From f9cc5accde1a4de5e0b077ee4e8a028778934989 Mon Sep 17 00:00:00 2001 From: zhuoda Date: Sat, 5 Nov 2022 22:40:22 +0800 Subject: [PATCH] v2.0 --- .gitignore | 13 +- README.md | 173 +- .../.gitignore | 8 +- smart-admin-api/pom.xml | 368 + smart-admin-api/sa-admin/pom.xml | 47 + .../sa/admin/SmartAdminApplication.java | 33 + .../sa/admin/common/AdminBaseController.java | 13 + .../admin/config/OperateLogAspectConfig.java | 34 + .../sa/admin/config/SecurityConfig.java | 40 + .../sa/admin/config/SecurityMethodConfig.java | 50 + .../sa/admin/constant/AdminCacheConst.java | 57 + .../sa/admin/constant/AdminRedisKeyConst.java | 17 + .../admin/constant/AdminSwaggerTagConst.java | 55 + .../sa/admin/listener/AdminStartupRunner.java | 40 + .../category/constant/CategoryTypeEnum.java | 36 + .../controller/CategoryController.java | 67 + .../business/category/dao/CategoryDao.java | 72 + .../category/domain/dto/CategoryBaseDTO.java | 44 + .../domain/dto/CategorySimpleDTO.java | 26 + .../domain/entity/CategoryEntity.java | 67 + .../category/domain/form/CategoryAddForm.java | 49 + .../domain/form/CategoryTreeQueryForm.java | 25 + .../domain/form/CategoryUpdateForm.java | 24 + .../category/domain/vo/CategoryTreeVO.java | 40 + .../category/domain/vo/CategoryVO.java | 51 + .../manager/CategoryCacheManager.java | 120 + .../service/CategoryQueryService.java | 214 + .../category/service/CategoryService.java | 220 + .../goods/constant/GoodsStatusEnum.java | 42 + .../goods/controller/GoodsController.java | 75 + .../module/business/goods/dao/GoodsDao.java | 41 + .../goods/domain/entity/GoodsEntity.java | 75 + .../goods/domain/form/GoodsAddForm.java | 57 + .../goods/domain/form/GoodsQueryForm.java | 46 + .../goods/domain/form/GoodsUpdateForm.java | 23 + .../business/goods/domain/vo/GoodsVO.java | 56 + .../business/goods/manager/GoodsManager.java | 20 + .../business/goods/service/GoodsService.java | 168 + .../business/oa/bank/BankController.java | 74 + .../module/business/oa/bank/BankDao.java | 61 + .../module/business/oa/bank/BankService.java | 162 + .../oa/bank/domain/BankCreateForm.java | 58 + .../business/oa/bank/domain/BankEntity.java | 95 + .../oa/bank/domain/BankQueryForm.java | 40 + .../oa/bank/domain/BankUpdateForm.java | 23 + .../business/oa/bank/domain/BankVO.java | 58 + .../oa/enterprise/EnterpriseController.java | 115 + .../enterprise/EnterpriseEmployeeManager.java | 19 + .../oa/enterprise/EnterpriseService.java | 252 + .../constant/EnterpriseTypeEnum.java | 40 + .../oa/enterprise/dao/EnterpriseDao.java | 72 + .../enterprise/dao/EnterpriseEmployeeDao.java | 88 + .../entity/EnterpriseEmployeeEntity.java | 51 + .../domain/entity/EnterpriseEntity.java | 153 + .../domain/form/EnterpriseCreateForm.java | 101 + .../domain/form/EnterpriseEmployeeForm.java | 29 + .../form/EnterpriseEmployeeQueryForm.java | 35 + .../domain/form/EnterpriseQueryForm.java | 38 + .../domain/form/EnterpriseUpdateForm.java | 23 + .../domain/vo/EnterpriseEmployeeVO.java | 47 + .../domain/vo/EnterpriseListVO.java | 20 + .../oa/enterprise/domain/vo/EnterpriseVO.java | 89 + .../oa/invoice/InvoiceController.java | 80 + .../business/oa/invoice/InvoiceDao.java | 61 + .../business/oa/invoice/InvoiceService.java | 158 + .../oa/invoice/domain/InvoiceAddForm.java | 59 + .../oa/invoice/domain/InvoiceEntity.java | 98 + .../oa/invoice/domain/InvoiceQueryForm.java | 40 + .../oa/invoice/domain/InvoiceUpdateForm.java | 23 + .../business/oa/invoice/domain/InvoiceVO.java | 58 + .../NoticeVisibleRangeDataTypeEnum.java | 30 + .../notice/controller/NoticeController.java | 138 + .../business/oa/notice/dao/NoticeDao.java | 144 + .../business/oa/notice/dao/NoticeTypeDao.java | 21 + .../oa/notice/domain/entity/NoticeEntity.java | 99 + .../domain/entity/NoticeTypeEntity.java | 41 + .../oa/notice/domain/form/NoticeAddForm.java | 78 + .../domain/form/NoticeEmployeeQueryForm.java | 35 + .../notice/domain/form/NoticeQueryForm.java | 48 + .../notice/domain/form/NoticeUpdateForm.java | 24 + .../form/NoticeViewRecordQueryForm.java | 32 + .../domain/form/NoticeVisibleRangeForm.java | 34 + .../oa/notice/domain/vo/NoticeDetailVO.java | 84 + .../oa/notice/domain/vo/NoticeEmployeeVO.java | 26 + .../oa/notice/domain/vo/NoticeTypeVO.java | 24 + .../notice/domain/vo/NoticeUpdateFormVO.java | 35 + .../oa/notice/domain/vo/NoticeVO.java | 75 + .../notice/domain/vo/NoticeViewRecordVO.java | 49 + .../domain/vo/NoticeVisibleRangeVO.java | 29 + .../oa/notice/manager/NoticeManager.java | 67 + .../notice/service/NoticeEmployeeService.java | 159 + .../oa/notice/service/NoticeService.java | 250 + .../oa/notice/service/NoticeTypeService.java | 87 + .../module/system/datascope}/DataScope.java | 29 +- .../system/datascope/DataScopeController.java | 41 + .../system/datascope/MyBatisPlugin.java | 80 +- .../datascope/constant/DataScopeTypeEnum.java | 29 +- .../constant/DataScopeViewTypeEnum.java | 53 + .../constant/DataScopeWhereInTypeEnum.java | 42 + .../domain}/DataScopeAndViewTypeVO.java | 15 +- .../datascope/domain}/DataScopeDTO.java | 15 +- .../datascope/domain/DataScopeSqlConfig.java | 41 + .../domain}/DataScopeViewTypeVO.java | 16 +- .../datascope/service/DataScopeService.java | 75 + .../service/DataScopeSqlConfigService.java | 83 +- .../service/DataScopeViewService.java | 79 +- .../strategy/DataScopePowerStrategy.java | 27 + .../controller/DepartmentController.java | 71 + .../system/department/dao/DepartmentDao.java | 40 + .../domain/entity/DepartmentEntity.java | 62 + .../domain/form/DepartmentAddForm.java | 26 +- .../domain/form/DepartmentUpdateForm.java | 24 + .../domain/vo/DepartmentEmployeeTreeVO.java | 27 + .../domain/vo/DepartmentTreeVO.java | 32 + .../department/domain/vo/DepartmentVO.java | 36 + .../manager/DepartmentCacheManager.java | 249 + .../department/manager/DepartmentManager.java | 21 + .../department/service/DepartmentService.java | 210 + .../controller/EmployeeController.java | 105 + .../system/employee/dao/EmployeeDao.java | 171 + .../domain/entity/EmployeeEntity.java | 81 + .../employee/domain/form/EmployeeAddForm.java | 56 + .../EmployeeBatchUpdateDepartmentForm.java | 31 + .../domain/form/EmployeeQueryForm.java | 40 + .../domain/form/EmployeeUpdateForm.java | 23 + .../form/EmployeeUpdatePasswordForm.java | 34 + .../domain/form/EmployeeUpdateRoleForm.java | 30 + .../system/employee/domain/vo/EmployeeVO.java | 58 + .../employee/manager/EmployeeManager.java | 82 + .../service/EmployeePermissionService.java | 81 + .../employee/service/EmployeeService.java | 384 + .../login/controller/LoginController.java | 90 + .../login/domain/LoginEmployeeDetail.java | 165 + .../module/system/login/domain/LoginForm.java | 41 + .../system/login/service/LoginService.java | 272 + .../menu/constant/MenuPermsTypeEnum.java | 46 + .../system/menu/constant/MenuTypeEnum.java | 48 + .../menu/controller/MenuController.java | 86 + .../admin/module/system/menu/dao/MenuDao.java | 105 + .../system/menu/domain/entity/MenuEntity.java | 139 + .../system/menu/domain/form/MenuAddForm.java | 20 + .../system/menu/domain/form/MenuBaseForm.java | 86 + .../domain/form/MenuPointsOperateForm.java | 43 + .../menu/domain/form/MenuUpdateForm.java | 26 + .../menu/domain/vo/MenuSimpleTreeVO.java | 37 + .../system/menu/domain/vo/MenuTreeVO.java | 22 + .../module/system/menu/domain/vo/MenuVO.java | 35 + .../system/menu/manager/MenuManager.java | 70 + .../system/menu/service/MenuService.java | 290 + .../role/controller/RoleController.java | 70 + .../controller/RoleDataScopeController.java | 50 + .../controller/RoleEmployeeController.java | 77 + .../role/controller/RoleMenuController.java | 47 + .../admin/module/system/role/dao/RoleDao.java | 29 + .../system/role/dao/RoleDataScopeDao.java | 46 + .../system/role/dao}/RoleEmployeeDao.java | 59 +- .../module/system/role/dao/RoleMenuDao.java | 54 + .../domain/entity/RoleDataScopeEntity.java | 53 + .../domain/entity/RoleEmployeeEntity.java | 41 + .../system/role/domain/entity/RoleEntity.java | 41 + .../role/domain/entity/RoleMenuEntity.java | 49 + .../system/role/domain/form/RoleAddForm.java | 13 +- .../domain/form/RoleDataScopeUpdateForm.java | 43 + .../domain/form/RoleEmployeeQueryForm.java | 24 + .../domain/form/RoleEmployeeUpdateForm.java | 18 +- .../role/domain/form/RoleMenuUpdateForm.java | 35 + .../role/domain/form/RoleQueryForm.java | 24 + .../role/domain/form/RoleUpdateForm.java | 27 + .../role/domain/vo/RoleDataScopeVO.java | 23 + .../system/role/domain/vo/RoleEmployeeVO.java | 22 + .../system/role/domain/vo/RoleMenuTreeVO.java | 29 + .../system/role/domain/vo/RoleSelectedVO.java | 20 + .../module/system/role/domain/vo}/RoleVO.java | 17 +- .../role/manager/RoleDataScopeManager.java | 20 + .../role/manager/RoleEmployeeManager.java | 37 + .../system/role/manager/RoleMenuManager.java | 40 + .../role/service/RoleDataScopeService.java | 67 + .../role/service/RoleEmployeeService.java | 153 + .../system/role/service/RoleMenuService.java | 130 + .../system/role/service/RoleService.java | 119 + .../system/support/AdminCacheController.java | 56 + .../support/AdminChangeLogController.java | 59 + .../system/support/AdminConfigController.java | 59 + .../system/support/AdminDictController.java | 79 + .../system/support/AdminFileController.java | 43 + .../support/AdminHeartBeatController.java | 41 + .../support/AdminHelpDocController.java | 108 + .../support/AdminLoginLogController.java | 42 + .../support/AdminOperateLogController.java | 46 + .../system/support/AdminReloadController.java | 54 + .../support/AdminSerialNumberController.java | 74 + .../src/main/resources/dev/application.yaml | 15 + .../src/main/resources/dev/log4j2.xml | 4 +- .../src/main/resources/dev/spy.properties | 18 + .../business/category/CategoryMapper.xml | 61 + .../mapper/business/goods/GoodsMapper.xml | 41 + .../mapper/business/notice/NoticeMapper.xml | 69 + .../mapper/business/oa/bank/BankMapper.xml | 58 + .../enterprise/EnterpriseEmployeeMapper.xml | 94 + .../oa/enterprise/EnterpriseMapper.xml | 59 + .../business/oa/invoice/InvoiceMapper.xml | 56 + .../mapper/business/oa/notice/NoticeDao.xml | 244 + .../system/department/DepartmentMapper.xml | 23 + .../mapper/system/employee/EmployeeMapper.xml | 200 + .../mapper/system/menu/MenuMapper.xml | 78 + .../system/role/RoleDataScopeMapper.xml | 16 +- .../mapper/system/role/RoleEmployeeMapper.xml | 134 + .../mapper/system/role/RoleMapper.xml | 15 + .../mapper/system/role/RoleMenuMapper.xml | 42 + .../src/main/resources/pre/application.yaml | 15 + .../src/main/resources/pre}/log4j2.xml | 4 +- .../src/main/resources/prod/application.yaml | 15 + .../src/main/resources/prod}/log4j2.xml | 4 +- .../src/main/resources/test/application.yaml | 15 + .../src/main/resources/test}/log4j2.xml | 6 +- .../src/main/resources/test/spy.properties | 18 + .../sa/admin/SmartAdminApplicationTest.java | 25 + .../sa-common}/pom.xml | 396 +- .../common/common/annoation}/NoNeedLogin.java | 16 +- .../sa/common/common/annoation/SaAuth.java | 22 + .../sa/common/common/code/ErrorCode.java | 52 + .../common/code/ErrorCodeRangeContainer.java | 119 + .../common/common/code/ErrorCodeRegister.java | 41 + .../common/common/code/SystemErrorCode.java | 36 + .../common/code/UnexpectedErrorCode.java | 36 + .../sa/common/common/code/UserErrorCode.java | 48 + .../common/constant/RequestHeaderConst.java | 18 + .../common/common/constant/StringConst.java | 44 + .../controller/SupportBaseController.java | 16 + .../common/common/domain/DataScopePlugin.java | 15 + .../sa/common/common/domain/PageParam.java | 58 + .../sa/common/common/domain/PageResult.java | 16 +- .../sa/common/common/domain/RequestUrlVO.java | 26 + .../sa/common/common/domain/RequestUser.java | 49 + .../sa/common/common/domain/ResponseDTO.java | 101 + .../common/domain/SystemEnvironment.java | 35 + .../sa/common/common/domain/ValidateData.java | 21 + .../common}/common/domain/ValidateList.java | 13 +- .../common/common/enumeration}/BaseEnum.java | 24 +- .../common/common/enumeration/GenderEnum.java | 37 + .../enumeration/SystemEnvironmentEnum.java | 50 + .../common/enumeration/UserTypeEnum.java | 37 + .../sa/common/common/excel/ExcelStyle.java | 185 + .../common/exception/BusinessException.java | 38 + .../interceptor/AbstractInterceptor.java | 148 + .../deserializer/DictValueVoDeserializer.java | 52 + .../deserializer/FileKeyVoDeserializer.java | 53 + .../deserializer}/LongJsonDeserializer.java | 11 +- .../BigDecimalNullZeroSerializer.java | 29 + .../serializer/DictValueVoSerializer.java | 52 + .../json/serializer/FileKeySerializer.java | 45 + .../json/serializer/FileKeyVoSerializer.java | 46 + .../json/serializer}/LongJsonSerializer.java | 13 +- .../security/AbstractSecurityConfig.java | 91 + .../SecurityAuthenticationFailHandler.java | 43 + .../common/security/SecurityMethodSource.java | 66 + .../SecurityPermissionCheckService.java | 74 + .../common/security/SecurityTokenFilter.java | 64 + .../common/swagger}/ApiModelPropertyEnum.java | 25 +- .../swagger/Swagger2MapperImplExtension.java | 91 + .../SwaggerApiModelPropertyEnumPlugin.java | 55 +- .../sa/common/common}/util/SmartBeanUtil.java | 41 +- .../common}/util/SmartBigDecimalUtil.java | 174 +- .../common}/util/SmartEasyPoiExcelUtil.java | 41 +- .../sa/common/common/util/SmartEnumUtil.java | 165 + .../sa/common/common/util/SmartPageUtil.java | 111 + .../common/common/util/SmartRequestUtil.java | 38 + .../common/common}/util/SmartStringUtil.java | 103 +- .../common}/util/SmartVerificationUtil.java | 27 +- .../validator/enumeration}/CheckEnum.java | 18 +- .../validator/enumeration}/EnumValidator.java | 14 +- .../lab1024/sa/common/config/AsyncConfig.java | 71 + .../sa/common/config/CorsFilterConfig.java | 45 + .../sa/common/config/DataSourceConfig.java | 99 +- .../lab1024/sa/common/config/DateConfig.java | 88 + .../sa/common/config/FileCloudConfig.java | 85 + .../sa/common/config/HeartBeatConfig.java | 37 + .../lab1024/sa/common/config/MvcConfig.java | 50 + .../sa/common/config/MybatisPlusConfig.java | 33 + .../sa/common/config/PostProcessorConfig.java | 56 + .../lab1024/sa/common/config/RedisConfig.java | 18 +- .../sa/common/config/ReloadConfig.java | 38 + .../sa/common/config/RepeatSubmitConfig.java | 40 + .../sa/common/config/RestTemplateConfig.java | 130 + .../sa/common/config/ScheduleConfig.java | 47 + .../sa/common/config/SwaggerConfig.java | 206 + .../config/SystemEnvironmentConfig.java | 49 + .../lab1024/sa/common/config/UrlConfig.java | 150 + .../sa/common/constant/CacheKeyConst.java | 14 + .../sa/common/constant/RedisKeyConst.java | 31 + .../sa/common/constant/ReloadConst.java | 18 + .../sa/common/constant/SwaggerTagConst.java | 49 + .../sa/common/constant/UrlPrefixConst.java | 18 + .../handler/GlobalExceptionHandler.java | 126 + .../listener/SmartApplicationListener.java | 54 + .../module/support/cache/CacheService.java | 78 + .../support/captcha/CaptchaController.java | 36 + .../support/captcha/CaptchaService.java | 115 + .../support/captcha/config/CaptchaColor.java | 17 +- .../support/captcha/config/CaptchaConfig.java | 33 +- .../support/captcha/config/CaptchaNoise.java | 28 +- .../captcha/config/CaptchaWordRenderer.java | 29 +- .../support/captcha/domain/CaptchaForm.java | 28 + .../support/captcha/domain/CaptchaVO.java | 29 + .../changelog/constant/ChangeLogTypeEnum.java | 28 + .../controller/ChangeLogController.java | 38 + .../support/changelog/dao/ChangeLogDao.java | 44 + .../domain/entity/ChangeLogEntity.java | 68 + .../domain/form/ChangeLogAddForm.java | 46 + .../domain/form/ChangeLogQueryForm.java | 42 + .../domain/form/ChangeLogUpdateForm.java | 50 + .../changelog/domain/vo/ChangeLogVO.java | 49 + .../changelog/manager/ChangeLogManager.java | 20 + .../changelog/service/ChangeLogService.java | 103 + .../constant/CodeDeleteEnum.java | 38 + .../constant/CodeFrontComponentEnum.java | 52 + .../constant/CodeGeneratorConstant.java | 30 + .../constant/CodeGeneratorPageTypeEnum.java | 38 + .../constant/CodeQueryFieldQueryTypeEnum.java | 43 + .../controller/CodeGeneratorController.java | 106 + .../dao/CodeGeneratorConfigDao.java | 20 + .../codegenerator/dao/CodeGeneratorDao.java | 45 + .../entity/CodeGeneratorConfigEntity.java | 74 + .../domain/form/CodeGeneratorConfigForm.java | 64 + .../domain/form/CodeGeneratorPreviewForm.java | 28 + .../domain/form/TableQueryForm.java | 23 + .../codegenerator/domain/model/CodeBasic.java | 55 + .../domain/model/CodeDelete.java | 40 + .../codegenerator/domain/model/CodeField.java | 59 + .../domain/model/CodeInsertAndUpdate.java | 42 + .../model/CodeInsertAndUpdateField.java | 46 + .../domain/model/CodeQueryField.java | 47 + .../domain/model/CodeTableField.java | 46 + .../domain/vo/TableColumnVO.java | 44 + .../domain/vo/TableConfigVO.java | 40 + .../codegenerator/domain/vo/TableVO.java | 37 + .../service/CodeGeneratorService.java | 223 + .../service/CodeGeneratorTemplateService.java | 238 + .../CodeGenerateBaseVariableService.java | 162 + .../backend/ControllerVariableService.java | 78 + .../variable/backend/DaoVariableService.java | 59 + .../backend/ManagerVariableService.java | 55 + .../backend/ServiceVariableService.java | 62 + .../domain/AddFormVariableService.java | 131 + .../domain/DeleteFormVariableService.java | 130 + .../backend/domain/EntityVariableService.java | 73 + .../backend/domain/MapperVariableService.java | 93 + .../domain/QueryFormVariableService.java | 128 + .../domain/UpdateFormVariableService.java | 145 + .../backend/domain/VOVariableService.java | 115 + .../variable/front/ApiVariableService.java | 29 + .../variable/front/ConstVariableService.java | 45 + .../variable/front/FormVariableService.java | 82 + .../variable/front/ListVariableService.java | 57 + .../codegenerator/util/CodeGeneratorTool.java | 59 + .../support/config/ConfigController.java | 36 + .../module/support/config/ConfigDao.java | 41 + .../module/support/config/ConfigKeyEnum.java | 35 + .../module/support/config/ConfigService.java | 205 + .../support/config/domain/ConfigAddForm.java | 24 +- .../support/config/domain/ConfigEntity.java | 49 + .../config/domain/ConfigQueryForm.java | 23 + .../config/domain/ConfigUpdateForm.java | 23 + .../support/config/domain/ConfigVO.java | 39 + .../annoation/DataTracerFieldBigDecimal.java | 21 + .../annoation/DataTracerFieldDict.java | 22 + .../annoation/DataTracerFieldEnum.java | 25 + .../annoation/DataTracerFieldLabel.java | 26 + .../annoation/DataTracerFieldSql.java | 40 + .../datatracer/constant/DataTracerConst.java | 27 + .../constant/DataTracerTypeEnum.java | 32 + .../controller/DataTracerController.java | 40 + .../support/datatracer/dao/DataTracerDao.java | 42 + .../domain/bo/DataTracerContentBO.java | 39 + .../domain/entity/DataTracerEntity.java | 90 + .../domain/form/DataTracerForm.java | 54 + .../domain/form/DataTracerQueryForm.java | 32 + .../datatracer/domain/vo/DataTracerVO.java | 62 + .../datatracer/manager/DataTracerManger.java | 19 + .../DataTracerChangeContentService.java | 486 + .../datatracer/service/DataTracerService.java | 224 + .../dict/controller/DictController.java | 63 + .../module/support/dict/dao/DictKeyDao.java | 58 + .../module/support/dict/dao/DictValueDao.java | 69 + .../dict/domain/entity/DictKeyEntity.java | 54 + .../dict/domain/entity/DictValueEntity.java | 58 + .../dict/domain/form/DictKeyAddForm.java | 34 + .../dict/domain/form/DictKeyQueryForm.java | 24 + .../dict/domain/form/DictKeyUpdateForm.java | 23 + .../dict/domain/form/DictValueAddForm.java | 44 + .../dict/domain/form/DictValueQueryForm.java | 30 + .../dict/domain/form/DictValueUpdateForm.java | 23 + .../support/dict/domain/vo/DictKeyVO.java | 29 + .../support/dict/domain/vo/DictValueVO.java | 35 + .../dict/service/DictCacheService.java | 133 + .../support/dict/service/DictService.java | 196 + .../controller/FeedbackController.java | 53 + .../support/feedback/dao/FeedbackDao.java | 31 + .../feedback/domain/FeedbackAddForm.java | 33 + .../feedback/domain/FeedbackEntity.java | 62 + .../feedback/domain/FeedbackQueryForm.java | 31 + .../support/feedback/domain/FeedbackVO.java | 51 + .../feedback/service/FeedbackService.java | 62 + .../file/constant/FileFolderTypeEnum.java | 49 + .../file/controller/FileController.java | 72 + .../module/support/file/dao/FileDao.java | 44 + .../file/domain/entity/FileEntity.java | 73 + .../file/domain/form/FileQueryForm.java | 47 + .../file/domain/form/FileUrlUploadForm.java | 31 + .../file/domain/vo/FileDownloadVO.java | 28 + .../file/domain/vo/FileMetadataVO.java | 31 + .../support/file/domain/vo/FileUploadVO.java | 35 + .../module/support/file/domain/vo/FileVO.java | 56 + .../support/file/service/FileService.java | 272 + .../service/FileStorageCloudServiceImpl.java | 215 + .../service/FileStorageLocalServiceImpl.java | 149 + .../file/service/IFileStorageService.java | 209 + .../support/heartbeat/HeartBeatRecordDao.java | 51 + .../heartbeat/HeartBeatRecordHandler.java | 42 + .../support/heartbeat/HeartBeatService.java | 38 + .../heartbeat/core/HeartBeatManager.java | 59 + .../heartbeat/core/HeartBeatRecord.java | 41 + .../heartbeat/core/HeartBeatRunnable.java | 71 + .../core/IHeartBeatRecordHandler.java | 20 + .../domain/HeartBeatRecordEntity.java | 53 + .../domain/HeartBeatRecordQueryForm.java | 30 + .../heartbeat/domain}/HeartBeatRecordVO.java | 20 +- .../helpdoc/controller/HelpDocController.java | 77 + .../helpdoc/dao/HelpDocCatalogDao.java | 21 + .../support/helpdoc/dao/HelpDocDao.java | 137 + .../domain/entity/HelpDocCatalogEntity.java | 53 + .../helpdoc/domain/entity/HelpDocEntity.java | 77 + .../helpdoc/domain/form/HelpDocAddForm.java | 57 + .../domain/form/HelpDocCatalogAddForm.java | 31 + .../domain/form/HelpDocCatalogUpdateForm.java | 23 + .../helpdoc/domain/form/HelpDocQueryForm.java | 33 + .../domain/form/HelpDocRelationForm.java | 28 + .../domain/form/HelpDocUpdateForm.java | 24 + .../form/HelpDocViewRecordQueryForm.java | 32 + .../helpdoc/domain/vo/HelpDocCatalogVO.java | 30 + .../helpdoc/domain/vo/HelpDocDetailVO.java | 65 + .../helpdoc/domain/vo/HelpDocRecordVO.java | 49 + .../helpdoc/domain/vo/HelpDocRelationVO.java | 23 + .../support/helpdoc/domain/vo/HelpDocVO.java | 50 + .../domain/vo/HelpDocViewRecordVO.java | 46 + .../helpdoc/manager/HelpDocManager.java | 60 + .../service/HelpDocCatalogService.java | 115 + .../helpdoc/service/HelpDocService.java | 117 + .../helpdoc/service/HelpDocUserService.java | 85 + .../module/support/jwe/DecryptData.java | 18 + .../common/module/support/jwe/JweAspect.java | 128 + .../common/module/support/jwe/JweDecrypt.java | 20 + .../common/module/support/jwe/JweEncrypt.java | 20 + .../common/module/support/jwe/JweUserKey.java | 32 + .../module/support/loginlog/LoginLogDao.java | 46 + .../support/loginlog/LoginLogResultEnum.java | 37 + .../support/loginlog/LoginLogService.java | 67 + .../loginlog/domain/LoginLogEntity.java | 67 + .../loginlog/domain/LoginLogQueryForm.java | 31 + .../support/loginlog/domain/LoginLogVO.java | 48 + .../support/operatelog/OperateLogDao.java | 49 + .../support/operatelog/OperateLogService.java | 57 + .../operatelog/annoation/OperateLog.java | 19 + .../operatelog/core/OperateLogAspect.java | 276 + .../operatelog/core/OperateLogConfig.java | 38 + .../operatelog/domain/OperateLogEntity.java | 106 + .../domain/OperateLogQueryForm.java | 33 + .../operatelog/domain/OperateLogVO.java | 47 +- .../module/support/redis/RedisService.java | 222 + .../module/support/reload/ReloadCommand.java | 56 + .../module/support/reload/ReloadService.java | 68 + .../core/AbstractSmartReloadCommand.java | 96 + .../reload/core/SmartReloadManager.java | 97 + .../reload/core/annoation}/SmartReload.java | 8 +- .../reload/core/domain/SmartReloadItem.java | 32 + .../reload/core/domain/SmartReloadObject.java | 32 + .../reload/core/domain/SmartReloadResult.java | 43 + .../core/thread/SmartReloadRunnable.java | 120 + .../support/reload/dao/ReloadItemDao.java | 25 + .../support/reload/dao/ReloadResultDao.java | 26 + .../support/reload/domain/ReloadForm.java | 20 +- .../reload/domain}/ReloadItemEntity.java | 16 +- .../support/reload/domain/ReloadItemVO.java | 36 + .../reload/domain}/ReloadResultEntity.java | 15 +- .../support/reload/domain/ReloadResultVO.java | 34 + .../repeatsubmit/RepeatSubmitAspect.java | 82 + .../repeatsubmit/annoation/RepeatSubmit.java | 33 + .../ticket/AbstractRepeatSubmitTicket.java | 56 + .../ticket/RepeatSubmitCaffeineTicket.java | 50 + .../ticket/RepeatSubmitRedisTicket.java | 48 + .../constant/SerialNumberIdEnum.java | 42 + .../constant/SerialNumberRuleTypeEnum.java | 44 + .../serialnumber/dao/SerialNumberDao.java | 41 + .../dao/SerialNumberRecordDao.java | 55 + .../domain/SerialNumberEntity.java | 79 + .../domain/SerialNumberGenerateForm.java | 28 + .../domain/SerialNumberGenerateResultBO.java | 52 + .../domain/SerialNumberInfoBO.java | 97 + .../domain/SerialNumberLastGenerateBO.java | 41 + .../domain/SerialNumberRecordEntity.java | 57 + .../domain/SerialNumberRecordQueryForm.java | 24 + .../service/SerialNumberBaseService.java | 252 + .../service/SerialNumberRecordService.java | 39 + .../service/SerialNumberService.java | 36 + .../impl/SerialNumberInternService.java | 78 + .../impl/SerialNumberMysqlService.java | 61 + .../impl/SerialNumberRedisService.java | 105 + .../support/table/TableColumnController.java | 51 + .../module/support/table/TableColumnDao.java | 23 + .../support/table/TableColumnService.java | 72 + .../table/domain/TableColumnEntity.java | 49 + .../table/domain/TableColumnItemForm.java | 37 + .../table/domain/TableColumnUpdateForm.java | 27 + .../common/module/support/token/JwtConst.java | 38 + .../module/support/token/LoginDeviceEnum.java | 43 + .../module/support/token/TokenService.java | 220 + .../main/resources/META-INF/spring.factories | 2 + .../sa-common}/src/main/resources/banner.txt | 13 +- .../java/constant/enum.java.vm | 24 + .../java/controller/Controller.java.vm | 68 + .../java/dao/Dao.java.vm | 51 + .../java/domain/entity/Entity.java.vm | 32 + .../java/domain/form/AddForm.java.vm | 30 + .../java/domain/form/QueryForm.java.vm | 38 + .../java/domain/form/UpdateForm.java.vm | 30 + .../java/domain/vo/VO.java.vm | 32 + .../java/manager/Manager.java.vm | 21 + .../java/mapper/Mapper.xml.vm | 74 + .../java/service/Service.java.vm | 108 + .../code-generator-template/js/api.js.vm | 78 + .../code-generator-template/js/const.js.vm | 23 + .../code-generator-template/js/form.vue.vm | 181 + .../code-generator-template/js/list.vue.vm | 317 + .../code-generator-template/tools.xml | 7 + .../src/main/resources/dev/sa-common.yaml | 134 + .../mapper/support/ChangeLogMapper.xml | 47 + .../mapper/support/CodeGeneratorMapper.xml | 36 + .../resources/mapper/support/ConfigMapper.xml | 22 + .../mapper/support/DataTracerMapper.xml | 31 + .../mapper/support/DictKeyMapper.xml | 37 + .../mapper/support/DictValueMapper.xml | 44 + .../mapper/support/FeedbackMapper.xml | 26 + .../resources/mapper/support/FileMapper.xml | 49 + .../mapper/support/HeartBeatRecordMapper.xml | 37 + .../resources/mapper/support/HelpDocDao.xml | 130 + .../mapper/support/LoginLogMapper.xml | 37 + .../mapper/support/OperateLogMapper.xml | 37 + .../mapper/support/ReloadItemMapper.xml | 10 + .../mapper/support/ReloadResultMapper.xml | 10 + .../mapper/support/SerialNumberMapper.xml | 21 + .../support/SerialNumberRecordMapper.xml | 32 + .../mapper/support/TableColumnMapper.xml | 18 + .../src/main/resources/pre/sa-common.yaml | 134 + .../src/main/resources/prod/sa-common.yaml | 134 + .../src/main/resources/test/sa-common.yaml | 134 + smart-admin-h5/.browserslistrc | 2 - smart-admin-h5/.editorconfig | 15 - smart-admin-h5/.env.development | 3 - smart-admin-h5/.env.local | 3 - smart-admin-h5/.env.pre | 3 - smart-admin-h5/.env.prod | 3 - smart-admin-h5/.env.sit | 3 - smart-admin-h5/.eslintignore | 7 - smart-admin-h5/.eslintrc.js | 232 - smart-admin-h5/.gitignore | 22 - smart-admin-h5/.postcssrc.js | 11 - smart-admin-h5/.prettierrc.js | 31 - smart-admin-h5/.sentryclirc | 7 - smart-admin-h5/README.md | 4 - smart-admin-h5/babel.config.js | 16 - smart-admin-h5/package.json | 58 - smart-admin-h5/public/index.html | 47 - smart-admin-h5/src/App.vue | 16 - smart-admin-h5/src/api/employee.js | 43 - smart-admin-h5/src/api/file.js | 14 - smart-admin-h5/src/api/login.js | 10 - smart-admin-h5/src/api/system-config.js | 31 - smart-admin-h5/src/api/user.js | 7 - smart-admin-h5/src/assets/css/index.scss | 5 - smart-admin-h5/src/assets/logo.png | Bin 6849 -> 0 bytes .../employee/department-employee-selector.vue | 121 - .../select-picker/SmartEnumSelectPicker.vue | 61 - .../form/select-picker/SmartSelectPicker | 59 - .../src/components/mixin/session-mixin.js | 25 - .../src/components/van-bar/BackNavBar.vue | 24 - .../src/components/van-bar/RouterNavBar.vue | 27 - smart-admin-h5/src/config/index.js | 46 - smart-admin-h5/src/constants/area.js | 4047 ---- .../src/constants/erp/contact-company.js | 165 - smart-admin-h5/src/constants/erp/index.js | 6 - smart-admin-h5/src/constants/file.js | 92 - smart-admin-h5/src/constants/index.js | 7 - smart-admin-h5/src/constants/school.js | 71 - smart-admin-h5/src/filters/filter.js | 298 - smart-admin-h5/src/filters/index.js | 5 - smart-admin-h5/src/lib/cookie.js | 21 - smart-admin-h5/src/lib/erp-http.js | 65 - smart-admin-h5/src/lib/http.js | 65 - smart-admin-h5/src/lib/local.js | 8 - smart-admin-h5/src/lib/menu-func.js | 276 - smart-admin-h5/src/lib/printPlugs.js | 133 - smart-admin-h5/src/lib/render-dom.js | 10 - smart-admin-h5/src/lib/smart-sentry.js | 21 - smart-admin-h5/src/lib/util.js | 515 - smart-admin-h5/src/lib/watermark.js | 49 - smart-admin-h5/src/main.js | 62 - smart-admin-h5/src/plugins/smart-sentry.js | 17 - smart-admin-h5/src/plugins/smart.js | 24 - smart-admin-h5/src/plugins/vant.js | 8 - smart-admin-h5/src/router/dashboard/index.js | 42 - smart-admin-h5/src/router/develop/develop.js | 21 - smart-admin-h5/src/router/error/error.js | 26 - smart-admin-h5/src/router/index.js | 150 - smart-admin-h5/src/router/login/login.js | 15 - smart-admin-h5/src/router/router-const.js | 23 - smart-admin-h5/src/router/routers.js | 32 - smart-admin-h5/src/router/user/user.js | 21 - smart-admin-h5/src/store/index.js | 23 - smart-admin-h5/src/store/module/app.js | 32 - smart-admin-h5/src/store/module/user.js | 41 - smart-admin-h5/src/themes/index.scss | 6 - smart-admin-h5/src/utils/index.js | 110 - smart-admin-h5/src/utils/request.js | 58 - smart-admin-h5/src/utils/validate.js | 20 - .../src/views/dashboard/dashboard.vue | 99 - smart-admin-h5/src/views/develop/config.vue | 47 - smart-admin-h5/src/views/error/404.vue | 23 - smart-admin-h5/src/views/login/login.vue | 68 - .../src/views/user/change-password.vue | 76 - smart-admin-h5/src/views/user/index.vue | 79 - smart-admin-h5/vue.config.js | 200 - smart-admin-service/README.md | 17 - smart-admin-service/pom.xml | 349 - .../smart-admin-api/doc/readme.txt | 15 - .../smartadmin/SmartAdminApplication.java | 29 - .../common/anno/NoValidPrivilege.java | 20 - .../smartadmin/common/anno/OperateLog.java | 20 - .../common/constant/CommentSortTypeEnum.java | 57 - .../smartadmin/common/constant/JudgeEnum.java | 52 - .../common/constant/ResponseCodeConst.java | 181 - .../common/controller/BaseController.java | 42 - .../smartadmin/common/domain/BaseEntity.java | 39 - .../smartadmin/common/domain/ITask.java | 16 - .../common/domain/OrderItemDTO.java | 16 - .../common/domain/PageParamDTO.java | 33 - .../smartadmin/common/domain/ResponseDTO.java | 132 - .../exception/SmartBusinessException.java | 33 - .../exception/SmartResponseCodeException.java | 24 - .../heartbeat/AbstractHeartBeatCommand.java | 90 - .../common/heartbeat/HeartBeatConfig.java | 29 - .../common/heartbeat/HeartBeatLogger.java | 20 - .../HeartBeatRecordCommendInterface.java | 17 - .../common/heartbeat/HeartBeatRecordDTO.java | 37 - .../heartbeat/HeatBeatRecordHelper.java | 45 - .../smartadmin/common/heartbeat/IpUtil.java | 81 - .../common/heartbeat/StringUtil.java | 60 - .../common/reload/SmartReloadManager.java | 134 - .../common/reload/SmartReloadScheduler.java | 87 - .../abstracts/AbstractSmartReloadCommand.java | 66 - .../AbstractSmartReloadCommand4Spring.java | 67 - .../domain/AbstractSmartReloadObject.java | 31 - .../reload/domain/AnnotationReloadObject.java | 44 - .../reload/domain/InterfaceReloadObject.java | 37 - .../reload/domain/entity/ReloadItem.java | 55 - .../domain/entity/SmartReloadResult.java | 102 - .../SmartReloadCommandInterface.java | 38 - .../interfaces/SmartReloadThreadLogger.java | 12 - .../reload/interfaces/SmartReloadable.java | 19 - .../bigdecimal/BigDecimalValidator.java | 73 - .../validator/bigdecimal/CheckBigDecimal.java | 53 - .../bigdecimal/ComparisonSymbolEnum.java | 40 - .../config/SmartAdminWebAppConfig.java | 25 - .../config/SmartHeartBeatConfig.java | 33 - .../config/SmartMybatisPlusConfig.java | 27 - .../smartadmin/config/SmartReloadConfig.java | 45 - .../config/SmartRestTemplateConfig.java | 109 - .../SmartSwaggerApiModelEnumConfig.java | 29 - .../SmartSwaggerDynamicGroupConfig.java | 236 - .../config/SmartWebSocketConfig.java | 25 - .../config/SystemEnvironmentCondition.java | 22 - .../smartadmin/constant/CommonConst.java | 51 - .../constant/SmartReloadTagConst.java | 16 - .../smartadmin/constant/SwaggerTagConst.java | 69 - .../constant/SystemEnvironmentEnum.java | 67 - .../handler/SmartGlobalExceptionHandler.java | 73 - .../handler/SmartOperateLogAspect.java | 167 - .../SmartAuthenticationInterceptor.java | 158 - .../listener/SmartAdminStartupRunner.java | 22 - .../business/email/EmailController.java | 81 - .../module/business/email/EmailDao.java | 47 - .../business/email/EmailSendStatusEnum.java | 37 - .../module/business/email/EmailService.java | 122 - .../email/domain/dto/EmailConfigDTO.java | 30 - .../business/email/domain/dto/EmailDTO.java | 44 - .../email/domain/dto/EmailQueryDTO.java | 35 - .../business/email/domain/dto/EmailVO.java | 45 - .../email/domain/entity/EmailEntity.java | 40 - .../module/business/log/LogService.java | 75 - .../OrderOperateLogController.java | 44 - .../orderoperatelog/OrderOperateLogDao.java | 30 - .../OrderOperateLogService.java | 64 - .../OrderOperateLogDefaultEmpEnum.java | 37 - .../OrderOperateLogOperateTypeConst.java | 30 - .../OrderOperateLogOrderTypeEnum.java | 51 - .../domain/dto/OrderOperateLogSaveDTO.java | 80 - .../domain/dto/SupplierOrderOperateVO.java | 44 - .../domain/entity/OrderOperateLogEntity.java | 58 - .../domain/vo/OrderOperateLogVO.java | 69 - .../userloginlog/UserLoginLogController.java | 54 - .../log/userloginlog/UserLoginLogDao.java | 47 - .../log/userloginlog/UserLoginLogService.java | 82 - .../userloginlog/domain/UserLoginLogDTO.java | 53 - .../domain/UserLoginLogEntity.java | 60 - .../domain/UserLoginLogQueryDTO.java | 31 - .../UserOperateLogController.java | 50 - .../log/useroperatelog/UserOperateLogDao.java | 47 - .../useroperatelog/UserOperateLogService.java | 91 - .../domain/UserOperateLogEntity.java | 74 - .../domain/UserOperateLogQueryDTO.java | 34 - .../business/notice/NoticeController.java | 96 - .../module/business/notice/NoticeManage.java | 97 - .../module/business/notice/NoticeService.java | 235 - .../module/business/notice/dao/NoticeDao.java | 103 - .../notice/dao/NoticeReceiveRecordDao.java | 48 - .../notice/domain/dto/NoticeAddDTO.java | 28 - .../notice/domain/dto/NoticeDetailVO.java | 30 - .../notice/domain/dto/NoticeQueryDTO.java | 34 - .../notice/domain/dto/NoticeReadCountDTO.java | 26 - .../notice/domain/dto/NoticeReceiveDTO.java | 43 - .../domain/dto/NoticeReceiveQueryDTO.java | 25 - .../notice/domain/dto/NoticeUpdateDTO.java | 21 - .../business/notice/domain/dto/NoticeVO.java | 42 - .../notice/domain/entity/NoticeEntity.java | 45 - .../entity/NoticeReceiveRecordEntity.java | 33 - .../peony/controller/PeonyController.java | 88 - .../module/business/peony/dao/PeonyDao.java | 64 - .../peony/domain/dto/PeonyAddDTO.java | 41 - .../peony/domain/dto/PeonyQueryDTO.java | 44 - .../peony/domain/dto/PeonyUpdateDTO.java | 20 - .../peony/domain/entity/PeonyEntity.java | 44 - .../peony/domain/vo/PeonyExcelVO.java | 42 - .../business/peony/domain/vo/PeonyVO.java | 45 - .../business/peony/service/PeonyService.java | 108 - .../constant/SqlOperateTypeEnum.java | 34 - .../support/codegenerator/dao/TableDao.java | 40 - .../domain/CodeGeneratorDTO.java | 56 - .../domain/CodeGeneratorQueryColumnDTO.java | 30 - .../codegenerator/domain/ColumnVO.java | 36 - .../codegenerator/domain/QueryFieldVO.java | 30 - .../service/CodeGeneratorComponent.java | 92 - .../service/CodeGeneratorService.java | 336 - .../module/support/file/FileController.java | 93 - .../module/support/file/FileDao.java | 72 - .../file/constant/FileModuleTypeEnum.java | 47 - .../file/constant/FileResponseCodeConst.java | 37 - .../file/constant/FileServiceNameConst.java | 24 - .../file/constant/FileServiceTypeEnum.java | 52 - .../support/file/domain/dto/FileAddDTO.java | 39 - .../support/file/domain/dto/FileDTO.java | 58 - .../support/file/domain/dto/FileQueryDTO.java | 33 - .../support/file/domain/dto/OSSConfig.java | 35 - .../file/domain/entity/FileEntity.java | 58 - .../module/support/file/domain/vo/FileVO.java | 58 - .../support/file/domain/vo/UploadVO.java | 27 - .../support/file/service/FileService.java | 198 - .../file/service/FileServiceAliYun.java | 182 - .../file/service/FileServiceLocal.java | 123 - .../file/service/FileServiceQiNiuYun.java | 175 - .../support/file/service/IFileService.java | 152 - .../heartbeat/HeartBeatController.java | 32 - .../support/heartbeat/HeartBeatRecordDao.java | 52 - .../heartbeat/HeartBeatRecordEntity.java | 42 - .../support/heartbeat/HeartBeatService.java | 90 - .../support/idgenerator/IdGeneratorDao.java | 36 - .../idgenerator/IdGeneratorManager.java | 66 - .../idgenerator/IdGeneratorService.java | 140 - .../idgenerator/constant/IdGeneratorEnum.java | 45 - .../constant/IdGeneratorRuleTypeEnum.java | 40 - .../idgenerator/domain/IdGeneratorEntity.java | 45 - .../domain/IdGeneratorLastNumberDTO.java | 38 - .../idgenerator/domain/IdGeneratorPOJO.java | 71 - .../domain/IdGeneratorRecordDTO.java | 22 - .../support/quartz/constant/QuartzConst.java | 17 - .../quartz/constant/TaskResultEnum.java | 47 - .../quartz/constant/TaskStatusEnum.java | 47 - .../quartz/controller/QuartzController.java | 81 - .../support/quartz/dao/QuartzTaskDao.java | 42 - .../support/quartz/dao/QuartzTaskLogDao.java | 35 - .../quartz/domain/dto/QuartzLogQueryDTO.java | 25 - .../quartz/domain/dto/QuartzQueryDTO.java | 16 - .../quartz/domain/dto/QuartzTaskDTO.java | 45 - .../quartz/domain/dto/QuartzTaskLogVO.java | 49 - .../quartz/domain/dto/QuartzTaskVO.java | 45 - .../domain/entity/QuartzTaskEntity.java | 50 - .../domain/entity/QuartzTaskLogEntity.java | 50 - .../support/quartz/service/QuartzTask.java | 85 - .../quartz/service/QuartzTaskLogService.java | 28 - .../quartz/service/QuartzTaskService.java | 349 - .../support/quartz/task/test/Example.java | 28 - .../smartreload/SmartReloadCommand.java | 52 - .../smartreload/SmartReloadController.java | 52 - .../smartreload/SmartReloadService.java | 103 - .../smartreload/dao/ReloadItemDao.java | 15 - .../smartreload/dao/ReloadResultDao.java | 23 - .../smartreload/domain/dto/ReloadItemVO.java | 46 - .../domain/dto/ReloadResultVO.java | 45 - .../support/websocket/MessageTypeEnum.java | 44 - .../support/websocket/WebSocketServer.java | 199 - .../websocket/domain/MessageCommonDTO.java | 29 - .../support/websocket/domain/MessageDTO.java | 41 - .../domain/WebSocketHeartBeatDTO.java | 23 - .../system/datascope/DataScopeController.java | 59 - .../system/datascope/DataScopeRoleDao.java | 52 - .../constant/DataScopeViewTypeEnum.java | 54 - .../constant/DataScopeWhereInTypeEnum.java | 42 - .../domain/dto/DataScopeBatchSetDTO.java | 28 - .../domain/dto/DataScopeBatchSetRoleDTO.java | 30 - .../domain/dto/DataScopeSelectVO.java | 24 - .../domain/dto/DataScopeSqlConfigDTO.java | 40 - .../domain/entity/DataScopeRoleEntity.java | 33 - .../datascope/service/DataScopeService.java | 118 - .../strategy/DataScopePowerStrategy.java | 24 - .../department/DepartmentController.java | 99 - .../system/department/DepartmentDao.java | 47 - .../DepartmentResponseCodeConst.java | 39 - .../system/department/DepartmentService.java | 285 - .../department/DepartmentTreeService.java | 99 - .../domain/dto/DepartmentUpdateDTO.java | 25 - .../department/domain/dto/DepartmentVO.java | 58 - .../domain/entity/DepartmentEntity.java | 48 - .../system/employee/EmployeeController.java | 103 - .../module/system/employee/EmployeeDao.java | 138 - .../system/employee/EmployeeService.java | 369 - .../constant/EmployeeResponseCodeConst.java | 61 - .../employee/constant/EmployeeStatusEnum.java | 56 - .../system/employee/domain/bo/EmployeeBO.java | 73 - .../employee/domain/dto/EmployeeAddDTO.java | 63 - .../employee/domain/dto/EmployeeBaseDTO.java | 52 - .../dto/EmployeeBatchUpdateStatusDTO.java | 26 - .../employee/domain/dto/EmployeeDTO.java | 73 - .../domain/dto/EmployeeLoginFormDTO.java | 31 - .../employee/domain/dto/EmployeeQueryDTO.java | 39 - .../domain/dto/EmployeeQueryExportDTO.java | 42 - .../domain/dto/EmployeeUpdateDTO.java | 28 - .../domain/dto/EmployeeUpdatePwdDTO.java | 25 - .../domain/dto/EmployeeUpdateRolesDTO.java | 29 - .../domain/entity/EmployeeEntity.java | 91 - .../system/employee/domain/vo/EmployeeVO.java | 72 - .../module/system/login/LoginController.java | 71 - .../system/login/LoginResponseCodeConst.java | 21 - .../module/system/login/LoginService.java | 215 - .../system/login/LoginTokenService.java | 118 - .../module/system/login/domain/KaptchaVO.java | 28 - .../system/login/domain/LoginCacheDTO.java | 28 - .../system/login/domain/LoginDetailVO.java | 68 - .../login/domain/LoginPrivilegeDTO.java | 33 - .../system/login/domain/RequestTokenBO.java | 26 - .../system/position/PositionController.java | 59 - .../module/system/position/PositionDao.java | 63 - .../position/PositionResponseCodeConst.java | 16 - .../system/position/PositionService.java | 124 - .../position/domain/dto/PositionAddDTO.java | 28 - .../position/domain/dto/PositionQueryDTO.java | 18 - .../domain/dto/PositionRelationAddDTO.java | 32 - .../domain/dto/PositionRelationQueryDTO.java | 20 - .../domain/dto/PositionRelationResultDTO.java | 40 - .../position/domain/dto/PositionResultVO.java | 41 - .../domain/dto/PositionUpdateDTO.java | 16 - .../domain/entity/PositionEntity.java | 26 - .../domain/entity/PositionRelationEntity.java | 26 - .../constant/PrivilegeResponseCodeConst.java | 29 - .../privilege/constant/PrivilegeTypeEnum.java | 49 - .../controller/PrivilegeController.java | 75 - .../system/privilege/dao/PrivilegeDao.java | 94 - .../domain/dto/PrivilegeFunctionDTO.java | 40 - .../domain/dto/PrivilegeFunctionVO.java | 40 - .../domain/dto/PrivilegeMenuDTO.java | 45 - .../privilege/domain/dto/PrivilegeMenuVO.java | 35 - .../domain/dto/PrivilegeRequestUrlVO.java | 27 - .../domain/entity/PrivilegeEntity.java | 57 - .../service/PrivilegeEmployeeService.java | 199 - .../service/PrivilegeRequestUrlService.java | 117 - .../privilege/service/PrivilegeService.java | 285 - .../system/role/basic/RoleController.java | 60 - .../module/system/role/basic/RoleDao.java | 26 - .../role/basic/RoleResponseCodeConst.java | 24 - .../module/system/role/basic/RoleService.java | 114 - .../role/basic/domain/dto/RoleQueryDTO.java | 25 - .../role/basic/domain/dto/RoleSelectedVO.java | 21 - .../role/basic/domain/dto/RoleUpdateDTO.java | 24 - .../role/basic/domain/entity/RoleEntity.java | 25 - .../roleemployee/RoleEmployeeController.java | 73 - .../roleemployee/RoleEmployeeService.java | 132 - .../roleemployee/domain/RoleEmployeeDTO.java | 21 - .../domain/RoleEmployeeEntity.java | 24 - .../RolePrivilegeController.java | 45 - .../role/roleprivilege/RolePrivilegeDao.java | 58 - .../roleprivilege/RolePrivilegeService.java | 129 - .../domain/dto/RolePrivilegeDTO.java | 35 - .../domain/dto/RolePrivilegeSimpleDTO.java | 43 - .../domain/dto/RolePrivilegeTreeVO.java | 19 - .../domain/entity/RolePrivilegeEntity.java | 32 - .../systemconfig/SystemConfigController.java | 70 - .../system/systemconfig/SystemConfigDao.java | 62 - .../systemconfig/SystemConfigService.java | 262 - .../constant/SystemConfigDataType.java | 67 - .../constant/SystemConfigEnum.java | 68 - .../SystemConfigResponseCodeConst.java | 29 - .../domain/dto/SystemConfigDTO.java | 50 - .../domain/dto/SystemConfigQueryDTO.java | 29 - .../domain/dto/SystemConfigUpdateDTO.java | 25 - .../domain/dto/SystemConfigVO.java | 48 - .../domain/entity/SystemConfigEntity.java | 51 - .../third/SmartApplicationContext.java | 80 - .../smartadmin/third/SmartRedisService.java | 622 - .../smartadmin/util/SmartBaseEnumUtil.java | 85 - .../smartadmin/util/SmartDateUtil.java | 521 - .../smartadmin/util/SmartDigestUtil.java | 17 - .../smartadmin/util/SmartFileUtil.java | 91 - .../smartadmin/util/SmartHttpUtil.java | 151 - .../lab1024/smartadmin/util/SmartIPUtil.java | 159 - .../smartadmin/util/SmartPageUtil.java | 97 - .../smartadmin/util/SmartQuartzUtil.java | 43 - .../util/SmartRequestTokenUtil.java | 51 - .../smartadmin/util/SmartSendMailUtil.java | 243 - .../smartadmin/util/SmartThreadFactory.java | 44 - .../smartadmin/util/excel/SmartExcel.java | 83 - .../util/excel/SmartExcelFileType.java | 10 - .../util/excel/SmartExcelReader.java | 32 - .../smartadmin/util/excel/SmartSheet.java | 113 - .../main/resources/dev/application.properties | 123 - .../src/main/resources/dev/spy.properties | 20 - .../mapper/business/email/EmailMapper.xml | 44 - .../business/log/OrderOperateLogMapper.xml | 50 - .../business/log/UserLoginLogMapper.xml | 46 - .../business/log/UserOperateLogMapper.xml | 51 - .../mapper/business/notice/NoticeMapper.xml | 155 - .../notice/NoticeReceiveRecordMapper.xml | 39 - .../mapper/business/peony/PeonyMapper.xml | 116 - .../support/codegenerator/TableMapper.xml | 27 - .../mapper/support/file/FileMapper.xml | 100 - .../heartbeat/HeartBeatRecordMapper.xml | 41 - .../support/idgenerator/IdGeneratorMapper.xml | 48 - .../support/quartz/QuartzTaskLogMapper.xml | 38 - .../support/quartz/QuartzTaskMapper.xml | 36 - .../support/smartreload/ReloadItemMapper.xml | 6 - .../smartreload/ReloadResultMapper.xml | 18 - .../system/department/DepartmentMapper.xml | 54 - .../mapper/system/employee/EmployeeMapper.xml | 186 - .../mapper/system/position/PositionMapper.xml | 77 - .../system/privilege/PrivilegeMapper.xml | 124 - .../mapper/system/role/RoleEmployeeMapper.xml | 124 - .../mapper/system/role/RoleMapper.xml | 27 - .../system/role/RolePrivilegeMapper.xml | 72 - .../systemconfig/SystemConfigMapper.xml | 102 - .../main/resources/pre/application.properties | 121 - .../resources/prod/application.properties | 120 - .../main/resources/sit/application.properties | 121 - .../src/main/resources/sit/spy.properties | 20 - .../main/resources/sql/quartz_mysql_2.3.0.sql | 179 - .../src/main/resources/sql/smart-admin.sql | 1588 -- .../codegenerator/java/AddDTO.java.vm | 36 - .../codegenerator/java/Controller.java.vm | 88 - .../templates/codegenerator/java/Dao.java.vm | 64 - .../templates/codegenerator/java/Dao.xml.vm | 144 - .../codegenerator/java/Entity.java.vm | 33 - .../codegenerator/java/ExcelVO.java.vm | 33 - .../codegenerator/java/QueryDTO.java.vm | 45 - .../codegenerator/java/Service.java.vm | 108 - .../codegenerator/java/UpdateDTO.java.vm | 20 - .../templates/codegenerator/java/VO.java.vm | 35 - .../templates/codegenerator/web/Api.js.vm | 28 - .../templates/codegenerator/web/List.vue.vm | 439 - .../codegenerator/web/ListForm.vue.vm | 132 - .../templates/codegenerator/web/Router.js.vm | 32 - .../java/net/lab1024/smartadmin/BaseTest.java | 28 - .../SmartAdminApplicationTests.java | 11 - .../CodeGeneratorServiceTest.java | 66 - smart-admin-web/.babelrc | 5 - smart-admin-web/.editorconfig | 9 - smart-admin-web/.env.development | 4 - smart-admin-web/.env.local | 4 - smart-admin-web/.env.prod | 8 - smart-admin-web/.env.sit | 3 - smart-admin-web/.eslintrc.js | 34 - smart-admin-web/.gitignore | 22 - smart-admin-web/.travis.yml | 5 - smart-admin-web/README.md | 13 - smart-admin-web/cypress.json | 3 - smart-admin-web/doc/notice.txt | 2 - .../javascript-ant-design-vue3/.env | 2 + .../.env.development | 8 + .../javascript-ant-design-vue3/.env.localhost | 8 + .../javascript-ant-design-vue3/.env.pre | 8 + .../.env.production | 8 + .../javascript-ant-design-vue3/.env.test | 8 + .../javascript-ant-design-vue3/.eslintignore | 18 + .../javascript-ant-design-vue3/.eslintrc.js | 66 + .../javascript-ant-design-vue3/.gitignore | 6 + .../javascript-ant-design-vue3/.prettierrc.js | 30 + .../.stylelintignore | 3 + .../.stylelintrc.js | 70 + .../README.en.md} | 0 .../README.md} | 0 .../javascript-ant-design-vue3/index.html | 24 + .../javascript-ant-design-vue3/jsconfig.json | 17 + .../javascript-ant-design-vue3/package.json | 73 + .../postcss.config.js} | 5 +- .../public/favicon.ico | Bin .../javascript-ant-design-vue3/src/App.vue | 34 + .../src/api/business/category/category-api.js | 34 + .../src/api/business/goods/goods-api.js | 31 + .../src/api/business/oa/bank-api.js | 42 + .../src/api/business/oa/enterprise-api.js | 64 + .../src/api/business/oa/invoice-api.js | 44 + .../src/api/business/oa/notice-api.js | 74 + .../src/api/support/cache/cache-api.js | 25 + .../api/support/change-log/change-log-api.js | 45 + .../code-generator/code-generator-api.js | 46 + .../src/api/support/config/config-api.js | 29 + .../support/data-tracer/data-tracer-api.js | 18 + .../src/api/support/dict/dict-api.js | 59 + .../src/api/support/feedback/feedback-api.js | 21 + .../src/api/support/file/file-api.js | 38 + .../api/support/heart-beat/heart-beat-api.js | 17 + .../src/api/support/help-doc/help-doc-api.js | 59 + .../support/help-doc/help-doc-catalog-api.js | 32 + .../api/support/login-log/login-log-api.js | 17 + .../support/operate-log/operate-log-api.js | 21 + .../src/api/support/reload/reload-api.js | 25 + .../serial-number/serial-number-api.js | 25 + .../src/api/support/table/table-column-api.js | 26 + .../api/system/department/department-api.js | 55 + .../src/api/system/employee/employee-api.js | 98 + .../src/api/system/home/home-api.js | 29 + .../src/api/system/login/login-api.js | 51 + .../src/api/system/menu/menu-api.js | 54 + .../src/api/system/role-menu/role-menu-api.js | 28 + .../src/api/system/role/role-api.js | 110 + .../src/assets/images/1024lab/1024lab-gzh.jpg | Bin 0 -> 27898 bytes .../assets/images/1024lab/xiaozhen-gzh.jpg | Bin 0 -> 8786 bytes .../assets/images/1024lab/zhuoda-wechat.jpg | Bin 0 -> 42080 bytes .../src/assets/images/login/ali-icon.png | Bin 0 -> 7011 bytes .../src/assets/images/login/google-icon.png | Bin 0 -> 6228 bytes .../src/assets/images/login/login-bg.jpg | Bin 0 -> 403238 bytes .../login/login-form-open-eyes-close.png | Bin 0 -> 4914 bytes .../images/login/login-form-open-eyes.png | Bin 0 -> 6557 bytes .../src/assets/images/login/login-qr.png | Bin 0 -> 11297 bytes .../src/assets/images/login/qq-icon.png | Bin 0 -> 5353 bytes .../src/assets/images/login/wechat-icon.png | Bin 0 -> 6657 bytes .../src/assets/images/login/weibo-icon.png | Bin 0 -> 7799 bytes .../src/assets/images/logo}/logo-min.png | Bin .../src/assets/images/logo/logo.png | Bin 0 -> 6053 bytes .../images/logo/smart-admin-logo-white.png | Bin 0 -> 8106 bytes .../assets/images/logo/smart-admin-logo.png | Bin 0 -> 14325 bytes .../src/assets/images/notice/edit_icon.png | Bin 0 -> 700 bytes .../src/assets/images/notice/file_icon.png | Bin 0 -> 488 bytes .../business/category-tree-select/index.vue | 85 + .../oa/enterprise-bank-select/index.vue | 109 + .../oa/enterprise-invoice-select/index.vue | 108 + .../business/oa/enterprise-select/index.vue | 85 + .../framework/area-cascader/index.vue | 91 + .../area-cascader/province-city-district.js | 17546 ++++++++++++++++ .../framework/area-cascader/province-city.js | 1727 ++ .../framework/boolean-select/index.vue | 81 + .../framework/icon-select/index.vue | 133 + .../framework/iframe/iframe-index.vue | 18 + .../iframe/route-default-component.vue | 3 + .../framework/smart-enum-checkbox/index.vue | 55 + .../framework/smart-enum-radio/index.vue | 63 + .../framework/smart-enum-select/index.vue | 68 + .../framework/smart-loading/index.js | 20 + .../components/framework/wangeditor/index.vue | 109 + .../components/support/data-tracer/index.vue | 239 + .../support/dict-key-select/index.vue | 78 + .../components/support/dict-select/index.vue | 116 + .../support/file-preview-modal/index.vue | 87 + .../components/support/file-preview/index.vue | 78 + .../components/support/file-upload/index.vue | 199 + .../support/table-operator/index.vue | 163 + .../smart-table-column-merge.js | 54 + .../smart-table-column-modal.vue | 280 + .../system/department-tree-select/index.vue | 58 + .../system/employee-select/index.vue | 97 + .../employee-table-select-modal/index.vue | 182 + .../system/menu-tree-select/index.vue | 76 + .../src/config/app-config.js | 29 + .../constants/business/erp/category-const.js | 23 + .../src/constants/business/erp/goods-const.js | 26 + .../constants/business/oa/enterprise-const.js | 24 + .../src/constants/business/oa/notice-const.js | 36 + .../src/constants/common-const.js | 58 + .../src/constants/index.js | 38 + .../src/constants/layout-const.js | 19 + .../src/constants/local-storage-key-const.js | 31 + .../src/constants/regular-const.js | 28 + .../src/constants/support/change-log-const.js | 29 + .../constants/support/code-generator-const.js | 118 + .../constants/support/data-tracer-const.js | 29 + .../src/constants/support/file-const.js | 31 + .../src/constants/support/login-log-const.js | 27 + .../src/constants/support/table-id-const.js | 57 + .../src/constants/system/employee-const.js | 27 + .../src/constants/system/home-const.js | 15 + .../constants/system/login-device-const.js | 31 + .../src/constants/system/menu-const.js | 47 + .../src/directives/privilege.js | 29 + .../src/i18n/index.js | 41 + .../src/i18n/lang/en-US/index.js | 17 + .../src/i18n/lang/zh-CN/index.js | 17 + .../header-user-space/header-avatar.vue | 126 + .../header-user-space/header-message.vue | 116 + .../header-reset-password-modal/index.vue | 85 + .../header-user-space/header-setting.vue | 201 + .../components/header-user-space/index.vue | 108 + .../menu-location-breadcrumb/index.vue | 35 + .../src/layout/components/page-tag/index.vue | 214 + .../components/side-expand-menu/index.vue | 51 + .../side-expand-menu/recursion-menu.vue | 101 + .../components/side-expand-menu/sub-menu.vue | 46 + .../components/side-expand-menu/top-menu.vue | 125 + .../components/contact-modal.vue | 102 + .../components/feedback-modal.vue | 85 + .../layout/components/side-help-doc/index.vue | 227 + .../src/layout/components/side-menu/index.vue | 118 + .../components/side-menu/recursion-menu.vue | 104 + .../layout/components/side-menu/sub-menu.vue | 45 + .../layout/components/smart-footer/index.vue | 34 + .../src/layout/smart-help-doc-layout.vue | 302 + .../src/layout/smart-keep-alive.js | 39 + .../src/layout/smart-layout.vue | 24 + .../src/layout/smart-side-expand-layout.vue | 237 + .../src/layout/smart-side-layout.vue | 240 + .../src/lib/axios.js | 129 + .../src/lib/default-time-ranges.js | 29 + .../src/lib/highlight-line-number.js | 226 + .../src/lib/smart-sentry.js | 22 + .../src/lib/smart-wartermark.js | 103 + .../javascript-ant-design-vue3/src/main.js | 89 + .../src/plugins/privilege-plugin.js | 29 + .../src/plugins/smart-enums-plugin.js | 78 + .../src/router/index.js | 151 + .../src/router/routers.js | 14 + .../src/router/support/help-doc.js | 28 + .../src/router/system/home.js | 39 + .../src/router/system/login.js | 21 + .../src/store/index.js | 12 + .../src/store/modules/system/app-config.js | 55 + .../src/store/modules/system/role.js | 95 + .../src/store/modules/system/spin.js | 30 + .../src/store/modules/system/user.js | 306 + .../src/theme/index.less | 150 + .../src/theme/smart-admin.less | 112 + .../src/utils/cookie-util.js | 29 + .../src/utils/local-util.js | 20 + .../src/utils/str-util.js | 46 + .../components/category-form-modal.vue | 96 + .../components/category-tree-table.vue | 163 + .../business/erp/catalog/custom-catalog.vue | 18 + .../business/erp/catalog/goods-catalog.vue | 18 + .../erp/goods/components/goods-form-modal.vue | 157 + .../views/business/erp/goods/goods-list.vue | 309 + .../components/enterprise-bank-list.vue | 239 + .../enterprise-bank-operate-modal.vue | 133 + .../components/enterprise-employee-list.vue | 275 + .../components/enterprise-invoice-list.vue | 243 + .../enterprise-invoice-operate-modal.vue | 127 + .../components/enterprise-operate-modal.vue | 243 + .../oa/enterprise/enterprise-detail.vue | 130 + .../oa/enterprise/enterprise-list.vue | 264 + .../notice/components/notice-form-drawer.vue | 307 + .../components/notice-form-visible-modal.vue | 71 + ...otice-form-visible-transfer-department.vue | 204 + .../notice-form-visible-transfer-employee.vue | 252 + .../components/notice-view-record-list.vue | 161 + .../business/oa/notice/notice-detail.vue | 144 + .../oa/notice/notice-employee-detail.vue | 153 + .../oa/notice/notice-employee-list.vue | 239 + .../views/business/oa/notice/notice-list.vue | 352 + .../src/views/support/cache/cache-list.vue | 112 + .../support/change-log/change-log-form.vue | 138 + .../support/change-log/change-log-list.vue | 317 + .../support/change-log/change-log-modal.vue | 44 + .../code-generator/code-generator-list.vue | 178 + .../code-generator/code-generator-util.js | 171 + ...code-generator-table-config-form-basic.vue | 290 + ...ode-generator-table-config-form-delete.vue | 128 + ...code-generator-table-config-form-field.vue | 225 + ...or-table-config-form-insert-and-update.vue | 293 + ...enerator-table-config-form-query-field.vue | 253 + ...enerator-table-config-form-table-field.vue | 153 + .../form/code-generator-table-config-form.vue | 228 + .../preview/code-generator-preview-modal.vue | 202 + .../support/config/config-form-modal.vue | 99 + .../src/views/support/config/config-list.vue | 170 + .../components/dict-key-operate-modal.vue | 95 + .../dict/components/dict-value-modal.vue | 221 + .../components/dict-value-operate-modal.vue | 101 + .../src/views/support/dict/index.vue | 237 + .../views/support/feedback/feedback-list.vue | 166 + .../src/views/support/file/file-list.vue | 280 + .../support/heart-beat/heart-beat-list.vue | 166 + .../help-doc-catalog-form-modal.vue | 132 + .../help-doc-catalog-tree-select.vue | 89 + .../components/help-doc-catalog-tree.vue | 354 + .../components/help-doc-form-drawer.vue | 204 + .../management/components/help-doc-list.vue | 267 + .../management/help-doc-manage-list.vue | 55 + .../help-doc/management/help-doc-mitt.js | 11 + .../components/help-doc-view-record-list.vue | 168 + .../help-doc/user-view/help-doc-user-view.vue | 150 + .../support/login-log/login-log-list.vue | 194 + .../operate-log/operate-log-detail-modal.vue | 139 + .../support/operate-log/operate-log-list.vue | 220 + .../support/reload/do-reload-form-modal.vue | 90 + .../src/views/support/reload/reload-list.vue | 133 + .../support/reload/reload-result-list.vue | 100 + .../serial-number-generate-form-modal.vue | 107 + .../serial-number/serial-number-list.vue | 143 + .../serial-number-record-list.vue | 115 + .../src/views/system/40X/403.vue | 24 + .../src/views/system/40X/404.vue | 24 + .../components/department-children/index.vue | 58 + .../department-form-modal/index.vue | 138 + .../components/department-tree/index.vue | 339 + .../employee-department-form-modal/index.vue | 94 + .../components/employee-form-modal/index.vue | 224 + .../components/employee-list/index.vue | 390 + .../employee-password-dialog/index.vue | 79 + .../employee/department/department-mitt.ts | 11 + .../system/employee/department/index.vue | 72 + .../role/components/role-data-scope/index.vue | 157 + .../components/role-employee-list/index.vue | 263 + .../role/components/role-form-modal/index.vue | 111 + .../role/components/role-list/index.vue | 116 + .../role/components/role-setting/index.vue | 44 + .../role/components/role-tree/index.less | 78 + .../role/components/role-tree/index.vue | 74 + .../role-tree/role-tree-checkbox.vue | 49 + .../components/role-tree/role-tree-menu.vue | 64 + .../components/role-tree/role-tree-point.vue | 33 + .../src/views/system/employee/role/index.vue | 45 + .../system/home/components/changelog-card.vue | 107 + .../home/components/default-home-card.vue | 60 + .../home/components/echarts/category.vue | 92 + .../system/home/components/echarts/gauge.vue | 119 + .../home/components/echarts/gradient.vue | 210 + .../system/home/components/echarts/pie.vue | 78 + .../home/components/official-account-card.vue | 86 + .../quick-entry/home-quick-entry-modal.vue | 81 + .../quick-entry/home-quick-entry.vue | 149 + .../quick-entry/init-quick-entry-list.js | 27 + .../home/components/to-be-done-card.vue | 158 + .../src/views/system/home/home-header.vue | 159 + .../src/views/system/home/home-notice.vue | 129 + .../src/views/system/home/index.less | 65 + .../src/views/system/home/index.vue | 89 + .../src/views/system/login/login.less | 175 + .../src/views/system/login/login.vue | 206 + .../menu/components/menu-operate-modal.vue | 309 + .../menu/components/menu-tree-select.vue | 49 + .../views/system/menu/menu-data-handler.js | 151 + .../system/menu/menu-list-table-columns.js | 83 + .../src/views/system/menu/menu-list.vue | 256 + .../javascript-ant-design-vue3/vite.config.js | 94 + smart-admin-web/package-lock.json | 15500 -------------- smart-admin-web/package.json | 89 - smart-admin-web/public/index.html | 19 - smart-admin-web/src/App.vue | 31 - smart-admin-web/src/api/data-scope.js | 15 - smart-admin-web/src/api/department.js | 47 - smart-admin-web/src/api/email.js | 27 - smart-admin-web/src/api/employee.js | 43 - smart-admin-web/src/api/file.js | 28 - smart-admin-web/src/api/heart-beat.js | 7 - smart-admin-web/src/api/login.js | 19 - smart-admin-web/src/api/notice.js | 43 - smart-admin-web/src/api/online-user.js | 12 - smart-admin-web/src/api/peony.js | 28 - smart-admin-web/src/api/position.js | 19 - smart-admin-web/src/api/privilege.js | 36 - smart-admin-web/src/api/role.js | 58 - smart-admin-web/src/api/smart-reload.js | 20 - smart-admin-web/src/api/system-config.js | 31 - smart-admin-web/src/api/task-manage.js | 35 - smart-admin-web/src/api/user-log.js | 28 - smart-admin-web/src/api/user.js | 20 - smart-admin-web/src/assets/icons/demo.css | 539 - .../src/assets/icons/demo_index.html | 722 - .../font_1299963_2zqwx2axi0j/demo.css | 539 - .../font_1299963_2zqwx2axi0j/demo_index.html | 722 - .../font_1299963_2zqwx2axi0j/iconfont.css | 113 - .../font_1299963_2zqwx2axi0j/iconfont.eot | Bin 8812 -> 0 bytes .../font_1299963_2zqwx2axi0j/iconfont.js | 1 - .../font_1299963_2zqwx2axi0j/iconfont.svg | 98 - .../font_1299963_2zqwx2axi0j/iconfont.ttf | Bin 8644 -> 0 bytes .../font_1299963_2zqwx2axi0j/iconfont.woff | Bin 5436 -> 0 bytes .../font_1299963_2zqwx2axi0j/iconfont.woff2 | Bin 4584 -> 0 bytes smart-admin-web/src/assets/icons/iconfont.css | 113 - smart-admin-web/src/assets/icons/iconfont.eot | Bin 8812 -> 0 bytes smart-admin-web/src/assets/icons/iconfont.js | 1 - smart-admin-web/src/assets/icons/iconfont.svg | 98 - smart-admin-web/src/assets/icons/iconfont.ttf | Bin 8644 -> 0 bytes .../src/assets/icons/iconfont.woff | Bin 5436 -> 0 bytes .../src/assets/icons/iconfont.woff2 | Bin 4584 -> 0 bytes .../src/assets/images/default_icon.png | Bin 2364 -> 0 bytes .../assets/images/error-page/error-401.svg | 1 - .../assets/images/error-page/error-404.svg | 1 - .../assets/images/error-page/error-500.svg | 1 - .../src/assets/images/icon-qr-qq-wechat.png | Bin 43541 -> 0 bytes .../assets/images/icon-social-bilibili.svg | 1 - .../src/assets/images/icon-social-juejin.svg | 1 - .../src/assets/images/icon-social-twitter.svg | 1 - .../src/assets/images/icon-social-zhihu.svg | 1 - .../src/assets/images/login-alipay.png | Bin 1881 -> 0 bytes .../src/assets/images/login-bg.jpg | Bin 547587 -> 0 bytes .../src/assets/images/login-logo.png | Bin 4900 -> 0 bytes .../src/assets/images/login-sina.png | Bin 1851 -> 0 bytes .../src/assets/images/login-taobao.png | Bin 1898 -> 0 bytes .../src/assets/images/login_desc_bg.png | Bin 272693 -> 0 bytes .../src/assets/images/login_logo.png | Bin 3523 -> 0 bytes smart-admin-web/src/assets/images/logo.png | Bin 3839 -> 0 bytes smart-admin-web/src/assets/images/logo1.png | Bin 3259 -> 0 bytes smart-admin-web/src/assets/images/message.png | Bin 1873 -> 0 bytes smart-admin-web/src/assets/images/shadow.png | Bin 224307 -> 0 bytes .../images/slider/sub_slider_active.png | Bin 3103 -> 0 bytes .../images/slider/sub_slider_default.png | Bin 3105 -> 0 bytes .../src/assets/style/lib/animate.css | 3625 ---- .../components/active-plate/active-plate.vue | 67 - smart-admin-web/src/components/charts/bar.vue | 73 - .../src/components/charts/index.js | 3 - smart-admin-web/src/components/charts/pie.vue | 85 - .../src/components/charts/theme.json | 490 - .../components/common-icon/common-icon.vue | 52 - .../src/components/common-icon/index.js | 2 - .../src/components/count-to/count-to.vue | 198 - .../src/components/count-to/index.js | 2 - .../src/components/count-to/index.less | 10 - .../src/components/editor/editor.vue | 77 - .../src/components/editor/index.js | 2 - .../components/employee/employee-selector.vue | 54 - .../src/components/icons/icons.vue | 38 - smart-admin-web/src/components/icons/index.js | 2 - .../main/components/a-back-top/index.js | 2 - .../main/components/a-back-top/index.vue | 130 - .../main/components/fullscreen/fullscreen.vue | 92 - .../main/components/fullscreen/index.js | 2 - .../custom-bread-crumb.less | 4 - .../custom-bread-crumb/custom-bread-crumb.vue | 44 - .../header-bar/custom-bread-crumb/index.js | 2 - .../components/header-bar/header-bar.less | 19 - .../main/components/header-bar/header-bar.vue | 106 - .../main/components/header-bar/index.js | 2 - .../header-bar/sider-trigger/index.js | 2 - .../sider-trigger/sider-trigger.less | 21 - .../sider-trigger/sider-trigger.vue | 35 - .../main/components/language/index.js | 2 - .../main/components/language/language.vue | 54 - .../main/components/notice/notice.vue | 371 - .../components/side-menu/collapsed-menu.vue | 84 - .../main/components/side-menu/index.js | 2 - .../main/components/side-menu/item-mixin.js | 30 - .../main/components/side-menu/mixin.js | 18 - .../components/side-menu/side-menu-item.vue | 35 - .../main/components/side-menu/side-menu.less | 39 - .../main/components/side-menu/side-menu.vue | 197 - .../main/components/tags-nav/index.js | 2 - .../main/components/tags-nav/tags-nav.less | 136 - .../main/components/tags-nav/tags-nav.vue | 256 - .../components/main/components/user/index.js | 2 - .../components/main/components/user/user.less | 25 - .../components/main/components/user/user.vue | 131 - smart-admin-web/src/components/main/index.js | 2 - smart-admin-web/src/components/main/main.less | 129 - smart-admin-web/src/components/main/main.vue | 533 - .../src/components/smart-admin-ad/ad.vue | 34 - .../src/components/smart-admin-ad/index.js | 2 - .../src/components/tables/edit.vue | 102 - .../src/components/tables/handle-btns.js | 70 - .../src/components/tables/index.js | 2 - .../src/components/tables/index.less | 17 - .../src/components/tables/tables.vue | 342 - smart-admin-web/src/config/index.js | 38 - smart-admin-web/src/constants/file.js | 24 - smart-admin-web/src/constants/index.js | 10 - smart-admin-web/src/constants/login.js | 13 - smart-admin-web/src/constants/notice.js | 13 - smart-admin-web/src/constants/privilege.js | 14 - smart-admin-web/src/constants/table-page.js | 6 - smart-admin-web/src/directives/directives.js | 11 - smart-admin-web/src/directives/index.js | 31 - .../src/directives/module/clipboard.js | 30 - .../src/directives/module/draggable.js | 42 - .../src/directives/module/privilege.js | 23 - smart-admin-web/src/lib/cookie.js | 21 - smart-admin-web/src/lib/http.js | 161 - smart-admin-web/src/lib/local.js | 8 - smart-admin-web/src/lib/menu-func.js | 276 - smart-admin-web/src/lib/printPlugs.js | 133 - smart-admin-web/src/lib/render-dom.js | 10 - smart-admin-web/src/lib/table-action.js | 84 - smart-admin-web/src/lib/util.js | 515 - smart-admin-web/src/locale/index.js | 37 - smart-admin-web/src/locale/lang/en-US.js | 46 - smart-admin-web/src/locale/lang/zh-CN.js | 46 - smart-admin-web/src/locale/lang/zh-TW.js | 46 - smart-admin-web/src/main.js | 80 - smart-admin-web/src/main.less | 37 - .../src/plugins/error-store/index.js | 4 - smart-admin-web/src/plugins/index.js | 12 - smart-admin-web/src/router/before-close.js | 17 - smart-admin-web/src/router/index.js | 218 - .../src/router/module/business/email.js | 40 - .../src/router/module/business/index.js | 29 - .../src/router/module/business/keep-alive.js | 31 - .../src/router/module/business/notice.js | 52 - .../src/router/module/business/peony.js | 49 - .../router/module/business/three-router.js | 63 - smart-admin-web/src/router/module/error.js | 33 - smart-admin-web/src/router/module/home.js | 29 - .../src/router/module/support/api-doc.js | 25 - .../src/router/module/support/heart-beat.js | 31 - .../src/router/module/support/index.js | 30 - .../src/router/module/support/monitor.js | 34 - .../src/router/module/support/reload.js | 40 - .../src/router/module/support/task.js | 63 - .../src/router/module/system/employee.js | 149 - .../src/router/module/system/file.js | 29 - .../src/router/module/system/index.js | 28 - .../router/module/system/system-setting.js | 65 - .../src/router/module/system/user-log.js | 42 - smart-admin-web/src/router/routers.js | 43 - smart-admin-web/src/store/index.js | 25 - smart-admin-web/src/store/module/app.js | 129 - smart-admin-web/src/store/module/notice.js | 19 - smart-admin-web/src/store/module/user.js | 122 - smart-admin-web/src/themes/ReadMe.md | 1 - smart-admin-web/src/themes/index.less | 328 - .../src/views/business/email/email-list.vue | 214 - .../src/views/business/email/send-mail.vue | 215 - .../views/business/keep-alive/add-content.vue | 94 - .../business/keep-alive/content-list.vue | 80 - .../views/business/notice/notice-detail.vue | 49 - .../src/views/business/notice/notice-list.vue | 369 - .../views/business/notice/person-notice.vue | 221 - .../peony/components/peony-list-form.vue | 133 - .../src/views/business/peony/peony-list.vue | 495 - .../three-level-router-view.vue | 58 - smart-admin-web/src/views/error-page/401.vue | 19 - smart-admin-web/src/views/error-page/404.vue | 19 - smart-admin-web/src/views/error-page/500.vue | 19 - .../src/views/error-page/back-btn-group.vue | 40 - .../src/views/error-page/error-content.vue | 28 - .../src/views/error-page/error.less | 46 - .../src/views/home/components/card.vue | 43 - .../src/views/home/components/chart-bar.vue | 140 - .../views/home/components/chart-funnel.vue | 106 - .../src/views/home/components/chart-gauge.vue | 87 - .../src/views/home/components/chart-line.vue | 123 - .../src/views/home/components/chart-pie.vue | 110 - .../src/views/home/components/home-circle.vue | 41 - .../views/home/components/home-progress.vue | 59 - .../src/views/home/components/theme.json | 490 - smart-admin-web/src/views/home/home.vue | 154 - smart-admin-web/src/views/home/index.js | 2 - smart-admin-web/src/views/login/canvas.js | 289 - .../src/views/login/components/login-form.vue | 134 - smart-admin-web/src/views/login/login.less | 128 - smart-admin-web/src/views/login/login.vue | 52 - .../src/views/support/api-doc/swagger.vue | 33 - .../support/heart-beat/heart-beat-list.vue | 115 - .../src/views/support/monitor/online-user.vue | 152 - .../src/views/support/monitor/sql.vue | 33 - .../reload/smart-reload/smart-reload-list.vue | 273 - .../src/views/support/task/task-list.vue | 556 - .../department-employee-tree-item.vue | 124 - .../department-employee-tree.vue | 251 - .../employee/position/position-list.vue | 366 - .../employee-table-add/employee-table-add.vue | 527 - .../employee-table-detail.vue | 72 - .../employee-table/employee-table.vue | 572 - .../role-employee/role-employee-manage.vue | 831 - .../role-data-scope/role-data-scope.vue | 144 - .../role/components/role-list/role-list.vue | 407 - .../role/components/role-tree/role-tree.vue | 431 - .../system/employee/role/role-manage.vue | 339 - .../src/views/system/file/file-list.vue | 279 - .../system-config/system-config.vue | 397 - .../components/privilege-form.vue | 144 - .../system-privilege/system-privilege.vue | 410 - .../views/system/user-log/user-login-log.vue | 185 - .../system/user-log/user-operate-log.vue | 252 - .../src/views/three-router/three-content.vue | 26 - smart-admin-web/tests/e2e/.eslintrc | 12 - smart-admin-web/tests/e2e/plugins/index.js | 9 - smart-admin-web/tests/e2e/specs/test.js | 8 - smart-admin-web/tests/e2e/support/commands.js | 25 - smart-admin-web/tests/e2e/support/index.js | 20 - smart-admin-web/tests/unit/.eslintrc.js | 8 - smart-admin-web/tests/unit/HelloWorld.spec.js | 13 - .../typescript-ant-design-vue3/.env | 2 + .../.env.development | 8 + .../typescript-ant-design-vue3/.env.localhost | 8 + .../typescript-ant-design-vue3/.env.pre | 8 + .../.env.production | 8 + .../typescript-ant-design-vue3/.env.test | 8 + .../typescript-ant-design-vue3/.eslintignore | 17 + .../typescript-ant-design-vue3/.eslintrc.js | 76 + .../typescript-ant-design-vue3/.gitignore | 6 + .../typescript-ant-design-vue3/.prettierrc.js | 31 + .../.stylelintignore | 3 + .../.stylelintrc.js | 70 + .../typescript-ant-design-vue3/README.md | 0 .../typescript-ant-design-vue3/index.html | 24 + .../typescript-ant-design-vue3/package.json | 82 + .../public/favicon.ico | Bin .../typescript-ant-design-vue3/src/App.vue | 38 + .../src/api/base-model/page-param-model.ts | 35 + .../src/api/base-model/page-result-model.ts | 50 + .../src/api/base-model/response-model.ts | 30 + .../src/api/base-model/sort-item-model.ts | 24 + .../src/api/business/category/category-api.js | 34 + .../src/api/business/goods/goods-api.js | 31 + .../src/api/business/oa/bank-api.js | 42 + .../src/api/business/oa/enterprise-api.js | 64 + .../src/api/business/oa/invoice-api.js | 44 + .../src/api/business/oa/notice-api.js | 74 + .../src/api/support/cache/cache-api.js | 25 + .../api/support/change-log/change-log-api.js | 45 + .../code-generator/code-generator-api.js | 46 + .../src/api/support/config/config-api.js | 29 + .../support/data-tracer/data-tracer-api.js | 18 + .../src/api/support/dict/dict-api.js | 59 + .../src/api/support/feedback/feedback-api.js | 21 + .../src/api/support/file/file-api.js | 38 + .../api/support/heart-beat/heart-beat-api.js | 17 + .../src/api/support/help-doc/help-doc-api.js | 59 + .../support/help-doc/help-doc-catalog-api.js | 32 + .../api/support/login-log/login-log-api.js | 17 + .../support/operate-log/operate-log-api.js | 21 + .../src/api/support/reload/reload-api.js | 25 + .../serial-number/serial-number-api.js | 25 + .../src/api/support/table/table-column-api.js | 26 + .../api/system/department/department-api.js | 55 + .../src/api/system/employee/employee-api.js | 98 + .../src/api/system/home/home-api.js | 29 + .../src/api/system/login/login-api.js | 51 + .../src/api/system/menu/menu-api.js | 54 + .../src/api/system/role-menu/role-menu-api.js | 28 + .../src/api/system/role/role-api.js | 110 + .../src/assets/images/1024lab/1024lab-gzh.jpg | Bin 0 -> 27898 bytes .../assets/images/1024lab/xiaozhen-gzh.jpg | Bin 0 -> 8786 bytes .../assets/images/1024lab/zhuoda-wechat.jpg | Bin 0 -> 42080 bytes .../src/assets/images/login/ali-icon.png | Bin 0 -> 7011 bytes .../src/assets/images/login/google-icon.png | Bin 0 -> 6228 bytes .../src/assets/images/login/login-bg.jpg | Bin 0 -> 403238 bytes .../login/login-form-open-eyes-close.png | Bin 0 -> 4914 bytes .../images/login/login-form-open-eyes.png | Bin 0 -> 6557 bytes .../src/assets/images/login/login-qr.png | Bin 0 -> 11297 bytes .../src/assets/images/login/qq-icon.png | Bin 0 -> 5353 bytes .../src/assets/images/login/wechat-icon.png | Bin 0 -> 6657 bytes .../src/assets/images/login/weibo-icon.png | Bin 0 -> 7799 bytes .../src/assets/images/logo/logo-min.png | Bin 0 -> 2079 bytes .../src/assets/images/logo/logo.png | Bin 0 -> 6053 bytes .../images/logo/smart-admin-logo-white.png | Bin 0 -> 8106 bytes .../assets/images/logo/smart-admin-logo.png | Bin 0 -> 14325 bytes .../src/assets/images/notice/edit_icon.png | Bin 0 -> 700 bytes .../src/assets/images/notice/file_icon.png | Bin 0 -> 488 bytes .../business/category-tree-select/index.vue | 85 + .../oa/enterprise-bank-select/index.vue | 109 + .../oa/enterprise-invoice-select/index.vue | 108 + .../business/oa/enterprise-select/index.vue | 85 + .../framework/area-cascader/index.vue | 91 + .../area-cascader/province-city-district.ts | 17546 ++++++++++++++++ .../framework/area-cascader/province-city.ts | 1727 ++ .../framework/boolean-select/index.vue | 81 + .../framework/icon-select/index.vue | 133 + .../framework/iframe/iframe-index.vue | 18 + .../iframe/route-default-component.vue | 3 + .../framework/smart-enum-checkbox/index.vue | 55 + .../framework/smart-enum-radio/index.vue | 63 + .../framework/smart-enum-select/index.vue | 68 + .../framework/smart-loading/index.ts | 20 + .../components/framework/wangeditor/index.vue | 109 + .../components/support/data-tracer/index.vue | 239 + .../support/dict-key-select/index.vue | 78 + .../components/support/dict-select/index.vue | 116 + .../support/file-preview-modal/index.vue | 87 + .../components/support/file-preview/index.vue | 78 + .../components/support/file-upload/index.vue | 199 + .../support/table-operator/index.vue | 163 + .../smart-table-column-merge.ts | 54 + .../smart-table-column-modal.vue | 280 + .../system/department-tree-select/index.vue | 58 + .../system/employee-select/index.vue | 97 + .../employee-table-select-modal/index.vue | 182 + .../system/menu-tree-select/index.vue | 76 + .../src/config/app-config.ts | 35 + .../constants/business/erp/category-const.ts | 25 + .../src/constants/business/erp/goods-const.ts | 28 + .../constants/business/oa/enterprise-const.ts | 25 + .../src/constants/business/oa/notice-const.ts | 37 + .../src/constants/common-const.ts | 57 + .../src/constants/index.ts | 38 + .../src/constants/layout-const.ts | 22 + .../src/constants/local-storage-key-const.ts | 31 + .../src/constants/regular-const.ts | 28 + .../src/constants/support/change-log-const.ts | 32 + .../constants/support/code-generator-const.ts | 120 + .../constants/support/data-tracer-const.ts | 31 + .../src/constants/support/file-const.ts | 33 + .../src/constants/support/login-log-const.ts | 30 + .../src/constants/support/table-id-const.ts | 57 + .../src/constants/system/employee-const.ts | 30 + .../src/constants/system/home-const.ts | 15 + .../constants/system/login-device-const.ts | 34 + .../src/constants/system/menu-const.ts | 50 + .../src/directives/privilege.ts | 31 + .../src/i18n/index.ts | 41 + .../src/i18n/lang/en-US/index.ts | 17 + .../src/i18n/lang/zh-CN/index.ts | 17 + .../header-user-space/header-avatar.vue | 126 + .../header-user-space/header-message.vue | 116 + .../header-reset-password-modal/index.vue | 85 + .../header-user-space/header-setting.vue | 201 + .../components/header-user-space/index.vue | 108 + .../menu-location-breadcrumb/index.vue | 35 + .../src/layout/components/page-tag/index.vue | 214 + .../components/side-expand-menu/index.vue | 51 + .../side-expand-menu/recursion-menu.vue | 101 + .../components/side-expand-menu/sub-menu.vue | 46 + .../components/side-expand-menu/top-menu.vue | 125 + .../components/contact-modal.vue | 102 + .../components/feedback-modal.vue | 85 + .../layout/components/side-help-doc/index.vue | 227 + .../src/layout/components/side-menu/index.vue | 118 + .../components/side-menu/recursion-menu.vue | 104 + .../layout/components/side-menu/sub-menu.vue | 45 + .../layout/components/smart-footer/index.vue | 34 + .../src/layout/smart-help-doc-layout.vue | 302 + .../src/layout/smart-keep-alive.ts | 39 + .../src/layout/smart-layout.vue | 24 + .../src/layout/smart-side-expand-layout.vue | 237 + .../src/layout/smart-side-layout.vue | 240 + .../src/lib/axios.ts | 130 + .../src/lib/default-time-ranges.ts | 29 + .../src/lib/highlight-line-number.ts | 226 + .../src/lib/smart-sentry.ts | 24 + .../src/lib/smart-wartermark.ts | 114 + .../typescript-ant-design-vue3/src/main.ts | 88 + .../src/plugins/privilege-plugin.ts | 30 + .../src/plugins/smart-enums-plugin.ts | 80 + .../src/router/index.ts | 152 + .../src/router/routers.ts | 14 + .../src/router/support/help-doc.ts | 28 + .../src/router/system/home.ts | 40 + .../src/router/system/login.ts | 22 + .../src/shims-vue.d.ts | 29 + .../src/store/index.ts | 12 + .../src/store/modules/model/UserTagNav.ts | 36 + .../src/store/modules/system/app-config.ts | 57 + .../src/store/modules/system/role.ts | 95 + .../src/store/modules/system/spin.ts | 34 + .../src/store/modules/system/user.ts | 306 + .../src/theme/index.less | 153 + .../src/theme/smart-admin.less | 112 + .../src/types/config.d.ts | 48 + .../src/types/env.d.ts | 18 + .../src/types/json-viewer.d.ts | 11 + .../src/types/smart-enum.d.ts | 28 + .../src/types/user.d.ts | 57 + .../src/utils/cookie-util.ts | 29 + .../src/utils/local-util.ts | 21 + .../src/utils/str-util.ts | 46 + .../components/category-form-modal.vue | 96 + .../components/category-tree-table.vue | 163 + .../business/erp/catalog/custom-catalog.vue | 18 + .../business/erp/catalog/goods-catalog.vue | 18 + .../erp/goods/components/goods-form-modal.vue | 150 + .../views/business/erp/goods/goods-list.vue | 309 + .../components/enterprise-bank-list.vue | 239 + .../enterprise-bank-operate-modal.vue | 133 + .../components/enterprise-employee-list.vue | 275 + .../components/enterprise-invoice-list.vue | 243 + .../enterprise-invoice-operate-modal.vue | 127 + .../components/enterprise-operate-modal.vue | 243 + .../oa/enterprise/enterprise-detail.vue | 130 + .../oa/enterprise/enterprise-list.vue | 264 + .../notice/components/notice-form-drawer.vue | 307 + .../components/notice-form-visible-modal.vue | 71 + ...otice-form-visible-transfer-department.vue | 204 + .../notice-form-visible-transfer-employee.vue | 252 + .../components/notice-view-record-list.vue | 161 + .../business/oa/notice/notice-detail.vue | 144 + .../oa/notice/notice-employee-detail.vue | 153 + .../oa/notice/notice-employee-list.vue | 239 + .../views/business/oa/notice/notice-list.vue | 352 + .../src/views/support/cache/cache-list.vue | 112 + .../support/change-log/change-log-form.vue | 138 + .../support/change-log/change-log-list.vue | 317 + .../support/change-log/change-log-modal.vue | 44 + .../code-generator/code-generator-list.vue | 178 + .../code-generator/code-generator-util.ts | 171 + ...code-generator-table-config-form-basic.vue | 275 + ...ode-generator-table-config-form-delete.vue | 128 + ...code-generator-table-config-form-field.vue | 222 + ...or-table-config-form-insert-and-update.vue | 293 + ...enerator-table-config-form-query-field.vue | 257 + ...enerator-table-config-form-table-field.vue | 150 + .../form/code-generator-table-config-form.vue | 225 + .../preview/code-generator-preview-modal.vue | 202 + .../support/config/config-form-modal.vue | 99 + .../src/views/support/config/config-list.vue | 170 + .../components/dict-key-operate-modal.vue | 95 + .../dict/components/dict-value-modal.vue | 221 + .../components/dict-value-operate-modal.vue | 101 + .../src/views/support/dict/index.vue | 237 + .../views/support/feedback/feedback-list.vue | 166 + .../src/views/support/file/file-list.vue | 280 + .../support/heart-beat/heart-beat-list.vue | 166 + .../help-doc-catalog-form-modal.vue | 132 + .../help-doc-catalog-tree-select.vue | 89 + .../components/help-doc-catalog-tree.vue | 354 + .../components/help-doc-form-drawer.vue | 204 + .../management/components/help-doc-list.vue | 267 + .../management/help-doc-manage-list.vue | 55 + .../help-doc/management/help-doc-mitt.ts | 11 + .../components/help-doc-view-record-list.vue | 168 + .../help-doc/user-view/help-doc-user-view.vue | 150 + .../support/login-log/login-log-list.vue | 194 + .../operate-log/operate-log-detail-modal.vue | 139 + .../support/operate-log/operate-log-list.vue | 220 + .../support/reload/do-reload-form-modal.vue | 90 + .../src/views/support/reload/reload-list.vue | 133 + .../support/reload/reload-result-list.vue | 100 + .../serial-number-generate-form-modal.vue | 107 + .../serial-number/serial-number-list.vue | 143 + .../serial-number-record-list.vue | 115 + .../src/views/system/40X/403.vue | 24 + .../src/views/system/40X/404.vue | 24 + .../components/department-children/index.vue | 58 + .../department-form-modal/index.vue | 138 + .../components/department-tree/index.vue | 339 + .../employee-department-form-modal/index.vue | 94 + .../components/employee-form-modal/index.vue | 224 + .../components/employee-list/index.vue | 390 + .../employee-password-dialog/index.vue | 79 + .../employee/department/department-mitt.ts | 11 + .../system/employee/department/index.vue | 72 + .../role/components/role-data-scope/index.vue | 157 + .../components/role-employee-list/index.vue | 263 + .../role/components/role-form-modal/index.vue | 111 + .../role/components/role-list/index.vue | 116 + .../role/components/role-setting/index.vue | 44 + .../role/components/role-tree/index.less | 78 + .../role/components/role-tree/index.vue | 74 + .../role-tree/role-tree-checkbox.vue | 49 + .../components/role-tree/role-tree-menu.vue | 64 + .../components/role-tree/role-tree-point.vue | 33 + .../src/views/system/employee/role/index.vue | 45 + .../system/home/components/changelog-card.vue | 107 + .../home/components/default-home-card.vue | 60 + .../home/components/echarts/category.vue | 92 + .../system/home/components/echarts/gauge.vue | 119 + .../home/components/echarts/gradient.vue | 210 + .../system/home/components/echarts/pie.vue | 78 + .../home/components/official-account-card.vue | 86 + .../quick-entry/home-quick-entry-modal.vue | 81 + .../quick-entry/home-quick-entry.vue | 149 + .../quick-entry/init-quick-entry-list.js | 27 + .../home/components/to-be-done-card.vue | 158 + .../src/views/system/home/home-header.vue | 159 + .../src/views/system/home/home-notice.vue | 129 + .../src/views/system/home/index.less | 65 + .../src/views/system/home/index.vue | 87 + .../src/views/system/login/login.less | 174 + .../src/views/system/login/login.vue | 205 + .../menu/components/menu-operate-modal.vue | 309 + .../menu/components/menu-tree-select.vue | 49 + .../views/system/menu/menu-data-handler.ts | 151 + .../system/menu/menu-list-table-columns.ts | 83 + .../src/views/system/menu/menu-list.vue | 256 + .../src/vite-env.d.ts | 1 + .../typescript-ant-design-vue3/tsconfig.json | 42 + .../typescript-ant-design-vue3/vite.config.ts | 65 + smart-admin-web/vscode/settings.json | 43 - smart-admin-web/vue.config.js | 77 - smart_admin_v2.sql | 2068 ++ 代码规范/api接口规范.md | 38 - 代码规范/front-standard-guide.md | 1148 - 代码规范/java-standard-guide.md | 697 - 快速部署/README.md | 77 - 截图/1-1.png | Bin 0 -> 471521 bytes 截图/1-2.png | Bin 0 -> 582678 bytes 截图/2-1.png | Bin 0 -> 591703 bytes 截图/2-2.png | Bin 0 -> 387026 bytes 截图/3-1.png | Bin 0 -> 406357 bytes 截图/3-2.png | Bin 0 -> 362615 bytes 截图/4-1.png | Bin 0 -> 375204 bytes 截图/4-2.png | Bin 0 -> 324770 bytes 截图/5-1.png | Bin 0 -> 348437 bytes 截图/5-2.png | Bin 0 -> 258165 bytes 截图/6-1.png | Bin 0 -> 345869 bytes 截图/6-2.png | Bin 0 -> 312732 bytes 截图/xiaozhen-gzh.jpg | Bin 0 -> 8786 bytes 截图/zhuoda-wechat-money-v1.jpg | Bin 0 -> 24507 bytes 截图/zhuoda-wechat.jpg | Bin 0 -> 35943 bytes 1807 files changed, 127943 insertions(+), 78167 deletions(-) rename {smart-admin-service => smart-admin-api}/.gitignore (90%) create mode 100644 smart-admin-api/pom.xml create mode 100644 smart-admin-api/sa-admin/pom.xml create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/SmartAdminApplication.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/common/AdminBaseController.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/config/OperateLogAspectConfig.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/config/SecurityConfig.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/config/SecurityMethodConfig.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/constant/AdminCacheConst.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/constant/AdminRedisKeyConst.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/constant/AdminSwaggerTagConst.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/listener/AdminStartupRunner.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/constant/CategoryTypeEnum.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/controller/CategoryController.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/dao/CategoryDao.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/domain/dto/CategoryBaseDTO.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/domain/dto/CategorySimpleDTO.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/domain/entity/CategoryEntity.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/domain/form/CategoryAddForm.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/domain/form/CategoryTreeQueryForm.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/domain/form/CategoryUpdateForm.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/domain/vo/CategoryTreeVO.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/domain/vo/CategoryVO.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/manager/CategoryCacheManager.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/service/CategoryQueryService.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/service/CategoryService.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/constant/GoodsStatusEnum.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/controller/GoodsController.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/dao/GoodsDao.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/domain/entity/GoodsEntity.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/domain/form/GoodsAddForm.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/domain/form/GoodsQueryForm.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/domain/form/GoodsUpdateForm.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/domain/vo/GoodsVO.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/manager/GoodsManager.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/service/GoodsService.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/bank/BankController.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/bank/BankDao.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/bank/BankService.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/bank/domain/BankCreateForm.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/bank/domain/BankEntity.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/bank/domain/BankQueryForm.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/bank/domain/BankUpdateForm.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/bank/domain/BankVO.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/EnterpriseController.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/EnterpriseEmployeeManager.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/EnterpriseService.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/constant/EnterpriseTypeEnum.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/dao/EnterpriseDao.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/dao/EnterpriseEmployeeDao.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/domain/entity/EnterpriseEmployeeEntity.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/domain/entity/EnterpriseEntity.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/domain/form/EnterpriseCreateForm.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/domain/form/EnterpriseEmployeeForm.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/domain/form/EnterpriseEmployeeQueryForm.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/domain/form/EnterpriseQueryForm.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/domain/form/EnterpriseUpdateForm.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/domain/vo/EnterpriseEmployeeVO.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/domain/vo/EnterpriseListVO.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/domain/vo/EnterpriseVO.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/invoice/InvoiceController.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/invoice/InvoiceDao.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/invoice/InvoiceService.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/invoice/domain/InvoiceAddForm.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/invoice/domain/InvoiceEntity.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/invoice/domain/InvoiceQueryForm.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/invoice/domain/InvoiceUpdateForm.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/invoice/domain/InvoiceVO.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/constant/NoticeVisibleRangeDataTypeEnum.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/controller/NoticeController.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/dao/NoticeDao.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/dao/NoticeTypeDao.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/entity/NoticeEntity.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/entity/NoticeTypeEntity.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/form/NoticeAddForm.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/form/NoticeEmployeeQueryForm.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/form/NoticeQueryForm.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/form/NoticeUpdateForm.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/form/NoticeViewRecordQueryForm.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/form/NoticeVisibleRangeForm.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/vo/NoticeDetailVO.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/vo/NoticeEmployeeVO.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/vo/NoticeTypeVO.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/vo/NoticeUpdateFormVO.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/vo/NoticeVO.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/vo/NoticeViewRecordVO.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/vo/NoticeVisibleRangeVO.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/manager/NoticeManager.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/service/NoticeEmployeeService.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/service/NoticeService.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/service/NoticeTypeService.java rename {smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/anno => smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope}/DataScope.java (51%) create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/DataScopeController.java rename {smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin => smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin}/module/system/datascope/MyBatisPlugin.java (68%) rename {smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin => smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin}/module/system/datascope/constant/DataScopeTypeEnum.java (52%) create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/constant/DataScopeViewTypeEnum.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/constant/DataScopeWhereInTypeEnum.java rename {smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/domain/dto => smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/domain}/DataScopeAndViewTypeVO.java (68%) rename {smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/domain/dto => smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/domain}/DataScopeDTO.java (64%) create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/domain/DataScopeSqlConfig.java rename {smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/domain/dto => smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/domain}/DataScopeViewTypeVO.java (60%) create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/service/DataScopeService.java rename {smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin => smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin}/module/system/datascope/service/DataScopeSqlConfigService.java (67%) rename {smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin => smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin}/module/system/datascope/service/DataScopeViewService.java (56%) create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/strategy/DataScopePowerStrategy.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/controller/DepartmentController.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/dao/DepartmentDao.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/entity/DepartmentEntity.java rename smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/department/domain/dto/DepartmentCreateDTO.java => smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/form/DepartmentAddForm.java (58%) create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/form/DepartmentUpdateForm.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/vo/DepartmentEmployeeTreeVO.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/vo/DepartmentTreeVO.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/vo/DepartmentVO.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/manager/DepartmentCacheManager.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/manager/DepartmentManager.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/service/DepartmentService.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/controller/EmployeeController.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/dao/EmployeeDao.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/entity/EmployeeEntity.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/form/EmployeeAddForm.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/form/EmployeeBatchUpdateDepartmentForm.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/form/EmployeeQueryForm.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/form/EmployeeUpdateForm.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/form/EmployeeUpdatePasswordForm.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/form/EmployeeUpdateRoleForm.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/vo/EmployeeVO.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/manager/EmployeeManager.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/service/EmployeePermissionService.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/service/EmployeeService.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/controller/LoginController.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/domain/LoginEmployeeDetail.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/domain/LoginForm.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/service/LoginService.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/constant/MenuPermsTypeEnum.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/constant/MenuTypeEnum.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/controller/MenuController.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/dao/MenuDao.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/domain/entity/MenuEntity.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/domain/form/MenuAddForm.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/domain/form/MenuBaseForm.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/domain/form/MenuPointsOperateForm.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/domain/form/MenuUpdateForm.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/domain/vo/MenuSimpleTreeVO.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/domain/vo/MenuTreeVO.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/domain/vo/MenuVO.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/manager/MenuManager.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/service/MenuService.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/controller/RoleController.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/controller/RoleDataScopeController.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/controller/RoleEmployeeController.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/controller/RoleMenuController.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/dao/RoleDao.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/dao/RoleDataScopeDao.java rename {smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleemployee => smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/dao}/RoleEmployeeDao.java (50%) create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/dao/RoleMenuDao.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/entity/RoleDataScopeEntity.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/entity/RoleEmployeeEntity.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/entity/RoleEntity.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/entity/RoleMenuEntity.java rename smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/domain/dto/RoleAddDTO.java => smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/form/RoleAddForm.java (66%) create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/form/RoleDataScopeUpdateForm.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/form/RoleEmployeeQueryForm.java rename smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/domain/dto/RoleBatchDTO.java => smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/form/RoleEmployeeUpdateForm.java (54%) create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/form/RoleMenuUpdateForm.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/form/RoleQueryForm.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/form/RoleUpdateForm.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/vo/RoleDataScopeVO.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/vo/RoleEmployeeVO.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/vo/RoleMenuTreeVO.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/vo/RoleSelectedVO.java rename {smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/domain/dto => smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/vo}/RoleVO.java (50%) create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/manager/RoleDataScopeManager.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/manager/RoleEmployeeManager.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/manager/RoleMenuManager.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/service/RoleDataScopeService.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/service/RoleEmployeeService.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/service/RoleMenuService.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/service/RoleService.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminCacheController.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminChangeLogController.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminConfigController.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminDictController.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminFileController.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminHeartBeatController.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminHelpDocController.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminLoginLogController.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminOperateLogController.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminReloadController.java create mode 100644 smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminSerialNumberController.java create mode 100644 smart-admin-api/sa-admin/src/main/resources/dev/application.yaml rename {smart-admin-service/smart-admin-api => smart-admin-api/sa-admin}/src/main/resources/dev/log4j2.xml (98%) create mode 100644 smart-admin-api/sa-admin/src/main/resources/dev/spy.properties create mode 100644 smart-admin-api/sa-admin/src/main/resources/mapper/business/category/CategoryMapper.xml create mode 100644 smart-admin-api/sa-admin/src/main/resources/mapper/business/goods/GoodsMapper.xml create mode 100644 smart-admin-api/sa-admin/src/main/resources/mapper/business/notice/NoticeMapper.xml create mode 100644 smart-admin-api/sa-admin/src/main/resources/mapper/business/oa/bank/BankMapper.xml create mode 100644 smart-admin-api/sa-admin/src/main/resources/mapper/business/oa/enterprise/EnterpriseEmployeeMapper.xml create mode 100644 smart-admin-api/sa-admin/src/main/resources/mapper/business/oa/enterprise/EnterpriseMapper.xml create mode 100644 smart-admin-api/sa-admin/src/main/resources/mapper/business/oa/invoice/InvoiceMapper.xml create mode 100644 smart-admin-api/sa-admin/src/main/resources/mapper/business/oa/notice/NoticeDao.xml create mode 100644 smart-admin-api/sa-admin/src/main/resources/mapper/system/department/DepartmentMapper.xml create mode 100644 smart-admin-api/sa-admin/src/main/resources/mapper/system/employee/EmployeeMapper.xml create mode 100644 smart-admin-api/sa-admin/src/main/resources/mapper/system/menu/MenuMapper.xml rename smart-admin-service/smart-admin-api/src/main/resources/mapper/system/datascope/DataScopeRoleMapper.xml => smart-admin-api/sa-admin/src/main/resources/mapper/system/role/RoleDataScopeMapper.xml (54%) create mode 100644 smart-admin-api/sa-admin/src/main/resources/mapper/system/role/RoleEmployeeMapper.xml create mode 100644 smart-admin-api/sa-admin/src/main/resources/mapper/system/role/RoleMapper.xml create mode 100644 smart-admin-api/sa-admin/src/main/resources/mapper/system/role/RoleMenuMapper.xml create mode 100644 smart-admin-api/sa-admin/src/main/resources/pre/application.yaml rename {smart-admin-service/smart-admin-api/src/main/resources/sit => smart-admin-api/sa-admin/src/main/resources/pre}/log4j2.xml (98%) create mode 100644 smart-admin-api/sa-admin/src/main/resources/prod/application.yaml rename {smart-admin-service/smart-admin-api/src/main/resources/pre => smart-admin-api/sa-admin/src/main/resources/prod}/log4j2.xml (97%) create mode 100644 smart-admin-api/sa-admin/src/main/resources/test/application.yaml rename {smart-admin-service/smart-admin-api/src/main/resources/prod => smart-admin-api/sa-admin/src/main/resources/test}/log4j2.xml (97%) create mode 100644 smart-admin-api/sa-admin/src/main/resources/test/spy.properties create mode 100644 smart-admin-api/sa-admin/src/test/java/net/lab1024/sa/admin/SmartAdminApplicationTest.java rename {smart-admin-service/smart-admin-api => smart-admin-api/sa-common}/pom.xml (53%) rename {smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/anno => smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/annoation}/NoNeedLogin.java (52%) create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/annoation/SaAuth.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/code/ErrorCode.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/code/ErrorCodeRangeContainer.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/code/ErrorCodeRegister.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/code/SystemErrorCode.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/code/UnexpectedErrorCode.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/code/UserErrorCode.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/constant/RequestHeaderConst.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/constant/StringConst.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/controller/SupportBaseController.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/domain/DataScopePlugin.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/domain/PageParam.java rename smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/domain/PageResultDTO.java => smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/domain/PageResult.java (64%) create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/domain/RequestUrlVO.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/domain/RequestUser.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/domain/ResponseDTO.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/domain/SystemEnvironment.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/domain/ValidateData.java rename {smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin => smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common}/common/domain/ValidateList.java (89%) rename {smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/domain => smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/enumeration}/BaseEnum.java (83%) create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/enumeration/GenderEnum.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/enumeration/SystemEnvironmentEnum.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/enumeration/UserTypeEnum.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/excel/ExcelStyle.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/exception/BusinessException.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/interceptor/AbstractInterceptor.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/json/deserializer/DictValueVoDeserializer.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/json/deserializer/FileKeyVoDeserializer.java rename {smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/json => smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/json/deserializer}/LongJsonDeserializer.java (71%) create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/json/serializer/BigDecimalNullZeroSerializer.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/json/serializer/DictValueVoSerializer.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/json/serializer/FileKeySerializer.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/json/serializer/FileKeyVoSerializer.java rename {smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/json => smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/json/serializer}/LongJsonSerializer.java (70%) create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/security/AbstractSecurityConfig.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/security/SecurityAuthenticationFailHandler.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/security/SecurityMethodSource.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/security/SecurityPermissionCheckService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/security/SecurityTokenFilter.java rename {smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/anno => smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/swagger}/ApiModelPropertyEnum.java (59%) create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/swagger/Swagger2MapperImplExtension.java rename smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/swagger/SmartSwaggerApiModelEnumPlugin.java => smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/swagger/SwaggerApiModelPropertyEnumPlugin.java (51%) rename {smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin => smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common}/util/SmartBeanUtil.java (52%) rename {smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin => smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common}/util/SmartBigDecimalUtil.java (55%) rename {smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin => smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common}/util/SmartEasyPoiExcelUtil.java (77%) create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/util/SmartEnumUtil.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/util/SmartPageUtil.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/util/SmartRequestUtil.java rename {smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin => smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common}/util/SmartStringUtil.java (73%) rename {smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin => smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common}/util/SmartVerificationUtil.java (51%) rename {smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/validator/en => smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/validator/enumeration}/CheckEnum.java (65%) rename {smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/validator/en => smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/validator/enumeration}/EnumValidator.java (85%) create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/AsyncConfig.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/CorsFilterConfig.java rename smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartDruidDataSourceConfig.java => smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/DataSourceConfig.java (60%) create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/DateConfig.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/FileCloudConfig.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/HeartBeatConfig.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/MvcConfig.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/MybatisPlusConfig.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/PostProcessorConfig.java rename smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartRedisConfig.java => smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/RedisConfig.java (90%) create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/ReloadConfig.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/RepeatSubmitConfig.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/RestTemplateConfig.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/ScheduleConfig.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/SwaggerConfig.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/SystemEnvironmentConfig.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/UrlConfig.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/constant/CacheKeyConst.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/constant/RedisKeyConst.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/constant/ReloadConst.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/constant/SwaggerTagConst.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/constant/UrlPrefixConst.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/handler/GlobalExceptionHandler.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/listener/SmartApplicationListener.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/cache/CacheService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/captcha/CaptchaController.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/captcha/CaptchaService.java rename smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/kaptcha/KaptchaColor.java => smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/captcha/config/CaptchaColor.java (73%) rename smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartKaptchaConfig.java => smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/captcha/config/CaptchaConfig.java (60%) rename smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/kaptcha/KaptchaNoise.java => smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/captcha/config/CaptchaNoise.java (62%) rename smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/kaptcha/KaptchaWordRenderer.java => smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/captcha/config/CaptchaWordRenderer.java (75%) create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/captcha/domain/CaptchaForm.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/captcha/domain/CaptchaVO.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/changelog/constant/ChangeLogTypeEnum.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/changelog/controller/ChangeLogController.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/changelog/dao/ChangeLogDao.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/changelog/domain/entity/ChangeLogEntity.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/changelog/domain/form/ChangeLogAddForm.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/changelog/domain/form/ChangeLogQueryForm.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/changelog/domain/form/ChangeLogUpdateForm.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/changelog/domain/vo/ChangeLogVO.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/changelog/manager/ChangeLogManager.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/changelog/service/ChangeLogService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/constant/CodeDeleteEnum.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/constant/CodeFrontComponentEnum.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/constant/CodeGeneratorConstant.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/constant/CodeGeneratorPageTypeEnum.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/constant/CodeQueryFieldQueryTypeEnum.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/controller/CodeGeneratorController.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/dao/CodeGeneratorConfigDao.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/dao/CodeGeneratorDao.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/entity/CodeGeneratorConfigEntity.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/form/CodeGeneratorConfigForm.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/form/CodeGeneratorPreviewForm.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/form/TableQueryForm.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/model/CodeBasic.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/model/CodeDelete.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/model/CodeField.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/model/CodeInsertAndUpdate.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/model/CodeInsertAndUpdateField.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/model/CodeQueryField.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/model/CodeTableField.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/vo/TableColumnVO.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/vo/TableConfigVO.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/vo/TableVO.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/CodeGeneratorService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/CodeGeneratorTemplateService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/CodeGenerateBaseVariableService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/ControllerVariableService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/DaoVariableService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/ManagerVariableService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/ServiceVariableService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/domain/AddFormVariableService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/domain/DeleteFormVariableService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/domain/EntityVariableService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/domain/MapperVariableService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/domain/QueryFormVariableService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/domain/UpdateFormVariableService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/domain/VOVariableService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/front/ApiVariableService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/front/ConstVariableService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/front/FormVariableService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/front/ListVariableService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/util/CodeGeneratorTool.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/config/ConfigController.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/config/ConfigDao.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/config/ConfigKeyEnum.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/config/ConfigService.java rename smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/domain/dto/SystemConfigAddDTO.java => smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/config/domain/ConfigAddForm.java (61%) create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/config/domain/ConfigEntity.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/config/domain/ConfigQueryForm.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/config/domain/ConfigUpdateForm.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/config/domain/ConfigVO.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/annoation/DataTracerFieldBigDecimal.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/annoation/DataTracerFieldDict.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/annoation/DataTracerFieldEnum.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/annoation/DataTracerFieldLabel.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/annoation/DataTracerFieldSql.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/constant/DataTracerConst.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/constant/DataTracerTypeEnum.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/controller/DataTracerController.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/dao/DataTracerDao.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/domain/bo/DataTracerContentBO.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/domain/entity/DataTracerEntity.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/domain/form/DataTracerForm.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/domain/form/DataTracerQueryForm.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/domain/vo/DataTracerVO.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/manager/DataTracerManger.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/service/DataTracerChangeContentService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/service/DataTracerService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/controller/DictController.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/dao/DictKeyDao.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/dao/DictValueDao.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/domain/entity/DictKeyEntity.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/domain/entity/DictValueEntity.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/domain/form/DictKeyAddForm.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/domain/form/DictKeyQueryForm.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/domain/form/DictKeyUpdateForm.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/domain/form/DictValueAddForm.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/domain/form/DictValueQueryForm.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/domain/form/DictValueUpdateForm.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/domain/vo/DictKeyVO.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/domain/vo/DictValueVO.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/service/DictCacheService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/service/DictService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/feedback/controller/FeedbackController.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/feedback/dao/FeedbackDao.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/feedback/domain/FeedbackAddForm.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/feedback/domain/FeedbackEntity.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/feedback/domain/FeedbackQueryForm.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/feedback/domain/FeedbackVO.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/feedback/service/FeedbackService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/constant/FileFolderTypeEnum.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/controller/FileController.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/dao/FileDao.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/domain/entity/FileEntity.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/domain/form/FileQueryForm.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/domain/form/FileUrlUploadForm.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/domain/vo/FileDownloadVO.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/domain/vo/FileMetadataVO.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/domain/vo/FileUploadVO.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/domain/vo/FileVO.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/service/FileService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/service/FileStorageCloudServiceImpl.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/service/FileStorageLocalServiceImpl.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/service/IFileStorageService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/heartbeat/HeartBeatRecordDao.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/heartbeat/HeartBeatRecordHandler.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/heartbeat/HeartBeatService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/heartbeat/core/HeartBeatManager.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/heartbeat/core/HeartBeatRecord.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/heartbeat/core/HeartBeatRunnable.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/heartbeat/core/IHeartBeatRecordHandler.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/heartbeat/domain/HeartBeatRecordEntity.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/heartbeat/domain/HeartBeatRecordQueryForm.java rename {smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/heartbeat => smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/heartbeat/domain}/HeartBeatRecordVO.java (53%) create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/controller/HelpDocController.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/dao/HelpDocCatalogDao.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/dao/HelpDocDao.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/entity/HelpDocCatalogEntity.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/entity/HelpDocEntity.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/form/HelpDocAddForm.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/form/HelpDocCatalogAddForm.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/form/HelpDocCatalogUpdateForm.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/form/HelpDocQueryForm.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/form/HelpDocRelationForm.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/form/HelpDocUpdateForm.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/form/HelpDocViewRecordQueryForm.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/vo/HelpDocCatalogVO.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/vo/HelpDocDetailVO.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/vo/HelpDocRecordVO.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/vo/HelpDocRelationVO.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/vo/HelpDocVO.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/vo/HelpDocViewRecordVO.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/manager/HelpDocManager.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/service/HelpDocCatalogService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/service/HelpDocService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/service/HelpDocUserService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/jwe/DecryptData.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/jwe/JweAspect.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/jwe/JweDecrypt.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/jwe/JweEncrypt.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/jwe/JweUserKey.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/loginlog/LoginLogDao.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/loginlog/LoginLogResultEnum.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/loginlog/LoginLogService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/loginlog/domain/LoginLogEntity.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/loginlog/domain/LoginLogQueryForm.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/loginlog/domain/LoginLogVO.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/operatelog/OperateLogDao.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/operatelog/OperateLogService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/operatelog/annoation/OperateLog.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/operatelog/core/OperateLogAspect.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/operatelog/core/OperateLogConfig.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/operatelog/domain/OperateLogEntity.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/operatelog/domain/OperateLogQueryForm.java rename smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/useroperatelog/domain/UserOperateLogDTO.java => smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/operatelog/domain/OperateLogVO.java (51%) create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/redis/RedisService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/ReloadCommand.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/ReloadService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/core/AbstractSmartReloadCommand.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/core/SmartReloadManager.java rename {smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/annotation => smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/core/annoation}/SmartReload.java (56%) create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/core/domain/SmartReloadItem.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/core/domain/SmartReloadObject.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/core/domain/SmartReloadResult.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/core/thread/SmartReloadRunnable.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/dao/ReloadItemDao.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/dao/ReloadResultDao.java rename smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/smartreload/domain/dto/ReloadItemUpdateDTO.java => smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/domain/ReloadForm.java (53%) rename {smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/smartreload/domain/entity => smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/domain}/ReloadItemEntity.java (62%) create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/domain/ReloadItemVO.java rename {smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/smartreload/domain/entity => smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/domain}/ReloadResultEntity.java (62%) create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/domain/ReloadResultVO.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/repeatsubmit/RepeatSubmitAspect.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/repeatsubmit/annoation/RepeatSubmit.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/repeatsubmit/ticket/AbstractRepeatSubmitTicket.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/repeatsubmit/ticket/RepeatSubmitCaffeineTicket.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/repeatsubmit/ticket/RepeatSubmitRedisTicket.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/constant/SerialNumberIdEnum.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/constant/SerialNumberRuleTypeEnum.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/dao/SerialNumberDao.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/dao/SerialNumberRecordDao.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/domain/SerialNumberEntity.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/domain/SerialNumberGenerateForm.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/domain/SerialNumberGenerateResultBO.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/domain/SerialNumberInfoBO.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/domain/SerialNumberLastGenerateBO.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/domain/SerialNumberRecordEntity.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/domain/SerialNumberRecordQueryForm.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/service/SerialNumberBaseService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/service/SerialNumberRecordService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/service/SerialNumberService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/service/impl/SerialNumberInternService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/service/impl/SerialNumberMysqlService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/service/impl/SerialNumberRedisService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/table/TableColumnController.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/table/TableColumnDao.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/table/TableColumnService.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/table/domain/TableColumnEntity.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/table/domain/TableColumnItemForm.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/table/domain/TableColumnUpdateForm.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/token/JwtConst.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/token/LoginDeviceEnum.java create mode 100644 smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/token/TokenService.java create mode 100644 smart-admin-api/sa-common/src/main/resources/META-INF/spring.factories rename {smart-admin-service/smart-admin-api => smart-admin-api/sa-common}/src/main/resources/banner.txt (50%) create mode 100644 smart-admin-api/sa-common/src/main/resources/code-generator-template/java/constant/enum.java.vm create mode 100644 smart-admin-api/sa-common/src/main/resources/code-generator-template/java/controller/Controller.java.vm create mode 100644 smart-admin-api/sa-common/src/main/resources/code-generator-template/java/dao/Dao.java.vm create mode 100644 smart-admin-api/sa-common/src/main/resources/code-generator-template/java/domain/entity/Entity.java.vm create mode 100644 smart-admin-api/sa-common/src/main/resources/code-generator-template/java/domain/form/AddForm.java.vm create mode 100644 smart-admin-api/sa-common/src/main/resources/code-generator-template/java/domain/form/QueryForm.java.vm create mode 100644 smart-admin-api/sa-common/src/main/resources/code-generator-template/java/domain/form/UpdateForm.java.vm create mode 100644 smart-admin-api/sa-common/src/main/resources/code-generator-template/java/domain/vo/VO.java.vm create mode 100644 smart-admin-api/sa-common/src/main/resources/code-generator-template/java/manager/Manager.java.vm create mode 100644 smart-admin-api/sa-common/src/main/resources/code-generator-template/java/mapper/Mapper.xml.vm create mode 100644 smart-admin-api/sa-common/src/main/resources/code-generator-template/java/service/Service.java.vm create mode 100644 smart-admin-api/sa-common/src/main/resources/code-generator-template/js/api.js.vm create mode 100644 smart-admin-api/sa-common/src/main/resources/code-generator-template/js/const.js.vm create mode 100644 smart-admin-api/sa-common/src/main/resources/code-generator-template/js/form.vue.vm create mode 100644 smart-admin-api/sa-common/src/main/resources/code-generator-template/js/list.vue.vm create mode 100644 smart-admin-api/sa-common/src/main/resources/code-generator-template/tools.xml create mode 100644 smart-admin-api/sa-common/src/main/resources/dev/sa-common.yaml create mode 100644 smart-admin-api/sa-common/src/main/resources/mapper/support/ChangeLogMapper.xml create mode 100644 smart-admin-api/sa-common/src/main/resources/mapper/support/CodeGeneratorMapper.xml create mode 100644 smart-admin-api/sa-common/src/main/resources/mapper/support/ConfigMapper.xml create mode 100644 smart-admin-api/sa-common/src/main/resources/mapper/support/DataTracerMapper.xml create mode 100644 smart-admin-api/sa-common/src/main/resources/mapper/support/DictKeyMapper.xml create mode 100644 smart-admin-api/sa-common/src/main/resources/mapper/support/DictValueMapper.xml create mode 100644 smart-admin-api/sa-common/src/main/resources/mapper/support/FeedbackMapper.xml create mode 100644 smart-admin-api/sa-common/src/main/resources/mapper/support/FileMapper.xml create mode 100644 smart-admin-api/sa-common/src/main/resources/mapper/support/HeartBeatRecordMapper.xml create mode 100644 smart-admin-api/sa-common/src/main/resources/mapper/support/HelpDocDao.xml create mode 100644 smart-admin-api/sa-common/src/main/resources/mapper/support/LoginLogMapper.xml create mode 100644 smart-admin-api/sa-common/src/main/resources/mapper/support/OperateLogMapper.xml create mode 100644 smart-admin-api/sa-common/src/main/resources/mapper/support/ReloadItemMapper.xml create mode 100644 smart-admin-api/sa-common/src/main/resources/mapper/support/ReloadResultMapper.xml create mode 100644 smart-admin-api/sa-common/src/main/resources/mapper/support/SerialNumberMapper.xml create mode 100644 smart-admin-api/sa-common/src/main/resources/mapper/support/SerialNumberRecordMapper.xml create mode 100644 smart-admin-api/sa-common/src/main/resources/mapper/support/TableColumnMapper.xml create mode 100644 smart-admin-api/sa-common/src/main/resources/pre/sa-common.yaml create mode 100644 smart-admin-api/sa-common/src/main/resources/prod/sa-common.yaml create mode 100644 smart-admin-api/sa-common/src/main/resources/test/sa-common.yaml delete mode 100644 smart-admin-h5/.browserslistrc delete mode 100644 smart-admin-h5/.editorconfig delete mode 100644 smart-admin-h5/.env.development delete mode 100644 smart-admin-h5/.env.local delete mode 100644 smart-admin-h5/.env.pre delete mode 100644 smart-admin-h5/.env.prod delete mode 100644 smart-admin-h5/.env.sit delete mode 100644 smart-admin-h5/.eslintignore delete mode 100644 smart-admin-h5/.eslintrc.js delete mode 100644 smart-admin-h5/.gitignore delete mode 100644 smart-admin-h5/.postcssrc.js delete mode 100644 smart-admin-h5/.prettierrc.js delete mode 100644 smart-admin-h5/.sentryclirc delete mode 100644 smart-admin-h5/README.md delete mode 100644 smart-admin-h5/babel.config.js delete mode 100644 smart-admin-h5/package.json delete mode 100644 smart-admin-h5/public/index.html delete mode 100644 smart-admin-h5/src/App.vue delete mode 100644 smart-admin-h5/src/api/employee.js delete mode 100644 smart-admin-h5/src/api/file.js delete mode 100644 smart-admin-h5/src/api/login.js delete mode 100644 smart-admin-h5/src/api/system-config.js delete mode 100644 smart-admin-h5/src/api/user.js delete mode 100644 smart-admin-h5/src/assets/css/index.scss delete mode 100644 smart-admin-h5/src/assets/logo.png delete mode 100644 smart-admin-h5/src/components/employee/department-employee-selector.vue delete mode 100644 smart-admin-h5/src/components/form/select-picker/SmartEnumSelectPicker.vue delete mode 100644 smart-admin-h5/src/components/form/select-picker/SmartSelectPicker delete mode 100644 smart-admin-h5/src/components/mixin/session-mixin.js delete mode 100644 smart-admin-h5/src/components/van-bar/BackNavBar.vue delete mode 100644 smart-admin-h5/src/components/van-bar/RouterNavBar.vue delete mode 100644 smart-admin-h5/src/config/index.js delete mode 100644 smart-admin-h5/src/constants/area.js delete mode 100644 smart-admin-h5/src/constants/erp/contact-company.js delete mode 100644 smart-admin-h5/src/constants/erp/index.js delete mode 100644 smart-admin-h5/src/constants/file.js delete mode 100644 smart-admin-h5/src/constants/index.js delete mode 100644 smart-admin-h5/src/constants/school.js delete mode 100644 smart-admin-h5/src/filters/filter.js delete mode 100644 smart-admin-h5/src/filters/index.js delete mode 100644 smart-admin-h5/src/lib/cookie.js delete mode 100644 smart-admin-h5/src/lib/erp-http.js delete mode 100644 smart-admin-h5/src/lib/http.js delete mode 100644 smart-admin-h5/src/lib/local.js delete mode 100644 smart-admin-h5/src/lib/menu-func.js delete mode 100644 smart-admin-h5/src/lib/printPlugs.js delete mode 100644 smart-admin-h5/src/lib/render-dom.js delete mode 100644 smart-admin-h5/src/lib/smart-sentry.js delete mode 100644 smart-admin-h5/src/lib/util.js delete mode 100644 smart-admin-h5/src/lib/watermark.js delete mode 100644 smart-admin-h5/src/main.js delete mode 100644 smart-admin-h5/src/plugins/smart-sentry.js delete mode 100644 smart-admin-h5/src/plugins/smart.js delete mode 100644 smart-admin-h5/src/plugins/vant.js delete mode 100644 smart-admin-h5/src/router/dashboard/index.js delete mode 100644 smart-admin-h5/src/router/develop/develop.js delete mode 100644 smart-admin-h5/src/router/error/error.js delete mode 100644 smart-admin-h5/src/router/index.js delete mode 100644 smart-admin-h5/src/router/login/login.js delete mode 100644 smart-admin-h5/src/router/router-const.js delete mode 100644 smart-admin-h5/src/router/routers.js delete mode 100644 smart-admin-h5/src/router/user/user.js delete mode 100644 smart-admin-h5/src/store/index.js delete mode 100644 smart-admin-h5/src/store/module/app.js delete mode 100644 smart-admin-h5/src/store/module/user.js delete mode 100644 smart-admin-h5/src/themes/index.scss delete mode 100644 smart-admin-h5/src/utils/index.js delete mode 100644 smart-admin-h5/src/utils/request.js delete mode 100644 smart-admin-h5/src/utils/validate.js delete mode 100644 smart-admin-h5/src/views/dashboard/dashboard.vue delete mode 100644 smart-admin-h5/src/views/develop/config.vue delete mode 100644 smart-admin-h5/src/views/error/404.vue delete mode 100644 smart-admin-h5/src/views/login/login.vue delete mode 100644 smart-admin-h5/src/views/user/change-password.vue delete mode 100644 smart-admin-h5/src/views/user/index.vue delete mode 100644 smart-admin-h5/vue.config.js delete mode 100644 smart-admin-service/README.md delete mode 100644 smart-admin-service/pom.xml delete mode 100644 smart-admin-service/smart-admin-api/doc/readme.txt delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/SmartAdminApplication.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/anno/NoValidPrivilege.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/anno/OperateLog.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/constant/CommentSortTypeEnum.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/constant/JudgeEnum.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/constant/ResponseCodeConst.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/controller/BaseController.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/domain/BaseEntity.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/domain/ITask.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/domain/OrderItemDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/domain/PageParamDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/domain/ResponseDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/exception/SmartBusinessException.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/exception/SmartResponseCodeException.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/heartbeat/AbstractHeartBeatCommand.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/heartbeat/HeartBeatConfig.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/heartbeat/HeartBeatLogger.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/heartbeat/HeartBeatRecordCommendInterface.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/heartbeat/HeartBeatRecordDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/heartbeat/HeatBeatRecordHelper.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/heartbeat/IpUtil.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/heartbeat/StringUtil.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/SmartReloadManager.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/SmartReloadScheduler.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/abstracts/AbstractSmartReloadCommand.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/abstracts/AbstractSmartReloadCommand4Spring.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/domain/AbstractSmartReloadObject.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/domain/AnnotationReloadObject.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/domain/InterfaceReloadObject.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/domain/entity/ReloadItem.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/domain/entity/SmartReloadResult.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/interfaces/SmartReloadCommandInterface.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/interfaces/SmartReloadThreadLogger.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/interfaces/SmartReloadable.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/validator/bigdecimal/BigDecimalValidator.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/validator/bigdecimal/CheckBigDecimal.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/validator/bigdecimal/ComparisonSymbolEnum.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartAdminWebAppConfig.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartHeartBeatConfig.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartMybatisPlusConfig.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartReloadConfig.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartRestTemplateConfig.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartSwaggerApiModelEnumConfig.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartSwaggerDynamicGroupConfig.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartWebSocketConfig.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SystemEnvironmentCondition.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/constant/CommonConst.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/constant/SmartReloadTagConst.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/constant/SwaggerTagConst.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/constant/SystemEnvironmentEnum.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/handler/SmartGlobalExceptionHandler.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/handler/SmartOperateLogAspect.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/interceptor/SmartAuthenticationInterceptor.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/listener/SmartAdminStartupRunner.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/email/EmailController.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/email/EmailDao.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/email/EmailSendStatusEnum.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/email/EmailService.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/email/domain/dto/EmailConfigDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/email/domain/dto/EmailDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/email/domain/dto/EmailQueryDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/email/domain/dto/EmailVO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/email/domain/entity/EmailEntity.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/LogService.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/orderoperatelog/OrderOperateLogController.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/orderoperatelog/OrderOperateLogDao.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/orderoperatelog/OrderOperateLogService.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/orderoperatelog/constant/OrderOperateLogDefaultEmpEnum.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/orderoperatelog/constant/OrderOperateLogOperateTypeConst.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/orderoperatelog/constant/OrderOperateLogOrderTypeEnum.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/orderoperatelog/domain/dto/OrderOperateLogSaveDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/orderoperatelog/domain/dto/SupplierOrderOperateVO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/orderoperatelog/domain/entity/OrderOperateLogEntity.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/orderoperatelog/domain/vo/OrderOperateLogVO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/userloginlog/UserLoginLogController.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/userloginlog/UserLoginLogDao.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/userloginlog/UserLoginLogService.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/userloginlog/domain/UserLoginLogDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/userloginlog/domain/UserLoginLogEntity.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/userloginlog/domain/UserLoginLogQueryDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/useroperatelog/UserOperateLogController.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/useroperatelog/UserOperateLogDao.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/useroperatelog/UserOperateLogService.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/useroperatelog/domain/UserOperateLogEntity.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/useroperatelog/domain/UserOperateLogQueryDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/NoticeController.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/NoticeManage.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/NoticeService.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/dao/NoticeDao.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/dao/NoticeReceiveRecordDao.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/domain/dto/NoticeAddDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/domain/dto/NoticeDetailVO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/domain/dto/NoticeQueryDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/domain/dto/NoticeReadCountDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/domain/dto/NoticeReceiveDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/domain/dto/NoticeReceiveQueryDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/domain/dto/NoticeUpdateDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/domain/dto/NoticeVO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/domain/entity/NoticeEntity.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/domain/entity/NoticeReceiveRecordEntity.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/peony/controller/PeonyController.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/peony/dao/PeonyDao.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/peony/domain/dto/PeonyAddDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/peony/domain/dto/PeonyQueryDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/peony/domain/dto/PeonyUpdateDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/peony/domain/entity/PeonyEntity.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/peony/domain/vo/PeonyExcelVO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/peony/domain/vo/PeonyVO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/peony/service/PeonyService.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/codegenerator/constant/SqlOperateTypeEnum.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/codegenerator/dao/TableDao.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/codegenerator/domain/CodeGeneratorDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/codegenerator/domain/CodeGeneratorQueryColumnDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/codegenerator/domain/ColumnVO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/codegenerator/domain/QueryFieldVO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/codegenerator/service/CodeGeneratorComponent.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/codegenerator/service/CodeGeneratorService.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/FileController.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/FileDao.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/constant/FileModuleTypeEnum.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/constant/FileResponseCodeConst.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/constant/FileServiceNameConst.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/constant/FileServiceTypeEnum.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/domain/dto/FileAddDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/domain/dto/FileDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/domain/dto/FileQueryDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/domain/dto/OSSConfig.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/domain/entity/FileEntity.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/domain/vo/FileVO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/domain/vo/UploadVO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/service/FileService.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/service/FileServiceAliYun.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/service/FileServiceLocal.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/service/FileServiceQiNiuYun.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/service/IFileService.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/heartbeat/HeartBeatController.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/heartbeat/HeartBeatRecordDao.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/heartbeat/HeartBeatRecordEntity.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/heartbeat/HeartBeatService.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/idgenerator/IdGeneratorDao.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/idgenerator/IdGeneratorManager.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/idgenerator/IdGeneratorService.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/idgenerator/constant/IdGeneratorEnum.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/idgenerator/constant/IdGeneratorRuleTypeEnum.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/idgenerator/domain/IdGeneratorEntity.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/idgenerator/domain/IdGeneratorLastNumberDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/idgenerator/domain/IdGeneratorPOJO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/idgenerator/domain/IdGeneratorRecordDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/constant/QuartzConst.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/constant/TaskResultEnum.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/constant/TaskStatusEnum.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/controller/QuartzController.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/dao/QuartzTaskDao.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/dao/QuartzTaskLogDao.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/domain/dto/QuartzLogQueryDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/domain/dto/QuartzQueryDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/domain/dto/QuartzTaskDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/domain/dto/QuartzTaskLogVO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/domain/dto/QuartzTaskVO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/domain/entity/QuartzTaskEntity.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/domain/entity/QuartzTaskLogEntity.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/service/QuartzTask.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/service/QuartzTaskLogService.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/service/QuartzTaskService.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/task/test/Example.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/smartreload/SmartReloadCommand.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/smartreload/SmartReloadController.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/smartreload/SmartReloadService.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/smartreload/dao/ReloadItemDao.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/smartreload/dao/ReloadResultDao.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/smartreload/domain/dto/ReloadItemVO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/smartreload/domain/dto/ReloadResultVO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/websocket/MessageTypeEnum.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/websocket/WebSocketServer.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/websocket/domain/MessageCommonDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/websocket/domain/MessageDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/websocket/domain/WebSocketHeartBeatDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/DataScopeController.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/DataScopeRoleDao.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/constant/DataScopeViewTypeEnum.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/constant/DataScopeWhereInTypeEnum.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/domain/dto/DataScopeBatchSetDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/domain/dto/DataScopeBatchSetRoleDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/domain/dto/DataScopeSelectVO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/domain/dto/DataScopeSqlConfigDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/domain/entity/DataScopeRoleEntity.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/service/DataScopeService.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/strategy/DataScopePowerStrategy.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/department/DepartmentController.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/department/DepartmentDao.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/department/DepartmentResponseCodeConst.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/department/DepartmentService.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/department/DepartmentTreeService.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/department/domain/dto/DepartmentUpdateDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/department/domain/dto/DepartmentVO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/department/domain/entity/DepartmentEntity.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/EmployeeController.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/EmployeeDao.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/EmployeeService.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/constant/EmployeeResponseCodeConst.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/constant/EmployeeStatusEnum.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/bo/EmployeeBO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/dto/EmployeeAddDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/dto/EmployeeBaseDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/dto/EmployeeBatchUpdateStatusDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/dto/EmployeeDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/dto/EmployeeLoginFormDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/dto/EmployeeQueryDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/dto/EmployeeQueryExportDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/dto/EmployeeUpdateDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/dto/EmployeeUpdatePwdDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/dto/EmployeeUpdateRolesDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/entity/EmployeeEntity.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/vo/EmployeeVO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/login/LoginController.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/login/LoginResponseCodeConst.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/login/LoginService.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/login/LoginTokenService.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/login/domain/KaptchaVO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/login/domain/LoginCacheDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/login/domain/LoginDetailVO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/login/domain/LoginPrivilegeDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/login/domain/RequestTokenBO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/PositionController.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/PositionDao.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/PositionResponseCodeConst.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/PositionService.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/domain/dto/PositionAddDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/domain/dto/PositionQueryDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/domain/dto/PositionRelationAddDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/domain/dto/PositionRelationQueryDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/domain/dto/PositionRelationResultDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/domain/dto/PositionResultVO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/domain/dto/PositionUpdateDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/domain/entity/PositionEntity.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/domain/entity/PositionRelationEntity.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/constant/PrivilegeResponseCodeConst.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/constant/PrivilegeTypeEnum.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/controller/PrivilegeController.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/dao/PrivilegeDao.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/domain/dto/PrivilegeFunctionDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/domain/dto/PrivilegeFunctionVO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/domain/dto/PrivilegeMenuDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/domain/dto/PrivilegeMenuVO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/domain/dto/PrivilegeRequestUrlVO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/domain/entity/PrivilegeEntity.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/service/PrivilegeEmployeeService.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/service/PrivilegeRequestUrlService.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/service/PrivilegeService.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/RoleController.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/RoleDao.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/RoleResponseCodeConst.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/RoleService.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/domain/dto/RoleQueryDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/domain/dto/RoleSelectedVO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/domain/dto/RoleUpdateDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/domain/entity/RoleEntity.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleemployee/RoleEmployeeController.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleemployee/RoleEmployeeService.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleemployee/domain/RoleEmployeeDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleemployee/domain/RoleEmployeeEntity.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleprivilege/RolePrivilegeController.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleprivilege/RolePrivilegeDao.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleprivilege/RolePrivilegeService.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleprivilege/domain/dto/RolePrivilegeDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleprivilege/domain/dto/RolePrivilegeSimpleDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleprivilege/domain/dto/RolePrivilegeTreeVO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleprivilege/domain/entity/RolePrivilegeEntity.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/SystemConfigController.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/SystemConfigDao.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/SystemConfigService.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/constant/SystemConfigDataType.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/constant/SystemConfigEnum.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/constant/SystemConfigResponseCodeConst.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/domain/dto/SystemConfigDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/domain/dto/SystemConfigQueryDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/domain/dto/SystemConfigUpdateDTO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/domain/dto/SystemConfigVO.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/domain/entity/SystemConfigEntity.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/third/SmartApplicationContext.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/third/SmartRedisService.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartBaseEnumUtil.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartDateUtil.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartDigestUtil.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartFileUtil.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartHttpUtil.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartIPUtil.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartPageUtil.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartQuartzUtil.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartRequestTokenUtil.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartSendMailUtil.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartThreadFactory.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/excel/SmartExcel.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/excel/SmartExcelFileType.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/excel/SmartExcelReader.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/excel/SmartSheet.java delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/dev/application.properties delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/dev/spy.properties delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/mapper/business/email/EmailMapper.xml delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/mapper/business/log/OrderOperateLogMapper.xml delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/mapper/business/log/UserLoginLogMapper.xml delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/mapper/business/log/UserOperateLogMapper.xml delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/mapper/business/notice/NoticeMapper.xml delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/mapper/business/notice/NoticeReceiveRecordMapper.xml delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/mapper/business/peony/PeonyMapper.xml delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/mapper/support/codegenerator/TableMapper.xml delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/mapper/support/file/FileMapper.xml delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/mapper/support/heartbeat/HeartBeatRecordMapper.xml delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/mapper/support/idgenerator/IdGeneratorMapper.xml delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/mapper/support/quartz/QuartzTaskLogMapper.xml delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/mapper/support/quartz/QuartzTaskMapper.xml delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/mapper/support/smartreload/ReloadItemMapper.xml delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/mapper/support/smartreload/ReloadResultMapper.xml delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/mapper/system/department/DepartmentMapper.xml delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/mapper/system/employee/EmployeeMapper.xml delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/mapper/system/position/PositionMapper.xml delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/mapper/system/privilege/PrivilegeMapper.xml delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/mapper/system/role/RoleEmployeeMapper.xml delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/mapper/system/role/RoleMapper.xml delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/mapper/system/role/RolePrivilegeMapper.xml delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/mapper/system/systemconfig/SystemConfigMapper.xml delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/pre/application.properties delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/prod/application.properties delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/sit/application.properties delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/sit/spy.properties delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/sql/quartz_mysql_2.3.0.sql delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/sql/smart-admin.sql delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/java/AddDTO.java.vm delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/java/Controller.java.vm delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/java/Dao.java.vm delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/java/Dao.xml.vm delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/java/Entity.java.vm delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/java/ExcelVO.java.vm delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/java/QueryDTO.java.vm delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/java/Service.java.vm delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/java/UpdateDTO.java.vm delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/java/VO.java.vm delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/web/Api.js.vm delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/web/List.vue.vm delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/web/ListForm.vue.vm delete mode 100644 smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/web/Router.js.vm delete mode 100644 smart-admin-service/smart-admin-api/src/test/java/net/lab1024/smartadmin/BaseTest.java delete mode 100644 smart-admin-service/smart-admin-api/src/test/java/net/lab1024/smartadmin/SmartAdminApplicationTests.java delete mode 100644 smart-admin-service/smart-admin-api/src/test/java/net/lab1024/smartadmin/module/support/codegenerator/CodeGeneratorServiceTest.java delete mode 100644 smart-admin-web/.babelrc delete mode 100644 smart-admin-web/.editorconfig delete mode 100644 smart-admin-web/.env.development delete mode 100644 smart-admin-web/.env.local delete mode 100644 smart-admin-web/.env.prod delete mode 100644 smart-admin-web/.env.sit delete mode 100644 smart-admin-web/.eslintrc.js delete mode 100644 smart-admin-web/.gitignore delete mode 100644 smart-admin-web/.travis.yml delete mode 100644 smart-admin-web/README.md delete mode 100644 smart-admin-web/cypress.json delete mode 100644 smart-admin-web/doc/notice.txt create mode 100644 smart-admin-web/javascript-ant-design-vue3/.env create mode 100644 smart-admin-web/javascript-ant-design-vue3/.env.development create mode 100644 smart-admin-web/javascript-ant-design-vue3/.env.localhost create mode 100644 smart-admin-web/javascript-ant-design-vue3/.env.pre create mode 100644 smart-admin-web/javascript-ant-design-vue3/.env.production create mode 100644 smart-admin-web/javascript-ant-design-vue3/.env.test create mode 100644 smart-admin-web/javascript-ant-design-vue3/.eslintignore create mode 100644 smart-admin-web/javascript-ant-design-vue3/.eslintrc.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/.gitignore create mode 100644 smart-admin-web/javascript-ant-design-vue3/.prettierrc.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/.stylelintignore create mode 100644 smart-admin-web/javascript-ant-design-vue3/.stylelintrc.js rename smart-admin-web/{.eslintignore => javascript-ant-design-vue3/README.en.md} (100%) rename smart-admin-web/{src/filters/index.js => javascript-ant-design-vue3/README.md} (100%) create mode 100644 smart-admin-web/javascript-ant-design-vue3/index.html create mode 100644 smart-admin-web/javascript-ant-design-vue3/jsconfig.json create mode 100644 smart-admin-web/javascript-ant-design-vue3/package.json rename smart-admin-web/{.postcssrc.js => javascript-ant-design-vue3/postcss.config.js} (54%) rename {smart-admin-h5 => smart-admin-web/javascript-ant-design-vue3}/public/favicon.ico (100%) create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/App.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/api/business/category/category-api.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/api/business/goods/goods-api.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/api/business/oa/bank-api.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/api/business/oa/enterprise-api.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/api/business/oa/invoice-api.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/api/business/oa/notice-api.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/api/support/cache/cache-api.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/api/support/change-log/change-log-api.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/api/support/code-generator/code-generator-api.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/api/support/config/config-api.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/api/support/data-tracer/data-tracer-api.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/api/support/dict/dict-api.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/api/support/feedback/feedback-api.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/api/support/file/file-api.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/api/support/heart-beat/heart-beat-api.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/api/support/help-doc/help-doc-api.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/api/support/help-doc/help-doc-catalog-api.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/api/support/login-log/login-log-api.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/api/support/operate-log/operate-log-api.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/api/support/reload/reload-api.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/api/support/serial-number/serial-number-api.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/api/support/table/table-column-api.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/api/system/department/department-api.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/api/system/employee/employee-api.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/api/system/home/home-api.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/api/system/login/login-api.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/api/system/menu/menu-api.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/api/system/role-menu/role-menu-api.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/api/system/role/role-api.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/assets/images/1024lab/1024lab-gzh.jpg create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/assets/images/1024lab/xiaozhen-gzh.jpg create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/assets/images/1024lab/zhuoda-wechat.jpg create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/assets/images/login/ali-icon.png create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/assets/images/login/google-icon.png create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/assets/images/login/login-bg.jpg create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/assets/images/login/login-form-open-eyes-close.png create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/assets/images/login/login-form-open-eyes.png create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/assets/images/login/login-qr.png create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/assets/images/login/qq-icon.png create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/assets/images/login/wechat-icon.png create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/assets/images/login/weibo-icon.png rename smart-admin-web/{src/assets/images => javascript-ant-design-vue3/src/assets/images/logo}/logo-min.png (100%) create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/assets/images/logo/logo.png create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/assets/images/logo/smart-admin-logo-white.png create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/assets/images/logo/smart-admin-logo.png create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/assets/images/notice/edit_icon.png create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/assets/images/notice/file_icon.png create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/components/business/category-tree-select/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/components/business/oa/enterprise-bank-select/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/components/business/oa/enterprise-invoice-select/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/components/business/oa/enterprise-select/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/components/framework/area-cascader/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/components/framework/area-cascader/province-city-district.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/components/framework/area-cascader/province-city.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/components/framework/boolean-select/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/components/framework/icon-select/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/components/framework/iframe/iframe-index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/components/framework/iframe/route-default-component.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/components/framework/smart-enum-checkbox/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/components/framework/smart-enum-radio/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/components/framework/smart-enum-select/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/components/framework/smart-loading/index.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/components/framework/wangeditor/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/components/support/data-tracer/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/components/support/dict-key-select/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/components/support/dict-select/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/components/support/file-preview-modal/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/components/support/file-preview/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/components/support/file-upload/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/components/support/table-operator/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/components/support/table-operator/smart-table-column-merge.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/components/support/table-operator/smart-table-column-modal.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/components/system/department-tree-select/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/components/system/employee-select/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/components/system/employee-table-select-modal/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/components/system/menu-tree-select/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/config/app-config.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/constants/business/erp/category-const.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/constants/business/erp/goods-const.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/constants/business/oa/enterprise-const.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/constants/business/oa/notice-const.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/constants/common-const.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/constants/index.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/constants/layout-const.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/constants/local-storage-key-const.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/constants/regular-const.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/constants/support/change-log-const.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/constants/support/code-generator-const.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/constants/support/data-tracer-const.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/constants/support/file-const.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/constants/support/login-log-const.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/constants/support/table-id-const.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/constants/system/employee-const.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/constants/system/home-const.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/constants/system/login-device-const.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/constants/system/menu-const.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/directives/privilege.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/i18n/index.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/i18n/lang/en-US/index.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/i18n/lang/zh-CN/index.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/layout/components/header-user-space/header-avatar.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/layout/components/header-user-space/header-message.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/layout/components/header-user-space/header-reset-password-modal/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/layout/components/header-user-space/header-setting.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/layout/components/header-user-space/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/layout/components/menu-location-breadcrumb/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/layout/components/page-tag/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/layout/components/side-expand-menu/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/layout/components/side-expand-menu/recursion-menu.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/layout/components/side-expand-menu/sub-menu.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/layout/components/side-expand-menu/top-menu.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/layout/components/side-help-doc/components/contact-modal.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/layout/components/side-help-doc/components/feedback-modal.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/layout/components/side-help-doc/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/layout/components/side-menu/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/layout/components/side-menu/recursion-menu.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/layout/components/side-menu/sub-menu.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/layout/components/smart-footer/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/layout/smart-help-doc-layout.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/layout/smart-keep-alive.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/layout/smart-layout.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/layout/smart-side-expand-layout.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/layout/smart-side-layout.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/lib/axios.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/lib/default-time-ranges.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/lib/highlight-line-number.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/lib/smart-sentry.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/lib/smart-wartermark.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/main.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/plugins/privilege-plugin.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/plugins/smart-enums-plugin.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/router/index.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/router/routers.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/router/support/help-doc.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/router/system/home.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/router/system/login.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/store/index.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/store/modules/system/app-config.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/store/modules/system/role.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/store/modules/system/spin.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/store/modules/system/user.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/theme/index.less create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/theme/smart-admin.less create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/utils/cookie-util.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/utils/local-util.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/utils/str-util.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/business/erp/catalog/components/category-form-modal.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/business/erp/catalog/components/category-tree-table.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/business/erp/catalog/custom-catalog.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/business/erp/catalog/goods-catalog.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/business/erp/goods/components/goods-form-modal.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/business/erp/goods/goods-list.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/business/oa/enterprise/components/enterprise-bank-list.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/business/oa/enterprise/components/enterprise-bank-operate-modal.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/business/oa/enterprise/components/enterprise-employee-list.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/business/oa/enterprise/components/enterprise-invoice-list.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/business/oa/enterprise/components/enterprise-invoice-operate-modal.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/business/oa/enterprise/components/enterprise-operate-modal.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/business/oa/enterprise/enterprise-detail.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/business/oa/enterprise/enterprise-list.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/business/oa/notice/components/notice-form-drawer.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/business/oa/notice/components/notice-form-visible-modal.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/business/oa/notice/components/notice-form-visible-transfer-department.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/business/oa/notice/components/notice-form-visible-transfer-employee.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/business/oa/notice/components/notice-view-record-list.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/business/oa/notice/notice-detail.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/business/oa/notice/notice-employee-detail.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/business/oa/notice/notice-employee-list.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/business/oa/notice/notice-list.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/support/cache/cache-list.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/support/change-log/change-log-form.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/support/change-log/change-log-list.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/support/change-log/change-log-modal.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/support/code-generator/code-generator-list.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/support/code-generator/code-generator-util.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/support/code-generator/components/form/code-generator-table-config-form-basic.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/support/code-generator/components/form/code-generator-table-config-form-delete.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/support/code-generator/components/form/code-generator-table-config-form-field.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/support/code-generator/components/form/code-generator-table-config-form-insert-and-update.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/support/code-generator/components/form/code-generator-table-config-form-query-field.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/support/code-generator/components/form/code-generator-table-config-form-table-field.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/support/code-generator/components/form/code-generator-table-config-form.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/support/code-generator/components/preview/code-generator-preview-modal.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/support/config/config-form-modal.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/support/config/config-list.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/support/dict/components/dict-key-operate-modal.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/support/dict/components/dict-value-modal.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/support/dict/components/dict-value-operate-modal.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/support/dict/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/support/feedback/feedback-list.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/support/file/file-list.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/support/heart-beat/heart-beat-list.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/support/help-doc/management/components/help-doc-catalog-form-modal.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/support/help-doc/management/components/help-doc-catalog-tree-select.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/support/help-doc/management/components/help-doc-catalog-tree.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/support/help-doc/management/components/help-doc-form-drawer.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/support/help-doc/management/components/help-doc-list.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/support/help-doc/management/help-doc-manage-list.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/support/help-doc/management/help-doc-mitt.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/support/help-doc/user-view/components/help-doc-view-record-list.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/support/help-doc/user-view/help-doc-user-view.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/support/login-log/login-log-list.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/support/operate-log/operate-log-detail-modal.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/support/operate-log/operate-log-list.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/support/reload/do-reload-form-modal.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/support/reload/reload-list.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/support/reload/reload-result-list.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/support/serial-number/serial-number-generate-form-modal.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/support/serial-number/serial-number-list.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/support/serial-number/serial-number-record-list.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/40X/403.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/40X/404.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/employee/department/components/department-children/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/employee/department/components/department-form-modal/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/employee/department/components/department-tree/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/employee/department/components/employee-department-form-modal/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/employee/department/components/employee-form-modal/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/employee/department/components/employee-list/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/employee/department/components/employee-password-dialog/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/employee/department/department-mitt.ts create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/employee/department/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/employee/role/components/role-data-scope/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/employee/role/components/role-employee-list/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/employee/role/components/role-form-modal/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/employee/role/components/role-list/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/employee/role/components/role-setting/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/employee/role/components/role-tree/index.less create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/employee/role/components/role-tree/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/employee/role/components/role-tree/role-tree-checkbox.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/employee/role/components/role-tree/role-tree-menu.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/employee/role/components/role-tree/role-tree-point.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/employee/role/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/home/components/changelog-card.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/home/components/default-home-card.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/home/components/echarts/category.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/home/components/echarts/gauge.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/home/components/echarts/gradient.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/home/components/echarts/pie.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/home/components/official-account-card.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/home/components/quick-entry/home-quick-entry-modal.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/home/components/quick-entry/home-quick-entry.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/home/components/quick-entry/init-quick-entry-list.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/home/components/to-be-done-card.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/home/home-header.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/home/home-notice.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/home/index.less create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/home/index.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/login/login.less create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/login/login.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/menu/components/menu-operate-modal.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/menu/components/menu-tree-select.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/menu/menu-data-handler.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/menu/menu-list-table-columns.js create mode 100644 smart-admin-web/javascript-ant-design-vue3/src/views/system/menu/menu-list.vue create mode 100644 smart-admin-web/javascript-ant-design-vue3/vite.config.js delete mode 100644 smart-admin-web/package-lock.json delete mode 100644 smart-admin-web/package.json delete mode 100644 smart-admin-web/public/index.html delete mode 100644 smart-admin-web/src/App.vue delete mode 100644 smart-admin-web/src/api/data-scope.js delete mode 100644 smart-admin-web/src/api/department.js delete mode 100644 smart-admin-web/src/api/email.js delete mode 100644 smart-admin-web/src/api/employee.js delete mode 100644 smart-admin-web/src/api/file.js delete mode 100644 smart-admin-web/src/api/heart-beat.js delete mode 100644 smart-admin-web/src/api/login.js delete mode 100644 smart-admin-web/src/api/notice.js delete mode 100644 smart-admin-web/src/api/online-user.js delete mode 100644 smart-admin-web/src/api/peony.js delete mode 100644 smart-admin-web/src/api/position.js delete mode 100644 smart-admin-web/src/api/privilege.js delete mode 100644 smart-admin-web/src/api/role.js delete mode 100644 smart-admin-web/src/api/smart-reload.js delete mode 100644 smart-admin-web/src/api/system-config.js delete mode 100644 smart-admin-web/src/api/task-manage.js delete mode 100644 smart-admin-web/src/api/user-log.js delete mode 100644 smart-admin-web/src/api/user.js delete mode 100644 smart-admin-web/src/assets/icons/demo.css delete mode 100644 smart-admin-web/src/assets/icons/demo_index.html delete mode 100644 smart-admin-web/src/assets/icons/download (4)/font_1299963_2zqwx2axi0j/demo.css delete mode 100644 smart-admin-web/src/assets/icons/download (4)/font_1299963_2zqwx2axi0j/demo_index.html delete mode 100644 smart-admin-web/src/assets/icons/download (4)/font_1299963_2zqwx2axi0j/iconfont.css delete mode 100644 smart-admin-web/src/assets/icons/download (4)/font_1299963_2zqwx2axi0j/iconfont.eot delete mode 100644 smart-admin-web/src/assets/icons/download (4)/font_1299963_2zqwx2axi0j/iconfont.js delete mode 100644 smart-admin-web/src/assets/icons/download (4)/font_1299963_2zqwx2axi0j/iconfont.svg delete mode 100644 smart-admin-web/src/assets/icons/download (4)/font_1299963_2zqwx2axi0j/iconfont.ttf delete mode 100644 smart-admin-web/src/assets/icons/download (4)/font_1299963_2zqwx2axi0j/iconfont.woff delete mode 100644 smart-admin-web/src/assets/icons/download (4)/font_1299963_2zqwx2axi0j/iconfont.woff2 delete mode 100644 smart-admin-web/src/assets/icons/iconfont.css delete mode 100644 smart-admin-web/src/assets/icons/iconfont.eot delete mode 100644 smart-admin-web/src/assets/icons/iconfont.js delete mode 100644 smart-admin-web/src/assets/icons/iconfont.svg delete mode 100644 smart-admin-web/src/assets/icons/iconfont.ttf delete mode 100644 smart-admin-web/src/assets/icons/iconfont.woff delete mode 100644 smart-admin-web/src/assets/icons/iconfont.woff2 delete mode 100644 smart-admin-web/src/assets/images/default_icon.png delete mode 100644 smart-admin-web/src/assets/images/error-page/error-401.svg delete mode 100644 smart-admin-web/src/assets/images/error-page/error-404.svg delete mode 100644 smart-admin-web/src/assets/images/error-page/error-500.svg delete mode 100644 smart-admin-web/src/assets/images/icon-qr-qq-wechat.png delete mode 100644 smart-admin-web/src/assets/images/icon-social-bilibili.svg delete mode 100644 smart-admin-web/src/assets/images/icon-social-juejin.svg delete mode 100644 smart-admin-web/src/assets/images/icon-social-twitter.svg delete mode 100644 smart-admin-web/src/assets/images/icon-social-zhihu.svg delete mode 100644 smart-admin-web/src/assets/images/login-alipay.png delete mode 100644 smart-admin-web/src/assets/images/login-bg.jpg delete mode 100644 smart-admin-web/src/assets/images/login-logo.png delete mode 100644 smart-admin-web/src/assets/images/login-sina.png delete mode 100644 smart-admin-web/src/assets/images/login-taobao.png delete mode 100644 smart-admin-web/src/assets/images/login_desc_bg.png delete mode 100644 smart-admin-web/src/assets/images/login_logo.png delete mode 100644 smart-admin-web/src/assets/images/logo.png delete mode 100644 smart-admin-web/src/assets/images/logo1.png delete mode 100644 smart-admin-web/src/assets/images/message.png delete mode 100644 smart-admin-web/src/assets/images/shadow.png delete mode 100644 smart-admin-web/src/assets/images/slider/sub_slider_active.png delete mode 100644 smart-admin-web/src/assets/images/slider/sub_slider_default.png delete mode 100644 smart-admin-web/src/assets/style/lib/animate.css delete mode 100644 smart-admin-web/src/components/active-plate/active-plate.vue delete mode 100644 smart-admin-web/src/components/charts/bar.vue delete mode 100644 smart-admin-web/src/components/charts/index.js delete mode 100644 smart-admin-web/src/components/charts/pie.vue delete mode 100644 smart-admin-web/src/components/charts/theme.json delete mode 100644 smart-admin-web/src/components/common-icon/common-icon.vue delete mode 100644 smart-admin-web/src/components/common-icon/index.js delete mode 100644 smart-admin-web/src/components/count-to/count-to.vue delete mode 100644 smart-admin-web/src/components/count-to/index.js delete mode 100644 smart-admin-web/src/components/count-to/index.less delete mode 100644 smart-admin-web/src/components/editor/editor.vue delete mode 100644 smart-admin-web/src/components/editor/index.js delete mode 100644 smart-admin-web/src/components/employee/employee-selector.vue delete mode 100644 smart-admin-web/src/components/icons/icons.vue delete mode 100644 smart-admin-web/src/components/icons/index.js delete mode 100644 smart-admin-web/src/components/main/components/a-back-top/index.js delete mode 100644 smart-admin-web/src/components/main/components/a-back-top/index.vue delete mode 100644 smart-admin-web/src/components/main/components/fullscreen/fullscreen.vue delete mode 100644 smart-admin-web/src/components/main/components/fullscreen/index.js delete mode 100644 smart-admin-web/src/components/main/components/header-bar/custom-bread-crumb/custom-bread-crumb.less delete mode 100644 smart-admin-web/src/components/main/components/header-bar/custom-bread-crumb/custom-bread-crumb.vue delete mode 100644 smart-admin-web/src/components/main/components/header-bar/custom-bread-crumb/index.js delete mode 100644 smart-admin-web/src/components/main/components/header-bar/header-bar.less delete mode 100644 smart-admin-web/src/components/main/components/header-bar/header-bar.vue delete mode 100644 smart-admin-web/src/components/main/components/header-bar/index.js delete mode 100644 smart-admin-web/src/components/main/components/header-bar/sider-trigger/index.js delete mode 100644 smart-admin-web/src/components/main/components/header-bar/sider-trigger/sider-trigger.less delete mode 100644 smart-admin-web/src/components/main/components/header-bar/sider-trigger/sider-trigger.vue delete mode 100644 smart-admin-web/src/components/main/components/language/index.js delete mode 100644 smart-admin-web/src/components/main/components/language/language.vue delete mode 100644 smart-admin-web/src/components/main/components/notice/notice.vue delete mode 100644 smart-admin-web/src/components/main/components/side-menu/collapsed-menu.vue delete mode 100644 smart-admin-web/src/components/main/components/side-menu/index.js delete mode 100644 smart-admin-web/src/components/main/components/side-menu/item-mixin.js delete mode 100644 smart-admin-web/src/components/main/components/side-menu/mixin.js delete mode 100644 smart-admin-web/src/components/main/components/side-menu/side-menu-item.vue delete mode 100644 smart-admin-web/src/components/main/components/side-menu/side-menu.less delete mode 100644 smart-admin-web/src/components/main/components/side-menu/side-menu.vue delete mode 100644 smart-admin-web/src/components/main/components/tags-nav/index.js delete mode 100644 smart-admin-web/src/components/main/components/tags-nav/tags-nav.less delete mode 100644 smart-admin-web/src/components/main/components/tags-nav/tags-nav.vue delete mode 100644 smart-admin-web/src/components/main/components/user/index.js delete mode 100644 smart-admin-web/src/components/main/components/user/user.less delete mode 100644 smart-admin-web/src/components/main/components/user/user.vue delete mode 100644 smart-admin-web/src/components/main/index.js delete mode 100644 smart-admin-web/src/components/main/main.less delete mode 100644 smart-admin-web/src/components/main/main.vue delete mode 100644 smart-admin-web/src/components/smart-admin-ad/ad.vue delete mode 100644 smart-admin-web/src/components/smart-admin-ad/index.js delete mode 100644 smart-admin-web/src/components/tables/edit.vue delete mode 100644 smart-admin-web/src/components/tables/handle-btns.js delete mode 100644 smart-admin-web/src/components/tables/index.js delete mode 100644 smart-admin-web/src/components/tables/index.less delete mode 100644 smart-admin-web/src/components/tables/tables.vue delete mode 100644 smart-admin-web/src/config/index.js delete mode 100644 smart-admin-web/src/constants/file.js delete mode 100644 smart-admin-web/src/constants/index.js delete mode 100644 smart-admin-web/src/constants/login.js delete mode 100644 smart-admin-web/src/constants/notice.js delete mode 100644 smart-admin-web/src/constants/privilege.js delete mode 100644 smart-admin-web/src/constants/table-page.js delete mode 100644 smart-admin-web/src/directives/directives.js delete mode 100644 smart-admin-web/src/directives/index.js delete mode 100644 smart-admin-web/src/directives/module/clipboard.js delete mode 100644 smart-admin-web/src/directives/module/draggable.js delete mode 100644 smart-admin-web/src/directives/module/privilege.js delete mode 100644 smart-admin-web/src/lib/cookie.js delete mode 100644 smart-admin-web/src/lib/http.js delete mode 100644 smart-admin-web/src/lib/local.js delete mode 100644 smart-admin-web/src/lib/menu-func.js delete mode 100644 smart-admin-web/src/lib/printPlugs.js delete mode 100644 smart-admin-web/src/lib/render-dom.js delete mode 100644 smart-admin-web/src/lib/table-action.js delete mode 100644 smart-admin-web/src/lib/util.js delete mode 100644 smart-admin-web/src/locale/index.js delete mode 100644 smart-admin-web/src/locale/lang/en-US.js delete mode 100644 smart-admin-web/src/locale/lang/zh-CN.js delete mode 100644 smart-admin-web/src/locale/lang/zh-TW.js delete mode 100644 smart-admin-web/src/main.js delete mode 100644 smart-admin-web/src/main.less delete mode 100644 smart-admin-web/src/plugins/error-store/index.js delete mode 100644 smart-admin-web/src/plugins/index.js delete mode 100644 smart-admin-web/src/router/before-close.js delete mode 100644 smart-admin-web/src/router/index.js delete mode 100644 smart-admin-web/src/router/module/business/email.js delete mode 100644 smart-admin-web/src/router/module/business/index.js delete mode 100644 smart-admin-web/src/router/module/business/keep-alive.js delete mode 100644 smart-admin-web/src/router/module/business/notice.js delete mode 100644 smart-admin-web/src/router/module/business/peony.js delete mode 100644 smart-admin-web/src/router/module/business/three-router.js delete mode 100644 smart-admin-web/src/router/module/error.js delete mode 100644 smart-admin-web/src/router/module/home.js delete mode 100644 smart-admin-web/src/router/module/support/api-doc.js delete mode 100644 smart-admin-web/src/router/module/support/heart-beat.js delete mode 100644 smart-admin-web/src/router/module/support/index.js delete mode 100644 smart-admin-web/src/router/module/support/monitor.js delete mode 100644 smart-admin-web/src/router/module/support/reload.js delete mode 100644 smart-admin-web/src/router/module/support/task.js delete mode 100644 smart-admin-web/src/router/module/system/employee.js delete mode 100644 smart-admin-web/src/router/module/system/file.js delete mode 100644 smart-admin-web/src/router/module/system/index.js delete mode 100644 smart-admin-web/src/router/module/system/system-setting.js delete mode 100644 smart-admin-web/src/router/module/system/user-log.js delete mode 100644 smart-admin-web/src/router/routers.js delete mode 100644 smart-admin-web/src/store/index.js delete mode 100644 smart-admin-web/src/store/module/app.js delete mode 100644 smart-admin-web/src/store/module/notice.js delete mode 100644 smart-admin-web/src/store/module/user.js delete mode 100644 smart-admin-web/src/themes/ReadMe.md delete mode 100644 smart-admin-web/src/themes/index.less delete mode 100644 smart-admin-web/src/views/business/email/email-list.vue delete mode 100644 smart-admin-web/src/views/business/email/send-mail.vue delete mode 100644 smart-admin-web/src/views/business/keep-alive/add-content.vue delete mode 100644 smart-admin-web/src/views/business/keep-alive/content-list.vue delete mode 100644 smart-admin-web/src/views/business/notice/notice-detail.vue delete mode 100644 smart-admin-web/src/views/business/notice/notice-list.vue delete mode 100644 smart-admin-web/src/views/business/notice/person-notice.vue delete mode 100644 smart-admin-web/src/views/business/peony/components/peony-list-form.vue delete mode 100644 smart-admin-web/src/views/business/peony/peony-list.vue delete mode 100644 smart-admin-web/src/views/business/three-level-router/three-level-router-view.vue delete mode 100644 smart-admin-web/src/views/error-page/401.vue delete mode 100644 smart-admin-web/src/views/error-page/404.vue delete mode 100644 smart-admin-web/src/views/error-page/500.vue delete mode 100644 smart-admin-web/src/views/error-page/back-btn-group.vue delete mode 100644 smart-admin-web/src/views/error-page/error-content.vue delete mode 100644 smart-admin-web/src/views/error-page/error.less delete mode 100644 smart-admin-web/src/views/home/components/card.vue delete mode 100644 smart-admin-web/src/views/home/components/chart-bar.vue delete mode 100644 smart-admin-web/src/views/home/components/chart-funnel.vue delete mode 100644 smart-admin-web/src/views/home/components/chart-gauge.vue delete mode 100644 smart-admin-web/src/views/home/components/chart-line.vue delete mode 100644 smart-admin-web/src/views/home/components/chart-pie.vue delete mode 100644 smart-admin-web/src/views/home/components/home-circle.vue delete mode 100644 smart-admin-web/src/views/home/components/home-progress.vue delete mode 100644 smart-admin-web/src/views/home/components/theme.json delete mode 100644 smart-admin-web/src/views/home/home.vue delete mode 100644 smart-admin-web/src/views/home/index.js delete mode 100644 smart-admin-web/src/views/login/canvas.js delete mode 100644 smart-admin-web/src/views/login/components/login-form.vue delete mode 100644 smart-admin-web/src/views/login/login.less delete mode 100644 smart-admin-web/src/views/login/login.vue delete mode 100644 smart-admin-web/src/views/support/api-doc/swagger.vue delete mode 100644 smart-admin-web/src/views/support/heart-beat/heart-beat-list.vue delete mode 100644 smart-admin-web/src/views/support/monitor/online-user.vue delete mode 100644 smart-admin-web/src/views/support/monitor/sql.vue delete mode 100644 smart-admin-web/src/views/support/reload/smart-reload/smart-reload-list.vue delete mode 100644 smart-admin-web/src/views/support/task/task-list.vue delete mode 100644 smart-admin-web/src/views/system/employee/components/department-employee-tree-item/department-employee-tree-item.vue delete mode 100644 smart-admin-web/src/views/system/employee/components/department-employee-tree/department-employee-tree.vue delete mode 100644 smart-admin-web/src/views/system/employee/position/position-list.vue delete mode 100644 smart-admin-web/src/views/system/employee/role-employee/components/employee-table-add/employee-table-add.vue delete mode 100644 smart-admin-web/src/views/system/employee/role-employee/components/employee-table-detail/employee-table-detail.vue delete mode 100644 smart-admin-web/src/views/system/employee/role-employee/components/employee-table/employee-table.vue delete mode 100644 smart-admin-web/src/views/system/employee/role-employee/role-employee-manage.vue delete mode 100644 smart-admin-web/src/views/system/employee/role/components/role-data-scope/role-data-scope.vue delete mode 100644 smart-admin-web/src/views/system/employee/role/components/role-list/role-list.vue delete mode 100644 smart-admin-web/src/views/system/employee/role/components/role-tree/role-tree.vue delete mode 100644 smart-admin-web/src/views/system/employee/role/role-manage.vue delete mode 100644 smart-admin-web/src/views/system/file/file-list.vue delete mode 100644 smart-admin-web/src/views/system/system-setting/system-config/system-config.vue delete mode 100644 smart-admin-web/src/views/system/system-setting/system-privilege/components/privilege-form.vue delete mode 100644 smart-admin-web/src/views/system/system-setting/system-privilege/system-privilege.vue delete mode 100644 smart-admin-web/src/views/system/user-log/user-login-log.vue delete mode 100644 smart-admin-web/src/views/system/user-log/user-operate-log.vue delete mode 100644 smart-admin-web/src/views/three-router/three-content.vue delete mode 100644 smart-admin-web/tests/e2e/.eslintrc delete mode 100644 smart-admin-web/tests/e2e/plugins/index.js delete mode 100644 smart-admin-web/tests/e2e/specs/test.js delete mode 100644 smart-admin-web/tests/e2e/support/commands.js delete mode 100644 smart-admin-web/tests/e2e/support/index.js delete mode 100644 smart-admin-web/tests/unit/.eslintrc.js delete mode 100644 smart-admin-web/tests/unit/HelloWorld.spec.js create mode 100644 smart-admin-web/typescript-ant-design-vue3/.env create mode 100644 smart-admin-web/typescript-ant-design-vue3/.env.development create mode 100644 smart-admin-web/typescript-ant-design-vue3/.env.localhost create mode 100644 smart-admin-web/typescript-ant-design-vue3/.env.pre create mode 100644 smart-admin-web/typescript-ant-design-vue3/.env.production create mode 100644 smart-admin-web/typescript-ant-design-vue3/.env.test create mode 100644 smart-admin-web/typescript-ant-design-vue3/.eslintignore create mode 100644 smart-admin-web/typescript-ant-design-vue3/.eslintrc.js create mode 100644 smart-admin-web/typescript-ant-design-vue3/.gitignore create mode 100644 smart-admin-web/typescript-ant-design-vue3/.prettierrc.js create mode 100644 smart-admin-web/typescript-ant-design-vue3/.stylelintignore create mode 100644 smart-admin-web/typescript-ant-design-vue3/.stylelintrc.js create mode 100644 smart-admin-web/typescript-ant-design-vue3/README.md create mode 100644 smart-admin-web/typescript-ant-design-vue3/index.html create mode 100644 smart-admin-web/typescript-ant-design-vue3/package.json rename smart-admin-web/{ => typescript-ant-design-vue3}/public/favicon.ico (100%) create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/App.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/api/base-model/page-param-model.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/api/base-model/page-result-model.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/api/base-model/response-model.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/api/base-model/sort-item-model.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/api/business/category/category-api.js create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/api/business/goods/goods-api.js create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/api/business/oa/bank-api.js create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/api/business/oa/enterprise-api.js create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/api/business/oa/invoice-api.js create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/api/business/oa/notice-api.js create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/api/support/cache/cache-api.js create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/api/support/change-log/change-log-api.js create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/api/support/code-generator/code-generator-api.js create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/api/support/config/config-api.js create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/api/support/data-tracer/data-tracer-api.js create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/api/support/dict/dict-api.js create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/api/support/feedback/feedback-api.js create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/api/support/file/file-api.js create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/api/support/heart-beat/heart-beat-api.js create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/api/support/help-doc/help-doc-api.js create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/api/support/help-doc/help-doc-catalog-api.js create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/api/support/login-log/login-log-api.js create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/api/support/operate-log/operate-log-api.js create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/api/support/reload/reload-api.js create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/api/support/serial-number/serial-number-api.js create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/api/support/table/table-column-api.js create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/api/system/department/department-api.js create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/api/system/employee/employee-api.js create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/api/system/home/home-api.js create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/api/system/login/login-api.js create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/api/system/menu/menu-api.js create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/api/system/role-menu/role-menu-api.js create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/api/system/role/role-api.js create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/assets/images/1024lab/1024lab-gzh.jpg create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/assets/images/1024lab/xiaozhen-gzh.jpg create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/assets/images/1024lab/zhuoda-wechat.jpg create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/assets/images/login/ali-icon.png create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/assets/images/login/google-icon.png create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/assets/images/login/login-bg.jpg create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/assets/images/login/login-form-open-eyes-close.png create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/assets/images/login/login-form-open-eyes.png create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/assets/images/login/login-qr.png create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/assets/images/login/qq-icon.png create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/assets/images/login/wechat-icon.png create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/assets/images/login/weibo-icon.png create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/assets/images/logo/logo-min.png create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/assets/images/logo/logo.png create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/assets/images/logo/smart-admin-logo-white.png create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/assets/images/logo/smart-admin-logo.png create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/assets/images/notice/edit_icon.png create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/assets/images/notice/file_icon.png create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/components/business/category-tree-select/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/components/business/oa/enterprise-bank-select/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/components/business/oa/enterprise-invoice-select/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/components/business/oa/enterprise-select/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/components/framework/area-cascader/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/components/framework/area-cascader/province-city-district.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/components/framework/area-cascader/province-city.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/components/framework/boolean-select/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/components/framework/icon-select/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/components/framework/iframe/iframe-index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/components/framework/iframe/route-default-component.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/components/framework/smart-enum-checkbox/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/components/framework/smart-enum-radio/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/components/framework/smart-enum-select/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/components/framework/smart-loading/index.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/components/framework/wangeditor/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/components/support/data-tracer/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/components/support/dict-key-select/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/components/support/dict-select/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/components/support/file-preview-modal/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/components/support/file-preview/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/components/support/file-upload/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/components/support/table-operator/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/components/support/table-operator/smart-table-column-merge.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/components/support/table-operator/smart-table-column-modal.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/components/system/department-tree-select/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/components/system/employee-select/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/components/system/employee-table-select-modal/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/components/system/menu-tree-select/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/config/app-config.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/constants/business/erp/category-const.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/constants/business/erp/goods-const.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/constants/business/oa/enterprise-const.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/constants/business/oa/notice-const.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/constants/common-const.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/constants/index.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/constants/layout-const.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/constants/local-storage-key-const.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/constants/regular-const.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/constants/support/change-log-const.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/constants/support/code-generator-const.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/constants/support/data-tracer-const.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/constants/support/file-const.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/constants/support/login-log-const.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/constants/support/table-id-const.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/constants/system/employee-const.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/constants/system/home-const.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/constants/system/login-device-const.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/constants/system/menu-const.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/directives/privilege.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/i18n/index.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/i18n/lang/en-US/index.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/i18n/lang/zh-CN/index.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/layout/components/header-user-space/header-avatar.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/layout/components/header-user-space/header-message.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/layout/components/header-user-space/header-reset-password-modal/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/layout/components/header-user-space/header-setting.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/layout/components/header-user-space/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/layout/components/menu-location-breadcrumb/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/layout/components/page-tag/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/layout/components/side-expand-menu/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/layout/components/side-expand-menu/recursion-menu.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/layout/components/side-expand-menu/sub-menu.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/layout/components/side-expand-menu/top-menu.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/layout/components/side-help-doc/components/contact-modal.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/layout/components/side-help-doc/components/feedback-modal.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/layout/components/side-help-doc/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/layout/components/side-menu/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/layout/components/side-menu/recursion-menu.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/layout/components/side-menu/sub-menu.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/layout/components/smart-footer/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/layout/smart-help-doc-layout.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/layout/smart-keep-alive.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/layout/smart-layout.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/layout/smart-side-expand-layout.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/layout/smart-side-layout.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/lib/axios.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/lib/default-time-ranges.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/lib/highlight-line-number.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/lib/smart-sentry.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/lib/smart-wartermark.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/main.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/plugins/privilege-plugin.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/plugins/smart-enums-plugin.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/router/index.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/router/routers.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/router/support/help-doc.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/router/system/home.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/router/system/login.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/shims-vue.d.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/store/index.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/store/modules/model/UserTagNav.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/store/modules/system/app-config.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/store/modules/system/role.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/store/modules/system/spin.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/store/modules/system/user.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/theme/index.less create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/theme/smart-admin.less create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/types/config.d.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/types/env.d.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/types/json-viewer.d.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/types/smart-enum.d.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/types/user.d.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/utils/cookie-util.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/utils/local-util.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/utils/str-util.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/business/erp/catalog/components/category-form-modal.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/business/erp/catalog/components/category-tree-table.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/business/erp/catalog/custom-catalog.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/business/erp/catalog/goods-catalog.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/business/erp/goods/components/goods-form-modal.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/business/erp/goods/goods-list.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/business/oa/enterprise/components/enterprise-bank-list.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/business/oa/enterprise/components/enterprise-bank-operate-modal.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/business/oa/enterprise/components/enterprise-employee-list.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/business/oa/enterprise/components/enterprise-invoice-list.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/business/oa/enterprise/components/enterprise-invoice-operate-modal.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/business/oa/enterprise/components/enterprise-operate-modal.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/business/oa/enterprise/enterprise-detail.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/business/oa/enterprise/enterprise-list.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/business/oa/notice/components/notice-form-drawer.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/business/oa/notice/components/notice-form-visible-modal.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/business/oa/notice/components/notice-form-visible-transfer-department.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/business/oa/notice/components/notice-form-visible-transfer-employee.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/business/oa/notice/components/notice-view-record-list.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/business/oa/notice/notice-detail.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/business/oa/notice/notice-employee-detail.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/business/oa/notice/notice-employee-list.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/business/oa/notice/notice-list.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/support/cache/cache-list.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/support/change-log/change-log-form.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/support/change-log/change-log-list.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/support/change-log/change-log-modal.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/support/code-generator/code-generator-list.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/support/code-generator/code-generator-util.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/support/code-generator/components/form/code-generator-table-config-form-basic.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/support/code-generator/components/form/code-generator-table-config-form-delete.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/support/code-generator/components/form/code-generator-table-config-form-field.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/support/code-generator/components/form/code-generator-table-config-form-insert-and-update.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/support/code-generator/components/form/code-generator-table-config-form-query-field.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/support/code-generator/components/form/code-generator-table-config-form-table-field.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/support/code-generator/components/form/code-generator-table-config-form.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/support/code-generator/components/preview/code-generator-preview-modal.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/support/config/config-form-modal.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/support/config/config-list.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/support/dict/components/dict-key-operate-modal.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/support/dict/components/dict-value-modal.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/support/dict/components/dict-value-operate-modal.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/support/dict/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/support/feedback/feedback-list.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/support/file/file-list.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/support/heart-beat/heart-beat-list.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/support/help-doc/management/components/help-doc-catalog-form-modal.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/support/help-doc/management/components/help-doc-catalog-tree-select.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/support/help-doc/management/components/help-doc-catalog-tree.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/support/help-doc/management/components/help-doc-form-drawer.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/support/help-doc/management/components/help-doc-list.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/support/help-doc/management/help-doc-manage-list.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/support/help-doc/management/help-doc-mitt.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/support/help-doc/user-view/components/help-doc-view-record-list.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/support/help-doc/user-view/help-doc-user-view.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/support/login-log/login-log-list.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/support/operate-log/operate-log-detail-modal.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/support/operate-log/operate-log-list.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/support/reload/do-reload-form-modal.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/support/reload/reload-list.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/support/reload/reload-result-list.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/support/serial-number/serial-number-generate-form-modal.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/support/serial-number/serial-number-list.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/support/serial-number/serial-number-record-list.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/40X/403.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/40X/404.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/employee/department/components/department-children/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/employee/department/components/department-form-modal/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/employee/department/components/department-tree/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/employee/department/components/employee-department-form-modal/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/employee/department/components/employee-form-modal/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/employee/department/components/employee-list/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/employee/department/components/employee-password-dialog/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/employee/department/department-mitt.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/employee/department/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/employee/role/components/role-data-scope/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/employee/role/components/role-employee-list/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/employee/role/components/role-form-modal/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/employee/role/components/role-list/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/employee/role/components/role-setting/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/employee/role/components/role-tree/index.less create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/employee/role/components/role-tree/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/employee/role/components/role-tree/role-tree-checkbox.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/employee/role/components/role-tree/role-tree-menu.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/employee/role/components/role-tree/role-tree-point.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/employee/role/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/home/components/changelog-card.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/home/components/default-home-card.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/home/components/echarts/category.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/home/components/echarts/gauge.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/home/components/echarts/gradient.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/home/components/echarts/pie.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/home/components/official-account-card.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/home/components/quick-entry/home-quick-entry-modal.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/home/components/quick-entry/home-quick-entry.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/home/components/quick-entry/init-quick-entry-list.js create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/home/components/to-be-done-card.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/home/home-header.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/home/home-notice.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/home/index.less create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/home/index.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/login/login.less create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/login/login.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/menu/components/menu-operate-modal.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/menu/components/menu-tree-select.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/menu/menu-data-handler.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/menu/menu-list-table-columns.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/views/system/menu/menu-list.vue create mode 100644 smart-admin-web/typescript-ant-design-vue3/src/vite-env.d.ts create mode 100644 smart-admin-web/typescript-ant-design-vue3/tsconfig.json create mode 100644 smart-admin-web/typescript-ant-design-vue3/vite.config.ts delete mode 100644 smart-admin-web/vscode/settings.json delete mode 100644 smart-admin-web/vue.config.js create mode 100644 smart_admin_v2.sql delete mode 100644 代码规范/api接口规范.md delete mode 100644 代码规范/front-standard-guide.md delete mode 100644 代码规范/java-standard-guide.md delete mode 100644 快速部署/README.md create mode 100644 截图/1-1.png create mode 100644 截图/1-2.png create mode 100644 截图/2-1.png create mode 100644 截图/2-2.png create mode 100644 截图/3-1.png create mode 100644 截图/3-2.png create mode 100644 截图/4-1.png create mode 100644 截图/4-2.png create mode 100644 截图/5-1.png create mode 100644 截图/5-2.png create mode 100644 截图/6-1.png create mode 100644 截图/6-2.png create mode 100644 截图/xiaozhen-gzh.jpg create mode 100644 截图/zhuoda-wechat-money-v1.jpg create mode 100644 截图/zhuoda-wechat.jpg diff --git a/.gitignore b/.gitignore index a2a3040a..b516240b 100644 --- a/.gitignore +++ b/.gitignore @@ -19,13 +19,8 @@ target/ *.iml *.ipr -### NetBeans ### -/nbproject/private/ -/nbbuild/ -/dist/ -/nbdist/ -/.nb-gradle/ -build/ +### front ### +**/dist +**/node_modules +**/.vscode -### VS Code ### -.vscode/ diff --git a/README.md b/README.md index c4d5da4b..975773f4 100644 --- a/README.md +++ b/README.md @@ -1,138 +1,127 @@ -#### 简介 -SmartAdmin由河南·洛阳 [1024创新实验室](https://www.1024lab.net/)团队研发的一套互联网企业级的通用型中后台解决方案!使用最前沿的前后台技术栈SpringBoot和Vue,前后端分离,**我们开源一套漂亮的代码和一套整洁的代码规范**,让大家在这浮躁的代码世界里感受到一股把代码写好的清流!同时又让开发者节省大量的时间,减少加班,快乐工作,热爱生活。SmartAdmin 让你从认识到忘不了,绝对是你最想要的! +### SmartAdmin 2.X -#### 开源地址 (*欢迎 Star!*) +SmartAdmin2.X 由河南·洛阳 [1024 创新实验室](https://www.1024lab.net/)使用SpringBoot2.x 和 Vue3.2 Setup标签、 Composition Api (同时支持JavaScript和TypeScript双版本) ,开发出的一套简洁、易用的中后台解决方案! + +**我们开源一套漂亮的代码和一套整洁的代码规范**,让大家在这浮躁的代码世界里感受到一股把代码写好的清流!同时又让开发者节省大量的时间,减少加班,快乐工作,保持谦逊,保持学习,热爱代码,更热爱生活! + +### 地址 在线预览: [http://preview.smartadmin.1024lab.net](http://preview.smartadmin.1024lab.net) 部署文档:[http://smartadmin.1024lab.net](http://smartadmin.1024lab.net) +vue2版本:请查看 feature/1.x 分支 +### 理念与思想 -#### 疑惑 -有人问:又是个“轮子”? 轮子靠谱吗?为什么要选择你这个轮子? -**1024Lab**回答: -它不是“轮子”,目的不是为了重复造轮子! 我们开源的是一套 “漂亮的代码” 和 “代码规范”。 - +- 我们分享的不是徒劳无功的各种功能,而是必须有的功能,如:数据变动记录、系统说明文档、版本更新记录、意见反馈、日志、心跳、单号生成器等等。 +- 我们分享的还有经过上百家公司验证过的前端、后端、vue3等代码规范,好的规范能让我们敲下的每行代码更铿锵有力! +- **我们推崇高质量的代码,身为开发,代码即利剑,键盘上一套行云流水,宛如侠客,事了拂衣去,深藏身与名。** +- **我们推崇团队的高度配合默契、互相帮助,从不加班,而不是一看到别人的代码就头皮发麻,留其 [996.ICU](https://baike.baidu.com/item/996.ICU)** +- **我们主动思考,保持谦逊,保持学习,热爱代码,更热爱生活。** +- **我们希望你,希望你能花费3分钟认真阅读下面的每一个点,让你感受从未有过的技术体验!** -#### 理念与思想 -- 我们分享的不是代码,不是徒劳无功的堆砌功能,而是你必须的基础功能,比如Vue前端权限、心跳、动态Reload、Keepalived标签页等等,可能还有一些正是你当前项目中缺失的功能。 -- 我们分享的不仅有代码,还有一套经过几十人验证过的前、后端代码。细节决定成败,好的规范能让我们敲下的每行代码更铿锵有力! -- 我们推崇高质量的代码,身为开发,代码即利剑,键盘上一套行云流水,宛如侠客,事了拂衣去,深藏身与名。 -- 我们推崇团队的高度配合默契、互相帮助,从不加班,而不是一看到别人的代码就头皮发麻,留其996.ICU -- 我们热爱编程,热爱代码,保持谦逊,不断学习,快乐工作,热爱生活。 -- **请相信并认真阅读下面的每一个点,让你感受不一样的编码体验** - -#### 演示图 +### 演示图 - - + + - - + + - - + + - - + + - - + + - - - - - - + + +
+### 技术体系 -#### 技术体系 -- 前端:Vue + Vue-Router + Vuex + ViewUI + vue-enum -- 后端:SpringBoot2 + Mybatis-plus + jwt + druid + mysql -- 前端代码规范smart-front-standard -guide(大力推荐) -- 基于阿里规范之上的后端规范smart-backend-standard-guide(大力推荐) +- 前端:Vue3.2 + Vue-Router + Pinia + Ant Design Vue 3.X + Vite +- 后端:Java8 + SpringBoot2.X + Mybatis-plus + jwt + druid + mysql -#### 前端特点 -- 高质量的代码、代码结构、和代码注释 -- 漂亮的UI,菜单栏、标签页,体验、交互更好用的员工、部门、角色、菜单管理等等 -- 优化基于Keepalive的标签页,做到标签页该缓存的时候缓存,比如左右切换等,不该缓存的时候不缓存,比如新建,表单提交结束等 -- 前端常量维护: vue-enum,拒绝出现魔法数字,代码不可维护的现象 -- 全新的基于前端的权限设计(忘掉传统的权限设计吧,已经不适合这个前端时代) -- 基于websocket的在线人数 -- 支持一级、二级、三级菜单,四级菜单以及搜索功能 -- 其他功能:邮件、富文本、消息、系统配置等等 -- 写不完了,太多好的细节需要你的发现...... +### 功能特点 -#### 后端特点 -- 高质量的Java代码、分包结构、和代码注释 +- 表格:持久化表格自定义列、国际化、水印 等 +- OA办公:公司信息(发票、银行、员工等)、通知公告(阅读记录、次数等) +- 文档:系统手册、意见反馈、更新记录 等 +- 监控:心跳监控、数据库监控 +- 日志:登录日志、操作日志(IP、浏览器、操作系统等设备信息) +- 系统:员工、部门、角色、权限、菜单 等 +- 工具:文件管理、系统参数、数据字典、单号生成 等 +- 代码生成: 基于每个表的配置、在线预览代码、下载 等 + +### 前端特点 + +- vue3.2 Composition 模式中如何正确的写好并组织好代码 +- 提供 js 和 ts 双版本,清晰的代码结构 +- 漂亮的 UI,菜单栏、标签页,体验、交互更好用的员工、部门、角色、菜单管理等等 +- 多种布局layout模式 +- 前端常量维护: vue-enum,拒绝出现魔法数字,常量枚举不可维护的现象 +- main.js 中正确的加载方式 +- 漂亮的首页、很好的帮助文档功能、等等,太多好的细节需要你的发现...... + +### 后端特点 + +- 高质量的 Java 代码、分包结构、和代码注释 - 业内独创的请求返回码维护,非常值得一看 -- 基于一个注解和controller的权限设计放弃更复杂的shiro,以及一套数据权限支持 - 四层架构(controller, service, manager, dao) -- 代码阅读性强、扩展性极高的员工、部门、角色、菜单管理 -- 基于LRU策略的内存级权限缓存 -- 配合前端vue-enum的swagger文档注解 -- 心跳服务,让你发现有哪些机器再跑,哪些人在偷偷的跑你的Job -- 自定义的quartz job添加和修改,方便测试人员测试 +- 配合前端 vue-enum 的 swagger 文档注解 +- 心跳服务,让你发现有哪些机器再跑,哪些人在偷偷的跑你的 Job - smart-reload,为系统预留钩子,动态加载,在不重启程序前提下执行一些代码,你懂的 - 以上只是一些举例,更多灿若繁星的惊喜和细节,等待着你的发现! -#### 前端代码规范 -- 文件、文件夹、目录结构、组建、变量等等怎么命名 -- html、css、less等如何规范 -- vue项目目录结构如何划分 -- router和store该怎么划分扩展性更好 -- vue组件规范该选择哪些 +### 前端代码规范 + +- vue3 项目目录结构如何划分 +- Composition setup 模式下如何编写代码 +- 文件、文件夹、目录结构、组件、变量等等怎么命名 +- router 和 store ( pinia ) 该怎么划分扩展性更好 +- 网络请求 axios 如何封装 - 以及更多,数不胜数让你觉得实用,同时身心愉悦的规范 -#### 后端代码规范 +### 后端代码规范 + - 四层架构(controller, service, manager, dao) 是什么,为什么要有四层 - 各个层的代码该怎么写才能让团队配合默契,高度一致 -- vo, bo, dto, entity ,各种javabean 怎么区分和使用 -- spring的 @Transactional 你用对了吗 -- 方法参数个数、注释、todo这些也要有规范,你遵守过吗 +- vo, bo, form, entity ,各种 javabean 怎么区分和使用 +- spring 的 @Transactional 你用对了吗 +- 方法参数个数、注释、todo 这些也要有规范,你遵守过吗 +- 数据库列如何命名等等 - 以上举例,只是沧海一粟,更多的细节等待你的发现! ps:以上规范基础都是以团队出发,让团队开心快乐的写代码,而不是为了代码规范而规范,不喜勿喷!谢谢。 -#### 联系我们 - -[1024创新实验室](https://www.1024lab.net/) -公众号 - - - - -
- -SmartAdmin微信群(**加我微信拉你入群!**) +### 联系我们 - + + + -
- - - - - -#### 捐赠 -开源不易,感谢捐赠 ->*佛祖保佑捐赠这些人写程序永无bug,工资翻倍,迎娶白富美,走上人生巅峰!* - - + + +
加我微信,拉你入群关注“小镇程序员”,了解我们请我们喝杯咖啡
---- -作者简介: -[卓大](https://zhuoluodada.cn), 1024创新实验室主任,混迹于各个技术圈,研究过计算机,熟悉点java,略懂点前端。 +### 作者 + +[1024创新实验室-主任:卓大](https://zhuoda.vip),混迹于各个技术圈,研究过计算机,熟悉点 java,略懂点前端。 +[1024创新实验室(河南·洛阳)](https://1024lab.net) 致力于成为中原领先、国内一流的技术团队,以技术创新为驱动,合作各类项目。 + diff --git a/smart-admin-service/.gitignore b/smart-admin-api/.gitignore similarity index 90% rename from smart-admin-service/.gitignore rename to smart-admin-api/.gitignore index a2a3040a..ab428af8 100644 --- a/smart-admin-service/.gitignore +++ b/smart-admin-api/.gitignore @@ -1,8 +1,10 @@ HELP.md target/ + +velocity.log + !.mvn/wrapper/maven-wrapper.jar -!**/src/main/** -!**/src/test/** + ### STS ### .apt_generated @@ -19,6 +21,8 @@ target/ *.iml *.ipr +.DS_Store + ### NetBeans ### /nbproject/private/ /nbbuild/ diff --git a/smart-admin-api/pom.xml b/smart-admin-api/pom.xml new file mode 100644 index 00000000..70da0158 --- /dev/null +++ b/smart-admin-api/pom.xml @@ -0,0 +1,368 @@ + + 4.0.0 + + net.1024lab + sa-parent + 1.0.0 + pom + + sa-parent + SmartAdmin project + + + sa-common + sa-admin + + + + 1.8 + 2.7.5 + 2.0.8 + 3.5.2 + 3.8.6 + 2.7.0 + 2.0.16 + 1.2.14 + 1.4.2 + 20.0 + 1.21 + 2.3.2 + 0.9.11 + 2.6 + 3.12.0 + 4.4 + 1.13 + 4.2.0 + 2.12.0 + 4.1.1 + 1.3 + 1.11.842 + 2.17.2 + 5.7.22 + 2.3 + 0.9.1 + 0.9.0 + 3.1 + + + + + + + + org.springframework.boot + spring-boot-dependencies + ${springboot.version} + pom + import + + + + + org.springframework + spring-mock + ${spring-mock.version} + + + commons-logging + commons-logging + + + + + + com.baomidou + mybatis-plus-boot-starter + ${mybatis-plus.version} + + + org.springframework.boot + spring-boot-starter-logging + + + + + + p6spy + p6spy + ${p6spy.version} + + + + io.springfox + springfox-swagger2 + ${swagger.version} + + + guava + com.google.guava + + + + + + io.springfox + springfox-swagger-ui + ${swagger.version} + + + + com.alibaba + fastjson + ${fastjson.version} + + + + com.alibaba + druid + ${druid.version} + + + + com.googlecode.concurrentlinkedhashmap + concurrentlinkedhashmap-lru + ${google-linkedhashmap.version} + + + + com.google.guava + guava + ${google-guava.version} + + + + eu.bitwalker + UserAgentUtils + ${user-agent-utils.version} + + + + com.github.penggle + kaptcha + ${kaptcha.version} + + + + org.reflections + reflections + ${reflections.version} + + + guava + com.google.guava + + + + + + commons-io + commons-io + ${commons-io.version} + + + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + + + + org.apache.commons + commons-collections4 + ${commons-collections4.version} + + + + commons-codec + commons-codec + ${commons-codec.version} + + + + + cn.afterturn + easypoi-spring-boot-starter + ${easypoi.version} + + + + cn.afterturn + easypoi-web + ${easypoi.version} + + + javassist + org.javassist + + + guava + com.google.guava + + + + + + + xerces + xercesImpl + ${xerces.version} + + + org.apache.poi + poi-scratchpad + ${poi-scratchpad.version} + + + + + org.apache.poi + ooxml-schemas + ${poi-ooxml-schemas.version} + + + + com.amazonaws + aws-java-sdk-s3 + ${aws-java-sdk.version} + + + commons-logging + commons-logging + + + + + + org.apache.logging.log4j + log4j-spring-boot + ${log4j-spring-boot.version} + + + + cn.hutool + hutool-all + ${hutool.version} + + + + io.jsonwebtoken + jjwt + ${jjwt.version} + + + + com.auth0 + jwks-rsa + ${jwks-rsa.version} + + + + + org.apache.velocity + velocity-engine-core + ${velocity-engine-core.version} + + + org.apache.velocity.tools + velocity-tools-generic + ${velocity-tools.version} + + + + + + + + ${profiles.active}-${project.name} + + + false + src/main/resources + + dev/* + test/* + pre/* + prod/* + + + + + src/main/resources/${profiles.active} + true + + *.yaml + + + + + src/main/resources/${profiles.active} + false + + *.* + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.2 + + 1.8 + 1.8 + UTF-8 + + + + org.apache.maven.plugins + maven-surefire-plugin + + true + true + + + + org.springframework.boot + spring-boot-maven-plugin + ${springboot.version} + + + + + + + + dev + + dev + + + true + + + + + test + + test + + + + + pre + + pre + + + + + prod + + prod + + + + + \ No newline at end of file diff --git a/smart-admin-api/sa-admin/pom.xml b/smart-admin-api/sa-admin/pom.xml new file mode 100644 index 00000000..af0f1935 --- /dev/null +++ b/smart-admin-api/sa-admin/pom.xml @@ -0,0 +1,47 @@ + + 4.0.0 + + net.1024lab + sa-parent + 1.0.0 + ../pom.xml + + + sa-admin + 1.0.0 + jar + + sa-admin + sa-admin project + + + + + net.1024lab + sa-common + ${project.version} + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + net.lab1024.sa.admin.SmartAdminApplication + + + + + repackage + + + + + + + + \ No newline at end of file diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/SmartAdminApplication.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/SmartAdminApplication.java new file mode 100644 index 00000000..82975649 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/SmartAdminApplication.java @@ -0,0 +1,33 @@ +package net.lab1024.sa.admin; + +import org.apache.ibatis.annotations.Mapper; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.security.servlet.UserDetailsServiceAutoConfiguration; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.EnableAspectJAutoProxy; +import org.springframework.scheduling.annotation.EnableScheduling; + +/** + * SmartAdmin 项目启动类 + * + * @Author 1024创新实验室-主任:卓大 + * @Date 2022-08-29 21:00:58 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@EnableCaching +@EnableScheduling +@EnableAspectJAutoProxy(proxyTargetClass = true, exposeProxy = true) +@ComponentScan(basePackages = {"net.lab1024.sa"}) +@MapperScan(value = "net.lab1024.sa", annotationClass = Mapper.class) +@SpringBootApplication(exclude = {UserDetailsServiceAutoConfiguration.class }) +public class SmartAdminApplication { + + public static void main(String[] args) { + SpringApplication.run(SmartAdminApplication.class, args); + } +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/common/AdminBaseController.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/common/AdminBaseController.java new file mode 100644 index 00000000..f54bbd51 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/common/AdminBaseController.java @@ -0,0 +1,13 @@ +package net.lab1024.sa.admin.common; + +/** + * admin 相关的父类 + * + * @Author 1024创新实验室-主任:卓大 + * @Date 2022-06-10 21:00:58 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +public class AdminBaseController { +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/config/OperateLogAspectConfig.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/config/OperateLogAspectConfig.java new file mode 100644 index 00000000..214502e0 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/config/OperateLogAspectConfig.java @@ -0,0 +1,34 @@ +package net.lab1024.sa.admin.config; + +import net.lab1024.sa.common.common.domain.RequestUser; +import net.lab1024.sa.common.common.util.SmartRequestUtil; +import net.lab1024.sa.common.module.support.operatelog.core.OperateLogAspect; +import net.lab1024.sa.common.module.support.operatelog.core.OperateLogConfig; +import org.springframework.context.annotation.Configuration; + +import javax.servlet.http.HttpServletRequest; + +/** + * 操作日志切面 配置 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022-05-30 21:22:12 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Configuration +public class OperateLogAspectConfig extends OperateLogAspect{ + + /** + * 配置信息 + * @return + */ + @Override + public OperateLogConfig getOperateLogConfig() { + OperateLogConfig config = OperateLogConfig.builder().corePoolSize(4).queueCapacity(1000).build(); + return config; + } + + +} \ No newline at end of file diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/config/SecurityConfig.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/config/SecurityConfig.java new file mode 100644 index 00000000..8f12ba27 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/config/SecurityConfig.java @@ -0,0 +1,40 @@ +package net.lab1024.sa.admin.config; + +import net.lab1024.sa.admin.module.system.login.service.LoginService; +import net.lab1024.sa.common.common.security.AbstractSecurityConfig; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.core.userdetails.UserDetails; + +import javax.servlet.http.HttpServletRequest; +import java.util.function.BiFunction; + +/** + * 权限配置 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022-05-30 21:22:12 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Configuration +public class SecurityConfig extends AbstractSecurityConfig { + /** + * 获取TOKEN 解析类 + */ + @Autowired + private LoginService loginService; + + @Override + protected BiFunction userFunction() { + return (token, request) -> loginService.getLoginUserDetail(token, request); + } + + @Override + protected String[] getAuthenticatedUrlPatterns() { + return new String[]{"/**"}; + } + + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/config/SecurityMethodConfig.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/config/SecurityMethodConfig.java new file mode 100644 index 00000000..772b2d5d --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/config/SecurityMethodConfig.java @@ -0,0 +1,50 @@ +package net.lab1024.sa.admin.config; + +import net.lab1024.sa.admin.module.system.login.domain.LoginEmployeeDetail; +import net.lab1024.sa.common.common.annoation.SaAuth; +import net.lab1024.sa.common.common.security.SecurityMethodSource; +import net.lab1024.sa.common.common.security.SecurityPermissionCheckService; +import org.springframework.context.annotation.Bean; +import org.springframework.security.access.expression.method.ExpressionBasedAnnotationAttributeFactory; +import org.springframework.security.access.method.MethodSecurityMetadataSource; +import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; +import org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration; +import org.springframework.security.core.Authentication; + +/** + * 1、以类名加方法名为权限字符串的校验模式
+ * 2、重写MethodSecurityMetadataSource将优化security配置,只需在方法上加上@saAuth注解,方法上就会存在权限(权限字符串为类名加方法名),而无需另外手动设置,减轻后端开发成本
+ * 3、security将不再依据权限字符串进行权限控制,
+ * 4、security将依据对应权限字符串下的接口权限进行控制
+ * 5、采用此配置原@PreAuthorize依然有效
+ * 6、如若无需此配置,需将@EnableGlobalMethodSecurity注解添加至SecurityConfig类上 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2021-08-31 0:01 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@EnableGlobalMethodSecurity(prePostEnabled = true) +public class SecurityMethodConfig extends GlobalMethodSecurityConfiguration { + + @Bean(SaAuth.saAuth) + public SecurityPermissionCheckService securityPermissionCheckService() { + return new SecurityPermissionCheckService() { + @Override + public boolean checkPermission(Authentication authentication, String permission) { + LoginEmployeeDetail loginEmployeeDetail = (LoginEmployeeDetail) authentication.getPrincipal(); + if (loginEmployeeDetail.getAdministratorFlag()) { + return true; + } + return super.permissionJudge(loginEmployeeDetail, permission); + } + }; + } + + @Override + public MethodSecurityMetadataSource customMethodSecurityMetadataSource() { + ExpressionBasedAnnotationAttributeFactory attributeFactory = new ExpressionBasedAnnotationAttributeFactory(this.getExpressionHandler()); + return new SecurityMethodSource(attributeFactory, SaAuth.saAuth); + } +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/constant/AdminCacheConst.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/constant/AdminCacheConst.java new file mode 100644 index 00000000..ebacfdf0 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/constant/AdminCacheConst.java @@ -0,0 +1,57 @@ +package net.lab1024.sa.admin.constant; + +import net.lab1024.sa.common.constant.CacheKeyConst; + +/** + * 缓存 key + * + * @Author 1024创新实验室-主任:卓大 + * @Date 2022-01-07 18:59:22 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +public class AdminCacheConst extends CacheKeyConst { + + public static class Department { + + /** + * 部门列表 + */ + public static final String DEPARTMENT_LIST_CACHE = "department_list_cache"; + + /** + * 部门map + */ + public static final String DEPARTMENT_MAP_CACHE = "department_map_cache"; + + /** + * 部门树 + */ + public static final String DEPARTMENT_TREE_CACHE = "department_tree_cache"; + + /** + * 某个部门以及下级的id列表 + */ + public static final String DEPARTMENT_SELF_CHILDREN_CACHE = "department_self_children_cache"; + + /** + * 部门路径 缓存 + */ + public static final String DEPARTMENT_PATH_CACHE = "department_path_cache"; + + } + + /** + * 分类相关缓存 + */ + public static class CATEGORY { + + public static final String CATEGORY_ENTITY = "category_cache"; + + public static final String CATEGORY_SUB = "category_sub_cache"; + + public static final String CATEGORY_TREE = "category_tree_cache"; + } + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/constant/AdminRedisKeyConst.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/constant/AdminRedisKeyConst.java new file mode 100644 index 00000000..301c73a8 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/constant/AdminRedisKeyConst.java @@ -0,0 +1,17 @@ +package net.lab1024.sa.admin.constant; + +import net.lab1024.sa.common.constant.RedisKeyConst; + +/** + * redis key 常量类 + * + * @Author 1024创新实验室-主任:卓大 + * @Date 2022-01-07 18:59:22 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +public class AdminRedisKeyConst extends RedisKeyConst { + + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/constant/AdminSwaggerTagConst.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/constant/AdminSwaggerTagConst.java new file mode 100644 index 00000000..a037fa66 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/constant/AdminSwaggerTagConst.java @@ -0,0 +1,55 @@ +package net.lab1024.sa.admin.constant; + +import net.lab1024.sa.common.constant.SwaggerTagConst; + +/** + * swagger + * + * @Author 1024创新实验室:罗伊 + * @Date 2022-01-07 18:59:22 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +public class AdminSwaggerTagConst extends SwaggerTagConst { + + public static class Business { + public static final String MANAGER_CATEGORY = "ERP进销存-分类管理"; + + public static final String MANAGER_GOODS = "ERP进销存-商品管理"; + + public static final String OA_BANK = "OA办公-银行卡信息"; + + public static final String OA_ENTERPRISE = "OA办公-企业"; + + public static final String OA_INVOICE = "OA办公-发票信息"; + + public static final String OA_NOTICE = "OA办公-通知公告"; + } + + + public static class System { + + public static final String SYSTEM_LOGIN = "系统-员工登录"; + + public static final String SYSTEM_EMPLOYEE = "系统-员工管理"; + + public static final String SYSTEM_DEPARTMENT = "系统-部门管理"; + + public static final String SYSTEM_MENU = "系统-菜单"; + + public static final String SYSTEM_DATA_SCOPE = "系统-系统-数据范围"; + + public static final String SYSTEM_ROLE = "系统-角色"; + + public static final String SYSTEM_ROLE_DATA_SCOPE = "系统-角色-数据范围"; + + public static final String SYSTEM_ROLE_EMPLOYEE = "系统-角色-员工"; + + public static final String SYSTEM_ROLE_MENU = "系统-角色-菜单"; + + public static final String SYSTEM_DATA_TRACER = "系统-"; + } + + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/listener/AdminStartupRunner.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/listener/AdminStartupRunner.java new file mode 100644 index 00000000..cf8d0490 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/listener/AdminStartupRunner.java @@ -0,0 +1,40 @@ +package net.lab1024.sa.admin.listener; + +import lombok.extern.slf4j.Slf4j; +import net.lab1024.sa.common.common.code.ErrorCodeRegister; +import net.lab1024.sa.common.config.ScheduleConfig; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.CommandLineRunner; +import org.springframework.stereotype.Component; + +/** + * admin 应用启动加载 + * + * @Author 1024创新实验室-主任:卓大 + * @Date 2021-08-26 18:46:32 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Slf4j +@Component +public class AdminStartupRunner implements CommandLineRunner { + + @Autowired + private ScheduleConfig scheduleConfig; + + @Override + public void run(String... args) { + + // 初始化状态码 + int codeCount = ErrorCodeRegister.initialize(); + + //TODO <卓大> :根据实际情况来决定是否开启定时任务 + String destroySchedules = "Spring 定时任务 @Schedule 已启动"; +// destroySchedules = scheduleConfig.destroy(); + + log.info("\n ---------------【1024创新实验室 温馨提示:】 ErrorCode 共计完成初始化: {}个!---------------" + + "\n ---------------【1024创新实验室 温馨提示:】 {}---------------\n", codeCount, destroySchedules); + + } +} \ No newline at end of file diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/constant/CategoryTypeEnum.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/constant/CategoryTypeEnum.java new file mode 100644 index 00000000..2df51fe3 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/constant/CategoryTypeEnum.java @@ -0,0 +1,36 @@ +package net.lab1024.sa.admin.module.business.category.constant; + + +import lombok.AllArgsConstructor; +import lombok.Getter; +import net.lab1024.sa.common.common.enumeration.BaseEnum; + +/** + * 分类类型 枚举 + * + * @Author 1024创新实验室: 胡克 + * @Date 2021/08/05 21:26:58 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@AllArgsConstructor +@Getter +public enum CategoryTypeEnum implements BaseEnum { + + /** + * 1 商品 + */ + GOODS(1, "商品"), + + /** + * 2 自定义 + */ + CUSTOM(2, "自定义"), + + ; + + private final Integer value; + + private final String desc; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/controller/CategoryController.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/controller/CategoryController.java new file mode 100644 index 00000000..5fff565a --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/controller/CategoryController.java @@ -0,0 +1,67 @@ +package net.lab1024.sa.admin.module.business.category.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import net.lab1024.sa.admin.common.AdminBaseController; +import net.lab1024.sa.admin.constant.AdminSwaggerTagConst; +import net.lab1024.sa.admin.module.business.category.domain.form.CategoryAddForm; +import net.lab1024.sa.admin.module.business.category.domain.form.CategoryTreeQueryForm; +import net.lab1024.sa.admin.module.business.category.domain.form.CategoryUpdateForm; +import net.lab1024.sa.admin.module.business.category.domain.vo.CategoryTreeVO; +import net.lab1024.sa.admin.module.business.category.domain.vo.CategoryVO; +import net.lab1024.sa.admin.module.business.category.service.CategoryService; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.module.support.operatelog.annoation.OperateLog; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + +/** + * 类目 + * + * @Author 1024创新实验室: 胡克 + * @Date 2021/08/05 21:26:58 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@OperateLog +@RestController +@Api(tags = AdminSwaggerTagConst.Business.MANAGER_CATEGORY) +public class CategoryController extends AdminBaseController { + + @Autowired + private CategoryService categoryService; + + @ApiOperation("添加类目 @author 胡克") + @PostMapping("/category/add") + public ResponseDTO add(@RequestBody @Valid CategoryAddForm addForm) { + return categoryService.add(addForm); + } + + @ApiOperation("更新类目 @author 胡克") + @PostMapping("/category/update") + public ResponseDTO update(@RequestBody @Valid CategoryUpdateForm updateForm) { + return categoryService.update(updateForm); + } + + @ApiOperation("查询类目详情 @author 胡克") + @GetMapping("/category/{categoryId}") + public ResponseDTO queryDetail(@PathVariable Long categoryId) { + return categoryService.queryDetail(categoryId); + } + + @ApiOperation("查询类目层级树 @author 胡克") + @PostMapping("/category/tree") + public ResponseDTO> queryTree(@RequestBody @Valid CategoryTreeQueryForm queryForm) { + return categoryService.queryTree(queryForm); + } + + @ApiOperation("删除类目 @author 胡克") + @GetMapping("/category/delete/{categoryId}") + public ResponseDTO delete(@PathVariable Long categoryId) { + return categoryService.delete(categoryId); + } +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/dao/CategoryDao.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/dao/CategoryDao.java new file mode 100644 index 00000000..c9ac00fd --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/dao/CategoryDao.java @@ -0,0 +1,72 @@ +package net.lab1024.sa.admin.module.business.category.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import net.lab1024.sa.admin.module.business.category.constant.CategoryTypeEnum; +import net.lab1024.sa.admin.module.business.category.domain.entity.CategoryEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * 类目 dao + * + * @Author 1024创新实验室: 胡克 + * @Date 2021/08/05 21:26:58 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Component +@Mapper +public interface CategoryDao extends BaseMapper { + + /** + * 根据父级id 类型 查询子类 + * + * @param parentIdList + * @param deletedFlag + * @return + */ + List queryByParentId(@Param("parentIdList") List parentIdList, + @Param("deletedFlag") Boolean deletedFlag); + + /** + * 根据父级id 类型 查询子类 + * + * @param parentIdList + * @param categoryType {@link CategoryTypeEnum} + * @param deletedFlag + * @return + */ + List queryByParentIdAndType(@Param("parentIdList") List parentIdList, + @Param("categoryType") Integer categoryType, + @Param("deletedFlag") Boolean deletedFlag); + + /** + * 某个类型的所有 + * @param categoryType + * @param deletedFlag + * @return + */ + List queryByType(@Param("categoryType") Integer categoryType, + @Param("deletedFlag") Boolean deletedFlag); + + /** + * 根据类型和id查询 + * @param categoryType + * @param categoryId + * @return + */ + CategoryEntity selectByTypeAndId(@Param("categoryType") Integer categoryType, @Param("categoryId") Long categoryId); + + /** + * 查看类目 具体条件 看sql + * + * @param entity + * @return + */ + CategoryEntity selectOne(CategoryEntity entity); + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/domain/dto/CategoryBaseDTO.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/domain/dto/CategoryBaseDTO.java new file mode 100644 index 00000000..5381ab9c --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/domain/dto/CategoryBaseDTO.java @@ -0,0 +1,44 @@ +package net.lab1024.sa.admin.module.business.category.domain.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.admin.module.business.category.constant.CategoryTypeEnum; +import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum; +import net.lab1024.sa.common.common.validator.enumeration.CheckEnum; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +/** + * 类目 基础属性 DTO 类 + * + * @author 胡克 + * @date 2021/1/20 16:17 + */ +@Data +public class CategoryBaseDTO { + + @ApiModelProperty(value = "类目名称", required = true) + @NotBlank(message = "类目名称不能为空") + @Length(max = 20, message = "类目名称最多20字符") + private String categoryName; + + @ApiModelPropertyEnum(desc = "分类类型", value = CategoryTypeEnum.class) + @CheckEnum(value = CategoryTypeEnum.class, required = true, message = "分类错误") + private Integer categoryType; + + @ApiModelProperty("父级类目id|可选") + private Long parentId; + + @ApiModelProperty("排序|可选") + private Integer sort; + + @ApiModelProperty("备注|可选") + @Length(max = 200, message = "备注最多200字符") + private String remark; + + @ApiModelProperty("禁用状态") + @NotNull(message = "禁用状态不能为空") + private Boolean disabledFlag; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/domain/dto/CategorySimpleDTO.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/domain/dto/CategorySimpleDTO.java new file mode 100644 index 00000000..7f25e7b2 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/domain/dto/CategorySimpleDTO.java @@ -0,0 +1,26 @@ +package net.lab1024.sa.admin.module.business.category.domain.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * 类目 基础属性 DTO 类 + * + * @author 胡克 + * @date 2021/1/20 16:17 + */ +@Data +public class CategorySimpleDTO { + + @ApiModelProperty("类目id") + private Long categoryId; + + @ApiModelProperty("类目名称") + private String categoryName; + + @ApiModelProperty("类目层级全称") + private String categoryFullName; + + @ApiModelProperty("父级id") + private Long parentId; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/domain/entity/CategoryEntity.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/domain/entity/CategoryEntity.java new file mode 100644 index 00000000..f8ee74af --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/domain/entity/CategoryEntity.java @@ -0,0 +1,67 @@ +package net.lab1024.sa.admin.module.business.category.domain.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import net.lab1024.sa.admin.module.business.category.constant.CategoryTypeEnum; + +import java.time.LocalDateTime; + +/** + * 类目 实体类 + * + * @Author 1024创新实验室: 胡克 + * @Date 2021/08/05 21:26:58 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +@TableName("t_category") +public class CategoryEntity { + + @TableId(type = IdType.AUTO) + private Long categoryId; + + /** + * 类目名称 + */ + private String categoryName; + + /** + * 类目 类型 + * + * @see CategoryTypeEnum + */ + private Integer categoryType; + + /** + * 父级类目id + */ + private Long parentId; + + /** + * 是否禁用 + */ + private Boolean disabledFlag; + + /** + * 排序 + */ + private Integer sort; + + /** + * 删除状态 + */ + private Boolean deletedFlag; + + /** + * 备注 + */ + private String remark; + + private LocalDateTime updateTime; + + private LocalDateTime createTime; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/domain/form/CategoryAddForm.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/domain/form/CategoryAddForm.java new file mode 100644 index 00000000..29a37810 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/domain/form/CategoryAddForm.java @@ -0,0 +1,49 @@ +package net.lab1024.sa.admin.module.business.category.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.admin.module.business.category.constant.CategoryTypeEnum; +import net.lab1024.sa.admin.module.business.category.domain.dto.CategoryBaseDTO; +import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum; +import net.lab1024.sa.common.common.validator.enumeration.CheckEnum; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +/** + * 类目 添加 + * + * @Author 1024创新实验室: 胡克 + * @Date 2021/08/05 21:26:58 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +public class CategoryAddForm { + + @ApiModelProperty(value = "类目名称", required = true) + @NotBlank(message = "类目名称不能为空") + @Length(max = 20, message = "类目名称最多20字符") + private String categoryName; + + @ApiModelPropertyEnum(desc = "分类类型", value = CategoryTypeEnum.class) + @CheckEnum(value = CategoryTypeEnum.class, required = true, message = "分类错误") + private Integer categoryType; + + @ApiModelProperty("父级类目id|可选") + private Long parentId; + + @ApiModelProperty("排序|可选") + private Integer sort; + + @ApiModelProperty("备注|可选") + @Length(max = 200, message = "备注最多200字符") + private String remark; + + @ApiModelProperty("禁用状态") + @NotNull(message = "禁用状态不能为空") + private Boolean disabledFlag; + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/domain/form/CategoryTreeQueryForm.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/domain/form/CategoryTreeQueryForm.java new file mode 100644 index 00000000..907bca77 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/domain/form/CategoryTreeQueryForm.java @@ -0,0 +1,25 @@ +package net.lab1024.sa.admin.module.business.category.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.admin.module.business.category.constant.CategoryTypeEnum; +import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum; + +/** + * 类目 层级树查询 + * + * @Author 1024创新实验室: 胡克 + * @Date 2021/08/05 21:26:58 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +public class CategoryTreeQueryForm { + + @ApiModelPropertyEnum(desc = "分类类型|可选", value = CategoryTypeEnum.class) + private Integer categoryType; + + @ApiModelProperty("父级类目id|可选") + private Long parentId; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/domain/form/CategoryUpdateForm.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/domain/form/CategoryUpdateForm.java new file mode 100644 index 00000000..959c7027 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/domain/form/CategoryUpdateForm.java @@ -0,0 +1,24 @@ +package net.lab1024.sa.admin.module.business.category.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.admin.module.business.category.domain.dto.CategoryBaseDTO; + +import javax.validation.constraints.NotNull; + +/** + * 类目 更新 + * + * @Author 1024创新实验室: 胡克 + * @Date 2021/08/05 21:26:58 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +public class CategoryUpdateForm extends CategoryAddForm { + + @ApiModelProperty("类目id") + @NotNull(message = "类目id不能为空") + private Long categoryId; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/domain/vo/CategoryTreeVO.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/domain/vo/CategoryTreeVO.java new file mode 100644 index 00000000..db3ecda3 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/domain/vo/CategoryTreeVO.java @@ -0,0 +1,40 @@ +package net.lab1024.sa.admin.module.business.category.domain.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * 类目 层级树 vo + * + * @Author 1024创新实验室: 胡克 + * @Date 2021/08/05 21:26:58 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +public class CategoryTreeVO { + + @ApiModelProperty("类目id") + private Long categoryId; + + @ApiModelProperty("类目名称") + private String categoryName; + + @ApiModelProperty("类目层级全称") + private String categoryFullName; + + @ApiModelProperty("父级id") + private Long parentId; + + @ApiModelProperty("类目id") + private Long value; + + @ApiModelProperty("类目名称") + private String label; + + @ApiModelProperty("子类") + private List children; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/domain/vo/CategoryVO.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/domain/vo/CategoryVO.java new file mode 100644 index 00000000..23b71962 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/domain/vo/CategoryVO.java @@ -0,0 +1,51 @@ +package net.lab1024.sa.admin.module.business.category.domain.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.admin.module.business.category.constant.CategoryTypeEnum; +import net.lab1024.sa.admin.module.business.category.domain.dto.CategoryBaseDTO; +import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum; +import net.lab1024.sa.common.common.validator.enumeration.CheckEnum; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.time.LocalDateTime; + +/** + * 类目 + * + * @Author 1024创新实验室: 胡克 + * @Date 2021/08/05 21:26:58 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +public class CategoryVO { + + @ApiModelProperty(value = "类目名称", required = true) + private String categoryName; + + @ApiModelPropertyEnum(desc = "分类类型", value = CategoryTypeEnum.class) + private Integer categoryType; + + @ApiModelProperty("父级类目id|可选") + private Long parentId; + + @ApiModelProperty("排序|可选") + private Integer sort; + + @ApiModelProperty("备注|可选") + private String remark; + + @ApiModelProperty("禁用状态") + private Boolean disabledFlag; + + @ApiModelProperty("类目id") + private Long categoryId; + + private LocalDateTime updateTime; + + private LocalDateTime createTime; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/manager/CategoryCacheManager.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/manager/CategoryCacheManager.java new file mode 100644 index 00000000..819d99dc --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/manager/CategoryCacheManager.java @@ -0,0 +1,120 @@ +package net.lab1024.sa.admin.module.business.category.manager; + +import com.google.common.collect.Lists; +import lombok.extern.slf4j.Slf4j; +import net.lab1024.sa.admin.constant.AdminCacheConst; +import net.lab1024.sa.admin.module.business.category.dao.CategoryDao; +import net.lab1024.sa.admin.module.business.category.domain.entity.CategoryEntity; +import net.lab1024.sa.admin.module.business.category.domain.vo.CategoryTreeVO; +import net.lab1024.sa.common.common.constant.StringConst; +import net.lab1024.sa.common.common.util.SmartBeanUtil; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 类目 查询 缓存 + * + * @Author 1024创新实验室: 胡克 + * @Date 2021/08/05 21:26:58 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Service +@Slf4j +public class CategoryCacheManager { + + + @Autowired + private CategoryDao categoryDao; + + + /** + * 根据类目id 移除缓存 + */ + @CacheEvict(value = {AdminCacheConst.CATEGORY.CATEGORY_ENTITY, AdminCacheConst.CATEGORY.CATEGORY_SUB, AdminCacheConst.CATEGORY.CATEGORY_TREE}, allEntries = true) + public void removeCache() { + log.info("clear CATEGORY ,CATEGORY_SUB ,CATEGORY_TREE"); + } + + /** + * 查詢类目 + * + * @param categoryId + * @return + */ + @Cacheable(AdminCacheConst.CATEGORY.CATEGORY_ENTITY) + public CategoryEntity queryCategory(Long categoryId) { + return categoryDao.selectById(categoryId); + } + + /** + * 查询类目 子级 + * + * @param categoryId + * @return + */ + @Cacheable(AdminCacheConst.CATEGORY.CATEGORY_SUB) + public List querySubCategory(Long categoryId) { + return categoryDao.queryByParentId(Lists.newArrayList(categoryId), false); + } + + + /** + * 查询类目 层级树 + * 优先查询缓存 + * + * @return + */ + @Cacheable(AdminCacheConst.CATEGORY.CATEGORY_TREE) + public List queryCategoryTree(Long parentId, Integer categoryType) { + List allCategoryEntityList = categoryDao.queryByType(categoryType, false); + + List categoryEntityList = allCategoryEntityList.stream().filter(e -> e.getParentId().equals(parentId)).collect(Collectors.toList()); + List treeList = SmartBeanUtil.copyList(categoryEntityList, CategoryTreeVO.class); + treeList.forEach(e -> { + e.setLabel(e.getCategoryName()); + e.setValue(e.getCategoryId()); + e.setCategoryFullName(e.getCategoryName()); + }); + // 递归设置子类 + this.queryAndSetSubCategory(treeList, allCategoryEntityList); + return treeList; + } + + /** + * 递归查询设置类目子类 + * 从缓存查询子类 + * + * @param treeList + */ + private void queryAndSetSubCategory(List treeList, List allCategoryEntityList) { + if (CollectionUtils.isEmpty(treeList)) { + return; + } + List parentIdList = treeList.stream().map(CategoryTreeVO::getValue).collect(Collectors.toList()); + List categoryEntityList = allCategoryEntityList.stream().filter(e -> parentIdList.contains(e.getParentId())).collect(Collectors.toList()); + Map> categorySubMap = categoryEntityList.stream().collect(Collectors.groupingBy(CategoryEntity::getParentId)); + treeList.forEach(e -> { + List childrenEntityList = categorySubMap.getOrDefault(e.getValue(), Lists.newArrayList()); + List childrenVOList = SmartBeanUtil.copyList(childrenEntityList, CategoryTreeVO.class); + childrenVOList.forEach(item -> { + item.setLabel(item.getCategoryName()); + item.setValue(item.getCategoryId()); + item.setCategoryFullName(e.getCategoryFullName() + StringConst.SEPARATOR_SLASH + item.getCategoryName()); + }); + // 递归查询 + this.queryAndSetSubCategory(childrenVOList, allCategoryEntityList); + e.setChildren(childrenVOList); + }); + } + + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/service/CategoryQueryService.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/service/CategoryQueryService.java new file mode 100644 index 00000000..4f643e66 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/service/CategoryQueryService.java @@ -0,0 +1,214 @@ +package net.lab1024.sa.admin.module.business.category.service; + +import cn.hutool.core.util.StrUtil; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import lombok.extern.slf4j.Slf4j; +import net.lab1024.sa.admin.module.business.category.dao.CategoryDao; +import net.lab1024.sa.admin.module.business.category.domain.entity.CategoryEntity; +import net.lab1024.sa.admin.module.business.category.domain.dto.CategorySimpleDTO; +import net.lab1024.sa.admin.module.business.category.manager.CategoryCacheManager; +import net.lab1024.sa.common.common.constant.StringConst; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * 类目 查询 业务类 + * + * @Author 1024创新实验室: 胡克 + * @Date 2021/08/05 21:26:58 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Service +@Slf4j +public class CategoryQueryService { + + private static final Long DEFAULT_CATEGORY_PARENT_ID = 0L; + + @Autowired + private CategoryDao categoryDao; + + @Autowired + private CategoryCacheManager categoryCacheManager; + + /** + * 根据 id 查询未删除的类目 + * + * @param categoryId + * @return 可能 null + */ + public Optional queryCategory(Long categoryId) { + if (null == categoryId) { + return Optional.empty(); + } + CategoryEntity entity = categoryCacheManager.queryCategory(categoryId); + if (null == entity || entity.getDeletedFlag()) { + return Optional.empty(); + } + return Optional.of(entity); + } + + + /** + * 根据 类目id集合 查询未删除的类目集合 + * + * @param categoryIdList + * @return + */ + public Map queryCategoryList(List categoryIdList) { + if (CollectionUtils.isEmpty(categoryIdList)) { + return Collections.emptyMap(); + } + categoryIdList = categoryIdList.stream().distinct().collect(Collectors.toList()); + Map categoryEntityMap = Maps.newHashMap(); + for (Long categoryId : categoryIdList) { + CategoryEntity categoryEntity = categoryCacheManager.queryCategory(categoryId); + if(categoryEntity != null){ + categoryEntityMap.put(categoryId, categoryEntity); + } + } + return categoryEntityMap; + } + + + /** + * 根据类目id 递归查询该id的所有子类id 递归查询 + * 同时存入缓存 + * 注意:查询出来的集合 不包含传递的父类参数 + * + * @param categoryIdList + */ + public List queryCategorySubId(List categoryIdList) { + if (CollectionUtils.isEmpty(categoryIdList)) { + return Collections.emptyList(); + } + //所有子类 + List categoryEntityList = Lists.newArrayList(); + categoryIdList.forEach(e -> { + categoryEntityList.addAll(categoryCacheManager.querySubCategory(e)); + }); + Map> subTypeMap = categoryEntityList.stream().collect(Collectors.groupingBy(CategoryEntity::getCategoryId)); + // 递归查询子类 + categoryIdList = subTypeMap.values().stream().flatMap(Collection::stream).map(CategoryEntity::getCategoryId).distinct().collect(Collectors.toList()); + if (CollectionUtils.isEmpty(categoryIdList)) { + return Lists.newArrayList(); + } + categoryIdList.addAll(this.queryCategorySubId(categoryIdList)); + return categoryIdList; + } + + + /** + * 处理类目名称 + * + * @param categoryIdList + */ + public List queryCategoryName(List categoryIdList) { + if (CollectionUtils.isEmpty(categoryIdList)) { + return null; + } + Map categoryMap = this.queryCategoryList(categoryIdList); + List categoryNameList = Lists.newArrayList(); + categoryIdList.forEach(e -> { + CategoryEntity categoryEntity = categoryMap.get(e); + if (categoryEntity != null) { + categoryNameList.add(categoryMap.get(e).getCategoryName()); + } + }); + return categoryNameList; + } + + /** + * 根据类目id 查询类目名称 + * + * @param categoryId + * @return + */ + public String queryCategoryName(Long categoryId) { + CategoryEntity categoryEntity = categoryCacheManager.queryCategory(categoryId); + if (null == categoryEntity || categoryEntity.getDeletedFlag()) { + return null; + } + return categoryEntity.getCategoryName(); + } + + /** + * 根据类目id 查询类目详情 包含类目全称 如:医考/医师资格/临床执业 + * + * @param categoryId + * @return + */ + public CategorySimpleDTO queryCategoryInfo(Long categoryId) { + CategoryEntity categoryEntity = categoryCacheManager.queryCategory(categoryId); + if (null == categoryEntity || categoryEntity.getDeletedFlag()) { + return null; + } + String fullName = this.queryFullName(categoryId); + // 返回DTO + CategorySimpleDTO categoryDTO = new CategorySimpleDTO(); + categoryDTO.setCategoryId(categoryId); + categoryDTO.setCategoryName(categoryEntity.getCategoryName()); + categoryDTO.setCategoryFullName(fullName); + categoryDTO.setParentId(categoryEntity.getParentId()); + return categoryDTO; + } + + /** + * 递归查询分类和所有父级类目 + * ps:特别注意返回的集合中 包含自己 + * + * @param categoryId + * @return + */ + public List queryCategoryAndParent(Long categoryId) { + List parentCategoryList = Lists.newArrayList(); + CategoryEntity categoryEntity = categoryCacheManager.queryCategory(categoryId); + if (null == categoryEntity || categoryEntity.getDeletedFlag()) { + return parentCategoryList; + } + + // 父级始终放在第一位 + parentCategoryList.add(0, categoryEntity); + Long parentId = categoryEntity.getParentId(); + if (Objects.equals(DEFAULT_CATEGORY_PARENT_ID, parentId)) { + return parentCategoryList; + } + parentCategoryList.addAll(0, this.queryCategoryAndParent(parentId)); + return parentCategoryList; + } + + /** + * 查询 分类全称 如:医考/医师资格/临床执业 + * + * @param categoryId + * @return + */ + public String queryFullName(Long categoryId) { + List parentCategoryList = this.queryCategoryAndParent(categoryId); + // 拼接父级类目名称 斜杠分隔返回 + List nameList = parentCategoryList.stream().map(CategoryEntity::getCategoryName).collect(Collectors.toList()); + return StrUtil.join(StringConst.SEPARATOR_SLASH, nameList); + } + + /** + * 查询 分类全称 如:医考/医师资格/临床执业 + * + * @param categoryIdList + * @return + */ + public Map queryFullName(List categoryIdList) { + if (CollectionUtils.isEmpty(categoryIdList)) { + return Collections.EMPTY_MAP; + } + // 循环内查询的缓存 还ok + return categoryIdList.stream().collect(Collectors.toMap(Function.identity(), this::queryFullName)); + } + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/service/CategoryService.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/service/CategoryService.java new file mode 100644 index 00000000..2dd1ae44 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/category/service/CategoryService.java @@ -0,0 +1,220 @@ +package net.lab1024.sa.admin.module.business.category.service; + +import com.google.common.collect.Lists; +import net.lab1024.sa.admin.module.business.category.dao.CategoryDao; +import net.lab1024.sa.admin.module.business.category.domain.entity.CategoryEntity; +import net.lab1024.sa.admin.module.business.category.domain.form.CategoryAddForm; +import net.lab1024.sa.admin.module.business.category.domain.form.CategoryTreeQueryForm; +import net.lab1024.sa.admin.module.business.category.domain.form.CategoryUpdateForm; +import net.lab1024.sa.admin.module.business.category.domain.vo.CategoryTreeVO; +import net.lab1024.sa.admin.module.business.category.domain.vo.CategoryVO; +import net.lab1024.sa.admin.module.business.category.manager.CategoryCacheManager; +import net.lab1024.sa.common.common.code.UserErrorCode; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.util.SmartBeanUtil; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.math.NumberUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Objects; +import java.util.Optional; + +/** + * 类目 + * + * @Author 1024创新实验室: 胡克 + * @Date 2021/08/05 21:26:58 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Service +public class CategoryService { + + @Autowired + private CategoryDao categoryDao; + + @Autowired + private CategoryQueryService categoryQueryService; + + @Autowired + private CategoryCacheManager categoryCacheManager; + + /** + * 添加类目 + * + * @author 胡克 + * @date 2021/1/20 17:17 + */ + public ResponseDTO add(CategoryAddForm addForm) { + // 校验类目 + CategoryEntity categoryEntity = SmartBeanUtil.copy(addForm, CategoryEntity.class); + ResponseDTO res = this.checkCategory(categoryEntity, false); + if (!res.getOk()) { + return res; + } + // 没有父类则使用默认父类 + Long parentId = null == addForm.getParentId() ? NumberUtils.LONG_ZERO : addForm.getParentId(); + categoryEntity.setParentId(parentId); + categoryEntity.setSort(null == addForm.getSort() ? 0 : addForm.getSort()); + categoryEntity.setDeletedFlag(false); + + // 保存数据 + categoryDao.insert(categoryEntity); + + // 更新缓存 + categoryCacheManager.removeCache(); + return ResponseDTO.ok(); + } + + /** + * 更新类目 + * 不能更新父级类目 + * + * @author 胡克 + * @date 2021/1/20 17:17 + */ + public ResponseDTO update(CategoryUpdateForm updateForm) { + // 校验类目 + Long categoryId = updateForm.getCategoryId(); + Optional optional = categoryQueryService.queryCategory(categoryId); + if (!optional.isPresent()) { + return ResponseDTO.error(UserErrorCode.DATA_NOT_EXIST); + } + CategoryEntity categoryEntity = SmartBeanUtil.copy(updateForm, CategoryEntity.class); + + /** + * 不更新类目类型 + * 不更新父类id + */ + Integer categoryType = optional.get().getCategoryType(); + categoryEntity.setCategoryType(categoryType); + categoryEntity.setParentId(optional.get().getParentId()); + + ResponseDTO responseDTO = this.checkCategory(categoryEntity, true); + if (!responseDTO.getOk()) { + return responseDTO; + } + categoryDao.updateById(categoryEntity); + + // 更新缓存 + categoryCacheManager.removeCache(); + return ResponseDTO.ok(); + } + + /** + * 新增/更新 类目时的 校验 + * + * @param categoryEntity + * @param isUpdate + * @return + */ + private ResponseDTO checkCategory(CategoryEntity categoryEntity, boolean isUpdate) { + // 校验父级是否存在 + Long parentId = categoryEntity.getParentId(); + Integer categoryType = categoryEntity.getCategoryType(); + if (null != parentId) { + if (Objects.equals(categoryEntity.getCategoryId(), parentId)) { + return ResponseDTO.userErrorParam("父级类目怎么和自己相同了"); + } + if (!Objects.equals(parentId, NumberUtils.LONG_ZERO)) { + Optional optional = categoryQueryService.queryCategory(parentId); + if (!optional.isPresent()) { + return ResponseDTO.error(UserErrorCode.DATA_NOT_EXIST, "父级类目不存在~"); + } + + CategoryEntity parent = optional.get(); + if (!Objects.equals(categoryType, parent.getCategoryType())) { + return ResponseDTO.userErrorParam("与父级类目类型不一致"); + } + } + + } else { + // 如果没有父类 使用默认父类 + parentId = NumberUtils.LONG_ZERO; + } + + // 校验同父类下 名称是否重复 + CategoryEntity queryEntity = new CategoryEntity(); + queryEntity.setParentId(parentId); + queryEntity.setCategoryType(categoryType); + queryEntity.setCategoryName(categoryEntity.getCategoryName()); + queryEntity.setDeletedFlag(false); + queryEntity = categoryDao.selectOne(queryEntity); + if (null != queryEntity) { + if (isUpdate) { + if (!Objects.equals(queryEntity.getCategoryId(), categoryEntity.getCategoryId())) { + return ResponseDTO.userErrorParam("同级下已存在相同类目~"); + } + } else { + return ResponseDTO.userErrorParam("同级下已存在相同类目~"); + } + } + return ResponseDTO.ok(); + } + + /** + * 查询 类目详情 + * + * @param categoryId + * @return + */ + public ResponseDTO queryDetail(Long categoryId) { + Optional optional = categoryQueryService.queryCategory(categoryId); + if (!optional.isPresent()) { + return ResponseDTO.error(UserErrorCode.DATA_NOT_EXIST); + } + CategoryVO adminVO = SmartBeanUtil.copy(optional.get(), CategoryVO.class); + return ResponseDTO.ok(adminVO); + } + + /** + * 根据父级id 查询所有子类 返回层级树 + * 如果父类id 为空 返回所有类目层级 + * + * @param queryForm + * @return + */ + public ResponseDTO> queryTree(CategoryTreeQueryForm queryForm) { + if (null == queryForm.getParentId()) { + if (null == queryForm.getCategoryType()) { + return ResponseDTO.userErrorParam("类目类型不能为空"); + } + queryForm.setParentId(NumberUtils.LONG_ZERO); + } + List treeList = categoryCacheManager.queryCategoryTree(queryForm.getParentId(), queryForm.getCategoryType()); + return ResponseDTO.ok(treeList); + } + + /** + * 删除类目 + * 如果有未删除的子类 则无法删除 + * + * @param categoryId + * @return + */ + public ResponseDTO delete(Long categoryId) { + Optional optional = categoryQueryService.queryCategory(categoryId); + if (!optional.isPresent()) { + return ResponseDTO.error(UserErrorCode.DATA_NOT_EXIST); + } + + List categorySubId = categoryQueryService.queryCategorySubId(Lists.newArrayList(categoryId)); + if (CollectionUtils.isNotEmpty(categorySubId)) { + return ResponseDTO.userErrorParam("请先删除子级类目"); + } + + // 更新数据 + CategoryEntity categoryEntity = new CategoryEntity(); + categoryEntity.setCategoryId(categoryId); + categoryEntity.setDeletedFlag(true); + categoryDao.updateById(categoryEntity); + + // 更新缓存 + categoryCacheManager.removeCache(); + return ResponseDTO.ok(); + } + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/constant/GoodsStatusEnum.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/constant/GoodsStatusEnum.java new file mode 100644 index 00000000..8638da70 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/constant/GoodsStatusEnum.java @@ -0,0 +1,42 @@ +package net.lab1024.sa.admin.module.business.goods.constant; + + +import lombok.AllArgsConstructor; +import lombok.Getter; +import net.lab1024.sa.common.common.enumeration.BaseEnum; + +/** + * 商品状态 + * + * @Author 1024创新实验室: 胡克 + * @Date 2021-10-25 20:26:54 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@AllArgsConstructor +@Getter +public enum GoodsStatusEnum implements BaseEnum { + + /** + * 1 预约中 + */ + APPOINTMENT(1, "预约中"), + + /** + * 2 售卖 + */ + SELL(2, "售卖中"), + + /** + * 3 售罄 + */ + SELL_OUT(3, "售罄"), + + + ; + + private final Integer value; + + private final String desc; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/controller/GoodsController.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/controller/GoodsController.java new file mode 100644 index 00000000..b1a31ccf --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/controller/GoodsController.java @@ -0,0 +1,75 @@ +package net.lab1024.sa.admin.module.business.goods.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import net.lab1024.sa.admin.common.AdminBaseController; +import net.lab1024.sa.admin.constant.AdminSwaggerTagConst; +import net.lab1024.sa.admin.module.business.goods.domain.form.GoodsAddForm; +import net.lab1024.sa.admin.module.business.goods.domain.form.GoodsQueryForm; +import net.lab1024.sa.admin.module.business.goods.domain.form.GoodsUpdateForm; +import net.lab1024.sa.admin.module.business.goods.domain.vo.GoodsVO; +import net.lab1024.sa.admin.module.business.goods.service.GoodsService; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.domain.ValidateList; +import net.lab1024.sa.common.module.support.operatelog.annoation.OperateLog; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + +/** + * 商品业务 + * + * @Author 1024创新实验室: 胡克 + * @Date 2021-10-25 20:26:54 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@OperateLog +@RestController +@Api(tags = AdminSwaggerTagConst.Business.MANAGER_GOODS) +public class GoodsController extends AdminBaseController { + + @Autowired + private GoodsService goodsService; + + @ApiOperation("分页查询 @author 胡克") + @PostMapping("/goods/query") + @PreAuthorize("@saAuth.checkPermission('goods:query ')") + public ResponseDTO> query(@RequestBody @Valid GoodsQueryForm queryForm) { + return goodsService.query(queryForm); + } + + @ApiOperation("添加商品 @author 胡克") + @PostMapping("/goods/add") + @PreAuthorize("@saAuth.checkPermission('goods:add')") + public ResponseDTO add(@RequestBody @Valid GoodsAddForm addForm) { + return goodsService.add(addForm); + } + + @ApiOperation("更新商品 @author 胡克") + @PostMapping("/goods/update") + @PreAuthorize("@saAuth.checkPermission('goods:update')") + public ResponseDTO update(@RequestBody @Valid GoodsUpdateForm updateForm) { + return goodsService.update(updateForm); + } + + @ApiOperation("删除 @author 卓大") + @GetMapping("/goods/delete/{goodsId}") + @PreAuthorize("@saAuth.checkPermission('goods:delete')") + public ResponseDTO delete(@PathVariable Long goodsId) { + return goodsService.delete(goodsId); + } + + @ApiOperation("批量 @author 卓大") + @PostMapping("/goods/batchDelete") + @PreAuthorize("@saAuth.checkPermission('goods:batchDelete')") + public ResponseDTO batchDelete(@RequestBody @Valid ValidateList idList) { + return goodsService.batchDelete(idList); + } + + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/dao/GoodsDao.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/dao/GoodsDao.java new file mode 100644 index 00000000..0493f2e3 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/dao/GoodsDao.java @@ -0,0 +1,41 @@ +package net.lab1024.sa.admin.module.business.goods.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import net.lab1024.sa.admin.module.business.goods.domain.entity.GoodsEntity; +import net.lab1024.sa.admin.module.business.goods.domain.form.GoodsQueryForm; +import net.lab1024.sa.admin.module.business.goods.domain.vo.GoodsVO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * 商品 + * + * @Author 1024创新实验室: 胡克 + * @Date 2021-10-25 20:26:54 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Mapper +@Component +public interface GoodsDao extends BaseMapper { + + /** + * 分页 查询商品 + * + * @param page + * @param query + * @return + */ + List query(Page page, @Param("query") GoodsQueryForm query); + + /** + * 批量更新删除状态 + */ + + void batchUpdateDeleted(@Param("goodsIdList")List goodsIdList,@Param("deletedFlag")Boolean deletedFlag); +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/domain/entity/GoodsEntity.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/domain/entity/GoodsEntity.java new file mode 100644 index 00000000..a2878a66 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/domain/entity/GoodsEntity.java @@ -0,0 +1,75 @@ +package net.lab1024.sa.admin.module.business.goods.domain.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import net.lab1024.sa.admin.module.business.category.dao.CategoryDao; +import net.lab1024.sa.common.module.support.datatracer.annoation.DataTracerFieldBigDecimal; +import net.lab1024.sa.common.module.support.datatracer.annoation.DataTracerFieldLabel; +import net.lab1024.sa.common.module.support.datatracer.annoation.DataTracerFieldSql; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * 商品 实体类 + * + * @Author 1024创新实验室: 胡克 + * @Date 2021-10-25 20:26:54 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +@TableName("t_goods") +public class GoodsEntity { + + @TableId(type = IdType.AUTO) + private Long goodsId; + + /** + * 商品状态:[1:预约中,2:售卖中,3:售罄] + */ + private Integer goodsStatus; + + /** + * 商品分类 + */ + private Long categoryId; + + /** + * 商品名称 + */ + private String goodsName; + + /** + * 产地 + */ + private String place; + + /** + * 商品价格 + */ + private BigDecimal price; + + + /** + * 上架状态 + */ + private Boolean shelvesFlag; + + /** + * 删除状态 + */ + private Boolean deletedFlag; + + /** + * 备注 + */ + private String remark; + + private LocalDateTime updateTime; + + private LocalDateTime createTime; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/domain/form/GoodsAddForm.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/domain/form/GoodsAddForm.java new file mode 100644 index 00000000..27474272 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/domain/form/GoodsAddForm.java @@ -0,0 +1,57 @@ +package net.lab1024.sa.admin.module.business.goods.domain.form; + +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.admin.module.business.goods.constant.GoodsStatusEnum; +import net.lab1024.sa.common.common.json.deserializer.DictValueVoDeserializer; +import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum; +import net.lab1024.sa.common.common.validator.enumeration.CheckEnum; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.DecimalMin; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.math.BigDecimal; + +/** + * 商品 添加表单 + * + * @Author 1024创新实验室: 胡克 + * @Date 2021-10-25 20:26:54 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +public class GoodsAddForm { + + @ApiModelProperty("商品分类") + @NotNull(message = "商品分类不能为空") + private Long categoryId; + + @ApiModelProperty("商品名称") + @NotBlank(message = "商品名称不能为空") + private String goodsName; + + @ApiModelPropertyEnum(GoodsStatusEnum.class) + @CheckEnum(message = "商品状态错误", value = GoodsStatusEnum.class, required = true) + private Integer goodsStatus; + + @ApiModelProperty("产地") + @NotBlank(message = "产地 不能为空 ") + @JsonDeserialize(using = DictValueVoDeserializer.class) + private String place; + + @ApiModelProperty("商品价格") + @NotNull(message = "商品价格不能为空") + @DecimalMin(value = "0", message = "商品价格最低0") + private BigDecimal price; + + @ApiModelProperty("上架状态") + @NotNull(message = "上架状态不能为空") + private Boolean shelvesFlag; + + @ApiModelProperty("备注|可选") + private String remark; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/domain/form/GoodsQueryForm.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/domain/form/GoodsQueryForm.java new file mode 100644 index 00000000..e25e3520 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/domain/form/GoodsQueryForm.java @@ -0,0 +1,46 @@ +package net.lab1024.sa.admin.module.business.goods.domain.form; + +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.admin.module.business.goods.constant.GoodsStatusEnum; +import net.lab1024.sa.common.common.domain.PageParam; +import net.lab1024.sa.common.common.json.deserializer.DictValueVoDeserializer; +import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum; +import net.lab1024.sa.common.common.validator.enumeration.CheckEnum; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; + +/** + * 商品 分页查询 + * + * @Author 1024创新实验室: 胡克 + * @Date 2021-10-25 20:26:54 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +public class GoodsQueryForm extends PageParam { + + @ApiModelProperty("商品分类") + private Integer categoryId; + + @ApiModelProperty("搜索词") + @Length(max = 30, message = "搜索词最多30字符") + private String searchWord; + + @ApiModelPropertyEnum(GoodsStatusEnum.class) + @CheckEnum(message = "商品状态错误", value = GoodsStatusEnum.class, required = false) + private Integer goodsStatus; + + @ApiModelProperty("产地") + private String place; + + @ApiModelProperty("上架状态") + private Boolean shelvesFlag; + + @ApiModelProperty(hidden = true) + private Boolean deletedFlag; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/domain/form/GoodsUpdateForm.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/domain/form/GoodsUpdateForm.java new file mode 100644 index 00000000..f72656ec --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/domain/form/GoodsUpdateForm.java @@ -0,0 +1,23 @@ +package net.lab1024.sa.admin.module.business.goods.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * 商品 更新表单 + * + * @Author 1024创新实验室: 胡克 + * @Date 2021-10-25 20:26:54 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +public class GoodsUpdateForm extends GoodsAddForm { + + @ApiModelProperty("商品id") + @NotNull(message = "商品id不能为空") + private Long goodsId; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/domain/vo/GoodsVO.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/domain/vo/GoodsVO.java new file mode 100644 index 00000000..fe7eaaf6 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/domain/vo/GoodsVO.java @@ -0,0 +1,56 @@ +package net.lab1024.sa.admin.module.business.goods.domain.vo; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.admin.module.business.goods.constant.GoodsStatusEnum; +import net.lab1024.sa.common.common.json.serializer.DictValueVoSerializer; +import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * 商品 + * + * @Author 1024创新实验室: 胡克 + * @Date 2021-10-25 20:26:54 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +public class GoodsVO { + + @ApiModelProperty("商品分类") + private Long categoryId; + + @ApiModelProperty("商品名称") + private String goodsName; + + @ApiModelPropertyEnum(GoodsStatusEnum.class) + private Integer goodsStatus; + + @ApiModelProperty("产地") + @JsonSerialize(using = DictValueVoSerializer.class) + private String place; + + @ApiModelProperty("商品价格") + private BigDecimal price; + + @ApiModelProperty("上架状态") + private Boolean shelvesFlag; + + @ApiModelProperty("备注|可选") + private String remark; + + @ApiModelProperty("商品id") + private Long goodsId; + + @ApiModelProperty("商品分类") + private String categoryName; + + private LocalDateTime updateTime; + + private LocalDateTime createTime; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/manager/GoodsManager.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/manager/GoodsManager.java new file mode 100644 index 00000000..898b6aab --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/manager/GoodsManager.java @@ -0,0 +1,20 @@ +package net.lab1024.sa.admin.module.business.goods.manager; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import net.lab1024.sa.admin.module.business.goods.dao.GoodsDao; +import net.lab1024.sa.admin.module.business.goods.domain.entity.GoodsEntity; +import org.springframework.stereotype.Service; + +/** + * 商品 manager + * + * @Author 1024创新实验室: 胡克 + * @Date 2021-10-25 20:26:54 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Service +public class GoodsManager extends ServiceImpl { + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/service/GoodsService.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/service/GoodsService.java new file mode 100644 index 00000000..dfbdd03b --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/service/GoodsService.java @@ -0,0 +1,168 @@ +package net.lab1024.sa.admin.module.business.goods.service; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import net.lab1024.sa.admin.module.business.category.constant.CategoryTypeEnum; +import net.lab1024.sa.admin.module.business.category.domain.entity.CategoryEntity; +import net.lab1024.sa.admin.module.business.category.service.CategoryQueryService; +import net.lab1024.sa.admin.module.business.goods.constant.GoodsStatusEnum; +import net.lab1024.sa.admin.module.business.goods.dao.GoodsDao; +import net.lab1024.sa.admin.module.business.goods.domain.entity.GoodsEntity; +import net.lab1024.sa.admin.module.business.goods.domain.form.GoodsAddForm; +import net.lab1024.sa.admin.module.business.goods.domain.form.GoodsQueryForm; +import net.lab1024.sa.admin.module.business.goods.domain.form.GoodsUpdateForm; +import net.lab1024.sa.admin.module.business.goods.domain.vo.GoodsVO; +import net.lab1024.sa.admin.module.business.goods.manager.GoodsManager; +import net.lab1024.sa.common.common.code.UserErrorCode; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.util.SmartBeanUtil; +import net.lab1024.sa.common.common.util.SmartPageUtil; +import net.lab1024.sa.common.module.support.datatracer.constant.DataTracerTypeEnum; +import net.lab1024.sa.common.module.support.datatracer.service.DataTracerService; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.stream.Collectors; + +/** + * 商品 + * + * @Author 1024创新实验室: 胡克 + * @Date 2021-10-25 20:26:54 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Service +public class GoodsService { + @Autowired + private GoodsDao goodsDao; + + @Autowired + private CategoryQueryService categoryQueryService; + + @Autowired + private DataTracerService dataTracerService; + + /** + * 添加商品 + * + * @param addForm + * @return + */ + @Transactional(rollbackFor = Exception.class) + public ResponseDTO add(GoodsAddForm addForm) { + // 商品校验 + ResponseDTO res = this.checkGoods(addForm, null); + if (!res.getOk()) { + return res; + } + GoodsEntity goodsEntity = SmartBeanUtil.copy(addForm, GoodsEntity.class); + goodsEntity.setDeletedFlag(Boolean.FALSE); + goodsDao.insert(goodsEntity); + dataTracerService.insert(goodsEntity.getGoodsId(), DataTracerTypeEnum.GOODS); + return ResponseDTO.ok(); + } + + /** + * 更新商品 + * + * @param updateForm + * @return + */ + @Transactional(rollbackFor = Exception.class) + public ResponseDTO update(GoodsUpdateForm updateForm) { + // 商品校验 + ResponseDTO res = this.checkGoods(updateForm, updateForm.getGoodsId()); + if (!res.getOk()) { + return res; + } + GoodsEntity originEntity = goodsDao.selectById(updateForm.getGoodsId()); + GoodsEntity goodsEntity = SmartBeanUtil.copy(updateForm, GoodsEntity.class); + goodsDao.updateById(goodsEntity); + dataTracerService.update(updateForm.getGoodsId(), DataTracerTypeEnum.GOODS, originEntity, goodsEntity); + return ResponseDTO.ok(); + } + + /** + * 添加/更新 商品校验 + * + * @param addForm + * @param goodsId 不为空 代表更新商品 + * @return + */ + private ResponseDTO checkGoods(GoodsAddForm addForm, Long goodsId) { + // 校验类目id + Long categoryId = addForm.getCategoryId(); + Optional optional = categoryQueryService.queryCategory(categoryId); + if (!optional.isPresent() || !CategoryTypeEnum.GOODS.equalsValue(optional.get().getCategoryType())) { + return ResponseDTO.error(UserErrorCode.DATA_NOT_EXIST, "商品类目不存在~"); + } + + return ResponseDTO.ok(); + } + + /** + * 删除 + */ + @Transactional(rollbackFor = Exception.class) + public ResponseDTO delete(Long goodsId) { + GoodsEntity goodsEntity = goodsDao.selectById(goodsId); + if (goodsEntity == null) { + return ResponseDTO.userErrorParam("商品不存在"); + } + + if (!goodsEntity.getGoodsStatus().equals(GoodsStatusEnum.SELL_OUT.getValue())) { + return ResponseDTO.userErrorParam("只有售罄的商品才可以删除"); + } + + batchDelete(Arrays.asList(goodsId)); + dataTracerService.batchDelete(Arrays.asList(goodsId), DataTracerTypeEnum.GOODS); + return ResponseDTO.ok(); + } + + /** + * 批量删除 + */ + public ResponseDTO batchDelete(List goodsIdList) { + if (CollectionUtils.isEmpty(goodsIdList)) { + return ResponseDTO.ok(); + } + + goodsDao.batchUpdateDeleted(goodsIdList, Boolean.TRUE); + return ResponseDTO.ok(); + } + + + /** + * 分页查询 + * + * @param queryForm + * @return + */ + public ResponseDTO> query(GoodsQueryForm queryForm) { + queryForm.setDeletedFlag(false); + Page page = SmartPageUtil.convert2PageQuery(queryForm); + List list = goodsDao.query(page, queryForm); + PageResult pageResult = SmartPageUtil.convert2PageResult(page, list); + if (pageResult.getEmptyFlag()) { + return ResponseDTO.ok(pageResult); + } + // 查询分类名称 + List categoryIdList = list.stream().map(GoodsVO::getCategoryId).distinct().collect(Collectors.toList()); + Map categoryMap = categoryQueryService.queryCategoryList(categoryIdList); + list.forEach(e -> { + CategoryEntity categoryEntity = categoryMap.get(e.getCategoryId()); + if (categoryEntity != null) { + e.setCategoryName(categoryEntity.getCategoryName()); + } + }); + return ResponseDTO.ok(pageResult); + } +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/bank/BankController.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/bank/BankController.java new file mode 100644 index 00000000..96fbea31 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/bank/BankController.java @@ -0,0 +1,74 @@ +package net.lab1024.sa.admin.module.business.oa.bank; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import net.lab1024.sa.admin.constant.AdminSwaggerTagConst; +import net.lab1024.sa.admin.module.business.oa.bank.domain.BankCreateForm; +import net.lab1024.sa.admin.module.business.oa.bank.domain.BankQueryForm; +import net.lab1024.sa.admin.module.business.oa.bank.domain.BankUpdateForm; +import net.lab1024.sa.admin.module.business.oa.bank.domain.BankVO; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.RequestUser; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.util.SmartRequestUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + +/** + * OA办公-OA银行信息 + * + * @Author 1024创新实验室:善逸 + * @Date 2022/6/23 21:59:22 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@RestController +@Api(tags = {AdminSwaggerTagConst.Business.OA_BANK}) +public class BankController { + + @Autowired + private BankService bankService; + + @ApiOperation(value = "分页查询银行信息 @author 善逸") + @PostMapping("/oa/bank/page/query") + public ResponseDTO> queryByPage(@RequestBody @Valid BankQueryForm queryDTO) { + return bankService.queryByPage(queryDTO); + } + + @ApiOperation(value = "根据企业ID查询银行信息列表 @author 善逸") + @GetMapping("/oa/bank/query/list/{enterpriseId}") + public ResponseDTO> queryList(@PathVariable Long enterpriseId) { + return bankService.queryList(enterpriseId); + } + + @ApiOperation(value = "查询银行信息详情 @author 善逸") + @GetMapping("/oa/bank/get/{bankId}") + public ResponseDTO getDetail(@PathVariable Long bankId) { + return bankService.getDetail(bankId); + } + + @ApiOperation(value = "新建银行信息 @author 善逸") + @PostMapping("/oa/bank/create") + public ResponseDTO createBank(@RequestBody @Valid BankCreateForm createVO) { + RequestUser requestUser = SmartRequestUtil.getRequestUser(); + createVO.setCreateUserId(requestUser.getUserId()); + createVO.setCreateUserName(requestUser.getUserName()); + return bankService.createBank(createVO); + } + + @ApiOperation(value = "编辑银行信息 @author 善逸") + @PostMapping("/oa/bank/update") + public ResponseDTO updateBank(@RequestBody @Valid BankUpdateForm updateVO) { + return bankService.updateBank(updateVO); + } + + @ApiOperation(value = "删除银行信息 @author 善逸") + @GetMapping("/oa/bank/delete/{bankId}") + public ResponseDTO deleteBank(@PathVariable Long bankId) { + return bankService.deleteBank(bankId); + } +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/bank/BankDao.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/bank/BankDao.java new file mode 100644 index 00000000..a45d406a --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/bank/BankDao.java @@ -0,0 +1,61 @@ +package net.lab1024.sa.admin.module.business.oa.bank; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import net.lab1024.sa.admin.module.business.oa.bank.domain.BankEntity; +import net.lab1024.sa.admin.module.business.oa.bank.domain.BankQueryForm; +import net.lab1024.sa.admin.module.business.oa.bank.domain.BankVO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * OA办公-OA银行信息 + * + * @Author 1024创新实验室:善逸 + * @Date 2022/6/23 21:59:22 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Mapper +@Component +public interface BankDao extends BaseMapper { + + /** + * 根据账号查询 + * @param enterpriseId + * @param accountNumber + * @param excludeBankId + * @param deletedFlag + * @return + */ + BankEntity queryByAccountNumber(@Param("enterpriseId") Long enterpriseId, @Param("accountNumber") String accountNumber, @Param("excludeBankId") Long excludeBankId, @Param("deletedFlag") Boolean deletedFlag); + + /** + * 删除银行信息 + * + * @param bankId + * @param deletedFlag + */ + void deleteBank(@Param("bankId") Long bankId, @Param("deletedFlag") Boolean deletedFlag); + + /** + * 银行信息分页查询 + * + * @param page + * @param queryForm + * @return + */ + List queryPage(Page page, @Param("queryForm") BankQueryForm queryForm); + + /** + * 查询银行信息详情 + * @param bankId + * @param deletedFlag + * @return + */ + BankVO getDetail(@Param("bankId") Long bankId, @Param("deletedFlag") Boolean deletedFlag); +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/bank/BankService.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/bank/BankService.java new file mode 100644 index 00000000..48c120bc --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/bank/BankService.java @@ -0,0 +1,162 @@ +package net.lab1024.sa.admin.module.business.oa.bank; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.extern.slf4j.Slf4j; +import net.lab1024.sa.admin.module.business.oa.bank.domain.*; +import net.lab1024.sa.admin.module.business.oa.enterprise.dao.EnterpriseDao; +import net.lab1024.sa.admin.module.business.oa.enterprise.domain.entity.EnterpriseEntity; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.util.SmartBeanUtil; +import net.lab1024.sa.common.common.util.SmartPageUtil; +import net.lab1024.sa.common.module.support.datatracer.constant.DataTracerConst; +import net.lab1024.sa.common.module.support.datatracer.constant.DataTracerTypeEnum; +import net.lab1024.sa.common.module.support.datatracer.service.DataTracerService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +import java.util.Objects; + +/** + * OA办公-OA银行信息 + * + * @Author 1024创新实验室:善逸 + * @Date 2022/6/23 21:59:22 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Service +@Slf4j +public class BankService { + + @Autowired + private BankDao bankDao; + @Autowired + private EnterpriseDao enterpriseDao; + + @Autowired + private DataTracerService dataTracerService; + + /** + * 分页查询银行信息 + * + * @param queryDTO + * @return + */ + public ResponseDTO> queryByPage(BankQueryForm queryDTO) { + queryDTO.setDeletedFlag(Boolean.FALSE); + Page page = SmartPageUtil.convert2PageQuery(queryDTO); + List bankVOS = bankDao.queryPage(page, queryDTO); + PageResult pageResult = SmartPageUtil.convert2PageResult(page, bankVOS); + return ResponseDTO.ok(pageResult); + } + + /** + * 根据企业ID查询不分页的银行列表 + * + * @param enterpriseId + * @return + */ + public ResponseDTO> queryList(Long enterpriseId) { + BankQueryForm queryDTO = new BankQueryForm(); + queryDTO.setEnterpriseId(enterpriseId); + queryDTO.setDeletedFlag(Boolean.FALSE); + List bankVOS = bankDao.queryPage(null, queryDTO); + return ResponseDTO.ok(bankVOS); + } + + /** + * 查询银行信息详情 + * + * @param bankId + * @return + */ + public ResponseDTO getDetail(Long bankId) { + // 校验银行信息是否存在 + BankVO bankVO = bankDao.getDetail(bankId, Boolean.FALSE); + if (Objects.isNull(bankVO)) { + return ResponseDTO.userErrorParam("银行信息不存在"); + } + return ResponseDTO.ok(bankVO); + } + + /** + * 新建银行信息 + * + * @param createVO + * @return + */ + @Transactional(rollbackFor = Exception.class) + public ResponseDTO createBank(BankCreateForm createVO) { + Long enterpriseId = createVO.getEnterpriseId(); + // 校验企业是否存在 + EnterpriseEntity enterpriseDetail = enterpriseDao.selectById(enterpriseId); + if (Objects.isNull(enterpriseDetail) || enterpriseDetail.getDeletedFlag()) { + return ResponseDTO.userErrorParam("企业不存在"); + } + // 验证银行信息账号是否重复 + BankEntity validateBank = bankDao.queryByAccountNumber(enterpriseId, createVO.getAccountNumber(), null, Boolean.FALSE); + if (Objects.nonNull(validateBank)) { + return ResponseDTO.userErrorParam("银行信息账号重复"); + } + // 数据插入 + BankEntity insertBank = SmartBeanUtil.copy(createVO, BankEntity.class); + bankDao.insert(insertBank); + dataTracerService.addTrace(enterpriseId, DataTracerTypeEnum.OA_ENTERPRISE, "新增银行:" + DataTracerConst.HTML_BR + dataTracerService.getChangeContent(insertBank)); + return ResponseDTO.ok(); + } + + /** + * 编辑银行信息 + * + * @param updateVO + * @return + */ + @Transactional(rollbackFor = Exception.class) + public ResponseDTO updateBank(BankUpdateForm updateVO) { + Long enterpriseId = updateVO.getEnterpriseId(); + // 校验企业是否存在 + EnterpriseEntity enterpriseDetail = enterpriseDao.selectById(enterpriseId); + if (Objects.isNull(enterpriseDetail) || enterpriseDetail.getDeletedFlag()) { + return ResponseDTO.userErrorParam("企业不存在"); + } + Long bankId = updateVO.getBankId(); + // 校验银行信息是否存在 + BankEntity bankDetail = bankDao.selectById(bankId); + if (Objects.isNull(bankDetail) || bankDetail.getDeletedFlag()) { + return ResponseDTO.userErrorParam("银行信息不存在"); + } + // 验证银行信息账号是否重复 + BankEntity validateBank = bankDao.queryByAccountNumber(updateVO.getEnterpriseId(), updateVO.getAccountNumber(), bankId, Boolean.FALSE); + if (Objects.nonNull(validateBank)) { + return ResponseDTO.userErrorParam("银行信息账号重复"); + } + // 数据编辑 + BankEntity updateBank = SmartBeanUtil.copy(updateVO, BankEntity.class); + bankDao.updateById(updateBank); + dataTracerService.addTrace(enterpriseId, DataTracerTypeEnum.OA_ENTERPRISE, "更新银行:" + DataTracerConst.HTML_BR + dataTracerService.getChangeContent(bankDetail, updateBank)); + return ResponseDTO.ok(); + } + + + /** + * 删除银行信息 + * + * @param bankId + * @return + */ + @Transactional(rollbackFor = Exception.class) + public ResponseDTO deleteBank(Long bankId) { + // 校验银行信息是否存在 + BankEntity bankDetail = bankDao.selectById(bankId); + if (Objects.isNull(bankDetail) || bankDetail.getDeletedFlag()) { + return ResponseDTO.userErrorParam("银行信息不存在"); + } + bankDao.deleteBank(bankId, Boolean.TRUE); + dataTracerService.addTrace(bankDetail.getEnterpriseId(), DataTracerTypeEnum.OA_ENTERPRISE, "删除银行:" + DataTracerConst.HTML_BR + dataTracerService.getChangeContent(bankDetail)); + return ResponseDTO.ok(); + } +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/bank/domain/BankCreateForm.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/bank/domain/BankCreateForm.java new file mode 100644 index 00000000..031ceb75 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/bank/domain/BankCreateForm.java @@ -0,0 +1,58 @@ +package net.lab1024.sa.admin.module.business.oa.bank.domain; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +/** + * OA办公-银行信息新建 + * + * @Author 1024创新实验室:善逸 + * @Date 2022/6/23 21:59:22 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +public class BankCreateForm { + + @ApiModelProperty("开户银行") + @NotBlank(message = "开户银行不能为空") + @Length(max = 200, message = "开户银行最多200字符") + private String bankName; + + @ApiModelProperty("账户名称") + @NotBlank(message = "账户名称不能为空") + @Length(max = 200, message = "账户名称最多200字符") + private String accountName; + + @ApiModelProperty("账号") + @NotBlank(message = "账号不能为空") + @Length(max = 200, message = "账号最多200字符") + private String accountNumber; + + @ApiModelProperty("备注") + @Length(max = 500, message = "备注最多500字符") + private String remark; + + @ApiModelProperty("是否对公") + @NotNull(message = "是否对公不能为空") + private Boolean businessFlag; + + @ApiModelProperty("企业") + @NotNull(message = "企业不能为空") + private Long enterpriseId; + + @ApiModelProperty("禁用状态") + @NotNull(message = "禁用状态不能为空") + private Boolean disabledFlag; + + @ApiModelProperty(value = "创建人", hidden = true) + private Long createUserId; + + @ApiModelProperty(value = "创建人", hidden = true) + private String createUserName; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/bank/domain/BankEntity.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/bank/domain/BankEntity.java new file mode 100644 index 00000000..0b3ec08d --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/bank/domain/BankEntity.java @@ -0,0 +1,95 @@ +package net.lab1024.sa.admin.module.business.oa.bank.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import net.lab1024.sa.common.module.support.datatracer.annoation.DataTracerFieldLabel; + +import java.time.LocalDateTime; + +/** + * OA办公-OA银行信息 + * + * @Author 1024创新实验室:善逸 + * @Date 2022/6/23 21:59:22 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +@TableName("t_oa_bank") +public class BankEntity { + + /** + * 银行信息ID + */ + @TableId(type = IdType.AUTO) + @DataTracerFieldLabel("银行信息ID") + private Long bankId; + + /** + * 开户银行 + */ + @DataTracerFieldLabel("开户银行") + private String bankName; + + /** + * 账户名称 + */ + @DataTracerFieldLabel("账户名称") + private String accountName; + + /** + * 账号 + */ + @DataTracerFieldLabel("账号") + private String accountNumber; + + /** + * 备注 + */ + @DataTracerFieldLabel("备注") + private String remark; + + /** + * 是否对公 + */ + @DataTracerFieldLabel("是否对公") + private Boolean businessFlag; + + /** + * 企业ID + */ + private Long enterpriseId; + + /** + * 禁用状态 + */ + @DataTracerFieldLabel("禁用状态") + private Boolean disabledFlag; + + /** + * 删除状态 + */ + private Boolean deletedFlag; + + /** + * 创建人ID + */ + private Long createUserId; + + /** + * 创建人ID + */ + private String createUserName; + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/bank/domain/BankQueryForm.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/bank/domain/BankQueryForm.java new file mode 100644 index 00000000..839b02f6 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/bank/domain/BankQueryForm.java @@ -0,0 +1,40 @@ +package net.lab1024.sa.admin.module.business.oa.bank.domain; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.domain.PageParam; +import org.hibernate.validator.constraints.Length; + +import java.time.LocalDate; + +/** + * OA办公-OA银行信息查询 + * + * @Author 1024创新实验室:善逸 + * @Date 2022/6/23 21:59:22 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +public class BankQueryForm extends PageParam { + + @ApiModelProperty("企业ID") + private Long enterpriseId; + + @ApiModelProperty("关键字") + @Length(max = 200, message = "关键字最多200字符") + private String keywords; + + @ApiModelProperty("开始时间") + private LocalDate startTime; + + @ApiModelProperty("结束时间") + private LocalDate endTime; + + @ApiModelProperty("禁用状态") + private Boolean disabledFlag; + + @ApiModelProperty(value = "删除状态", hidden = true) + private Boolean deletedFlag; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/bank/domain/BankUpdateForm.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/bank/domain/BankUpdateForm.java new file mode 100644 index 00000000..db8a2c71 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/bank/domain/BankUpdateForm.java @@ -0,0 +1,23 @@ +package net.lab1024.sa.admin.module.business.oa.bank.domain; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * OA办公-银行信息更新 + * + * @Author 1024创新实验室:善逸 + * @Date 2022/6/23 21:59:22 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +public class BankUpdateForm extends BankCreateForm { + + @ApiModelProperty("银行信息ID") + @NotNull(message = "银行信息ID不能为空") + private Long bankId; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/bank/domain/BankVO.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/bank/domain/BankVO.java new file mode 100644 index 00000000..5cfcb5b6 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/bank/domain/BankVO.java @@ -0,0 +1,58 @@ +package net.lab1024.sa.admin.module.business.oa.bank.domain; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * OA办公-OA银行信息 + * + * @Author 1024创新实验室:善逸 + * @Date 2022/6/23 21:59:22 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +public class BankVO { + + @ApiModelProperty("银行信息ID") + private Long bankId; + + @ApiModelProperty("开户银行") + private String bankName; + + @ApiModelProperty("账户名称") + private String accountName; + + @ApiModelProperty("账号") + private String accountNumber; + + @ApiModelProperty("备注") + private String remark; + + @ApiModelProperty("是否对公") + private Boolean businessFlag; + + @ApiModelProperty("企业ID") + private Long enterpriseId; + + @ApiModelProperty("企业名称") + private String enterpriseName; + + @ApiModelProperty("禁用状态") + private Boolean disabledFlag; + + @ApiModelProperty("创建人ID") + private Long createUserId; + + @ApiModelProperty("创建人名称") + private String createUserName; + + @ApiModelProperty("创建时间") + private LocalDateTime createTime; + + @ApiModelProperty("更新时间") + private LocalDateTime updateTime; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/EnterpriseController.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/EnterpriseController.java new file mode 100644 index 00000000..efc0143b --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/EnterpriseController.java @@ -0,0 +1,115 @@ +package net.lab1024.sa.admin.module.business.oa.enterprise; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import net.lab1024.sa.admin.constant.AdminSwaggerTagConst; +import net.lab1024.sa.admin.module.business.oa.enterprise.domain.form.*; +import net.lab1024.sa.admin.module.business.oa.enterprise.domain.vo.EnterpriseEmployeeVO; +import net.lab1024.sa.admin.module.business.oa.enterprise.domain.vo.EnterpriseListVO; +import net.lab1024.sa.admin.module.business.oa.enterprise.domain.vo.EnterpriseVO; +import net.lab1024.sa.common.common.annoation.SaAuth; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.RequestUser; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.util.SmartRequestUtil; +import net.lab1024.sa.common.module.support.operatelog.annoation.OperateLog; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + +/** + * 企业 + * + * @Author 1024创新实验室: 开云 + * @Date 2022/7/28 20:37:15 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Slf4j +@RestController +@OperateLog +@Api(tags = {AdminSwaggerTagConst.Business.OA_ENTERPRISE}) +public class EnterpriseController { + + @Autowired + private EnterpriseService enterpriseService; + + @ApiOperation(value = "分页查询企业模块 @author 开云") + @PostMapping("/oa/enterprise/page/query") + @SaAuth + public ResponseDTO> queryByPage(@RequestBody @Valid EnterpriseQueryForm queryDTO) { + return enterpriseService.queryByPage(queryDTO); + } + + @ApiOperation(value = "查询企业详情 @author 开云") + @GetMapping("/oa/enterprise/get/{enterpriseId}") + @SaAuth + public ResponseDTO getDetail(@PathVariable Long enterpriseId) { + return ResponseDTO.ok(enterpriseService.getDetail(enterpriseId)); + } + + @ApiOperation(value = "新建企业 @author 开云") + @PostMapping("/oa/enterprise/create") + @SaAuth + public ResponseDTO createEnterprise(@RequestBody @Valid EnterpriseCreateForm createVO) { + RequestUser requestUser = SmartRequestUtil.getRequestUser(); + createVO.setCreateUserId(requestUser.getUserId()); + createVO.setCreateUserName(requestUser.getUserName()); + return enterpriseService.createEnterprise(createVO); + } + + @ApiOperation(value = "编辑企业 @author 开云") + @PostMapping("/oa/enterprise/update") + @SaAuth + public ResponseDTO updateEnterprise(@RequestBody @Valid EnterpriseUpdateForm updateVO) { + return enterpriseService.updateEnterprise(updateVO); + } + + @ApiOperation(value = "删除企业 @author 开云") + @GetMapping("/oa/enterprise/delete/{enterpriseId}") + @SaAuth + public ResponseDTO deleteEnterprise(@PathVariable Long enterpriseId) { + return enterpriseService.deleteEnterprise(enterpriseId); + } + + @ApiOperation(value = "企业列表查询 @author 开云") + @GetMapping("/oa/enterprise/query/list") + @SaAuth + public ResponseDTO> queryList(@RequestParam(value = "type", required = false) Integer type) { + return enterpriseService.queryList(type); + } + + + @ApiOperation(value = "企业添加员工 @author 罗伊") + @PostMapping("/oa/enterprise/employee/add") + @SaAuth + public ResponseDTO addEmployee(@RequestBody @Valid EnterpriseEmployeeForm enterpriseEmployeeForm) { + return enterpriseService.addEmployee(enterpriseEmployeeForm); + } + + @ApiOperation(value = "查询企业全部员工 @author 罗伊") + @PostMapping("/oa/enterprise/employee/list") + @SaAuth + public ResponseDTO> employeeList(@RequestBody @Valid List enterpriseIdList) { + return ResponseDTO.ok(enterpriseService.employeeList(enterpriseIdList)); + } + + @ApiOperation(value = "分页查询企业员工 @author 卓大") + @PostMapping("/oa/enterprise/employee/queryPage") + @SaAuth + public ResponseDTO> queryPageEmployeeList(@RequestBody @Valid EnterpriseEmployeeQueryForm queryForm) { + return ResponseDTO.ok(enterpriseService.queryPageEmployeeList(queryForm)); + } + + + @ApiOperation(value = "企业删除员工 @author 罗伊") + @PostMapping("/oa/enterprise/employee/delete") + @SaAuth + public ResponseDTO deleteEmployee(@RequestBody @Valid EnterpriseEmployeeForm enterpriseEmployeeForm) { + return enterpriseService.deleteEmployee(enterpriseEmployeeForm); + } +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/EnterpriseEmployeeManager.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/EnterpriseEmployeeManager.java new file mode 100644 index 00000000..1ac3fd5e --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/EnterpriseEmployeeManager.java @@ -0,0 +1,19 @@ +package net.lab1024.sa.admin.module.business.oa.enterprise; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import net.lab1024.sa.admin.module.business.oa.enterprise.dao.EnterpriseEmployeeDao; +import net.lab1024.sa.admin.module.business.oa.enterprise.domain.entity.EnterpriseEmployeeEntity; +import org.springframework.stereotype.Service; + +/** + * 企业员工关系 manager + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022/7/28 20:37:15 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Service +public class EnterpriseEmployeeManager extends ServiceImpl { +} \ No newline at end of file diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/EnterpriseService.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/EnterpriseService.java new file mode 100644 index 00000000..b065d3b8 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/EnterpriseService.java @@ -0,0 +1,252 @@ +package net.lab1024.sa.admin.module.business.oa.enterprise; + +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.google.common.collect.Lists; +import lombok.extern.slf4j.Slf4j; +import net.lab1024.sa.admin.module.business.oa.enterprise.dao.EnterpriseDao; +import net.lab1024.sa.admin.module.business.oa.enterprise.dao.EnterpriseEmployeeDao; +import net.lab1024.sa.admin.module.business.oa.enterprise.domain.entity.EnterpriseEmployeeEntity; +import net.lab1024.sa.admin.module.business.oa.enterprise.domain.entity.EnterpriseEntity; +import net.lab1024.sa.admin.module.business.oa.enterprise.domain.form.*; +import net.lab1024.sa.admin.module.business.oa.enterprise.domain.vo.EnterpriseEmployeeVO; +import net.lab1024.sa.admin.module.business.oa.enterprise.domain.vo.EnterpriseListVO; +import net.lab1024.sa.admin.module.business.oa.enterprise.domain.vo.EnterpriseVO; +import net.lab1024.sa.admin.module.system.department.service.DepartmentService; +import net.lab1024.sa.common.common.code.UserErrorCode; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.util.SmartBeanUtil; +import net.lab1024.sa.common.common.util.SmartPageUtil; +import net.lab1024.sa.common.module.support.datatracer.constant.DataTracerTypeEnum; +import net.lab1024.sa.common.module.support.datatracer.domain.form.DataTracerForm; +import net.lab1024.sa.common.module.support.datatracer.service.DataTracerService; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * 企业 + * + * @Author 1024创新实验室: 开云 + * @Date 2022/7/28 20:37:15 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Service +@Slf4j +public class EnterpriseService { + + @Autowired + private EnterpriseDao enterpriseDao; + + @Autowired + private EnterpriseEmployeeDao enterpriseEmployeeDao; + + @Autowired + private EnterpriseEmployeeManager enterpriseEmployeeManager; + + @Autowired + private DataTracerService dataTracerService; + + @Autowired + private DepartmentService departmentService; + + /** + * 分页查询企业模块 + * + * @param queryDTO + * @return + */ + public ResponseDTO> queryByPage(EnterpriseQueryForm queryDTO) { + queryDTO.setDeletedFlag(Boolean.FALSE); + Page page = SmartPageUtil.convert2PageQuery(queryDTO); + List enterpriseVOS = enterpriseDao.queryPage(page, queryDTO); + PageResult pageResult = SmartPageUtil.convert2PageResult(page, enterpriseVOS); + return ResponseDTO.ok(pageResult); + } + + /** + * 查询企业详情 + * + * @param enterpriseId + * @return + */ + public EnterpriseVO getDetail(Long enterpriseId) { + EnterpriseVO enterpriseDetail = enterpriseDao.getDetail(enterpriseId, Boolean.FALSE); + return enterpriseDetail; + } + + /** + * 新建企业 + * + * @param createVO + * @return + */ + @Transactional(rollbackFor = Exception.class) + public ResponseDTO createEnterprise(EnterpriseCreateForm createVO) { + // 验证企业名称是否重复 + EnterpriseEntity validateEnterprise = enterpriseDao.queryByEnterpriseName(createVO.getEnterpriseName(), null, Boolean.FALSE); + if (Objects.nonNull(validateEnterprise)) { + return ResponseDTO.userErrorParam("企业名称重复"); + } + // 数据插入 + EnterpriseEntity insertEnterprise = SmartBeanUtil.copy(createVO, EnterpriseEntity.class); + enterpriseDao.insert(insertEnterprise); + dataTracerService.insert(insertEnterprise.getEnterpriseId(), DataTracerTypeEnum.OA_ENTERPRISE); + return ResponseDTO.ok(); + } + + /** + * 编辑企业 + * + * @param updateVO + * @return + */ + @Transactional(rollbackFor = Exception.class) + public ResponseDTO updateEnterprise(EnterpriseUpdateForm updateVO) { + Long enterpriseId = updateVO.getEnterpriseId(); + // 校验企业是否存在 + EnterpriseEntity enterpriseDetail = enterpriseDao.selectById(enterpriseId); + if (Objects.isNull(enterpriseDetail) || enterpriseDetail.getDeletedFlag()) { + return ResponseDTO.userErrorParam("企业不存在"); + } + // 验证企业名称是否重复 + EnterpriseEntity validateEnterprise = enterpriseDao.queryByEnterpriseName(updateVO.getEnterpriseName(), enterpriseId, Boolean.FALSE); + if (Objects.nonNull(validateEnterprise)) { + return ResponseDTO.userErrorParam("企业名称重复"); + } + // 数据编辑 + EnterpriseEntity updateEntity = SmartBeanUtil.copy(enterpriseDetail, EnterpriseEntity.class); + SmartBeanUtil.copyProperties(updateVO, updateEntity); + enterpriseDao.updateById(updateEntity); + + //变更记录 + DataTracerForm dataTracerForm = DataTracerForm.builder() + .dataId(updateVO.getEnterpriseId()) + .type(DataTracerTypeEnum.OA_ENTERPRISE) + .content("修改企业信息") + .diffOld(dataTracerService.getChangeContent(enterpriseDetail)) + .diffNew(dataTracerService.getChangeContent(updateEntity)) + .build(); + + dataTracerService.addTrace(dataTracerForm); + return ResponseDTO.ok(); + } + + + /** + * 删除企业 + * + * @param enterpriseId + * @return + */ + @Transactional(rollbackFor = Exception.class) + public ResponseDTO deleteEnterprise(Long enterpriseId) { + // 校验企业是否存在 + EnterpriseEntity enterpriseDetail = enterpriseDao.selectById(enterpriseId); + if (Objects.isNull(enterpriseDetail) || enterpriseDetail.getDeletedFlag()) { + return ResponseDTO.userErrorParam("企业不存在"); + } + enterpriseDao.deleteEnterprise(enterpriseId, Boolean.TRUE); + dataTracerService.delete(enterpriseId, DataTracerTypeEnum.OA_ENTERPRISE); + return ResponseDTO.ok(); + } + + /** + * 企业列表查询 + * + * @return + */ + public ResponseDTO> queryList(Integer type) { + List enterpriseListVOS = enterpriseDao.queryList(type, Boolean.FALSE, Boolean.FALSE); + return ResponseDTO.ok(enterpriseListVOS); + } + + //----------------------------------------- 以下为员工相关-------------------------------------------- + + /** + * 企业添加员工 + * + * @param enterpriseEmployeeForm + * @return + */ + public synchronized ResponseDTO addEmployee(EnterpriseEmployeeForm enterpriseEmployeeForm) { + Long enterpriseId = enterpriseEmployeeForm.getEnterpriseId(); + EnterpriseEntity enterpriseEntity = enterpriseDao.selectById(enterpriseId); + if (enterpriseEntity == null || enterpriseEntity.getDeletedFlag()) { + return ResponseDTO.error(UserErrorCode.DATA_NOT_EXIST); + } + //过滤掉已存在的员工 + List waitAddEmployeeIdList = enterpriseEmployeeForm.getEmployeeIdList(); + List enterpriseEmployeeEntityList = enterpriseEmployeeDao.selectByEnterpriseAndEmployeeIdList(enterpriseId, waitAddEmployeeIdList); + if (CollectionUtils.isNotEmpty(enterpriseEmployeeEntityList)) { + List existEmployeeIdList = enterpriseEmployeeEntityList.stream().map(EnterpriseEmployeeEntity::getEmployeeId).collect(Collectors.toList()); + waitAddEmployeeIdList = waitAddEmployeeIdList.stream().filter(e -> !existEmployeeIdList.contains(e)).collect(Collectors.toList()); + } + if (CollectionUtils.isEmpty(waitAddEmployeeIdList)) { + return ResponseDTO.ok(); + } + List batchAddList = Lists.newArrayList(); + for (Long employeeId : waitAddEmployeeIdList) { + EnterpriseEmployeeEntity enterpriseEmployeeEntity = new EnterpriseEmployeeEntity(); + enterpriseEmployeeEntity.setEnterpriseId(enterpriseId); + enterpriseEmployeeEntity.setEmployeeId(employeeId); + batchAddList.add(enterpriseEmployeeEntity); + } + enterpriseEmployeeManager.saveBatch(batchAddList); + return ResponseDTO.ok(); + } + + /** + * 企业删除员工 + * + * @param enterpriseEmployeeForm + * @return + */ + public synchronized ResponseDTO deleteEmployee(EnterpriseEmployeeForm enterpriseEmployeeForm) { + Long enterpriseId = enterpriseEmployeeForm.getEnterpriseId(); + EnterpriseEntity enterpriseEntity = enterpriseDao.selectById(enterpriseId); + if (enterpriseEntity == null || enterpriseEntity.getDeletedFlag()) { + return ResponseDTO.error(UserErrorCode.DATA_NOT_EXIST); + } + List waitDeleteEmployeeIdList = enterpriseEmployeeForm.getEmployeeIdList(); + enterpriseEmployeeDao.deleteByEnterpriseAndEmployeeIdList(enterpriseId, waitDeleteEmployeeIdList); + return ResponseDTO.ok(); + } + + /** + * 企业下员工列表 + * + * @param enterpriseIdList + * @return + */ + public List employeeList(List enterpriseIdList) { + if (CollectionUtils.isEmpty(enterpriseIdList)) { + return Lists.newArrayList(); + } + List enterpriseEmployeeVOList = enterpriseEmployeeDao.selectByEnterpriseIdList(enterpriseIdList); + return enterpriseEmployeeVOList; + } + + /** + * 分页查询企业员工 + * + * @param queryForm + * @return + */ + public PageResult queryPageEmployeeList(EnterpriseEmployeeQueryForm queryForm) { + Page page = SmartPageUtil.convert2PageQuery(queryForm); + List enterpriseEmployeeVOList = enterpriseEmployeeDao.queryPageEmployeeList(page, queryForm); + for (EnterpriseEmployeeVO enterpriseEmployeeVO : enterpriseEmployeeVOList) { + enterpriseEmployeeVO.setDepartmentName(departmentService.getDepartmentPath(enterpriseEmployeeVO.getDepartmentId())); + } + return SmartPageUtil.convert2PageResult(page, enterpriseEmployeeVOList); + } +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/constant/EnterpriseTypeEnum.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/constant/EnterpriseTypeEnum.java new file mode 100644 index 00000000..ddbf5f79 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/constant/EnterpriseTypeEnum.java @@ -0,0 +1,40 @@ +package net.lab1024.sa.admin.module.business.oa.enterprise.constant; + + +import net.lab1024.sa.common.common.enumeration.BaseEnum; + +/** + * 企业类型 + * + * @Author 1024创新实验室: 开云 + * @Date 2022/7/28 20:37:15 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +public enum EnterpriseTypeEnum implements BaseEnum { + + NORMAL(1, "有限企业"), + + FOREIGN(2, "外资企业"), + ; + + private Integer value; + private String desc; + + EnterpriseTypeEnum(Integer value, String desc) { + this.value = value; + this.desc = desc; + } + + + @Override + public Integer getValue() { + return value; + } + + @Override + public String getDesc() { + return desc; + } +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/dao/EnterpriseDao.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/dao/EnterpriseDao.java new file mode 100644 index 00000000..5b58609a --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/dao/EnterpriseDao.java @@ -0,0 +1,72 @@ +package net.lab1024.sa.admin.module.business.oa.enterprise.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import net.lab1024.sa.admin.module.business.oa.enterprise.domain.entity.EnterpriseEntity; +import net.lab1024.sa.admin.module.business.oa.enterprise.domain.form.EnterpriseQueryForm; +import net.lab1024.sa.admin.module.business.oa.enterprise.domain.vo.EnterpriseListVO; +import net.lab1024.sa.admin.module.business.oa.enterprise.domain.vo.EnterpriseVO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * 企业 + * + * @Author 1024创新实验室: 开云 + * @Date 2022/7/28 20:37:15 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Mapper +@Component +public interface EnterpriseDao extends BaseMapper { + + /** + * 根据企业名称查询 + * + * @param enterpriseName + * @param excludeEnterpriseId + * @param deletedFlag + * @return + */ + EnterpriseEntity queryByEnterpriseName(@Param("enterpriseName") String enterpriseName, @Param("excludeEnterpriseId") Long excludeEnterpriseId, @Param("deletedFlag") Boolean deletedFlag); + + /** + * 删除企业 + * + * @param enterpriseId + * @param deletedFlag + */ + void deleteEnterprise(@Param("enterpriseId") Long enterpriseId, @Param("deletedFlag") Boolean deletedFlag); + + /** + * 企业分页查询 + * + * @param page + * @param queryForm + * @return + */ + List queryPage(Page page, @Param("queryForm") EnterpriseQueryForm queryForm); + + /** + * 查询企业详情 + * + * @param enterpriseId + * @return + */ + EnterpriseVO getDetail(@Param("enterpriseId") Long enterpriseId, @Param("deletedFlag") Boolean deletedFlag); + + /** + * 查询列表 + * + * @param type + * @param disabledFlag + * @param deletedFlag + * @return + */ + List queryList(@Param("type") Integer type, @Param("disabledFlag") Boolean disabledFlag, @Param("deletedFlag") Boolean deletedFlag); +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/dao/EnterpriseEmployeeDao.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/dao/EnterpriseEmployeeDao.java new file mode 100644 index 00000000..93808710 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/dao/EnterpriseEmployeeDao.java @@ -0,0 +1,88 @@ +package net.lab1024.sa.admin.module.business.oa.enterprise.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import net.lab1024.sa.admin.module.business.oa.enterprise.domain.entity.EnterpriseEmployeeEntity; +import net.lab1024.sa.admin.module.business.oa.enterprise.domain.form.EnterpriseEmployeeQueryForm; +import net.lab1024.sa.admin.module.business.oa.enterprise.domain.vo.EnterpriseEmployeeVO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Component; + +import java.util.Collection; +import java.util.List; + +/** + * 企业员工 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022/7/28 20:37:15 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Mapper +@Component +public interface EnterpriseEmployeeDao extends BaseMapper { + + + /** + * 根据员工查询 + * @param employeeIdList + * @return + */ + List selectByEmployeeIdList(@Param("employeeIdList")Collection employeeIdList); + + /** + * 查询员工关联的企业 + * @param employeeId + * @return + */ + List selectEnterpriseIdByEmployeeId(@Param("employeeId")Long employeeId); + /** + * 根据企业查询 + * @param enterpriseIdList + * @return + */ + List selectByEnterpriseIdList(@Param("enterpriseIdList")Collection enterpriseIdList); + /** + * 根据企业查询 + * @param enterpriseId + * @return + */ + List selectByEnterpriseId(@Param("enterpriseId")Long enterpriseId); + + /** + * 查询企业下的所有员工id + * @param enterpriseIdList + * @return + */ + List selectEmployeeIdByEnterpriseIdList(@Param("enterpriseIdList")Collection enterpriseIdList); + /** + * 根据员工删除 + * @param enterpriseId + * @param employeeIdList + */ + void deleteByEnterpriseAndEmployeeIdList(@Param("enterpriseId")Long enterpriseId, @Param("employeeIdList")Collection employeeIdList); + + /** + * 根据员工查询 + * @param enterpriseId + * @param employeeIdList + */ + List selectByEnterpriseAndEmployeeIdList(@Param("enterpriseId")Long enterpriseId, @Param("employeeIdList")Collection employeeIdList); + + /** + * 删除某员工关联的所有企业 + * @param employeeId + */ + void deleteByEmployeeId(@Param("employeeId")Long employeeId); + + /** + * 分页查询企业员工 + * @param page + * @param queryForm + * @return + */ + List queryPageEmployeeList(Page page,@Param("queryForm") EnterpriseEmployeeQueryForm queryForm); +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/domain/entity/EnterpriseEmployeeEntity.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/domain/entity/EnterpriseEmployeeEntity.java new file mode 100644 index 00000000..a4c9b8ea --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/domain/entity/EnterpriseEmployeeEntity.java @@ -0,0 +1,51 @@ +package net.lab1024.sa.admin.module.business.oa.enterprise.domain.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.LocalDateTime; + +/** + * 企业员工 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022/7/28 20:37:15 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +@TableName("t_oa_enterprise_employee") +@NoArgsConstructor +public class EnterpriseEmployeeEntity { + + @TableId(type = IdType.AUTO) + private Long enterpriseEmployeeId; + + /** + * 企业ID + */ + private Long enterpriseId; + /** + * 员工 + */ + private Long employeeId; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; + + public EnterpriseEmployeeEntity(Long enterpriseId, Long employeeId) { + this.enterpriseId = enterpriseId; + this.employeeId = employeeId; + } +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/domain/entity/EnterpriseEntity.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/domain/entity/EnterpriseEntity.java new file mode 100644 index 00000000..67b4c48e --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/domain/entity/EnterpriseEntity.java @@ -0,0 +1,153 @@ +package net.lab1024.sa.admin.module.business.oa.enterprise.domain.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import net.lab1024.sa.admin.module.business.oa.enterprise.constant.EnterpriseTypeEnum; +import net.lab1024.sa.common.module.support.datatracer.annoation.DataTracerFieldEnum; +import net.lab1024.sa.common.module.support.datatracer.annoation.DataTracerFieldLabel; + +import java.time.LocalDateTime; + +/** + * 企业 + * + * @Author 1024创新实验室: 开云 + * @Date 2022/7/28 20:37:15 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +@TableName("t_oa_enterprise") +public class EnterpriseEntity { + + /** + * 企业ID + */ + @TableId(type = IdType.AUTO) + private Long enterpriseId; + + /** + * 企业名称 + */ + @DataTracerFieldLabel("企业名称") + private String enterpriseName; + + /** + * 企业logo + */ + @DataTracerFieldLabel("企业logo") + private String enterpriseLogo; + + /** + * 统一社会信用代码 + */ + @DataTracerFieldLabel("统一社会信用代码") + private String unifiedSocialCreditCode; + + /** + * 类型 + * + * @see EnterpriseTypeEnum + */ + @DataTracerFieldLabel("类型") + @DataTracerFieldEnum(enumClass = EnterpriseTypeEnum.class) + private Integer type; + + /** + * 联系人 + */ + @DataTracerFieldLabel("联系人") + private String contact; + + /** + * 联系人电话 + */ + @DataTracerFieldLabel("联系人电话") + private String contactPhone; + + /** + * 邮箱 + */ + @DataTracerFieldLabel("邮箱") + private String email; + + /** + * 省份 + */ + private Integer province; + + /** + * 省份名称 + */ + @DataTracerFieldLabel("省份名称") + private String provinceName; + + /** + * 城市 + */ + private Integer city; + + /** + * 城市名称 + */ + @DataTracerFieldLabel("城市名称") + private String cityName; + + /** + * 区县 + */ + private Integer district; + + /** + * 区县名称 + */ + @DataTracerFieldLabel("区县名称") + private String districtName; + + /** + * 详细地址 + */ + @DataTracerFieldLabel("详细地址") + private String address; + + /** + * 营业执照 + */ + @DataTracerFieldLabel("营业执照") + private String businessLicense; + + /** + * 禁用状态 + */ + @DataTracerFieldLabel("禁用状态") + private Boolean disabledFlag; + + /** + * 删除状态 + */ + @DataTracerFieldLabel("删除状态") + private Boolean deletedFlag; + + /** + * 创建人ID + */ + private Long createUserId; + + /** + * 创建人ID + */ + private String createUserName; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/domain/form/EnterpriseCreateForm.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/domain/form/EnterpriseCreateForm.java new file mode 100644 index 00000000..4db85d21 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/domain/form/EnterpriseCreateForm.java @@ -0,0 +1,101 @@ +package net.lab1024.sa.admin.module.business.oa.enterprise.domain.form; + +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.admin.module.business.oa.enterprise.constant.EnterpriseTypeEnum; +import net.lab1024.sa.common.common.json.deserializer.FileKeyVoDeserializer; +import net.lab1024.sa.common.common.json.serializer.FileKeyVoSerializer; +import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum; +import net.lab1024.sa.common.common.util.SmartVerificationUtil; +import net.lab1024.sa.common.common.validator.enumeration.CheckEnum; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Pattern; + +/** + * OA企业模块创建 + * + * @Author 1024创新实验室: 开云 + * @Date 2022/7/28 20:37:15 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +public class EnterpriseCreateForm { + + @ApiModelProperty("企业名称") + @NotBlank(message = "企业名称不能为空") + @Length(max = 200, message = "企业名称最多200字符") + private String enterpriseName; + + @ApiModelProperty("企业logo") + @JsonSerialize(using = FileKeyVoSerializer.class) + @JsonDeserialize(using = FileKeyVoDeserializer.class) + private String enterpriseLogo; + + @ApiModelProperty("统一社会信用代码") + @NotBlank(message = "统一社会信用代码不能为空") + @Length(max = 200, message = "统一社会信用代码最多200字符") + private String unifiedSocialCreditCode; + + @ApiModelProperty("联系人") + @NotBlank(message = "联系人不能为空") + @Length(max = 100, message = "联系人最多100字符") + private String contact; + + @ApiModelProperty("联系人电话") + @NotBlank(message = "联系人电话不能为空") + @Pattern(regexp = SmartVerificationUtil.PHONE_REGEXP, message = "手机号格式不正确") + private String contactPhone; + + @ApiModelPropertyEnum(desc = "类型", value = EnterpriseTypeEnum.class) + @CheckEnum(message = "类型不正确", value = EnterpriseTypeEnum.class) + private Integer type; + + @ApiModelProperty("邮箱") + @Pattern(regexp = SmartVerificationUtil.EMAIL, message = "邮箱格式不正确") + private String email; + + @ApiModelProperty("省份") + private Integer province; + + @ApiModelProperty("省份名称") + private String provinceName; + + @ApiModelProperty("城市") + private Integer city; + + @ApiModelProperty("城市名称") + private String cityName; + + @ApiModelProperty("区县") + private Integer district; + + @ApiModelProperty("区县名称") + private String districtName; + + @ApiModelProperty("详细地址") + @Length(max = 500, message = "详细地址最多500字符") + private String address; + + @ApiModelProperty("营业执照") + @JsonSerialize(using = FileKeyVoSerializer.class) + @JsonDeserialize(using = FileKeyVoDeserializer.class) + private String businessLicense; + + @ApiModelProperty("禁用状态") + @NotNull(message = "禁用状态不能为空") + private Boolean disabledFlag; + + @ApiModelProperty(value = "创建人", hidden = true) + private Long createUserId; + + @ApiModelProperty(value = "创建人", hidden = true) + private String createUserName; + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/domain/form/EnterpriseEmployeeForm.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/domain/form/EnterpriseEmployeeForm.java new file mode 100644 index 00000000..84897956 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/domain/form/EnterpriseEmployeeForm.java @@ -0,0 +1,29 @@ +package net.lab1024.sa.admin.module.business.oa.enterprise.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.util.List; + +/** + * 企业员工 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022/7/28 20:37:15 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +public class EnterpriseEmployeeForm { + + @ApiModelProperty("企业id") + @NotNull(message = "企业id不能为空") + private Long enterpriseId; + + @ApiModelProperty("员工信息id") + @NotEmpty(message = "员工信息id不能为空") + private List employeeIdList; +} \ No newline at end of file diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/domain/form/EnterpriseEmployeeQueryForm.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/domain/form/EnterpriseEmployeeQueryForm.java new file mode 100644 index 00000000..33b6a738 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/domain/form/EnterpriseEmployeeQueryForm.java @@ -0,0 +1,35 @@ +package net.lab1024.sa.admin.module.business.oa.enterprise.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.domain.PageParam; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.util.List; + +/** + * 查询企业员工 + * + * @Author 1024创新实验室: 开云 + * @Date 2021-12-20 21:06:49 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class EnterpriseEmployeeQueryForm extends PageParam { + + @ApiModelProperty("搜索词") + @Length(max = 20, message = "搜索词最多20字符") + private String keyword; + + @ApiModelProperty("公司Id") + @NotNull(message = "公司id 不能为空") + private Long enterpriseId; + + @ApiModelProperty(value = "删除标识", hidden = true) + private Boolean deletedFlag; + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/domain/form/EnterpriseQueryForm.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/domain/form/EnterpriseQueryForm.java new file mode 100644 index 00000000..06fd5783 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/domain/form/EnterpriseQueryForm.java @@ -0,0 +1,38 @@ +package net.lab1024.sa.admin.module.business.oa.enterprise.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.domain.PageParam; +import org.hibernate.validator.constraints.Length; + +import java.time.LocalDate; + +/** + * OA企业模块分页查询 + * + * @Author 1024创新实验室: 开云 + * @Date 2022/7/28 20:37:15 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +public class EnterpriseQueryForm extends PageParam { + + @ApiModelProperty("关键字") + @Length(max = 200, message = "关键字最多200字符") + private String keywords; + + @ApiModelProperty("开始时间") + private LocalDate startTime; + + @ApiModelProperty("结束时间") + private LocalDate endTime; + + @ApiModelProperty("禁用状态") + private Boolean disabledFlag; + + @ApiModelProperty(value = "删除状态", hidden = true) + private Boolean deletedFlag; + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/domain/form/EnterpriseUpdateForm.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/domain/form/EnterpriseUpdateForm.java new file mode 100644 index 00000000..200e15e7 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/domain/form/EnterpriseUpdateForm.java @@ -0,0 +1,23 @@ +package net.lab1024.sa.admin.module.business.oa.enterprise.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * OA企业模块编辑 + * + * @Author 1024创新实验室: 开云 + * @Date 2022/7/28 20:37:15 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +public class EnterpriseUpdateForm extends EnterpriseCreateForm { + + @ApiModelProperty("企业ID") + @NotNull(message = "企业ID不能为空") + private Long enterpriseId; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/domain/vo/EnterpriseEmployeeVO.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/domain/vo/EnterpriseEmployeeVO.java new file mode 100644 index 00000000..0e37ee59 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/domain/vo/EnterpriseEmployeeVO.java @@ -0,0 +1,47 @@ +package net.lab1024.sa.admin.module.business.oa.enterprise.domain.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * 企业员工信息 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022/7/28 20:37:15 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +public class EnterpriseEmployeeVO { + + private Long enterpriseEmployeeId; + + @ApiModelProperty("企业ID") + private Long enterpriseId; + + @ApiModelProperty("企业名称") + private String enterpriseName; + + @ApiModelProperty("员工") + private Long employeeId; + + @ApiModelProperty("登录账号") + private String loginName; + + @ApiModelProperty("员工名称") + private String actualName; + + @ApiModelProperty("手机号码") + private String phone; + + @ApiModelProperty("部门id") + private Long departmentId; + + @ApiModelProperty("是否被禁用") + private Boolean disabledFlag; + + @ApiModelProperty("部门名称") + private String departmentName; + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/domain/vo/EnterpriseListVO.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/domain/vo/EnterpriseListVO.java new file mode 100644 index 00000000..806ff89d --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/domain/vo/EnterpriseListVO.java @@ -0,0 +1,20 @@ +package net.lab1024.sa.admin.module.business.oa.enterprise.domain.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * OA企业模块列表 + * + * @author lihaifan + * @date 2022/6/23 14:31 + */ +@Data +public class EnterpriseListVO { + + @ApiModelProperty("企业ID") + private Long enterpriseId; + + @ApiModelProperty("企业名称") + private String enterpriseName; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/domain/vo/EnterpriseVO.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/domain/vo/EnterpriseVO.java new file mode 100644 index 00000000..828424e5 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/domain/vo/EnterpriseVO.java @@ -0,0 +1,89 @@ +package net.lab1024.sa.admin.module.business.oa.enterprise.domain.vo; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.admin.module.business.oa.enterprise.constant.EnterpriseTypeEnum; +import net.lab1024.sa.common.common.json.serializer.FileKeyVoSerializer; +import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum; + +import java.time.LocalDateTime; + +/** + * 企业信息 + * + * @Author 1024创新实验室: 开云 + * @Date 2022/7/28 20:37:15 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +public class EnterpriseVO { + + @ApiModelProperty("企业ID") + private Long enterpriseId; + + @ApiModelProperty("企业名称") + private String enterpriseName; + + @ApiModelProperty("企业logo") + @JsonSerialize(using = FileKeyVoSerializer.class) + private String enterpriseLogo; + + @ApiModelProperty("统一社会信用代码") + private String unifiedSocialCreditCode; + + @ApiModelPropertyEnum(desc = "类型", value = EnterpriseTypeEnum.class) + private Integer type; + + @ApiModelProperty("联系人") + private String contact; + + @ApiModelProperty("联系人电话") + private String contactPhone; + + @ApiModelProperty("邮箱") + private String email; + + @ApiModelProperty("省份") + private Integer province; + + @ApiModelProperty("省份名称") + private String provinceName; + + @ApiModelProperty("城市") + private Integer city; + + @ApiModelProperty("城市名称") + private String cityName; + + @ApiModelProperty("区县") + private Integer district; + + @ApiModelProperty("区县名称") + private String districtName; + + @ApiModelProperty("详细地址") + private String address; + + @ApiModelProperty("营业执照") + @JsonSerialize(using = FileKeyVoSerializer.class) + private String businessLicense; + + @ApiModelProperty("禁用状态") + private Boolean disabledFlag; + + @ApiModelProperty("创建人ID") + private Long createUserId; + + @ApiModelProperty("创建人名称") + private String createUserName; + + @ApiModelProperty("创建时间") + private LocalDateTime createTime; + + @ApiModelProperty("更新时间") + private LocalDateTime updateTime; + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/invoice/InvoiceController.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/invoice/InvoiceController.java new file mode 100644 index 00000000..40909dc9 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/invoice/InvoiceController.java @@ -0,0 +1,80 @@ +package net.lab1024.sa.admin.module.business.oa.invoice; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import net.lab1024.sa.admin.constant.AdminSwaggerTagConst; +import net.lab1024.sa.admin.module.business.oa.invoice.domain.InvoiceAddForm; +import net.lab1024.sa.admin.module.business.oa.invoice.domain.InvoiceQueryForm; +import net.lab1024.sa.admin.module.business.oa.invoice.domain.InvoiceUpdateForm; +import net.lab1024.sa.admin.module.business.oa.invoice.domain.InvoiceVO; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.RequestUser; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.util.SmartRequestUtil; +import net.lab1024.sa.common.module.support.operatelog.annoation.OperateLog; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + +/** + * OA发票信息 + * + * @Author 1024创新实验室: 善逸 + * @Date 2022-06-23 19:32:59 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Slf4j +@RestController +@OperateLog +@Api(tags = {AdminSwaggerTagConst.Business.OA_INVOICE}) +public class InvoiceController { + + @Autowired + private InvoiceService invoiceService; + + @ApiOperation(value = "分页查询发票信息 @author 善逸") + @PostMapping("/oa/invoice/page/query") + public ResponseDTO> queryByPage(@RequestBody @Valid InvoiceQueryForm queryDTO) { + return invoiceService.queryByPage(queryDTO); + } + + @ApiOperation(value = "查询发票信息详情 @author 善逸") + @GetMapping("/oa/invoice/get/{invoiceId}") + public ResponseDTO getDetail(@PathVariable Long invoiceId) { + return invoiceService.getDetail(invoiceId); + } + + @ApiOperation(value = "新建发票信息 @author 善逸") + @PostMapping("/oa/invoice/create") + public ResponseDTO createInvoice(@RequestBody @Valid InvoiceAddForm createVO) { + RequestUser requestUser = SmartRequestUtil.getRequestUser(); + createVO.setCreateUserId(requestUser.getUserId()); + createVO.setCreateUserName(requestUser.getUserName()); + return invoiceService.createInvoice(createVO); + } + + @ApiOperation(value = "编辑发票信息 @author 善逸") + @PostMapping("/oa/invoice/update") + public ResponseDTO updateInvoice(@RequestBody @Valid InvoiceUpdateForm updateVO) { + return invoiceService.updateInvoice(updateVO); + } + + @ApiOperation(value = "删除发票信息 @author 善逸") + @GetMapping("/invoice/delete/{invoiceId}") + public ResponseDTO deleteInvoice(@PathVariable Long invoiceId) { + return invoiceService.deleteInvoice(invoiceId); + } + + @ApiOperation(value = "查询列表 @author lidoudou") + @GetMapping("/oa/invoice/query/list/{enterpriseId}") + public ResponseDTO> queryList(@PathVariable Long enterpriseId) { + return invoiceService.queryList(enterpriseId); + } + + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/invoice/InvoiceDao.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/invoice/InvoiceDao.java new file mode 100644 index 00000000..371a4edb --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/invoice/InvoiceDao.java @@ -0,0 +1,61 @@ +package net.lab1024.sa.admin.module.business.oa.invoice; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import net.lab1024.sa.admin.module.business.oa.invoice.domain.InvoiceEntity; +import net.lab1024.sa.admin.module.business.oa.invoice.domain.InvoiceQueryForm; +import net.lab1024.sa.admin.module.business.oa.invoice.domain.InvoiceVO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * OA发票信息 + * + * @Author 1024创新实验室: 善逸 + * @Date 2022-06-23 19:32:59 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Mapper +@Component +public interface InvoiceDao extends BaseMapper { + + /** + * 根据账号查询 + * @param enterpriseId + * @param accountNumber + * @param excludeInvoiceId + * @param deletedFlag + * @return + */ + InvoiceEntity queryByAccountNumber(@Param("enterpriseId") Long enterpriseId, @Param("accountNumber") String accountNumber, @Param("excludeInvoiceId") Long excludeInvoiceId, @Param("deletedFlag") Boolean deletedFlag); + + /** + * 删除发票信息 + * + * @param invoiceId + * @param deletedFlag + */ + void deleteInvoice(@Param("invoiceId") Long invoiceId, @Param("deletedFlag") Boolean deletedFlag); + + /** + * 发票信息分页查询 + * + * @param page + * @param queryForm + * @return + */ + List queryPage(Page page, @Param("queryForm") InvoiceQueryForm queryForm); + + /** + * 查询发票信息详情 + * @param invoiceId + * @param deletedFlag + * @return + */ + InvoiceVO getDetail(@Param("invoiceId") Long invoiceId, @Param("deletedFlag") Boolean deletedFlag); +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/invoice/InvoiceService.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/invoice/InvoiceService.java new file mode 100644 index 00000000..70afe51d --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/invoice/InvoiceService.java @@ -0,0 +1,158 @@ +package net.lab1024.sa.admin.module.business.oa.invoice; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.extern.slf4j.Slf4j; +import net.lab1024.sa.admin.module.business.oa.enterprise.EnterpriseService; +import net.lab1024.sa.admin.module.business.oa.enterprise.domain.vo.EnterpriseVO; +import net.lab1024.sa.admin.module.business.oa.invoice.domain.*; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.util.SmartBeanUtil; +import net.lab1024.sa.common.common.util.SmartPageUtil; +import net.lab1024.sa.common.module.support.datatracer.constant.DataTracerConst; +import net.lab1024.sa.common.module.support.datatracer.constant.DataTracerTypeEnum; +import net.lab1024.sa.common.module.support.datatracer.service.DataTracerService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +import java.util.Objects; + +/** + * OA发票信息 + * + * @Author 1024创新实验室: 善逸 + * @Date 2022-06-23 19:32:59 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Service +@Slf4j +public class InvoiceService { + + @Autowired + private InvoiceDao invoiceDao; + + @Autowired + private EnterpriseService enterpriseService; + + @Autowired + private DataTracerService dataTracerService; + + /** + * 分页查询发票信息 + * + * @param queryDTO + * @return + */ + public ResponseDTO> queryByPage(InvoiceQueryForm queryDTO) { + queryDTO.setDeletedFlag(Boolean.FALSE); + Page page = SmartPageUtil.convert2PageQuery(queryDTO); + List invoiceVOS = invoiceDao.queryPage(page, queryDTO); + PageResult pageResult = SmartPageUtil.convert2PageResult(page, invoiceVOS); + return ResponseDTO.ok(pageResult); + } + + public ResponseDTO> queryList(Long enterpriseId) { + InvoiceQueryForm queryForm = new InvoiceQueryForm(); + queryForm.setDeletedFlag(Boolean.FALSE); + queryForm.setDisabledFlag(Boolean.FALSE); + queryForm.setEnterpriseId(enterpriseId); + List invoiceList = invoiceDao.queryPage(null, queryForm); + return ResponseDTO.ok(invoiceList); + } + + /** + * 查询发票信息详情 + * + * @param invoiceId + * @return + */ + public ResponseDTO getDetail(Long invoiceId) { + // 校验发票信息是否存在 + InvoiceVO invoiceVO = invoiceDao.getDetail(invoiceId, Boolean.FALSE); + if (Objects.isNull(invoiceVO)) { + return ResponseDTO.userErrorParam("发票信息不存在"); + } + return ResponseDTO.ok(invoiceVO); + } + + /** + * 新建发票信息 + * + * @param createVO + * @return + */ + @Transactional(rollbackFor = Exception.class) + public ResponseDTO createInvoice(InvoiceAddForm createVO) { + Long enterpriseId = createVO.getEnterpriseId(); + // 校验企业是否存在 + EnterpriseVO enterpriseVO = enterpriseService.getDetail(enterpriseId); + if (Objects.isNull(enterpriseVO)) { + return ResponseDTO.userErrorParam("企业不存在"); + } + // 验证发票信息账号是否重复 + InvoiceEntity validateInvoice = invoiceDao.queryByAccountNumber(enterpriseId, createVO.getAccountNumber(), null, Boolean.FALSE); + if (Objects.nonNull(validateInvoice)) { + return ResponseDTO.userErrorParam("发票信息账号重复"); + } + // 数据插入 + InvoiceEntity insertInvoice = SmartBeanUtil.copy(createVO, InvoiceEntity.class); + invoiceDao.insert(insertInvoice); + dataTracerService.addTrace(enterpriseId, DataTracerTypeEnum.OA_ENTERPRISE, "新增发票:" + DataTracerConst.HTML_BR + dataTracerService.getChangeContent(insertInvoice)); + return ResponseDTO.ok(); + } + + /** + * 编辑发票信息 + * + * @param updateVO + * @return + */ + @Transactional(rollbackFor = Exception.class) + public ResponseDTO updateInvoice(InvoiceUpdateForm updateVO) { + Long enterpriseId = updateVO.getEnterpriseId(); + // 校验企业是否存在 + EnterpriseVO enterpriseVO = enterpriseService.getDetail(enterpriseId); + if (Objects.isNull(enterpriseVO)) { + return ResponseDTO.userErrorParam("企业不存在"); + } + Long invoiceId = updateVO.getInvoiceId(); + // 校验发票信息是否存在 + InvoiceEntity invoiceDetail = invoiceDao.selectById(invoiceId); + if (Objects.isNull(invoiceDetail) || invoiceDetail.getDeletedFlag()) { + return ResponseDTO.userErrorParam("发票信息不存在"); + } + // 验证发票信息账号是否重复 + InvoiceEntity validateInvoice = invoiceDao.queryByAccountNumber(updateVO.getEnterpriseId(), updateVO.getAccountNumber(), invoiceId, Boolean.FALSE); + if (Objects.nonNull(validateInvoice)) { + return ResponseDTO.userErrorParam("发票信息账号重复"); + } + // 数据编辑 + InvoiceEntity updateInvoice = SmartBeanUtil.copy(updateVO, InvoiceEntity.class); + invoiceDao.updateById(updateInvoice); + dataTracerService.addTrace(enterpriseId, DataTracerTypeEnum.OA_ENTERPRISE, "更新发票:" + DataTracerConst.HTML_BR + dataTracerService.getChangeContent(invoiceDetail, updateInvoice)); + return ResponseDTO.ok(); + } + + + /** + * 删除发票信息 + + * @param invoiceId + * @return + */ + @Transactional(rollbackFor = Exception.class) + public ResponseDTO deleteInvoice(Long invoiceId) { + // 校验发票信息是否存在 + InvoiceEntity invoiceDetail = invoiceDao.selectById(invoiceId); + if (Objects.isNull(invoiceDetail) || invoiceDetail.getDeletedFlag()) { + return ResponseDTO.userErrorParam("发票信息不存在"); + } + invoiceDao.deleteInvoice(invoiceId, Boolean.TRUE); + dataTracerService.addTrace(invoiceDetail.getEnterpriseId(), DataTracerTypeEnum.OA_ENTERPRISE, "删除发票:" + DataTracerConst.HTML_BR + dataTracerService.getChangeContent(invoiceDetail)); + return ResponseDTO.ok(); + } +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/invoice/domain/InvoiceAddForm.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/invoice/domain/InvoiceAddForm.java new file mode 100644 index 00000000..0a87edee --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/invoice/domain/InvoiceAddForm.java @@ -0,0 +1,59 @@ +package net.lab1024.sa.admin.module.business.oa.invoice.domain; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +/** + * OA发票信息新建 + * + * @Author 1024创新实验室: 善逸 + * @Date 2022-06-23 19:32:59 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +public class InvoiceAddForm { + + @ApiModelProperty("开票抬头") + @NotBlank(message = "开票抬头不能为空") + @Length(max = 200, message = "开票抬头最多200字符") + private String invoiceHeads; + + @ApiModelProperty("纳税人识别号") + @NotBlank(message = "纳税人识别号不能为空") + @Length(max = 200, message = "纳税人识别号最多200字符") + private String taxpayerIdentificationNumber; + + @ApiModelProperty("银行账户") + @NotBlank(message = "银行账户不能为空") + @Length(max = 200, message = "银行账户最多200字符") + private String accountNumber; + + @ApiModelProperty("开户行") + @NotBlank(message = "开户行不能为空") + @Length(max = 200, message = "开户行最多200字符") + private String bankName; + + @ApiModelProperty("启用状态") + @NotNull(message = "启用状态不能为空") + private Boolean disabledFlag; + + @ApiModelProperty("备注") + @Length(max = 500, message = "备注最多500字符") + private String remark; + + @ApiModelProperty("企业") + @NotNull(message = "企业不能为空") + private Long enterpriseId; + + @ApiModelProperty(value = "创建人", hidden = true) + private Long createUserId; + + @ApiModelProperty(value = "创建人名称", hidden = true) + private String createUserName; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/invoice/domain/InvoiceEntity.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/invoice/domain/InvoiceEntity.java new file mode 100644 index 00000000..bc7d563a --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/invoice/domain/InvoiceEntity.java @@ -0,0 +1,98 @@ +package net.lab1024.sa.admin.module.business.oa.invoice.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import net.lab1024.sa.common.module.support.datatracer.annoation.DataTracerFieldLabel; + +import java.time.LocalDateTime; + +/** + * OA发票信息 + * + * @Author 1024创新实验室: 善逸 + * @Date 2022-06-23 19:32:59 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +@TableName("t_oa_invoice") +public class InvoiceEntity { + + /** + * 发票信息ID + */ + @TableId(type = IdType.AUTO) + private Long invoiceId; + + /** + * 开票抬头 + */ + @DataTracerFieldLabel("开票抬头") + private String invoiceHeads; + + /** + * 纳税人识别号 + */ + @DataTracerFieldLabel("纳税人识别号") + private String taxpayerIdentificationNumber; + + /** + * 银行账户 + */ + @DataTracerFieldLabel("银行账户") + private String accountNumber; + + /** + * 开户行 + */ + @DataTracerFieldLabel("开户行") + private String bankName; + + /** + * 备注 + */ + @DataTracerFieldLabel("备注") + private String remark; + + /** + * 企业ID + */ + private Long enterpriseId; + + /** + * 禁用状态 + */ + @DataTracerFieldLabel("禁用状态") + private Boolean disabledFlag; + + /** + * 删除状态 + */ + @DataTracerFieldLabel("删除状态") + private Boolean deletedFlag; + + /** + * 创建人ID + */ + private Long createUserId; + + /** + * 创建人ID + */ + private String createUserName; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; + + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/invoice/domain/InvoiceQueryForm.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/invoice/domain/InvoiceQueryForm.java new file mode 100644 index 00000000..0883bd3f --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/invoice/domain/InvoiceQueryForm.java @@ -0,0 +1,40 @@ +package net.lab1024.sa.admin.module.business.oa.invoice.domain; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.domain.PageParam; +import org.hibernate.validator.constraints.Length; + +import java.time.LocalDate; + +/** + * OA发票信息查询 + * + * @Author 1024创新实验室: 善逸 + * @Date 2022-06-23 19:32:59 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +public class InvoiceQueryForm extends PageParam { + + @ApiModelProperty("企业ID") + private Long enterpriseId; + + @ApiModelProperty("关键字") + @Length(max = 200, message = "关键字最多200字符") + private String keywords; + + @ApiModelProperty("开始时间") + private LocalDate startTime; + + @ApiModelProperty("结束时间") + private LocalDate endTime; + + @ApiModelProperty("禁用状态") + private Boolean disabledFlag; + + @ApiModelProperty(value = "删除状态", hidden = true) + private Boolean deletedFlag; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/invoice/domain/InvoiceUpdateForm.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/invoice/domain/InvoiceUpdateForm.java new file mode 100644 index 00000000..053d4934 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/invoice/domain/InvoiceUpdateForm.java @@ -0,0 +1,23 @@ +package net.lab1024.sa.admin.module.business.oa.invoice.domain; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * OA发票信息编辑 + * + * @Author 1024创新实验室: 善逸 + * @Date 2022-06-23 19:32:59 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +public class InvoiceUpdateForm extends InvoiceAddForm { + + @ApiModelProperty("发票信息ID") + @NotNull(message = "发票信息ID不能为空") + private Long invoiceId; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/invoice/domain/InvoiceVO.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/invoice/domain/InvoiceVO.java new file mode 100644 index 00000000..2c8fb0e9 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/invoice/domain/InvoiceVO.java @@ -0,0 +1,58 @@ +package net.lab1024.sa.admin.module.business.oa.invoice.domain; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * OA发票信息 + * + * @Author 1024创新实验室: 善逸 + * @Date 2022-06-23 19:32:59 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +public class InvoiceVO { + + @ApiModelProperty("发票信息ID") + private Long invoiceId; + + @ApiModelProperty("开票抬头") + private String invoiceHeads; + + @ApiModelProperty("纳税人识别号") + private String taxpayerIdentificationNumber; + + @ApiModelProperty("银行账户") + private String accountNumber; + + @ApiModelProperty("开户行") + private String bankName; + + @ApiModelProperty("备注") + private String remark; + + @ApiModelProperty("企业") + private Long enterpriseId; + + @ApiModelProperty("企业名称") + private String enterpriseName; + + @ApiModelProperty("禁用状态") + private Boolean disabledFlag; + + @ApiModelProperty("创建人ID") + private Long createUserId; + + @ApiModelProperty("创建人名称") + private String createUserName; + + @ApiModelProperty("创建时间") + private LocalDateTime createTime; + + @ApiModelProperty("更新时间") + private LocalDateTime updateTime; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/constant/NoticeVisibleRangeDataTypeEnum.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/constant/NoticeVisibleRangeDataTypeEnum.java new file mode 100644 index 00000000..27f4d163 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/constant/NoticeVisibleRangeDataTypeEnum.java @@ -0,0 +1,30 @@ +package net.lab1024.sa.admin.module.business.oa.notice.constant; + + +import lombok.AllArgsConstructor; +import lombok.Getter; +import net.lab1024.sa.common.common.enumeration.BaseEnum; + +/** + * 公告、通知 可见范围类型 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-12 21:40:39 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Getter +@AllArgsConstructor +public enum NoticeVisibleRangeDataTypeEnum implements BaseEnum { + + EMPLOYEE(1, "员工"), + + DEPARTMENT(2, "部门"), + + ; + + private final Integer value; + + private final String desc; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/controller/NoticeController.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/controller/NoticeController.java new file mode 100644 index 00000000..a06bcf12 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/controller/NoticeController.java @@ -0,0 +1,138 @@ +package net.lab1024.sa.admin.module.business.oa.notice.controller; + +import cn.hutool.extra.servlet.ServletUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import net.lab1024.sa.admin.constant.AdminSwaggerTagConst; +import net.lab1024.sa.admin.module.business.oa.notice.domain.form.*; +import net.lab1024.sa.admin.module.business.oa.notice.domain.vo.*; +import net.lab1024.sa.admin.module.business.oa.notice.service.NoticeEmployeeService; +import net.lab1024.sa.admin.module.business.oa.notice.service.NoticeService; +import net.lab1024.sa.admin.module.business.oa.notice.service.NoticeTypeService; +import net.lab1024.sa.common.common.annoation.SaAuth; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.util.SmartRequestUtil; +import net.lab1024.sa.common.module.support.repeatsubmit.annoation.RepeatSubmit; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import javax.validation.Valid; +import java.util.List; + +/** + * 公告、通知、新闻等等 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-12 21:40:39 + * @Wechat 卓大1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Api(tags = AdminSwaggerTagConst.Business.OA_NOTICE) +@RestController +public class NoticeController { + + @Autowired + private NoticeService noticeService; + + @Autowired + private NoticeTypeService noticeTypeService; + + @Autowired + private NoticeEmployeeService noticeEmployeeService; + + // --------------------- 通知公告类型 ------------------------- + + @ApiOperation("通知公告类型-获取全部 @author 卓大") + @GetMapping("/oa/noticeType/getAll") + public ResponseDTO> getAll() { + return ResponseDTO.ok(noticeTypeService.getAll()); + } + + @ApiOperation("通知公告类型-添加 @author 卓大") + @GetMapping("/oa/noticeType/add/{name}") + public ResponseDTO add(@PathVariable String name) { + return noticeTypeService.add(name); + } + + @ApiOperation("通知公告类型-修改 @author 卓大") + @GetMapping("/oa/noticeType/update/{noticeTypeId}/{name}") + public ResponseDTO update(@PathVariable Long noticeTypeId, @PathVariable String name) { + return noticeTypeService.update(noticeTypeId, name); + } + + @ApiOperation("通知公告类型-删除 @author 卓大") + @GetMapping("/oa/noticeType/delete/{noticeTypeId}") + public ResponseDTO deleteNoticeType(@PathVariable Long noticeTypeId) { + return noticeTypeService.delete(noticeTypeId); + } + + // --------------------- 【管理】通知公告------------------------- + + @ApiOperation("【管理】通知公告-分页查询 @author 卓大") + @PostMapping("/oa/notice/query") + @SaAuth + public ResponseDTO> query(@RequestBody @Valid NoticeQueryForm queryForm) { + return ResponseDTO.ok(noticeService.query(queryForm)); + } + + @ApiOperation("【管理】通知公告-添加 @author 卓大") + @PostMapping("/oa/notice/add") + @RepeatSubmit + @SaAuth + public ResponseDTO add(@RequestBody @Valid NoticeAddForm addForm) { + addForm.setCreateUserId(SmartRequestUtil.getRequestUserId()); + return noticeService.add(addForm); + } + + @ApiOperation("【管理】通知公告-更新 @author 卓大") + @PostMapping("/oa/notice/update") + @RepeatSubmit + @SaAuth + public ResponseDTO update(@RequestBody @Valid NoticeUpdateForm updateForm) { + return noticeService.update(updateForm); + } + + @ApiOperation("【管理】通知公告-更新详情 @author 卓大") + @GetMapping("/oa/notice/getUpdateVO/{noticeId}") + @SaAuth + public ResponseDTO getUpdateFormVO(@PathVariable Long noticeId) { + return ResponseDTO.ok(noticeService.getUpdateFormVO(noticeId)); + } + + @ApiOperation("【管理】通知公告-删除 @author 卓大") + @GetMapping("/oa/notice/delete/{noticeId}") + @SaAuth + public ResponseDTO delete(@PathVariable Long noticeId) { + return noticeService.delete(noticeId); + } + + // --------------------- 【员工】查看 通知公告 ------------------------- + @ApiOperation("【员工】通知公告-查看详情 @author 卓大") + @GetMapping("/oa/notice/employee/view/{noticeId}") + @RepeatSubmit + public ResponseDTO view(@PathVariable Long noticeId, HttpServletRequest request) { + return noticeEmployeeService.view( + SmartRequestUtil.getRequestUserId(), + noticeId, + ServletUtil.getClientIP(request), + request.getHeader("User-Agent") + ); + } + + @ApiOperation("【员工】通知公告-查询全部 @author 卓大") + @PostMapping("/oa/notice/employee/query") + @RepeatSubmit + public ResponseDTO> queryEmployeeNotice(@RequestBody @Valid NoticeEmployeeQueryForm noticeEmployeeQueryForm) { + return noticeEmployeeService.queryList(SmartRequestUtil.getRequestUserId(), noticeEmployeeQueryForm); + } + + @ApiOperation("【员工】通知公告-查询 查看记录 @author 卓大") + @PostMapping("/oa/notice/employee/queryViewRecord") + @RepeatSubmit + public ResponseDTO> queryViewRecord(@RequestBody @Valid NoticeViewRecordQueryForm noticeViewRecordQueryForm) { + return ResponseDTO.ok(noticeEmployeeService.queryViewRecord(noticeViewRecordQueryForm)); + } +} \ No newline at end of file diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/dao/NoticeDao.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/dao/NoticeDao.java new file mode 100644 index 00000000..aba10192 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/dao/NoticeDao.java @@ -0,0 +1,144 @@ +package net.lab1024.sa.admin.module.business.oa.notice.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import net.lab1024.sa.admin.module.business.oa.notice.domain.entity.NoticeEntity; +import net.lab1024.sa.admin.module.business.oa.notice.domain.form.NoticeEmployeeQueryForm; +import net.lab1024.sa.admin.module.business.oa.notice.domain.form.NoticeQueryForm; +import net.lab1024.sa.admin.module.business.oa.notice.domain.form.NoticeViewRecordQueryForm; +import net.lab1024.sa.admin.module.business.oa.notice.domain.form.NoticeVisibleRangeForm; +import net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeEmployeeVO; +import net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeVO; +import net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeViewRecordVO; +import net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeVisibleRangeVO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * 公告、通知、新闻等等 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-12 21:40:39 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Mapper +@Component +public interface NoticeDao extends BaseMapper { + + // ================================= 数据范围相关 【子表】 ================================= + + /** + * 保存可见范围 + * + * @param noticeId + * @param visibleRangeFormList + */ + void insertVisibleRange(@Param("noticeId") Long noticeId, @Param("visibleRangeFormList") List visibleRangeFormList); + + /** + * 删除可见范围 + * + * @param noticeId + */ + void deleteVisibleRange(@Param("noticeId") Long noticeId); + + /** + * 相关可见范围 + * + * @param noticeId + */ + List queryVisibleRange(@Param("noticeId") Long noticeId); + + // ================================= 通知公告【主表】 相关 ================================= + + /** + * 后管分页查询资讯 + * + * @param page + * @param queryForm + * @return + */ + List query(Page page, @Param("query") NoticeQueryForm queryForm); + + + /** + * 更新删除状态 + * + * @param noticeId + */ + void updateDeletedFlag(@Param("noticeId") Long noticeId); + + // ================================= 通知公告【员工查看】 相关 ================================= + + /** + * 查询 员工 查看到的通知公告 + * + * @param page + * @param requestEmployeeId + * @param noticeEmployeeQueryForm + * @return + */ + List queryEmployeeNotice(Page page, + @Param("requestEmployeeId") Long requestEmployeeId, + @Param("query") NoticeEmployeeQueryForm noticeEmployeeQueryForm, + @Param("requestEmployeeDepartmentIdList") List requestEmployeeDepartmentIdList, + @Param("deletedFlag") boolean deletedFlag, + @Param("administratorFlag") boolean administratorFlag, + @Param("departmentDataType") Integer departmentDataType, + @Param("employeeDataType") Integer employeeDataType + + ); + + /** + * 查询 员工 未读的通知公告 + * + * @param page + * @param requestEmployeeId + * @param noticeEmployeeQueryForm + * @return + */ + List queryEmployeeNotViewNotice(Page page, + @Param("requestEmployeeId") Long requestEmployeeId, + @Param("query") NoticeEmployeeQueryForm noticeEmployeeQueryForm, + @Param("requestEmployeeDepartmentIdList") List requestEmployeeDepartmentIdList, + @Param("deletedFlag") boolean deletedFlag, + @Param("administratorFlag") boolean administratorFlag, + @Param("departmentDataType") Integer departmentDataType, + @Param("employeeDataType") Integer employeeDataType + + ); + + long viewRecordCount(@Param("noticeId")Long noticeId, @Param("employeeId")Long employeeId); + + /** + * 查询通知、公告的 查看记录 + * @param page + * @param noticeViewRecordQueryForm + * @return + */ + List queryNoticeViewRecordList(Page page,@Param("queryForm") NoticeViewRecordQueryForm noticeViewRecordQueryForm); + + /** + * 保存查看记录 + * @param noticeId + * @param employeeId + * @param ip + * @param userAgent + */ + void insertViewRecord(@Param("noticeId") Long noticeId, @Param("employeeId") Long employeeId, @Param("ip") String ip, @Param("userAgent") String userAgent,@Param("pageViewCount") Integer pageViewCount); + + /** + * 更新查看记录 + * @param noticeId + * @param requestEmployeeId + * @param ip + * @param userAgent + */ + void updateViewRecord(@Param("noticeId")Long noticeId, @Param("employeeId")Long requestEmployeeId,@Param("ip") String ip, @Param("userAgent")String userAgent); + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/dao/NoticeTypeDao.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/dao/NoticeTypeDao.java new file mode 100644 index 00000000..456fe4dd --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/dao/NoticeTypeDao.java @@ -0,0 +1,21 @@ +package net.lab1024.sa.admin.module.business.oa.notice.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import net.lab1024.sa.admin.module.business.oa.notice.domain.entity.NoticeTypeEntity; +import org.apache.ibatis.annotations.Mapper; +import org.springframework.stereotype.Component; + +/** + * 通知公告类型 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-12 21:40:39 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Mapper +@Component +public interface NoticeTypeDao extends BaseMapper { + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/entity/NoticeEntity.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/entity/NoticeEntity.java new file mode 100644 index 00000000..7dfaa513 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/entity/NoticeEntity.java @@ -0,0 +1,99 @@ +package net.lab1024.sa.admin.module.business.oa.notice.domain.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * 通知公告 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-12 21:40:39 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +@TableName("t_notice") +public class NoticeEntity { + + @TableId(type = IdType.AUTO) + private Long noticeId; + + /** + * 类型 + */ + private Long noticeTypeId; + + /** + * 标题 + */ + private String title; + + /** + * 是否全部可见 + */ + private Boolean allVisibleFlag; + + /** + * 是否定时发布 + */ + private Boolean scheduledPublishFlag; + + /** + * 发布时间 + */ + private LocalDateTime publishTime; + + /** + * 内容 纯文本 + */ + private String contentText; + + /** + * 内容 html + */ + private String contentHtml; + + /** + * 附件 + * 多个英文逗号分隔 + */ + private String attachment; + + /** + * 页面浏览量 + */ + private Integer pageViewCount; + + /** + * 用户浏览量 + */ + private Integer userViewCount; + + /** + * 来源 + */ + private String source; + + /** + * 作者 + */ + private String author; + + /** + * 文号 + */ + private String documentNumber; + + private Boolean deletedFlag; + + private Long createUserId; + + private LocalDateTime updateTime; + + private LocalDateTime createTime; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/entity/NoticeTypeEntity.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/entity/NoticeTypeEntity.java new file mode 100644 index 00000000..c749dced --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/entity/NoticeTypeEntity.java @@ -0,0 +1,41 @@ +package net.lab1024.sa.admin.module.business.oa.notice.domain.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.LocalDateTime; + +/** + * 通知公告类型 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-12 21:40:39 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +@TableName("t_notice_type") +@NoArgsConstructor +@AllArgsConstructor +@Builder +public class NoticeTypeEntity { + + @TableId(type = IdType.AUTO) + private Long noticeTypeId; + + /** + * 名称 + */ + private String noticeTypeName; + + + private LocalDateTime updateTime; + + private LocalDateTime createTime; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/form/NoticeAddForm.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/form/NoticeAddForm.java new file mode 100644 index 00000000..b83ba79a --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/form/NoticeAddForm.java @@ -0,0 +1,78 @@ +package net.lab1024.sa.admin.module.business.oa.notice.domain.form; + +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.json.deserializer.FileKeyVoDeserializer; +import org.hibernate.validator.constraints.Length; + +import javax.validation.Valid; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.time.LocalDateTime; +import java.util.List; + +/** + * 通知公告 添加表单 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-12 21:40:39 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +public class NoticeAddForm { + + @ApiModelProperty("标题") + @NotBlank(message = "标题不能为空") + @Length(max = 200, message = "标题最多200字符") + private String title; + + @ApiModelProperty("分类") + @NotNull(message = "分类不能为空") + private Long noticeTypeId; + + @ApiModelProperty("是否全部可见") + @NotNull(message = "是否全部可见不能为空") + private Boolean allVisibleFlag; + + @ApiModelProperty("是否定时发布") + @NotNull(message = "是否定时发布不能为空") + private Boolean scheduledPublishFlag; + + @ApiModelProperty("发布时间") + @NotNull(message = "发布时间不能为空") + private LocalDateTime publishTime; + + @ApiModelProperty("纯文本内容") + @NotNull(message = "文本内容不能为空") + private String contentText; + + @ApiModelProperty("html内容") + @NotNull(message = "html内容不能为空") + private String contentHtml; + + @ApiModelProperty("附件,多个英文逗号分隔|可选") + @Length(max = 1000, message = "最多1000字符") + @JsonDeserialize(using = FileKeyVoDeserializer.class) + private String attachment; + + @ApiModelProperty("作者") + @NotBlank(message = "作者不能为空") + private String author; + + @ApiModelProperty("来源") + @NotBlank(message = "标题不能为空") + private String source; + + @ApiModelProperty("文号") + private String documentNumber; + + @ApiModelProperty(hidden = true) + private Long createUserId; + + @ApiModelProperty("可见范围设置|可选") + @Valid + private List visibleRangeList; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/form/NoticeEmployeeQueryForm.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/form/NoticeEmployeeQueryForm.java new file mode 100644 index 00000000..0374861c --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/form/NoticeEmployeeQueryForm.java @@ -0,0 +1,35 @@ +package net.lab1024.sa.admin.module.business.oa.notice.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.domain.PageParam; + +import java.time.LocalDate; + +/** + * 通知公告 员工查询表单 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-12 21:40:39 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +public class NoticeEmployeeQueryForm extends PageParam { + + @ApiModelProperty("标题、作者、来源、文号") + private String keywords; + + @ApiModelProperty("分类") + private Long noticeTypeId; + + @ApiModelProperty("发布-开始时间") + private LocalDate publishTimeBegin; + + @ApiModelProperty("未读标识") + private Boolean notViewFlag; + + @ApiModelProperty("发布-截止时间") + private LocalDate publishTimeEnd; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/form/NoticeQueryForm.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/form/NoticeQueryForm.java new file mode 100644 index 00000000..c319b2b6 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/form/NoticeQueryForm.java @@ -0,0 +1,48 @@ +package net.lab1024.sa.admin.module.business.oa.notice.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.domain.PageParam; + +import java.time.LocalDate; + +/** + * 通知公告 管理查询表单 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-12 21:40:39 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +public class NoticeQueryForm extends PageParam { + + @ApiModelProperty("分类") + private Long noticeTypeId; + + @ApiModelProperty("标题、作者、来源") + private String keywords; + + @ApiModelProperty("文号") + private String documentNumber; + + @ApiModelProperty("创建人") + private Long createUserId; + + @ApiModelProperty("删除标识") + private Boolean deletedFlag; + + @ApiModelProperty("创建-开始时间") + private LocalDate createTimeBegin; + + @ApiModelProperty("创建-截止时间") + private LocalDate createTimeEnd; + + @ApiModelProperty("发布-开始时间") + private LocalDate publishTimeBegin; + + @ApiModelProperty("发布-截止时间") + private LocalDate publishTimeEnd; + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/form/NoticeUpdateForm.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/form/NoticeUpdateForm.java new file mode 100644 index 00000000..c2ecb57d --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/form/NoticeUpdateForm.java @@ -0,0 +1,24 @@ +package net.lab1024.sa.admin.module.business.oa.notice.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * 通知公告 更新表单 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-12 21:40:39 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +public class NoticeUpdateForm extends NoticeAddForm { + + @ApiModelProperty("id") + @NotNull(message = "通知id不能为空") + private Long noticeId; + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/form/NoticeViewRecordQueryForm.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/form/NoticeViewRecordQueryForm.java new file mode 100644 index 00000000..7ac41f27 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/form/NoticeViewRecordQueryForm.java @@ -0,0 +1,32 @@ +package net.lab1024.sa.admin.module.business.oa.notice.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.domain.PageParam; + +import javax.validation.constraints.NotNull; + +/** + * 通知公告 阅读记录查询 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-12 21:40:39 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +public class NoticeViewRecordQueryForm extends PageParam { + + @ApiModelProperty("通知公告id") + @NotNull(message = "通知公告id不能为空") + private Long noticeId; + + @ApiModelProperty("部门id") + private Long departmentId; + + @ApiModelProperty("关键字") + private String keywords; + + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/form/NoticeVisibleRangeForm.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/form/NoticeVisibleRangeForm.java new file mode 100644 index 00000000..7a3b061b --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/form/NoticeVisibleRangeForm.java @@ -0,0 +1,34 @@ +package net.lab1024.sa.admin.module.business.oa.notice.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import net.lab1024.sa.admin.module.business.oa.notice.constant.NoticeVisibleRangeDataTypeEnum; +import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum; +import net.lab1024.sa.common.common.validator.enumeration.CheckEnum; + +import javax.validation.constraints.NotNull; + +/** + * 通知公告 可见范围数据 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-12 21:40:39 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class NoticeVisibleRangeForm { + + @ApiModelPropertyEnum(NoticeVisibleRangeDataTypeEnum.class) + @CheckEnum(value = NoticeVisibleRangeDataTypeEnum.class, required = true, message = "数据类型错误") + private Integer dataType; + + @ApiModelProperty("员工/部门id") + @NotNull(message = "员工/部门id不能为空") + private Long dataId; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/vo/NoticeDetailVO.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/vo/NoticeDetailVO.java new file mode 100644 index 00000000..72927bee --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/vo/NoticeDetailVO.java @@ -0,0 +1,84 @@ +package net.lab1024.sa.admin.module.business.oa.notice.domain.vo; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.json.serializer.FileKeyVoSerializer; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.time.LocalDateTime; + +/** + * 通知公告 详情 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-12 21:40:39 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +public class NoticeDetailVO { + + @ApiModelProperty("id") + private Long noticeId; + + @ApiModelProperty("标题") + private String title; + + @ApiModelProperty("分类") + private Long noticeTypeId; + + @ApiModelProperty("分类名称") + private Long noticeTypeName; + + @ApiModelProperty("是否全部可见") + @NotNull(message = "是否全部可见不能为空") + private Boolean allVisibleFlag; + + @ApiModelProperty("是否定时发布") + @NotNull(message = "是否定时发布不能为空") + private Boolean scheduledPublishFlag; + + @ApiModelProperty("纯文本内容") + private String contentText; + + @ApiModelProperty("html内容") + private String contentHtml; + + @ApiModelProperty("附件") + @JsonSerialize(using = FileKeyVoSerializer.class) + private String attachment; + + @ApiModelProperty("发布时间") + @NotNull(message = "发布时间不能为空") + private LocalDateTime publishTime; + + @ApiModelProperty("作者") + @NotBlank(message = "作者不能为空") + private String author; + + @ApiModelProperty("来源") + @NotBlank(message = "标题不能为空") + private String source; + + @ApiModelProperty("文号") + private String documentNumber; + + @ApiModelProperty("页面浏览量") + private Integer pageViewCount; + + @ApiModelProperty("用户浏览量") + private Integer userViewCount; + + @ApiModelProperty("创建人名称") + private Long createUserName; + + @ApiModelProperty("创建时间") + private LocalDateTime createTime; + + @ApiModelProperty("更新时间") + private LocalDateTime updateTime; + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/vo/NoticeEmployeeVO.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/vo/NoticeEmployeeVO.java new file mode 100644 index 00000000..b86044a1 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/vo/NoticeEmployeeVO.java @@ -0,0 +1,26 @@ +package net.lab1024.sa.admin.module.business.oa.notice.domain.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.time.LocalDate; + +/** + * 通知公告 员工查看 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-12 21:40:39 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +public class NoticeEmployeeVO extends NoticeVO { + + @ApiModelProperty("是否查看") + private Boolean viewFlag; + + @ApiModelProperty("发布日期") + private LocalDate publishDate; + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/vo/NoticeTypeVO.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/vo/NoticeTypeVO.java new file mode 100644 index 00000000..6aa9ee15 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/vo/NoticeTypeVO.java @@ -0,0 +1,24 @@ +package net.lab1024.sa.admin.module.business.oa.notice.domain.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * 通知公告 类型 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-12 21:40:39 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +public class NoticeTypeVO { + + @ApiModelProperty("通知类型id") + private Long noticeTypeId; + + @ApiModelProperty("通知类型-名称") + private String noticeTypeName; + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/vo/NoticeUpdateFormVO.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/vo/NoticeUpdateFormVO.java new file mode 100644 index 00000000..2d82624b --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/vo/NoticeUpdateFormVO.java @@ -0,0 +1,35 @@ +package net.lab1024.sa.admin.module.business.oa.notice.domain.vo; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.json.serializer.FileKeyVoSerializer; + +import java.util.List; + +/** + * 用于更新 【通知、公告】 的 VO 对象 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-12 21:40:39 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +public class NoticeUpdateFormVO extends NoticeVO { + + @ApiModelProperty("纯文本内容") + private String contentText; + + @ApiModelProperty("html内容") + private String contentHtml; + + @ApiModelProperty("附件") + @JsonSerialize(using = FileKeyVoSerializer.class) + private String attachment; + + @ApiModelProperty("可见范围") + private List visibleRangeList; + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/vo/NoticeVO.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/vo/NoticeVO.java new file mode 100644 index 00000000..570fa925 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/vo/NoticeVO.java @@ -0,0 +1,75 @@ +package net.lab1024.sa.admin.module.business.oa.notice.domain.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.time.LocalDateTime; + + +/** + * 新闻、公告 VO + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-12 21:40:39 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +public class NoticeVO { + + @ApiModelProperty("id") + private Long noticeId; + + @ApiModelProperty("标题") + private String title; + + @ApiModelProperty("分类") + private Long noticeTypeId; + + @ApiModelProperty("分类名称") + private String noticeTypeName; + + @ApiModelProperty("是否全部可见") + private Boolean allVisibleFlag; + + @ApiModelProperty("是否定时发布") + private Boolean scheduledPublishFlag; + + @ApiModelProperty("发布状态") + private Boolean publishFlag; + + @ApiModelProperty("发布时间") + private LocalDateTime publishTime; + + @ApiModelProperty("作者") + @NotBlank(message = "作者不能为空") + private String author; + + @ApiModelProperty("来源") + @NotBlank(message = "标题不能为空") + private String source; + + @ApiModelProperty("文号") + private String documentNumber; + + @ApiModelProperty("页面浏览量") + private Integer pageViewCount; + + @ApiModelProperty("用户浏览量") + private Integer userViewCount; + + @ApiModelProperty("删除标识") + private Boolean deletedFlag; + + @ApiModelProperty("创建人名称") + private String createUserName; + + @ApiModelProperty("创建时间") + private LocalDateTime createTime; + + @ApiModelProperty("更新时间") + private LocalDateTime updateTime; + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/vo/NoticeViewRecordVO.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/vo/NoticeViewRecordVO.java new file mode 100644 index 00000000..5b761259 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/vo/NoticeViewRecordVO.java @@ -0,0 +1,49 @@ +package net.lab1024.sa.admin.module.business.oa.notice.domain.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * 浏览记录 VO + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-12 21:40:39 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +public class NoticeViewRecordVO { + + @ApiModelProperty("员工ID") + private Long employeeId; + + @ApiModelProperty("员工姓名") + private String employeeName; + + @ApiModelProperty("员工部门名称") + private String departmentName; + + @ApiModelProperty("查看次数") + private Integer pageViewCount; + + @ApiModelProperty("首次ip") + private String firstIp; + + @ApiModelProperty("首次用户设备等标识") + private String firstUserAgent; + + @ApiModelProperty("首次查看时间") + private LocalDateTime createTime; + + @ApiModelProperty("最后一次 ip") + private String lastIp; + + @ApiModelProperty("最后一次 用户设备等标识") + private String lastUserAgent; + + @ApiModelProperty("最后一次查看时间") + private LocalDateTime updateTime; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/vo/NoticeVisibleRangeVO.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/vo/NoticeVisibleRangeVO.java new file mode 100644 index 00000000..cd3ad235 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/vo/NoticeVisibleRangeVO.java @@ -0,0 +1,29 @@ +package net.lab1024.sa.admin.module.business.oa.notice.domain.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.admin.module.business.oa.notice.constant.NoticeVisibleRangeDataTypeEnum; +import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum; + +/** + * 新闻、公告 可见范围数据 VO + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-12 21:40:39 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +public class NoticeVisibleRangeVO { + + @ApiModelPropertyEnum(NoticeVisibleRangeDataTypeEnum.class) + private Integer dataType; + + @ApiModelProperty("员工/部门id") + private Long dataId; + + @ApiModelProperty("员工/部门 名称") + private String dataName; + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/manager/NoticeManager.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/manager/NoticeManager.java new file mode 100644 index 00000000..662dca05 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/manager/NoticeManager.java @@ -0,0 +1,67 @@ +package net.lab1024.sa.admin.module.business.oa.notice.manager; + +import net.lab1024.sa.admin.module.business.oa.notice.dao.NoticeDao; +import net.lab1024.sa.admin.module.business.oa.notice.domain.entity.NoticeEntity; +import net.lab1024.sa.admin.module.business.oa.notice.domain.form.NoticeVisibleRangeForm; +import net.lab1024.sa.common.module.support.datatracer.constant.DataTracerTypeEnum; +import net.lab1024.sa.common.module.support.datatracer.service.DataTracerService; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * 通知、公告 manager + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-12 21:40:39 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Service +public class NoticeManager { + + @Autowired + private NoticeDao noticeDao; + + @Autowired + private DataTracerService dataTracerService; + + /** + * 保存 + * + * @param noticeEntity + * @param visibleRangeFormList + */ + @Transactional(rollbackFor = Throwable.class) + public void save(NoticeEntity noticeEntity, List visibleRangeFormList) { + noticeDao.insert(noticeEntity); + Long noticeId = noticeEntity.getNoticeId(); + // 保存可见范围 + if (CollectionUtils.isNotEmpty(visibleRangeFormList)) { + noticeDao.insertVisibleRange(noticeId, visibleRangeFormList); + } + dataTracerService.insert(noticeId, DataTracerTypeEnum.OA_NOTICE); + } + + /** + * 更新 + * + * @param noticeEntity + * @param visibleRangeList + */ + @Transactional(rollbackFor = Throwable.class) + public void update(NoticeEntity old, NoticeEntity noticeEntity, List visibleRangeList) { + noticeDao.updateById(noticeEntity); + Long noticeId = noticeEntity.getNoticeId(); + // 保存可见范围 + if (CollectionUtils.isNotEmpty(visibleRangeList)) { + noticeDao.deleteVisibleRange(noticeId); + noticeDao.insertVisibleRange(noticeId, visibleRangeList); + } + dataTracerService.update(noticeId, DataTracerTypeEnum.OA_NOTICE, old, noticeEntity); + } +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/service/NoticeEmployeeService.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/service/NoticeEmployeeService.java new file mode 100644 index 00000000..b3456b7d --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/service/NoticeEmployeeService.java @@ -0,0 +1,159 @@ +package net.lab1024.sa.admin.module.business.oa.notice.service; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.google.common.collect.Lists; +import net.lab1024.sa.admin.module.business.oa.notice.constant.NoticeVisibleRangeDataTypeEnum; +import net.lab1024.sa.admin.module.business.oa.notice.dao.NoticeDao; +import net.lab1024.sa.admin.module.business.oa.notice.domain.form.NoticeEmployeeQueryForm; +import net.lab1024.sa.admin.module.business.oa.notice.domain.form.NoticeViewRecordQueryForm; +import net.lab1024.sa.admin.module.business.oa.notice.domain.vo.*; +import net.lab1024.sa.admin.module.system.department.service.DepartmentService; +import net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity; +import net.lab1024.sa.admin.module.system.employee.service.EmployeeService; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.util.SmartBeanUtil; +import net.lab1024.sa.common.common.util.SmartPageUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + + +/** + * 员工查看 通知。公告 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-12 21:40:39 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Service +public class NoticeEmployeeService { + + @Autowired + private NoticeDao noticeDao; + + @Autowired + private NoticeService noticeService; + + @Autowired + private DepartmentService departmentService; + + @Autowired + private EmployeeService employeeService; + + /** + * 查询我的 通知、公告清单 + * + * @return + */ + public ResponseDTO> queryList(Long requestEmployeeId, NoticeEmployeeQueryForm noticeEmployeeQueryForm) { + Page page = SmartPageUtil.convert2PageQuery(noticeEmployeeQueryForm); + + //获取请求人的 部门及其子部门 + List employeeDepartmentIdList = Lists.newArrayList(); + EmployeeEntity employeeEntity = employeeService.getById(requestEmployeeId); + if (employeeEntity.getDepartmentId() != null) { + employeeDepartmentIdList = departmentService.selfAndChildrenIdList(employeeEntity.getDepartmentId()); + } + + List noticeList = null; + //只查询未读的 + if (noticeEmployeeQueryForm.getNotViewFlag() != null && noticeEmployeeQueryForm.getNotViewFlag()) { + noticeList = noticeDao.queryEmployeeNotViewNotice(page, + requestEmployeeId, + noticeEmployeeQueryForm, + employeeDepartmentIdList, + false, + employeeEntity.getAdministratorFlag(), + NoticeVisibleRangeDataTypeEnum.DEPARTMENT.getValue(), + NoticeVisibleRangeDataTypeEnum.EMPLOYEE.getValue()); + } else { + // 查询全部 + noticeList = noticeDao.queryEmployeeNotice(page, + requestEmployeeId, + noticeEmployeeQueryForm, + employeeDepartmentIdList, + false, + employeeEntity.getAdministratorFlag(), + NoticeVisibleRangeDataTypeEnum.DEPARTMENT.getValue(), + NoticeVisibleRangeDataTypeEnum.EMPLOYEE.getValue()); + } + // 设置发布日期 + noticeList.forEach(notice -> notice.setPublishDate(notice.getPublishTime().toLocalDate())); + + return ResponseDTO.ok(SmartPageUtil.convert2PageResult(page, noticeList)); + } + + + /** + * 查询我的 待查看的 通知、公告清单 + * + * @return + */ + public ResponseDTO view(Long requestEmployeeId, Long noticeId, String ip, String userAgent) { + NoticeUpdateFormVO updateFormVO = noticeService.getUpdateFormVO(noticeId); + if (updateFormVO == null || Boolean.TRUE.equals(updateFormVO.getDeletedFlag())) { + return ResponseDTO.userErrorParam("通知公告不存在"); + } + + EmployeeEntity employeeEntity = employeeService.getById(requestEmployeeId); + if (!updateFormVO.getAllVisibleFlag() && checkVisibleRange(updateFormVO.getVisibleRangeList(), requestEmployeeId, employeeEntity.getDepartmentId())) { + return ResponseDTO.userErrorParam("对不起,您没有权限查看内容"); + } + + NoticeDetailVO noticeDetailVO = SmartBeanUtil.copy(updateFormVO, NoticeDetailVO.class); + long viewCount = noticeDao.viewRecordCount(noticeId, requestEmployeeId); + if (viewCount == 0) { + noticeDao.insertViewRecord(noticeId, requestEmployeeId, ip, userAgent, 1); + } else { + noticeDao.updateViewRecord(noticeId, requestEmployeeId, ip, userAgent); + } + + return ResponseDTO.ok(noticeDetailVO); + } + + /** + * 校验是否有查看权限的范围 + * + * @param visibleRangeList + * @param employeeId + * @param departmentId + * @return + */ + public boolean checkVisibleRange(List visibleRangeList, Long employeeId, Long departmentId) { + // 员工范围 + boolean anyMatch = visibleRangeList.stream().anyMatch(e -> NoticeVisibleRangeDataTypeEnum.EMPLOYEE.equalsValue(e.getDataType()) && Objects.equals(e.getDataId(), employeeId)); + if (anyMatch) { + return true; + } + + //部门范围 + List visibleDepartmentIdList = visibleRangeList.stream().filter(e -> NoticeVisibleRangeDataTypeEnum.DEPARTMENT.equalsValue(e.getDataType())) + .map(NoticeVisibleRangeVO::getDataId).collect(Collectors.toList()); + + for (Long visibleDepartmentId : visibleDepartmentIdList) { + List departmentIdList = departmentService.selfAndChildrenIdList(visibleDepartmentId); + if (departmentIdList.contains(departmentId)) { + return true; + } + } + return false; + } + + /** + * 分页查询 查看记录 + * + * @param noticeViewRecordQueryForm + * @return + */ + public PageResult queryViewRecord(NoticeViewRecordQueryForm noticeViewRecordQueryForm) { + Page page = SmartPageUtil.convert2PageQuery(noticeViewRecordQueryForm); + List noticeViewRecordVOS = noticeDao.queryNoticeViewRecordList(page, noticeViewRecordQueryForm); + return SmartPageUtil.convert2PageResult(page, noticeViewRecordVOS); + } +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/service/NoticeService.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/service/NoticeService.java new file mode 100644 index 00000000..dbe3b311 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/service/NoticeService.java @@ -0,0 +1,250 @@ +package net.lab1024.sa.admin.module.business.oa.notice.service; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import net.lab1024.sa.admin.module.business.oa.notice.constant.NoticeVisibleRangeDataTypeEnum; +import net.lab1024.sa.admin.module.business.oa.notice.dao.NoticeDao; +import net.lab1024.sa.admin.module.business.oa.notice.domain.entity.NoticeEntity; +import net.lab1024.sa.admin.module.business.oa.notice.domain.form.NoticeAddForm; +import net.lab1024.sa.admin.module.business.oa.notice.domain.form.NoticeQueryForm; +import net.lab1024.sa.admin.module.business.oa.notice.domain.form.NoticeUpdateForm; +import net.lab1024.sa.admin.module.business.oa.notice.domain.form.NoticeVisibleRangeForm; +import net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeTypeVO; +import net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeUpdateFormVO; +import net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeVO; +import net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeVisibleRangeVO; +import net.lab1024.sa.admin.module.business.oa.notice.manager.NoticeManager; +import net.lab1024.sa.admin.module.system.department.dao.DepartmentDao; +import net.lab1024.sa.admin.module.system.department.domain.entity.DepartmentEntity; +import net.lab1024.sa.admin.module.system.department.domain.vo.DepartmentVO; +import net.lab1024.sa.admin.module.system.department.service.DepartmentService; +import net.lab1024.sa.admin.module.system.employee.dao.EmployeeDao; +import net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity; +import net.lab1024.sa.common.common.constant.StringConst; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.util.SmartBeanUtil; +import net.lab1024.sa.common.common.util.SmartPageUtil; +import net.lab1024.sa.common.module.support.datatracer.constant.DataTracerTypeEnum; +import net.lab1024.sa.common.module.support.datatracer.service.DataTracerService; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * 通知。公告 后台管理业务 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-12 21:40:39 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Service +public class NoticeService { + + @Autowired + private NoticeDao noticeDao; + + @Autowired + private NoticeManager noticeManager; + + @Autowired + private EmployeeDao employeeDao; + + @Autowired + private DepartmentDao departmentDao; + + @Autowired + private DepartmentService departmentService; + + @Autowired + private NoticeTypeService noticeTypeService; + + @Autowired + private DataTracerService dataTracerService; + + /** + * 查询 通知、公告 + * + * @param queryForm + * @return + */ + public PageResult query(NoticeQueryForm queryForm) { + Page page = SmartPageUtil.convert2PageQuery(queryForm); + List list = noticeDao.query(page, queryForm); + LocalDateTime now = LocalDateTime.now(); + list.forEach(e -> e.setPublishFlag(e.getPublishTime().isBefore(now))); + return SmartPageUtil.convert2PageResult(page, list); + } + + /** + * 添加 + * + * @param addForm + * @return + */ + public ResponseDTO add(NoticeAddForm addForm) { + // 校验并获取可见范围 + ResponseDTO validate = this.checkAndBuildVisibleRange(addForm); + if (!validate.getOk()) { + return ResponseDTO.error(validate); + } + + // build 资讯 + NoticeEntity noticeEntity = SmartBeanUtil.copy(addForm, NoticeEntity.class); + // 发布时间:不是定时发布时 默认为 当前 + if (!addForm.getScheduledPublishFlag()) { + noticeEntity.setPublishTime(LocalDateTime.now()); + } + // 保存数据 + noticeManager.save(noticeEntity, addForm.getVisibleRangeList()); + return ResponseDTO.ok(); + } + + /** + * 校验并返回可见范围 + * + * @param form + * @return + */ + private ResponseDTO checkAndBuildVisibleRange(NoticeAddForm form) { + // 校验资讯分类 + NoticeTypeVO noticeType = noticeTypeService.getByNoticeTypeId(form.getNoticeTypeId()); + if (noticeType == null) { + return ResponseDTO.userErrorParam("分类不存在"); + } + + if (form.getAllVisibleFlag()) { + return ResponseDTO.ok(); + } + + /** + * 校验可见范围 + * 非全部可见时 校验选择的员工|部门 + */ + List visibleRangeUpdateList = form.getVisibleRangeList(); + if (CollectionUtils.isEmpty(visibleRangeUpdateList)) { + return ResponseDTO.userErrorParam("未设置可见范围"); + } + + // 校验可见范围-> 员工 + List employeeIdList = visibleRangeUpdateList.stream() + .filter(e -> NoticeVisibleRangeDataTypeEnum.EMPLOYEE.equalsValue(e.getDataType())) + .map(NoticeVisibleRangeForm::getDataId) + .distinct().collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(employeeIdList)) { + employeeIdList = employeeIdList.stream().distinct().collect(Collectors.toList()); + List dbEmployeeIdList = employeeDao.selectBatchIds(employeeIdList).stream().map(EmployeeEntity::getEmployeeId).collect(Collectors.toList()); + Collection subtract = CollectionUtils.subtract(employeeIdList, dbEmployeeIdList); + if (subtract.size() > 0) { + return ResponseDTO.userErrorParam("员工id不存在:" + subtract); + } + } + + // 校验可见范围-> 部门 + List deptIdList = visibleRangeUpdateList.stream() + .filter(e -> NoticeVisibleRangeDataTypeEnum.DEPARTMENT.equalsValue(e.getDataType())) + .map(NoticeVisibleRangeForm::getDataId) + .distinct().collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(deptIdList)) { + deptIdList = deptIdList.stream().distinct().collect(Collectors.toList()); + List dbDeptIdList = departmentDao.selectBatchIds(deptIdList).stream().map(DepartmentEntity::getDepartmentId).collect(Collectors.toList()); + Collection subtract = CollectionUtils.subtract(deptIdList, dbDeptIdList); + if (subtract.size() > 0) { + return ResponseDTO.userErrorParam("部门id不存在:" + subtract); + } + } + return ResponseDTO.ok(); + } + + + /** + * 更新 + * + * @param updateForm + * @return + */ + public ResponseDTO update(NoticeUpdateForm updateForm) { + + NoticeEntity oldNoticeEntity = noticeDao.selectById(updateForm.getNoticeId()); + if (oldNoticeEntity == null) { + return ResponseDTO.userErrorParam("通知不存在"); + } + + // 校验并获取可见范围 + ResponseDTO res = this.checkAndBuildVisibleRange(updateForm); + if (!res.getOk()) { + return ResponseDTO.error(res); + } + + // 更新 + NoticeEntity noticeEntity = SmartBeanUtil.copy(updateForm, NoticeEntity.class); + noticeManager.update(oldNoticeEntity, noticeEntity, updateForm.getVisibleRangeList()); + return ResponseDTO.ok(); + } + + + /** + * 删除 + * + * @param noticeId + * @return + */ + public ResponseDTO delete(Long noticeId) { + NoticeEntity noticeEntity = noticeDao.selectById(noticeId); + if (null == noticeEntity || noticeEntity.getDeletedFlag()) { + return ResponseDTO.userErrorParam("通知公告不存在"); + } + // 更新删除状态 + noticeDao.updateDeletedFlag(noticeId); + dataTracerService.delete(noticeId, DataTracerTypeEnum.OA_NOTICE); + return ResponseDTO.ok(); + } + + /** + * 获取更新表单用的详情 + * + * @param noticeId + * @return + */ + public NoticeUpdateFormVO getUpdateFormVO(Long noticeId) { + NoticeEntity noticeEntity = noticeDao.selectById(noticeId); + if (null == noticeEntity) { + return null; + } + + NoticeUpdateFormVO updateFormVO = SmartBeanUtil.copy(noticeEntity, NoticeUpdateFormVO.class); + if (!updateFormVO.getAllVisibleFlag()) { + List noticeVisibleRangeList = noticeDao.queryVisibleRange(noticeId); + List employeeIdList = noticeVisibleRangeList.stream().filter(e -> NoticeVisibleRangeDataTypeEnum.EMPLOYEE.getValue().equals(e.getDataType())) + .map(NoticeVisibleRangeVO::getDataId) + .collect(Collectors.toList()); + + Map employeeMap = null; + if (CollectionUtils.isNotEmpty(employeeIdList)) { + employeeMap = employeeDao.selectBatchIds(employeeIdList).stream().collect(Collectors.toMap(EmployeeEntity::getEmployeeId, Function.identity())); + } else { + employeeMap = new HashMap<>(); + } + for (NoticeVisibleRangeVO noticeVisibleRange : noticeVisibleRangeList) { + if (noticeVisibleRange.getDataType().equals(NoticeVisibleRangeDataTypeEnum.EMPLOYEE.getValue())) { + EmployeeEntity employeeEntity = employeeMap.get(noticeVisibleRange.getDataId()); + noticeVisibleRange.setDataName(employeeEntity == null ? StringConst.EMPTY : employeeEntity.getActualName()); + } else { + DepartmentVO departmentVO = departmentService.getDepartmentById(noticeVisibleRange.getDataId()); + noticeVisibleRange.setDataName(departmentVO == null ? StringConst.EMPTY : departmentVO.getName()); + } + } + updateFormVO.setVisibleRangeList(noticeVisibleRangeList); + } + return updateFormVO; + } +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/service/NoticeTypeService.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/service/NoticeTypeService.java new file mode 100644 index 00000000..23da7364 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/service/NoticeTypeService.java @@ -0,0 +1,87 @@ +package net.lab1024.sa.admin.module.business.oa.notice.service; + +import cn.hutool.core.util.StrUtil; +import net.lab1024.sa.admin.module.business.oa.notice.dao.NoticeTypeDao; +import net.lab1024.sa.admin.module.business.oa.notice.domain.entity.NoticeTypeEntity; +import net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeTypeVO; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.util.SmartBeanUtil; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; + +/** + * 通知。公告 类型 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-12 21:40:39 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Service +public class NoticeTypeService { + + @Autowired + private NoticeTypeDao noticeTypeDao; + + /** + * 查询全部 + * @return + */ + public List getAll() { + return SmartBeanUtil.copyList(noticeTypeDao.selectList(null), NoticeTypeVO.class); + } + + public NoticeTypeVO getByNoticeTypeId(Long noticceTypeId) { + return SmartBeanUtil.copy(noticeTypeDao.selectById(noticceTypeId), NoticeTypeVO.class); + } + + public synchronized ResponseDTO add(String name) { + if (StrUtil.isBlank(name)) { + return ResponseDTO.userErrorParam("类型名称不能为空"); + } + + List noticeTypeEntityList = noticeTypeDao.selectList(null); + if (!CollectionUtils.isEmpty(noticeTypeEntityList)) { + boolean exist = noticeTypeEntityList.stream().map(NoticeTypeEntity::getNoticeTypeName).collect(Collectors.toSet()).contains(name); + if (exist) { + return ResponseDTO.userErrorParam("类型名称已经存在"); + } + } + noticeTypeDao.insert(NoticeTypeEntity.builder().noticeTypeName(name).build()); + return ResponseDTO.ok(); + } + + public synchronized ResponseDTO update(Long noticeTypeId, String name) { + if (StrUtil.isBlank(name)) { + return ResponseDTO.userErrorParam("类型名称不能为空"); + } + + NoticeTypeEntity noticeTypeEntity = noticeTypeDao.selectById(noticeTypeId); + if (noticeTypeEntity == null) { + return ResponseDTO.userErrorParam("类型名称不存在"); + } + + List noticeTypeEntityList = noticeTypeDao.selectList(null); + if (!CollectionUtils.isEmpty(noticeTypeEntityList)) { + Optional optionalNoticeTypeEntity = noticeTypeEntityList.stream().filter(e -> e.getNoticeTypeName().equals(name)).findFirst(); + if (optionalNoticeTypeEntity.isPresent() && !optionalNoticeTypeEntity.get().getNoticeTypeId().equals(noticeTypeId)) { + return ResponseDTO.userErrorParam("类型名称已经存在"); + } + } + noticeTypeEntity.setNoticeTypeName(name); + noticeTypeDao.updateById(noticeTypeEntity); + return ResponseDTO.ok(); + } + + public synchronized ResponseDTO delete(Long noticeTypeId) { + noticeTypeDao.deleteById(noticeTypeId); + return ResponseDTO.ok(); + } + +} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/anno/DataScope.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/DataScope.java similarity index 51% rename from smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/anno/DataScope.java rename to smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/DataScope.java index 1ab8061a..7ba28705 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/anno/DataScope.java +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/DataScope.java @@ -1,8 +1,9 @@ -package net.lab1024.smartadmin.common.anno; +package net.lab1024.sa.admin.module.system.datascope; -import net.lab1024.smartadmin.module.system.datascope.constant.DataScopeTypeEnum; -import net.lab1024.smartadmin.module.system.datascope.constant.DataScopeWhereInTypeEnum; -import net.lab1024.smartadmin.module.system.datascope.strategy.DataScopePowerStrategy; + +import net.lab1024.sa.admin.module.system.datascope.constant.DataScopeTypeEnum; +import net.lab1024.sa.admin.module.system.datascope.constant.DataScopeWhereInTypeEnum; +import net.lab1024.sa.admin.module.system.datascope.strategy.DataScopePowerStrategy; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; @@ -10,20 +11,19 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** - * [ 数据范围 ] + * 数据范围 * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - * @since JDK1.8 + * @Author 1024创新实验室: 罗伊 + * @Date 2022-03-18 20:59:17 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public @interface DataScope { - DataScopeTypeEnum dataScopeType() default DataScopeTypeEnum.DEFAULT; + DataScopeTypeEnum dataScopeType() ; DataScopeWhereInTypeEnum whereInType() default DataScopeWhereInTypeEnum.EMPLOYEE; @@ -33,6 +33,11 @@ public @interface DataScope { */ Class joinSqlImplClazz() default DataScopePowerStrategy.class; + /** + * 多个参数已逗号分隔,本属性主要用于joinSqlImplClazz 实现类跟进参数进行不同的范围控制,如不使用CUSTOM_STRATEGY,可不做配置 + * @return + */ + String paramName() default ""; /** * * 第几个where 条件 从0开始 diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/DataScopeController.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/DataScopeController.java new file mode 100644 index 00000000..4e143889 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/DataScopeController.java @@ -0,0 +1,41 @@ +package net.lab1024.sa.admin.module.system.datascope; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import net.lab1024.sa.admin.common.AdminBaseController; +import net.lab1024.sa.admin.constant.AdminSwaggerTagConst; +import net.lab1024.sa.admin.module.system.datascope.domain.DataScopeAndViewTypeVO; +import net.lab1024.sa.admin.module.system.datascope.service.DataScopeService; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.module.support.operatelog.annoation.OperateLog; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * 查询支持的数据范围类型 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022-03-18 20:59:17 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@OperateLog +@RestController +@Api(tags = {AdminSwaggerTagConst.System.SYSTEM_DATA_SCOPE}) +public class DataScopeController extends AdminBaseController { + + @Autowired + private DataScopeService dataScopeService; + + @ApiOperation(value = "获取当前系统所配置的所有数据范围 @author 罗伊") + @GetMapping("/dataScope/list") + public ResponseDTO> dataScopeList() { + return dataScopeService.dataScopeList(); + } + + +} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/MyBatisPlugin.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/MyBatisPlugin.java similarity index 68% rename from smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/MyBatisPlugin.java rename to smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/MyBatisPlugin.java index f9270b62..2c2f39d1 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/MyBatisPlugin.java +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/MyBatisPlugin.java @@ -1,49 +1,61 @@ -package net.lab1024.smartadmin.module.system.datascope; +package net.lab1024.sa.admin.module.system.datascope; -import net.lab1024.smartadmin.module.system.datascope.domain.dto.DataScopeSqlConfigDTO; -import net.lab1024.smartadmin.module.system.datascope.service.DataScopeSqlConfigService; -import net.lab1024.smartadmin.third.SmartApplicationContext; -import net.lab1024.smartadmin.util.SmartStringUtil; +import cn.hutool.core.util.StrUtil; +import com.google.common.collect.Maps; +import net.lab1024.sa.admin.module.system.datascope.domain.DataScopeSqlConfig; +import net.lab1024.sa.admin.module.system.datascope.service.DataScopeSqlConfigService; +import net.lab1024.sa.common.common.domain.DataScopePlugin; import org.apache.commons.lang3.StringUtils; import org.apache.ibatis.mapping.*; -import org.apache.ibatis.plugin.*; +import org.apache.ibatis.plugin.Intercepts; +import org.apache.ibatis.plugin.Invocation; +import org.apache.ibatis.plugin.Plugin; +import org.apache.ibatis.plugin.Signature; import org.apache.ibatis.session.ResultHandler; import org.apache.ibatis.session.RowBounds; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationContext; import org.springframework.stereotype.Component; import java.util.List; +import java.util.Map; import java.util.Properties; /** - * [ mybaits sql 拦截 ] + * mybaits sql 拦截 * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - * @since JDK1.8 + * @Author 1024创新实验室: 罗伊 + * @Date 2022-03-18 20:59:17 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) */ @Intercepts({@Signature(type = org.apache.ibatis.executor.Executor.class, method = "query", args = {MappedStatement.class, Object.class, RowBounds.class, ResultHandler.class})}) @Component -public class MyBatisPlugin implements Interceptor { +public class MyBatisPlugin extends DataScopePlugin { + + @Autowired + private ApplicationContext applicationContext; @Override public Object intercept(Invocation invocation) throws Throwable { + MappedStatement mappedStatement = (MappedStatement) invocation.getArgs()[0]; Object parameter = invocation.getArgs()[1]; + BoundSql boundSql = mappedStatement.getBoundSql(parameter); String originalSql = boundSql.getSql().trim(); String id = mappedStatement.getId(); - List methodStrList = SmartStringUtil.splitConvertToList(id, "\\."); + List methodStrList = StrUtil.split(id, "."); String path = methodStrList.get(methodStrList.size() - 2) + "." + methodStrList.get(methodStrList.size() - 1); DataScopeSqlConfigService dataScopeSqlConfigService = this.dataScopeSqlConfigService(); if (dataScopeSqlConfigService == null) { return invocation.proceed(); } - DataScopeSqlConfigDTO sqlConfigDTO = dataScopeSqlConfigService.getSqlConfig(path); + DataScopeSqlConfig sqlConfigDTO = dataScopeSqlConfigService.getSqlConfig(path); if (sqlConfigDTO != null) { - BoundSql newBoundSql = copyFromBoundSql(mappedStatement, boundSql, this.joinSql(originalSql, sqlConfigDTO)); + Map paramMap = this.getParamList(sqlConfigDTO.getParamName(), parameter); + BoundSql newBoundSql = copyFromBoundSql(mappedStatement, boundSql, this.joinSql(originalSql, paramMap, sqlConfigDTO)); ParameterMap map = mappedStatement.getParameterMap(); MappedStatement newMs = copyFromMappedStatement(mappedStatement, new BoundSqlSqlSource(newBoundSql), map); invocation.getArgs()[0] = newMs; @@ -53,11 +65,32 @@ public class MyBatisPlugin implements Interceptor { return obj; } - private String joinSql(String sql, DataScopeSqlConfigDTO sqlConfigDTO) { + + private Map getParamList(String paramName, Object parameter) { + Map paramMap = Maps.newHashMap(); + if (StringUtils.isEmpty(paramName)) { + return paramMap; + } + if (parameter == null) { + return paramMap; + } + if (parameter instanceof Map) { + String[] paramNameArray = paramName.split(","); + Map parameterMap = (Map) parameter; + for (String param : paramNameArray) { + if(parameterMap.containsKey(param)){ + paramMap.put(param, parameterMap.get(param)); + } + } + } + return paramMap; + } + + private String joinSql(String sql, Map paramMap, DataScopeSqlConfig sqlConfigDTO) { if (null == sqlConfigDTO) { return sql; } - String appendSql = this.dataScopeSqlConfigService().getJoinSql(sqlConfigDTO); + String appendSql = this.dataScopeSqlConfigService().getJoinSql(paramMap, sqlConfigDTO); if (StringUtils.isEmpty(appendSql)) { return sql; } @@ -68,18 +101,18 @@ public class MyBatisPlugin implements Interceptor { int whereIndex = StringUtils.ordinalIndexOf(sql.toLowerCase(), where, appendSqlWhereIndex + 1); int orderIndex = sql.toLowerCase().indexOf(order); int groupIndex = sql.toLowerCase().indexOf(group); - if (whereIndex > - 1) { + if (whereIndex > -1) { String subSql = sql.substring(0, whereIndex + where.length() + 1); subSql = subSql + " " + appendSql + " AND " + sql.substring(whereIndex + where.length() + 1); return subSql; } - if (groupIndex > - 1) { + if (groupIndex > -1) { String subSql = sql.substring(0, groupIndex); subSql = subSql + " where " + appendSql + " " + sql.substring(groupIndex); return subSql; } - if (orderIndex > - 1) { + if (orderIndex > -1) { String subSql = sql.substring(0, orderIndex); subSql = subSql + " where " + appendSql + " " + sql.substring(orderIndex); return subSql; @@ -89,7 +122,7 @@ public class MyBatisPlugin implements Interceptor { } public DataScopeSqlConfigService dataScopeSqlConfigService() { - return (DataScopeSqlConfigService) SmartApplicationContext.getBean("dataScopeSqlConfigService"); + return (DataScopeSqlConfigService) applicationContext.getBean("dataScopeSqlConfigService"); } public class BoundSqlSqlSource implements SqlSource { @@ -99,6 +132,7 @@ public class MyBatisPlugin implements Interceptor { public BoundSqlSqlSource(BoundSql boundSql) { this.boundSql = boundSql; } + @Override public BoundSql getBoundSql(Object parameterObject) { return boundSql; diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/constant/DataScopeTypeEnum.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/constant/DataScopeTypeEnum.java similarity index 52% rename from smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/constant/DataScopeTypeEnum.java rename to smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/constant/DataScopeTypeEnum.java index 66ebb8f9..9130631a 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/constant/DataScopeTypeEnum.java +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/constant/DataScopeTypeEnum.java @@ -1,28 +1,33 @@ -package net.lab1024.smartadmin.module.system.datascope.constant; +package net.lab1024.sa.admin.module.system.datascope.constant; - -import net.lab1024.smartadmin.common.domain.BaseEnum; +import net.lab1024.sa.common.common.enumeration.BaseEnum; /** - * [ ] + * 数据范围 类型 * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/4/28 0028 下午 15:37 - * @since JDK1.8 + * @Author 1024创新实验室: 罗伊 + * @Date 2020/11/28 20:59:17 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) */ public enum DataScopeTypeEnum implements BaseEnum { - DEFAULT(0,0,"默认类型","数据范围样例"); + /** + * 系统通知 + */ + NOTICE(1, 20, "系统通知", "系统通知数据范围"), + ; private Integer value; + private Integer sort; + private String name; + private String desc; - DataScopeTypeEnum(Integer value,Integer sort,String name,String desc) { + DataScopeTypeEnum(Integer value, Integer sort, String name, String desc) { this.value = value; this.sort = sort; this.name = name; diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/constant/DataScopeViewTypeEnum.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/constant/DataScopeViewTypeEnum.java new file mode 100644 index 00000000..1ef69302 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/constant/DataScopeViewTypeEnum.java @@ -0,0 +1,53 @@ +package net.lab1024.sa.admin.module.system.datascope.constant; + + +import net.lab1024.sa.common.common.enumeration.BaseEnum; + + +/** + * 数据范围 种类 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2020/11/28 20:59:17 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public enum DataScopeViewTypeEnum implements BaseEnum { + + ME(0, 0, "本人"), + + DEPARTMENT(1, 5, "本部门"), + + DEPARTMENT_AND_SUB(2, 10, "本部门及下属子部门"), + + ALL(10, 100, "全部"); + + + + private Integer value; + private Integer level; + private String desc; + + DataScopeViewTypeEnum(Integer value, Integer level, String desc) { + this.value = value; + this.level = level; + this.desc = desc; + } + + @Override + public Integer getValue() { + return value; + } + + public Integer getLevel() { + return level; + } + + @Override + public String getDesc() { + return desc; + } + + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/constant/DataScopeWhereInTypeEnum.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/constant/DataScopeWhereInTypeEnum.java new file mode 100644 index 00000000..dd9293d5 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/constant/DataScopeWhereInTypeEnum.java @@ -0,0 +1,42 @@ +package net.lab1024.sa.admin.module.system.datascope.constant; + + +import net.lab1024.sa.common.common.enumeration.BaseEnum; + +/** + * 数据范围 sql where + * + * @Author 1024创新实验室: 罗伊 + * @Date 2020/11/28 20:59:17 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public enum DataScopeWhereInTypeEnum implements BaseEnum { + + EMPLOYEE(0, "以员工IN"), + + DEPARTMENT(1, "以部门IN"), + + CUSTOM_STRATEGY(2, "自定义策略"); + + private Integer value; + private String desc; + + DataScopeWhereInTypeEnum(Integer value, String desc) { + this.value = value; + this.desc = desc; + } + + @Override + public Integer getValue() { + return value; + } + + @Override + public String getDesc() { + return desc; + } + + +} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/domain/dto/DataScopeAndViewTypeVO.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/domain/DataScopeAndViewTypeVO.java similarity index 68% rename from smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/domain/dto/DataScopeAndViewTypeVO.java rename to smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/domain/DataScopeAndViewTypeVO.java index 1412be57..51bd3f57 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/domain/dto/DataScopeAndViewTypeVO.java +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/domain/DataScopeAndViewTypeVO.java @@ -1,4 +1,4 @@ -package net.lab1024.smartadmin.module.system.datascope.domain.dto; +package net.lab1024.sa.admin.module.system.datascope.domain; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -6,14 +6,13 @@ import lombok.Data; import java.util.List; /** - * [ ] + * 数据范围 * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/4/27 0027 下午 16:37 - * @since JDK1.8 + * @Author 1024创新实验室: 罗伊 + * @Date 2020/11/28 20:59:17 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) */ @Data public class DataScopeAndViewTypeVO { diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/domain/dto/DataScopeDTO.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/domain/DataScopeDTO.java similarity index 64% rename from smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/domain/dto/DataScopeDTO.java rename to smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/domain/DataScopeDTO.java index 629679bf..01919e95 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/domain/dto/DataScopeDTO.java +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/domain/DataScopeDTO.java @@ -1,18 +1,17 @@ -package net.lab1024.smartadmin.module.system.datascope.domain.dto; +package net.lab1024.sa.admin.module.system.datascope.domain; import io.swagger.annotations.ApiModelProperty; import lombok.Builder; import lombok.Data; /** - * [ ] + * 数据范围 * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/4/27 0027 下午 16:37 - * @since JDK1.8 + * @Author 1024创新实验室: 罗伊 + * @Date 2020/11/28 20:59:17 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) */ @Data @Builder diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/domain/DataScopeSqlConfig.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/domain/DataScopeSqlConfig.java new file mode 100644 index 00000000..63686b3b --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/domain/DataScopeSqlConfig.java @@ -0,0 +1,41 @@ +package net.lab1024.sa.admin.module.system.datascope.domain; + +import lombok.Data; +import net.lab1024.sa.admin.module.system.datascope.constant.DataScopeTypeEnum; +import net.lab1024.sa.admin.module.system.datascope.constant.DataScopeWhereInTypeEnum; + +/** + * 数据范围 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2020/11/28 20:59:17 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class DataScopeSqlConfig { + + /** + * 数据范围类型 + * {@link DataScopeTypeEnum} + */ + private DataScopeTypeEnum dataScopeType; + + /** + * join sql 具体实现类 + */ + private Class joinSqlImplClazz; + + private String joinSql; + + private Integer whereIndex; + + private String paramName; + + /** + * whereIn类型 + * {@link DataScopeWhereInTypeEnum} + */ + private DataScopeWhereInTypeEnum dataScopeWhereInType; +} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/domain/dto/DataScopeViewTypeVO.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/domain/DataScopeViewTypeVO.java similarity index 60% rename from smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/domain/dto/DataScopeViewTypeVO.java rename to smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/domain/DataScopeViewTypeVO.java index 853a514f..22231d22 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/domain/dto/DataScopeViewTypeVO.java +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/domain/DataScopeViewTypeVO.java @@ -1,18 +1,17 @@ -package net.lab1024.smartadmin.module.system.datascope.domain.dto; +package net.lab1024.sa.admin.module.system.datascope.domain; import io.swagger.annotations.ApiModelProperty; import lombok.Builder; import lombok.Data; /** - * [ ] + * 数据范围 * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/4/28 0028 下午 15:41 - * @since JDK1.8 + * @Author 1024创新实验室: 罗伊 + * @Date 2020/11/28 20:59:17 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) */ @Data @Builder @@ -20,6 +19,7 @@ public class DataScopeViewTypeVO { @ApiModelProperty("可见范围") private Integer viewType; + @ApiModelProperty("可见范围名称") private String viewTypeName; diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/service/DataScopeService.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/service/DataScopeService.java new file mode 100644 index 00000000..7353706e --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/service/DataScopeService.java @@ -0,0 +1,75 @@ +package net.lab1024.sa.admin.module.system.datascope.service; + +import com.google.common.collect.Lists; +import net.lab1024.sa.admin.module.system.datascope.constant.DataScopeTypeEnum; +import net.lab1024.sa.admin.module.system.datascope.constant.DataScopeViewTypeEnum; +import net.lab1024.sa.admin.module.system.datascope.domain.DataScopeAndViewTypeVO; +import net.lab1024.sa.admin.module.system.datascope.domain.DataScopeDTO; +import net.lab1024.sa.admin.module.system.datascope.domain.DataScopeViewTypeVO; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.util.SmartBeanUtil; +import org.springframework.stereotype.Service; + +import java.util.Comparator; +import java.util.List; + +/** + * 数据范围 保存 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2020/11/28 20:59:17 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Service +public class DataScopeService { + + /** + * 获取所有可以进行数据范围配置的信息 + * + * @return + */ + public ResponseDTO> dataScopeList() { + List dataScopeList = this.getDataScopeType(); + List dataScopeAndTypeList = SmartBeanUtil.copyList(dataScopeList, DataScopeAndViewTypeVO.class); + List typeList = this.getViewType(); + dataScopeAndTypeList.forEach(e -> { + e.setViewTypeList(typeList); + }); + return ResponseDTO.ok(dataScopeAndTypeList); + } + + /** + * 获取当前系统存在的数据可见范围 + * + * @return + */ + public List getViewType() { + List viewTypeList = Lists.newArrayList(); + DataScopeViewTypeEnum[] enums = DataScopeViewTypeEnum.class.getEnumConstants(); + DataScopeViewTypeVO dataScopeViewTypeDTO; + for (DataScopeViewTypeEnum viewTypeEnum : enums) { + dataScopeViewTypeDTO = DataScopeViewTypeVO.builder().viewType(viewTypeEnum.getValue()).viewTypeLevel(viewTypeEnum.getLevel()).viewTypeName(viewTypeEnum.getDesc()).build(); + viewTypeList.add(dataScopeViewTypeDTO); + } + Comparator comparator = (h1, h2) -> h1.getViewTypeLevel().compareTo(h2.getViewTypeLevel()); + viewTypeList.sort(comparator); + return viewTypeList; + } + + public List getDataScopeType() { + List dataScopeTypeList = Lists.newArrayList(); + DataScopeTypeEnum[] enums = DataScopeTypeEnum.class.getEnumConstants(); + DataScopeDTO dataScopeDTO; + for (DataScopeTypeEnum typeEnum : enums) { + dataScopeDTO = + DataScopeDTO.builder().dataScopeType(typeEnum.getValue()).dataScopeTypeDesc(typeEnum.getDesc()).dataScopeTypeName(typeEnum.getName()).dataScopeTypeSort(typeEnum.getSort()).build(); + dataScopeTypeList.add(dataScopeDTO); + } + Comparator comparator = (h1, h2) -> h1.getDataScopeTypeSort().compareTo(h2.getDataScopeTypeSort()); + dataScopeTypeList.sort(comparator); + return dataScopeTypeList; + } + +} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/service/DataScopeSqlConfigService.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/service/DataScopeSqlConfigService.java similarity index 67% rename from smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/service/DataScopeSqlConfigService.java rename to smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/service/DataScopeSqlConfigService.java index 30381384..fc98e24b 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/service/DataScopeSqlConfigService.java +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/service/DataScopeSqlConfigService.java @@ -1,16 +1,14 @@ -package net.lab1024.smartadmin.module.system.datascope.service; +package net.lab1024.sa.admin.module.system.datascope.service; import lombok.extern.slf4j.Slf4j; -import net.lab1024.smartadmin.common.anno.DataScope; -import net.lab1024.smartadmin.module.system.datascope.constant.DataScopeTypeEnum; -import net.lab1024.smartadmin.module.system.datascope.constant.DataScopeViewTypeEnum; -import net.lab1024.smartadmin.module.system.datascope.constant.DataScopeWhereInTypeEnum; -import net.lab1024.smartadmin.module.system.datascope.domain.dto.DataScopeSqlConfigDTO; -import net.lab1024.smartadmin.module.system.datascope.strategy.DataScopePowerStrategy; -import net.lab1024.smartadmin.module.system.login.domain.RequestTokenBO; -import net.lab1024.smartadmin.third.SmartApplicationContext; -import net.lab1024.smartadmin.util.SmartRequestTokenUtil; -import org.apache.commons.collections.CollectionUtils; +import net.lab1024.sa.admin.module.system.datascope.constant.DataScopeTypeEnum; +import net.lab1024.sa.admin.module.system.datascope.constant.DataScopeViewTypeEnum; +import net.lab1024.sa.admin.module.system.datascope.constant.DataScopeWhereInTypeEnum; +import net.lab1024.sa.admin.module.system.datascope.domain.DataScopeSqlConfig; +import net.lab1024.sa.admin.module.system.datascope.DataScope; +import net.lab1024.sa.admin.module.system.datascope.strategy.DataScopePowerStrategy; +import net.lab1024.sa.common.common.util.SmartRequestUtil; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.reflections.Reflections; import org.reflections.scanners.MethodAnnotationsScanner; @@ -18,6 +16,7 @@ import org.reflections.util.ClasspathHelper; import org.reflections.util.ConfigurationBuilder; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.ApplicationContext; import org.springframework.stereotype.Service; import javax.annotation.PostConstruct; @@ -28,27 +27,18 @@ import java.util.Set; import java.util.concurrent.ConcurrentHashMap; /** - * [ ] + * sql配置 * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/4/29 0029 上午 10:12 - * @since JDK1.8 + * @Author 1024创新实验室: 罗伊 + * @Date 2020/11/28 20:59:17 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) */ @Slf4j @Service public class DataScopeSqlConfigService { - private ConcurrentHashMap dataScopeMethodMap = new ConcurrentHashMap<>(); - - @Autowired - private DataScopeViewService dataScopeViewService; - - @Value("${swagger.packAge}") - private String scanPackage; - /** * 注解joinsql 参数 */ @@ -56,6 +46,19 @@ public class DataScopeSqlConfigService { private static final String DEPARTMENT_PARAM = "#departmentIds"; + private ConcurrentHashMap dataScopeMethodMap = new ConcurrentHashMap<>(); + + @Autowired + private DataScopeViewService dataScopeViewService; + + @Value("${swagger.package}") + private String scanPackage; + + + @Autowired + private ApplicationContext applicationContext; + + @PostConstruct private void initDataScopeMethodMap() { this.refreshDataScopeMethodMap(); @@ -66,17 +69,19 @@ public class DataScopeSqlConfigService { * * @return */ - private Map refreshDataScopeMethodMap() { + private Map refreshDataScopeMethodMap() { Reflections reflections = new Reflections(new ConfigurationBuilder().setUrls(ClasspathHelper.forPackage(scanPackage)).setScanners(new MethodAnnotationsScanner())); Set methods = reflections.getMethodsAnnotatedWith(DataScope.class); for (Method method : methods) { DataScope dataScopeAnnotation = method.getAnnotation(DataScope.class); if (dataScopeAnnotation != null) { - DataScopeSqlConfigDTO configDTO = new DataScopeSqlConfigDTO(); + DataScopeSqlConfig configDTO = new DataScopeSqlConfig(); configDTO.setDataScopeType(dataScopeAnnotation.dataScopeType()); configDTO.setJoinSql(dataScopeAnnotation.joinSql()); configDTO.setWhereIndex(dataScopeAnnotation.whereIndex()); configDTO.setDataScopeWhereInType(dataScopeAnnotation.whereInType()); + configDTO.setParamName(dataScopeAnnotation.paramName()); + configDTO.setJoinSqlImplClazz(dataScopeAnnotation.joinSqlImplClazz()); dataScopeMethodMap.put(method.getDeclaringClass().getSimpleName() + "." + method.getName(), configDTO); } } @@ -89,35 +94,37 @@ public class DataScopeSqlConfigService { * @param method * @return */ - public DataScopeSqlConfigDTO getSqlConfig(String method) { - DataScopeSqlConfigDTO sqlConfigDTO = this.dataScopeMethodMap.get(method); + public DataScopeSqlConfig getSqlConfig(String method) { + DataScopeSqlConfig sqlConfigDTO = this.dataScopeMethodMap.get(method); return sqlConfigDTO; } /** * 组装需要拼接的sql - * + * @param paramMap * @param sqlConfigDTO * @return */ - public String getJoinSql(DataScopeSqlConfigDTO sqlConfigDTO) { + public String getJoinSql(Map paramMap, DataScopeSqlConfig sqlConfigDTO) { DataScopeTypeEnum dataScopeTypeEnum = sqlConfigDTO.getDataScopeType(); String joinSql = sqlConfigDTO.getJoinSql(); - RequestTokenBO requestToken = SmartRequestTokenUtil.getThreadLocalUser(); - Long employeeId = requestToken.getRequestUserId(); + Long employeeId = SmartRequestUtil.getRequestUserId(); + if (employeeId == null) { + return ""; + } if (DataScopeWhereInTypeEnum.CUSTOM_STRATEGY == sqlConfigDTO.getDataScopeWhereInType()) { Class strategyClass = sqlConfigDTO.getJoinSqlImplClazz(); - if(strategyClass == null){ + if (strategyClass == null) { log.warn("data scope custom strategy class is null"); return ""; } - DataScopePowerStrategy powerStrategy = (DataScopePowerStrategy)SmartApplicationContext.getBean(sqlConfigDTO.getJoinSqlImplClazz()); + DataScopePowerStrategy powerStrategy = (DataScopePowerStrategy) applicationContext.getBean(sqlConfigDTO.getJoinSqlImplClazz()); if (powerStrategy == null) { - log.warn("data scope custom strategy class:{} ,bean is null",sqlConfigDTO.getJoinSqlImplClazz()); + log.warn("data scope custom strategy class:{} ,bean is null", sqlConfigDTO.getJoinSqlImplClazz()); return ""; } DataScopeViewTypeEnum viewTypeEnum = dataScopeViewService.getEmployeeDataScopeViewType(dataScopeTypeEnum, employeeId); - return powerStrategy.getCondition(viewTypeEnum,sqlConfigDTO); + return powerStrategy.getCondition(viewTypeEnum,paramMap, sqlConfigDTO); } if (DataScopeWhereInTypeEnum.EMPLOYEE == sqlConfigDTO.getDataScopeWhereInType()) { List canViewEmployeeIds = dataScopeViewService.getCanViewEmployeeId(dataScopeTypeEnum, employeeId); diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/service/DataScopeViewService.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/service/DataScopeViewService.java similarity index 56% rename from smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/service/DataScopeViewService.java rename to smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/service/DataScopeViewService.java index 11ec5bc7..6ec1c408 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/service/DataScopeViewService.java +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/service/DataScopeViewService.java @@ -1,19 +1,16 @@ -package net.lab1024.smartadmin.module.system.datascope.service; +package net.lab1024.sa.admin.module.system.datascope.service; import com.google.common.collect.Lists; -import net.lab1024.smartadmin.module.system.datascope.DataScopeRoleDao; -import net.lab1024.smartadmin.module.system.datascope.constant.DataScopeTypeEnum; -import net.lab1024.smartadmin.module.system.datascope.constant.DataScopeViewTypeEnum; -import net.lab1024.smartadmin.module.system.datascope.domain.entity.DataScopeRoleEntity; -import net.lab1024.smartadmin.module.system.department.DepartmentTreeService; -import net.lab1024.smartadmin.module.system.employee.EmployeeDao; -import net.lab1024.smartadmin.module.system.employee.domain.dto.EmployeeDTO; -import net.lab1024.smartadmin.module.system.employee.domain.entity.EmployeeEntity; -import net.lab1024.smartadmin.module.system.employee.domain.vo.EmployeeVO; -import net.lab1024.smartadmin.module.system.privilege.service.PrivilegeEmployeeService; -import net.lab1024.smartadmin.module.system.role.roleemployee.RoleEmployeeDao; -import net.lab1024.smartadmin.util.SmartBaseEnumUtil; -import org.apache.commons.collections.CollectionUtils; +import net.lab1024.sa.admin.module.system.datascope.constant.DataScopeTypeEnum; +import net.lab1024.sa.admin.module.system.department.service.DepartmentService; +import net.lab1024.sa.admin.module.system.employee.dao.EmployeeDao; +import net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity; +import net.lab1024.sa.admin.module.system.role.dao.RoleDataScopeDao; +import net.lab1024.sa.admin.module.system.role.dao.RoleEmployeeDao; +import net.lab1024.sa.admin.module.system.role.domain.entity.RoleDataScopeEntity; +import net.lab1024.sa.admin.module.system.datascope.constant.DataScopeViewTypeEnum; +import net.lab1024.sa.common.common.util.SmartEnumUtil; +import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -23,14 +20,13 @@ import java.util.Map; import java.util.stream.Collectors; /** - * [ ] + * 数据范围 * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/4/28 0028 下午 15:56 - * @since JDK1.8 + * @Author 1024创新实验室: 罗伊 + * @Date 2020/11/28 20:59:17 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) */ @Service public class DataScopeViewService { @@ -39,16 +35,13 @@ public class DataScopeViewService { private RoleEmployeeDao roleEmployeeDao; @Autowired - private DataScopeRoleDao dataScopeRoleDao; - - @Autowired - private DepartmentTreeService departmentTreeService; + private RoleDataScopeDao roleDataScopeDao; @Autowired private EmployeeDao employeeDao; @Autowired - private PrivilegeEmployeeService privilegeEmployeeService; + private DepartmentService departmentService; /** * 获取某人可以查看的所有人员信息 @@ -92,15 +85,14 @@ public class DataScopeViewService { return Lists.newArrayList(); } - private List getMeDepartmentIdList(Long employeeId) { + public List getMeDepartmentIdList(Long employeeId) { EmployeeEntity employeeEntity = employeeDao.selectById(employeeId); return Lists.newArrayList(employeeEntity.getDepartmentId()); } - private List getDepartmentAndSubIdList(Long employeeId) { + public List getDepartmentAndSubIdList(Long employeeId) { EmployeeEntity employeeEntity = employeeDao.selectById(employeeId); - List allDepartmentIds = Lists.newArrayList(); - departmentTreeService.buildIdList(employeeEntity.getDepartmentId(), allDepartmentIds); + List allDepartmentIds = departmentService.selfAndChildrenIdList(employeeEntity.getDepartmentId()); return allDepartmentIds; } @@ -115,23 +107,23 @@ public class DataScopeViewService { return DataScopeViewTypeEnum.ME; } - if (privilegeEmployeeService.isSuperman(employeeId)) { - return DataScopeViewTypeEnum.ALL; - } List roleIdList = roleEmployeeDao.selectRoleIdByEmployeeId(employeeId); //未设置角色 默认本人 if (CollectionUtils.isEmpty(roleIdList)) { return DataScopeViewTypeEnum.ME; } //未设置角色数据范围 默认本人 - List dataScopeRoleList = dataScopeRoleDao.listByRoleIdList(roleIdList); + List dataScopeRoleList = roleDataScopeDao.listByRoleIdList(roleIdList); if (CollectionUtils.isEmpty(dataScopeRoleList)) { return DataScopeViewTypeEnum.ME; } - Map> listMap = dataScopeRoleList.stream().collect(Collectors.groupingBy(DataScopeRoleEntity::getDataScopeType)); - List viewLevelList = listMap.get(dataScopeTypeEnum.getValue()); - DataScopeRoleEntity maxLevel = viewLevelList.stream().max(Comparator.comparing(e -> SmartBaseEnumUtil.getEnumByValue(e.getViewType(), DataScopeViewTypeEnum.class).getLevel())).get(); - return SmartBaseEnumUtil.getEnumByValue(maxLevel.getViewType(), DataScopeViewTypeEnum.class); + Map> listMap = dataScopeRoleList.stream().collect(Collectors.groupingBy(RoleDataScopeEntity::getDataScopeType)); + List viewLevelList = listMap.getOrDefault(dataScopeTypeEnum.getValue(), Lists.newArrayList()); + if (CollectionUtils.isEmpty(viewLevelList)) { + return DataScopeViewTypeEnum.ME; + } + RoleDataScopeEntity maxLevel = viewLevelList.stream().max(Comparator.comparing(e -> SmartEnumUtil.getEnumByValue(e.getViewType(), DataScopeViewTypeEnum.class).getLevel())).get(); + return SmartEnumUtil.getEnumByValue(maxLevel.getViewType(), DataScopeViewTypeEnum.class); } /** @@ -152,8 +144,7 @@ public class DataScopeViewService { */ private List getDepartmentEmployeeIdList(Long employeeId) { EmployeeEntity employeeEntity = employeeDao.selectById(employeeId); - List employeeList = employeeDao.getEmployeeIdByDeptId(employeeEntity.getDepartmentId()); - List employeeIdList = employeeList.stream().map(e -> e.getId()).collect(Collectors.toList()); + List employeeIdList = employeeDao.getEmployeeIdByDepartmentId(employeeEntity.getDepartmentId(), false); return employeeIdList; } @@ -164,12 +155,8 @@ public class DataScopeViewService { * @return */ private List getDepartmentAndSubEmployeeIdList(Long employeeId) { - EmployeeEntity employeeEntity = employeeDao.selectById(employeeId); - List allDepartmentIds = Lists.newArrayList(); - departmentTreeService.buildIdList(employeeEntity.getDepartmentId(), allDepartmentIds); - List employeeList = employeeDao.getEmployeeIdByDeptIds(allDepartmentIds); - List employeeIdList = employeeList.stream().map(e -> e.getId()).collect(Collectors.toList()); + List allDepartmentIds = getDepartmentAndSubIdList(employeeId); + List employeeIdList = employeeDao.getEmployeeIdByDepartmentIdList(allDepartmentIds, false); return employeeIdList; } - } diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/strategy/DataScopePowerStrategy.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/strategy/DataScopePowerStrategy.java new file mode 100644 index 00000000..4611fd57 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/strategy/DataScopePowerStrategy.java @@ -0,0 +1,27 @@ +package net.lab1024.sa.admin.module.system.datascope.strategy; + +import net.lab1024.sa.admin.module.system.datascope.constant.DataScopeViewTypeEnum; +import net.lab1024.sa.admin.module.system.datascope.domain.DataScopeSqlConfig; + +import java.util.Map; + +/** + * 数据范围策略 ,使用DataScopeWhereInTypeEnum.CUSTOM_STRATEGY类型,DataScope注解的joinSql属性无用 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2020/11/28 20:59:17 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public abstract class DataScopePowerStrategy { + + /** + * 获取joinsql 字符串 + * @param viewTypeEnum + * @param paramMap + * @param sqlConfigDTO + * @return + */ + public abstract String getCondition(DataScopeViewTypeEnum viewTypeEnum, Map paramMap, DataScopeSqlConfig sqlConfigDTO); +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/controller/DepartmentController.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/controller/DepartmentController.java new file mode 100644 index 00000000..62e2fe33 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/controller/DepartmentController.java @@ -0,0 +1,71 @@ +package net.lab1024.sa.admin.module.system.department.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import net.lab1024.sa.admin.common.AdminBaseController; +import net.lab1024.sa.admin.constant.AdminSwaggerTagConst; +import net.lab1024.sa.admin.module.system.department.domain.form.DepartmentAddForm; +import net.lab1024.sa.admin.module.system.department.domain.form.DepartmentUpdateForm; +import net.lab1024.sa.admin.module.system.department.domain.vo.DepartmentTreeVO; +import net.lab1024.sa.admin.module.system.department.domain.vo.DepartmentVO; +import net.lab1024.sa.admin.module.system.department.service.DepartmentService; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.module.support.operatelog.annoation.OperateLog; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + +/** + * 部门 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-01-12 20:37:48 + * @Wechat 卓大1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@OperateLog +@RestController +@Api(tags = {AdminSwaggerTagConst.System.SYSTEM_DEPARTMENT}) +public class DepartmentController extends AdminBaseController { + + @Autowired + private DepartmentService departmentService; + + @ApiOperation(value = "查询部门树形列表 @author 卓大") + @GetMapping("/department/treeList") + public ResponseDTO> departmentTree() { + return departmentService.departmentTree(); + } + + @ApiOperation(value = "添加部门 @author 卓大") + @PostMapping("/department/add") + @PreAuthorize("@saAuth.checkPermission('system:department:add')") + public ResponseDTO addDepartment(@Valid @RequestBody DepartmentAddForm createDTO) { + return departmentService.addDepartment(createDTO); + } + + @ApiOperation(value = "更新部门 @author 卓大") + @PostMapping("/department/update") + @PreAuthorize("@saAuth.checkPermission('system:department:update')") + public ResponseDTO updateDepartment(@Valid @RequestBody DepartmentUpdateForm updateDTO) { + return departmentService.updateDepartment(updateDTO); + } + + @ApiOperation(value = "删除部门 @author 卓大") + @GetMapping("/department/delete/{departmentId}") + @PreAuthorize("@saAuth.checkPermission('system:department:delete')") + public ResponseDTO deleteDepartment(@PathVariable Long departmentId) { + return departmentService.deleteDepartment(departmentId); + } + + @ApiOperation(value = "查询部门列表 @author 卓大") + @GetMapping("/department/listAll") + public ResponseDTO> listAll() { + return ResponseDTO.ok(departmentService.listAll()); + } + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/dao/DepartmentDao.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/dao/DepartmentDao.java new file mode 100644 index 00000000..25c395ca --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/dao/DepartmentDao.java @@ -0,0 +1,40 @@ +package net.lab1024.sa.admin.module.system.department.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import net.lab1024.sa.admin.module.system.department.domain.entity.DepartmentEntity; +import net.lab1024.sa.admin.module.system.department.domain.vo.DepartmentVO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * 部门 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-01-12 20:37:48 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Component +@Mapper +public interface DepartmentDao extends BaseMapper { + + /** + * 根据部门id,查询此部门直接子部门的数量 + * + * @param departmentId + * @return int 子部门的数量 + */ + Integer countSubDepartment(@Param("departmentId") Long departmentId); + + /** + * 获取全部部门列表 + * + * @return + */ + List listAll(); + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/entity/DepartmentEntity.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/entity/DepartmentEntity.java new file mode 100644 index 00000000..28f9431b --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/entity/DepartmentEntity.java @@ -0,0 +1,62 @@ +package net.lab1024.sa.admin.module.system.department.domain.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * 部门实体类 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-01-12 20:37:48 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +@TableName(value = "t_department") +public class DepartmentEntity { + + /** + * 主键id + */ + @TableId(type = IdType.AUTO) + private Long departmentId; + + /** + * 部门名称 + */ + private String name; + + /** + * 负责人员工 id + */ + private Long managerId; + + /** + * 部门父级id + */ + private Long parentId; + + /** + * 排序 + */ + private Integer sort; + + + /** + * 更新时间 + */ + private LocalDateTime updateTime; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + + +} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/department/domain/dto/DepartmentCreateDTO.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/form/DepartmentAddForm.java similarity index 58% rename from smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/department/domain/dto/DepartmentCreateDTO.java rename to smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/form/DepartmentAddForm.java index 3e80003c..4a10c4c5 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/department/domain/dto/DepartmentCreateDTO.java +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/form/DepartmentAddForm.java @@ -1,4 +1,4 @@ -package net.lab1024.smartadmin.module.system.department.domain.dto; +package net.lab1024.sa.admin.module.system.department.domain.form; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -7,27 +7,25 @@ import org.hibernate.validator.constraints.Length; import javax.validation.constraints.NotNull; /** - * - * [ ] - * - * @version 1.0 - * @since JDK1.8 - * @author yandanyang - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date + * 部门 添加表单 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-01-12 20:37:48 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) */ @Data -public class DepartmentCreateDTO { - +public class DepartmentAddForm { @ApiModelProperty("部门名称") @Length(min = 1, max = 50, message = "请输入正确的部门名称(1-50个字符)") @NotNull(message = "请输入正确的部门名称(1-50个字符)") private String name; - @ApiModelProperty("部门简称") - private String shortName; + @ApiModelProperty("排序") + @NotNull(message = "排序值") + private Integer sort; @ApiModelProperty("部门负责人id") private Long managerId; diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/form/DepartmentUpdateForm.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/form/DepartmentUpdateForm.java new file mode 100644 index 00000000..a9516819 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/form/DepartmentUpdateForm.java @@ -0,0 +1,24 @@ +package net.lab1024.sa.admin.module.system.department.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * 部门 更新表单 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-01-12 20:37:48 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class DepartmentUpdateForm extends DepartmentAddForm { + + @ApiModelProperty("部门id") + @NotNull(message = "部门id不能为空") + private Long departmentId; + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/vo/DepartmentEmployeeTreeVO.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/vo/DepartmentEmployeeTreeVO.java new file mode 100644 index 00000000..aba7b263 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/vo/DepartmentEmployeeTreeVO.java @@ -0,0 +1,27 @@ +package net.lab1024.sa.admin.module.system.department.domain.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO; + +import java.util.List; + +/** + * 部门 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-01-12 20:37:48 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class DepartmentEmployeeTreeVO extends DepartmentVO { + + @ApiModelProperty("部门员工列表") + private List employees; + + @ApiModelProperty("子部门") + private List children; + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/vo/DepartmentTreeVO.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/vo/DepartmentTreeVO.java new file mode 100644 index 00000000..4efef78d --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/vo/DepartmentTreeVO.java @@ -0,0 +1,32 @@ +package net.lab1024.sa.admin.module.system.department.domain.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * 部门 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-01-12 20:37:48 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class DepartmentTreeVO extends DepartmentVO { + + @ApiModelProperty("同级上一个元素id") + private Long preId; + + @ApiModelProperty("同级下一个元素id") + private Long nextId; + + @ApiModelProperty("子部门") + private List children; + + @ApiModelProperty("自己和所有递归子部门的id集合") + private List selfAndAllChildrenIdList; + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/vo/DepartmentVO.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/vo/DepartmentVO.java new file mode 100644 index 00000000..5f546fc9 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/domain/vo/DepartmentVO.java @@ -0,0 +1,36 @@ +package net.lab1024.sa.admin.module.system.department.domain.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * 部门 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-01-12 20:37:48 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class DepartmentVO { + + @ApiModelProperty("部门id") + private Long departmentId; + + @ApiModelProperty("部门名称") + private String name; + + @ApiModelProperty("部门负责人姓名") + private String managerName; + + @ApiModelProperty("部门负责人id") + private Long managerId; + + @ApiModelProperty("父级部门id") + private Long parentId; + + @ApiModelProperty("排序") + private Integer sort; + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/manager/DepartmentCacheManager.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/manager/DepartmentCacheManager.java new file mode 100644 index 00000000..f1fc0930 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/manager/DepartmentCacheManager.java @@ -0,0 +1,249 @@ +package net.lab1024.sa.admin.module.system.department.manager; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import lombok.extern.slf4j.Slf4j; +import net.lab1024.sa.admin.constant.AdminCacheConst; +import net.lab1024.sa.admin.module.system.department.dao.DepartmentDao; +import net.lab1024.sa.admin.module.system.department.domain.vo.DepartmentTreeVO; +import net.lab1024.sa.admin.module.system.department.domain.vo.DepartmentVO; +import net.lab1024.sa.common.common.util.SmartBeanUtil; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.math.NumberUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * 部门 缓存相关 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-01-12 20:37:48 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Slf4j +@Service +public class DepartmentCacheManager { + + @Autowired + private DepartmentDao departmentDao; + + private void logClearInfo(String cache) { + log.info("clear " + cache); + } + + // ----------------------- 清空缓存 ----------------------- + @CacheEvict(value = {AdminCacheConst.Department.DEPARTMENT_LIST_CACHE, AdminCacheConst.Department.DEPARTMENT_MAP_CACHE, AdminCacheConst.Department.DEPARTMENT_SELF_CHILDREN_CACHE, AdminCacheConst.Department.DEPARTMENT_TREE_CACHE, AdminCacheConst.Department.DEPARTMENT_PATH_CACHE,}, allEntries = true) + public void clearCache() { + logClearInfo(AdminCacheConst.Department.DEPARTMENT_LIST_CACHE); + } + + // ----------------------- 查询 ----------------------- + + /** + * 部门列表 + * + * @return + */ + @Cacheable(AdminCacheConst.Department.DEPARTMENT_LIST_CACHE) + public List getDepartmentList() { + List departmentVOList = departmentDao.listAll(); + return departmentVOList; + } + + /** + * 部门map + * + * @return + */ + @Cacheable(AdminCacheConst.Department.DEPARTMENT_MAP_CACHE) + public Map getDepartmentMap() { + return departmentDao.listAll().stream().collect(Collectors.toMap(DepartmentVO::getDepartmentId, Function.identity())); + } + + + /** + * 缓存部门树结构 + * + * @return + */ + @Cacheable(AdminCacheConst.Department.DEPARTMENT_TREE_CACHE) + public List getDepartmentTree() { + List departmentVOList = departmentDao.listAll(); + return this.buildTree(departmentVOList); + } + + /** + * 缓存某个部门的下级id列表 + * + * @param departmentId + * @return + */ + @Cacheable(AdminCacheConst.Department.DEPARTMENT_SELF_CHILDREN_CACHE) + public List getDepartmentSelfAndChildren(Long departmentId) { + List departmentVOList = departmentDao.listAll(); + List idList = this.selfAndChildrenIdList(departmentId, departmentVOList); + return idList; + } + + + /** + * 部门的路径名称 + * + * @return + */ + @Cacheable(AdminCacheConst.Department.DEPARTMENT_PATH_CACHE) + public Map getDepartmentPathMap() { + List departmentVOList = departmentDao.listAll(); + Map departmentMap = departmentVOList.stream().collect(Collectors.toMap(DepartmentVO::getDepartmentId, Function.identity())); + + Map pathNameMap = Maps.newHashMap(); + for (DepartmentVO departmentVO : departmentVOList) { + String pathName = this.buildDepartmentPath(departmentVO, departmentMap); + pathNameMap.put(departmentVO.getDepartmentId(), pathName); + } + + return pathNameMap; + } + + /** + * 构建父级考点路径 + * + * @param departmentVO + * @param departmentMap + */ + private String buildDepartmentPath(DepartmentVO departmentVO, Map departmentMap) { + if (Objects.equals(departmentVO.getParentId(), NumberUtils.LONG_ZERO)) { + return departmentVO.getName(); + } + //父节点 + DepartmentVO parentDepartment = departmentMap.get(departmentVO.getParentId()); + if (parentDepartment == null) { + return departmentVO.getName(); + } + String pathName = buildDepartmentPath(parentDepartment, departmentMap); + return pathName + "/" + departmentVO.getName(); + + } + // ---------------------- 构造树的一些方法 ------------------------------ + + /** + * 构建部门树结构 + * + * @param voList + * @return + */ + public List buildTree(List voList) { + if (CollectionUtils.isEmpty(voList)) { + return Lists.newArrayList(); + } + List rootList = voList.stream().filter(e -> e.getParentId() == null || Objects.equals(e.getParentId(), NumberUtils.LONG_ZERO)).collect(Collectors.toList()); + if (CollectionUtils.isEmpty(rootList)) { + return Lists.newArrayList(); + } + List treeVOList = SmartBeanUtil.copyList(rootList, DepartmentTreeVO.class); + this.recursiveBuildTree(treeVOList, voList); + return treeVOList; + } + + /** + * 构建所有根节点的下级树形结构 + * + * @param nodeList + * @param + */ + private void recursiveBuildTree(List nodeList, List allDepartmentList) { + int nodeSize = nodeList.size(); + for (int i = 0; i < nodeSize; i++) { + int preIndex = i - 1; + int nextIndex = i + 1; + DepartmentTreeVO node = nodeList.get(i); + if (preIndex > -1) { + node.setPreId(nodeList.get(preIndex).getDepartmentId()); + } + if (nextIndex < nodeSize) { + node.setNextId(nodeList.get(nextIndex).getDepartmentId()); + } + + ArrayList selfAndAllChildrenIdList = Lists.newArrayList(); + selfAndAllChildrenIdList.add(node.getDepartmentId()); + node.setSelfAndAllChildrenIdList(selfAndAllChildrenIdList); + + List children = getChildren(node.getDepartmentId(), allDepartmentList); + if (CollectionUtils.isNotEmpty(children)) { + node.setChildren(children); + this.recursiveBuildTree(children, allDepartmentList); + } + } + } + + + /** + * 获取子元素 + * + * @param departmentId + * @param voList + * @return + */ + private List getChildren(Long departmentId, List voList) { + List childrenEntityList = voList.stream().filter(e -> departmentId.equals(e.getParentId())).collect(Collectors.toList()); + if (CollectionUtils.isEmpty(childrenEntityList)) { + return Lists.newArrayList(); + } + return SmartBeanUtil.copyList(childrenEntityList, DepartmentTreeVO.class); + } + + + /** + * 通过部门id,获取当前以及下属部门 + * + * @param departmentId + * @param voList + */ + public List selfAndChildrenIdList(Long departmentId, List voList) { + List selfAndChildrenIdList = Lists.newArrayList(); + if (CollectionUtils.isEmpty(voList)) { + return selfAndChildrenIdList; + } + selfAndChildrenIdList.add(departmentId); + List children = this.getChildren(departmentId, voList); + if (CollectionUtils.isEmpty(children)) { + return selfAndChildrenIdList; + } + List childrenIdList = children.stream().map(DepartmentTreeVO::getDepartmentId).collect(Collectors.toList()); + selfAndChildrenIdList.addAll(childrenIdList); + for (Long childId : childrenIdList) { + this.selfAndChildrenRecursion(selfAndChildrenIdList, childId, voList); + } + return selfAndChildrenIdList; + } + + /** + * 递归查询 + * + * @param selfAndChildrenIdList + * @param departmentId + * @param voList + */ + public void selfAndChildrenRecursion(List selfAndChildrenIdList, Long departmentId, List voList) { + List children = this.getChildren(departmentId, voList); + if (CollectionUtils.isEmpty(children)) { + return; + } + List childrenIdList = children.stream().map(DepartmentTreeVO::getDepartmentId).collect(Collectors.toList()); + selfAndChildrenIdList.addAll(childrenIdList); + for (Long childId : childrenIdList) { + this.selfAndChildrenRecursion(selfAndChildrenIdList, childId, voList); + } + } +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/manager/DepartmentManager.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/manager/DepartmentManager.java new file mode 100644 index 00000000..8bc49a91 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/manager/DepartmentManager.java @@ -0,0 +1,21 @@ +package net.lab1024.sa.admin.module.system.department.manager; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import net.lab1024.sa.admin.module.system.department.dao.DepartmentDao; +import org.springframework.stereotype.Service; +import net.lab1024.sa.admin.module.system.department.domain.entity.DepartmentEntity; + +/** + * 部门 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-01-12 20:37:48 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Service +public class DepartmentManager extends ServiceImpl { + + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/service/DepartmentService.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/service/DepartmentService.java new file mode 100644 index 00000000..c82c98db --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/department/service/DepartmentService.java @@ -0,0 +1,210 @@ +package net.lab1024.sa.admin.module.system.department.service; + +import net.lab1024.sa.admin.module.system.department.dao.DepartmentDao; +import net.lab1024.sa.admin.module.system.department.domain.entity.DepartmentEntity; +import net.lab1024.sa.admin.module.system.department.domain.form.DepartmentAddForm; +import net.lab1024.sa.admin.module.system.department.domain.form.DepartmentUpdateForm; +import net.lab1024.sa.admin.module.system.department.domain.vo.DepartmentTreeVO; +import net.lab1024.sa.admin.module.system.department.domain.vo.DepartmentVO; +import net.lab1024.sa.admin.module.system.department.manager.DepartmentCacheManager; +import net.lab1024.sa.admin.module.system.employee.dao.EmployeeDao; +import net.lab1024.sa.common.common.code.UserErrorCode; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.util.SmartBeanUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +/** + * 部门 service + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-01-12 20:37:48 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Service +public class DepartmentService { + + @Autowired + private DepartmentDao departmentDao; + + @Autowired + private EmployeeDao employeeDao; + + @Autowired + private DepartmentCacheManager departmentCacheManager; + + // ---------------------------- 增加、修改、删除 ---------------------------- + + /** + * 新增添加部门 + * + * @param departmentAddForm + * @return AjaxResult + */ + + public ResponseDTO addDepartment(DepartmentAddForm departmentAddForm) { + DepartmentEntity departmentEntity = SmartBeanUtil.copy(departmentAddForm, DepartmentEntity.class); + departmentDao.insert(departmentEntity); + this.clearCache(); + return ResponseDTO.ok(); + } + + + /** + * 更新部门信息 + * + * @param updateDTO + * @return + */ + public ResponseDTO updateDepartment(DepartmentUpdateForm updateDTO) { + if (updateDTO.getParentId() == null) { + return ResponseDTO.userErrorParam("父级部门id不能为空"); + } + DepartmentEntity entity = departmentDao.selectById(updateDTO.getDepartmentId()); + if (entity == null) { + return ResponseDTO.error(UserErrorCode.DATA_NOT_EXIST); + } + DepartmentEntity departmentEntity = SmartBeanUtil.copy(updateDTO, DepartmentEntity.class); + departmentEntity.setSort(updateDTO.getSort()); + departmentDao.updateById(departmentEntity); + this.clearCache(); + return ResponseDTO.ok(); + } + + /** + * 根据id删除部门 + * 1、需要判断当前部门是否有子部门,有子部门则不允许删除 + * 2、需要判断当前部门是否有员工,有员工则不能删除 + * + * @param departmentId + * @return + */ + public ResponseDTO deleteDepartment(Long departmentId) { + DepartmentEntity departmentEntity = departmentDao.selectById(departmentId); + if (null == departmentEntity) { + return ResponseDTO.error(UserErrorCode.DATA_NOT_EXIST); + } + // 是否有子级部门 + int subDepartmentNum = departmentDao.countSubDepartment(departmentId); + if (subDepartmentNum > 0) { + return ResponseDTO.userErrorParam("请先删除子级部门"); + } + + // 是否有未删除员工 + int employeeNum = employeeDao.countByDepartmentId(departmentId); + if (employeeNum > 0) { + return ResponseDTO.userErrorParam("请先删除部门员工"); + } + departmentDao.deleteById(departmentId); + // 清除缓存 + this.clearCache(); + return ResponseDTO.ok(); + } + + /** + * 清除自身以及下级的id列表缓存 + */ + private void clearCache() { + departmentCacheManager.clearCache(); + } + + // ---------------------------- 查询 ---------------------------- + + /** + * 获取部门树形结构 + * + * @return + */ + public ResponseDTO> departmentTree() { + List treeVOList = departmentCacheManager.getDepartmentTree(); + return ResponseDTO.ok(treeVOList); + } + + + /** + * 自身以及所有下级的部门id列表 + * + * @param departmentId + * @return + */ + public List selfAndChildrenIdList(Long departmentId) { + return departmentCacheManager.getDepartmentSelfAndChildren(departmentId); + } + + + /** + * 获取所有部门 + * + * @return + */ + public List listAll() { + return departmentCacheManager.getDepartmentList(); + } + + + /** + * 获取部门 + * + * @param departmentId + */ + public DepartmentVO getDepartmentById(Long departmentId) { + return departmentCacheManager.getDepartmentMap().get(departmentId); + } + + /** + * 获取部门路径:/公司/研发部/产品组 + * + * @param departmentId + */ + public String getDepartmentPath(Long departmentId) { + return departmentCacheManager.getDepartmentPathMap().get(departmentId); + } + + /** + * 查询全部父级部门(不包含自己) + * + * @param departmentId + * @return + * @author listen + */ + public List queryAllParentDepartment(Long departmentId) { + List list = new ArrayList<>(); + + Map departmentMap = departmentCacheManager.getDepartmentMap(); + DepartmentVO departmentVO = departmentMap.get(departmentId); + while (departmentVO != null) { + list.add(departmentVO); + departmentVO = departmentMap.get(departmentVO.getParentId()); + } + Collections.reverse(list); + return list; + } + + /** + * 查询全部父级部门(不包含自己) + * + * @param departmentId + * @return + * @author listen + */ + public List queryAllParentDepartmentIdList(Long departmentId) { + List list = new ArrayList<>(); + + Map departmentMap = departmentCacheManager.getDepartmentMap(); + DepartmentVO departmentVO = departmentMap.get(departmentId); + while (departmentVO != null) { + list.add(departmentVO.getDepartmentId()); + departmentVO = departmentMap.get(departmentVO.getParentId()); + } + Collections.reverse(list); + return list; + } + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/controller/EmployeeController.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/controller/EmployeeController.java new file mode 100644 index 00000000..c5f0f325 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/controller/EmployeeController.java @@ -0,0 +1,105 @@ +package net.lab1024.sa.admin.module.system.employee.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import net.lab1024.sa.admin.common.AdminBaseController; +import net.lab1024.sa.admin.constant.AdminSwaggerTagConst; +import net.lab1024.sa.admin.module.system.employee.domain.form.*; +import net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO; +import net.lab1024.sa.admin.module.system.employee.service.EmployeeService; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.util.SmartRequestUtil; +import net.lab1024.sa.common.module.support.operatelog.annoation.OperateLog; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + +/** + * 员工 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2021-12-09 22:57:49 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@RestController +@OperateLog +@Api(tags = {AdminSwaggerTagConst.System.SYSTEM_EMPLOYEE}) +public class EmployeeController extends AdminBaseController { + + @Autowired + private EmployeeService employeeService; + + @PostMapping("/employee/query") + @ApiOperation(value = "员工管理查询 @author 卓大") + public ResponseDTO> query(@Valid @RequestBody EmployeeQueryForm query) { + return employeeService.queryEmployee(query); + } + + @ApiOperation(value = "添加员工(返回添加员工的密码) @author 卓大") + @PostMapping("/employee/add") + @PreAuthorize("@saAuth.checkPermission('system:employee:add')") + public ResponseDTO addEmployee(@Valid @RequestBody EmployeeAddForm employeeAddForm) { + return employeeService.addEmployee(employeeAddForm); + } + + @ApiOperation(value = "更新员工 @author 卓大") + @PostMapping("/employee/update") + @PreAuthorize("@saAuth.checkPermission('system:employee:update')") + public ResponseDTO updateEmployee(@Valid @RequestBody EmployeeUpdateForm employeeUpdateForm) { + return employeeService.updateEmployee(employeeUpdateForm); + } + + @ApiOperation(value = "更新员工禁用/启用状态 @author 卓大") + @GetMapping("/employee/update/disabled/{employeeId}") + @PreAuthorize("@saAuth.checkPermission('system:employee:disabled')") + public ResponseDTO updateDisableFlag(@PathVariable Long employeeId) { + return employeeService.updateDisableFlag(employeeId); + } + + @ApiOperation(value = "批量删除员工 @author 卓大") + @PostMapping("/employee/update/batch/delete") + @PreAuthorize("@saAuth.checkPermission('system:employee:delete')") + public ResponseDTO batchUpdateDeleteFlag(@RequestBody List employeeIdList) { + return employeeService.batchUpdateDeleteFlag(employeeIdList); + } + + @ApiOperation(value = "批量调整员工部门 @author 卓大") + @PostMapping("/employee/update/batch/department") + @PreAuthorize("@saAuth.checkPermission('system:employee:department:update')") + public ResponseDTO batchUpdateDepartment(@Valid @RequestBody EmployeeBatchUpdateDepartmentForm batchUpdateDepartmentForm) { + return employeeService.batchUpdateDepartment(batchUpdateDepartmentForm); + } + + @ApiOperation(value = "修改密码 @author 卓大") + @PostMapping("/employee/update/password") + public ResponseDTO updatePassword(@Valid @RequestBody EmployeeUpdatePasswordForm updatePasswordForm) { + updatePasswordForm.setEmployeeId(SmartRequestUtil.getRequestUserId()); + return employeeService.updatePassword(updatePasswordForm); + } + + @ApiOperation(value = "重置员工密码 @author 卓大") + @GetMapping("/employee/update/password/reset/{employeeId}") + @PreAuthorize("@saAuth.checkPermission('system:employee:password:reset')") + public ResponseDTO resetPassword(@PathVariable Integer employeeId) { + return employeeService.resetPassword(employeeId); + } + + @ApiOperation(value = "查询员工-根据部门id @author 卓大") + @GetMapping("/employee/getAllEmployeeByDepartmentId/{departmentId}") + public ResponseDTO> getAllEmployeeByDepartmentId(@PathVariable Long departmentId) { + return employeeService.getAllEmployeeByDepartmentId(departmentId, Boolean.FALSE); + } + + @ApiOperation("查询所有员工 @author 卓大") + @GetMapping("/employee/queryAll") + public ResponseDTO> queryAllEmployee(@RequestParam(value = "disabledFlag", required = false) Boolean disabledFlag) { + return employeeService.queryAllEmployee(disabledFlag); + } + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/dao/EmployeeDao.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/dao/EmployeeDao.java new file mode 100644 index 00000000..b5bc89dd --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/dao/EmployeeDao.java @@ -0,0 +1,171 @@ +package net.lab1024.sa.admin.module.system.employee.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity; +import net.lab1024.sa.admin.module.system.employee.domain.form.EmployeeQueryForm; +import net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Component; + +import java.util.Collection; +import java.util.List; + +/** + * 员工 dao + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2021-12-09 22:57:49 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Mapper +@Component +public interface EmployeeDao extends BaseMapper { + /** + * 查询员工列表 + * + * @param page + * @param queryForm + * @return + */ + List queryEmployee(Page page, @Param("queryForm") EmployeeQueryForm queryForm, @Param("departmentIdList") List departmentIdList); + + /** + * 查询员工 + */ + List selectEmployeeByDisabledAndDeleted(@Param("disabledFlag") Boolean disabledFlag, @Param("deletedFlag") Boolean deletedFlag); + + + /** + * 更新单个 + * + * @param employeeId + * @param disabledFlag + */ + void updateDisableFlag(@Param("employeeId") Long employeeId, @Param("disabledFlag") Boolean disabledFlag); + + + /** + * 通过登录名查询 + * + * @param loginName + * @param disabledFlag + * @return + */ + EmployeeEntity getByLoginName(@Param("loginName") String loginName, + @Param("disabledFlag") Boolean disabledFlag); + + + /** + * 通过姓名查询 + * + * @param actualName + * @param disabledFlag + * @return + */ + EmployeeEntity getByActualName(@Param("actualName") String actualName, + @Param("disabledFlag") Boolean disabledFlag + ); + + /** + * 通过手机号查询 + * + * @param phone + * @param disabledFlag + * @return + */ + EmployeeEntity getByPhone(@Param("phone") String phone, @Param("disabledFlag") Boolean disabledFlag); + + /** + * 获取所有员工 + * + * @return + */ + List listAll(); + + /** + * 获取某个部门员工数 + * + * @param departmentId + * @return + */ + Integer countByDepartmentId(@Param("departmentId") Long departmentId); + + /** + * 获取一批员工 + * + * @param employeeIds + * @return + */ + List getEmployeeByIds(@Param("employeeIds") Collection employeeIds); + + + /** + * 查询单个员工信息 + * + * @param employeeId + * @return + */ + EmployeeVO getEmployeeById(@Param("employeeId") Long employeeId); + + + /** + * 获取某个部门的员工 + * + * @param departmentId + * @param disabledFlag + * @return + */ + List selectByDepartmentId(@Param("departmentId") Long departmentId, @Param("disabledFlag") Boolean disabledFlag); + + + /** + * 查询某些部门下用户名是xxx的员工 + * + * @param departmentIdList + * @param actualName + * @param disabledFlag + * @return + */ + List selectByActualName(@Param("departmentIdList") List departmentIdList, @Param("actualName") String actualName, @Param("disabledFlag") Boolean disabledFlag); + + + /** + * 获取某批部门的员工Id + * + * @param departmentIds + * @return + */ + List getEmployeeIdByDepartmentIdList(@Param("departmentIds") List departmentIds, @Param("disabledFlag") Boolean disabledFlag); + + /** + * 获取所有 + * + * @param leaveFlag + * @param disabledFlag + * @return + */ + List getEmployeeId(@Param("leaveFlag") Boolean leaveFlag, @Param("disabledFlag") Boolean disabledFlag); + + /** + * 获取某个部门的员工Id + * + * @param departmentId + * @param disabledFlag + * @return + */ + List getEmployeeIdByDepartmentId(@Param("departmentId") Long departmentId, @Param("disabledFlag") Boolean disabledFlag); + + /** + * 员工重置密码 + * + * @param employeeId + * @param password + * @return + */ + Integer updatePassword(@Param("employeeId") Integer employeeId, @Param("password") String password); + +} \ No newline at end of file diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/entity/EmployeeEntity.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/entity/EmployeeEntity.java new file mode 100644 index 00000000..b66b5961 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/entity/EmployeeEntity.java @@ -0,0 +1,81 @@ +package net.lab1024.sa.admin.module.system.employee.domain.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * 员工 实体表 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2021-12-09 22:57:49 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +@TableName("t_employee") +public class EmployeeEntity { + + @TableId(type = IdType.AUTO) + private Long employeeId; + + /** + * 登录账号 + */ + private String loginName; + + /** + * 登录密码 + */ + private String loginPwd; + + /** + * 员工名称 + */ + private String actualName; + + /** + * 性别 + */ + private Integer gender; + + /** + * 手机号码 + */ + private String phone; + + /** + * 部门id + */ + private Long departmentId; + + /** + * 是否为超级管理员: 0 不是,1是 + */ + private Boolean administratorFlag; + + /** + * 是否被禁用 0否1是 + */ + private Boolean disabledFlag; + + /** + * 是否删除0否 1是 + */ + private Boolean deletedFlag; + + /** + * 备注 + */ + private String remark; + + private LocalDateTime updateTime; + + private LocalDateTime createTime; + + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/form/EmployeeAddForm.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/form/EmployeeAddForm.java new file mode 100644 index 00000000..09bf252d --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/form/EmployeeAddForm.java @@ -0,0 +1,56 @@ +package net.lab1024.sa.admin.module.system.employee.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.enumeration.GenderEnum; +import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum; +import net.lab1024.sa.common.common.validator.enumeration.CheckEnum; +import org.hibernate.validator.constraints.Length; +import net.lab1024.sa.common.common.util.SmartVerificationUtil; + +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Pattern; +import java.util.List; + +/** + * 添加员工 + * + * @Author 1024创新实验室: 开云 + * @Date 2021-12-20 21:06:49 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class EmployeeAddForm { + + @ApiModelProperty("姓名") + @NotNull(message = "姓名不能为空") + @Length(max = 30, message = "姓名最多30字符") + private String actualName; + + @ApiModelProperty("登录账号") + @NotNull(message = "登录账号不能为空") + @Length(max = 30, message = "登录账号最多30字符") + private String loginName; + + @ApiModelPropertyEnum(GenderEnum.class) + @CheckEnum(value = GenderEnum.class, message = "性别错误") + private Integer gender; + + @ApiModelProperty("部门id") + @NotNull(message = "部门id不能为空") + private Long departmentId; + + @ApiModelProperty("是否启用") + @NotNull(message = "是否被禁用不能为空") + private Boolean disabledFlag; + + @ApiModelProperty("手机号") + @NotNull(message = "手机号不能为空") + @Pattern(regexp = SmartVerificationUtil.PHONE_REGEXP, message = "手机号格式不正确") + private String phone; + + @ApiModelProperty("角色列表") + private List roleIdList; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/form/EmployeeBatchUpdateDepartmentForm.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/form/EmployeeBatchUpdateDepartmentForm.java new file mode 100644 index 00000000..4a9de07a --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/form/EmployeeBatchUpdateDepartmentForm.java @@ -0,0 +1,31 @@ +package net.lab1024.sa.admin.module.system.employee.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.util.List; + +/** + * 员工更新部门 + * + * @Author 1024创新实验室: 开云 + * @Date 2021-12-20 21:06:49 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class EmployeeBatchUpdateDepartmentForm { + + @ApiModelProperty("员工id") + @NotEmpty(message = "员工id不能为空") + @Size(max = 99, message = "一次最多调整99个员工") + private List employeeIdList; + + @ApiModelProperty("部门ID") + @NotNull(message = "部门ID不能为空") + private Long departmentId; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/form/EmployeeQueryForm.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/form/EmployeeQueryForm.java new file mode 100644 index 00000000..8315f206 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/form/EmployeeQueryForm.java @@ -0,0 +1,40 @@ +package net.lab1024.sa.admin.module.system.employee.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.domain.PageParam; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.Size; +import java.util.List; + +/** + * 员工列表 + * + * @Author 1024创新实验室: 开云 + * @Date 2021-12-20 21:06:49 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class EmployeeQueryForm extends PageParam { + + @ApiModelProperty("搜索词") + @Length(max = 20, message = "搜索词最多20字符") + private String keyword; + + @ApiModelProperty("部门id") + private Long departmentId; + + @ApiModelProperty("是否禁用") + private Boolean disabledFlag; + + @ApiModelProperty("员工id集合") + @Size(max = 99, message = "最多查询99个员工") + private List employeeIdList; + + @ApiModelProperty(value = "删除标识", hidden = true) + private Boolean deletedFlag; + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/form/EmployeeUpdateForm.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/form/EmployeeUpdateForm.java new file mode 100644 index 00000000..860a66d4 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/form/EmployeeUpdateForm.java @@ -0,0 +1,23 @@ +package net.lab1024.sa.admin.module.system.employee.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * 更新员工 + * + * @Author 1024创新实验室: 开云 + * @Date 2021-12-20 21:06:49 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class EmployeeUpdateForm extends EmployeeAddForm { + + @ApiModelProperty("员工id") + @NotNull(message = "员工id不能为空") + private Long employeeId; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/form/EmployeeUpdatePasswordForm.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/form/EmployeeUpdatePasswordForm.java new file mode 100644 index 00000000..d4e4758e --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/form/EmployeeUpdatePasswordForm.java @@ -0,0 +1,34 @@ +package net.lab1024.sa.admin.module.system.employee.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.util.SmartVerificationUtil; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Pattern; + +/** + * 修改密码所需参数 + * + * @Author 1024创新实验室: 开云 + * @Date 2021-12-20 21:06:49 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class EmployeeUpdatePasswordForm { + + @ApiModelProperty(hidden = true) + private Long employeeId; + + @ApiModelProperty("原密码") + @NotBlank(message = "原密码不能为空哦") + @Pattern(regexp = SmartVerificationUtil.PWD_REGEXP, message = "原密码请输入6-15位(数字|大小写字母|小数点)") + private String oldPassword; + + @ApiModelProperty("新密码") + @NotBlank(message = "新密码不能为空哦") + @Pattern(regexp = SmartVerificationUtil.PWD_REGEXP, message = "新密码请输入6-15位(数字|大小写字母|小数点)") + private String newPassword; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/form/EmployeeUpdateRoleForm.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/form/EmployeeUpdateRoleForm.java new file mode 100644 index 00000000..4672565f --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/form/EmployeeUpdateRoleForm.java @@ -0,0 +1,30 @@ +package net.lab1024.sa.admin.module.system.employee.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.util.List; + +/** + * 员工更新角色 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2021-12-20 20:55:13 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class EmployeeUpdateRoleForm { + + @ApiModelProperty("员工id") + @NotNull(message = "员工id不能为空") + private Long employeeId; + + @ApiModelProperty("角色ids") + @Size(max = 99, message = "角色最多99") + private List roleIdList; + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/vo/EmployeeVO.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/vo/EmployeeVO.java new file mode 100644 index 00000000..108a81d7 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/vo/EmployeeVO.java @@ -0,0 +1,58 @@ +package net.lab1024.sa.admin.module.system.employee.domain.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.enumeration.GenderEnum; +import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * 员工信息 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2021-12-21 23:05:56 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class EmployeeVO { + + @ApiModelProperty("主键id") + private Long employeeId; + + @ApiModelProperty("登录账号") + private String loginName; + + @ApiModelPropertyEnum(GenderEnum.class) + private Integer gender; + + @ApiModelProperty("员工名称") + private String actualName; + + @ApiModelProperty("手机号码") + private String phone; + + @ApiModelProperty("部门id") + private Long departmentId; + + @ApiModelProperty("是否被禁用") + private Boolean disabledFlag; + + @ApiModelProperty("是否 超级管理员") + private Boolean administratorFlag; + + @ApiModelProperty("部门名称") + private String departmentName; + + @ApiModelProperty("创建时间") + private LocalDateTime createTime; + + @ApiModelProperty("角色列表") + private List roleIdList; + + @ApiModelProperty("角色名称列表") + private List roleNameList; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/manager/EmployeeManager.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/manager/EmployeeManager.java new file mode 100644 index 00000000..f31a3317 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/manager/EmployeeManager.java @@ -0,0 +1,82 @@ +package net.lab1024.sa.admin.module.system.employee.manager; + + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import net.lab1024.sa.admin.module.system.employee.dao.EmployeeDao; +import net.lab1024.sa.admin.module.system.role.domain.entity.RoleEmployeeEntity; +import net.lab1024.sa.admin.module.system.role.manager.RoleEmployeeManager; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity; + +import java.util.List; +import java.util.stream.Collectors; + +/** + * 员工 manager + * + * @Author 1024创新实验室: 胡克 + * @Date 2021-12-29 21:52:46 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Service +public class EmployeeManager extends ServiceImpl { + + @Autowired + private EmployeeDao employeeDao; + + @Autowired + private RoleEmployeeManager roleEmployeeManager; + + /** + * 保存员工 + * + * @param employee + */ + @Transactional(rollbackFor = Throwable.class) + public void saveEmployee(EmployeeEntity employee, List roleIdList) { + // 保存员工 获得id + employeeDao.insert(employee); + + if (CollectionUtils.isNotEmpty(roleIdList)) { + List roleEmployeeList = roleIdList.stream().map(e -> new RoleEmployeeEntity(e, employee.getEmployeeId())).collect(Collectors.toList()); + roleEmployeeManager.saveBatch(roleEmployeeList); + } + } + + /** + * 更新员工 + * + * @param employee + */ + @Transactional(rollbackFor = Throwable.class) + public void updateEmployee(EmployeeEntity employee, List roleIdList) { + // 保存员工 获得id + employeeDao.updateById(employee); + + if (CollectionUtils.isNotEmpty(roleIdList)) { + List roleEmployeeList = roleIdList.stream().map(e -> new RoleEmployeeEntity(e, employee.getEmployeeId())).collect(Collectors.toList()); + this.updateEmployeeRole(employee.getEmployeeId(), roleEmployeeList); + } + } + + /** + * 更新员工角色 + * + * @param employeeId + * @param roleEmployeeList + */ + @Transactional(rollbackFor = Throwable.class) + public void updateEmployeeRole(Long employeeId, List roleEmployeeList) { + roleEmployeeManager.getBaseMapper().deleteByEmployeeId(employeeId); + + if (CollectionUtils.isNotEmpty(roleEmployeeList)) { + roleEmployeeManager.saveBatch(roleEmployeeList); + } + } + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/service/EmployeePermissionService.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/service/EmployeePermissionService.java new file mode 100644 index 00000000..3e6a0297 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/service/EmployeePermissionService.java @@ -0,0 +1,81 @@ +package net.lab1024.sa.admin.module.system.employee.service; + +import net.lab1024.sa.admin.module.system.menu.constant.MenuPermsTypeEnum; +import net.lab1024.sa.admin.module.system.menu.domain.vo.MenuVO; +import net.lab1024.sa.admin.module.system.role.service.RoleEmployeeService; +import net.lab1024.sa.admin.module.system.role.service.RoleMenuService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.core.authority.SimpleGrantedAuthority; +import org.springframework.stereotype.Service; + +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +/** + * 员工权限校验 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2021-12-29 21:52:46 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Service +public class EmployeePermissionService { + + @Autowired + private RoleEmployeeService roleEmployeeService; + + @Autowired + private RoleMenuService roleMenuService; + + /** + * 构建权限集合 + * + * @param menuAndPointsList + */ + public Set buildAuthorities(List menuAndPointsList) { + HashSet permissionList = new HashSet<>(); + for (MenuVO menu : menuAndPointsList) { + if(menu.getPermsType() == null){ + continue; + } + + String perms = null; + if(menu.getPermsType().equals(MenuPermsTypeEnum.SPRING_SECURITY.getValue())){ + perms = menu.getWebPerms(); + }else{ + perms = menu.getApiPerms(); + } + + if (StringUtils.isEmpty(perms)) { + continue; + } + //接口权限 + String[] split = perms.split(","); + for (String perm : split) { + permissionList.add(perm); + } + } + + Set authorities = new HashSet<>(); + authorities.addAll(permissionList.stream().map(SimpleGrantedAuthority::new).collect(Collectors.toSet())); + return authorities; + } + + /** + * 查询用户拥有的前端菜单项 用于登陆返回 前端动态路由配置 + * + * @param employeeId + * @return + */ + public List getEmployeeMenuAndPointsList(Long employeeId, Boolean administratorFlag) { + List roleIdList = roleEmployeeService.getRoleIdList(employeeId); + return roleMenuService.getMenuList(roleIdList, administratorFlag); + } + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/service/EmployeeService.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/service/EmployeeService.java new file mode 100644 index 00000000..6669719c --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/service/EmployeeService.java @@ -0,0 +1,384 @@ +package net.lab1024.sa.admin.module.system.employee.service; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.google.common.collect.Lists; +import net.lab1024.sa.admin.module.system.department.dao.DepartmentDao; +import net.lab1024.sa.admin.module.system.department.domain.entity.DepartmentEntity; +import net.lab1024.sa.admin.module.system.department.domain.vo.DepartmentVO; +import net.lab1024.sa.admin.module.system.department.service.DepartmentService; +import net.lab1024.sa.admin.module.system.employee.dao.EmployeeDao; +import net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity; +import net.lab1024.sa.admin.module.system.employee.domain.form.*; +import net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO; +import net.lab1024.sa.admin.module.system.employee.manager.EmployeeManager; +import net.lab1024.sa.admin.module.system.role.dao.RoleEmployeeDao; +import net.lab1024.sa.admin.module.system.role.domain.vo.RoleEmployeeVO; +import net.lab1024.sa.common.common.code.UserErrorCode; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.enumeration.UserTypeEnum; +import net.lab1024.sa.common.common.util.SmartBeanUtil; +import net.lab1024.sa.common.common.util.SmartPageUtil; +import net.lab1024.sa.common.module.support.token.TokenService; +import org.apache.commons.codec.digest.DigestUtils; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.RandomStringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 员工 service + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2021-12-29 21:52:46 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Service +public class EmployeeService { + + private static final String PASSWORD_SALT_FORMAT = "smart_%s_admin_$^&*"; + + @Autowired + private EmployeeDao employeeDao; + + @Autowired + private DepartmentDao departmentDao; + + @Autowired + private EmployeeManager employeeManager; + + @Autowired + private RoleEmployeeDao roleEmployeeDao; + + @Autowired + private DepartmentService departmentService; + + @Autowired + private TokenService tokenService; + + + public EmployeeEntity getById(Long employeeId) { + return employeeDao.selectById(employeeId); + } + + + /** + * 查询员工列表 + * + * @param employeeQueryForm + * @return + */ + public ResponseDTO> queryEmployee(EmployeeQueryForm employeeQueryForm) { + employeeQueryForm.setDeletedFlag(false); + Page pageParam = SmartPageUtil.convert2PageQuery(employeeQueryForm); + + List departmentIdList = new ArrayList<>(); + if (employeeQueryForm.getDepartmentId() != null) { + departmentIdList.addAll(departmentService.selfAndChildrenIdList(employeeQueryForm.getDepartmentId())); + } + + List employeeList = employeeDao.queryEmployee(pageParam, employeeQueryForm, departmentIdList); + if (CollectionUtils.isEmpty(employeeList)) { + PageResult PageResult = SmartPageUtil.convert2PageResult(pageParam, employeeList); + return ResponseDTO.ok(PageResult); + } + + List employeeIdList = employeeList.stream().map(EmployeeVO::getEmployeeId).collect(Collectors.toList()); + // 查询员工角色 + List roleEmployeeEntityList = roleEmployeeDao.selectRoleByEmployeeIdList(employeeIdList); + Map> employeeRoleIdListMap = roleEmployeeEntityList.stream().collect(Collectors.groupingBy(RoleEmployeeVO::getEmployeeId, Collectors.mapping(RoleEmployeeVO::getRoleId, Collectors.toList()))); + Map> employeeRoleNameListMap = roleEmployeeEntityList.stream().collect(Collectors.groupingBy(RoleEmployeeVO::getEmployeeId, Collectors.mapping(RoleEmployeeVO::getRoleName, Collectors.toList()))); + + employeeList.forEach(e -> { + e.setRoleIdList(employeeRoleIdListMap.getOrDefault(e.getEmployeeId(), Lists.newArrayList())); + e.setRoleNameList(employeeRoleNameListMap.getOrDefault(e.getEmployeeId(), Lists.newArrayList())); + e.setDepartmentName(departmentService.getDepartmentPath(e.getDepartmentId())); + }); + PageResult PageResult = SmartPageUtil.convert2PageResult(pageParam, employeeList); + return ResponseDTO.ok(PageResult); + } + + /** + * 新增员工 + * + * @param employeeAddForm + * @return + */ + public synchronized ResponseDTO addEmployee(EmployeeAddForm employeeAddForm) { + // 校验名称是否重复 + EmployeeEntity employeeEntity = employeeDao.getByLoginName(employeeAddForm.getLoginName(), false); + if (null != employeeEntity) { + return ResponseDTO.userErrorParam("登录名重复"); + } + // 校验姓名是否重复 + employeeEntity = employeeDao.getByActualName(employeeAddForm.getActualName(), false); + if (null != employeeEntity) { + return ResponseDTO.userErrorParam("姓名重复"); + } + // 校验电话是否存在 + employeeEntity = employeeDao.getByPhone(employeeAddForm.getPhone(), false); + if (null != employeeEntity) { + return ResponseDTO.userErrorParam("手机号已存在"); + } + // 部门是否存在 + Long departmentId = employeeAddForm.getDepartmentId(); + DepartmentEntity department = departmentDao.selectById(departmentId); + if (department == null) { + return ResponseDTO.userErrorParam("部门不存在"); + } + + EmployeeEntity entity = SmartBeanUtil.copy(employeeAddForm, EmployeeEntity.class); + // 设置密码 默认密码 + String password = randomPassword(); + entity.setLoginPwd(getEncryptPwd(password)); + + // 保存数据 + entity.setDeletedFlag(Boolean.FALSE); + employeeManager.saveEmployee(entity, employeeAddForm.getRoleIdList()); + + return ResponseDTO.ok(password); + } + + /** + * 更新员工 + * + * @param employeeUpdateForm + * @return + */ + public synchronized ResponseDTO updateEmployee(EmployeeUpdateForm employeeUpdateForm) { + + Long employeeId = employeeUpdateForm.getEmployeeId(); + EmployeeEntity employeeEntity = employeeDao.selectById(employeeId); + if (null == employeeEntity) { + return ResponseDTO.error(UserErrorCode.DATA_NOT_EXIST); + } + + // 部门是否存在 + Long departmentId = employeeUpdateForm.getDepartmentId(); + DepartmentEntity departmentEntity = departmentDao.selectById(departmentId); + if (departmentEntity == null) { + return ResponseDTO.userErrorParam("部门不存在"); + } + + + EmployeeEntity existEntity = employeeDao.getByLoginName(employeeUpdateForm.getLoginName(), false); + if (null != existEntity && !Objects.equals(existEntity.getEmployeeId(), employeeId)) { + return ResponseDTO.userErrorParam("登录名重复"); + } + + existEntity = employeeDao.getByPhone(employeeUpdateForm.getPhone(), false); + if (null != existEntity && !Objects.equals(existEntity.getEmployeeId(), employeeId)) { + return ResponseDTO.userErrorParam("手机号已存在"); + } + + existEntity = employeeDao.getByActualName(employeeUpdateForm.getActualName(), false); + if (null != existEntity && !Objects.equals(existEntity.getEmployeeId(), employeeId)) { + return ResponseDTO.userErrorParam("姓名重复"); + } + + // 不更新密码 + EmployeeEntity entity = SmartBeanUtil.copy(employeeUpdateForm, EmployeeEntity.class); + entity.setLoginPwd(null); + + // 更新数据 + employeeManager.updateEmployee(entity, employeeUpdateForm.getRoleIdList()); + + return ResponseDTO.ok(); + } + + /** + * 更新禁用/启用状态 + * + * @param employeeId + * @return + */ + public ResponseDTO updateDisableFlag(Long employeeId) { + if (null == employeeId) { + return ResponseDTO.error(UserErrorCode.DATA_NOT_EXIST); + } + EmployeeEntity employeeEntity = employeeDao.selectById(employeeId); + if (null == employeeEntity) { + return ResponseDTO.error(UserErrorCode.DATA_NOT_EXIST); + } + employeeDao.updateDisableFlag(employeeId, !employeeEntity.getDisabledFlag()); + + if (employeeEntity.getDisabledFlag()) { + tokenService.batchRemoveRedisToken(employeeId, UserTypeEnum.ADMIN_EMPLOYEE); + } + + return ResponseDTO.ok(); + } + + /** + * 批量删除员工 + * + * @param employeeIdList 员工ID列表 + * @return + */ + public ResponseDTO batchUpdateDeleteFlag(List employeeIdList) { + if (CollectionUtils.isEmpty(employeeIdList)) { + return ResponseDTO.ok(); + } + List employeeEntityList = employeeManager.listByIds(employeeIdList); + if (CollectionUtils.isEmpty(employeeEntityList)) { + return ResponseDTO.ok(); + } + // 更新删除 + List deleteList = employeeIdList.stream().map(e -> { + EmployeeEntity updateEmployee = new EmployeeEntity(); + updateEmployee.setEmployeeId(e); + updateEmployee.setDeletedFlag(true); + return updateEmployee; + }).collect(Collectors.toList()); + employeeManager.updateBatchById(deleteList); + + for (Long employeeId : employeeIdList) { + tokenService.batchRemoveRedisToken(employeeId, UserTypeEnum.ADMIN_EMPLOYEE); + } + return ResponseDTO.ok(); + } + + + /** + * 批量更新部门 + * + * @param batchUpdateDepartmentForm + * @return + */ + public ResponseDTO batchUpdateDepartment(EmployeeBatchUpdateDepartmentForm batchUpdateDepartmentForm) { + List employeeIdList = batchUpdateDepartmentForm.getEmployeeIdList(); + List employeeEntityList = employeeDao.selectBatchIds(employeeIdList); + if (employeeIdList.size() != employeeEntityList.size()) { + return ResponseDTO.error(UserErrorCode.DATA_NOT_EXIST); + } + // 更新 + List updateList = employeeIdList.stream().map(e -> { + EmployeeEntity updateEmployee = new EmployeeEntity(); + updateEmployee.setEmployeeId(e); + updateEmployee.setDepartmentId(batchUpdateDepartmentForm.getDepartmentId()); + return updateEmployee; + }).collect(Collectors.toList()); + employeeManager.updateBatchById(updateList); + + return ResponseDTO.ok(); + } + + + /** + * 更新密码 + * + * @param updatePasswordForm + * @return + */ + public ResponseDTO updatePassword(EmployeeUpdatePasswordForm updatePasswordForm) { + Long employeeId = updatePasswordForm.getEmployeeId(); + EmployeeEntity employeeEntity = employeeDao.selectById(employeeId); + if (employeeEntity == null) { + return ResponseDTO.error(UserErrorCode.DATA_NOT_EXIST); + } + // 校验原始密码 + String encryptPwd = getEncryptPwd(updatePasswordForm.getOldPassword()); + if (!Objects.equals(encryptPwd, employeeEntity.getLoginPwd())) { + return ResponseDTO.userErrorParam("原密码有误,请重新输入"); + } + + // 新旧密码相同 + String newPassword = updatePasswordForm.getNewPassword(); + if (Objects.equals(updatePasswordForm.getOldPassword(), newPassword)) { + return ResponseDTO.ok(); + } + + // 更新密码 + EmployeeEntity updateEntity = new EmployeeEntity(); + updateEntity.setEmployeeId(employeeId); + updateEntity.setLoginPwd(getEncryptPwd(newPassword)); + employeeDao.updateById(updateEntity); + + return ResponseDTO.ok(); + } + + /** + * 获取某个部门的员工信息 + * + * @param departmentId + * @return + */ + public ResponseDTO> getAllEmployeeByDepartmentId(Long departmentId, Boolean disabledFlag) { + List employeeEntityList = employeeDao.selectByDepartmentId(departmentId, disabledFlag); + if (disabledFlag != null) { + employeeEntityList = employeeEntityList.stream().filter(e -> e.getDisabledFlag().equals(disabledFlag)).collect(Collectors.toList()); + } + + if (CollectionUtils.isEmpty(employeeEntityList)) { + return ResponseDTO.ok(Collections.emptyList()); + } + + DepartmentVO department = departmentService.getDepartmentById(departmentId); + + List voList = employeeEntityList.stream().map(e -> { + EmployeeVO employeeVO = SmartBeanUtil.copy(e, EmployeeVO.class); + if (department != null) { + employeeVO.setDepartmentName(department.getName()); + } + return employeeVO; + }).collect(Collectors.toList()); + return ResponseDTO.ok(voList); + } + + + /** + * 重置密码 + * + * @param employeeId + * @return + */ + public ResponseDTO resetPassword(Integer employeeId) { + String password = randomPassword(); + employeeDao.updatePassword(employeeId, getEncryptPwd(password)); + return ResponseDTO.ok(password); + } + + private String randomPassword() { + return RandomStringUtils.randomNumeric(6) + RandomStringUtils.randomAlphabetic(2).toLowerCase(); + } + + /** + * 获取 加密后 的密码 + * + * @param password + * @return + */ + public static String getEncryptPwd(String password) { + return DigestUtils.md5Hex(String.format(PASSWORD_SALT_FORMAT, password)); + } + + + /** + * 查询全部员工 + * + * @return + */ + public ResponseDTO> queryAllEmployee(Boolean disabledFlag) { + List employeeList = employeeDao.selectEmployeeByDisabledAndDeleted(disabledFlag, Boolean.FALSE); + return ResponseDTO.ok(employeeList); + } + + /** + * 根据登录名获取员工 + * + * @param loginName + * @return + */ + public EmployeeEntity getByLoginName(String loginName) { + return employeeDao.getByLoginName(loginName, null); + } + + public static void main(String[] args) { + System.out.println(getEncryptPwd("123456")); + } +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/controller/LoginController.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/controller/LoginController.java new file mode 100644 index 00000000..1d28888d --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/controller/LoginController.java @@ -0,0 +1,90 @@ +package net.lab1024.sa.admin.module.system.login.controller; + +import cn.hutool.extra.servlet.ServletUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import net.lab1024.sa.admin.constant.AdminSwaggerTagConst; +import net.lab1024.sa.admin.module.system.login.domain.LoginEmployeeDetail; +import net.lab1024.sa.admin.module.system.login.domain.LoginForm; +import net.lab1024.sa.admin.module.system.login.service.LoginService; +import net.lab1024.sa.common.common.annoation.NoNeedLogin; +import net.lab1024.sa.common.common.code.UserErrorCode; +import net.lab1024.sa.common.common.constant.RequestHeaderConst; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.util.SmartRequestUtil; +import net.lab1024.sa.common.module.support.captcha.domain.CaptchaVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; +import javax.validation.Valid; + +/** + * 员工登录 + * + * @Author 1024创新实验室-主任:卓大 + * @Date 2021-12-15 21:05:46 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@RestController +@Api(tags = {AdminSwaggerTagConst.System.SYSTEM_LOGIN}) +public class LoginController { + + @Autowired + private LoginService loginService; + + @NoNeedLogin + @PostMapping("/login") + @ApiOperation("登录 @author 卓大") + public ResponseDTO login(@Valid @RequestBody LoginForm loginForm) { + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + String ip = ServletUtil.getClientIP(request); + String userAgent = ServletUtil.getHeaderIgnoreCase(request, RequestHeaderConst.USER_AGENT); + return loginService.login(loginForm, ip, userAgent); + } + + @GetMapping("/login/refresh") + @ApiOperation("刷新用户信息(包含用户基础信息、权限信息等等) @author 卓大") + public ResponseDTO refresh() { + loginService.removeLoginUserDetailCache(SmartRequestUtil.getRequestUserId()); + return ResponseDTO.ok(); + } + + @GetMapping("/login/getLoginInfo") + @ApiOperation("获取登录结果信息 @author 卓大") + public ResponseDTO getLoginInfo() { + Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); + if (authentication == null) { + return ResponseDTO.error(UserErrorCode.LOGIN_STATE_INVALID); + } + + Object principal = authentication.getPrincipal(); + if (!(principal instanceof LoginEmployeeDetail)) { + return ResponseDTO.error(UserErrorCode.LOGIN_STATE_INVALID); + } + + LoginEmployeeDetail loginEmployeeDetail = (LoginEmployeeDetail) authentication.getPrincipal(); + loginEmployeeDetail.setLoginPassword(null); + return ResponseDTO.ok(loginEmployeeDetail); + } + + @ApiOperation("退出登陆 @author 卓大") + @GetMapping("/login/logout") + public ResponseDTO logout(@RequestHeader(value = RequestHeaderConst.TOKEN, required = false) String token) { + return loginService.logout(token, SmartRequestUtil.getRequestUser()); + } + + @ApiOperation("获取验证码 @author 卓大") + @GetMapping("/login/getCaptcha") + @NoNeedLogin + public ResponseDTO getCaptcha() { + return loginService.getCaptcha(); + } + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/domain/LoginEmployeeDetail.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/domain/LoginEmployeeDetail.java new file mode 100644 index 00000000..a8be6eef --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/domain/LoginEmployeeDetail.java @@ -0,0 +1,165 @@ +package net.lab1024.sa.admin.module.system.login.domain; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.admin.module.system.menu.domain.vo.MenuVO; +import net.lab1024.sa.common.common.domain.RequestUser; +import net.lab1024.sa.common.common.enumeration.GenderEnum; +import net.lab1024.sa.common.common.enumeration.UserTypeEnum; +import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum; +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.core.userdetails.UserDetails; + +import java.time.LocalDateTime; +import java.util.Collection; +import java.util.List; +import java.util.Set; + +/** + * 员工登录 + * + * @Author 1024创新实验室: 善逸 + * @Date 2021/8/4 21:15 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +public class LoginEmployeeDetail implements UserDetails, RequestUser { + + @ApiModelProperty("token") + private String token; + + @ApiModelProperty("员工id") + private Long employeeId; + + @ApiModelPropertyEnum(UserTypeEnum.class) + private UserTypeEnum userType; + + @ApiModelProperty("登录账号") + private String loginName; + + @ApiModelProperty("员工名称") + private String actualName; + + @ApiModelPropertyEnum(GenderEnum.class) + private Integer gender; + + @ApiModelProperty("手机号码") + private String phone; + + @ApiModelProperty("部门id") + private Long departmentId; + + @ApiModelProperty("部门名称") + private String departmentName; + + @ApiModelProperty("是否为超管") + private Boolean administratorFlag; + + @ApiModelProperty("菜单列表") + private List menuList; + + @JsonIgnore + private String loginPassword; + + @ApiModelProperty("上次登录id") + private String lastLoginIp; + + @ApiModelProperty("上次登录user-agent") + private String lastLoginUserAgent; + + @ApiModelProperty("上次登录时间") + private LocalDateTime lastLoginTime; + + @ApiModelProperty("请求ip") + private String ip; + + @ApiModelProperty("请求user-agent") + private String userAgent; + + /** + * security 权限串 + */ + private Set authorities; + + @Override + public Collection getAuthorities() { + return authorities; + } + + @Override + @JsonIgnore + public String getPassword() { + return this.loginPassword; + } + + @Override + public String getUsername() { + return this.getLoginName(); + } + + /** + * 账户是否未过期,过期无法验证 + */ + @Override + public boolean isAccountNonExpired() { + return true; + } + + /** + * 指定用户是否解锁,锁定的用户无法进行身份验证 + * + * @return + */ + @Override + public boolean isAccountNonLocked() { + return true; + } + + /** + * 指示是否已过期的用户的凭据(密码),过期的凭据防止认证 + * + * @return + */ + @Override + public boolean isCredentialsNonExpired() { + return true; + } + + /** + * 是否可用 ,禁用的用户不能身份验证 + * + * @return + */ + @Override + public boolean isEnabled() { + return true; + } + + @Override + public Long getUserId() { + return employeeId; + } + + @Override + public String getUserName() { + return actualName; + } + + @Override + public UserTypeEnum getUserType() { + return userType; + } + + @Override + public String getIp() { + return this.ip; + } + + @Override + public String getUserAgent() { + return this.userAgent; + } +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/domain/LoginForm.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/domain/LoginForm.java new file mode 100644 index 00000000..85ffacd3 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/domain/LoginForm.java @@ -0,0 +1,41 @@ +package net.lab1024.sa.admin.module.system.login.domain; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum; +import net.lab1024.sa.common.common.util.SmartVerificationUtil; +import net.lab1024.sa.common.common.validator.enumeration.CheckEnum; +import net.lab1024.sa.common.module.support.captcha.domain.CaptchaForm; +import net.lab1024.sa.common.module.support.token.LoginDeviceEnum; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Pattern; + +/** + * 员工登录 + * + * @Author 1024创新实验室: 开云 + * @Date 2021-12-19 11:49:45 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +public class LoginForm extends CaptchaForm { + + @ApiModelProperty("登录名") + @NotBlank(message = "登录名不能为空") + @Length(max = 30, message = "登录账号最多30字符") + private String loginName; + + @ApiModelProperty("密码") + @NotBlank(message = "密码不能为空") + @Pattern(regexp = SmartVerificationUtil.PWD_REGEXP, message = "请输入8-15位密码(数字|大小写字母|小数点)") + private String password; + + @ApiModelProperty(value = "登录终端") + @ApiModelPropertyEnum(LoginDeviceEnum.class) + @CheckEnum(value = LoginDeviceEnum.class, required = true, message = "此终端不允许登录") + private Integer loginDevice; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/service/LoginService.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/service/LoginService.java new file mode 100644 index 00000000..bc0b1bfa --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/service/LoginService.java @@ -0,0 +1,272 @@ +package net.lab1024.sa.admin.module.system.login.service; + +import cn.hutool.extra.servlet.ServletUtil; +import com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap; +import lombok.extern.slf4j.Slf4j; +import net.lab1024.sa.admin.module.system.department.domain.vo.DepartmentVO; +import net.lab1024.sa.admin.module.system.department.service.DepartmentService; +import net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity; +import net.lab1024.sa.admin.module.system.employee.service.EmployeePermissionService; +import net.lab1024.sa.admin.module.system.employee.service.EmployeeService; +import net.lab1024.sa.admin.module.system.login.domain.LoginEmployeeDetail; +import net.lab1024.sa.admin.module.system.login.domain.LoginForm; +import net.lab1024.sa.admin.module.system.menu.domain.vo.MenuVO; +import net.lab1024.sa.common.common.constant.RequestHeaderConst; +import net.lab1024.sa.common.common.constant.StringConst; +import net.lab1024.sa.common.common.domain.RequestUser; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.enumeration.UserTypeEnum; +import net.lab1024.sa.common.common.util.SmartBeanUtil; +import net.lab1024.sa.common.common.util.SmartEnumUtil; +import net.lab1024.sa.common.module.support.captcha.CaptchaService; +import net.lab1024.sa.common.module.support.captcha.domain.CaptchaVO; +import net.lab1024.sa.common.module.support.config.ConfigKeyEnum; +import net.lab1024.sa.common.module.support.config.ConfigService; +import net.lab1024.sa.common.module.support.loginlog.LoginLogResultEnum; +import net.lab1024.sa.common.module.support.loginlog.LoginLogService; +import net.lab1024.sa.common.module.support.loginlog.domain.LoginLogEntity; +import net.lab1024.sa.common.module.support.loginlog.domain.LoginLogVO; +import net.lab1024.sa.common.module.support.token.LoginDeviceEnum; +import net.lab1024.sa.common.module.support.token.TokenService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.servlet.http.HttpServletRequest; +import java.time.LocalDateTime; +import java.util.List; +import java.util.concurrent.ConcurrentMap; + +/** + * 员工 登录服务 + * + * @Author 1024创新实验室: 开云 + * @Date 2021-12-01 22:56:34 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Slf4j +@Service +public class LoginService { + + @Autowired + private EmployeeService employeeService; + + @Autowired + private DepartmentService departmentService; + + @Autowired + private TokenService tokenService; + + @Autowired + private CaptchaService captchaService; + + @Autowired + private EmployeePermissionService employeePermissionService; + + @Autowired + private ConfigService configService; + + @Autowired + private LoginLogService loginLogService; + + /** + * 登录信息二级缓存 + */ + private ConcurrentMap loginUserDetailCache = new ConcurrentLinkedHashMap.Builder().maximumWeightedCapacity(1000).build(); + + /** + * 获取验证码 + * + * @return + */ + public ResponseDTO getCaptcha() { + return ResponseDTO.ok(captchaService.generateCaptcha()); + } + + /** + * 员工登陆 + * + * @param loginForm + * @return 返回用户登录信息 + */ + public ResponseDTO login(LoginForm loginForm, String ip, String userAgent) { + LoginDeviceEnum loginDeviceEnum = SmartEnumUtil.getEnumByValue(loginForm.getLoginDevice(), LoginDeviceEnum.class); + if (loginDeviceEnum == null) { + return ResponseDTO.userErrorParam("登录设备暂不支持!"); + } + // 校验 图形验证码 + ResponseDTO checkCaptcha = captchaService.checkCaptcha(loginForm); + if (!checkCaptcha.getOk()) { + return ResponseDTO.error(checkCaptcha); + } + + /** + * 验证账号和账号状态 + */ + EmployeeEntity employeeEntity = employeeService.getByLoginName(loginForm.getLoginName()); + if (null == employeeEntity) { + return ResponseDTO.userErrorParam("登录名不存在!"); + } + + if (employeeEntity.getDisabledFlag()) { + saveLoginLog(employeeEntity, ip, userAgent, "账号已禁用", LoginLogResultEnum.LOGIN_FAIL); + return ResponseDTO.userErrorParam("您的账号已被禁用,请联系工作人员!"); + } + /** + * 验证密码: + * 1、万能密码 + * 2、真实密码 + */ + String superPassword = EmployeeService.getEncryptPwd(configService.getConfigValue(ConfigKeyEnum.SUPER_PASSWORD)); + String requestPassword = EmployeeService.getEncryptPwd(loginForm.getPassword()); + if (!(superPassword.equals(requestPassword) || employeeEntity.getLoginPwd().equals(requestPassword))) { + saveLoginLog(employeeEntity, ip, userAgent, "密码错误", LoginLogResultEnum.LOGIN_FAIL); + return ResponseDTO.userErrorParam("登录名或密码错误!"); + } + + // 生成 登录token,保存token + Boolean superPasswordFlag = superPassword.equals(requestPassword); + String token = tokenService.generateToken(employeeEntity.getEmployeeId(), employeeEntity.getActualName(), UserTypeEnum.ADMIN_EMPLOYEE, loginDeviceEnum, superPasswordFlag); + + //获取员工登录信息 + LoginEmployeeDetail loginEmployeeDetail = loadLoginInfo(employeeEntity); + loginEmployeeDetail.setToken(token); + + // 放入缓存 + loginUserDetailCache.put(employeeEntity.getEmployeeId(), loginEmployeeDetail); + + //保存登录记录 + saveLoginLog(employeeEntity, ip, userAgent, superPasswordFlag ? "万能密码登录" : loginDeviceEnum.getDesc(), LoginLogResultEnum.LOGIN_SUCCESS); + + return ResponseDTO.ok(loginEmployeeDetail); + } + + + /** + * 获取登录的用户信息 + * + * @return + */ + private LoginEmployeeDetail loadLoginInfo(EmployeeEntity employeeEntity) { + LoginEmployeeDetail loginEmployeeDetail = SmartBeanUtil.copy(employeeEntity, LoginEmployeeDetail.class); + loginEmployeeDetail.setUserType(UserTypeEnum.ADMIN_EMPLOYEE); + + //部门信息 + DepartmentVO department = departmentService.getDepartmentById(employeeEntity.getDepartmentId()); + loginEmployeeDetail.setDepartmentName(null == department ? StringConst.EMPTY : department.getName()); + + /** + * 获取前端菜单和后端权限 + * 1、从数据库获取所有的权限 + * 2、拼凑成菜单和后端权限 + */ + List menuAndPointsList = employeePermissionService.getEmployeeMenuAndPointsList(employeeEntity.getEmployeeId(), employeeEntity.getAdministratorFlag()); + //前端菜单 + loginEmployeeDetail.setMenuList(menuAndPointsList); + //后端权限 + loginEmployeeDetail.setAuthorities(employeePermissionService.buildAuthorities(menuAndPointsList)); + + //上次登录信息 + LoginLogVO loginLogVO = loginLogService.queryLastByUserId(employeeEntity.getEmployeeId(), UserTypeEnum.ADMIN_EMPLOYEE); + if (loginLogVO != null) { + loginEmployeeDetail.setLastLoginIp(loginLogVO.getLoginIp()); + loginEmployeeDetail.setLastLoginTime(loginLogVO.getCreateTime()); + loginEmployeeDetail.setLastLoginUserAgent(loginLogVO.getUserAgent()); + } + + return loginEmployeeDetail; + } + + /** + * 保存登录日志 + * + * @param employeeEntity + * @param ip + * @param userAgent + */ + private void saveLoginLog(EmployeeEntity employeeEntity, String ip, String userAgent, String remark, LoginLogResultEnum result) { + LoginLogEntity loginEntity = LoginLogEntity.builder() + .userId(employeeEntity.getEmployeeId()) + .userType(UserTypeEnum.ADMIN_EMPLOYEE.getValue()) + .userName(employeeEntity.getActualName()) + .userAgent(userAgent) + .loginIp(ip) + .remark(remark) + .loginResult(result.getValue()) + .createTime(LocalDateTime.now()) + .build(); + loginLogService.log(loginEntity); + } + + + /** + * 移除用户信息缓存 + * + * @param requestUserId + */ + public void removeLoginUserDetailCache(Long requestUserId) { + loginUserDetailCache.remove(requestUserId); + } + + /** + * 根据登陆token 获取员请求工信息 + * + * @param + * @return + */ + public LoginEmployeeDetail getLoginUserDetail(String token, HttpServletRequest request) { + Long requestUserId = tokenService.getUserIdAndValidateToken(token); + if (requestUserId == null) { + return null; + } + // 查询用户信息 + LoginEmployeeDetail loginEmployeeDetail = loginUserDetailCache.get(requestUserId); + if (loginEmployeeDetail == null) { + // 员工基本信息 + EmployeeEntity employeeEntity = employeeService.getById(requestUserId); + if (employeeEntity == null) { + return null; + } + + loginEmployeeDetail = this.loadLoginInfo(employeeEntity); + loginEmployeeDetail.setToken(token); + loginUserDetailCache.put(requestUserId, loginEmployeeDetail); + } + + //更新请求ip和user agent + loginEmployeeDetail.setUserAgent(ServletUtil.getHeaderIgnoreCase(request, RequestHeaderConst.USER_AGENT)); + loginEmployeeDetail.setIp(ServletUtil.getClientIP(request)); + + return loginEmployeeDetail; + } + + + /** + * 退出登陆,清除token缓存 + * + * @return + */ + public ResponseDTO logout(String token, RequestUser requestUser) { + loginUserDetailCache.remove(requestUser.getUserId()); + tokenService.removeToken(token); + //保存登出日志 + saveLogoutLog(requestUser, requestUser.getIp(), requestUser.getUserAgent()); + return ResponseDTO.ok(); + } + + /** + * 保存登出日志 + */ + private void saveLogoutLog(RequestUser requestUser, String ip, String userAgent) { + LoginLogEntity loginEntity = LoginLogEntity.builder() + .userId(requestUser.getUserId()) + .userName(requestUser.getUserName()) + .userAgent(userAgent) + .loginIp(ip) + .loginResult(LoginLogResultEnum.LOGIN_OUT.getValue()) + .createTime(LocalDateTime.now()) + .build(); + loginLogService.log(loginEntity); + } +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/constant/MenuPermsTypeEnum.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/constant/MenuPermsTypeEnum.java new file mode 100644 index 00000000..c277026b --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/constant/MenuPermsTypeEnum.java @@ -0,0 +1,46 @@ +package net.lab1024.sa.admin.module.system.menu.constant; + + +import net.lab1024.sa.common.common.enumeration.BaseEnum; + +/** + * 权限类型 + * + * @Author 1024创新实验室: 善逸 + * @Date 2022-03-06 22:04:37 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public enum MenuPermsTypeEnum implements BaseEnum { + /** + * SpringSecurity模式 + */ + SPRING_SECURITY(1, "SpringSecurity模式"), + /** + * URL模式 + */ + URL(2, "URL模式"), + + ; + + private Integer value; + + private String desc; + + + MenuPermsTypeEnum(Integer value, String desc) { + this.value = value; + this.desc = desc; + } + + @Override + public Integer getValue() { + return value; + } + + @Override + public String getDesc() { + return desc; + } +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/constant/MenuTypeEnum.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/constant/MenuTypeEnum.java new file mode 100644 index 00000000..06c21540 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/constant/MenuTypeEnum.java @@ -0,0 +1,48 @@ +package net.lab1024.sa.admin.module.system.menu.constant; + + +import net.lab1024.sa.common.common.enumeration.BaseEnum; + +/** + * 菜单类型枚举 + * + * @Author 1024创新实验室: 善逸 + * @Date 2022-03-06 22:04:37 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public enum MenuTypeEnum implements BaseEnum { + /** + * 目录 + */ + CATALOG(1, "目录"), + /** + * 菜单 + */ + MENU(2, "菜单"), + /** + * 功能点 + */ + POINTS(3, "功能点"); + + private Integer value; + + private String desc; + + + MenuTypeEnum(Integer value, String desc) { + this.value = value; + this.desc = desc; + } + + @Override + public Integer getValue() { + return value; + } + + @Override + public String getDesc() { + return desc; + } +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/controller/MenuController.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/controller/MenuController.java new file mode 100644 index 00000000..d0b921e7 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/controller/MenuController.java @@ -0,0 +1,86 @@ +package net.lab1024.sa.admin.module.system.menu.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import net.lab1024.sa.admin.common.AdminBaseController; +import net.lab1024.sa.admin.constant.AdminSwaggerTagConst; +import net.lab1024.sa.admin.module.system.menu.domain.form.MenuAddForm; +import net.lab1024.sa.admin.module.system.menu.domain.form.MenuUpdateForm; +import net.lab1024.sa.admin.module.system.menu.domain.vo.MenuTreeVO; +import net.lab1024.sa.admin.module.system.menu.domain.vo.MenuVO; +import net.lab1024.sa.admin.module.system.menu.service.MenuService; +import net.lab1024.sa.common.common.domain.RequestUrlVO; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.util.SmartRequestUtil; +import net.lab1024.sa.common.module.support.operatelog.annoation.OperateLog; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + +/** + * 菜单 + * + * @Author 1024创新实验室: 善逸 + * @Date 2022-03-06 22:04:37 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@OperateLog +@RestController +@Api(tags = {AdminSwaggerTagConst.System.SYSTEM_MENU}) +public class MenuController extends AdminBaseController { + + @Autowired + private MenuService menuService; + + @ApiOperation(value = "添加菜单 @author 卓大") + @PostMapping("/menu/add") + @PreAuthorize("@saAuth.checkPermission('system:menu:add')") + public ResponseDTO addMenu(@RequestBody @Valid MenuAddForm menuAddForm) { + menuAddForm.setCreateUserId(SmartRequestUtil.getRequestUserId()); + return menuService.addMenu(menuAddForm); + } + + @ApiOperation(value = "更新菜单 @author 卓大") + @PostMapping("/menu/update") + @PreAuthorize("@saAuth.checkPermission('system:menu:update')") + public ResponseDTO updateMenu(@RequestBody @Valid MenuUpdateForm menuUpdateForm) { + menuUpdateForm.setUpdateUserId(SmartRequestUtil.getRequestUserId()); + return menuService.updateMenu(menuUpdateForm); + } + + @ApiOperation(value = "批量删除菜单 @author 卓大") + @GetMapping("/menu/batchDelete") + @PreAuthorize("@saAuth.checkPermission('system:menu:delete,system:menu:batch:delete')") + public ResponseDTO batchDeleteMenu(@RequestParam("menuIdList") List menuIdList) { + return menuService.batchDeleteMenu(menuIdList, SmartRequestUtil.getRequestUserId()); + } + + @ApiOperation(value = "查询菜单列表 @author 卓大") + @GetMapping("/menu/query") + public ResponseDTO> queryMenuList() { + return ResponseDTO.ok(menuService.queryMenuList(null)); + } + + @ApiOperation(value = "查询菜单详情 @author 卓大") + @GetMapping("/menu/detail/{menuId}") + public ResponseDTO getMenuDetail(@PathVariable Long menuId) { + return menuService.getMenuDetail(menuId); + } + + @ApiOperation(value = "查询菜单树 @author 卓大") + @GetMapping("/menu/tree") + public ResponseDTO> queryMenuTree(@RequestParam("onlyMenu") Boolean onlyMenu) { + return menuService.queryMenuTree(onlyMenu); + } + + @ApiOperation(value = "获取所有请求路径 @author 卓大") + @GetMapping("/menu/auth/url") + public ResponseDTO> getAuthUrl() { + return menuService.getAuthUrl(); + } +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/dao/MenuDao.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/dao/MenuDao.java new file mode 100644 index 00000000..468046bd --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/dao/MenuDao.java @@ -0,0 +1,105 @@ +package net.lab1024.sa.admin.module.system.menu.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Component; +import net.lab1024.sa.admin.module.system.menu.domain.entity.MenuEntity; +import net.lab1024.sa.admin.module.system.menu.domain.vo.MenuVO; + +import java.util.List; + +/** + * 菜单 dao + * + * @Author 1024创新实验室: 善逸 + * @Date 2022-03-06 22:04:37 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Mapper +@Component +public interface MenuDao extends BaseMapper { + + /** + * 根据名称查询同一级下的菜单 + * + * @param menuName 菜单名 + * @param parentId 父级id + * @param deletedFlag 是否删除 + * @return + */ + MenuEntity getByMenuName(@Param("menuName") String menuName, @Param("parentId") Long parentId, @Param("deletedFlag") Boolean deletedFlag); + + /** + * 根据前端权限字符串查询菜单 + * + * @param webPerms 前端权限字符串 + * @param deletedFlag 是否删除 + * @return + */ + MenuEntity getByWebPerms(@Param("webPerms") String webPerms, @Param("deletedFlag") Boolean deletedFlag); + + /** + * 根据菜单ID删除菜单(逻辑删除) + * + * @param menuIdList 菜单id集合 + * @param updateUserId 操作人id + * @param deletedFlag 是否删除 + */ + void deleteByMenuIdList(@Param("menuIdList") List menuIdList, @Param("updateUserId") Long updateUserId, @Param("deletedFlag") Boolean deletedFlag); + + /** + * 查询菜单列表 + * + * @param deletedFlag 是否删除 + * @param disabledFlag 是否禁用 + * @param menuTypeList 菜单类型集合 + * @return + */ + List queryMenuList(@Param("deletedFlag") Boolean deletedFlag, @Param("disabledFlag") Boolean disabledFlag, @Param("menuTypeList") List menuTypeList); + + + /** + * 根据菜单ID 查询功能点列表 + * + * @param menuId 菜单id + * @param menuType 菜单类型 + * @param deletedFlag 删除标记 + * @return + */ + List getPointListByMenuId(@Param("menuId") Long menuId, @Param("menuType") Integer menuType, @Param("deletedFlag") Boolean deletedFlag); + + /** + * 根据员工ID查询菜单列表 + * + * @param deletedFlag 是否删除 + * @param disabledFlag 禁用标识 + * @param employeeId 员工id + * @return + */ + List queryMenuByEmployeeId(@Param("deletedFlag") Boolean deletedFlag, + @Param("disabledFlag") Boolean disabledFlag, + @Param("employeeId") Long employeeId); + + /** + * 根据菜单类型查询 + * + * @param menuType 菜单类型 + * @param deletedFlag 删除 + * @param disabledFlag 禁用 + * @return + */ + List queryMenuByType(@Param("menuType") Integer menuType, + @Param("deletedFlag") Boolean deletedFlag, + @Param("disabledFlag") Boolean disabledFlag); + + /** + * 查询孩子id + * + * @param menuIdList + * @return + */ + List selectMenuIdByParentIdList(@Param("menuIdList") List menuIdList); +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/domain/entity/MenuEntity.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/domain/entity/MenuEntity.java new file mode 100644 index 00000000..41fd3061 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/domain/entity/MenuEntity.java @@ -0,0 +1,139 @@ +package net.lab1024.sa.admin.module.system.menu.domain.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import net.lab1024.sa.admin.module.system.menu.constant.MenuPermsTypeEnum; +import net.lab1024.sa.admin.module.system.menu.constant.MenuTypeEnum; +import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum; +import net.lab1024.sa.common.common.validator.enumeration.CheckEnum; + +import java.time.LocalDateTime; + +/** + * 菜单 表 + * + * @Author 1024创新实验室: 善逸 + * @Date 2022-03-06 22:04:37 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +@TableName(value = "t_menu") +public class MenuEntity { + + /** + * 菜单ID + */ + @TableId(type = IdType.AUTO) + private Long menuId; + + /** + * 菜单名称 + */ + private String menuName; + + /** + * 类型 + * + * @see MenuTypeEnum + */ + private Integer menuType; + + /** + * 父菜单ID + */ + private Long parentId; + + /** + * 显示顺序 + */ + private Integer sort; + + /** + * 路由地址 + */ + private String path; + + /** + * 组件路径 + */ + private String component; + + /** + * 是否为外链 + */ + private Boolean frameFlag; + + /** + * 外链地址 + */ + private String frameUrl; + + /** + * 是否缓存 + */ + private Boolean cacheFlag; + + /** + * 显示状态 + */ + private Boolean visibleFlag; + + /** + * 禁用状态 + */ + private Boolean disabledFlag; + + /** + * 后端权限字符串 + */ + private String apiPerms; + + /** + * 权限类型 + */ + private Integer permsType; + + /** + * 前端权限字符串 + */ + private String webPerms; + + /** + * 菜单图标 + */ + private String icon; + + /** + * 功能点关联菜单ID + */ + private Long contextMenuId; + + /** + * 删除状态 + */ + private Boolean deletedFlag; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 创建人 + */ + private Long createUserId; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; + + /** + * 更新人 + */ + private Long updateUserId; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/domain/form/MenuAddForm.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/domain/form/MenuAddForm.java new file mode 100644 index 00000000..afc8e250 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/domain/form/MenuAddForm.java @@ -0,0 +1,20 @@ +package net.lab1024.sa.admin.module.system.menu.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * 菜单 添加表单 + * + * @Author 1024创新实验室: 善逸 + * @Date 2022-03-06 22:04:37 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class MenuAddForm extends MenuBaseForm { + + @ApiModelProperty(hidden = true) + private Long createUserId; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/domain/form/MenuBaseForm.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/domain/form/MenuBaseForm.java new file mode 100644 index 00000000..f404535f --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/domain/form/MenuBaseForm.java @@ -0,0 +1,86 @@ +package net.lab1024.sa.admin.module.system.menu.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.admin.module.system.menu.constant.MenuPermsTypeEnum; +import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum; +import net.lab1024.sa.common.common.validator.enumeration.CheckEnum; +import org.hibernate.validator.constraints.Length; +import net.lab1024.sa.admin.module.system.menu.constant.MenuTypeEnum; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.util.List; + +/** + * 菜单基础 + * + * @Author 1024创新实验室: 善逸 + * @Date 2022-03-06 22:04:37 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class MenuBaseForm { + + @ApiModelProperty("菜单名称") + @NotBlank(message = "菜单名称不能为空") + @Length(max = 30, message = "菜单名称最多30个字符") + private String menuName; + + @ApiModelPropertyEnum(value = MenuTypeEnum.class, desc = "类型") + @CheckEnum(value = MenuTypeEnum.class, message = "类型错误") + private Integer menuType; + + @ApiModelProperty("父菜单ID 无上级可传0") + @NotNull(message = "父菜单ID不能为空") + private Long parentId; + + @ApiModelProperty("显示顺序") + private Integer sort; + + @ApiModelProperty("路由地址") + private String path; + + @ApiModelProperty("组件路径") + private String component; + + @ApiModelProperty("是否为外链") + @NotNull(message = "是否为外链不能为空") + private Boolean frameFlag; + + @ApiModelProperty("外链地址") + private String frameUrl; + + @ApiModelProperty("是否缓存") + @NotNull(message = "是否缓存不能为空") + private Boolean cacheFlag; + + @ApiModelProperty("显示状态") + @NotNull(message = "显示状态不能为空") + private Boolean visibleFlag; + + @ApiModelProperty("禁用状态") + @NotNull(message = "禁用状态不能为空") + private Boolean disabledFlag; + + @ApiModelPropertyEnum(value = MenuPermsTypeEnum.class, desc = "权限类型 ") + @CheckEnum(value = MenuPermsTypeEnum.class, message = "权限类型") + private Integer permsType; + + @ApiModelProperty("前端权限字符串") + private String webPerms; + + @ApiModelProperty("后端端权限字符串") + private String apiPerms; + + @ApiModelProperty("后端接口权限集合(拆分)") + private List apiPermsList; + + @ApiModelProperty("菜单图标") + private String icon; + + @ApiModelProperty("功能点关联菜单ID") + private Long contextMenuId; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/domain/form/MenuPointsOperateForm.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/domain/form/MenuPointsOperateForm.java new file mode 100644 index 00000000..edf28ae7 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/domain/form/MenuPointsOperateForm.java @@ -0,0 +1,43 @@ +package net.lab1024.sa.admin.module.system.menu.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.util.List; + +/** + * 菜单功能点操作Form + * + * @Author 1024创新实验室: 善逸 + * @Date 2022-03-06 22:04:37 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class MenuPointsOperateForm { + + @ApiModelProperty("菜单ID") + private Long menuId; + + @ApiModelProperty("功能点名称") + @NotBlank(message = "功能点不能为空") + @Length(max = 30, message = "功能点最多30个字符") + private String menuName; + + @ApiModelProperty("禁用状态") + @NotNull(message = "禁用状态不能为空") + private Boolean disabledFlag; + + @ApiModelProperty("后端接口权限集合") + private List apiPermsList; + + @ApiModelProperty("权限字符串") + private String webPerms; + + @ApiModelProperty("功能点关联菜单ID") + private Long contextMenuId; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/domain/form/MenuUpdateForm.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/domain/form/MenuUpdateForm.java new file mode 100644 index 00000000..c0a39f1e --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/domain/form/MenuUpdateForm.java @@ -0,0 +1,26 @@ +package net.lab1024.sa.admin.module.system.menu.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * 菜单 更新Form + * + * @Author 1024创新实验室: 善逸 + * @Date 2022-03-06 22:04:37 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class MenuUpdateForm extends MenuBaseForm { + + @ApiModelProperty("菜单ID") + @NotNull(message = "菜单ID不能为空") + private Long menuId; + + @ApiModelProperty(hidden = true) + private Long updateUserId; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/domain/vo/MenuSimpleTreeVO.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/domain/vo/MenuSimpleTreeVO.java new file mode 100644 index 00000000..560aca3e --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/domain/vo/MenuSimpleTreeVO.java @@ -0,0 +1,37 @@ +package net.lab1024.sa.admin.module.system.menu.domain.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * 简易的菜单VO + * + * @Author 1024创新实验室: 善逸 + * @Date 2022-03-06 22:04:37 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class MenuSimpleTreeVO { + + @ApiModelProperty("菜单ID") + private Long menuId; + + @ApiModelProperty("菜单名称") + private String menuName; + + @ApiModelProperty("功能点关联菜单ID") + private Long contextMenuId; + + @ApiModelProperty("父级菜单ID") + private Long parentId; + + @ApiModelProperty("菜单类型") + private Integer menuType; + + @ApiModelProperty("子菜单") + private List children; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/domain/vo/MenuTreeVO.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/domain/vo/MenuTreeVO.java new file mode 100644 index 00000000..0930c968 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/domain/vo/MenuTreeVO.java @@ -0,0 +1,22 @@ +package net.lab1024.sa.admin.module.system.menu.domain.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * 菜单 + * + * @Author 1024创新实验室: 善逸 + * @Date 2022-03-06 22:04:37 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class MenuTreeVO extends MenuVO{ + + @ApiModelProperty("菜单子集") + private List children; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/domain/vo/MenuVO.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/domain/vo/MenuVO.java new file mode 100644 index 00000000..d8e68ad9 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/domain/vo/MenuVO.java @@ -0,0 +1,35 @@ +package net.lab1024.sa.admin.module.system.menu.domain.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.admin.module.system.menu.domain.form.MenuBaseForm; + +import java.time.LocalDateTime; + +/** + * 菜单 + * + * @Author 1024创新实验室: 善逸 + * @Date 2022-03-06 22:04:37 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class MenuVO extends MenuBaseForm { + + @ApiModelProperty("菜单ID") + private Long menuId; + + @ApiModelProperty("创建时间") + private LocalDateTime createTime; + + @ApiModelProperty("创建人") + private Long createUserId; + + @ApiModelProperty("更新时间") + private LocalDateTime updateTime; + + @ApiModelProperty("更新人") + private Long updateUserId; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/manager/MenuManager.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/manager/MenuManager.java new file mode 100644 index 00000000..d57c81d3 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/manager/MenuManager.java @@ -0,0 +1,70 @@ +package net.lab1024.sa.admin.module.system.menu.manager; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import net.lab1024.sa.admin.module.system.menu.constant.MenuTypeEnum; +import net.lab1024.sa.admin.module.system.menu.dao.MenuDao; +import net.lab1024.sa.admin.module.system.menu.domain.entity.MenuEntity; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * 菜单Manager层 + * + * @Author 1024创新实验室: 善逸 + * @Date 2022-03-06 23:45:04 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Service +public class MenuManager extends ServiceImpl { + + /** + * 添加菜单 + * + * @param menuEntity + * @param pointEntityList + */ + @Transactional(rollbackFor = Exception.class) + public void addMenu(MenuEntity menuEntity, List pointEntityList) { + //添加菜单 + save(menuEntity); + //构建功能点 + pointEntityList.forEach(e -> { + e.setParentId(menuEntity.getMenuId()); + e.setMenuType(MenuTypeEnum.POINTS.getValue()); + e.setCreateUserId(menuEntity.getCreateUserId()); + }); + //批量添加功能点 + saveBatch(pointEntityList); + } + + /** + * 更新菜单 + * + * @param menuEntity + * @param savePointList + * @param deletePointList + * @param updatePointList + */ + @Transactional(rollbackFor = Exception.class) + public void updateMenu(MenuEntity menuEntity, List savePointList, List deletePointList, List updatePointList) { + //更新菜单 + updateById(menuEntity); + //构建新增功能点 + savePointList.forEach(e -> { + e.setParentId(menuEntity.getMenuId()); + e.setMenuType(MenuTypeEnum.POINTS.getValue()); + //因为更新操作人在menuEntity的UpdateUserId字段 + e.setCreateUserId(menuEntity.getUpdateUserId()); + }); + //批量添加功能点 + saveBatch(savePointList); + //批量删除功能点 + updateBatchById(deletePointList); + //批量更新功能点 + updateBatchById(updatePointList); + } +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/service/MenuService.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/service/MenuService.java new file mode 100644 index 00000000..4b3fa693 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/service/MenuService.java @@ -0,0 +1,290 @@ +package net.lab1024.sa.admin.module.system.menu.service; + +import cn.hutool.core.collection.CollectionUtil; +import com.google.common.collect.Lists; +import net.lab1024.sa.admin.module.system.menu.constant.MenuTypeEnum; +import net.lab1024.sa.admin.module.system.menu.dao.MenuDao; +import net.lab1024.sa.admin.module.system.menu.domain.entity.MenuEntity; +import net.lab1024.sa.admin.module.system.menu.domain.form.MenuAddForm; +import net.lab1024.sa.admin.module.system.menu.domain.form.MenuBaseForm; +import net.lab1024.sa.admin.module.system.menu.domain.form.MenuUpdateForm; +import net.lab1024.sa.admin.module.system.menu.domain.vo.MenuTreeVO; +import net.lab1024.sa.admin.module.system.menu.domain.vo.MenuVO; +import net.lab1024.sa.common.common.code.SystemErrorCode; +import net.lab1024.sa.common.common.domain.RequestUrlVO; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.util.SmartBeanUtil; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.math.NumberUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 菜单 + * + * @Author 1024创新实验室: 善逸 + * @Date 2022-03-08 22:15:09 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Service +public class MenuService { + + @Autowired + private MenuDao menuDao; + + @Autowired + private List authUrl; + + /** + * 添加菜单 + * + * @param menuAddForm + * @return + */ + public synchronized ResponseDTO addMenu(MenuAddForm menuAddForm) { + // 校验菜单名称 + if (this.validateMenuName(menuAddForm)) { + return ResponseDTO.userErrorParam("菜单名称已存在"); + } + // 校验前端权限字符串 + if (this.validateWebPerms(menuAddForm)) { + return ResponseDTO.userErrorParam("权限字符串已存在"); + } + MenuEntity menuEntity = SmartBeanUtil.copy(menuAddForm, MenuEntity.class); + // 处理接口权限 + List permsList = menuAddForm.getApiPermsList(); + if (!CollectionUtils.isEmpty(permsList)) { + String perms = StringUtils.join(permsList, ","); + menuEntity.setApiPerms(perms); + } + menuDao.insert(menuEntity); + return ResponseDTO.ok(); + } + + /** + * 更新菜单 + * + * @param menuUpdateForm + * @return + */ + public synchronized ResponseDTO updateMenu(MenuUpdateForm menuUpdateForm) { + //校验菜单是否存在 + MenuEntity selectMenu = menuDao.selectById(menuUpdateForm.getMenuId()); + if (selectMenu == null) { + return ResponseDTO.userErrorParam("菜单不存在"); + } + if (selectMenu.getDeletedFlag()) { + return ResponseDTO.userErrorParam("菜单已被删除"); + } + //校验菜单名称 + if (this.validateMenuName(menuUpdateForm)) { + return ResponseDTO.userErrorParam("菜单名称已存在"); + } + // 校验前端权限字符串 + if (this.validateWebPerms(menuUpdateForm)) { + return ResponseDTO.userErrorParam("权限字符串已存在"); + } + if (menuUpdateForm.getMenuId().equals(menuUpdateForm.getParentId())) { + return ResponseDTO.userErrorParam("上级菜单不能为自己"); + } + MenuEntity menuEntity = SmartBeanUtil.copy(menuUpdateForm, MenuEntity.class); + // 处理接口权限 + List permsList = menuUpdateForm.getApiPermsList(); + if (!CollectionUtils.isEmpty(permsList)) { + String perms = StringUtils.join(permsList, ","); + menuEntity.setApiPerms(perms); + } + menuDao.updateById(menuEntity); + return ResponseDTO.ok(); + } + + + /** + * 批量删除菜单 + * + * @param menuIdList + * @param employeeId + * @return + */ + public synchronized ResponseDTO batchDeleteMenu(List menuIdList, Long employeeId) { + if (CollectionUtils.isEmpty(menuIdList)) { + return ResponseDTO.userErrorParam("所选菜单不能为空"); + } + menuDao.deleteByMenuIdList(menuIdList, employeeId, Boolean.TRUE); + //孩子节点也需要删除 + this.recursiveDeleteChildren(menuIdList, employeeId); + return ResponseDTO.ok(); + } + + private void recursiveDeleteChildren(List menuIdList, Long employeeId) { + List childrenMenuIdList = menuDao.selectMenuIdByParentIdList(menuIdList); + if (CollectionUtil.isEmpty(childrenMenuIdList)) { + return; + } + menuDao.deleteByMenuIdList(childrenMenuIdList, employeeId, Boolean.TRUE); + recursiveDeleteChildren(childrenMenuIdList, employeeId); + } + + /** + * 校验菜单名称 + * + * @param menuDTO + * @param + * @return true 重复 false 未重复 + */ + public Boolean validateMenuName(T menuDTO) { + MenuEntity menu = menuDao.getByMenuName(menuDTO.getMenuName(), menuDTO.getParentId(), Boolean.FALSE); + if (menuDTO instanceof MenuAddForm) { + return menu != null; + } + if (menuDTO instanceof MenuUpdateForm) { + Long menuId = ((MenuUpdateForm) menuDTO).getMenuId(); + return menu != null && menu.getMenuId().longValue() != menuId.longValue(); + } + return true; + } + + /** + * 校验前端权限字符串 + * + * @param menuDTO + * @param + * @return true 重复 false 未重复 + */ + public Boolean validateWebPerms(T menuDTO) { + MenuEntity menu = menuDao.getByWebPerms(menuDTO.getWebPerms(), Boolean.FALSE); + if (menuDTO instanceof MenuAddForm) { + return menu != null; + } + if (menuDTO instanceof MenuUpdateForm) { + Long menuId = ((MenuUpdateForm) menuDTO).getMenuId(); + return menu != null && menu.getMenuId().longValue() != menuId.longValue(); + } + return true; + } + + /** + * 查询菜单列表 + * + * @return + */ + public List queryMenuList(Boolean disabledFlag) { + List menuVOList = menuDao.queryMenuList(Boolean.FALSE, disabledFlag, null); + //根据ParentId进行分组 + Map> parentMap = menuVOList.stream().collect(Collectors.groupingBy(MenuVO::getParentId, Collectors.toList())); + List filterMenuVOList = this.filterNoParentMenu(parentMap, NumberUtils.LONG_ZERO); + return filterMenuVOList; + } + + /** + * 过滤没有上级菜单的菜单列表 + * + * @param parentMap + * @param parentId + * @return + */ + private List filterNoParentMenu(Map> parentMap, Long parentId) { + // 获取本级菜单树List + List res = parentMap.getOrDefault(parentId, Lists.newArrayList()); + List childMenu = Lists.newArrayList(); + // 循环遍历下级菜单 + res.forEach(e -> { + //处理接口权限 + String perms = e.getApiPerms(); + if (StringUtils.isBlank(perms)) { + e.setApiPermsList(Lists.newArrayList()); + } else { + List permsList = Lists.newArrayList(StringUtils.split(perms, ",")); + e.setApiPermsList(permsList); + } + List menuList = this.filterNoParentMenu(parentMap, e.getMenuId()); + childMenu.addAll(menuList); + }); + res.addAll(childMenu); + return res; + } + + /** + * 查询菜单树 + * + * @param onlyMenu 不查询功能点 + * @return + */ + public ResponseDTO> queryMenuTree(Boolean onlyMenu) { + List menuTypeList = Lists.newArrayList(); + if (onlyMenu) { + menuTypeList = Lists.newArrayList(MenuTypeEnum.CATALOG.getValue(), MenuTypeEnum.MENU.getValue()); + } + List menuVOList = menuDao.queryMenuList(Boolean.FALSE, null, menuTypeList); + //根据ParentId进行分组 + Map> parentMap = menuVOList.stream().collect(Collectors.groupingBy(MenuVO::getParentId, Collectors.toList())); + List menuTreeVOList = this.buildMenuTree(parentMap, NumberUtils.LONG_ZERO); + return ResponseDTO.ok(menuTreeVOList); + } + + /** + * 构建菜单树 + * + * @return + */ + List buildMenuTree(Map> parentMap, Long parentId) { + // 获取本级菜单树List + List res = parentMap.getOrDefault(parentId, Lists.newArrayList()).stream() + .map(e -> SmartBeanUtil.copy(e, MenuTreeVO.class)).collect(Collectors.toList()); + // 循环遍历下级菜单 + res.forEach(e -> { + //处理接口权限 + String perms = e.getApiPerms(); + if (StringUtils.isBlank(perms)) { + e.setApiPermsList(Lists.newArrayList()); + } else { + List permsList = Lists.newArrayList(StringUtils.split(perms, ",")); + e.setApiPermsList(permsList); + } + e.setChildren(this.buildMenuTree(parentMap, e.getMenuId())); + }); + return res; + } + + /** + * 查询菜单详情 + * + * @param menuId + * @return + */ + public ResponseDTO getMenuDetail(Long menuId) { + //校验菜单是否存在 + MenuEntity selectMenu = menuDao.selectById(menuId); + if (selectMenu == null) { + return ResponseDTO.error(SystemErrorCode.SYSTEM_ERROR, "菜单不存在"); + } + if (selectMenu.getDeletedFlag()) { + return ResponseDTO.error(SystemErrorCode.SYSTEM_ERROR, "菜单已被删除"); + } + MenuVO menuVO = SmartBeanUtil.copy(selectMenu, MenuVO.class); + //处理接口权限 + String perms = menuVO.getApiPerms(); + if (!StringUtils.isBlank(perms)) { + List permsList = Lists.newArrayList(StringUtils.split(perms, ",")); + menuVO.setApiPermsList(permsList); + } + return ResponseDTO.ok(menuVO); + } + + /** + * 获取系统所有请求路径 + * + * @return + */ + public ResponseDTO> getAuthUrl() { + return ResponseDTO.ok(authUrl); + } + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/controller/RoleController.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/controller/RoleController.java new file mode 100644 index 00000000..4fcdc2d2 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/controller/RoleController.java @@ -0,0 +1,70 @@ +package net.lab1024.sa.admin.module.system.role.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import net.lab1024.sa.admin.common.AdminBaseController; +import net.lab1024.sa.admin.constant.AdminSwaggerTagConst; +import net.lab1024.sa.admin.module.system.role.domain.form.RoleAddForm; +import net.lab1024.sa.admin.module.system.role.domain.form.RoleUpdateForm; +import net.lab1024.sa.admin.module.system.role.domain.vo.RoleVO; +import net.lab1024.sa.admin.module.system.role.service.RoleService; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.module.support.operatelog.annoation.OperateLog; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + +/** + * 角色 + * + * @Author 1024创新实验室: 胡克 + * @Date 2021-12-14 19:40:28 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@OperateLog +@RestController +@Api(tags = {AdminSwaggerTagConst.System.SYSTEM_ROLE}) +public class RoleController extends AdminBaseController { + + @Autowired + private RoleService roleService; + + @ApiOperation("添加角色 @author 卓大") + @PostMapping("/role/add") + @PreAuthorize("@saAuth.checkPermission('system:role:add')") + public ResponseDTO addRole(@Valid @RequestBody RoleAddForm roleAddForm) { + return roleService.addRole(roleAddForm); + } + + @ApiOperation("删除角色 @author 卓大") + @GetMapping("/role/delete/{roleId}") + @PreAuthorize("@saAuth.checkPermission('system:role:delete')") + public ResponseDTO deleteRole(@PathVariable Long roleId) { + return roleService.deleteRole(roleId); + } + + @ApiOperation("更新角色 @author 卓大") + @PostMapping("/role/update") + @PreAuthorize("@saAuth.checkPermission('system:role:update')") + public ResponseDTO updateRole(@Valid @RequestBody RoleUpdateForm roleUpdateDTO) { + return roleService.updateRole(roleUpdateDTO); + } + + @ApiOperation("获取角色数据 @author 卓大") + @GetMapping("/role/get/{roleId}") + public ResponseDTO getRole(@PathVariable("roleId") Long roleId) { + return roleService.getRoleById(roleId); + } + + @ApiOperation("获取所有角色 @author 卓大") + @GetMapping("/role/getAll") + public ResponseDTO> getAllRole() { + return roleService.getAllRole(); + } + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/controller/RoleDataScopeController.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/controller/RoleDataScopeController.java new file mode 100644 index 00000000..a2814595 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/controller/RoleDataScopeController.java @@ -0,0 +1,50 @@ +package net.lab1024.sa.admin.module.system.role.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import net.lab1024.sa.admin.common.AdminBaseController; +import net.lab1024.sa.admin.constant.AdminSwaggerTagConst; +import net.lab1024.sa.admin.module.system.role.domain.form.RoleDataScopeUpdateForm; +import net.lab1024.sa.admin.module.system.role.domain.vo.RoleDataScopeVO; +import net.lab1024.sa.admin.module.system.role.service.RoleDataScopeService; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.module.support.operatelog.annoation.OperateLog; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + +/** + * 角色的数据权限配置 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-02-26 22:09:59 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@OperateLog +@RestController +@Api(tags = {AdminSwaggerTagConst.System.SYSTEM_ROLE_DATA_SCOPE}) +public class RoleDataScopeController extends AdminBaseController { + + @Autowired + private RoleDataScopeService roleDataScopeService; + + @ApiOperation(value = "获取某角色所设置的数据范围 @author 卓大") + @GetMapping("/role/dataScope/getRoleDataScopeList/{roleId}") + public ResponseDTO> dataScopeListByRole(@PathVariable Long roleId) { + return roleDataScopeService.getRoleDataScopeList(roleId); + } + + @ApiOperation(value = "批量设置某角色数据范围 @author 卓大") + @PostMapping("/role/dataScope/updateRoleDataScopeList") + @PreAuthorize("@saAuth.checkPermission('system:role:dataScope:update')") + public ResponseDTO updateRoleDataScopeList(@RequestBody @Valid RoleDataScopeUpdateForm roleDataScopeUpdateForm) { + return roleDataScopeService.updateRoleDataScopeList(roleDataScopeUpdateForm); + } + + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/controller/RoleEmployeeController.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/controller/RoleEmployeeController.java new file mode 100644 index 00000000..19ad623c --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/controller/RoleEmployeeController.java @@ -0,0 +1,77 @@ +package net.lab1024.sa.admin.module.system.role.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import net.lab1024.sa.admin.common.AdminBaseController; +import net.lab1024.sa.admin.constant.AdminSwaggerTagConst; +import net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO; +import net.lab1024.sa.admin.module.system.role.domain.form.RoleEmployeeQueryForm; +import net.lab1024.sa.admin.module.system.role.domain.form.RoleEmployeeUpdateForm; +import net.lab1024.sa.admin.module.system.role.domain.vo.RoleSelectedVO; +import net.lab1024.sa.admin.module.system.role.service.RoleEmployeeService; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.module.support.operatelog.annoation.OperateLog; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + +/** + * 角色的员工 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-02-26 22:09:59 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@OperateLog +@RestController +@Api(tags = {AdminSwaggerTagConst.System.SYSTEM_ROLE_EMPLOYEE}) +public class RoleEmployeeController extends AdminBaseController { + + @Autowired + private RoleEmployeeService roleEmployeeService; + + @ApiOperation(value = "查询某个角色下的员工列表 @author 卓大") + @PostMapping("/role/employee/queryEmployee") + public ResponseDTO> queryEmployee(@Valid @RequestBody RoleEmployeeQueryForm roleEmployeeQueryForm) { + return roleEmployeeService.queryEmployee(roleEmployeeQueryForm); + } + + @ApiOperation(value = "获取某个角色下的所有员工列表(无分页) @author 卓大") + @GetMapping("/role/employee/getAllEmployeeByRoleId/{roleId}") + public ResponseDTO> listAllEmployeeRoleId(@PathVariable Long roleId) { + return ResponseDTO.ok(roleEmployeeService.getAllEmployeeByRoleId(roleId)); + } + + @ApiOperation(value = "从角色成员列表中移除员工 @author 卓大") + @GetMapping("/role/employee/removeEmployee") + @PreAuthorize("@saAuth.checkPermission('system:role:employee:delete')") + public ResponseDTO removeEmployee(Long employeeId, Long roleId) { + return roleEmployeeService.removeRoleEmployee(employeeId, roleId); + } + + @ApiOperation(value = "从角色成员列表中批量移除员工 @author 卓大") + @PostMapping("/role/employee/batchRemoveRoleEmployee") + @PreAuthorize("@saAuth.checkPermission('system:role:employee:batch:delete')") + public ResponseDTO batchRemoveEmployee(@Valid @RequestBody RoleEmployeeUpdateForm updateForm) { + return roleEmployeeService.batchRemoveRoleEmployee(updateForm); + } + + @ApiOperation(value = "角色成员列表中批量添加员工 @author 卓大") + @PostMapping("/role/employee/batchAddRoleEmployee") + @PreAuthorize("@saAuth.checkPermission('system:role:employee:add')") + public ResponseDTO addEmployeeList(@Valid @RequestBody RoleEmployeeUpdateForm addForm) { + return roleEmployeeService.batchAddRoleEmployee(addForm); + } + + @ApiOperation(value = "获取员工所有选中的角色和所有角色 @author 卓大") + @GetMapping("/role/employee/getRoles/{employeeId}") + public ResponseDTO> getRoleByEmployeeId(@PathVariable Long employeeId) { + return ResponseDTO.ok(roleEmployeeService.getRoleInfoListByEmployeeId(employeeId)); + } +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/controller/RoleMenuController.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/controller/RoleMenuController.java new file mode 100644 index 00000000..02e7b8c3 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/controller/RoleMenuController.java @@ -0,0 +1,47 @@ +package net.lab1024.sa.admin.module.system.role.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import net.lab1024.sa.admin.common.AdminBaseController; +import net.lab1024.sa.admin.constant.AdminSwaggerTagConst; +import net.lab1024.sa.admin.module.system.role.domain.form.RoleMenuUpdateForm; +import net.lab1024.sa.admin.module.system.role.domain.vo.RoleMenuTreeVO; +import net.lab1024.sa.admin.module.system.role.service.RoleMenuService; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.module.support.operatelog.annoation.OperateLog; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + +/** + * 角色的菜单 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-02-26 21:34:01 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@OperateLog +@RestController +@Api(tags = {AdminSwaggerTagConst.System.SYSTEM_ROLE_MENU}) +public class RoleMenuController extends AdminBaseController { + + @Autowired + private RoleMenuService roleMenuService; + + @ApiOperation("更新角色权限 @author 卓大") + @PostMapping("/role/menu/updateRoleMenu") + @PreAuthorize("@saAuth.checkPermission('system:role:menu:update')") + public ResponseDTO updateRoleMenu(@Valid @RequestBody RoleMenuUpdateForm updateDTO) { + return roleMenuService.updateRoleMenu(updateDTO); + } + + @ApiOperation("获取角色关联菜单权限 @author 卓大") + @GetMapping("/role/menu/getRoleSelectedMenu/{roleId}") + public ResponseDTO getRoleSelectedMenu(@PathVariable Long roleId) { + return roleMenuService.getRoleSelectedMenu(roleId); + } +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/dao/RoleDao.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/dao/RoleDao.java new file mode 100644 index 00000000..24ad753a --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/dao/RoleDao.java @@ -0,0 +1,29 @@ +package net.lab1024.sa.admin.module.system.role.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Component; +import net.lab1024.sa.admin.module.system.role.domain.entity.RoleEntity; + +/** + * 角色 dao + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022-02-26 21:34:01 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Mapper +@Component +public interface RoleDao extends BaseMapper { + + /** + * 根据角色名称查询 + * @param roleName + * @return + */ + RoleEntity getByRoleName(@Param("roleName") String roleName); + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/dao/RoleDataScopeDao.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/dao/RoleDataScopeDao.java new file mode 100644 index 00000000..281694ec --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/dao/RoleDataScopeDao.java @@ -0,0 +1,46 @@ +package net.lab1024.sa.admin.module.system.role.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Component; +import net.lab1024.sa.admin.module.system.role.domain.entity.RoleDataScopeEntity; + +import java.util.List; + + +/** + * 角色 数据权限 dao + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022-02-26 21:34:01 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Mapper +@Component +public interface RoleDataScopeDao extends BaseMapper { + + /** + * 获取某个角色的设置信息 + * @param roleId + * @return + */ + List listByRoleId(@Param("roleId") Long roleId); + + /** + * 获取某批角色的所有数据范围配置信息 + * @param roleIdList + * @return + */ + List listByRoleIdList(@Param("roleIdList") List roleIdList); + + /** + * 删除某个角色的设置信息 + * @param roleId + * @return + */ + void deleteByRoleId(@Param("roleId") Long roleId); + +} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleemployee/RoleEmployeeDao.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/dao/RoleEmployeeDao.java similarity index 50% rename from smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleemployee/RoleEmployeeDao.java rename to smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/dao/RoleEmployeeDao.java index 08a484e7..a2eaf954 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleemployee/RoleEmployeeDao.java +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/dao/RoleEmployeeDao.java @@ -1,25 +1,26 @@ -package net.lab1024.smartadmin.module.system.role.roleemployee; +package net.lab1024.sa.admin.module.system.role.dao; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import net.lab1024.smartadmin.module.system.employee.domain.dto.EmployeeDTO; -import net.lab1024.smartadmin.module.system.role.basic.domain.dto.RoleQueryDTO; -import net.lab1024.smartadmin.module.system.role.roleemployee.domain.RoleEmployeeEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Component; +import net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO; +import net.lab1024.sa.admin.module.system.role.domain.entity.RoleEmployeeEntity; +import net.lab1024.sa.admin.module.system.role.domain.form.RoleEmployeeQueryForm; +import net.lab1024.sa.admin.module.system.role.domain.vo.RoleEmployeeVO; import java.util.List; + /** - * [ ] + * 角色 员工 dao * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/3/27 0027 下午 13:00 - * @since JDK1.8 + * @Author 1024创新实验室: 罗伊 + * @Date 2022-03-07 18:54:42 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) */ @Mapper @Component @@ -33,19 +34,39 @@ public interface RoleEmployeeDao extends BaseMapper { List selectRoleIdByEmployeeId(@Param("employeeId") Long employeeId); /** - * - * @param page - * @param queryDTO + * 根据员工id 查询所有的角色 + * @param employeeIdList * @return */ - List selectEmployeeByNamePage(Page page, @Param("queryDTO") RoleQueryDTO queryDTO); + List selectRoleIdByEmployeeIdList(@Param("employeeIdList") List employeeIdList); + + /** + * 根据员工id 查询所有的角色 + * @param employeeIdList + * @return + */ + List selectRoleByEmployeeIdList(@Param("employeeIdList") List employeeIdList); + + /** + * 查询角色下的人员id + * @param roleIdList + * @return + */ + List selectEmployeeIdByRoleIdList(@Param("roleIdList") List roleIdList); + /** + * + * @param page + * @param roleEmployeeQueryForm + * @return + */ + List selectRoleEmployeeByName(Page page, @Param("queryForm") RoleEmployeeQueryForm roleEmployeeQueryForm); /** * * @param roleId * @return */ - List selectEmployeeByRoleId(@Param("roleId") Long roleId); + List selectEmployeeByRoleId(@Param("roleId") Long roleId); /** * 根据员工信息删除 * @param employeeId @@ -71,10 +92,4 @@ public interface RoleEmployeeDao extends BaseMapper { * @param employeeIds */ void batchDeleteEmployeeRole(@Param("roleId") Long roleId,@Param("employeeIds")List employeeIds); - - /** - * 批量新增 - * @param roleRelationList - */ - void batchInsert(List roleRelationList); } diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/dao/RoleMenuDao.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/dao/RoleMenuDao.java new file mode 100644 index 00000000..aed7cdd2 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/dao/RoleMenuDao.java @@ -0,0 +1,54 @@ +package net.lab1024.sa.admin.module.system.role.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import net.lab1024.sa.admin.module.system.menu.domain.entity.MenuEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Component; +import net.lab1024.sa.admin.module.system.role.domain.entity.RoleMenuEntity; + +import java.util.List; + +/** + * 角色 菜单 dao + * + * @Author 1024创新实验室: 善逸 + * @Date 2022-03-07 18:54:42 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Mapper +@Component +public interface RoleMenuDao extends BaseMapper { + + /** + * 根据角色ID删除菜单权限 + * + * @param roleId + */ + void deleteByRoleId(@Param("roleId") Long roleId); + + /** + * 根据角色ID查询选择的菜单权限 + * + * @param roleId + * @return + */ + List queryMenuIdByRoleId(@Param("roleId") Long roleId); + + /** + * 根据角色ID集合查询选择的菜单权限 + * + * @param roleIdList + * @return + */ + List selectMenuListByRoleIdList(@Param("roleIdList") List roleIdList, @Param("deletedFlag") Boolean deletedFlag); + + /** + * 查询所有的菜单角色 + * + * @return + */ + List queryAllRoleMenu(); +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/entity/RoleDataScopeEntity.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/entity/RoleDataScopeEntity.java new file mode 100644 index 00000000..1f2514e0 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/entity/RoleDataScopeEntity.java @@ -0,0 +1,53 @@ +package net.lab1024.sa.admin.module.system.role.domain.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import net.lab1024.sa.admin.module.system.datascope.constant.DataScopeTypeEnum; +import net.lab1024.sa.admin.module.system.datascope.constant.DataScopeViewTypeEnum; + +import java.time.LocalDateTime; + +/** + * 数据范围与角色关系 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022-03-07 18:54:42 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +@TableName("t_role_data_scope") +public class RoleDataScopeEntity { + /** + * 主键id + */ + @TableId(type = IdType.AUTO) + private Long id; + /** + * 数据范围id + * {@link DataScopeTypeEnum} + */ + private Integer dataScopeType; + /** + * 数据范围类型 + * {@link DataScopeViewTypeEnum} + */ + private Integer viewType; + /** + * 角色id + */ + private Long roleId; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; + + /** + * 创建时间 + */ + private LocalDateTime createTime; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/entity/RoleEmployeeEntity.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/entity/RoleEmployeeEntity.java new file mode 100644 index 00000000..4a8b9c46 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/entity/RoleEmployeeEntity.java @@ -0,0 +1,41 @@ +package net.lab1024.sa.admin.module.system.role.domain.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * 角色 员工关系 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022-03-07 18:54:42 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +@TableName("t_role_employee") +public class RoleEmployeeEntity { + + @TableId(type = IdType.AUTO) + private Long id; + + private Long roleId; + + private Long employeeId; + + private LocalDateTime updateTime; + + private LocalDateTime createTime; + + public RoleEmployeeEntity() { + } + + public RoleEmployeeEntity(Long roleId, Long employeeId) { + this.roleId = roleId; + this.employeeId = employeeId; + } +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/entity/RoleEntity.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/entity/RoleEntity.java new file mode 100644 index 00000000..7d963f7b --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/entity/RoleEntity.java @@ -0,0 +1,41 @@ +package net.lab1024.sa.admin.module.system.role.domain.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * 角色 + * + * @Author 1024创新实验室: 胡克 + * @Date 2022-03-07 18:54:42 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +@TableName("t_role") +public class RoleEntity { + /** + * 主键id + */ + @TableId(type = IdType.AUTO) + private Long roleId; + + private String roleName; + + private String remark; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; + + /** + * 创建时间 + */ + private LocalDateTime createTime; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/entity/RoleMenuEntity.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/entity/RoleMenuEntity.java new file mode 100644 index 00000000..36b0d80f --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/entity/RoleMenuEntity.java @@ -0,0 +1,49 @@ +package net.lab1024.sa.admin.module.system.role.domain.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * 角色 菜单 + * + * @Author 1024创新实验室: 善逸 + * @Date 2022-03-16 23:00:57 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +@TableName("t_role_menu") +public class RoleMenuEntity { + + /** + * 主键id + */ + @TableId(type = IdType.AUTO) + private Long roleMenuId; + + /** + * 角色 id + */ + private Long roleId; + + /** + * 菜单 id + */ + private Long menuId; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + +} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/domain/dto/RoleAddDTO.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/form/RoleAddForm.java similarity index 66% rename from smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/domain/dto/RoleAddDTO.java rename to smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/form/RoleAddForm.java index ba66b68e..f34113ea 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/domain/dto/RoleAddDTO.java +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/form/RoleAddForm.java @@ -1,4 +1,4 @@ -package net.lab1024.smartadmin.module.system.role.basic.domain.dto; +package net.lab1024.sa.admin.module.system.role.domain.form; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import org.hibernate.validator.constraints.Length; @@ -6,13 +6,16 @@ import org.hibernate.validator.constraints.Length; import javax.validation.constraints.NotNull; /** - * 角色添加DTO + * 角色 添加表单 * - * @author listen - * @date 2017/12/28 09:40 + * @Author 1024创新实验室: 胡克 + * @Date 2022-02-26 19:09:42 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) */ @Data -public class RoleAddDTO { +public class RoleAddForm { /** * 角色名称 diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/form/RoleDataScopeUpdateForm.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/form/RoleDataScopeUpdateForm.java new file mode 100644 index 00000000..6dbff70d --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/form/RoleDataScopeUpdateForm.java @@ -0,0 +1,43 @@ +package net.lab1024.sa.admin.module.system.role.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import java.util.List; + +/** + * 角色的数据范围更新 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022-04-08 21:53:04 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class RoleDataScopeUpdateForm { + + @ApiModelProperty("角色id") + @NotNull(message = "角色id不能为空") + private Long roleId; + + @ApiModelProperty("设置信息") + @Valid + private List dataScopeItemList; + + + @Data + public static class RoleUpdateDataScopeListFormItem { + + @ApiModelProperty("数据范围类型") + @NotNull(message = "数据范围类型不能为空") + private Integer dataScopeType; + + @ApiModelProperty("可见范围") + @NotNull(message = "可见范围不能为空") + private Integer viewType; + } + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/form/RoleEmployeeQueryForm.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/form/RoleEmployeeQueryForm.java new file mode 100644 index 00000000..c517d1fb --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/form/RoleEmployeeQueryForm.java @@ -0,0 +1,24 @@ +package net.lab1024.sa.admin.module.system.role.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.domain.PageParam; + +/** + * 角色的员工查询 + * + * @Author 1024创新实验室: 善逸 + * @Date 2022-04-08 21:53:04 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class RoleEmployeeQueryForm extends PageParam { + + @ApiModelProperty("关键字") + private String keywords; + + @ApiModelProperty("角色id") + private String roleId; +} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/domain/dto/RoleBatchDTO.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/form/RoleEmployeeUpdateForm.java similarity index 54% rename from smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/domain/dto/RoleBatchDTO.java rename to smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/form/RoleEmployeeUpdateForm.java index af01cf8c..3b5f9655 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/domain/dto/RoleBatchDTO.java +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/form/RoleEmployeeUpdateForm.java @@ -1,4 +1,4 @@ -package net.lab1024.smartadmin.module.system.role.basic.domain.dto; +package net.lab1024.sa.admin.module.system.role.domain.form; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -8,23 +8,23 @@ import javax.validation.constraints.NotNull; import java.util.List; /** - * 批量添加角色员工DTO + * 角色的员工更新 * - * @author listen - * @date 2017/12/29 15:38 + * @Author 1024创新实验室: 善逸 + * @Date 2022-04-08 21:53:04 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) */ @Data -public class RoleBatchDTO { +public class RoleEmployeeUpdateForm { @ApiModelProperty("角色id") @NotNull(message = "角色id不能为空") protected Long roleId; - /** - * 员工id集合 - */ @ApiModelProperty(value = "员工id集合") @NotEmpty(message = "员工id不能为空") - protected List employeeIds; + protected List employeeIdList; } diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/form/RoleMenuUpdateForm.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/form/RoleMenuUpdateForm.java new file mode 100644 index 00000000..559f67af --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/form/RoleMenuUpdateForm.java @@ -0,0 +1,35 @@ +package net.lab1024.sa.admin.module.system.role.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.util.List; + +/** + * 角色的菜单更新 + * + * @Author 1024创新实验室: 善逸 + * @Date 2022-04-08 21:53:04 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class RoleMenuUpdateForm { + + /** + * 角色id + */ + @ApiModelProperty("角色id") + @NotNull(message = "角色id不能为空") + private Long roleId; + + /** + * 菜单ID 集合 + */ + @ApiModelProperty("菜单ID集合") + @NotNull(message = "菜单ID不能为空") + private List menuIdList; + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/form/RoleQueryForm.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/form/RoleQueryForm.java new file mode 100644 index 00000000..a1f935fb --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/form/RoleQueryForm.java @@ -0,0 +1,24 @@ +package net.lab1024.sa.admin.module.system.role.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.domain.PageParam; + +/** + * 角色 查询 + * + * @Author 1024创新实验室: 胡克 + * @Date 2022-02-26 19:09:42 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class RoleQueryForm extends PageParam { + + @ApiModelProperty("角色名称") + private String roleName; + + @ApiModelProperty("角色id") + private String roleId; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/form/RoleUpdateForm.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/form/RoleUpdateForm.java new file mode 100644 index 00000000..0b937f26 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/form/RoleUpdateForm.java @@ -0,0 +1,27 @@ +package net.lab1024.sa.admin.module.system.role.domain.form; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * 角色更新修改 + * + * @Author 1024创新实验室: 胡克 + * @Date 2022-02-26 19:09:42 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class RoleUpdateForm extends RoleAddForm { + + /** + * 角色id + */ + @ApiModelProperty("角色id") + @NotNull(message = "角色id不能为空") + protected Long roleId; + + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/vo/RoleDataScopeVO.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/vo/RoleDataScopeVO.java new file mode 100644 index 00000000..dd11deb9 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/vo/RoleDataScopeVO.java @@ -0,0 +1,23 @@ +package net.lab1024.sa.admin.module.system.role.domain.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * 角色的数据范围 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022-04-08 21:53:04 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class RoleDataScopeVO { + + @ApiModelProperty("数据范围id") + private Integer dataScopeType; + + @ApiModelProperty("可见范围") + private Integer viewType; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/vo/RoleEmployeeVO.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/vo/RoleEmployeeVO.java new file mode 100644 index 00000000..04e63e33 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/vo/RoleEmployeeVO.java @@ -0,0 +1,22 @@ +package net.lab1024.sa.admin.module.system.role.domain.vo; + +import lombok.Data; + +/** + * 角色的员工 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022-04-08 21:53:04 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class RoleEmployeeVO { + + private Long roleId; + + private Long employeeId; + + private String roleName; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/vo/RoleMenuTreeVO.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/vo/RoleMenuTreeVO.java new file mode 100644 index 00000000..04013481 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/vo/RoleMenuTreeVO.java @@ -0,0 +1,29 @@ +package net.lab1024.sa.admin.module.system.role.domain.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.admin.module.system.menu.domain.vo.MenuSimpleTreeVO; + +import java.util.List; + +/** + * 角色菜单树 + * + * @Author 1024创新实验室: 善逸 + * @Date 2022-04-08 21:53:04 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class RoleMenuTreeVO { + + @ApiModelProperty("角色ID") + private Long roleId; + + @ApiModelProperty("菜单列表") + private List menuTreeList; + + @ApiModelProperty("选中的菜单ID") + private List selectedMenuId; +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/vo/RoleSelectedVO.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/vo/RoleSelectedVO.java new file mode 100644 index 00000000..e8204845 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/vo/RoleSelectedVO.java @@ -0,0 +1,20 @@ +package net.lab1024.sa.admin.module.system.role.domain.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * 选择角色 + * + * @Author 1024创新实验室: 善逸 + * @Date 2022-04-08 21:53:04 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class RoleSelectedVO extends RoleVO { + + @ApiModelProperty("角色名称") + private Boolean selected; +} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/domain/dto/RoleVO.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/vo/RoleVO.java similarity index 50% rename from smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/domain/dto/RoleVO.java rename to smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/vo/RoleVO.java index 9f3eed90..7edd1ada 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/domain/dto/RoleVO.java +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/vo/RoleVO.java @@ -1,23 +1,22 @@ -package net.lab1024.smartadmin.module.system.role.basic.domain.dto; +package net.lab1024.sa.admin.module.system.role.domain.vo; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** - * [ ] + * 角色 * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/3/27 0027 下午 15:27 - * @since JDK1.8 + * @Author 1024创新实验室: 善逸 + * @Date 2022-04-08 21:53:04 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) */ @Data public class RoleVO { @ApiModelProperty("角色ID") - private Long id; + private Long roleId; @ApiModelProperty("角色名称") private String roleName; diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/manager/RoleDataScopeManager.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/manager/RoleDataScopeManager.java new file mode 100644 index 00000000..1b2aab9d --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/manager/RoleDataScopeManager.java @@ -0,0 +1,20 @@ +package net.lab1024.sa.admin.module.system.role.manager; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import net.lab1024.sa.admin.module.system.role.dao.RoleDataScopeDao; +import net.lab1024.sa.admin.module.system.role.domain.entity.RoleDataScopeEntity; +import org.springframework.stereotype.Service; + +/** + * 角色 数据范围 manager + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-04-08 21:53:04 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Service +public class RoleDataScopeManager extends ServiceImpl { + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/manager/RoleEmployeeManager.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/manager/RoleEmployeeManager.java new file mode 100644 index 00000000..c470c878 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/manager/RoleEmployeeManager.java @@ -0,0 +1,37 @@ +package net.lab1024.sa.admin.module.system.role.manager; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import net.lab1024.sa.admin.module.system.role.dao.RoleEmployeeDao; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import net.lab1024.sa.admin.module.system.role.domain.entity.RoleEmployeeEntity; + +import java.util.List; + +/** + * 角色员工 manager + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-04-08 21:53:04 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Service +public class RoleEmployeeManager extends ServiceImpl { + + /** + * 保存 角色员工 + * + * @param roleId + * @param roleEmployeeList + */ + @Transactional(rollbackFor = Throwable.class) + public void saveRoleEmployee(Long roleId, List roleEmployeeList) { + this.getBaseMapper().deleteByRoleId(roleId); + if (CollectionUtils.isNotEmpty(roleEmployeeList)) { + this.saveBatch(roleEmployeeList); + } + } +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/manager/RoleMenuManager.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/manager/RoleMenuManager.java new file mode 100644 index 00000000..32fbe646 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/manager/RoleMenuManager.java @@ -0,0 +1,40 @@ +package net.lab1024.sa.admin.module.system.role.manager; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import net.lab1024.sa.admin.module.system.role.dao.RoleMenuDao; +import net.lab1024.sa.admin.module.system.role.domain.entity.RoleMenuEntity; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * 角色-菜单 manager + * + * @Author 1024创新实验室: 善逸 + * @Date 2022-04-09 19:05:49 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Service +public class RoleMenuManager extends ServiceImpl { + + @Autowired + private RoleMenuDao roleMenuDao; + + /** + * 更新角色权限 + * + * @param roleId + * @param roleMenuEntityList + */ + @Transactional(rollbackFor = Exception.class) + public void updateRoleMenu(Long roleId, List roleMenuEntityList) { + // 根据角色ID删除菜单权限 + roleMenuDao.deleteByRoleId(roleId); + // 批量添加菜单权限 + saveBatch(roleMenuEntityList); + } +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/service/RoleDataScopeService.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/service/RoleDataScopeService.java new file mode 100644 index 00000000..3cc655bc --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/service/RoleDataScopeService.java @@ -0,0 +1,67 @@ +package net.lab1024.sa.admin.module.system.role.service; + +import com.google.common.collect.Lists; +import net.lab1024.sa.admin.module.system.role.domain.form.RoleDataScopeUpdateForm; +import net.lab1024.sa.admin.module.system.role.domain.vo.RoleDataScopeVO; +import net.lab1024.sa.common.common.code.UserErrorCode; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.util.SmartBeanUtil; +import net.lab1024.sa.admin.module.system.role.domain.entity.RoleDataScopeEntity; +import net.lab1024.sa.admin.module.system.role.manager.RoleDataScopeManager; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.List; + +/** + * 角色-数据范围 + * + * @Author 1024创新实验室: 善逸 + * @Date 2021-10-22 23:17:47 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Service +public class RoleDataScopeService { + + @Autowired + private RoleDataScopeManager roleDataScopeManager; + + + /** + * 获取某个角色的数据范围设置信息 + * + * @param roleId + * @return + */ + public ResponseDTO> getRoleDataScopeList(Long roleId) { + List roleDataScopeEntityList = roleDataScopeManager.getBaseMapper().listByRoleId(roleId); + if (CollectionUtils.isEmpty(roleDataScopeEntityList)) { + return ResponseDTO.ok(Lists.newArrayList()); + } + List roleDataScopeList = SmartBeanUtil.copyList(roleDataScopeEntityList, RoleDataScopeVO.class); + return ResponseDTO.ok(roleDataScopeList); + } + + /** + * 批量设置某个角色的数据范围设置信息 + * + * @param roleDataScopeUpdateForm + * @return + */ + @Transactional(rollbackFor = Exception.class) + public ResponseDTO updateRoleDataScopeList(RoleDataScopeUpdateForm roleDataScopeUpdateForm) { + List batchSetList = roleDataScopeUpdateForm.getDataScopeItemList(); + if (CollectionUtils.isEmpty(batchSetList)) { + return ResponseDTO.error(UserErrorCode.PARAM_ERROR, "缺少配置信息"); + } + List roleDataScopeEntityList = SmartBeanUtil.copyList(batchSetList, RoleDataScopeEntity.class); + roleDataScopeEntityList.forEach(e -> e.setRoleId(roleDataScopeUpdateForm.getRoleId())); + roleDataScopeManager.getBaseMapper().deleteByRoleId(roleDataScopeUpdateForm.getRoleId()); + roleDataScopeManager.saveBatch(roleDataScopeEntityList); + return ResponseDTO.ok(); + } +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/service/RoleEmployeeService.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/service/RoleEmployeeService.java new file mode 100644 index 00000000..51bf64d4 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/service/RoleEmployeeService.java @@ -0,0 +1,153 @@ +package net.lab1024.sa.admin.module.system.role.service; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import net.lab1024.sa.admin.module.system.role.dao.RoleDao; +import net.lab1024.sa.admin.module.system.role.dao.RoleEmployeeDao; +import net.lab1024.sa.admin.module.system.role.domain.entity.RoleEntity; +import net.lab1024.sa.admin.module.system.role.domain.form.RoleEmployeeQueryForm; +import net.lab1024.sa.admin.module.system.role.domain.form.RoleEmployeeUpdateForm; +import net.lab1024.sa.admin.module.system.role.domain.vo.RoleSelectedVO; +import net.lab1024.sa.common.common.code.UserErrorCode; +import net.lab1024.sa.common.common.constant.StringConst; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.util.SmartBeanUtil; +import net.lab1024.sa.common.common.util.SmartPageUtil; +import net.lab1024.sa.admin.module.system.department.dao.DepartmentDao; +import net.lab1024.sa.admin.module.system.department.domain.entity.DepartmentEntity; +import net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO; +import net.lab1024.sa.admin.module.system.role.domain.entity.RoleEmployeeEntity; +import net.lab1024.sa.admin.module.system.role.manager.RoleEmployeeManager; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * 角色-员工 + * + * @Author 1024创新实验室: 善逸 + * @Date 2021-10-22 23:17:47 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Service +public class RoleEmployeeService { + + @Autowired + private RoleEmployeeDao roleEmployeeDao; + @Autowired + private RoleDao roleDao; + @Autowired + private DepartmentDao departmentDao; + @Autowired + private RoleEmployeeManager roleEmployeeManager; + + /** + * 通过角色id,分页获取成员员工列表 + * + * @param roleEmployeeQueryForm + * @return + */ + public ResponseDTO> queryEmployee(RoleEmployeeQueryForm roleEmployeeQueryForm) { + Page page = SmartPageUtil.convert2PageQuery(roleEmployeeQueryForm); + List employeeDTOS = roleEmployeeDao.selectRoleEmployeeByName(page, roleEmployeeQueryForm) + .stream() + .filter(Objects::nonNull) + .collect(Collectors.toList()); + List departmentIdList = employeeDTOS.stream().filter(e -> e != null && e.getDepartmentId() != null).map(EmployeeVO::getDepartmentId).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(departmentIdList)) { + List departmentEntities = departmentDao.selectBatchIds(departmentIdList); + Map departmentIdNameMap = departmentEntities.stream().collect(Collectors.toMap(DepartmentEntity::getDepartmentId, DepartmentEntity::getName)); + employeeDTOS.forEach(e -> { + e.setDepartmentName(departmentIdNameMap.getOrDefault(e.getDepartmentId(), StringConst.EMPTY)); + }); + } + PageResult PageResult = SmartPageUtil.convert2PageResult(page, employeeDTOS, EmployeeVO.class); + return ResponseDTO.ok(PageResult); + } + + public List getAllEmployeeByRoleId(Long roleId) { + return roleEmployeeDao.selectEmployeeByRoleId(roleId); + } + + /** + * 移除员工角色 + * + * @param employeeId + * @param roleId + * @return ResponseDTO + */ + @Transactional(rollbackFor = Exception.class) + public ResponseDTO removeRoleEmployee(Long employeeId, Long roleId) { + if (null == employeeId || null == roleId) { + return ResponseDTO.userErrorParam(); + } + roleEmployeeDao.deleteByEmployeeIdRoleId(employeeId, roleId); + return ResponseDTO.ok(); + } + + /** + * 批量删除角色的成员员工 + * + * @param roleEmployeeUpdateForm + * @return ResponseDTO + */ + public ResponseDTO batchRemoveRoleEmployee(RoleEmployeeUpdateForm roleEmployeeUpdateForm) { + roleEmployeeDao.batchDeleteEmployeeRole(roleEmployeeUpdateForm.getRoleId(), roleEmployeeUpdateForm.getEmployeeIdList()); + return ResponseDTO.ok(); + } + + /** + * 批量添加角色的成员员工 + * + * @param roleEmployeeUpdateForm + * @return + */ + public ResponseDTO batchAddRoleEmployee(RoleEmployeeUpdateForm roleEmployeeUpdateForm) { + Long roleId = roleEmployeeUpdateForm.getRoleId(); + List employeeIdList = roleEmployeeUpdateForm.getEmployeeIdList(); + // 保存新的角色员工 + List roleEmployeeList = null; + if (CollectionUtils.isNotEmpty(employeeIdList)) { + roleEmployeeList = employeeIdList.stream() + .map(employeeId -> new RoleEmployeeEntity(roleId, employeeId)) + .collect(Collectors.toList()); + } + // 保存数据 + roleEmployeeManager.saveRoleEmployee(roleId, roleEmployeeList); + return ResponseDTO.ok(); + } + + /** + * 通过员工id获取员工角色 + * + * @param employeeId + * @return + */ + public List getRoleInfoListByEmployeeId(Long employeeId) { + List roleIds = roleEmployeeDao.selectRoleIdByEmployeeId(employeeId); + List roleList = roleDao.selectList(null); + List result = SmartBeanUtil.copyList(roleList, RoleSelectedVO.class); + result.stream().forEach(item -> item.setSelected(roleIds.contains(item.getRoleId()))); + return result; + } + + /** + * 根据员工id 查询角色id集合 + * + * @param employeeId + * @return + */ + public List getRoleIdList(Long employeeId) { + return roleEmployeeDao.selectRoleIdByEmployeeId(employeeId); + } + + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/service/RoleMenuService.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/service/RoleMenuService.java new file mode 100644 index 00000000..e93d106a --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/service/RoleMenuService.java @@ -0,0 +1,130 @@ +package net.lab1024.sa.admin.module.system.role.service; + +import com.google.common.collect.Lists; +import net.lab1024.sa.admin.module.system.menu.dao.MenuDao; +import net.lab1024.sa.admin.module.system.menu.domain.entity.MenuEntity; +import net.lab1024.sa.admin.module.system.menu.domain.vo.MenuSimpleTreeVO; +import net.lab1024.sa.admin.module.system.menu.domain.vo.MenuVO; +import net.lab1024.sa.admin.module.system.role.dao.RoleDao; +import net.lab1024.sa.admin.module.system.role.dao.RoleMenuDao; +import net.lab1024.sa.admin.module.system.role.domain.entity.RoleEntity; +import net.lab1024.sa.admin.module.system.role.domain.entity.RoleMenuEntity; +import net.lab1024.sa.admin.module.system.role.domain.form.RoleMenuUpdateForm; +import net.lab1024.sa.admin.module.system.role.domain.vo.RoleMenuTreeVO; +import net.lab1024.sa.admin.module.system.role.manager.RoleMenuManager; +import net.lab1024.sa.common.common.code.UserErrorCode; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.util.SmartBeanUtil; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.math.NumberUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 角色-菜单 + * + * @Author 1024创新实验室: 善逸 + * @Date 2021-10-22 23:17:47 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Service +public class RoleMenuService { + + @Autowired + private RoleDao roleDao; + @Autowired + private RoleMenuDao roleMenuDao; + @Autowired + private RoleMenuManager roleMenuManager; + @Autowired + private MenuDao menuDao; + + /** + * 更新角色权限 + * + * @param roleMenuUpdateForm + * @return + */ + public ResponseDTO updateRoleMenu(RoleMenuUpdateForm roleMenuUpdateForm) { + //查询角色是否存在 + Long roleId = roleMenuUpdateForm.getRoleId(); + RoleEntity roleEntity = roleDao.selectById(roleId); + if (null == roleEntity) { + return ResponseDTO.error(UserErrorCode.DATA_NOT_EXIST); + } + List roleMenuEntityList = Lists.newArrayList(); + RoleMenuEntity roleMenuEntity; + for (Long menuId : roleMenuUpdateForm.getMenuIdList()) { + roleMenuEntity = new RoleMenuEntity(); + roleMenuEntity.setRoleId(roleId); + roleMenuEntity.setMenuId(menuId); + roleMenuEntityList.add(roleMenuEntity); + } + roleMenuManager.updateRoleMenu(roleMenuUpdateForm.getRoleId(), roleMenuEntityList); + return ResponseDTO.ok(); + } + + /** + * 根据角色id集合,查询其所有的菜单权限 + * + * @param roleIdList + * @return + */ + public List getMenuList(List roleIdList, Boolean administratorFlag) { + //管理员返回所有菜单 + if(administratorFlag){ + List menuEntityList = roleMenuDao.selectMenuListByRoleIdList(Lists.newArrayList(), false); + return SmartBeanUtil.copyList(menuEntityList, MenuVO.class); + } + //非管理员 无角色 返回空菜单 + if (CollectionUtils.isEmpty(roleIdList)) { + return new ArrayList<>(); + } + List menuEntityList = roleMenuDao.selectMenuListByRoleIdList(roleIdList, false); + return SmartBeanUtil.copyList(menuEntityList, MenuVO.class); + } + + + /** + * 获取角色关联菜单权限 + * + * @param roleId + * @return + */ + public ResponseDTO getRoleSelectedMenu(Long roleId) { + RoleMenuTreeVO res = new RoleMenuTreeVO(); + res.setRoleId(roleId); + //查询角色ID选择的菜单权限 + List selectedMenuId = roleMenuDao.queryMenuIdByRoleId(roleId); + res.setSelectedMenuId(selectedMenuId); + //查询菜单权限 + List menuVOList = menuDao.queryMenuList(Boolean.FALSE, Boolean.FALSE, null); + Map> parentMap = menuVOList.stream().collect(Collectors.groupingBy(MenuVO::getParentId, Collectors.toList())); + List menuTreeList = this.buildMenuTree(parentMap, NumberUtils.LONG_ZERO); + res.setMenuTreeList(menuTreeList); + return ResponseDTO.ok(res); + } + + /** + * 构建菜单树 + * + * @return + */ + private List buildMenuTree(Map> parentMap, Long parentId) { + // 获取本级菜单树List + List res = parentMap.getOrDefault(parentId, Lists.newArrayList()).stream() + .map(e -> SmartBeanUtil.copy(e, MenuSimpleTreeVO.class)).collect(Collectors.toList()); + // 循环遍历下级菜单 + res.forEach(e -> { + e.setChildren(this.buildMenuTree(parentMap, e.getMenuId())); + }); + return res; + } +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/service/RoleService.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/service/RoleService.java new file mode 100644 index 00000000..031d75e0 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/service/RoleService.java @@ -0,0 +1,119 @@ +package net.lab1024.sa.admin.module.system.role.service; + +import net.lab1024.sa.admin.module.system.role.dao.RoleDao; +import net.lab1024.sa.admin.module.system.role.dao.RoleEmployeeDao; +import net.lab1024.sa.admin.module.system.role.dao.RoleMenuDao; +import net.lab1024.sa.admin.module.system.role.domain.entity.RoleEntity; +import net.lab1024.sa.admin.module.system.role.domain.form.RoleAddForm; +import net.lab1024.sa.admin.module.system.role.domain.form.RoleUpdateForm; +import net.lab1024.sa.admin.module.system.role.domain.vo.RoleVO; +import net.lab1024.sa.common.common.code.UserErrorCode; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.util.SmartBeanUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * 角色 + * + * @Author 1024创新实验室: 胡克 + * @Date 2021-08-16 20:19:22 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Service +public class RoleService { + + @Autowired + private RoleDao roleDao; + + @Autowired + private RoleMenuDao roleMenuDao; + + @Autowired + private RoleEmployeeDao roleEmployeeDao; + + /** + * 新增添加角色 + * + * @param roleAddForm + * @return ResponseDTO + */ + public ResponseDTO addRole(RoleAddForm roleAddForm) { + RoleEntity existRoleEntity = roleDao.getByRoleName(roleAddForm.getRoleName()); + if (null != existRoleEntity) { + return ResponseDTO.userErrorParam("角色名称重复"); + } + RoleEntity roleEntity = SmartBeanUtil.copy(roleAddForm, RoleEntity.class); + roleDao.insert(roleEntity); + return ResponseDTO.ok(); + } + + /** + * 根据角色id 删除 + * + * @param roleId + * @return ResponseDTO + */ + @Transactional(rollbackFor = Exception.class) + public ResponseDTO deleteRole(Long roleId) { + RoleEntity roleEntity = roleDao.selectById(roleId); + if (null == roleEntity) { + return ResponseDTO.error(UserErrorCode.DATA_NOT_EXIST); + } + roleDao.deleteById(roleId); + roleMenuDao.deleteByRoleId(roleId); + roleEmployeeDao.deleteByRoleId(roleId); + return ResponseDTO.ok(); + } + + /** + * 更新角色 + * + * @param roleUpdateForm + * @return ResponseDTO + */ + @Transactional(rollbackFor = Exception.class) + public ResponseDTO updateRole(RoleUpdateForm roleUpdateForm) { + if (null == roleDao.selectById(roleUpdateForm.getRoleId())) { + return ResponseDTO.error(UserErrorCode.DATA_NOT_EXIST); + } + RoleEntity existRoleEntity = roleDao.getByRoleName(roleUpdateForm.getRoleName()); + if (null != existRoleEntity && !existRoleEntity.getRoleId().equals(roleUpdateForm.getRoleId())) { + return ResponseDTO.userErrorParam("角色名称重复"); + } + RoleEntity roleEntity = SmartBeanUtil.copy(roleUpdateForm, RoleEntity.class); + roleDao.updateById(roleEntity); + return ResponseDTO.ok(); + } + + /** + * 根据id获取角色数据 + * + * @param roleId + * @return ResponseDTO + */ + public ResponseDTO getRoleById(Long roleId) { + RoleEntity roleEntity = roleDao.selectById(roleId); + if (null == roleEntity) { + return ResponseDTO.error(UserErrorCode.DATA_NOT_EXIST); + } + RoleVO role = SmartBeanUtil.copy(roleEntity, RoleVO.class); + return ResponseDTO.ok(role); + } + + /** + * 获取所有角色列表 + * + * @return ResponseDTO + */ + public ResponseDTO> getAllRole() { + List roleEntityList = roleDao.selectList(null); + List roleList = SmartBeanUtil.copyList(roleEntityList, RoleVO.class); + return ResponseDTO.ok(roleList); + } +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminCacheController.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminCacheController.java new file mode 100644 index 00000000..492a063b --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminCacheController.java @@ -0,0 +1,56 @@ +package net.lab1024.sa.admin.module.system.support; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import net.lab1024.sa.common.common.controller.SupportBaseController; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.constant.SwaggerTagConst; +import net.lab1024.sa.common.module.support.cache.CacheService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * 缓存 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2021/10/11 20:07 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@RestController +@Api(tags = {SwaggerTagConst.Support.CACHE}) +public class AdminCacheController extends SupportBaseController { + + @Autowired + private CacheService cacheService; + + @ApiOperation(value = "获取所有缓存 @author 罗伊") + @GetMapping("/cache/names") + public ResponseDTO> cacheNames() { + return ResponseDTO.ok(cacheService.cacheNames()); + } + + + @ApiOperation(value = "移除某个缓存 @author 罗伊") + @PreAuthorize("@saAuth.checkPermission('support:cache:delete')") + @GetMapping("/cache/remove/{cacheName}") + public ResponseDTO removeCache(@PathVariable String cacheName) { + cacheService.removeCache(cacheName); + return ResponseDTO.ok(); + } + + + @ApiOperation(value = "获取某个缓存的所有key @author 罗伊") + @PreAuthorize("@saAuth.checkPermission('support:cache:keys')") + @GetMapping("/cache/keys/{cacheName}") + public ResponseDTO> cacheKeys(@PathVariable String cacheName) { + return ResponseDTO.ok(cacheService.cacheKey(cacheName)); + } + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminChangeLogController.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminChangeLogController.java new file mode 100644 index 00000000..7c4b1eec --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminChangeLogController.java @@ -0,0 +1,59 @@ +package net.lab1024.sa.admin.module.system.support; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.domain.ValidateList; +import net.lab1024.sa.common.constant.SwaggerTagConst; +import net.lab1024.sa.common.module.support.changelog.domain.form.ChangeLogAddForm; +import net.lab1024.sa.common.module.support.changelog.domain.form.ChangeLogUpdateForm; +import net.lab1024.sa.common.module.support.changelog.service.ChangeLogService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + +/** + * 系统更新日志 Controller + * + * @Author 卓大 + * @Date 2022-09-26 14:53:50 + * @Copyright 1024创新实验室 + */ + +@RestController +@Api(tags = SwaggerTagConst.Support.CHANGE_LOG) +public class AdminChangeLogController { + + @Autowired + private ChangeLogService changeLogService; + + @ApiOperation("添加 @author 卓大") + @PostMapping("/changeLog/add") + @PreAuthorize("@saAuth.checkPermission('changeLog:add')") + public ResponseDTO add(@RequestBody @Valid ChangeLogAddForm addForm) { + return changeLogService.add(addForm); + } + + @ApiOperation("更新 @author 卓大") + @PreAuthorize("@saAuth.checkPermission('changeLog:update')") + @PostMapping("/changeLog/update") + public ResponseDTO update(@RequestBody @Valid ChangeLogUpdateForm updateForm) { + return changeLogService.update(updateForm); + } + + @ApiOperation("批量删除 @author 卓大") + @PreAuthorize("@saAuth.checkPermission('changeLog:batchDelete')") + @PostMapping("/changeLog/batchDelete") + public ResponseDTO batchDelete(@RequestBody ValidateList idList) { + return changeLogService.batchDelete(idList); + } + + @ApiOperation("单个删除 @author 卓大") + @PreAuthorize("@saAuth.checkPermission('changeLog:delete')") + @GetMapping("/changeLog/delete/{changeLogId}") + public ResponseDTO batchDelete(@PathVariable Long changeLogId) { + return changeLogService.delete(changeLogId); + } +} \ No newline at end of file diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminConfigController.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminConfigController.java new file mode 100644 index 00000000..78ab1722 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminConfigController.java @@ -0,0 +1,59 @@ +package net.lab1024.sa.admin.module.system.support; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import net.lab1024.sa.common.common.controller.SupportBaseController; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.constant.SwaggerTagConst; +import net.lab1024.sa.common.module.support.config.ConfigService; +import net.lab1024.sa.common.module.support.config.domain.ConfigAddForm; +import net.lab1024.sa.common.module.support.config.domain.ConfigQueryForm; +import net.lab1024.sa.common.module.support.config.domain.ConfigUpdateForm; +import net.lab1024.sa.common.module.support.config.domain.ConfigVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +import javax.validation.Valid; + +/** + * 配置 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-03-14 20:46:27 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Api(tags = {SwaggerTagConst.Support.CONFIG}) +@RestController +public class AdminConfigController extends SupportBaseController { + + @Autowired + private ConfigService configService; + + @ApiOperation("分页查询系统配置 @author 卓大") + @PreAuthorize("@saAuth.checkPermission('support:config:query')") + @PostMapping("/config/query") + public ResponseDTO> querySystemConfigPage(@RequestBody @Valid ConfigQueryForm queryForm) { + return configService.queryConfigPage(queryForm); + } + + @ApiOperation("添加配置参数 @author 卓大") + @PreAuthorize("@saAuth.checkPermission('support:config:add')") + @PostMapping("/config/add") + public ResponseDTO addSystemConfig(@RequestBody @Valid ConfigAddForm configAddForm) { + return configService.add(configAddForm); + } + + @ApiOperation("修改配置参数 @author 卓大") + @PreAuthorize("@saAuth.checkPermission('support:config:update')") + @PostMapping("/config/update") + public ResponseDTO updateSystemConfig(@RequestBody @Valid ConfigUpdateForm updateForm) { + return configService.updateSystemConfig(updateForm); + } + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminDictController.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminDictController.java new file mode 100644 index 00000000..8f44a918 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminDictController.java @@ -0,0 +1,79 @@ +package net.lab1024.sa.admin.module.system.support; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import net.lab1024.sa.common.common.controller.SupportBaseController; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.constant.SwaggerTagConst; +import net.lab1024.sa.common.module.support.dict.domain.form.*; +import net.lab1024.sa.common.module.support.dict.domain.vo.DictKeyVO; +import net.lab1024.sa.common.module.support.dict.service.DictService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +import javax.validation.Valid; +import java.util.List; + +/** + * 字典 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022/5/26 19:40:55 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Api(tags = {SwaggerTagConst.Support.DICT}) +@RestController +public class AdminDictController extends SupportBaseController { + + @Autowired + private DictService dictService; + + @ApiOperation("分页查询数据字典KEY - @author 罗伊") + @PostMapping("/dict/key/query") + public ResponseDTO> keyQuery(@Valid @RequestBody DictKeyQueryForm queryForm) { + return dictService.keyQuery(queryForm); + } + + + @ApiOperation("数据字典KEY-添加- @author 罗伊") + @PostMapping("/dict/key/add") + public ResponseDTO keyAdd(@Valid @RequestBody DictKeyAddForm keyAddForm) { + return dictService.keyAdd(keyAddForm); + } + + @ApiOperation("数据字典Value-添加- @author 罗伊") + @PostMapping("/dict/value/add") + public ResponseDTO valueAdd(@Valid @RequestBody DictValueAddForm valueAddForm) { + return dictService.valueAdd(valueAddForm); + } + + @ApiOperation("数据字典KEY-更新- @author 罗伊") + @PostMapping("/dict/key/edit") + public ResponseDTO keyEdit(@Valid @RequestBody DictKeyUpdateForm keyUpdateForm) { + return dictService.keyEdit(keyUpdateForm); + } + + @ApiOperation("数据字典Value-更新- @author 罗伊") + @PostMapping("/dict/value/edit") + public ResponseDTO valueEdit(@Valid @RequestBody DictValueUpdateForm valueUpdateForm) { + return dictService.valueEdit(valueUpdateForm); + } + + @ApiOperation("数据字典KEY-删除- @author 罗伊") + @PostMapping("/dict/key/delete") + public ResponseDTO keyDelete(@RequestBody List keyIdList) { + return dictService.keyDelete(keyIdList); + } + + @ApiOperation("数据字典Value-删除- @author 罗伊") + @PostMapping("/dict/value/delete") + public ResponseDTO valueDelete(@RequestBody List valueIdList) { + return dictService.valueDelete(valueIdList); + } + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminFileController.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminFileController.java new file mode 100644 index 00000000..b4528715 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminFileController.java @@ -0,0 +1,43 @@ +package net.lab1024.sa.admin.module.system.support; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import net.lab1024.sa.common.common.controller.SupportBaseController; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.constant.SwaggerTagConst; +import net.lab1024.sa.common.module.support.file.domain.form.FileQueryForm; +import net.lab1024.sa.common.module.support.file.domain.vo.FileVO; +import net.lab1024.sa.common.module.support.file.service.FileService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +import javax.validation.Valid; + +/** + * 文件服务 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2019年10月11日 15:34:47 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@RestController +@Api(tags = {SwaggerTagConst.Support.FILE}) +public class AdminFileController extends SupportBaseController { + + @Autowired + private FileService fileService; + + @ApiOperation("分页查询 @author 1024创新实验室-主任-卓大") + @PreAuthorize("@saAuth.checkPermission('support:file:query')") + @PostMapping("/file/queryPage") + public ResponseDTO> queryPage(@RequestBody @Valid FileQueryForm queryForm) { + return ResponseDTO.ok(fileService.queryPage(queryForm)); + } + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminHeartBeatController.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminHeartBeatController.java new file mode 100644 index 00000000..2f91d0be --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminHeartBeatController.java @@ -0,0 +1,41 @@ +package net.lab1024.sa.admin.module.system.support; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import net.lab1024.sa.common.common.controller.SupportBaseController; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.constant.SwaggerTagConst; +import net.lab1024.sa.common.module.support.heartbeat.HeartBeatService; +import net.lab1024.sa.common.module.support.heartbeat.domain.HeartBeatRecordQueryForm; +import net.lab1024.sa.common.module.support.heartbeat.domain.HeartBeatRecordVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +import javax.validation.Valid; + +/** + * 心跳记录 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-01-09 20:57:24 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Api(tags = {SwaggerTagConst.Support.HEART_BEAT}) +@RestController +public class AdminHeartBeatController extends SupportBaseController { + + @Autowired + private HeartBeatService heartBeatService; + + @PostMapping("/heartBeat/query") + @ApiOperation("查询心跳记录 @author 卓大") + public ResponseDTO> query(@RequestBody @Valid HeartBeatRecordQueryForm pageParam) { + return heartBeatService.pageQuery(pageParam); + } + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminHelpDocController.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminHelpDocController.java new file mode 100644 index 00000000..5d0949e2 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminHelpDocController.java @@ -0,0 +1,108 @@ +package net.lab1024.sa.admin.module.system.support; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import net.lab1024.sa.common.common.controller.SupportBaseController; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.constant.SwaggerTagConst; +import net.lab1024.sa.common.module.support.helpdoc.domain.form.*; +import net.lab1024.sa.common.module.support.helpdoc.domain.vo.HelpDocDetailVO; +import net.lab1024.sa.common.module.support.helpdoc.domain.vo.HelpDocVO; +import net.lab1024.sa.common.module.support.helpdoc.service.HelpDocCatalogService; +import net.lab1024.sa.common.module.support.helpdoc.service.HelpDocService; +import net.lab1024.sa.common.module.support.repeatsubmit.annoation.RepeatSubmit; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + +/** + * 帮助文档 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-20 23:11:42 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Api(tags = SwaggerTagConst.Support.HELP_DOC) +@RestController +public class AdminHelpDocController extends SupportBaseController { + + @Autowired + private HelpDocService helpDocService; + + @Autowired + private HelpDocCatalogService helpDocCatalogService; + + // --------------------- 帮助文档 【目录管理】 ------------------------- + + + @ApiOperation("帮助文档目录-添加 @author 卓大") + @PreAuthorize("@saAuth.checkPermission('helpDocCatalog:addCategory')") + @PostMapping("/helpDoc/helpDocCatalog/add") + public ResponseDTO addHelpDocCatalog(@RequestBody @Valid HelpDocCatalogAddForm helpDocCatalogAddForm) { + return helpDocCatalogService.add(helpDocCatalogAddForm); + } + + @ApiOperation("帮助文档目录-更新 @author 卓大") + @PreAuthorize("@saAuth.checkPermission('helpDocCatalog:edit')") + @PostMapping("/helpDoc/helpDocCatalog/update") + public ResponseDTO updateHelpDocCatalog(@RequestBody @Valid HelpDocCatalogUpdateForm helpDocCatalogUpdateForm) { + return helpDocCatalogService.update(helpDocCatalogUpdateForm); + } + + @ApiOperation("帮助文档目录-删除 @author 卓大") + @GetMapping("/helpDoc/helpDocCatalog/delete/{helpDocCatalogId}") + public ResponseDTO deleteHelpDocCatalog(@PathVariable Long helpDocCatalogId) { + return helpDocCatalogService.delete(helpDocCatalogId); + } + + // --------------------- 帮助文档 【管理:增、删、查、改】------------------------- + + @ApiOperation("【管理】帮助文档-分页查询 @author 卓大") + @PreAuthorize("@saAuth.checkPermission('helpDoc:query')") + @PostMapping("/helpDoc/query") + public ResponseDTO> query(@RequestBody @Valid HelpDocQueryForm queryForm) { + return ResponseDTO.ok(helpDocService.query(queryForm)); + } + + @ApiOperation("【管理】帮助文档-获取详情 @author 卓大") + @GetMapping("/helpDoc/getDetail/{helpDocId}") + public ResponseDTO getDetail(@PathVariable Long helpDocId) { + return ResponseDTO.ok(helpDocService.getDetail(helpDocId)); + } + + @ApiOperation("【管理】帮助文档-添加 @author 卓大") + @PreAuthorize("@saAuth.checkPermission('helpDoc:add')") + @PostMapping("/helpDoc/add") + @RepeatSubmit + public ResponseDTO add(@RequestBody @Valid HelpDocAddForm addForm) { + return helpDocService.add(addForm); + } + + @ApiOperation("【管理】帮助文档-更新 @author 卓大") + @PreAuthorize("@saAuth.checkPermission('helpDoc:update')") + @PostMapping("/helpDoc/update") + @RepeatSubmit + public ResponseDTO update(@RequestBody @Valid HelpDocUpdateForm updateForm) { + return helpDocService.update(updateForm); + } + + @ApiOperation("【管理】帮助文档-删除 @author 卓大") + @PreAuthorize("@saAuth.checkPermission('helpDoc:delete')") + @GetMapping("/helpDoc/delete/{helpDocId}") + public ResponseDTO delete(@PathVariable Long helpDocId) { + return helpDocService.delete(helpDocId); + } + + @ApiOperation("【管理】帮助文档-根据关联id查询 @author 卓大") + @GetMapping("/helpDoc/queryHelpDocByRelationId/{relationId}") + public ResponseDTO> queryHelpDocByRelationId(@PathVariable Long relationId) { + return ResponseDTO.ok(helpDocService.queryHelpDocByRelationId(relationId)); + } + +} \ No newline at end of file diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminLoginLogController.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminLoginLogController.java new file mode 100644 index 00000000..0fd71522 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminLoginLogController.java @@ -0,0 +1,42 @@ +package net.lab1024.sa.admin.module.system.support; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import net.lab1024.sa.common.common.controller.SupportBaseController; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.constant.SwaggerTagConst; +import net.lab1024.sa.common.module.support.loginlog.LoginLogService; +import net.lab1024.sa.common.module.support.loginlog.domain.LoginLogQueryForm; +import net.lab1024.sa.common.module.support.loginlog.domain.LoginLogVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +/** + * 登录日志 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022/07/22 19:46:23 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@RestController +@Api(tags = {SwaggerTagConst.Support.LOGIN_LOG}) +public class AdminLoginLogController extends SupportBaseController { + + @Autowired + private LoginLogService loginLogService; + + @ApiOperation(value = "分页查询 @author 卓大") + @PreAuthorize("@saAuth.checkPermission('loginLog:query')") + @PostMapping("/loginLog/page/query") + public ResponseDTO> queryByPage(@RequestBody LoginLogQueryForm queryForm) { + return loginLogService.queryByPage(queryForm); + } + + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminOperateLogController.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminOperateLogController.java new file mode 100644 index 00000000..85161a6f --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminOperateLogController.java @@ -0,0 +1,46 @@ +package net.lab1024.sa.admin.module.system.support; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import net.lab1024.sa.common.common.controller.SupportBaseController; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.constant.SwaggerTagConst; +import net.lab1024.sa.common.module.support.operatelog.OperateLogService; +import net.lab1024.sa.common.module.support.operatelog.domain.OperateLogQueryForm; +import net.lab1024.sa.common.module.support.operatelog.domain.OperateLogVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +/** + * 操作日志 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2021-12-08 20:48:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@RestController +@Api(tags = {SwaggerTagConst.Support.OPERATE_LOG}) +public class AdminOperateLogController extends SupportBaseController { + + @Autowired + private OperateLogService operateLogService; + + @ApiOperation(value = "分页查询 @author 罗伊") + @PreAuthorize("@saAuth.checkPermission('operateLog:query')") + @PostMapping("/operateLog/page/query") + public ResponseDTO> queryByPage(@RequestBody OperateLogQueryForm queryForm) { + return operateLogService.queryByPage(queryForm); + } + + @ApiOperation(value = "详情 @author 罗伊") + @PreAuthorize("@saAuth.checkPermission('operateLog:detail')") + @GetMapping("/operateLog/detail/{operateLogId}") + public ResponseDTO detail(@PathVariable Long operateLogId) { + return operateLogService.detail(operateLogId); + } + +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminReloadController.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminReloadController.java new file mode 100644 index 00000000..24637f6e --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminReloadController.java @@ -0,0 +1,54 @@ +package net.lab1024.sa.admin.module.system.support; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import net.lab1024.sa.common.common.controller.SupportBaseController; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.constant.SwaggerTagConst; +import net.lab1024.sa.common.module.support.reload.ReloadService; +import net.lab1024.sa.common.module.support.reload.domain.ReloadForm; +import net.lab1024.sa.common.module.support.reload.domain.ReloadItemVO; +import net.lab1024.sa.common.module.support.reload.domain.ReloadResultVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + +/** + * reload (内存热加载、钩子等) + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2015-03-02 19:11:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@RestController +@Api(tags = {SwaggerTagConst.Support.RELOAD}) +public class AdminReloadController extends SupportBaseController { + + @Autowired + private ReloadService reloadService; + + @ApiOperation(value = "查询reload列表 @author 开云") + @GetMapping("/reload/query") + public ResponseDTO> query() { + return reloadService.query(); + } + + @ApiOperation(value = "获取reload result @author 开云") + @PreAuthorize("@saAuth.checkPermission('support:reload:result')") + @GetMapping("/reload/result/{tag}") + public ResponseDTO> queryReloadResult(@PathVariable("tag") String tag) { + return reloadService.queryReloadItemResult(tag); + } + + @ApiOperation(value = "通过tag更新标识 @author 开云") + @PreAuthorize("@saAuth.checkPermission('support:reload:execute')") + @PostMapping("/reload/update") + public ResponseDTO updateByTag(@RequestBody @Valid ReloadForm reloadForm) { + return reloadService.updateByTag(reloadForm); + } +} diff --git a/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminSerialNumberController.java b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminSerialNumberController.java new file mode 100644 index 00000000..329a2aaf --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/support/AdminSerialNumberController.java @@ -0,0 +1,74 @@ +package net.lab1024.sa.admin.module.system.support; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import net.lab1024.sa.common.common.controller.SupportBaseController; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.util.SmartEnumUtil; +import net.lab1024.sa.common.constant.SwaggerTagConst; +import net.lab1024.sa.common.module.support.serialnumber.constant.SerialNumberIdEnum; +import net.lab1024.sa.common.module.support.serialnumber.dao.SerialNumberDao; +import net.lab1024.sa.common.module.support.serialnumber.domain.SerialNumberEntity; +import net.lab1024.sa.common.module.support.serialnumber.domain.SerialNumberGenerateForm; +import net.lab1024.sa.common.module.support.serialnumber.domain.SerialNumberRecordEntity; +import net.lab1024.sa.common.module.support.serialnumber.domain.SerialNumberRecordQueryForm; +import net.lab1024.sa.common.module.support.serialnumber.service.SerialNumberRecordService; +import net.lab1024.sa.common.module.support.serialnumber.service.SerialNumberService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +import javax.validation.Valid; +import java.util.List; + +/** + * 单据序列号 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-03-25 21:46:07 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Api(tags = SwaggerTagConst.Support.SERIAL_NUMBER) +@RestController +public class AdminSerialNumberController extends SupportBaseController { + + @Autowired + private SerialNumberDao serialNumberDao; + + @Autowired + private SerialNumberService serialNumberService; + + @Autowired + private SerialNumberRecordService serialNumberRecordService; + + @ApiOperation("生成单号 @author 卓大") + @PreAuthorize("@saAuth.checkPermission('support:serial:number:generate')") + @PostMapping("/serialNumber/generate") + public ResponseDTO> generate(@RequestBody @Valid SerialNumberGenerateForm generateForm) { + SerialNumberIdEnum serialNumberIdEnum = SmartEnumUtil.getEnumByValue(generateForm.getSerialNumberId(), SerialNumberIdEnum.class); + if (null == serialNumberIdEnum) { + return ResponseDTO.userErrorParam("SerialNumberId,不存在" + generateForm.getSerialNumberId()); + } + return ResponseDTO.ok(serialNumberService.generate(serialNumberIdEnum, generateForm.getCount())); + } + + @ApiOperation("获取所有单号定义 @author 卓大") + @GetMapping("/serialNumber/all") + public ResponseDTO> getAll() { + return ResponseDTO.ok(serialNumberDao.selectList(null)); + } + + @ApiOperation("获取生成记录 @author 卓大") + @PreAuthorize("@saAuth.checkPermission('support:serial:number:record')") + @PostMapping("/serialNumber/queryRecord") + public ResponseDTO> queryRecord(@RequestBody @Valid SerialNumberRecordQueryForm queryForm) { + return ResponseDTO.ok(serialNumberRecordService.query(queryForm)); + } + +} diff --git a/smart-admin-api/sa-admin/src/main/resources/dev/application.yaml b/smart-admin-api/sa-admin/src/main/resources/dev/application.yaml new file mode 100644 index 00000000..148358fa --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/resources/dev/application.yaml @@ -0,0 +1,15 @@ +server: + servlet: + context-path: '/' + port: 1024 +spring: + profiles: + active: '@profiles.active@' +# 项目配置 +project: + name: sa-admin + module: net.lab1024.sa.admin.module +# swagger文档 +swagger: + host: localhost:${server.port} + tag-class: net.lab1024.sa.admin.constant.AdminSwaggerTagConst \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/resources/dev/log4j2.xml b/smart-admin-api/sa-admin/src/main/resources/dev/log4j2.xml similarity index 98% rename from smart-admin-service/smart-admin-api/src/main/resources/dev/log4j2.xml rename to smart-admin-api/sa-admin/src/main/resources/dev/log4j2.xml index 86c514a3..a110f0a4 100644 --- a/smart-admin-service/smart-admin-api/src/main/resources/dev/log4j2.xml +++ b/smart-admin-api/sa-admin/src/main/resources/dev/log4j2.xml @@ -5,7 +5,7 @@ --> - /home/logs/smart-admin/dev/logs + $${env:localPath:-/home}/logs/smart_admin_v2/dev @@ -85,6 +85,7 @@ + @@ -94,4 +95,5 @@ + \ No newline at end of file diff --git a/smart-admin-api/sa-admin/src/main/resources/dev/spy.properties b/smart-admin-api/sa-admin/src/main/resources/dev/spy.properties new file mode 100644 index 00000000..9877f620 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/resources/dev/spy.properties @@ -0,0 +1,18 @@ +#相关的包 +modulelist=com.baomidou.mybatisplus.extension.p6spy.MybatisPlusLogFactory,com.p6spy.engine.outage.P6OutageFactory +# 日志格式 +logMessageFormat=com.baomidou.mybatisplus.extension.p6spy.P6SpyLogger +#日志输出到控制台 +appender=com.p6spy.engine.spy.appender.StdoutLogger +# 设置 p6spy driver 代理 +deregisterdrivers=true +# 取消JDBC URL前缀 +useprefix=true +# 配置记录 Log 例外,可去掉的结果集有error,info,batch,debug,statement,commit,rollback,result,resultset. +excludecategories=info,debug,result,commit,resultset +# 日期格式 +dateformat=yyyy-MM-dd HH:mm:ss +# 开启慢sql +outagedetection=true +# 慢SQL记录标准(单位秒) +outagedetectioninterval=2 \ No newline at end of file diff --git a/smart-admin-api/sa-admin/src/main/resources/mapper/business/category/CategoryMapper.xml b/smart-admin-api/sa-admin/src/main/resources/mapper/business/category/CategoryMapper.xml new file mode 100644 index 00000000..908509c5 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/resources/mapper/business/category/CategoryMapper.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/smart-admin-api/sa-admin/src/main/resources/mapper/business/goods/GoodsMapper.xml b/smart-admin-api/sa-admin/src/main/resources/mapper/business/goods/GoodsMapper.xml new file mode 100644 index 00000000..7fcadccb --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/resources/mapper/business/goods/GoodsMapper.xml @@ -0,0 +1,41 @@ + + + + + update t_goods + set deleted_flag = #{deletedFlag} + WHERE goods_id IN + + #{item} + + + + + + + \ No newline at end of file diff --git a/smart-admin-api/sa-admin/src/main/resources/mapper/business/notice/NoticeMapper.xml b/smart-admin-api/sa-admin/src/main/resources/mapper/business/notice/NoticeMapper.xml new file mode 100644 index 00000000..5965a484 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/resources/mapper/business/notice/NoticeMapper.xml @@ -0,0 +1,69 @@ + + + + + UPDATE t_notice + SET watch_amount = watch_amount + 1 + WHERE notice_id = #{noticeId} + + + UPDATE t_notice + SET deleted_flag = #{deletedFlag} + WHERE notice_id IN + + #{item} + + + + UPDATE t_notice + SET notice_type = #{noticeType}, + notice_belong_type = #{noticeBelongType}, + notice_title = #{noticeTitle}, + notice_content = #{noticeContent}, + link_address = #{linkAddress}, + cover_file_key = #{coverFileKey}, + accessory_file_keys = #{accessoryFileKeys}, + top_flag = #{topFlag}, + publish_time = #{publishTime}, + disabled_flag = #{disabledFlag} + WHERE notice_id = #{noticeId} + + + + \ No newline at end of file diff --git a/smart-admin-api/sa-admin/src/main/resources/mapper/business/oa/bank/BankMapper.xml b/smart-admin-api/sa-admin/src/main/resources/mapper/business/oa/bank/BankMapper.xml new file mode 100644 index 00000000..79b505db --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/resources/mapper/business/oa/bank/BankMapper.xml @@ -0,0 +1,58 @@ + + + + + UPDATE t_oa_bank + SET deleted_flag = #{deletedFlag} + WHERE bank_id = #{bankId} + + + + + \ No newline at end of file diff --git a/smart-admin-api/sa-admin/src/main/resources/mapper/business/oa/enterprise/EnterpriseEmployeeMapper.xml b/smart-admin-api/sa-admin/src/main/resources/mapper/business/oa/enterprise/EnterpriseEmployeeMapper.xml new file mode 100644 index 00000000..62acf08f --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/resources/mapper/business/oa/enterprise/EnterpriseEmployeeMapper.xml @@ -0,0 +1,94 @@ + + + + + + delete from t_oa_enterprise_employee where enterprise_id = #{enterpriseId} and employee_id in + + #{item} + + + + + delete from t_oa_enterprise_employee where employee_id = #{employeeId} + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/smart-admin-api/sa-admin/src/main/resources/mapper/business/oa/enterprise/EnterpriseMapper.xml b/smart-admin-api/sa-admin/src/main/resources/mapper/business/oa/enterprise/EnterpriseMapper.xml new file mode 100644 index 00000000..11ed88ac --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/resources/mapper/business/oa/enterprise/EnterpriseMapper.xml @@ -0,0 +1,59 @@ + + + + + UPDATE t_oa_enterprise + SET deleted_flag = #{deletedFlag} + WHERE enterprise_id = #{enterpriseId} + + + + + + \ No newline at end of file diff --git a/smart-admin-api/sa-admin/src/main/resources/mapper/business/oa/invoice/InvoiceMapper.xml b/smart-admin-api/sa-admin/src/main/resources/mapper/business/oa/invoice/InvoiceMapper.xml new file mode 100644 index 00000000..0001d92f --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/resources/mapper/business/oa/invoice/InvoiceMapper.xml @@ -0,0 +1,56 @@ + + + + + UPDATE t_oa_invoice + SET deleted_flag = #{deletedFlag} + WHERE invoice_id = #{invoiceId} + + + + + \ No newline at end of file diff --git a/smart-admin-api/sa-admin/src/main/resources/mapper/business/oa/notice/NoticeDao.xml b/smart-admin-api/sa-admin/src/main/resources/mapper/business/oa/notice/NoticeDao.xml new file mode 100644 index 00000000..13ec9914 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/resources/mapper/business/oa/notice/NoticeDao.xml @@ -0,0 +1,244 @@ + + + + + + + + insert into t_notice_visible_range + (notice_id, data_type, data_id) + values + + ( #{noticeId} , #{item.dataType}, #{item.dataId} ) + + + + delete + from t_notice_visible_range + where notice_id = #{noticeId} + + + + + + + update t_notice + set deleted_flag = true + where notice_id = #{noticeId} + + + + + + + + + + + + + + insert into t_notice_view_record (notice_id, employee_id, first_ip, first_user_agent, page_view_count) + values (#{noticeId}, #{employeeId}, #{ip}, #{userAgent}, #{pageViewCount}) + + + update t_notice_view_record + set page_view_count = page_view_count + 1, + last_ip = #{ip}, + last_user_agent = #{userAgent} + where notice_id = #{noticeId} + and employee_id = #{employeeId} + + + \ No newline at end of file diff --git a/smart-admin-api/sa-admin/src/main/resources/mapper/system/department/DepartmentMapper.xml b/smart-admin-api/sa-admin/src/main/resources/mapper/system/department/DepartmentMapper.xml new file mode 100644 index 00000000..326d94f5 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/resources/mapper/system/department/DepartmentMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/smart-admin-api/sa-admin/src/main/resources/mapper/system/employee/EmployeeMapper.xml b/smart-admin-api/sa-admin/src/main/resources/mapper/system/employee/EmployeeMapper.xml new file mode 100644 index 00000000..24f5eebb --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/resources/mapper/system/employee/EmployeeMapper.xml @@ -0,0 +1,200 @@ + + + + + + + + + UPDATE t_employee + SET disabled_flag = #{disabledFlag} + WHERE employee_id = #{employeeId} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + UPDATE t_employee + SET login_pwd = #{password} + WHERE employee_id = #{employeeId} + + + + \ No newline at end of file diff --git a/smart-admin-api/sa-admin/src/main/resources/mapper/system/menu/MenuMapper.xml b/smart-admin-api/sa-admin/src/main/resources/mapper/system/menu/MenuMapper.xml new file mode 100644 index 00000000..68fbede0 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/resources/mapper/system/menu/MenuMapper.xml @@ -0,0 +1,78 @@ + + + + + + + + update t_menu + set deleted_flag = #{deletedFlag}, + update_user_id = #{updateUserId} + where menu_id = #{item} + + + + + + + + + + + + + \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/resources/mapper/system/datascope/DataScopeRoleMapper.xml b/smart-admin-api/sa-admin/src/main/resources/mapper/system/role/RoleDataScopeMapper.xml similarity index 54% rename from smart-admin-service/smart-admin-api/src/main/resources/mapper/system/datascope/DataScopeRoleMapper.xml rename to smart-admin-api/sa-admin/src/main/resources/mapper/system/role/RoleDataScopeMapper.xml index 88bd6a9d..b9f5bcfc 100644 --- a/smart-admin-service/smart-admin-api/src/main/resources/mapper/system/datascope/DataScopeRoleMapper.xml +++ b/smart-admin-api/sa-admin/src/main/resources/mapper/system/role/RoleDataScopeMapper.xml @@ -1,8 +1,8 @@ - + - + + SELECT er.role_id + FROM t_role_employee er + WHERE er.employee_id = #{employeeId} + + + + + + + + + + + + + + + + + DELETE + FROM t_role_employee + WHERE employee_id = #{employeeId} + + + + + DELETE + FROM t_role_employee + WHERE role_id = #{roleId} + + + + DELETE + FROM t_role_employee + WHERE role_id = #{roleId} + and employee_id = #{employeeId} + + + + + DELETE FROM t_role_employee + WHERE role_id = #{roleId} and employee_id in + + #{item} + + + \ No newline at end of file diff --git a/smart-admin-api/sa-admin/src/main/resources/mapper/system/role/RoleMapper.xml b/smart-admin-api/sa-admin/src/main/resources/mapper/system/role/RoleMapper.xml new file mode 100644 index 00000000..48d0e447 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/resources/mapper/system/role/RoleMapper.xml @@ -0,0 +1,15 @@ + + + + + + + + + + \ No newline at end of file diff --git a/smart-admin-api/sa-admin/src/main/resources/mapper/system/role/RoleMenuMapper.xml b/smart-admin-api/sa-admin/src/main/resources/mapper/system/role/RoleMenuMapper.xml new file mode 100644 index 00000000..12b84f0d --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/resources/mapper/system/role/RoleMenuMapper.xml @@ -0,0 +1,42 @@ + + + + + delete + from t_role_menu + where role_id = #{roleId} + + + + + + \ No newline at end of file diff --git a/smart-admin-api/sa-admin/src/main/resources/pre/application.yaml b/smart-admin-api/sa-admin/src/main/resources/pre/application.yaml new file mode 100644 index 00000000..148358fa --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/resources/pre/application.yaml @@ -0,0 +1,15 @@ +server: + servlet: + context-path: '/' + port: 1024 +spring: + profiles: + active: '@profiles.active@' +# 项目配置 +project: + name: sa-admin + module: net.lab1024.sa.admin.module +# swagger文档 +swagger: + host: localhost:${server.port} + tag-class: net.lab1024.sa.admin.constant.AdminSwaggerTagConst \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/resources/sit/log4j2.xml b/smart-admin-api/sa-admin/src/main/resources/pre/log4j2.xml similarity index 98% rename from smart-admin-service/smart-admin-api/src/main/resources/sit/log4j2.xml rename to smart-admin-api/sa-admin/src/main/resources/pre/log4j2.xml index ac533c99..70c3f924 100644 --- a/smart-admin-service/smart-admin-api/src/main/resources/sit/log4j2.xml +++ b/smart-admin-api/sa-admin/src/main/resources/pre/log4j2.xml @@ -5,7 +5,7 @@ --> - /home/logs/smart-admin/dev/logs + $${env:localPath:-/home}/logs/smart_admin_v2/pre @@ -85,6 +85,7 @@ + @@ -94,4 +95,5 @@ + \ No newline at end of file diff --git a/smart-admin-api/sa-admin/src/main/resources/prod/application.yaml b/smart-admin-api/sa-admin/src/main/resources/prod/application.yaml new file mode 100644 index 00000000..148358fa --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/resources/prod/application.yaml @@ -0,0 +1,15 @@ +server: + servlet: + context-path: '/' + port: 1024 +spring: + profiles: + active: '@profiles.active@' +# 项目配置 +project: + name: sa-admin + module: net.lab1024.sa.admin.module +# swagger文档 +swagger: + host: localhost:${server.port} + tag-class: net.lab1024.sa.admin.constant.AdminSwaggerTagConst \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/resources/pre/log4j2.xml b/smart-admin-api/sa-admin/src/main/resources/prod/log4j2.xml similarity index 97% rename from smart-admin-service/smart-admin-api/src/main/resources/pre/log4j2.xml rename to smart-admin-api/sa-admin/src/main/resources/prod/log4j2.xml index f1942baf..dafcb3d0 100644 --- a/smart-admin-service/smart-admin-api/src/main/resources/pre/log4j2.xml +++ b/smart-admin-api/sa-admin/src/main/resources/prod/log4j2.xml @@ -5,7 +5,7 @@ --> - /home/logs/smart-admin/dev/logs + $${env:localPath:-/home}/logs/smart_admin_v2/prod @@ -85,6 +85,7 @@ + @@ -94,4 +95,5 @@ + \ No newline at end of file diff --git a/smart-admin-api/sa-admin/src/main/resources/test/application.yaml b/smart-admin-api/sa-admin/src/main/resources/test/application.yaml new file mode 100644 index 00000000..148358fa --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/resources/test/application.yaml @@ -0,0 +1,15 @@ +server: + servlet: + context-path: '/' + port: 1024 +spring: + profiles: + active: '@profiles.active@' +# 项目配置 +project: + name: sa-admin + module: net.lab1024.sa.admin.module +# swagger文档 +swagger: + host: localhost:${server.port} + tag-class: net.lab1024.sa.admin.constant.AdminSwaggerTagConst \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/resources/prod/log4j2.xml b/smart-admin-api/sa-admin/src/main/resources/test/log4j2.xml similarity index 97% rename from smart-admin-service/smart-admin-api/src/main/resources/prod/log4j2.xml rename to smart-admin-api/sa-admin/src/main/resources/test/log4j2.xml index 4991f76e..035d17e0 100644 --- a/smart-admin-service/smart-admin-api/src/main/resources/prod/log4j2.xml +++ b/smart-admin-api/sa-admin/src/main/resources/test/log4j2.xml @@ -5,7 +5,7 @@ --> - /home/logs/smart-admin + $${env:localPath:-/home}/logs/smart_admin_v2/test @@ -85,8 +85,9 @@ + - + @@ -94,4 +95,5 @@ + \ No newline at end of file diff --git a/smart-admin-api/sa-admin/src/main/resources/test/spy.properties b/smart-admin-api/sa-admin/src/main/resources/test/spy.properties new file mode 100644 index 00000000..9877f620 --- /dev/null +++ b/smart-admin-api/sa-admin/src/main/resources/test/spy.properties @@ -0,0 +1,18 @@ +#相关的包 +modulelist=com.baomidou.mybatisplus.extension.p6spy.MybatisPlusLogFactory,com.p6spy.engine.outage.P6OutageFactory +# 日志格式 +logMessageFormat=com.baomidou.mybatisplus.extension.p6spy.P6SpyLogger +#日志输出到控制台 +appender=com.p6spy.engine.spy.appender.StdoutLogger +# 设置 p6spy driver 代理 +deregisterdrivers=true +# 取消JDBC URL前缀 +useprefix=true +# 配置记录 Log 例外,可去掉的结果集有error,info,batch,debug,statement,commit,rollback,result,resultset. +excludecategories=info,debug,result,commit,resultset +# 日期格式 +dateformat=yyyy-MM-dd HH:mm:ss +# 开启慢sql +outagedetection=true +# 慢SQL记录标准(单位秒) +outagedetectioninterval=2 \ No newline at end of file diff --git a/smart-admin-api/sa-admin/src/test/java/net/lab1024/sa/admin/SmartAdminApplicationTest.java b/smart-admin-api/sa-admin/src/test/java/net/lab1024/sa/admin/SmartAdminApplicationTest.java new file mode 100644 index 00000000..864741d1 --- /dev/null +++ b/smart-admin-api/sa-admin/src/test/java/net/lab1024/sa/admin/SmartAdminApplicationTest.java @@ -0,0 +1,25 @@ +package net.lab1024.sa.admin; + +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.extension.ExtendWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit.jupiter.SpringExtension; + +@ExtendWith(SpringExtension.class) +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) +public class SmartAdminApplicationTest { + + @BeforeEach + public void before() { + System.out.println("----------------------- 测试开始 -----------------------"); + + } + + @AfterEach + public void after() { + System.out.println("----------------------- 测试结束 -----------------------"); + } + +} + diff --git a/smart-admin-service/smart-admin-api/pom.xml b/smart-admin-api/sa-common/pom.xml similarity index 53% rename from smart-admin-service/smart-admin-api/pom.xml rename to smart-admin-api/sa-common/pom.xml index f7ec8db4..0a52eeda 100644 --- a/smart-admin-service/smart-admin-api/pom.xml +++ b/smart-admin-api/sa-common/pom.xml @@ -1,199 +1,83 @@ + 4.0.0 net.1024lab - smart-admin-service-parent + sa-parent 1.0.0 ../pom.xml - 4.0.0 - smart-admin-api - jar + sa-common + 1.0.0 - smart-admin-api - - - UTF-8 - UTF-8 - 1.8 - + sa-common + sa-common project - - - org.springframework.boot - spring-boot-starter-log4j2 - org.springframework.boot spring-boot-starter-aop - spring-boot-starter-logging org.springframework.boot + spring-boot-starter-logging + org.springframework.boot - spring-boot-starter-quartz + spring-boot-starter-data-redis + + + org.springframework.boot + spring-boot-starter + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-logging + + + + + + + org.springframework.boot + spring-boot-starter-security + + + + org.springframework.boot + spring-boot-starter-log4j2 + + + + org.apache.logging.log4j + log4j-spring-boot + + + + org.apache.logging.log4j + log4j-web + + org.springframework.boot spring-boot-starter-validation - - org.springframework.boot - spring-boot-starter-data-redis - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-websocket - - - org.springframework.boot - spring-boot-starter-mail - + org.springframework.boot spring-boot-starter-test - test - - - org.springframework.boot - spring-boot-starter-actuator - - - logback-classic - ch.qos.logback - - - spring-boot-starter-logging - org.springframework.boot - - - - - - - com.baomidou - mybatis-plus-boot-starter - - - - - velocity - org.apache.velocity - - - commons-collections - commons-collections - - - - - org.apache.velocity - velocity-engine-core - - - - - - com.alibaba - fastjson - - - - - com.alibaba - druid - - - - - p6spy - p6spy - - - - - io.springfox - springfox-swagger2 - - - io.springfox - springfox-swagger-ui - - - - - - com.github.xiaoymin - knife4j-spring-boot-starter - ${knife4j.version} - - - - - - com.google.guava - guava - - - - - com.aliyun.oss - aliyun-sdk-oss - - - commons-logging - commons-logging - - - - - com.qiniu - qiniu-java-sdk - - - commons-fileupload - commons-fileupload - - - - - - io.jsonwebtoken - jjwt - - - - - cn.afterturn - easypoi-spring-boot-starter - - - - - commons-beanutils - commons-beanutils - - - commons-logging - commons-logging - - - - - - org.apache.commons - commons-pool2 @@ -202,13 +86,44 @@ - com.github.penggle - kaptcha + com.github.ben-manes.caffeine + caffeine + + + error_prone_annotations + com.google.errorprone + + - com.googlecode.concurrentlinkedhashmap - concurrentlinkedhashmap-lru + org.projectlombok + lombok + + + + org.apache.commons + commons-pool2 + + + + org.springframework + spring-mock + + + + com.baomidou + mybatis-plus-boot-starter + + + + p6spy + p6spy + + + + io.springfox + springfox-swagger2 @@ -217,60 +132,105 @@ - eu.bitwalker - UserAgentUtils + io.springfox + springfox-swagger-ui - org.projectlombok - lombok - provided + com.alibaba + fastjson + + + + com.alibaba + druid + + + + com.google.guava + guava + + + + com.github.penggle + kaptcha + + + + + cn.afterturn + easypoi-spring-boot-starter + + + + cn.afterturn + easypoi-web + + + + + com.googlecode.concurrentlinkedhashmap + concurrentlinkedhashmap-lru + + + + org.reflections + reflections + + + + com.amazonaws + aws-java-sdk-s3 + + + + + xerces + xercesImpl + + + org.apache.poi + poi-scratchpad + + + + org.apache.commons + commons-lang3 + + + org.apache.commons + commons-collections4 + + + + commons-io + commons-io + + + + cn.hutool + hutool-all + + + + io.jsonwebtoken + jjwt + + + + com.auth0 + jwks-rsa + + + org.apache.velocity + velocity-engine-core + + + org.apache.velocity.tools + velocity-tools-generic - - - - src/main/java - - **/*.* - - - - false - src/main/resources - - dev/* - sit/* - pre/* - prod/* - - - - src/main/resources/${profiles.active} - true - - *.properties - *.xml - - - - - - org.springframework.boot - spring-boot-maven-plugin - - true - - - - org.apache.maven.plugins - maven-surefire-plugin - - true - - - - + \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/anno/NoNeedLogin.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/annoation/NoNeedLogin.java similarity index 52% rename from smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/anno/NoNeedLogin.java rename to smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/annoation/NoNeedLogin.java index 3957937a..e8100629 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/anno/NoNeedLogin.java +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/annoation/NoNeedLogin.java @@ -1,4 +1,4 @@ -package net.lab1024.smartadmin.common.anno; +package net.lab1024.sa.common.common.annoation; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; @@ -6,15 +6,13 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** + * 不需要登录注解 * - * [ 不需要登陆 ] - * - * @version 1.0 - * @since JDK1.8 - * @author yandanyang - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date + * @Author 1024创新实验室: 罗伊 + * @Date 2022-05-30 21:22:12 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/annoation/SaAuth.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/annoation/SaAuth.java new file mode 100644 index 00000000..4d44a2f7 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/annoation/SaAuth.java @@ -0,0 +1,22 @@ +package net.lab1024.sa.common.common.annoation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 校验权限注解 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022-05-30 21:22:12 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.METHOD) +public @interface SaAuth { + + String saAuth = "saAuth"; +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/code/ErrorCode.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/code/ErrorCode.java new file mode 100644 index 00000000..f67cc95c --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/code/ErrorCode.java @@ -0,0 +1,52 @@ +package net.lab1024.sa.common.common.code; + +/** + * 错误码
+ * 一共分为三种: 1)系统错误、2)用户级别错误、3)未预期到的错误 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2021-09-02 20:21:10 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public interface ErrorCode { + + /** + * 系统等级 + */ + String LEVEL_SYSTEM = "system"; + + /** + * 用户等级 + */ + String LEVEL_USER = "user"; + + /** + * 未预期到的等级 + */ + String LEVEL_UNEXPECTED = "unexpected"; + + /** + * 错误码 + * + * @return + */ + int getCode(); + + /** + * 错误消息 + * + * @return + */ + String getMsg(); + + /** + * 错误等级 + * + * @return + */ + String getLevel(); + + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/code/ErrorCodeRangeContainer.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/code/ErrorCodeRangeContainer.java new file mode 100644 index 00000000..db8cce84 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/code/ErrorCodeRangeContainer.java @@ -0,0 +1,119 @@ +package net.lab1024.sa.common.common.code; + +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.tuple.ImmutablePair; + +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * 错误码 注册容器 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2021/09/27 22:09 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +class ErrorCodeRangeContainer { + + /** + * 所有的错误码均大于10000 + */ + static final int MIN_START_CODE = 10000; + + static final Map, ImmutablePair> CODE_RANGE_MAP = new ConcurrentHashMap<>(); + + /** + * 用于统计数量 + */ + static int errorCounter = 0; + + /** + * 注册状态码 + * 校验是否重复 是否越界 + * + * @param clazz + * @param start + * @param end + */ + static void register(Class clazz, int start, int end) { + String simpleName = clazz.getSimpleName(); + if (!clazz.isEnum()) { + throw new ExceptionInInitializerError(String.format("<> error: %s not Enum class !", simpleName)); + } + if (start > end) { + throw new ExceptionInInitializerError(String.format("<> error: %s start must be less than the end !", simpleName)); + } + + if (start <= MIN_START_CODE) { + throw new ExceptionInInitializerError(String.format("<> error: %s start must be more than %s !", simpleName, MIN_START_CODE)); + } + + // 校验是否重复注册 + boolean containsKey = CODE_RANGE_MAP.containsKey(clazz); + if (containsKey) { + throw new ExceptionInInitializerError(String.format("<> error: Enum %s already exist !", simpleName)); + } + + // 校验 开始结束值 是否越界 + CODE_RANGE_MAP.forEach((k, v) -> { + if (isExistOtherRange(start, end, v)) { + throw new IllegalArgumentException(String.format("<> error: %s[%d,%d] has intersection with class:%s[%d,%d]", simpleName, start, end, + k.getSimpleName(), v.getLeft(), v.getRight())); + } + }); + + // 循环校验code并存储 + List codeList = Stream.of(clazz.getEnumConstants()).map(codeEnum -> { + Integer code = codeEnum.getCode(); + if (code < start || code > end) { + throw new IllegalArgumentException(String.format("<> error: %s[%d,%d] code %d out of range", simpleName, start, end, code)); + } + return code; + }).collect(Collectors.toList()); + + // 校验code是否重复 + List distinctCodeList = codeList.stream().distinct().collect(Collectors.toList()); + Collection subtract = CollectionUtils.subtract(codeList, distinctCodeList); + if (CollectionUtils.isNotEmpty(subtract)) { + throw new IllegalArgumentException(String.format("<> error: %s code %s is repeat!", simpleName, subtract)); + } + + CODE_RANGE_MAP.put(clazz, ImmutablePair.of(start, end)); + // 统计 + errorCounter = errorCounter + distinctCodeList.size(); + } + + /** + * 是否存在于其他范围 + * + * @param start + * @param end + * @param range + * @return + */ + private static boolean isExistOtherRange(int start, int end, ImmutablePair range) { + if (start >= range.getLeft() && start <= range.getRight()) { + return true; + } + + if (end >= range.getLeft() && end <= range.getRight()) { + return true; + } + + return false; + } + + /** + * 进行初始化 + */ + static int initialize() { + return errorCounter; + } + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/code/ErrorCodeRegister.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/code/ErrorCodeRegister.java new file mode 100644 index 00000000..43fe18a1 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/code/ErrorCodeRegister.java @@ -0,0 +1,41 @@ +package net.lab1024.sa.common.common.code; + +import static net.lab1024.sa.common.common.code.ErrorCodeRangeContainer.register; + +/** + * 注册code状态码
+ * ps:为什么要在此处不那么优雅的手动注册? + * 主要是为了能统一、清晰、浏览当前定义的所有状态码 + * 方便后续维护 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2021/09/27 23:09 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public class ErrorCodeRegister { + + static { + + // 系统 错误码 + register(SystemErrorCode.class, 10001, 20000); + + // 意外 错误码 + register(UnexpectedErrorCode.class, 20001, 30000); + + // 用户 通用错误码 + register(UserErrorCode.class, 30001, 40000); + + } + + + public static int initialize() { + return ErrorCodeRangeContainer.initialize(); + } + + public static void main(String[] args) { + ErrorCodeRegister.initialize(); + } + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/code/SystemErrorCode.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/code/SystemErrorCode.java new file mode 100644 index 00000000..f3fc67ec --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/code/SystemErrorCode.java @@ -0,0 +1,36 @@ +package net.lab1024.sa.common.common.code; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 系统错误状态码(此类返回码应该高度重视) + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2021/10/24 20:09 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Getter +@AllArgsConstructor +public enum SystemErrorCode implements ErrorCode { + + SYSTEM_ERROR(10001, "系统似乎出现了点小问题"), + + ; + + private final int code; + + private final String msg; + + private final String level; + + SystemErrorCode(int code, String msg) { + this.code = code; + this.msg = msg; + this.level = LEVEL_SYSTEM; + } + +} + diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/code/UnexpectedErrorCode.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/code/UnexpectedErrorCode.java new file mode 100644 index 00000000..2fc735d3 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/code/UnexpectedErrorCode.java @@ -0,0 +1,36 @@ +package net.lab1024.sa.common.common.code; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 未预期的错误码(即发生了不可能发生的事情,此类返回码应该高度重视) + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2021/09/27 22:10:46 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Getter +@AllArgsConstructor +public enum UnexpectedErrorCode implements ErrorCode { + + BUSINESS_HANDING(20001, "呃~ 业务繁忙,请稍后重试"), + PAY_ORDER_ID_ERROR(20002, "付款单id发生了异常,请联系技术人员排查"), + + ; + + private final int code; + + private final String msg; + + private final String level; + + UnexpectedErrorCode(int code, String msg) { + this.code = code; + this.msg = msg; + this.level = LEVEL_UNEXPECTED; + } + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/code/UserErrorCode.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/code/UserErrorCode.java new file mode 100644 index 00000000..6178661a --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/code/UserErrorCode.java @@ -0,0 +1,48 @@ +package net.lab1024.sa.common.common.code; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 用户级别的错误码(用户引起的错误返回码,可以不用关注) + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2021/09/21 22:12:27 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Getter +@AllArgsConstructor +public enum UserErrorCode implements ErrorCode { + + PARAM_ERROR(30001, "参数错误"), + + DATA_NOT_EXIST(30002, "左翻右翻,数据竟然找不到了~"), + + ALREADY_EXIST(30003, "数据已存在了呀~"), + + REPEAT_SUBMIT(30004, "亲~您操作的太快了,请稍等下再操作~"), + + NO_PERMISSION(30005, "对不起,您无法访问此资源哦~"), + + DEVELOPING(30006, "系統正在紧急开发中,敬请期待~"), + + LOGIN_STATE_INVALID(30007, "您还未登录或登录失效,请重新登录!"), + + USER_STATUS_ERROR(30008, "用户状态异常"), + + FORM_REPEAT_SUBMIT(30009, "请勿重复提交"); + + private final int code; + + private final String msg; + + private final String level; + + UserErrorCode(int code, String msg) { + this.code = code; + this.msg = msg; + this.level = LEVEL_USER; + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/constant/RequestHeaderConst.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/constant/RequestHeaderConst.java new file mode 100644 index 00000000..674e4dd4 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/constant/RequestHeaderConst.java @@ -0,0 +1,18 @@ +package net.lab1024.sa.common.common.constant; + +/** + * 请求消息头常量 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022-05-15 20:46:27 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public class RequestHeaderConst { + + public static final String TOKEN = "x-access-token"; + + public static final String USER_AGENT = "user-agent"; + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/constant/StringConst.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/constant/StringConst.java new file mode 100644 index 00000000..2a40152d --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/constant/StringConst.java @@ -0,0 +1,44 @@ +package net.lab1024.sa.common.common.constant; + +/** + * 字符串常量 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2021-10-14 23:16:47 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public class StringConst { + + /** + * 全局通用分隔符 + */ + public static final String SEPARATOR = ","; + + /** + * 全局通用分隔符 下划线 + */ + public static final String UNDERLINE = "_"; + + /** + * 全局通用 横杠 + */ + public static final String HORIZONTAL = "-"; + + /** + * 全局通用分隔符 + */ + public static final Character SEPARATOR_CHAR = ','; + + /** + * 全局通用分隔符 斜杠 + */ + public static final String SEPARATOR_SLASH = "/"; + + /** + * 空字符串 + */ + public static final String EMPTY = ""; + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/controller/SupportBaseController.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/controller/SupportBaseController.java new file mode 100644 index 00000000..5c135dec --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/controller/SupportBaseController.java @@ -0,0 +1,16 @@ +package net.lab1024.sa.common.common.controller; + +import net.lab1024.sa.common.constant.UrlPrefixConst; +import org.springframework.web.bind.annotation.RequestMapping; +/** + * 支撑类业务路由基类 + * + * @Author 1024创新实验室: 胡克 + * @Date 2022-04-24 20:43:55 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@RequestMapping(UrlPrefixConst.SUPPORT) +public class SupportBaseController { +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/domain/DataScopePlugin.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/domain/DataScopePlugin.java new file mode 100644 index 00000000..8963f216 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/domain/DataScopePlugin.java @@ -0,0 +1,15 @@ +package net.lab1024.sa.common.common.domain; + +import org.apache.ibatis.plugin.Interceptor; + +/** + * 数据范围 插件 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2021-11-15 17:20:04 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public abstract class DataScopePlugin implements Interceptor { +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/domain/PageParam.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/domain/PageParam.java new file mode 100644 index 00000000..8ffb7d75 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/domain/PageParam.java @@ -0,0 +1,58 @@ +package net.lab1024.sa.common.common.domain; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.Valid; +import javax.validation.constraints.Max; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.util.List; + +/** + * 分页基础参数 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2020/04/28 16:19 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class PageParam { + + @ApiModelProperty(value = "页码(不能为空)", required = true, example = "1") + @NotNull(message = "分页参数不能为空") + private Integer pageNum; + + @ApiModelProperty(value = "每页数量(不能为空)", required = true, example = "10") + @NotNull(message = "每页数量不能为空") + @Max(value = 200, message = "每页最大为200") + private Integer pageSize; + + @ApiModelProperty("是否查询总条数") + protected Boolean searchCount; + + @ApiModelProperty("排序字段集合") + @Size(max = 10, message = "排序字段最多10") + @Valid + private List sortItemList; + + /** + * 排序DTO类 + */ + @Data + public static class SortItem { + + @ApiModelProperty("true正序|false倒序") + @NotNull(message = "排序规则不能为空") + private Boolean isAsc; + + @ApiModelProperty(value = "排序字段") + @NotBlank(message = "排序字段不能为空") + @Length(max = 30, message = "排序字段最多30") + private String column; + } +} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/domain/PageResultDTO.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/domain/PageResult.java similarity index 64% rename from smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/domain/PageResultDTO.java rename to smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/domain/PageResult.java index 23995832..0f75f991 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/domain/PageResultDTO.java +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/domain/PageResult.java @@ -1,4 +1,4 @@ -package net.lab1024.smartadmin.common.domain; +package net.lab1024.sa.common.common.domain; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -6,13 +6,16 @@ import lombok.Data; import java.util.List; /** - * Page返回对象 + * 分页返回对象 * - * @Author lihaifan - * @Date Created in 2017/10/31 15:05 + * @Author 1024创新实验室-主任: 卓大 + * @Date 2020/04/28 16:19 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) */ @Data -public class PageResultDTO { +public class PageResult { /** * 当前页 @@ -44,4 +47,7 @@ public class PageResultDTO { @ApiModelProperty(value = "结果集") private List list; + @ApiModelProperty("是否为空") + private Boolean emptyFlag; + } diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/domain/RequestUrlVO.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/domain/RequestUrlVO.java new file mode 100644 index 00000000..3b8e0be3 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/domain/RequestUrlVO.java @@ -0,0 +1,26 @@ +package net.lab1024.sa.common.common.domain; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * 请求url返回对象 + * + * @Author 1024创新实验室: 李善逸 + * @Date 2021/9/1 20:15 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class RequestUrlVO { + + @ApiModelProperty("注释说明") + private String comment; + + @ApiModelProperty("controller.method") + private String name; + + @ApiModelProperty("url") + private String url; +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/domain/RequestUser.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/domain/RequestUser.java new file mode 100644 index 00000000..afce6da7 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/domain/RequestUser.java @@ -0,0 +1,49 @@ +package net.lab1024.sa.common.common.domain; + +import net.lab1024.sa.common.common.enumeration.UserTypeEnum; + +/** + * 请求用户 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2021-12-21 19:55:07 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public interface RequestUser { + + /** + * 请求用户id + * + * @return + */ + Long getUserId(); + + /** + * 请求用户名称 + * + * @return + */ + String getUserName(); + + /** + * 获取用户类型 + */ + UserTypeEnum getUserType(); + + /** + * 获取请求的IP + * + * @return + */ + String getIp(); + + /** + * 获取请求 user-agent + * + * @return + */ + String getUserAgent(); + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/domain/ResponseDTO.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/domain/ResponseDTO.java new file mode 100644 index 00000000..4aaaf8e5 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/domain/ResponseDTO.java @@ -0,0 +1,101 @@ +package net.lab1024.sa.common.common.domain; + + +import lombok.Data; +import net.lab1024.sa.common.common.code.ErrorCode; +import net.lab1024.sa.common.common.code.UserErrorCode; +import org.apache.commons.lang3.StringUtils; + +/** + * 请求返回对象 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2021-10-31 21:06:11 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class ResponseDTO { + + public static final int OK_CODE = 0; + + public static final String OK_MSG = "success"; + + private Integer code; + + private String level; + + private String msg; + + private Boolean ok; + + private T data; + + public ResponseDTO(Integer code, String level, boolean ok, String msg, T data) { + this.code = code; + this.level = level; + this.ok = ok; + this.msg = msg; + this.data = data; + } + + public ResponseDTO(ErrorCode errorCode, boolean ok, String msg, T data) { + this.code = errorCode.getCode(); + this.level = errorCode.getLevel(); + this.ok = ok; + if (StringUtils.isNotBlank(msg)) { + this.msg = msg; + } else { + this.msg = errorCode.getMsg(); + } + this.data = data; + } + + public static ResponseDTO ok() { + return new ResponseDTO<>(OK_CODE, null, true, OK_MSG, null); + } + + public static ResponseDTO ok(T data) { + return new ResponseDTO<>(OK_CODE, null, true, OK_MSG, data); + } + + public static ResponseDTO okMsg(String msg) { + return new ResponseDTO<>(OK_CODE, null, true, msg, null); + } + + // -------------------------------------------- 最常用的 用户参数 错误码 -------------------------------------------- + + public static ResponseDTO userErrorParam() { + return new ResponseDTO<>(UserErrorCode.PARAM_ERROR, false, null, null); + } + + + public static ResponseDTO userErrorParam(String msg) { + return new ResponseDTO<>(UserErrorCode.PARAM_ERROR, false, msg, null); + } + + // -------------------------------------------- 错误码 -------------------------------------------- + + public static ResponseDTO error(ErrorCode errorCode) { + return new ResponseDTO<>(errorCode, false, null, null); + } + + public static ResponseDTO error(ErrorCode errorCode, boolean ok) { + return new ResponseDTO<>(errorCode, ok, null, null); + } + + public static ResponseDTO error(ResponseDTO responseDTO) { + return new ResponseDTO<>(responseDTO.getCode(), responseDTO.getLevel(), responseDTO.getOk(), responseDTO.getMsg(), responseDTO.getData()); + } + + public static ResponseDTO error(ErrorCode errorCode, String msg) { + return new ResponseDTO<>(errorCode, false, msg, null); + } + + public static ResponseDTO errorData(ErrorCode errorCode, T data) { + return new ResponseDTO<>(errorCode, false, null, data); + } + + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/domain/SystemEnvironment.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/domain/SystemEnvironment.java new file mode 100644 index 00000000..8cf4b845 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/domain/SystemEnvironment.java @@ -0,0 +1,35 @@ +package net.lab1024.sa.common.common.domain; + + +import lombok.AllArgsConstructor; +import lombok.Getter; +import net.lab1024.sa.common.common.enumeration.SystemEnvironmentEnum; + +/** + * 系统环境 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2021/8/13 21:06:11 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@AllArgsConstructor +@Getter +public class SystemEnvironment { + + /** + * 是否位生产环境 + */ + private boolean isProd; + + /** + * 项目名称 + */ + private String projectName; + + /** + * 当前环境 + */ + private SystemEnvironmentEnum currentEnvironment; +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/domain/ValidateData.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/domain/ValidateData.java new file mode 100644 index 00000000..a9aff002 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/domain/ValidateData.java @@ -0,0 +1,21 @@ +package net.lab1024.sa.common.common.domain; + +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * 校验数据是否为空的包装类 + * + * @Author 1024创新实验室: 胡克 + * @Date 2020/10/16 21:06:11 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class ValidateData { + + @NotNull(message = "数据不能为空哦") + private T data; +} \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/domain/ValidateList.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/domain/ValidateList.java similarity index 89% rename from smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/domain/ValidateList.java rename to smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/domain/ValidateList.java index c3907e63..c2ccb33c 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/domain/ValidateList.java +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/domain/ValidateList.java @@ -1,17 +1,22 @@ -package net.lab1024.smartadmin.common.domain; +package net.lab1024.sa.common.common.domain; import javax.validation.Valid; import javax.validation.constraints.NotEmpty; import java.util.*; /** - * @author: zhuoda - * @create: 2020-02-03 17:37 PM from win10 + * 校验集合是否为空的包装类 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2020-02-03 17:37 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) */ public class ValidateList implements List { @Valid - @NotEmpty(message = "数据长度请大于0!") + @NotEmpty(message = "数据长度不能为空哦") private List list; public ValidateList() { diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/domain/BaseEnum.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/enumeration/BaseEnum.java similarity index 83% rename from smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/domain/BaseEnum.java rename to smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/enumeration/BaseEnum.java index 61ef2c66..c7eaf693 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/domain/BaseEnum.java +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/enumeration/BaseEnum.java @@ -1,4 +1,4 @@ -package net.lab1024.smartadmin.common.domain; +package net.lab1024.sa.common.common.enumeration; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONAware; @@ -10,15 +10,20 @@ import java.util.LinkedHashMap; import java.util.Objects; /** - * @author listen - * @date 2018-07-17 下午 3:52 + * 枚举类接口 + * + * @Author 1024创新实验室: 胡克 + * @Date 2018-07-17 21:22:12 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) */ public interface BaseEnum { /** * 获取枚举类的值 * - * @return Object + * @return */ Object getValue(); @@ -67,24 +72,21 @@ public interface BaseEnum { String enumJson = JSON.toJSONString(json, true); enumJson = enumJson.replaceAll("\"", ""); - enumJson= enumJson.replaceAll("\t","  "); - enumJson = enumJson.replaceAll("\n","
"); + enumJson = enumJson.replaceAll("\t", "  "); + enumJson = enumJson.replaceAll("\n", "
"); String prefix = "
export const
" + CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, clazz.getSimpleName() + " =
"); return prefix + "" + enumJson + "
"; } - @Data class DeletedQuotationAware implements JSONAware { private String value; public DeletedQuotationAware(Object value) { - if(value == null){ - this.value = ""; - }else if (value instanceof String) { + if (value instanceof String) { this.value = "'" + value + "'"; - }else { + } else { this.value = value.toString(); } } diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/enumeration/GenderEnum.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/enumeration/GenderEnum.java new file mode 100644 index 00000000..548d02e1 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/enumeration/GenderEnum.java @@ -0,0 +1,37 @@ +package net.lab1024.sa.common.common.enumeration; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 性别枚举类 + * + * @Author 1024创新实验室: 胡克 + * @Date 2019/09/24 16:50 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@AllArgsConstructor +@Getter +public enum GenderEnum implements BaseEnum { + + /** + * 0 未知 + */ + UNKNOWN(0, "未知"), + + /** + * 男 1 奇数为阳 + */ + MAN(1, "男"), + + /** + * 女 2 偶数为阴 + */ + WOMAN(2, "女"); + + private final Integer value; + + private final String desc; +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/enumeration/SystemEnvironmentEnum.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/enumeration/SystemEnvironmentEnum.java new file mode 100644 index 00000000..bccaecbd --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/enumeration/SystemEnvironmentEnum.java @@ -0,0 +1,50 @@ +package net.lab1024.sa.common.common.enumeration; + + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 系统环境枚举类 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2020-10-15 22:45:04 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@AllArgsConstructor +@Getter +public enum SystemEnvironmentEnum implements BaseEnum { + /** + * dev + */ + DEV(SystemEnvironmentNameConst.DEV, "开发环境"), + + /** + * test + */ + TEST(SystemEnvironmentNameConst.TEST, "测试环境"), + + /** + * pre + */ + PRE(SystemEnvironmentNameConst.PRE, "预发布环境"), + + /** + * prod + */ + PROD(SystemEnvironmentNameConst.PROD, "生产环境"); + + private final String value; + + private final String desc; + + public static final class SystemEnvironmentNameConst { + public static final String DEV = "dev"; + public static final String TEST = "test"; + public static final String PRE = "pre"; + public static final String PROD = "prod"; + } + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/enumeration/UserTypeEnum.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/enumeration/UserTypeEnum.java new file mode 100644 index 00000000..c34670b9 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/enumeration/UserTypeEnum.java @@ -0,0 +1,37 @@ +package net.lab1024.sa.common.common.enumeration; + +/** + * 用户类型 + * + * @Author 1024创新实验室-主任:卓大 + * @Date 2022/10/19 21:46:24 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +public enum UserTypeEnum implements BaseEnum { + + /** + * 管理端 员工用户 + */ + ADMIN_EMPLOYEE(1, "员工"); + + private Integer type; + + private String desc; + + UserTypeEnum(Integer type, String desc) { + this.type = type; + this.desc = desc; + } + + @Override + public Integer getValue() { + return type; + } + + @Override + public String getDesc() { + return desc; + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/excel/ExcelStyle.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/excel/ExcelStyle.java new file mode 100644 index 00000000..eb723497 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/excel/ExcelStyle.java @@ -0,0 +1,185 @@ +package net.lab1024.sa.common.common.excel; + +import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; +import cn.afterturn.easypoi.excel.entity.params.ExcelForEachParams; +import cn.afterturn.easypoi.excel.export.styler.IExcelExportStyler; +import org.apache.poi.ss.usermodel.*; + +/** + * excel样式 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2020/9/25 19:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public class ExcelStyle implements IExcelExportStyler { + private static final short STRING_FORMAT = (short) BuiltinFormats.getBuiltinFormat("TEXT"); + private static final short FONT_SIZE_TEN = 10; + private static final short FONT_SIZE_ELEVEN = 11; + private static final short FONT_SIZE_TWELVE = 12; + /** + * 大标题样式 + */ + private CellStyle headerStyle; + /** + * 每列标题样式 + */ + private CellStyle titleStyle; + /** + * 数据行样式 + */ + private CellStyle styles; + + public ExcelStyle(Workbook workbook) { + this.init(workbook); + } + + /** + * 初始化样式 + * + * @param workbook + */ + private void init(Workbook workbook) { + this.headerStyle = initHeaderStyle(workbook); + this.titleStyle = initTitleStyle(workbook); + this.styles = initStyles(workbook); + } + + /** + * 大标题样式 + * + * @param color + * @return + */ + @Override + public CellStyle getHeaderStyle(short color) { + return headerStyle; + } + + /** + * 每列标题样式 + * + * @param color + * @return + */ + @Override + public CellStyle getTitleStyle(short color) { + return titleStyle; + } + + /** + * 数据行样式 + * + * @param parity 可以用来表示奇偶行 + * @param entity 数据内容 + * @return 样式 + */ + public CellStyle getStyles(boolean parity, ExcelExportEntity entity) { + return styles; + } + + /** + * 获取样式方法 + * + * @param dataRow 数据行 + * @param obj 对象 + * @param data 数据 + */ + @Override + public CellStyle getStyles(Cell cell, int dataRow, ExcelExportEntity entity, Object obj, Object data) { + return getStyles(true, entity); + } + + /** + * 模板使用的样式设置 + */ + @Override + public CellStyle getTemplateStyles(boolean isSingle, ExcelForEachParams excelForEachParams) { + return null; + } + + /** + * 初始化--大标题样式 + * + * @param workbook + * @return + */ + private CellStyle initHeaderStyle(Workbook workbook) { + CellStyle style = getBaseCellStyle(workbook); + style.setFont(getFont(workbook, FONT_SIZE_TWELVE, true)); + return style; + } + + /** + * 初始化--每列标题样式 + * + * @param workbook + * @return + */ + private CellStyle initTitleStyle(Workbook workbook) { + CellStyle style = getBaseCellStyle(workbook); + style.setFont(getFont(workbook, FONT_SIZE_ELEVEN, false)); + //背景色 + style.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex()); + style.setFillPattern(FillPatternType.SOLID_FOREGROUND); + return style; + } + + /** + * 初始化--数据行样式 + * + * @param workbook + * @return + */ + private CellStyle initStyles(Workbook workbook) { + CellStyle style = getBaseCellStyle(workbook); + style.setFont(getFont(workbook, FONT_SIZE_TEN, false)); + style.setDataFormat(STRING_FORMAT); + style.setAlignment(HorizontalAlignment.LEFT); + return style; + } + + /** + * 基础样式 + * + * @return + */ + private CellStyle getBaseCellStyle(Workbook workbook) { + CellStyle style = workbook.createCellStyle(); + //下边框 + style.setBorderBottom(BorderStyle.THIN); + //左边框 + style.setBorderLeft(BorderStyle.THIN); + //上边框 + style.setBorderTop(BorderStyle.THIN); + //右边框 + style.setBorderRight(BorderStyle.THIN); + //水平居中 + style.setAlignment(HorizontalAlignment.CENTER); + //上下居中 + style.setVerticalAlignment(VerticalAlignment.CENTER); + //设置自动换行 + style.setWrapText(true); + return style; + } + + /** + * 字体样式 + * + * @param size 字体大小 + * @param isBold 是否加粗 + * @return + */ + private Font getFont(Workbook workbook, short size, boolean isBold) { + Font font = workbook.createFont(); + //字体样式 + font.setFontName("宋体"); + //是否加粗 + font.setBold(isBold); + //字体大小 + font.setFontHeightInPoints(size); + return font; + } +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/exception/BusinessException.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/exception/BusinessException.java new file mode 100644 index 00000000..19b6b958 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/exception/BusinessException.java @@ -0,0 +1,38 @@ +package net.lab1024.sa.common.common.exception; + +import net.lab1024.sa.common.common.code.ErrorCode; + +/** + * 业务逻辑异常,全局异常拦截后统一返回ResponseCodeConst.SYSTEM_ERROR + * + * @Author 1024创新实验室: 罗伊 + * @Date 2020/8/25 21:57 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public class BusinessException extends RuntimeException { + + public BusinessException() { + } + + public BusinessException(ErrorCode errorCode) { + super(errorCode.getMsg()); + } + + public BusinessException(String message) { + super(message); + } + + public BusinessException(String message, Throwable cause) { + super(message, cause); + } + + public BusinessException(Throwable cause) { + super(cause); + } + + public BusinessException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { + super(message, cause, enableSuppression, writableStackTrace); + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/interceptor/AbstractInterceptor.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/interceptor/AbstractInterceptor.java new file mode 100644 index 00000000..62f2042d --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/interceptor/AbstractInterceptor.java @@ -0,0 +1,148 @@ +package net.lab1024.sa.common.common.interceptor; + +import com.alibaba.fastjson.JSONObject; +import net.lab1024.sa.common.common.annoation.NoNeedLogin; +import net.lab1024.sa.common.common.code.UserErrorCode; +import net.lab1024.sa.common.common.constant.RequestHeaderConst; +import net.lab1024.sa.common.common.domain.RequestUser; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.util.SmartRequestUtil; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.util.CollectionUtils; +import org.springframework.web.method.HandlerMethod; +import org.springframework.web.servlet.HandlerInterceptor; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.List; +import java.util.function.Function; + +/** + * 抽象拦截器 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2021-10-09 20:56:14 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public abstract class AbstractInterceptor implements HandlerInterceptor { + + @Autowired + private List ignoreUrlList; + + + /** + * Token获取用户信息 + * + * @return + */ + protected abstract Function userFunction(); + + /** + * 拦截路径 + * + * @return + */ + public abstract String[] pathPatterns(); + + /** + * 忽略的url集合 + * + * @return + */ + protected List getIgnoreUrlList() { + return ignoreUrlList; + } + + /** + * 拦截服务器端响应处理ajax请求返回结果 + * + * @param request + * @param response + * @param handler + * @return + * @throws Exception + */ + @Override + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { + // OPTIONS请求直接return + if (HttpMethod.OPTIONS.toString().equals(request.getMethod())) { + response.setStatus(HttpStatus.NO_CONTENT.value()); + return false; + } + + boolean isHandler = handler instanceof HandlerMethod; + if (!isHandler) { + return true; + } + //放行的Uri前缀 + String uri = request.getRequestURI(); + String contextPath = request.getContextPath(); + String target = uri.replaceFirst(contextPath, ""); + if (this.contain(this.getIgnoreUrlList(), target)) { + return true; + } + //不需要登录 + NoNeedLogin noNeedLogin = ((HandlerMethod) handler).getMethodAnnotation(NoNeedLogin.class); + // 检查是否包含 token + String xRequestToken = request.getParameter(RequestHeaderConst.TOKEN); + String xHeaderToken = request.getHeader(RequestHeaderConst.TOKEN); + String xAccessToken = StringUtils.isNotBlank(xRequestToken) ? xRequestToken : xHeaderToken; + // 包含token 则获取用户信息 并保存 + if (StringUtils.isNotBlank(xAccessToken)) { + RequestUser requestUser = userFunction().apply(xAccessToken); + if (requestUser != null) { + SmartRequestUtil.setRequestUser(requestUser); + } + // 有token 无需登录 + if (null != noNeedLogin) { + return true; + } + } + // 无token 无需登录 + if (null != noNeedLogin) { + return true; + } + if (StringUtils.isBlank(xAccessToken)) { + this.outputResult(response, ResponseDTO.error(UserErrorCode.LOGIN_STATE_INVALID)); + return false; + } + return true; + } + + public Boolean contain(List ignores, String uri) { + if (CollectionUtils.isEmpty(ignores)) { + return false; + } + for (String ignoreUrl : ignores) { + if (uri.startsWith(ignoreUrl)) { + return true; + } + } + return false; + } + + /** + * 错误输出 + * + * @param response + * @param responseDTO + * @throws IOException + */ + private void outputResult(HttpServletResponse response, ResponseDTO responseDTO) throws IOException { + String msg = JSONObject.toJSONString(responseDTO); + response.setContentType("application/json;charset=UTF-8"); + response.getWriter().write(msg); + response.flushBuffer(); + } + + @Override + public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { + SmartRequestUtil.remove(); + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/json/deserializer/DictValueVoDeserializer.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/json/deserializer/DictValueVoDeserializer.java new file mode 100644 index 00000000..e61f1133 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/json/deserializer/DictValueVoDeserializer.java @@ -0,0 +1,52 @@ +package net.lab1024.sa.common.common.json.deserializer; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.ObjectCodec; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; +import lombok.extern.slf4j.Slf4j; +import net.lab1024.sa.common.module.support.dict.domain.vo.DictValueVO; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 字典反序列化 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022-08-12 22:17:53 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Slf4j +public class DictValueVoDeserializer extends JsonDeserializer { + + @Override + public String deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { + List list = new ArrayList<>(); + ObjectCodec objectCodec = jsonParser.getCodec(); + JsonNode listOrObjectNode = objectCodec.readTree(jsonParser); + String deserialize = ""; + try { + if (listOrObjectNode.isArray()) { + for (JsonNode node : listOrObjectNode) { + list.add(objectCodec.treeToValue(node, DictValueVO.class)); + } + } else { + list.add(objectCodec.treeToValue(listOrObjectNode, DictValueVO.class)); + } + deserialize = list.stream().map(DictValueVO::getValueCode).collect(Collectors.joining(",")); + } catch (Exception e) { + log.error(e.getMessage(), e); + deserialize = listOrObjectNode.asText(); + } + return deserialize; + } + + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/json/deserializer/FileKeyVoDeserializer.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/json/deserializer/FileKeyVoDeserializer.java new file mode 100644 index 00000000..66d5bdb6 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/json/deserializer/FileKeyVoDeserializer.java @@ -0,0 +1,53 @@ +package net.lab1024.sa.common.common.json.deserializer; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.ObjectCodec; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; +import lombok.extern.slf4j.Slf4j; +import net.lab1024.sa.common.module.support.file.domain.vo.FileVO; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 文件key反序列化
+ * 由于前端接收到的是序列化过的字段, 这边入库需要进行反序列化操作比较方便处理 + * + * @Author 1024创新实验室: 胡克 + * @Date 2022-11-24 17:15:23 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Slf4j +public class FileKeyVoDeserializer extends JsonDeserializer { + + @Override + public String deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { + List list = new ArrayList<>(); + ObjectCodec objectCodec = jsonParser.getCodec(); + JsonNode listOrObjectNode = objectCodec.readTree(jsonParser); + String deserialize = ""; + try { + if (listOrObjectNode.isArray()) { + for (JsonNode node : listOrObjectNode) { + list.add(objectCodec.treeToValue(node, FileVO.class)); + } + } else { + list.add(objectCodec.treeToValue(listOrObjectNode, FileVO.class)); + } + deserialize = list.stream().map(FileVO::getFileKey).collect(Collectors.joining(",")); + } catch (Exception e) { + log.error(e.getMessage(), e); + deserialize = listOrObjectNode.asText(); + } + return deserialize; + } + + +} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/json/LongJsonDeserializer.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/json/deserializer/LongJsonDeserializer.java similarity index 71% rename from smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/json/LongJsonDeserializer.java rename to smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/json/deserializer/LongJsonDeserializer.java index 0dc8e315..debb4875 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/json/LongJsonDeserializer.java +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/json/deserializer/LongJsonDeserializer.java @@ -1,4 +1,4 @@ -package net.lab1024.smartadmin.common.json; +package net.lab1024.sa.common.common.json.deserializer; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; @@ -7,6 +7,15 @@ import com.fasterxml.jackson.databind.JsonDeserializer; import java.io.IOException; +/** + * Long类型序列化 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2020-06-02 22:55:07 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ public class LongJsonDeserializer extends JsonDeserializer { @Override diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/json/serializer/BigDecimalNullZeroSerializer.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/json/serializer/BigDecimalNullZeroSerializer.java new file mode 100644 index 00000000..b0174ddf --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/json/serializer/BigDecimalNullZeroSerializer.java @@ -0,0 +1,29 @@ +package net.lab1024.sa.common.common.json.serializer; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; + +import java.io.IOException; +import java.math.BigDecimal; + +/** + * 数字序列化 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2020/8/20 21:04 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public class BigDecimalNullZeroSerializer extends JsonSerializer { + + @Override + public void serialize(BigDecimal value, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { + if (value == null) { + jsonGenerator.writeNumber(BigDecimal.ZERO); + return; + } + jsonGenerator.writeNumber(value); + } +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/json/serializer/DictValueVoSerializer.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/json/serializer/DictValueVoSerializer.java new file mode 100644 index 00000000..5398bb0d --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/json/serializer/DictValueVoSerializer.java @@ -0,0 +1,52 @@ +package net.lab1024.sa.common.common.json.serializer; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.google.common.collect.Lists; +import net.lab1024.sa.common.module.support.dict.domain.vo.DictValueVO; +import net.lab1024.sa.common.module.support.dict.service.DictCacheService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; + +/** + * 字典序列化 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022-08-12 22:17:53 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public class DictValueVoSerializer extends JsonSerializer { + + @Autowired + private DictCacheService dictCacheService; + + + @Override + public void serialize(String value, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { + if (StringUtils.isEmpty(value)) { + jsonGenerator.writeObject(Lists.newArrayList()); + return; + } + + String[] valueCodeArray = value.split(","); + List valueCodeList = Arrays.asList(valueCodeArray); + List dictValueVOList = Lists.newArrayList(); + valueCodeList.forEach(e->{ + if(StringUtils.isNotBlank(e)){ + DictValueVO dictValueVO = dictCacheService.selectValueByValueCode(value); + if(dictValueVO != null){ + dictValueVOList.add(dictValueVO); + } + } + }); + jsonGenerator.writeObject(dictValueVOList); + + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/json/serializer/FileKeySerializer.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/json/serializer/FileKeySerializer.java new file mode 100644 index 00000000..d63d492b --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/json/serializer/FileKeySerializer.java @@ -0,0 +1,45 @@ +package net.lab1024.sa.common.common.json.serializer; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.module.support.file.service.FileService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; + +import java.io.IOException; + +/** + * 文件key进行序列化对象 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2020/8/15 22:06 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public class FileKeySerializer extends JsonSerializer { + + @Autowired + private FileService fileService; + + + @Override + public void serialize(String value, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { + if (StringUtils.isEmpty(value)) { + jsonGenerator.writeString(value); + return; + } + if (fileService == null) { + jsonGenerator.writeString(value); + return; + } + ResponseDTO responseDTO = fileService.getFileUrl(value); + if (responseDTO.getOk()) { + jsonGenerator.writeString(responseDTO.getData()); + return; + } + jsonGenerator.writeString(value); + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/json/serializer/FileKeyVoSerializer.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/json/serializer/FileKeyVoSerializer.java new file mode 100644 index 00000000..8f27dc1e --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/json/serializer/FileKeyVoSerializer.java @@ -0,0 +1,46 @@ +package net.lab1024.sa.common.common.json.serializer; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.google.common.collect.Lists; +import net.lab1024.sa.common.module.support.file.domain.vo.FileVO; +import net.lab1024.sa.common.module.support.file.service.FileService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; + +/** + * 文件key进行序列化对象 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2020/8/15 22:06 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public class FileKeyVoSerializer extends JsonSerializer { + + @Autowired + private FileService fileService; + + + @Override + public void serialize(String value, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { + if (StringUtils.isEmpty(value)) { + jsonGenerator.writeObject(Lists.newArrayList()); + return; + } + if(fileService == null){ + jsonGenerator.writeString(value); + return; + } + String[] fileKeyArray = value.split(","); + List fileKeyList = Arrays.asList(fileKeyArray); + List fileKeyVOList = fileService.getFileList(fileKeyList); + jsonGenerator.writeObject(fileKeyVOList); + } +} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/json/LongJsonSerializer.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/json/serializer/LongJsonSerializer.java similarity index 70% rename from smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/json/LongJsonSerializer.java rename to smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/json/serializer/LongJsonSerializer.java index 75442925..05a140a3 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/json/LongJsonSerializer.java +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/json/serializer/LongJsonSerializer.java @@ -1,5 +1,4 @@ -package net.lab1024.smartadmin.common.json; - +package net.lab1024.sa.common.common.json.serializer; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonProcessingException; @@ -8,7 +7,17 @@ import com.fasterxml.jackson.databind.SerializerProvider; import java.io.IOException; +/** + * Long类型序列化 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2020-06-02 22:55:07 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ public class LongJsonSerializer extends JsonSerializer { + @Override public void serialize(Long value, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException, JsonProcessingException { String text = (value == null ? null : String.valueOf(value)); diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/security/AbstractSecurityConfig.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/security/AbstractSecurityConfig.java new file mode 100644 index 00000000..91fb7212 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/security/AbstractSecurityConfig.java @@ -0,0 +1,91 @@ +package net.lab1024.sa.common.common.security; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; +import org.springframework.security.config.http.SessionCreationPolicy; +import org.springframework.security.core.userdetails.UserDetails; +import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; +import org.springframework.web.filter.CorsFilter; + +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.function.BiFunction; +import java.util.function.Function; + +/** + * Spring Security + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2021/8/3 17:50 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public abstract class AbstractSecurityConfig extends WebSecurityConfigurerAdapter { + @Autowired + private CorsFilter corsFilter; + + @Autowired + private List noNeedLoginUrlList; + + @Autowired + private List ignoreUrlList; + + /** + * Token获取用户信息 + * + * @return + */ + protected abstract BiFunction userFunction(); + + /** + * 需要认证的url集合 + * + * @return + */ + protected abstract String[] getAuthenticatedUrlPatterns(); + + /** + * 不需要登录的url集合 + * + * @return + */ + protected String[] getNoNeedLoginUrl() { + return noNeedLoginUrlList.toArray(new String[noNeedLoginUrlList.size()]); + } + + /** + * 忽略的url集合 + * + * @return + */ + protected String[] getIgnoreUrlList() { + return ignoreUrlList.toArray(new String[ignoreUrlList.size()]); + } + + @Override + protected void configure(HttpSecurity httpSecurity) throws Exception { + httpSecurity + // CSRF禁用,因为不使用session + .csrf().disable() + // 认证失败处理类 + .exceptionHandling().authenticationEntryPoint(new SecurityAuthenticationFailHandler()).and() + .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and() + // 过滤请求 + .authorizeRequests() + //忽略的url + .antMatchers(this.getIgnoreUrlList()).permitAll() + // 不需要登陆的url + .antMatchers(this.getNoNeedLoginUrl()).permitAll() + //需要校验权限的url + .antMatchers(getAuthenticatedUrlPatterns()).authenticated(); + + // token filter 进行校验 + httpSecurity.addFilterBefore(new SecurityTokenFilter(this.userFunction()), UsernamePasswordAuthenticationFilter.class); + httpSecurity.addFilterBefore(corsFilter, SecurityTokenFilter.class); + + } + + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/security/SecurityAuthenticationFailHandler.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/security/SecurityAuthenticationFailHandler.java new file mode 100644 index 00000000..3e146f18 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/security/SecurityAuthenticationFailHandler.java @@ -0,0 +1,43 @@ +package net.lab1024.sa.common.common.security; + +import com.alibaba.fastjson.JSONObject; +import net.lab1024.sa.common.common.code.ErrorCode; +import net.lab1024.sa.common.common.code.UserErrorCode; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import org.springframework.security.core.AuthenticationException; +import org.springframework.security.web.AuthenticationEntryPoint; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +/** + * 登录认证失败处理 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022-08-26 20:21:10 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public class SecurityAuthenticationFailHandler implements AuthenticationEntryPoint { + + @Override + public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException e) throws IOException { + this.outputResult(response, UserErrorCode.LOGIN_STATE_INVALID); + } + + /** + * 输出 + * + * @param response + * @param errorCode + * @throws IOException + */ + private void outputResult(HttpServletResponse response, ErrorCode errorCode) throws IOException { + String msg = JSONObject.toJSONString(ResponseDTO.error(errorCode)); + response.setContentType("application/json;charset=UTF-8"); + response.getWriter().write(msg); + response.flushBuffer(); + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/security/SecurityMethodSource.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/security/SecurityMethodSource.java new file mode 100644 index 00000000..290b3d9c --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/security/SecurityMethodSource.java @@ -0,0 +1,66 @@ +package net.lab1024.sa.common.common.security; + +import net.lab1024.sa.common.common.annoation.SaAuth; +import org.apache.commons.lang3.StringUtils; +import org.springframework.security.access.ConfigAttribute; +import org.springframework.security.access.prepost.PreInvocationAttribute; +import org.springframework.security.access.prepost.PrePostAnnotationSecurityMetadataSource; +import org.springframework.security.access.prepost.PrePostInvocationAttributeFactory; + +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.Collection; + +/** + * 此类用于默认给所有接口添加权限 @saAuth.checkPermission('%s') + * %s 为类名.方法名 + * 和使用@PreAuthorize("@saAuth.checkPermission('%s')") 效果一致 + * 避免所有接口都添加一遍 减轻工作量 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2021-08-30 23:08 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public class SecurityMethodSource extends PrePostAnnotationSecurityMetadataSource { + + + private static String EXPRESSION_FORMAT = "@%s.checkPermission('%s')"; + + private final PrePostInvocationAttributeFactory attributeFactory; + + private String beanName; + + + public SecurityMethodSource(PrePostInvocationAttributeFactory attributeFactory, String beanName) { + super(attributeFactory); + this.attributeFactory = attributeFactory; + this.beanName = beanName; + } + + + @Override + public Collection getAttributes(Method method, Class targetClass) { + //如果不存在SaAuth采用security认证模式 + SaAuth saAuth = method.getAnnotation(SaAuth.class); + if (saAuth == null) { + return super.getAttributes(method, targetClass); + } + + //存在添加以URL为权限字符串的校验模式 + ArrayList configAttributes = new ArrayList(1); + String classFullName = targetClass.getName(); + String methodName = method.getName(); + String[] classNameArray = StringUtils.split(classFullName, "\\."); + String controllerName = classNameArray[classNameArray.length - 1]; + String privilegeName = controllerName + "." + methodName; + String preAuthorizeAttribute = String.format(EXPRESSION_FORMAT, beanName, privilegeName); + PreInvocationAttribute pre = this.attributeFactory.createPreInvocationAttribute(null, null, preAuthorizeAttribute); + if (pre != null) { + configAttributes.add(pre); + } + return configAttributes; + } + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/security/SecurityPermissionCheckService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/security/SecurityPermissionCheckService.java new file mode 100644 index 00000000..29e46559 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/security/SecurityPermissionCheckService.java @@ -0,0 +1,74 @@ +package net.lab1024.sa.common.common.security; + +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.authority.SimpleGrantedAuthority; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.security.core.userdetails.UserDetails; + +import java.util.Arrays; +import java.util.Optional; +import java.util.Set; +import java.util.stream.Collectors; + +/** + * 校验权限 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022/5/12 21:50 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public abstract class SecurityPermissionCheckService { + + + /** + * 校验是否有权限 + * + * @param permission + * @return + */ + public boolean checkPermission(String permission) { + Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); + if (authentication == null) { + return false; + } + return checkPermission(authentication, permission); + } + + /** + * 校验是否有权限 + * + * @param authentication + * @param permission + * @return + */ + public abstract boolean checkPermission(Authentication authentication, String permission); + + /** + * 判断 + * + * @param userDetails + * @param permissionStr + * @return + */ + protected boolean permissionJudge(UserDetails userDetails, String permissionStr) { + if (CollectionUtils.isEmpty(userDetails.getAuthorities())) { + return false; + } + + if (StringUtils.isBlank(permissionStr)) { + return false; + } + + String[] permissionArray = permissionStr.split(","); + for (String permission : permissionArray) { + if(userDetails.getAuthorities().contains(new SimpleGrantedAuthority(permission))){ + return true; + } + } + return false; + } +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/security/SecurityTokenFilter.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/security/SecurityTokenFilter.java new file mode 100644 index 00000000..1a2ef97e --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/security/SecurityTokenFilter.java @@ -0,0 +1,64 @@ +package net.lab1024.sa.common.common.security; + +import lombok.extern.slf4j.Slf4j; +import net.lab1024.sa.common.common.constant.RequestHeaderConst; +import net.lab1024.sa.common.common.domain.RequestUser; +import net.lab1024.sa.common.common.util.SmartRequestUtil; +import org.apache.commons.lang3.StringUtils; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.security.core.userdetails.UserDetails; +import org.springframework.security.web.authentication.WebAuthenticationDetailsSource; +import org.springframework.web.filter.OncePerRequestFilter; + +import javax.servlet.FilterChain; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.function.BiFunction; +import java.util.function.Function; + +/** + * 注意此处不能 加入@Component,否则对应ignoreUrl的相关请求 将会进入此Filter,并会覆盖CorsFilter + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022/5/12 21:50 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Slf4j +public class SecurityTokenFilter extends OncePerRequestFilter { + + private BiFunction userFunction; + + public SecurityTokenFilter(BiFunction userFunction) { + this.userFunction = userFunction; + } + + @Override + protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) + throws ServletException, IOException { + //需要做token校验, 消息头的token优先于请求query参数的token + String xHeaderToken = request.getHeader(RequestHeaderConst.TOKEN); + String xRequestToken = request.getParameter(RequestHeaderConst.TOKEN); + String xAccessToken = null != xHeaderToken ? xHeaderToken : xRequestToken; + if (StringUtils.isBlank(xAccessToken)) { + chain.doFilter(request, response); + return; + } + //清理spring security + SecurityContextHolder.clearContext(); + + UserDetails loginUserDetail = userFunction.apply(xAccessToken,request); + if (null != loginUserDetail) { + UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(loginUserDetail, null, loginUserDetail.getAuthorities()); + authenticationToken.setDetails(new WebAuthenticationDetailsSource().buildDetails(request)); + SecurityContextHolder.getContext().setAuthentication(authenticationToken); + SmartRequestUtil.setRequestUser((RequestUser) loginUserDetail); + } + // 若未给予spring security上下文用户授权 则会授权失败 进入AuthenticationEntryPointImpl + chain.doFilter(request, response); + } +} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/anno/ApiModelPropertyEnum.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/swagger/ApiModelPropertyEnum.java similarity index 59% rename from smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/anno/ApiModelPropertyEnum.java rename to smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/swagger/ApiModelPropertyEnum.java index c9babff3..c306f00b 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/anno/ApiModelPropertyEnum.java +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/swagger/ApiModelPropertyEnum.java @@ -1,6 +1,6 @@ -package net.lab1024.smartadmin.common.anno; +package net.lab1024.sa.common.common.swagger; -import net.lab1024.smartadmin.common.domain.BaseEnum; +import net.lab1024.sa.common.common.enumeration.BaseEnum; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; @@ -8,10 +8,13 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** - * 枚举类字段属性的注解 + * 枚举类字段属性的 自定义 swagger 注解 * - * @author listen - * @date 2019/05/16 15:18 + * @Author 1024创新实验室: 胡克 + * @Date 2019/05/16 23:18 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) */ @Target({ElementType.FIELD}) @Retention(RetentionPolicy.RUNTIME) @@ -26,22 +29,12 @@ public @interface ApiModelPropertyEnum { String example() default ""; - /** - * 是否隐藏 - * - * @return - */ boolean hidden() default false; - /** - * 是否必须 - * - * @return - */ boolean required() default true; String dataType() default ""; - String enumDesc() default ""; + String desc() default ""; } diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/swagger/Swagger2MapperImplExtension.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/swagger/Swagger2MapperImplExtension.java new file mode 100644 index 00000000..6de869d9 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/swagger/Swagger2MapperImplExtension.java @@ -0,0 +1,91 @@ +package net.lab1024.sa.common.common.swagger; + +import com.google.common.collect.LinkedListMultimap; +import com.google.common.collect.Multimap; +import io.swagger.models.Operation; +import io.swagger.models.Path; +import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; +import org.springframework.context.annotation.Primary; +import org.springframework.stereotype.Component; +import springfox.documentation.service.ApiDescription; +import springfox.documentation.service.ApiListing; +import springfox.documentation.swagger2.mappers.ModelMapper; +import springfox.documentation.swagger2.mappers.ServiceModelToSwagger2MapperImpl; + +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.util.*; + +import static springfox.documentation.builders.BuilderDefaults.nullToEmptyList; + +/** + * 修改 api 顺序 + * + * @Author 1024创新实验室: 胡克 + * @Date 2021/8/11 22:05 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@ConditionalOnBean(ModelMapper.class) +@Component +@Primary +public class Swagger2MapperImplExtension extends ServiceModelToSwagger2MapperImpl { + + @Override + protected Map mapApiListings(Multimap apiListings) { + Map paths = new LinkedHashMap<>(); + Multimap apiListingMap = LinkedListMultimap.create(); + Iterator iter = apiListings.entries().iterator(); + while (iter.hasNext()) { + Map.Entry entry = (Map.Entry) iter.next(); + ApiListing apis = entry.getValue(); + List apiList = apis.getApis(); + apiList.sort((left, right) -> { + int position1 = left.getOperations().get(0).getPosition(); + int position2 = right.getOperations().get(0).getPosition(); + if (position1 == position2) { + return String.CASE_INSENSITIVE_ORDER.compare(left.getPath(), right.getPath()); + } + return Integer.compare(position1, position2); + }); + try { + // 因ApiListing的属性都是final故需要通过反射来修改值 + modify(apis, "apis", apiList); + } catch (Exception e) { + e.printStackTrace(); + } + apiListingMap.put(entry.getKey(), apis); + } + + for (ApiListing each : apiListingMap.values()) { + for (ApiDescription api : each.getApis()) { + paths.put(api.getPath(), mapOperations(api, Optional.ofNullable(paths.get(api.getPath())))); + } + } + return paths; + } + + private Path mapOperations(ApiDescription api, Optional existingPath) { + Path path = existingPath.orElse(new Path()); + for (springfox.documentation.service.Operation each : nullToEmptyList(api.getOperations())) { + Operation operation = mapOperation(each); + path.set(each.getMethod().toString().toLowerCase(), operation); + } + return path; + } + + public static void modify(Object object, String fieldName, Object newFieldValue) throws Exception { + Field field = object.getClass().getDeclaredField(fieldName); + + Field modifiersField = Field.class.getDeclaredField("modifiers"); + modifiersField.setAccessible(true); + modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL); + + if (!field.isAccessible()) { + field.setAccessible(true); + } + + field.set(object, newFieldValue); + } +} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/swagger/SmartSwaggerApiModelEnumPlugin.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/swagger/SwaggerApiModelPropertyEnumPlugin.java similarity index 51% rename from smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/swagger/SmartSwaggerApiModelEnumPlugin.java rename to smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/swagger/SwaggerApiModelPropertyEnumPlugin.java index dbc2d586..ce126155 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/swagger/SmartSwaggerApiModelEnumPlugin.java +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/swagger/SwaggerApiModelPropertyEnumPlugin.java @@ -1,30 +1,12 @@ -/* - * - * Copyright 2015 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 - * - * http://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. - * - * - */ +package net.lab1024.sa.common.common.swagger; -package net.lab1024.smartadmin.common.swagger; - -import net.lab1024.smartadmin.common.anno.ApiModelPropertyEnum; -import net.lab1024.smartadmin.common.domain.BaseEnum; import com.google.common.base.Function; import com.google.common.base.Optional; +import net.lab1024.sa.common.common.enumeration.BaseEnum; import org.apache.commons.lang3.StringUtils; import org.springframework.core.annotation.AnnotationUtils; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; import springfox.documentation.spi.DocumentationType; import springfox.documentation.spi.schema.ModelPropertyBuilderPlugin; import springfox.documentation.spi.schema.contexts.ModelPropertyContext; @@ -36,31 +18,36 @@ import static springfox.documentation.schema.Annotations.findPropertyAnnotation; /** * swagger 用于说明枚举类字段说明 - * SWAGGER_PLUGIN_ORDER+1 是将此配置放在原来的后面执行 + * * SWAGGER_PLUGIN_ORDER+1 是将此配置放在原来的后面执行 * - * @author listen - * @date 2019年5月16日 15:36:56 + * @Author 1024创新实验室: 胡克 + * @Date 2019/8/11 15:36:56 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) */ -public class SmartSwaggerApiModelEnumPlugin implements ModelPropertyBuilderPlugin { +@Component +@Order(SwaggerPluginSupport.SWAGGER_PLUGIN_ORDER + 1) +public class SwaggerApiModelPropertyEnumPlugin implements ModelPropertyBuilderPlugin { @Override public void apply(ModelPropertyContext context) { - Optional enumOptional = Optional.absent(); + Optional annotation = Optional.absent(); if (context.getAnnotatedElement().isPresent()) { - enumOptional = enumOptional.or(findApiModePropertyAnnotation(context.getAnnotatedElement().get())); + annotation = annotation.or(findApiModePropertyAnnotation(context.getAnnotatedElement().get())); } if (context.getBeanPropertyDefinition().isPresent()) { - enumOptional = enumOptional.or(findPropertyAnnotation(context.getBeanPropertyDefinition().get(), ApiModelPropertyEnum.class)); + annotation = annotation.or(findPropertyAnnotation(context.getBeanPropertyDefinition().get(), ApiModelPropertyEnum.class)); } - if (enumOptional.isPresent()) { - ApiModelPropertyEnum anEnum = enumOptional.get(); + if (annotation.isPresent()) { + ApiModelPropertyEnum anEnum = annotation.get(); String enumInfo = BaseEnum.getInfo(anEnum.value()); context.getBuilder() - .required(enumOptional.transform(toIsRequired()).or(false)) - .description(anEnum.enumDesc() + ":" + enumInfo) - .example(enumOptional.transform(toExample()).orNull()) + .required(annotation.transform(toIsRequired()).or(false)) + .description(anEnum.desc() + ":" + enumInfo) + .example(annotation.transform(toExample()).orNull()) .isHidden(anEnum.hidden()); } } diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartBeanUtil.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/util/SmartBeanUtil.java similarity index 52% rename from smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartBeanUtil.java rename to smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/util/SmartBeanUtil.java index 6d36c05b..ec36b2b2 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartBeanUtil.java +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/util/SmartBeanUtil.java @@ -1,13 +1,31 @@ -package net.lab1024.smartadmin.util; +package net.lab1024.sa.common.common.util; import org.springframework.beans.BeanUtils; +import javax.validation.ConstraintViolation; +import javax.validation.Validation; +import javax.validation.Validator; import java.util.Collections; import java.util.List; +import java.util.Set; import java.util.stream.Collectors; +/** + * bean相关工具类 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2018-01-15 10:48:23 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ public class SmartBeanUtil { + /** + * 验证器 + */ + private static final Validator VALIDATOR = Validation.buildDefaultValidatorFactory().getValidator(); + /** * 复制bean的属性 * @@ -27,7 +45,7 @@ public class SmartBeanUtil { * @return */ public static T copy(Object source, Class target) { - if(source == null || target == null){ + if (source == null || target == null) { return null; } try { @@ -49,11 +67,28 @@ public class SmartBeanUtil { * @return */ public static List copyList(List source, Class target) { - if (null == source || source.isEmpty()) { return Collections.emptyList(); } return source.stream().map(e -> copy(e, target)).collect(Collectors.toList()); } + /** + * 手动验证对象 Model的属性 + * 需要配合 hibernate-validator 校验注解 + * + * @param t + * @return String 返回null代表验证通过,否则返回错误的信息 + */ + public static String verify(T t) { + // 获取验证结果 + Set> validate = VALIDATOR.validate(t); + if (validate.isEmpty()) { + // 验证通过 + return null; + } + // 返回错误信息 + List messageList = validate.stream().map(ConstraintViolation::getMessage).collect(Collectors.toList()); + return messageList.toString(); + } } diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartBigDecimalUtil.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/util/SmartBigDecimalUtil.java similarity index 55% rename from smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartBigDecimalUtil.java rename to smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/util/SmartBigDecimalUtil.java index 651f3d4e..a1ff2da6 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartBigDecimalUtil.java +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/util/SmartBigDecimalUtil.java @@ -1,31 +1,25 @@ -package net.lab1024.smartadmin.util; +package net.lab1024.sa.common.common.util; import java.math.BigDecimal; import java.math.RoundingMode; -import java.text.NumberFormat; /** - * 全局 BigDecimal 工具类 + * BigDecimal 工具类 * - * @author listen - * @date 2018/01/17 13:54 + * @Author 1024创新实验室: 胡克 + * @Date 2018/01/17 13:54 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) */ public class SmartBigDecimalUtil { /** - * 价格类型 保留小数点 2 + * 金额 保留小数点 2 */ - public static final int PRICE_DECIMAL_POINT = 2; + public static final int AMOUNT_DECIMAL_POINT = 2; - /** - * 价格类型 保留小数点 6 - */ - public static final int SIX_PRICE_DECIMAL_POINT = 6; - - /** - * 重量类型保留小数点 3 - */ - public static final int WEIGHT_DECIMAL_POINT = 3; + public static final BigDecimal ONE_HUNDRED = new BigDecimal("100"); /** * 金额相关计算方法:四舍五入 保留2位小数点 @@ -33,65 +27,22 @@ public class SmartBigDecimalUtil { public static class Amount { public static BigDecimal add(BigDecimal num1, BigDecimal num2) { - return setScale(num1.add(num2), PRICE_DECIMAL_POINT); + return setScale(num1.add(num2), AMOUNT_DECIMAL_POINT); } public static BigDecimal multiply(BigDecimal num1, BigDecimal num2) { - return setScale(num1.multiply(num2), PRICE_DECIMAL_POINT); + return setScale(num1.multiply(num2), AMOUNT_DECIMAL_POINT); } public static BigDecimal subtract(BigDecimal num1, BigDecimal num2) { - return setScale(num1.subtract(num2), PRICE_DECIMAL_POINT); + return setScale(num1.subtract(num2), AMOUNT_DECIMAL_POINT); } public static BigDecimal divide(BigDecimal num1, BigDecimal num2) { - return setScale(num1.divide(num2, RoundingMode.HALF_UP), PRICE_DECIMAL_POINT); + return setScale(num1.divide(num2, RoundingMode.HALF_UP), AMOUNT_DECIMAL_POINT); } } - /** - * 金额相关计算方法:四舍五入 保留2位小数点 - */ - public static class AmountSix { - - public static BigDecimal add(BigDecimal num1, BigDecimal num2) { - return setScale(num1.add(num2), SIX_PRICE_DECIMAL_POINT); - } - - public static BigDecimal multiply(BigDecimal num1, BigDecimal num2) { - return setScale(num1.multiply(num2), SIX_PRICE_DECIMAL_POINT); - } - - public static BigDecimal subtract(BigDecimal num1, BigDecimal num2) { - return setScale(num1.subtract(num2), SIX_PRICE_DECIMAL_POINT); - } - - public static BigDecimal divide(BigDecimal num1, BigDecimal num2) { - return num1.divide(num2, PRICE_DECIMAL_POINT, RoundingMode.HALF_UP); - } - } - - /** - * 重量相关计算方法:四舍五入 保留3位小数点 - */ - public static class Weight { - - public static BigDecimal add(BigDecimal num1, BigDecimal num2) { - return setScale(num1.add(num2), WEIGHT_DECIMAL_POINT); - } - - public static BigDecimal multiply(BigDecimal num1, BigDecimal num2) { - return setScale(num1.multiply(num2), WEIGHT_DECIMAL_POINT); - } - - public static BigDecimal subtract(BigDecimal num1, BigDecimal num2) { - return setScale(num1.subtract(num2), WEIGHT_DECIMAL_POINT); - } - - public static BigDecimal divide(BigDecimal num1, BigDecimal num2) { - return num1.divide(num2, WEIGHT_DECIMAL_POINT, RoundingMode.HALF_UP); - } - } /** * BigDecimal 加法 num1 + num2 @@ -106,6 +57,25 @@ public class SmartBigDecimalUtil { return setScale(num1.add(num2), point); } + /** + * 累加 + * + * @param point + * @param array + * @return + */ + public static BigDecimal add(int point, BigDecimal... array) { + BigDecimal res = new BigDecimal(0); + for (BigDecimal item : array) { + if (item == null) { + res = res.add(BigDecimal.ZERO); + } else { + res = res.add(item); + } + } + return setScale(res, point); + } + /** * BigDecimal 乘法 num1 x num2 * 未做非空校验 @@ -164,7 +134,7 @@ public class SmartBigDecimalUtil { * @return boolean */ public static boolean isGreaterThan(BigDecimal num1, BigDecimal num2) { - return num1.compareTo(num2) == 1; + return num1.compareTo(num2) > 0; } /** @@ -186,7 +156,7 @@ public class SmartBigDecimalUtil { * @return boolean */ public static boolean isLessThan(BigDecimal num1, BigDecimal num2) { - return num1.compareTo(num2) == -1; + return num1.compareTo(num2) < 0; } /** @@ -211,20 +181,6 @@ public class SmartBigDecimalUtil { return num1.compareTo(num2) == 0; } - /** - * 计算 num1 / num2 的百分比 - * - * @param num1 - * @param num2 - * @return String - */ - public static String getPercentage(BigDecimal num1, BigDecimal num2) { - BigDecimal result = num1.divide(num2, 4, RoundingMode.HALF_UP); - NumberFormat percent = NumberFormat.getPercentInstance(); - percent.setMaximumFractionDigits(2); - return percent.format(result.doubleValue()); - } - /** * 计算 num1 / num2 的百分比 * @@ -233,16 +189,14 @@ public class SmartBigDecimalUtil { * @param point 保留几位小数 * @return String */ - public static BigDecimal bigDecimalPercent(Integer num1, Integer num2, int point) { + public static BigDecimal percent(Integer num1, Integer num2, int point) { if (num1 == null || num2 == null) { return BigDecimal.ZERO; } if (num2.equals(0)) { return BigDecimal.ZERO; } - BigDecimal bigDecimalNum1 = new BigDecimal(num1); - BigDecimal bigDecimalNum2 = new BigDecimal(num2); - return bigDecimalPercent(bigDecimalNum1, bigDecimalNum2, point); + return percent(new BigDecimal(num1), new BigDecimal(num2), point); } /** @@ -253,7 +207,7 @@ public class SmartBigDecimalUtil { * @param point 保留几位小数 * @return String */ - public static BigDecimal bigDecimalPercent(BigDecimal num1, BigDecimal num2, int point) { + public static BigDecimal percent(BigDecimal num1, BigDecimal num2, int point) { if (num1 == null || num2 == null) { return BigDecimal.ZERO; } @@ -261,52 +215,7 @@ public class SmartBigDecimalUtil { return BigDecimal.ZERO; } BigDecimal percent = num1.divide(num2, point + 2, RoundingMode.HALF_UP); - BigDecimal percent100 = percent.multiply(new BigDecimal(100)).setScale(point); - return percent100; - } - - /** - * 判断num是否为空 或者 零 - * - * @param num - * @return String - */ - public static Boolean isEmpty(BigDecimal num) { - return null == num || equals(BigDecimal.ZERO, num); - } - - /** - * 判断num是否 不等于null 并且不等于零 - * - * @param num - * @return String - */ - public static Boolean isNotEmpty(BigDecimal num) { - return !isEmpty(num); - } - - /** - * 转换为万 - * - * @param num - * @param point - * @return - */ - public static BigDecimal convertTenThousand(BigDecimal num, int point) { - return num.divide(new BigDecimal(10000), point, RoundingMode.HALF_UP); - } - - /** - * 转换为负数 - * - * @param num - * @return - */ - public static BigDecimal convertToMinusNumber(BigDecimal num) { - if (isLessOrEqual(num, BigDecimal.ZERO)) { - return num; - } - return BigDecimal.ZERO.subtract(num); + return percent.multiply(ONE_HUNDRED).setScale(point); } /** @@ -330,4 +239,9 @@ public class SmartBigDecimalUtil { public static BigDecimal min(BigDecimal num1, BigDecimal num2) { return num1.compareTo(num2) < 0 ? num1 : num2; } + + public static void main(String[] args) { + System.out.println(percent(new BigDecimal("3"), new BigDecimal("11"), 2)); + System.out.println(percent(new BigDecimal("8"), new BigDecimal("11"), 2)); + } } diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartEasyPoiExcelUtil.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/util/SmartEasyPoiExcelUtil.java similarity index 77% rename from smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartEasyPoiExcelUtil.java rename to smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/util/SmartEasyPoiExcelUtil.java index fb3860a6..40994422 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartEasyPoiExcelUtil.java +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/util/SmartEasyPoiExcelUtil.java @@ -1,10 +1,11 @@ -package net.lab1024.smartadmin.util; +package net.lab1024.sa.common.common.util; import cn.afterturn.easypoi.excel.ExcelExportUtil; import cn.afterturn.easypoi.excel.ExcelImportUtil; import cn.afterturn.easypoi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.ImportParams; import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.apache.poi.ss.usermodel.Workbook; import org.springframework.web.multipart.MultipartFile; @@ -12,16 +13,22 @@ import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; import java.io.File; import java.io.IOException; +import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.util.List; import java.util.Map; import java.util.NoSuchElementException; /** - * @author: zhuoda - * @create: 2020-03-30 14:27 PM from win10 + * excel 工具类 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2018/01/17 13:54 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) */ - +@Slf4j public class SmartEasyPoiExcelUtil { public static void exportExcel(List list, String title, String sheetName, Class pojoClass, String fileName, boolean isCreateHeader, HttpServletResponse response) throws IOException { @@ -42,21 +49,30 @@ public class SmartEasyPoiExcelUtil { private static void defaultExport(List list, Class pojoClass, String fileName, HttpServletResponse response, ExportParams exportParams) throws IOException { Workbook workbook = ExcelExportUtil.exportExcel(exportParams, pojoClass, list); - if (workbook != null) ; - downLoadExcel(fileName, response, workbook); + downloadExcel(fileName, workbook, response); } - private static void downLoadExcel(String fileName, HttpServletResponse response, Workbook workbook) throws IOException { - response.setHeader("content-Type", "application/vnd.ms-excel"); - response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8")); - response.setCharacterEncoding("UTF-8"); + + public static void downloadExcel(String fileName, Workbook workbook, HttpServletResponse response) { + try { + fileName = URLEncoder.encode(fileName, "UTF-8"); + } catch (UnsupportedEncodingException e) { + log.error("", e); + } + response.setCharacterEncoding("utf-8"); + response.setHeader("Content-Type", "application/vnd.ms-excel"); + response.setHeader("Content-Disposition", "attachment;filename=" + fileName + ".xls"); + try { workbook.write(response.getOutputStream()); + workbook.close(); + } catch (IOException e) { + log.error("", e); + } } private static void defaultExport(List> list, String fileName, HttpServletResponse response) throws IOException { Workbook workbook = ExcelExportUtil.exportExcel(list, ExcelType.HSSF); - if (workbook != null) ; - downLoadExcel(fileName, response, workbook); + downloadExcel(fileName, workbook, response); } public static List importExcel(String filePath, Integer titleRows, Integer headerRows, Class pojoClass) { @@ -73,7 +89,6 @@ public class SmartEasyPoiExcelUtil { //throw new NormalException("模板不能为空"); } catch (Exception e) { e.printStackTrace(); - //throw new NormalException(e.getMessage()); } return list; } diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/util/SmartEnumUtil.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/util/SmartEnumUtil.java new file mode 100644 index 00000000..40c34a95 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/util/SmartEnumUtil.java @@ -0,0 +1,165 @@ +package net.lab1024.sa.common.common.util; + +import net.lab1024.sa.common.common.enumeration.BaseEnum; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; + +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Objects; +import java.util.function.BiConsumer; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * 枚举工具类 + * + * @Author 1024创新实验室: 胡克 + * @Date 2017/10/10 18:17 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public class SmartEnumUtil { + + /** + * 校验参数与枚举类比较是否合法 + * + * @param value 参数 + * @param enumClass 枚举类必须实现BaseEnum接口 + * @return boolean + * @Author 胡克 + */ + public static boolean checkEnum(Object value, Class enumClass) { + if (null == value) { + return false; + } + return Stream.of(enumClass.getEnumConstants()).anyMatch(e -> e.equalsValue(value)); + } + + /** + * 创建一个具有唯一array值的数组,每个值不包含在其他给定的数组中。 + * + * @param enumClass + * @param exclude + * @param + * @return + */ + public static List differenceValueList(Class enumClass, T... exclude) { + HashSet valueSet = new HashSet<>(); + if (exclude != null) { + valueSet.addAll(Stream.of(exclude).map(BaseEnum::getValue).collect(Collectors.toSet())); + } + + return Stream.of(enumClass.getEnumConstants()) + .filter(e -> !valueSet.contains(e.getValue())) + .map(BaseEnum::getValue) + .collect(Collectors.toList()); + } + + /** + * 获取枚举类的说明 value : info 的形式 + * + * @param enumClass + * @return String + */ + public static String getEnumDesc(Class enumClass) { + BaseEnum[] enums = enumClass.getEnumConstants(); + // value : info 的形式 + StringBuilder sb = new StringBuilder(); + for (BaseEnum baseEnum : enums) { + sb.append(baseEnum.getValue()).append(":").append(baseEnum.getDesc()).append(","); + } + return sb.toString(); + } + + /** + * 获取与参数相匹配的枚举类实例的 说明 + * + * @param value 参数 + * @param enumClass 枚举类必须实现BaseEnum接口 + * @return String 如无匹配枚举则返回null + */ + public static String getEnumDescByValue(Object value, Class enumClass) { + if (null == value) { + return null; + } + return Stream.of(enumClass.getEnumConstants()) + .filter(e -> e.equalsValue(value)) + .findFirst() + .map(BaseEnum::getDesc) + .orElse(null); + } + + public static String getEnumDescByValueList(Collection values, Class enumClass) { + if (CollectionUtils.isEmpty(values)) { + return ""; + } + return Stream.of(enumClass.getEnumConstants()).filter(e -> values.contains(e.getValue())).map(BaseEnum::getDesc).collect(Collectors.joining(",")); + } + + /** + * 根据参数获取枚举类的实例 + * + * @param value 参数 + * @param enumClass 枚举类必须实现BaseEnum接口 + * @return BaseEnum 无匹配值返回null + * @Author 胡克 + */ + public static T getEnumByValue(Object value, Class enumClass) { + if (null == value) { + return null; + } + return Stream.of(enumClass.getEnumConstants()) + .filter(e -> e.equalsValue(value)) + .findFirst() + .orElse(null); + } + + /** + * 根据实例描述与获取枚举类的实例 + * + * @param desc 参数描述 + * @param enumClass 枚举类必须实现BaseEnum接口 + * @return BaseEnum 无匹配值返回null + * @Author 胡克 + */ + public static T getEnumByDesc(String desc, Class enumClass) { + return Stream.of(enumClass.getEnumConstants()) + .filter(e -> Objects.equals(e.getDesc(), desc)) + .findFirst() + .orElse(null); + } + + + public static T getEnumByName(String name, Class enumClass) { + return Stream.of(enumClass.getEnumConstants()) + .filter(e -> StringUtils.equalsIgnoreCase(e.toString(), name)) + .findFirst() + .orElse(null); + } + + + /** + * 根据lambda getter/setter 注入 + * + * @param list + * @param getter + * @param setter + * @param enumClass + * @param + */ + public static void inject(List list, Function getter, BiConsumer setter, Class enumClass) { + if (list == null || list.isEmpty()) { + return; + } + for (T t : list) { + Integer enumValue = getter.apply(t); + if (enumValue != null) { + setter.accept(t, getEnumDescByValue(enumValue, enumClass)); + } + } + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/util/SmartPageUtil.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/util/SmartPageUtil.java new file mode 100644 index 00000000..63ac5d7b --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/util/SmartPageUtil.java @@ -0,0 +1,111 @@ +package net.lab1024.sa.common.common.util; + +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.google.common.collect.Lists; +import net.lab1024.sa.common.common.domain.PageParam; +import net.lab1024.sa.common.common.domain.PageResult; +import org.apache.commons.collections4.CollectionUtils; + +import java.util.List; +import java.util.stream.Collectors; + +/** + * 分页工具类 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2020-04-23 20:51:40 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public class SmartPageUtil { + + /** + * 转换为查询参数 + * + * @param baseDTO + * @return + */ + public static Page convert2PageQuery(PageParam baseDTO) { + Page page = new Page<>(baseDTO.getPageNum(), baseDTO.getPageSize()); + // 设置排序字段 + List sortItemList = baseDTO.getSortItemList(); + if (CollectionUtils.isNotEmpty(sortItemList)) { + List orderItemList = sortItemList.stream().map(e -> new OrderItem(e.getColumn(), e.getIsAsc())).collect(Collectors.toList()); + page.setOrders(orderItemList); + } + return page; + } + + /** + * 转换为 PageResultDTO 对象 + * + * @param page + * @param sourceList 原list + * @param targetClazz 目标类 + * @return + */ + public static PageResult convert2PageResult(Page page, List sourceList, Class targetClazz) { + return convert2PageResult(page, SmartBeanUtil.copyList(sourceList, targetClazz)); + } + + /** + * 转换为 PageResultDTO 对象 + * + * @param page + * @param sourceList list + * @return + */ + public static PageResult convert2PageResult(Page page, List sourceList) { + PageResult pageResult = new PageResult<>(); + pageResult.setPageNum(page.getCurrent()); + pageResult.setPageSize(page.getSize()); + pageResult.setTotal(page.getTotal()); + pageResult.setPages(page.getPages()); + pageResult.setList(sourceList); + pageResult.setEmptyFlag(CollectionUtils.isEmpty(sourceList)); + return pageResult; + } + + /** + * 转换分页结果对象 + * + * @param pageResult + * @param targetClazz + * @return + */ + public static PageResult convert2PageResult(PageResult pageResult, Class targetClazz) { + PageResult newPageResult = new PageResult<>(); + newPageResult.setPageNum(pageResult.getPageNum()); + newPageResult.setPageSize(pageResult.getPageSize()); + newPageResult.setTotal(pageResult.getTotal()); + newPageResult.setPages(pageResult.getPages()); + newPageResult.setEmptyFlag(pageResult.getEmptyFlag()); + newPageResult.setList(SmartBeanUtil.copyList(pageResult.getList(), targetClazz)); + return newPageResult; + } + + public static PageResult subListPage(Integer pageNum, Integer pageSize, List list) { + PageResult pageRet = new PageResult(); + //总条数 + int count = list.size(); + int pages = count % pageSize == 0 ? count / pageSize : (count / pageSize + 1); + int fromIndex = (pageNum - 1) * pageSize; + int toIndex = pageNum * pageSize > count ? count : pageNum * pageSize; + + if (pageNum > pages) { + pageRet.setList(Lists.newLinkedList()); + pageRet.setPageNum(pageNum.longValue()); + pageRet.setPages(Long.valueOf(pages)); + pageRet.setTotal(Long.valueOf(count)); + return pageRet; + } + List pageList = list.subList(fromIndex, toIndex); + pageRet.setList(pageList); + pageRet.setPageNum(pageNum.longValue()); + pageRet.setPages(Long.valueOf(pages)); + pageRet.setTotal(Long.valueOf(count)); + return pageRet; + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/util/SmartRequestUtil.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/util/SmartRequestUtil.java new file mode 100644 index 00000000..40210ba2 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/util/SmartRequestUtil.java @@ -0,0 +1,38 @@ +package net.lab1024.sa.common.common.util; + +import lombok.extern.slf4j.Slf4j; +import net.lab1024.sa.common.common.domain.RequestUser; + +/** + * 请求用户 工具类 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022-05-30 21:22:12 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Slf4j +public class SmartRequestUtil { + + private static final ThreadLocal requestThreadLocal = new ThreadLocal<>(); + + public static void setRequestUser(RequestUser requestUser) { + requestThreadLocal.set(requestUser); + } + + public static RequestUser getRequestUser() { + return requestThreadLocal.get(); + } + + public static Long getRequestUserId() { + RequestUser requestUser = getRequestUser(); + return null == requestUser ? null : requestUser.getUserId(); + } + + public static void remove() { + requestThreadLocal.remove(); + } + + +} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartStringUtil.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/util/SmartStringUtil.java similarity index 73% rename from smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartStringUtil.java rename to smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/util/SmartStringUtil.java index da2e1764..230863a0 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartStringUtil.java +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/util/SmartStringUtil.java @@ -1,6 +1,7 @@ -package net.lab1024.smartadmin.util; +package net.lab1024.sa.common.common.util; -import org.apache.commons.lang3.StringUtils; + +import cn.hutool.core.util.StrUtil; import java.util.ArrayList; import java.util.HashSet; @@ -8,11 +9,15 @@ import java.util.List; import java.util.Set; /** - * 字符串操作类,包括分割,转换,大写首字母 + * 独有的字符串工具类 * - * @author jiaozi + * @Author 1024创新实验室-主任: 卓大 + * @Date 2021-09-02 20:21:10 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) */ -public class SmartStringUtil extends StringUtils { +public class SmartStringUtil extends StrUtil { // ===============split ======================= @@ -42,7 +47,7 @@ public class SmartStringUtil extends StringUtils { // ===============split Integer======================= - public static List splitConverToIntList(String str, String split, int defaultVal) { + public static List splitConvertToIntList(String str, String split, int defaultVal) { if (isEmpty(str)) { return new ArrayList(); } @@ -60,7 +65,7 @@ public class SmartStringUtil extends StringUtils { return list; } - public static Set splitConverToIntSet(String str, String split, int defaultVal) { + public static Set splitConvertToIntSet(String str, String split, int defaultVal) { if (isEmpty(str)) { return new HashSet(); } @@ -78,12 +83,12 @@ public class SmartStringUtil extends StringUtils { return set; } - public static Set splitConverToIntSet(String str, String split) { - return splitConverToIntSet(str, split, 0); + public static Set splitConvertToIntSet(String str, String split) { + return splitConvertToIntSet(str, split, 0); } - public static List splitConverToIntList(String str, String split) { - return splitConverToIntList(str, split, 0); + public static List splitConvertToIntList(String str, String split) { + return splitConvertToIntList(str, split, 0); } public static int[] splitConvertToIntArray(String str, String split, int defaultVal) { @@ -109,7 +114,7 @@ public class SmartStringUtil extends StringUtils { // ===============split 2 Long======================= - public static List splitConverToLongList(String str, String split, long defaultVal) { + public static List splitConvertToLongList(String str, String split, long defaultVal) { if (isEmpty(str)) { return new ArrayList(); } @@ -127,8 +132,8 @@ public class SmartStringUtil extends StringUtils { return list; } - public static List splitConverToLongList(String str, String split) { - return splitConverToLongList(str, split, 0L); + public static List splitConvertToLongList(String str, String split) { + return splitConvertToLongList(str, split, 0L); } public static long[] splitConvertToLongArray(String str, String split, long defaultVal) { @@ -154,7 +159,7 @@ public class SmartStringUtil extends StringUtils { // ===============split convert byte======================= - public static List splitConverToByteList(String str, String split, byte defaultVal) { + public static List splitConvertToByteList(String str, String split, byte defaultVal) { if (isEmpty(str)) { return new ArrayList(); } @@ -172,8 +177,8 @@ public class SmartStringUtil extends StringUtils { return list; } - public static List splitConverToByteList(String str, String split) { - return splitConverToByteList(str, split, (byte) 0); + public static List splitConvertToByteList(String str, String split) { + return splitConvertToByteList(str, split, (byte) 0); } public static byte[] splitConvertToByteArray(String str, String split, byte defaultVal) { @@ -199,7 +204,7 @@ public class SmartStringUtil extends StringUtils { // ===============split convert double======================= - public static List splitConverToDoubleList(String str, String split, double defaultVal) { + public static List splitConvertToDoubleList(String str, String split, double defaultVal) { if (isEmpty(str)) { return new ArrayList(); } @@ -217,8 +222,8 @@ public class SmartStringUtil extends StringUtils { return list; } - public static List splitConverToDoubleList(String str, String split) { - return splitConverToDoubleList(str, split, 0); + public static List splitConvertToDoubleList(String str, String split) { + return splitConvertToDoubleList(str, split, 0); } public static double[] splitConvertToDoubleArray(String str, String split, double defaultVal) { @@ -242,9 +247,9 @@ public class SmartStringUtil extends StringUtils { return splitConvertToDoubleArray(str, split, 0); } - // ===============solit convert float======================= + // ===============split convert float======================= - public static List splitConverToFloatList(String str, String split, float defaultVal) { + public static List splitConvertToFloatList(String str, String split, float defaultVal) { if (isEmpty(str)) { return new ArrayList(); } @@ -262,8 +267,8 @@ public class SmartStringUtil extends StringUtils { return list; } - public static List splitConverToFloatList(String str, String split) { - return splitConverToFloatList(str, split, 0f); + public static List splitConvertToFloatList(String str, String split) { + return splitConvertToFloatList(str, split, 0f); } public static float[] splitConvertToFloatArray(String str, String split, float defaultVal) { @@ -287,25 +292,43 @@ public class SmartStringUtil extends StringUtils { return splitConvertToFloatArray(str, split, 0f); } - // ===============upperCase======================= - /** - * 将首字母大写 - * - * @param str - * @return - */ public static String upperCaseFirstChar(String str) { - if (str == null || str.isEmpty()) { + if (str != null && !str.isEmpty()) { + char firstChar = str.charAt(0); + if (Character.isUpperCase(firstChar)) { + return str; + } else { + char[] values = str.toCharArray(); + values[0] = Character.toUpperCase(firstChar); + return new String(values); + } + } else { return str; } - char firstChar = str.charAt(0); - if (Character.isUpperCase(firstChar)) { - return str; - } - char[] values = str.toCharArray(); - values[0] = Character.toUpperCase(firstChar); - return new String(values); } -} + public static String replace(String content, int begin, int end, String newStr) { + if (begin < content.length() && begin >= 0) { + if (end <= content.length() && end >= 0) { + if (begin > end) { + return content; + } else { + StringBuilder starStr = new StringBuilder(); + + for (int i = begin; i < end; ++i) { + starStr.append(newStr); + } + + return content.substring(0, begin) + starStr + content.substring(end); + } + } else { + return content; + } + } else { + return content; + } + } + + +} \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartVerificationUtil.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/util/SmartVerificationUtil.java similarity index 51% rename from smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartVerificationUtil.java rename to smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/util/SmartVerificationUtil.java index ceb349f1..5360e160 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartVerificationUtil.java +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/util/SmartVerificationUtil.java @@ -1,16 +1,18 @@ -package net.lab1024.smartadmin.util; +package net.lab1024.sa.common.common.util; import java.util.regex.Pattern; + /** * 验证工具类 * - * @author listen - * @date 2017/11/06 10:54 + * @Author 1024创新实验室: 胡克 + * @Date 2017/11/06 10:54 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) */ public class SmartVerificationUtil { - - /** * 手机号码验证规则 */ @@ -30,32 +32,33 @@ public class SmartVerificationUtil { * 车牌号 */ public static final String CAR_NUMBER = - "([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼]{1}(([A-HJ-Z]{1}[A-HJ-NP-Z0-9]{5})|([A-HJ-Z]{1}(([DF]{1}[A-HJ-NP-Z0-9]{1}[0-9]{4})|([0-9]{5}[DF]{1})))|" + "([A-HJ-Z" + "]{1}[A-D0-9]{1}[0-9]{3}警)))|" + - "([0-9]{6}使)|((([沪粤川云桂鄂陕蒙藏黑辽渝]{1}A)|鲁B|闽D|蒙E|蒙H)[0-9]{4}领)|(WJ[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼·•]{1}[0-9]{4}[TDSHBXJ0-9]{1})|" + "([VKHBSLJNGCE]{1}[A-DJ-PR" + "-TVY]{1}[0-9]{5})"; + "([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼]{1}(([A-HJ-Z]{1}[A-HJ-NP-Z0-9]{5})|([A-HJ-Z]{1}(([DF]{1}[A-HJ-NP-Z0-9]{1}[0-9]{4})|([0-9]{5}[DF]{1})))|" + "([A-HJ-Z" + "]{1}[A-D0-9]{1}[0-9]{3}警)))|" + + "([0-9]{6}使)|((([沪粤川云桂鄂陕蒙藏黑辽渝]{1}A)|鲁B|闽D|蒙E|蒙H)[0-9]{4}领)|(WJ[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼·•]{1}[0-9]{4}[TDSHBXJ0-9]{1})|" + "([VKHBSLJNGCE]{1}[A-DJ-PR" + "-TVY]{1}[0-9]{5})"; /** * 日期年月日校验 yyyy-MM-dd HH:mm:ss */ public static final String DATE_TIME = "^((([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9" + - "]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29))\\s+([0-1]?[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$"; + "]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29))\\s+([0-1]?[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$"; /** * 日期校验 yyyy-MM-dd */ public static final String DATE = "(([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))" - + "|(02-(0[1-9]|[1][0-9]|2[0-8])))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29)" + "([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9" - + "][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|(" + "(([0-9]{2})(0[48]|[2468][048]|[13579][26])|(" + "(0[48" + "]|[2468][048]|[3579][26])00))-02-29)"; + + "|(02-(0[1-9]|[1][0-9]|2[0-8])))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29)" + "([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9" + + "][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|(" + "(([0-9]{2})(0[48]|[2468][048]|[13579][26])|(" + "(0[48" + "]|[2468][048]|[3579][26])00))-02-29)"; + + public static final String DATE_TIME_HM = "^((([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29))\\s+([0-1]?[0-9]|2[0-3]):([0-5][0-9])$"; /** * 年月校验 例: 2019-10 */ public static final String YEAR_MONTH = "^\\d{4}-((0([1-9]))|(1(0|1|2)))$"; - /** * 时间区间验证 10:23-19:00 */ - public static final String TIME_SECTION= "^(0[0-9]|1[0-9]|2[0-3]):(0[0-9]|[1-5][0-9])-(0[0-9]|1[0-9]|2[0-3]):(0[0-9]|[1-5][0-9])$"; + public static final String TIME_SECTION = "^(0[0-9]|1[0-9]|2[0-3]):(0[0-9]|[1-5][0-9])-(0[0-9]|1[0-9]|2[0-3]):(0[0-9]|[1-5][0-9])$"; /** * 时间验证 10:23 diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/validator/en/CheckEnum.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/validator/enumeration/CheckEnum.java similarity index 65% rename from smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/validator/en/CheckEnum.java rename to smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/validator/enumeration/CheckEnum.java index ceef46fc..dd708b3c 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/validator/en/CheckEnum.java +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/validator/enumeration/CheckEnum.java @@ -1,7 +1,7 @@ -package net.lab1024.smartadmin.common.validator.en; +package net.lab1024.sa.common.common.validator.enumeration; -import net.lab1024.smartadmin.common.domain.BaseEnum; +import net.lab1024.sa.common.common.enumeration.BaseEnum; import javax.validation.Constraint; import javax.validation.Payload; @@ -11,11 +11,13 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** - * 自定义的属性校验注解 - * 为了方便与校验属性的值是否为合法的枚举值 + * 自定义的属性校验注解,为了方便与校验属性的值是否为合法的枚举值 * - * @author listen - * @date 2017/11/11 15:31 + * @Author 1024创新实验室: 胡克 + * @Date 2017/11/11 15:31 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) */ @Target(ElementType.FIELD) @Retention(RetentionPolicy.RUNTIME) @@ -27,14 +29,14 @@ public @interface CheckEnum { * * @return String */ - String message() default "非法的枚举值"; + String message(); /** * 枚举类对象 必须实现BaseEnum接口 * * @return */ - Class enumClazz(); + Class value(); /** * 是否必须 diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/validator/en/EnumValidator.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/validator/enumeration/EnumValidator.java similarity index 85% rename from smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/validator/en/EnumValidator.java rename to smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/validator/enumeration/EnumValidator.java index adbc1dbe..bd7ea126 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/validator/en/EnumValidator.java +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/validator/enumeration/EnumValidator.java @@ -1,6 +1,7 @@ -package net.lab1024.smartadmin.common.validator.en; +package net.lab1024.sa.common.common.validator.enumeration; -import net.lab1024.smartadmin.common.domain.BaseEnum; + +import net.lab1024.sa.common.common.enumeration.BaseEnum; import javax.validation.ConstraintValidator; import javax.validation.ConstraintValidatorContext; @@ -11,8 +12,11 @@ import java.util.stream.Stream; /** * 枚举类校验器 * - * @author listen - * @date 2017/11/11 15:34 + * @Author 1024创新实验室: 胡克 + * @Date 2017/11/11 15:34 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) */ public class EnumValidator implements ConstraintValidator { @@ -30,7 +34,7 @@ public class EnumValidator implements ConstraintValidator { public void initialize(CheckEnum constraintAnnotation) { // 获取注解传入的枚举类对象 required = constraintAnnotation.required(); - Class enumClass = constraintAnnotation.enumClazz(); + Class enumClass = constraintAnnotation.value(); enumValList = Stream.of(enumClass.getEnumConstants()).map(BaseEnum::getValue).collect(Collectors.toList()); } diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/AsyncConfig.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/AsyncConfig.java new file mode 100644 index 00000000..9d39c7cd --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/AsyncConfig.java @@ -0,0 +1,71 @@ +package net.lab1024.sa.common.config; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.task.AsyncTaskExecutor; +import org.springframework.scheduling.annotation.AsyncConfigurer; +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; + +import java.lang.reflect.Method; +import java.util.Arrays; + +/** + * 异步调用线程配置 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2021-09-02 20:21:10 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Slf4j +@Configuration +public class AsyncConfig { + + /** + * 线程池 配置bean名称 + */ + public static final String ASYNC_EXECUTOR_THREAD_NAME = "smart-admin-async-executor"; + + /** + * 配置线程池 + * + * @return + */ + @Bean(name = ASYNC_EXECUTOR_THREAD_NAME) + public AsyncTaskExecutor executor() { + int processors = Runtime.getRuntime().availableProcessors(); + int threadCount = Math.max(1, processors - 1); + ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor(); + // 核心线程数量 + taskExecutor.setCorePoolSize(threadCount); + // 最大线程数量 + taskExecutor.setMaxPoolSize(threadCount); + taskExecutor.setThreadNamePrefix(ASYNC_EXECUTOR_THREAD_NAME); + taskExecutor.initialize(); + return taskExecutor; + } + + /** + * spring 异步任务 异常配置 + */ + @Configuration + public static class AsyncExceptionConfig implements AsyncConfigurer { + @Override + public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() { + return new AsyncExceptionHandler(); + } + } + + /** + * 自定义异常处理 + */ + public static class AsyncExceptionHandler implements AsyncUncaughtExceptionHandler { + @Override + public void handleUncaughtException(Throwable throwable, Method method, Object... objects) { + log.error("异步任务发生异常:{}, 参数:{}, ", method.getDeclaringClass().getSimpleName() + "." + method.getName(), Arrays.toString(objects), throwable); + } + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/CorsFilterConfig.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/CorsFilterConfig.java new file mode 100644 index 00000000..7cea2f08 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/CorsFilterConfig.java @@ -0,0 +1,45 @@ +package net.lab1024.sa.common.config; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.cors.CorsConfiguration; +import org.springframework.web.cors.UrlBasedCorsConfigurationSource; +import org.springframework.web.filter.CorsFilter; + +/** + * 跨域配置 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2021/11/15 20:38 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Configuration +public class CorsFilterConfig { + + @Value("${access-control-allow-origin}") + private String accessControlAllowOrigin; + + /** + * 跨域配置 + * + * @return + */ + @Bean + public CorsFilter corsFilter () { + UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); + CorsConfiguration config = new CorsConfiguration(); + config.setAllowCredentials(true); + // 设置访问源地址 + config.addAllowedOriginPattern(accessControlAllowOrigin); + // 设置访问源请求头 + config.addAllowedHeader("*"); + // 设置访问源请求方法 + config.addAllowedMethod("*"); + // 对接口配置跨域设置 + source.registerCorsConfiguration("/**", config); + return new CorsFilter(source); + } +} \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartDruidDataSourceConfig.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/DataSourceConfig.java similarity index 60% rename from smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartDruidDataSourceConfig.java rename to smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/DataSourceConfig.java index 560bda2a..cb937a0b 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartDruidDataSourceConfig.java +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/DataSourceConfig.java @@ -1,4 +1,4 @@ -package net.lab1024.smartadmin.config; +package net.lab1024.sa.common.config; import com.alibaba.druid.filter.Filter; import com.alibaba.druid.filter.stat.StatFilter; @@ -6,8 +6,13 @@ import com.alibaba.druid.pool.DruidDataSource; import com.alibaba.druid.support.http.StatViewServlet; import com.alibaba.druid.support.http.WebStatFilter; import com.alibaba.druid.support.spring.stat.DruidStatInterceptor; -import com.alibaba.druid.util.JdbcConstants; +import com.baomidou.mybatisplus.annotation.DbType; +import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; +import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean; import lombok.extern.slf4j.Slf4j; +import net.lab1024.sa.common.common.domain.DataScopePlugin; +import org.apache.ibatis.plugin.Interceptor; +import org.apache.ibatis.session.SqlSessionFactory; import org.springframework.aop.support.DefaultPointcutAdvisor; import org.springframework.aop.support.JdkRegexpMethodPointcut; import org.springframework.beans.factory.annotation.Autowired; @@ -15,28 +20,31 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.boot.web.servlet.ServletRegistrationBean; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Conditional; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Primary; +import org.springframework.core.io.Resource; +import org.springframework.core.io.support.PathMatchingResourcePatternResolver; import javax.sql.DataSource; import java.sql.SQLException; import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; /** - * [ 数据源配置 ] + * 数据源配置 * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - * @since JDK1.8 + * @Author 1024创新实验室-主任: 卓大 + * @Date 2017-11-28 15:21:10 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) */ @Slf4j @Configuration -public class SmartDruidDataSourceConfig { +public class DataSourceConfig { @Value("${spring.datasource.driver-class-name}") String driver; @@ -79,18 +87,20 @@ public class SmartDruidDataSourceConfig { @Value("${spring.datasource.druid.login.enabled}") boolean druidLoginEnable; + @Value("${spring.datasource.druid.method.pointcut}") + String methodPointcut; @Autowired - private StatFilter logSlowSql; + private MybatisPlusInterceptor paginationInterceptor; - @Autowired - private DruidStatInterceptor druidStatInterceptor; + @Autowired(required = false) + private DataScopePlugin dataScopePlugin; @Bean @Primary public DataSource druidDataSource() { DruidDataSource druidDataSource = new DruidDataSource(); - druidDataSource.setDbType(JdbcConstants.MYSQL); + druidDataSource.setDbType(DbType.MYSQL.getDb()); druidDataSource.setDriverClassName(driver); druidDataSource.setUrl(url); druidDataSource.setUsername(username); @@ -101,10 +111,15 @@ public class SmartDruidDataSourceConfig { druidDataSource.setMaxWait(maxWait); druidDataSource.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis); druidDataSource.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis); + druidDataSource.setValidationQuery("SELECT 1"); try { druidDataSource.setFilters(filters); ArrayList arrayList = new ArrayList<>(); - arrayList.add(logSlowSql); + StatFilter statFilter = new StatFilter(); + statFilter.setMergeSql(true); + statFilter.setSlowSqlMillis(500); + statFilter.setLogSlowSql(true); + arrayList.add(statFilter); druidDataSource.setProxyFilters(arrayList); druidDataSource.init(); } catch (SQLException e) { @@ -115,8 +130,33 @@ public class SmartDruidDataSourceConfig { } @Bean - public ServletRegistrationBean druidServlet() { - ServletRegistrationBean servletRegistrationBean = new ServletRegistrationBean(); + public SqlSessionFactory sqlSessionFactory() throws Exception { + MybatisSqlSessionFactoryBean factoryBean = new MybatisSqlSessionFactoryBean(); + factoryBean.setDataSource(druidDataSource()); + PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); + Resource[] resources = resolver.getResources("classpath*:/mapper/**/*.xml"); + factoryBean.setMapperLocations(resources); + + // 设置 MyBatis-Plus 分页插件 注意此处myBatisPlugin一定要放在后面 + List pluginsList = new ArrayList<>(); + pluginsList.add(paginationInterceptor); + if (dataScopePlugin != null) { + pluginsList.add(dataScopePlugin); + } + factoryBean.setPlugins(pluginsList.toArray(new Interceptor[pluginsList.size()])); + + return factoryBean.getObject(); + } + + /** + * 非正式环境 才加载 + * + * @return + */ + @Conditional(SystemEnvironmentConfig.class) + @Bean + public ServletRegistrationBean druidServlet() { + ServletRegistrationBean servletRegistrationBean = new ServletRegistrationBean<>(); servletRegistrationBean.setServlet(new StatViewServlet()); servletRegistrationBean.addUrlMappings("/druid/*"); Map initParameters = new HashMap(); @@ -131,33 +171,18 @@ public class SmartDruidDataSourceConfig { } @Bean - public FilterRegistrationBean filterRegistrationBean() { - FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(); + public FilterRegistrationBean filterRegistrationBean() { + FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(); filterRegistrationBean.setFilter(new WebStatFilter()); filterRegistrationBean.addUrlPatterns("/*"); - filterRegistrationBean.addInitParameter("exclusions", "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*"); + filterRegistrationBean.addInitParameter("exclusions", "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/*"); return filterRegistrationBean; } - @Bean - public StatFilter logSlowSql() { - StatFilter statFilter = new StatFilter(); - statFilter.setMergeSql(true); - statFilter.setSlowSqlMillis(300); - statFilter.setLogSlowSql(true); - return statFilter; - } - - @Bean(name = "druid-stat-interceptor") - public DruidStatInterceptor druidStatInterceptor() { - DruidStatInterceptor dsInterceptor = new DruidStatInterceptor(); - return dsInterceptor; - } - @Bean public JdkRegexpMethodPointcut jdkRegexpMethodPointcut() { JdkRegexpMethodPointcut jdkRegexpMethodPointcut = new JdkRegexpMethodPointcut(); - jdkRegexpMethodPointcut.setPatterns("net.lab1024.smartadmin.module..*Service.*"); + jdkRegexpMethodPointcut.setPatterns(methodPointcut); return jdkRegexpMethodPointcut; } @@ -165,7 +190,7 @@ public class SmartDruidDataSourceConfig { public DefaultPointcutAdvisor defaultPointcutAdvisor() { DefaultPointcutAdvisor pointcutAdvisor = new DefaultPointcutAdvisor(); pointcutAdvisor.setPointcut(jdkRegexpMethodPointcut()); - pointcutAdvisor.setAdvice(druidStatInterceptor); + pointcutAdvisor.setAdvice(new DruidStatInterceptor()); return pointcutAdvisor; } diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/DateConfig.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/DateConfig.java new file mode 100644 index 00000000..5faee795 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/DateConfig.java @@ -0,0 +1,88 @@ +package net.lab1024.sa.common.config; + +import cn.hutool.core.date.DatePattern; +import cn.hutool.core.date.LocalDateTimeUtil; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; +import org.apache.commons.lang3.StringUtils; +import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.convert.converter.Converter; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.format.DateTimeParseException; + +/** + * java8 localDate 时间类格式化配置 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2017-11-28 15:21:10 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Configuration +public class DateConfig { + + @Bean + public Jackson2ObjectMapperBuilderCustomizer customizer() { + return builder -> { + builder.deserializers(new LocalDateDeserializer(DatePattern.NORM_DATE_FORMAT.getDateTimeFormatter())); + builder.deserializers(new LocalDateTimeDeserializer(DatePattern.NORM_DATETIME_FORMAT.getDateTimeFormatter())); + builder.serializers(new LocalDateSerializer(DatePattern.NORM_DATE_FORMAT.getDateTimeFormatter())); + builder.serializers(new LocalDateTimeSerializer(DatePattern.NORM_DATETIME_FORMAT.getDateTimeFormatter())); + }; + } + + + /** + * string 转为 LocalDateTime 配置类 + * + * @author 卓大 + */ + @Configuration + public static class StringToLocalDateTime implements Converter { + + @Override + public LocalDateTime convert(String str) { + if (StringUtils.isBlank(str)) { + return null; + } + LocalDateTime localDateTime; + try { + localDateTime = LocalDateTimeUtil.parse(str, DatePattern.NORM_DATETIME_FORMAT.getDateTimeFormatter()); + } catch (DateTimeParseException e) { + throw new RuntimeException("请输入正确的日期格式:yyyy-MM-dd HH:mm:ss"); + } + return localDateTime; + } + } + + + /** + * string 转为 LocalDate 配置类 + * + * @author 卓大 + */ + @Configuration + public static class StringToLocalDate implements Converter { + + @Override + public LocalDate convert(String str) { + if (StringUtils.isBlank(str)) { + return null; + } + LocalDate localDate; + try { + localDate = LocalDateTimeUtil.parseDate(str, DatePattern.NORM_DATE_FORMAT.getDateTimeFormatter()); + } catch (DateTimeParseException e) { + throw new RuntimeException("请输入正确的日期格式:yyyy-MM-dd"); + } + return localDate; + } + } +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/FileCloudConfig.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/FileCloudConfig.java new file mode 100644 index 00000000..c7285969 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/FileCloudConfig.java @@ -0,0 +1,85 @@ +package net.lab1024.sa.common.config; + +import com.amazonaws.ClientConfiguration; +import com.amazonaws.Protocol; +import com.amazonaws.auth.AWSStaticCredentialsProvider; +import com.amazonaws.auth.BasicAWSCredentials; +import com.amazonaws.client.builder.AwsClientBuilder; +import com.amazonaws.services.s3.AmazonS3; +import com.amazonaws.services.s3.AmazonS3ClientBuilder; +import lombok.Data; +import net.lab1024.sa.common.module.support.file.service.FileStorageCloudServiceImpl; +import net.lab1024.sa.common.module.support.file.service.FileStorageLocalServiceImpl; +import net.lab1024.sa.common.module.support.file.service.IFileStorageService; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * 文件上传 配置 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2019-09-02 23:21:10 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +@Configuration +public class FileCloudConfig { + + @Value("${file.storage.cloud.region}") + private String region; + + @Value("${file.storage.cloud.endpoint}") + private String endpoint; + + @Value("${file.storage.cloud.bucket-name}") + private String bucketName; + + @Value("${file.storage.cloud.access-key}") + private String accessKey; + + @Value("${file.storage.cloud.secret-key}") + private String secretKey; + + @Value("${file.storage.cloud.url.expire}") + private Long urlExpire; + + @Value("${file.storage.cloud.url.public}") + private String publicUrl; + + /** + * 初始化 云oss client 配置 + * + * @return + */ + @Bean + @ConditionalOnProperty(prefix = "file.storage", name = {"mode"}, havingValue = "cloud") + public AmazonS3 initAmazonS3() { + ClientConfiguration clientConfig = new ClientConfiguration(); + clientConfig.setProtocol(Protocol.HTTPS); + AmazonS3 s3Client = AmazonS3ClientBuilder.standard() + .withCredentials(new AWSStaticCredentialsProvider(new BasicAWSCredentials(accessKey, secretKey))) + .withClientConfiguration(clientConfig) + .withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(endpoint, region)) + .withPathStyleAccessEnabled(false) + .build(); + return s3Client; + } + + @Bean + @ConditionalOnProperty(prefix = "file.storage", name = {"mode"}, havingValue = "cloud") + public IFileStorageService initCloudFileService() { + return new FileStorageCloudServiceImpl(); + } + + @Bean + @ConditionalOnProperty(prefix = "file.storage", name = {"mode"}, havingValue = "local") + public IFileStorageService initLocalFileService() { + return new FileStorageLocalServiceImpl(); + } + + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/HeartBeatConfig.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/HeartBeatConfig.java new file mode 100644 index 00000000..56e8765f --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/HeartBeatConfig.java @@ -0,0 +1,37 @@ +package net.lab1024.sa.common.config; + +import net.lab1024.sa.common.module.support.heartbeat.core.HeartBeatManager; +import net.lab1024.sa.common.module.support.heartbeat.core.IHeartBeatRecordHandler; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * 心跳配置 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2018/10/9 18:47 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Configuration +public class HeartBeatConfig { + + /** + * 间隔时间 + */ + @Value("${heart-beat.interval-seconds}") + private Long intervalSeconds; + + @Autowired + private IHeartBeatRecordHandler heartBeatRecordHandler; + + @Bean + public HeartBeatManager heartBeatManager() { + return new HeartBeatManager(intervalSeconds * 1000L, heartBeatRecordHandler); + } + + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/MvcConfig.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/MvcConfig.java new file mode 100644 index 00000000..c08339c9 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/MvcConfig.java @@ -0,0 +1,50 @@ +package net.lab1024.sa.common.config; + +import net.lab1024.sa.common.common.interceptor.AbstractInterceptor; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.HandlerInterceptor; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; +import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +import java.util.List; + +/** + * web相关配置 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2021-09-02 20:21:10 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Configuration +public class MvcConfig implements WebMvcConfigurer { + + @Autowired(required = false) + private List interceptorList; + + @Override + public void addInterceptors (InterceptorRegistry registry) { + if (CollectionUtils.isEmpty(interceptorList)) { + return; + } + interceptorList.forEach(e->{ + registry.addInterceptor(e).addPathPatterns("/**"); + }); + } + + @Override + public void addResourceHandlers(ResourceHandlerRegistry registry) { + registry.addResourceHandler("/preview/**"); + } + + @Override + public void addViewControllers(ViewControllerRegistry registry) { + registry.addViewController("/druidMonitor").setViewName("redirect:druid/index.html"); + registry.addViewController("/swaggerApi").setViewName("redirect:swagger-ui.html"); + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/MybatisPlusConfig.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/MybatisPlusConfig.java new file mode 100644 index 00000000..f946abea --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/MybatisPlusConfig.java @@ -0,0 +1,33 @@ +package net.lab1024.sa.common.config; + +import com.baomidou.mybatisplus.annotation.DbType; +import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; +import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.transaction.annotation.EnableTransactionManagement; + +/** + * mp 插件 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2021-09-02 20:21:10 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@EnableTransactionManagement +@Configuration +public class MybatisPlusConfig { + + /** + * 分页插件 + */ + @Bean + public MybatisPlusInterceptor paginationInterceptor() { + MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); + interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL)); + return interceptor; + } + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/PostProcessorConfig.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/PostProcessorConfig.java new file mode 100644 index 00000000..827b499b --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/PostProcessorConfig.java @@ -0,0 +1,56 @@ +package net.lab1024.sa.common.config; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.env.EnvironmentPostProcessor; +import org.springframework.boot.env.YamlPropertySourceLoader; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.env.ConfigurableEnvironment; +import org.springframework.core.env.MutablePropertySources; +import org.springframework.core.env.PropertySource; +import org.springframework.core.io.Resource; +import org.springframework.core.io.support.PathMatchingResourcePatternResolver; + +import java.io.IOException; +import java.util.List; + +/** + * yaml 读取配置 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022-05-30 21:22:12 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Configuration +@Slf4j +public class PostProcessorConfig implements EnvironmentPostProcessor { + + private final YamlPropertySourceLoader loader = new YamlPropertySourceLoader(); + + @Override + public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) { + MutablePropertySources propertySources = environment.getPropertySources(); + this.loadProperty(propertySources); + } + + private void loadProperty(MutablePropertySources propertySources) { + PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); + try { + Resource[] resources = resolver.getResources("classpath*:sa-*.yaml"); + if (resources.length < 1) { + return; + } + for (Resource resource : resources) { + log.info("初始化系统配置:{}", resource.getFilename()); + List> load = loader.load(resource.getFilename(), resource); + load.forEach(propertySources::addLast); + } + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + +} \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartRedisConfig.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/RedisConfig.java similarity index 90% rename from smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartRedisConfig.java rename to smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/RedisConfig.java index 829ca01f..7002d53d 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartRedisConfig.java +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/RedisConfig.java @@ -1,4 +1,4 @@ -package net.lab1024.smartadmin.config; +package net.lab1024.sa.common.config; import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.PropertyAccessor; @@ -12,17 +12,16 @@ import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; import org.springframework.data.redis.serializer.StringRedisSerializer; /** - * [ redis配置 ] + * redis配置 * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - * @since JDK1.8 + * @Author 1024创新实验室-主任: 卓大 + * @Date 2021-09-02 20:21:10 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) */ @Configuration -public class SmartRedisConfig { +public class RedisConfig { @Autowired private RedisConnectionFactory factory; @@ -70,5 +69,4 @@ public class SmartRedisConfig { return redisTemplate.opsForZSet(); } - } diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/ReloadConfig.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/ReloadConfig.java new file mode 100644 index 00000000..1c31dcec --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/ReloadConfig.java @@ -0,0 +1,38 @@ +package net.lab1024.sa.common.config; + +import lombok.extern.slf4j.Slf4j; +import net.lab1024.sa.common.module.support.reload.ReloadCommand; +import net.lab1024.sa.common.module.support.reload.core.SmartReloadManager; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * reload配置 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2021/9/1 21:40 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Slf4j +@Configuration +public class ReloadConfig { + + /** + * 间隔时间 + */ + @Value("${reload.interval-seconds}") + private Integer intervalSeconds; + + @Autowired + private ReloadCommand reloadCommand; + + @Bean + public SmartReloadManager initSmartReloadManager() { + // 创建 Reload Manager 调度器 + return new SmartReloadManager(reloadCommand,intervalSeconds); + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/RepeatSubmitConfig.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/RepeatSubmitConfig.java new file mode 100644 index 00000000..fcfdd5ee --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/RepeatSubmitConfig.java @@ -0,0 +1,40 @@ +package net.lab1024.sa.common.config; + +import net.lab1024.sa.common.common.constant.StringConst; +import net.lab1024.sa.common.common.util.SmartRequestUtil; +import net.lab1024.sa.common.module.support.repeatsubmit.RepeatSubmitAspect; +import net.lab1024.sa.common.module.support.repeatsubmit.ticket.RepeatSubmitCaffeineTicket; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * 重复提交配置 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2021/10/9 18:47 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Configuration +public class RepeatSubmitConfig { + + @Bean + public RepeatSubmitAspect repeatSubmitAspect() { + RepeatSubmitCaffeineTicket caffeineTicket = new RepeatSubmitCaffeineTicket(this::ticket); + return new RepeatSubmitAspect(caffeineTicket); + } + + /** + * 获取指明某个用户的凭证 + * + * @return + */ + private String ticket(String servletPath) { + Long userId = SmartRequestUtil.getRequestUserId(); + if (null == userId) { + return StringConst.EMPTY; + } + return servletPath + "_" + userId; + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/RestTemplateConfig.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/RestTemplateConfig.java new file mode 100644 index 00000000..d14004c3 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/RestTemplateConfig.java @@ -0,0 +1,130 @@ +package net.lab1024.sa.common.config; + +import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter; +import okhttp3.ConnectionPool; +import okhttp3.OkHttpClient; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.http.client.OkHttp3ClientHttpRequestFactory; +import org.springframework.http.converter.HttpMessageConverter; +import org.springframework.http.converter.StringHttpMessageConverter; +import org.springframework.web.client.RestTemplate; + +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLSocketFactory; +import javax.net.ssl.TrustManager; +import javax.net.ssl.X509TrustManager; +import java.nio.charset.StandardCharsets; +import java.security.KeyManagementException; +import java.security.NoSuchAlgorithmException; +import java.security.SecureRandom; +import java.security.cert.CertificateException; +import java.security.cert.X509Certificate; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; + +/** + * http请求配置 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022-05-30 21:22:12 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Configuration +public class RestTemplateConfig { + + @Value("${http.pool.max-total}") + private Integer maxTotal; + + @Value("${http.pool.connect-timeout}") + private Integer connectTimeout; + + @Value("${http.pool.read-timeout}") + private Integer readTimeout; + + @Value("${http.pool.write-timeout}") + private Integer writeTimeout; + + @Value("${http.pool.keep-alive}") + private Integer keepAlive; + + @Bean + public RestTemplate restTemplate() { + RestTemplate restTemplate = new RestTemplate(); + restTemplate.setRequestFactory(this.clientHttpRequestFactory()); + List> messageConverterList = restTemplate.getMessageConverters(); + messageConverterList.add(0, new StringHttpMessageConverter(StandardCharsets.UTF_8)); + messageConverterList.addAll(this.converters()); + return restTemplate; + } + + public List> converters() { + List> converters = new ArrayList<>(); + HttpMessageConverter converter = new StringHttpMessageConverter(StandardCharsets.UTF_8); + FastJsonHttpMessageConverter fastConverter = new FastJsonHttpMessageConverter(); + List fastMediaTypes = new ArrayList<>(); + fastMediaTypes.add(MediaType.APPLICATION_FORM_URLENCODED); + fastMediaTypes.add(MediaType.APPLICATION_JSON); + fastConverter.setSupportedMediaTypes(fastMediaTypes); + converters.add(converter); + converters.add(fastConverter); + return converters; + } + + + public OkHttp3ClientHttpRequestFactory clientHttpRequestFactory() { + return new OkHttp3ClientHttpRequestFactory(httpClientBuilder()); + } + + public OkHttpClient httpClientBuilder() { + return new OkHttpClient.Builder() + .retryOnConnectionFailure(true) + .connectionPool(this.pool()) + .connectTimeout(connectTimeout, TimeUnit.MILLISECONDS) + .readTimeout(readTimeout, TimeUnit.MILLISECONDS) + .writeTimeout(writeTimeout, TimeUnit.MILLISECONDS) + .build(); + } + + public ConnectionPool pool() { + return new ConnectionPool(maxTotal, keepAlive, TimeUnit.MILLISECONDS); + } + + + @Bean + public X509TrustManager x509TrustManager() { + return new X509TrustManager() { + @Override + public void checkClientTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException { + } + + @Override + public void checkServerTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException { + } + + @Override + public X509Certificate[] getAcceptedIssuers() { + return new X509Certificate[0]; + } + }; + } + + @Bean + public SSLSocketFactory sslSocketFactory() { + try { + //信任任何链接 + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(null, new TrustManager[]{x509TrustManager()}, new SecureRandom()); + return sslContext.getSocketFactory(); + } catch (NoSuchAlgorithmException | KeyManagementException e) { + e.printStackTrace(); + } + return null; + } + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/ScheduleConfig.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/ScheduleConfig.java new file mode 100644 index 00000000..a156a41b --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/ScheduleConfig.java @@ -0,0 +1,47 @@ +package net.lab1024.sa.common.config; + +import lombok.extern.slf4j.Slf4j; +import org.apache.logging.log4j.util.Strings; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.annotation.SchedulingConfigurer; +import org.springframework.scheduling.config.ScheduledTaskRegistrar; +import org.springframework.scheduling.config.Task; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 定时任务调度 配置 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022-05-30 21:22:12 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Slf4j +@Configuration +public class ScheduleConfig implements SchedulingConfigurer { + + private ScheduledTaskRegistrar taskRegistrar; + + @Override + public void configureTasks(ScheduledTaskRegistrar taskRegistrar) { + this.taskRegistrar = taskRegistrar; + } + + public String destroy() { + List taskList = new ArrayList<>(); + taskList.addAll(taskRegistrar.getCronTaskList()); + taskList.addAll(taskRegistrar.getTriggerTaskList()); + taskList.addAll(taskRegistrar.getFixedDelayTaskList()); + taskList.addAll(taskRegistrar.getFixedRateTaskList()); + + taskRegistrar.destroy(); + + List taskNameList = taskList.stream().map(Task::toString).collect(Collectors.toList()); + return "已关闭 @Scheduled定时任务:" + taskNameList.size() + "个!"; + } + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/SwaggerConfig.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/SwaggerConfig.java new file mode 100644 index 00000000..901b9246 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/SwaggerConfig.java @@ -0,0 +1,206 @@ +package net.lab1024.sa.common.config; + +import com.google.common.base.Optional; +import com.google.common.base.Predicate; +import com.google.common.base.Predicates; +import com.google.common.collect.Lists; +import io.swagger.annotations.Api; +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import net.lab1024.sa.common.common.constant.RequestHeaderConst; +import net.lab1024.sa.common.common.swagger.SwaggerApiModelPropertyEnumPlugin; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.BeansException; +import org.springframework.beans.factory.config.BeanDefinition; +import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; +import org.springframework.beans.factory.support.BeanDefinitionBuilder; +import org.springframework.beans.factory.support.BeanDefinitionRegistry; +import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor; +import org.springframework.context.EnvironmentAware; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Conditional; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.annotation.Order; +import org.springframework.core.env.Environment; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RestController; +import springfox.documentation.RequestHandler; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.ParameterBuilder; +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.schema.ModelRef; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.service.Contact; +import springfox.documentation.service.Parameter; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger.common.SwaggerPluginSupport; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 根据SwaggerTagConst内部类动态生成Swagger group + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2020-03-25 22:54:46 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Slf4j +@EnableSwagger2 +@Configuration +@Conditional(SystemEnvironmentConfig.class) +public class SwaggerConfig implements EnvironmentAware, BeanDefinitionRegistryPostProcessor { + + /** + * 文档标题 + */ + private String title; + + /** + * 文档描述 + */ + private String description; + + /** + * api版本 + */ + private String version; + + /** + * service url + */ + private String teamUrl; + + /** + * host + */ + private String host; + + private String tagClass; + + @Bean + @Order(SwaggerPluginSupport.SWAGGER_PLUGIN_ORDER + 1) + public SwaggerApiModelPropertyEnumPlugin swaggerEnum() { + return new SwaggerApiModelPropertyEnumPlugin(); + } + + @Override + public void setEnvironment(Environment environment) { + this.title = environment.getProperty("swagger.title"); + this.description = environment.getProperty("swagger.description"); + this.version = environment.getProperty("swagger.version"); + this.host = environment.getProperty("swagger.host"); + this.tagClass = environment.getProperty("swagger.tag-class"); + this.teamUrl = environment.getProperty("swagger.team-url"); + } + + @Override + public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) { + Map> groupMap = this.buildGroup(); + for (Map.Entry> entry : groupMap.entrySet()) { + String group = entry.getKey(); + BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(Docket.class, () -> this.baseDocket(group, entry.getValue())); + BeanDefinition beanDefinition = builder.getRawBeanDefinition(); + registry.registerBeanDefinition(group + "Api", beanDefinition); + } + } + + @SneakyThrows + private Map> buildGroup() { + Class clazz = Class.forName(tagClass); + Class[] innerClazz = clazz.getClasses(); + Map> groupMap = new HashMap<>(16); + for (Class cls : innerClazz) { + String group = cls.getSimpleName(); + List apiTags = Lists.newArrayList(); + Field[] fields = cls.getDeclaredFields(); + for (Field field : fields) { + boolean isFinal = Modifier.isFinal(field.getModifiers()); + if (isFinal) { + apiTags.add(field.get(null).toString()); + } + } + groupMap.put(group, apiTags); + } + return groupMap; + } + + private Docket baseDocket(String groupName, List apiTagList) { + // 配置全局参数 + List parameterList = this.generateParameter(); + + Docket docket = new Docket(DocumentationType.SWAGGER_2).groupName(groupName) + .forCodeGeneration(true) + .select() + // 过滤规则 + .apis(this.getControllerPredicate(apiTagList)) + // 与 过滤规则 controller 包路径 二选一 + // .apis(RequestHandlerSelectors.basePackage(packAge)) + .paths(PathSelectors.any()) + .build().apiInfo(this.apiInfo()) + .globalOperationParameters(parameterList); + if (StringUtils.isNotBlank(host)) { + docket = docket.host(host); + } + return docket; + } + + private Predicate getControllerPredicate(List apiTagList) { + Predicate methodPredicate = (input) -> { + Api api = null; + Optional apiOptional = input.findControllerAnnotation(Api.class); + if (apiOptional.isPresent()) { + api = apiOptional.get(); + } + if (api == null) { + return false; + } + List tags = Arrays.asList(api.tags()); + if (apiTagList.containsAll(tags)) { + return true; + } + return false; + }; + Predicate controllerPredicate = Predicates.or(RequestHandlerSelectors.withClassAnnotation(RestController.class), RequestHandlerSelectors.withClassAnnotation(Controller.class)); + return Predicates.and(controllerPredicate, methodPredicate); + } + + private ApiInfo apiInfo() { + return new ApiInfoBuilder().title(title) + .description(description) + .version(version) + .termsOfServiceUrl(teamUrl) + .contact(new Contact("1024lab", teamUrl, "1024lab@sina.com")) + .build(); + } + + @Override + public void postProcessBeanFactory(ConfigurableListableBeanFactory configurableListableBeanFactory) throws BeansException { + + } + + /** + * 生成共用请求参数 + * + * @return + */ + private List generateParameter() { + // 配置全局参数 token + Parameter token = new ParameterBuilder().name(RequestHeaderConst.TOKEN) + .description("token") + .modelRef(new ModelRef("string")) + .parameterType("header").defaultValue("1") + .required(false) + .build(); + return Lists.newArrayList(token); + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/SystemEnvironmentConfig.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/SystemEnvironmentConfig.java new file mode 100644 index 00000000..1af9577a --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/SystemEnvironmentConfig.java @@ -0,0 +1,49 @@ +package net.lab1024.sa.common.config; + +import net.lab1024.sa.common.common.domain.SystemEnvironment; +import net.lab1024.sa.common.common.enumeration.SystemEnvironmentEnum; +import net.lab1024.sa.common.common.util.SmartEnumUtil; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Condition; +import org.springframework.context.annotation.ConditionContext; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.type.AnnotatedTypeMetadata; + +/** + * 系统环境 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2021/08/13 18:56 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Configuration +public class SystemEnvironmentConfig implements Condition { + + @Value("${spring.profiles.active}") + private String systemEnvironment; + + @Value("${project.name}") + private String projectName; + + @Override + public boolean matches(ConditionContext conditionContext, AnnotatedTypeMetadata annotatedTypeMetadata) { + String property = conditionContext.getEnvironment().getProperty("spring.profiles.active"); + return StringUtils.isNotBlank(property) && !SystemEnvironmentEnum.PROD.equalsValue(property); + } + + @Bean + public SystemEnvironment initEnvironment() { + SystemEnvironmentEnum currentEnvironment = SmartEnumUtil.getEnumByValue(systemEnvironment, SystemEnvironmentEnum.class); + if (currentEnvironment == null) { + throw new ExceptionInInitializerError("无法获取当前环境!请在 application.yaml 配置参数:spring.profiles.active"); + } + if (StringUtils.isBlank(projectName)) { + throw new ExceptionInInitializerError("无法获取当前项目名称!请在 application.yaml 配置参数:project.name"); + } + return new SystemEnvironment(currentEnvironment == SystemEnvironmentEnum.PROD, projectName, currentEnvironment); + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/UrlConfig.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/UrlConfig.java new file mode 100644 index 00000000..6e8ae116 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/UrlConfig.java @@ -0,0 +1,150 @@ +package net.lab1024.sa.common.config; + +import cn.hutool.core.util.StrUtil; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import net.lab1024.sa.common.common.annoation.NoNeedLogin; +import net.lab1024.sa.common.common.annoation.SaAuth; +import net.lab1024.sa.common.common.domain.RequestUrlVO; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.method.HandlerMethod; +import org.springframework.web.servlet.mvc.method.RequestMappingInfo; +import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; + +import java.lang.reflect.Method; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +/** + * url配置 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022-05-30 21:22:12 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Configuration +@Slf4j +public class UrlConfig { + @Autowired + private RequestMappingHandlerMapping requestMappingHandlerMapping; + + + /** + * 获取每个方法的请求路径 + * + * @return + */ + @Bean + public Map> methodUrlMap() { + Map> methodUrlMap = Maps.newHashMap(); + //获取url与类和方法的对应信息 + Map map = requestMappingHandlerMapping.getHandlerMethods(); + for (Map.Entry entry : map.entrySet()) { + RequestMappingInfo requestMappingInfo = entry.getKey(); + + Set urls = requestMappingInfo.getPatternsCondition().getPatterns(); + if (CollectionUtils.isEmpty(urls)) { + continue; + } + HandlerMethod handlerMethod = entry.getValue(); + methodUrlMap.put(handlerMethod.getMethod(), urls); + } + return methodUrlMap; + } + + /** + * 需要进行url权限校验的方法 + * + * @param methodUrlMap + * @return + */ + @Bean + public List authUrl(Map> methodUrlMap) { + List authUrlList = Lists.newArrayList(); + for (Map.Entry> entry : methodUrlMap.entrySet()) { + Method method = entry.getKey(); + SaAuth saAuth = method.getAnnotation(SaAuth.class); + if (null == saAuth) { + continue; + } + List requestUrlList = this.buildRequestUrl(method, entry.getValue()); + authUrlList.addAll(requestUrlList); + } + log.info("需要权限校验的URL:{}", authUrlList.stream().map(e -> e.getUrl()).collect(Collectors.toList())); + return authUrlList; + } + + private List buildRequestUrl(Method method, Set urlSet) { + List requestUrlList = Lists.newArrayList(); + if (CollectionUtils.isEmpty(urlSet)) { + return requestUrlList; + } + //url对应的方法名称 + String className = method.getDeclaringClass().getName(); + String methodName = method.getName(); + List list = StrUtil.split(className, "."); + String controllerName = list.get(list.size() - 1); + String name = controllerName + "." + methodName; + //swagger 说明信息 + String methodComment = null; + ApiOperation apiOperation = method.getAnnotation(ApiOperation.class); + if (apiOperation != null) { + methodComment = apiOperation.value(); + } + for (String url : urlSet) { + RequestUrlVO requestUrlVO = new RequestUrlVO(); + requestUrlVO.setUrl(url); + requestUrlVO.setName(name); + requestUrlVO.setComment(methodComment); + requestUrlList.add(requestUrlVO); + } + return requestUrlList; + } + + + /** + * 获取无需登录可以匿名访问的url信息 + * + * @return + */ + @Bean + public List noNeedLoginUrlList(Map> methodUrlMap) { + List noNeedLoginUrlList = Lists.newArrayList(); + for (Map.Entry> entry : methodUrlMap.entrySet()) { + Method method = entry.getKey(); + NoNeedLogin noNeedLogin = method.getAnnotation(NoNeedLogin.class); + if (null == noNeedLogin) { + continue; + } + noNeedLoginUrlList.addAll(entry.getValue()); + } + log.info("不需要登录的URL:{}", noNeedLoginUrlList); + return noNeedLoginUrlList; + } + + /** + * 获取忽略的url信息 + * + * @return + */ + @Bean + public List ignoreUrlList() { + List ignoreUrlList = Lists.newArrayList(); + ignoreUrlList.add("/swagger-ui.html"); + ignoreUrlList.add("/swagger-resources/**"); + ignoreUrlList.add("/webjars/**"); + ignoreUrlList.add("/druid/**"); + ignoreUrlList.add("/*/api-docs"); + return ignoreUrlList; + } + +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/constant/CacheKeyConst.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/constant/CacheKeyConst.java new file mode 100644 index 00000000..ef91a805 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/constant/CacheKeyConst.java @@ -0,0 +1,14 @@ +package net.lab1024.sa.common.constant; + +/** + * 缓存key常量 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022-05-30 21:22:12 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public class CacheKeyConst { + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/constant/RedisKeyConst.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/constant/RedisKeyConst.java new file mode 100644 index 00000000..9abb7afb --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/constant/RedisKeyConst.java @@ -0,0 +1,31 @@ +package net.lab1024.sa.common.constant; + +/** + * redis key 常量类 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022-05-30 21:22:12 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public class RedisKeyConst { + + public static final String SEPARATOR = ":"; + + public static class Support { + + public static final String FILE_URL = "file:"; + + public static final String FILE_VO = "file-vo:"; + + public static final String SERIAL_NUMBER_LAST_INFO = "serial-number:last-info"; + + public static final String SERIAL_NUMBER = "serial-number:"; + + public static final String CAPTCHA = "captcha:"; + + public static final String TOKEN = "token:"; + + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/constant/ReloadConst.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/constant/ReloadConst.java new file mode 100644 index 00000000..635dc382 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/constant/ReloadConst.java @@ -0,0 +1,18 @@ +package net.lab1024.sa.common.constant; + +/** + * reload 项目 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-05-30 21:22:12 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public class ReloadConst { + + public static final String CONFIG_RELOAD = "system_config"; + + public static final String CACHE_SERVICE = "cache_service"; + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/constant/SwaggerTagConst.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/constant/SwaggerTagConst.java new file mode 100644 index 00000000..ebc7bdb4 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/constant/SwaggerTagConst.java @@ -0,0 +1,49 @@ +package net.lab1024.sa.common.constant; + +/** + * swagger + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022-05-30 21:22:12 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public class SwaggerTagConst { + + public static class Support { + + public static final String CACHE = "业务支撑-缓存"; + + public static final String CAPTCHA = "业务支撑-验证码"; + + public static final String OPERATE_LOG = "业务支撑-用户操作记录"; + + public static final String LOGIN_LOG = "业务支撑-登录日志"; + + public static final String RELOAD = "业务支撑-reload"; + + public static final String SERIAL_NUMBER = "业务支撑-id生成器"; + + public static final String HEART_BEAT = "业务支撑-服务心跳"; + + public static final String FILE = "业务支撑-文件服务"; + + public static final String CONFIG = "业务支撑-系统参数"; + + public static final String DATA_TRACER = "业务支撑-数据变动记录"; + + public static final String DICT = "业务支撑-数据字典"; + + public static final String CODE_GENERATOR = "业务支撑-代码生成"; + + public static final String CHANGE_LOG = "业务支撑-更新日志"; + + public static final String HELP_DOC = "业务支撑-帮助文档"; + + public static final String FEEDBACK = "业务支撑-意见反馈"; + + public static final String TABLE_COLUMN = "业务支撑-列自定义"; + } + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/constant/UrlPrefixConst.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/constant/UrlPrefixConst.java new file mode 100644 index 00000000..12c28934 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/constant/UrlPrefixConst.java @@ -0,0 +1,18 @@ +package net.lab1024.sa.common.constant; + +/** + * url前缀 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2021/10/03 20:48 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public class UrlPrefixConst { + + public static final String SUPPORT = "/support"; + + public static final String THIRD = "/third"; + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/handler/GlobalExceptionHandler.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/handler/GlobalExceptionHandler.java new file mode 100644 index 00000000..66da1df0 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/handler/GlobalExceptionHandler.java @@ -0,0 +1,126 @@ +package net.lab1024.sa.common.handler; + +import lombok.extern.slf4j.Slf4j; +import net.lab1024.sa.common.common.code.SystemErrorCode; +import net.lab1024.sa.common.common.code.UserErrorCode; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.domain.SystemEnvironment; +import net.lab1024.sa.common.common.exception.BusinessException; +import org.springframework.beans.TypeMismatchException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.converter.HttpMessageNotReadableException; +import org.springframework.security.access.AccessDeniedException; +import org.springframework.validation.BindException; +import org.springframework.validation.FieldError; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import java.util.List; +import java.util.stream.Collectors; + +/** + * 全局异常拦截 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2020/8/25 21:57 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Slf4j +@ControllerAdvice +public class GlobalExceptionHandler { + + @Autowired + private SystemEnvironment systemEnvironment; + + /** + * json 格式错误 缺少请求体 + */ + @ResponseBody + @ExceptionHandler({HttpMessageNotReadableException.class}) + public ResponseDTO jsonFormatExceptionHandler(Exception e) { + if (!systemEnvironment.isProd()) { + log.error("全局JSON格式错误异常,URL:{}", getCurrentRequestUrl(), e); + } + return ResponseDTO.error(UserErrorCode.PARAM_ERROR, "参数JSON格式错误"); + } + + /** + * json 格式错误 缺少请求体 + */ + @ResponseBody + @ExceptionHandler({TypeMismatchException.class, BindException.class}) + public ResponseDTO paramExceptionHandler(Exception e) { + if (!systemEnvironment.isProd()) { + log.error("全局参数异常,URL:{}", getCurrentRequestUrl(), e); + } + + if (e instanceof BindException) { + if (e instanceof MethodArgumentNotValidException) { + List fieldErrors = ((MethodArgumentNotValidException) e).getBindingResult().getFieldErrors(); + List msgList = fieldErrors.stream().map(FieldError::getDefaultMessage).collect(Collectors.toList()); + return ResponseDTO.error(UserErrorCode.PARAM_ERROR, String.join(",", msgList)); + } + + List fieldErrors = ((BindException) e).getFieldErrors(); + List error = fieldErrors.stream().map(field -> field.getField() + ":" + field.getRejectedValue()).collect(Collectors.toList()); + String errorMsg = UserErrorCode.PARAM_ERROR.getMsg() + ":" + error; + return ResponseDTO.error(UserErrorCode.PARAM_ERROR, errorMsg); + } + + return ResponseDTO.error(UserErrorCode.PARAM_ERROR); + } + + /** + * 权限异常 + */ + @ResponseBody + @ExceptionHandler({AccessDeniedException.class}) + public ResponseDTO permissionExceptionHandler(AccessDeniedException e) { + return ResponseDTO.error(UserErrorCode.NO_PERMISSION); + } + + /** + * 业务异常 + */ + @ResponseBody + @ExceptionHandler(BusinessException.class) + public ResponseDTO businessExceptionHandler(BusinessException e) { + if (!systemEnvironment.isProd()) { + log.error("全局业务异常,URL:{}", getCurrentRequestUrl(), e); + } + return ResponseDTO.error(SystemErrorCode.SYSTEM_ERROR, e.getMessage()); + } + + /** + * 其他全部异常 + * + * @param e + * @return + */ + @ResponseBody + @ExceptionHandler(Throwable.class) + public ResponseDTO errorHandler(Throwable e) { + log.error("捕获全局异常,URL:{}", getCurrentRequestUrl(), e); + return ResponseDTO.error(SystemErrorCode.SYSTEM_ERROR, systemEnvironment.isProd() ? null : e.toString()); + } + + /** + * 获取当前请求url + */ + private String getCurrentRequestUrl() { + RequestAttributes request = RequestContextHolder.getRequestAttributes(); + if (null == request) { + return null; + } + ServletRequestAttributes servletRequest = (ServletRequestAttributes) request; + return servletRequest.getRequest().getRequestURI(); + } + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/listener/SmartApplicationListener.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/listener/SmartApplicationListener.java new file mode 100644 index 00000000..21cfb938 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/listener/SmartApplicationListener.java @@ -0,0 +1,54 @@ +package net.lab1024.sa.common.listener; + +import cn.hutool.core.net.NetUtil; +import cn.hutool.core.util.URLUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.boot.web.context.WebServerApplicationContext; +import org.springframework.boot.web.context.WebServerInitializedEvent; +import org.springframework.boot.web.server.WebServer; +import org.springframework.context.ApplicationListener; +import org.springframework.core.annotation.Order; +import org.springframework.core.env.Environment; +import org.springframework.stereotype.Component; + +/** + * 启动监听器 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2021-12-23 23:45:26 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Slf4j +@Component +@Order(value = 1024) +public class SmartApplicationListener implements ApplicationListener { + + @Override + public void onApplicationEvent(WebServerInitializedEvent webServerInitializedEvent) { + WebServer server = webServerInitializedEvent.getWebServer(); + WebServerApplicationContext context = webServerInitializedEvent.getApplicationContext(); + Environment env = context.getEnvironment(); + //获取服务信息 + String ip = NetUtil.getLocalhost().getHostAddress(); + Integer port = server.getPort(); + String contextPath = env.getProperty("server.servlet.context-path"); + if (contextPath == null) { + contextPath = ""; + } + String profile = env.getProperty("spring.profiles.active"); + String projectName = env.getProperty("project.name"); + //拼接服务地址 + String title = String.format("-------------【%s】 service is running!current profile is 【%s】-------------", projectName, profile); + String localhostUrl = URLUtil.normalize(String.format("http://localhost:%d%s", port, contextPath), false, true); + String externalUrl = URLUtil.normalize(String.format("http://%s:%d%s", ip, port, contextPath), false, true); + String swaggerUrl = URLUtil.normalize(String.format("http://localhost:%d%s/swagger-ui.html", port, contextPath), false, true); + log.info("\n{}\n" + + "\tLocal:\t\t{}" + + "\n\tExternal:\t{}" + + "\n\tSwagger:\t{}" + + "\n-------------------------------------------------------------------------------------\n", + title, localhostUrl, externalUrl, swaggerUrl); + } +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/cache/CacheService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/cache/CacheService.java new file mode 100644 index 00000000..7697929c --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/cache/CacheService.java @@ -0,0 +1,78 @@ +package net.lab1024.sa.common.module.support.cache; + +import com.google.common.collect.Lists; +import net.lab1024.sa.common.constant.ReloadConst; +import net.lab1024.sa.common.module.support.reload.core.annoation.SmartReload; +import org.springframework.cache.caffeine.CaffeineCache; +import org.springframework.cache.caffeine.CaffeineCacheManager; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Collection; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +/** + * 缓存操作 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2021/10/11 20:07 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Service +public class CacheService { + + @Resource + private CaffeineCacheManager caffeineCacheManager; + + /** + * 获取所有缓存名称 + * + * @return + */ + public List cacheNames() { + return Lists.newArrayList(caffeineCacheManager.getCacheNames()); + } + + /** + * 某个缓存下的所有key + * + * @param cacheName + * @return + */ + public List cacheKey(String cacheName) { + CaffeineCache cache = (CaffeineCache) caffeineCacheManager.getCache(cacheName); + if (cache == null) { + return Lists.newArrayList(); + } + Set cacheKey = cache.getNativeCache().asMap().keySet(); + return cacheKey.stream().map(e -> e.toString()).collect(Collectors.toList()); + } + + /** + * 移除某个key + * + * @param cacheName + */ + + public void removeCache(String cacheName) { + CaffeineCache cache = (CaffeineCache) caffeineCacheManager.getCache(cacheName); + if (cache != null) { + cache.clear(); + } + } + + @SmartReload(ReloadConst.CACHE_SERVICE) + public void clearAllCache() { + Collection cacheNames = caffeineCacheManager.getCacheNames(); + for (String name : cacheNames) { + CaffeineCache cache = (CaffeineCache) caffeineCacheManager.getCache(name); + if (cache != null) { + cache.clear(); + } + } + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/captcha/CaptchaController.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/captcha/CaptchaController.java new file mode 100644 index 00000000..47916db0 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/captcha/CaptchaController.java @@ -0,0 +1,36 @@ +package net.lab1024.sa.common.module.support.captcha; + + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import net.lab1024.sa.common.common.controller.SupportBaseController; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.constant.SwaggerTagConst; +import net.lab1024.sa.common.module.support.captcha.domain.CaptchaVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 图形验证码业务 + * + * @Author 1024创新实验室: 胡克 + * @Date 2021-09-02 20:21:10 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Api(tags = SwaggerTagConst.Support.CAPTCHA) +@RestController +public class CaptchaController extends SupportBaseController { + + @Autowired + private CaptchaService captchaService; + + @ApiOperation("获取图形验证码 @author 胡克") + @GetMapping("/captcha") + public ResponseDTO generateCaptcha() { + return ResponseDTO.ok(captchaService.generateCaptcha()); + } + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/captcha/CaptchaService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/captcha/CaptchaService.java new file mode 100644 index 00000000..36042c67 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/captcha/CaptchaService.java @@ -0,0 +1,115 @@ +package net.lab1024.sa.common.module.support.captcha; + +import com.google.code.kaptcha.impl.DefaultKaptcha; +import lombok.extern.slf4j.Slf4j; +import net.lab1024.sa.common.common.code.UserErrorCode; +import net.lab1024.sa.common.common.constant.StringConst; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.domain.SystemEnvironment; +import net.lab1024.sa.common.common.exception.BusinessException; +import net.lab1024.sa.common.constant.RedisKeyConst; +import net.lab1024.sa.common.module.support.captcha.domain.CaptchaForm; +import net.lab1024.sa.common.module.support.captcha.domain.CaptchaVO; +import net.lab1024.sa.common.module.support.redis.RedisService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.Base64Utils; + +import javax.imageio.ImageIO; +import java.awt.image.BufferedImage; +import java.io.ByteArrayOutputStream; +import java.util.Objects; +import java.util.UUID; + +/** + * 图形验证码 服务 + * + * @Author 1024创新实验室: 胡克 + * @Date 2021/8/31 20:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Slf4j +@Service +public class CaptchaService { + + /** + * 过期时间:65秒 + */ + private static final long EXPIRE_SECOND = 65L; + + @Autowired + private DefaultKaptcha defaultKaptcha; + @Autowired + private SystemEnvironment systemEnvironment; + @Autowired + private RedisService redisService; + + /** + * 生成图形验证码 + * 默认 1 分钟有效期 + * + * @return + */ + public CaptchaVO generateCaptcha() { + String captchaText = defaultKaptcha.createText(); + BufferedImage image = defaultKaptcha.createImage(captchaText); + + String base64Code; + try (ByteArrayOutputStream os = new ByteArrayOutputStream()) { + ImageIO.write(image, "jpg", os); + base64Code = Base64Utils.encodeToString(os.toByteArray()); + } catch (Exception e) { + log.error("generateCaptcha error:", e); + throw new BusinessException("生成验证码错误"); + } + + /** + * 返回验证码对象 + * 图片 base64格式 + */ + // uuid 唯一标识 + String uuid = UUID.randomUUID().toString().replace("-", StringConst.EMPTY); + + CaptchaVO captchaVO = new CaptchaVO(); + captchaVO.setCaptchaUuid(uuid); + captchaVO.setCaptchaBase64Image("data:image/png;base64," + base64Code); + captchaVO.setExpireSeconds(EXPIRE_SECOND); + if (!systemEnvironment.isProd()) { + captchaVO.setCaptchaText(captchaText); + } + String redisCaptchaKey = redisService.generateRedisKey(RedisKeyConst.Support.CAPTCHA, uuid); + redisService.set(redisCaptchaKey, captchaText, EXPIRE_SECOND); + return captchaVO; + } + + /** + * 校验图形验证码 + * + * @param captchaForm + * @return + */ + public ResponseDTO checkCaptcha(CaptchaForm captchaForm) { + if (StringUtils.isBlank(captchaForm.getCaptchaUuid()) || StringUtils.isBlank(captchaForm.getCaptchaCode())) { + return ResponseDTO.userErrorParam("请输入正确验证码"); + } + /** + * 1、校验redis里的验证码 + * 2、校验成功后,删除redis + */ + String redisCaptchaKey = redisService.generateRedisKey(RedisKeyConst.Support.CAPTCHA, captchaForm.getCaptchaUuid()); + String redisCaptchaCode = redisService.get(redisCaptchaKey); + if (StringUtils.isBlank(redisCaptchaCode)) { + return ResponseDTO.userErrorParam("验证码已过期,请刷新重试"); + } + if (!Objects.equals(redisCaptchaCode, captchaForm.getCaptchaCode())) { + return ResponseDTO.userErrorParam("验证码错误,请输入正确的验证码"); + } + // 删除已使用的验证码 + redisService.delete(redisCaptchaKey); + return ResponseDTO.ok(); + } + +} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/kaptcha/KaptchaColor.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/captcha/config/CaptchaColor.java similarity index 73% rename from smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/kaptcha/KaptchaColor.java rename to smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/captcha/config/CaptchaColor.java index 4baeb2a2..4dd96c13 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/kaptcha/KaptchaColor.java +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/captcha/config/CaptchaColor.java @@ -1,4 +1,4 @@ -package net.lab1024.smartadmin.common.kaptcha; +package net.lab1024.sa.common.module.support.captcha.config; import com.google.common.collect.Lists; @@ -7,16 +7,15 @@ import java.util.List; import java.util.Random; /** - * [ 验证码颜色 ] + * 验证码颜色 * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/7/6 0006 上午 10:51 - * @since JDK1.8 + * @Author 1024创新实验室-主任: 卓大 + * @Date 2021-09-02 20:21:10 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) */ -public class KaptchaColor { +public class CaptchaColor { public static Color getColor() { diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartKaptchaConfig.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/captcha/config/CaptchaConfig.java similarity index 60% rename from smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartKaptchaConfig.java rename to smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/captcha/config/CaptchaConfig.java index 06dd1c95..6a315072 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartKaptchaConfig.java +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/captcha/config/CaptchaConfig.java @@ -1,7 +1,5 @@ -package net.lab1024.smartadmin.config; +package net.lab1024.sa.common.module.support.captcha.config; -import net.lab1024.smartadmin.common.kaptcha.KaptchaNoise; -import net.lab1024.smartadmin.common.kaptcha.KaptchaWordRenderer; import com.google.code.kaptcha.impl.DefaultKaptcha; import com.google.code.kaptcha.util.Config; import org.springframework.context.annotation.Bean; @@ -10,27 +8,26 @@ import org.springframework.context.annotation.Configuration; import java.util.Properties; /** - * [ 验证码配置 ] + * 验证码配置 * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/7/4 0004 上午 9:40 - * @since JDK1.8 + * @Author 1024创新实验室-主任: 卓大 + * @Date 2021-09-02 20:21:10 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) */ @Configuration -public class SmartKaptchaConfig { +public class CaptchaConfig { @Bean - public DefaultKaptcha getDefaultKaptcha(){ - DefaultKaptcha defaultKaptcha=new DefaultKaptcha(); - Properties properties=new Properties(); + public DefaultKaptcha getDefaultKaptcha() { + DefaultKaptcha defaultKaptcha = new DefaultKaptcha(); + Properties properties = new Properties(); properties.setProperty("kaptcha.border", "no"); properties.setProperty("kaptcha.border.color", "34,114,200"); properties.setProperty("kaptcha.image.width", "125"); properties.setProperty("kaptcha.image.height", "45"); - properties.setProperty("kaptcha.textproducer.char.string", "0123456789"); + properties.setProperty("kaptcha.textproducer.char.string", "123456789"); properties.setProperty("kaptcha.textproducer.char.length", "4"); properties.setProperty("kaptcha.textproducer.font.names", "Arial,Arial Narrow,Serif,Helvetica,Tahoma,Times New Roman,Verdana"); properties.setProperty("kaptcha.textproducer.font.size", "38"); @@ -38,10 +35,10 @@ public class SmartKaptchaConfig { properties.setProperty("kaptcha.background.clear.from", "white"); properties.setProperty("kaptcha.background.clear.to", "white"); - properties.setProperty("kaptcha.word.impl", KaptchaWordRenderer.class.getName()); - properties.setProperty("kaptcha.noise.impl", KaptchaNoise.class.getName()); + properties.setProperty("kaptcha.word.impl", CaptchaWordRenderer.class.getName()); + properties.setProperty("kaptcha.noise.impl", CaptchaNoise.class.getName()); - Config config=new Config(properties); + Config config = new Config(properties); defaultKaptcha.setConfig(config); return defaultKaptcha; } diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/kaptcha/KaptchaNoise.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/captcha/config/CaptchaNoise.java similarity index 62% rename from smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/kaptcha/KaptchaNoise.java rename to smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/captcha/config/CaptchaNoise.java index 22238a6c..36f773d5 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/kaptcha/KaptchaNoise.java +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/captcha/config/CaptchaNoise.java @@ -1,4 +1,4 @@ -package net.lab1024.smartadmin.common.kaptcha; +package net.lab1024.sa.common.module.support.captcha.config; import com.google.code.kaptcha.NoiseProducer; import com.google.code.kaptcha.util.Configurable; @@ -8,17 +8,17 @@ import java.awt.image.BufferedImage; import java.util.Random; /** - * [ 验证码加噪处理 ] + * 验证码加噪处理 * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/7/6 0006 上午 10:47 - * @since JDK1.8 + * @Author 1024创新实验室-主任: 卓大 + * @Date 2021-09-02 20:21:10 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) */ -public class KaptchaNoise extends Configurable implements NoiseProducer { - public KaptchaNoise() { +public class CaptchaNoise extends Configurable implements NoiseProducer { + + public CaptchaNoise() { } @Override @@ -26,16 +26,16 @@ public class KaptchaNoise extends Configurable implements NoiseProducer { int width = image.getWidth(); int height = image.getHeight(); - Graphics2D graph = (Graphics2D)image.getGraphics(); + Graphics2D graph = (Graphics2D) image.getGraphics(); graph.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); graph.setStroke(new BasicStroke(1.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL)); Random random = new Random(); int noiseLineNum = random.nextInt(3); - if(noiseLineNum == 0){ + if (noiseLineNum == 0) { noiseLineNum = 1; } - for (int i = 0; i < noiseLineNum; i++){ - graph.setColor(KaptchaColor.getColor()); + for (int i = 0; i < noiseLineNum; i++) { + graph.setColor(CaptchaColor.getColor()); graph.drawLine(random.nextInt(width), random.nextInt(height), 10 + random.nextInt(20), 10 + random.nextInt(20)); } diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/kaptcha/KaptchaWordRenderer.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/captcha/config/CaptchaWordRenderer.java similarity index 75% rename from smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/kaptcha/KaptchaWordRenderer.java rename to smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/captcha/config/CaptchaWordRenderer.java index 38ff1b4c..23b2278e 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/kaptcha/KaptchaWordRenderer.java +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/captcha/config/CaptchaWordRenderer.java @@ -1,5 +1,6 @@ -package net.lab1024.smartadmin.common.kaptcha; +package net.lab1024.sa.common.module.support.captcha.config; +import com.google.code.kaptcha.text.WordRenderer; import com.google.code.kaptcha.util.Configurable; import java.awt.*; @@ -9,18 +10,17 @@ import java.awt.image.BufferedImage; import java.util.Random; /** - * [ 验证码字体生成 ] + * 验证码字体生成 * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/7/6 0006 上午 9:43 - * @since JDK1.8 + * @Author 1024创新实验室-主任: 卓大 + * @Date 2021-09-02 20:21:10 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) */ -public class KaptchaWordRenderer extends Configurable implements com.google.code.kaptcha.text.WordRenderer { +public class CaptchaWordRenderer extends Configurable implements WordRenderer { - public KaptchaWordRenderer() { + public CaptchaWordRenderer() { } @Override @@ -46,11 +46,11 @@ public class KaptchaWordRenderer extends Configurable implements com.google.code int widthNeeded = 0; int startPosX; - for(startPosX = 0; startPosX < wordChars.length; ++startPosX) { + for (startPosX = 0; startPosX < wordChars.length; ++startPosX) { chosenFonts[startPosX] = fonts[random.nextInt(fonts.length)]; char[] charToDraw = new char[]{wordChars[startPosX]}; GlyphVector gv = chosenFonts[startPosX].createGlyphVector(frc, charToDraw); - charWidths[startPosX] = (int)gv.getVisualBounds().getWidth(); + charWidths[startPosX] = (int) gv.getVisualBounds().getWidth(); if (startPosX > 0) { widthNeeded += 2; } @@ -60,8 +60,8 @@ public class KaptchaWordRenderer extends Configurable implements com.google.code startPosX = (width - widthNeeded) / 2; - for(int i = 0; i < wordChars.length; ++i) { - g2D.setColor(KaptchaColor.getColor()); + for (int i = 0; i < wordChars.length; ++i) { + g2D.setColor(CaptchaColor.getColor()); g2D.setFont(chosenFonts[i].deriveFont(Font.PLAIN)); char[] charToDraw = new char[]{wordChars[i]}; g2D.drawChars(charToDraw, 0, charToDraw.length, startPosX, startPosY); @@ -71,5 +71,4 @@ public class KaptchaWordRenderer extends Configurable implements com.google.code return image; } - } diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/captcha/domain/CaptchaForm.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/captcha/domain/CaptchaForm.java new file mode 100644 index 00000000..5d2d21c7 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/captcha/domain/CaptchaForm.java @@ -0,0 +1,28 @@ +package net.lab1024.sa.common.module.support.captcha.domain; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * 图形验证码 表单 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2021-09-02 20:21:10 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ + +@Data +public class CaptchaForm { + + @ApiModelProperty(value = "验证码") + @NotBlank(message = "验证码不能为空") + private String captchaCode; + + @ApiModelProperty(value = "验证码uuid标识") + @NotBlank(message = "验证码uuid标识不能为空") + private String captchaUuid; +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/captcha/domain/CaptchaVO.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/captcha/domain/CaptchaVO.java new file mode 100644 index 00000000..cee66da6 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/captcha/domain/CaptchaVO.java @@ -0,0 +1,29 @@ +package net.lab1024.sa.common.module.support.captcha.domain; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * 图形验证码 VO + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2021/8/31 20:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class CaptchaVO { + + @ApiModelProperty("验证码唯一标识") + private String captchaUuid; + + @ApiModelProperty("验证码图片内容-生产环境无效") + private String captchaText; + + @ApiModelProperty("验证码Base64图片") + private String captchaBase64Image; + + @ApiModelProperty("过期时间(秒)") + private Long expireSeconds; +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/changelog/constant/ChangeLogTypeEnum.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/changelog/constant/ChangeLogTypeEnum.java new file mode 100644 index 00000000..e57ad480 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/changelog/constant/ChangeLogTypeEnum.java @@ -0,0 +1,28 @@ +package net.lab1024.sa.common.module.support.changelog.constant; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import net.lab1024.sa.common.common.enumeration.BaseEnum; + +/** + * 更新类型:[1:特大版本功能更新;2:功能更新;3:bug修复] + * + * @Author 卓大 + * @Date 2022-09-26T14:53:50 + * @Copyright 1024创新实验室 + */ + +@AllArgsConstructor +@Getter +public enum ChangeLogTypeEnum implements BaseEnum { + + MAJOR_UPDATE(1, "重大更新"), + FUNCTION_UPDATE(2, "功能更新"), + BUG_FIX(3, "Bug修复"), + + ; + + private final Integer value; + + private final String desc; +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/changelog/controller/ChangeLogController.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/changelog/controller/ChangeLogController.java new file mode 100644 index 00000000..775f3bc4 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/changelog/controller/ChangeLogController.java @@ -0,0 +1,38 @@ +package net.lab1024.sa.common.module.support.changelog.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.constant.SwaggerTagConst; +import net.lab1024.sa.common.module.support.changelog.domain.form.ChangeLogQueryForm; +import net.lab1024.sa.common.module.support.changelog.domain.vo.ChangeLogVO; +import net.lab1024.sa.common.module.support.changelog.service.ChangeLogService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +import javax.validation.Valid; + +/** + * 系统更新日志 Controller + * + * @Author 卓大 + * @Date 2022-09-26 14:53:50 + * @Copyright 1024创新实验室 + */ + +@RestController +@Api(tags = SwaggerTagConst.Support.CHANGE_LOG) +public class ChangeLogController { + + @Autowired + private ChangeLogService changeLogService; + + @ApiOperation("分页查询 @author 卓大") + @PostMapping("/changeLog/queryPage") + public ResponseDTO> queryPage(@RequestBody @Valid ChangeLogQueryForm queryForm) { + return ResponseDTO.ok(changeLogService.queryPage(queryForm)); + } +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/changelog/dao/ChangeLogDao.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/changelog/dao/ChangeLogDao.java new file mode 100644 index 00000000..157eeccc --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/changelog/dao/ChangeLogDao.java @@ -0,0 +1,44 @@ +package net.lab1024.sa.common.module.support.changelog.dao; + +import java.util.List; + +import net.lab1024.sa.common.module.support.changelog.domain.form.ChangeLogQueryForm; +import net.lab1024.sa.common.module.support.changelog.domain.vo.ChangeLogVO; +import net.lab1024.sa.common.module.support.changelog.domain.entity.ChangeLogEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Component; + +/** + * 系统更新日志 Dao + * + * @Author 卓大 + * @Date 2022-09-26 14:53:50 + * @Copyright 1024创新实验室 + */ + +@Mapper +@Component +public interface ChangeLogDao extends BaseMapper { + + /** + * 分页 查询 + * + * @param page + * @param queryForm + * @return + */ + List queryPage(Page page, @Param("queryForm") ChangeLogQueryForm queryForm); + + /** + * 根据版本查询 ChangeLog + * + * @param version + * @return + */ + ChangeLogEntity selectByVersion(@Param("version") String version); + + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/changelog/domain/entity/ChangeLogEntity.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/changelog/domain/entity/ChangeLogEntity.java new file mode 100644 index 00000000..5773f412 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/changelog/domain/entity/ChangeLogEntity.java @@ -0,0 +1,68 @@ +package net.lab1024.sa.common.module.support.changelog.domain.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.time.LocalDate; +import java.time.LocalDateTime; +import lombok.Data; + +/** + * 系统更新日志 + * + * @Author 卓大 + * @Date 2022-09-26 14:53:50 + * @Copyright 1024创新实验室 + */ + +@Data +@TableName("t_change_log") +public class ChangeLogEntity { + + /** + * 更新日志id + */ + @TableId(type = IdType.AUTO) + private Long changeLogId; + + /** + * 版本 + */ + private String version; + + /** + * 更新类型:[1:特大版本功能更新;2:功能更新;3:bug修复] + */ + private Integer type; + + /** + * 发布人 + */ + private String publishAuthor; + + /** + * 发布日期 + */ + private LocalDate publicDate; + + /** + * 更新内容 + */ + private String content; + + /** + * 跳转链接 + */ + private String link; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; + +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/changelog/domain/form/ChangeLogAddForm.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/changelog/domain/form/ChangeLogAddForm.java new file mode 100644 index 00000000..ad552338 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/changelog/domain/form/ChangeLogAddForm.java @@ -0,0 +1,46 @@ +package net.lab1024.sa.common.module.support.changelog.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import java.time.LocalDate; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import lombok.Data; +import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum; +import net.lab1024.sa.common.common.validator.enumeration.CheckEnum; +import net.lab1024.sa.common.module.support.changelog.constant.ChangeLogTypeEnum; + +/** + * 系统更新日志 新建表单 + * + * @Author 卓大 + * @Date 2022-09-26 14:53:50 + * @Copyright 1024创新实验室 + */ + +@Data +public class ChangeLogAddForm { + + @ApiModelProperty(value = "版本", required = true) + @NotBlank(message = "版本 不能为空") + private String version; + + @ApiModelPropertyEnum(value = ChangeLogTypeEnum.class, desc = "更新类型:[1:特大版本功能更新;2:功能更新;3:bug修复]") + @CheckEnum(value = ChangeLogTypeEnum.class, message = "更新类型:[1:特大版本功能更新;2:功能更新;3:bug修复] 错误", required = true) + private Integer type; + + @ApiModelProperty(value = "发布人", required = true) + @NotBlank(message = "发布人 不能为空") + private String publishAuthor; + + @ApiModelProperty(value = "发布日期", required = true) + @NotNull(message = "发布日期 不能为空") + private LocalDate publicDate; + + @ApiModelProperty(value = "更新内容", required = true) + @NotBlank(message = "更新内容 不能为空") + private String content; + + @ApiModelProperty(value = "跳转链接") + private String link; + +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/changelog/domain/form/ChangeLogQueryForm.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/changelog/domain/form/ChangeLogQueryForm.java new file mode 100644 index 00000000..393c4c69 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/changelog/domain/form/ChangeLogQueryForm.java @@ -0,0 +1,42 @@ +package net.lab1024.sa.common.module.support.changelog.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.domain.PageParam; +import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum; +import net.lab1024.sa.common.common.validator.enumeration.CheckEnum; +import net.lab1024.sa.common.module.support.changelog.constant.ChangeLogTypeEnum; + +import java.time.LocalDate; + +/** + * 系统更新日志 查询 + * + * @Author 卓大 + * @Date 2022-09-26 14:53:50 + * @Copyright 1024创新实验室 + */ + +@Data +public class ChangeLogQueryForm extends PageParam{ + + @ApiModelPropertyEnum(value = ChangeLogTypeEnum.class, desc = "更新类型:[1:特大版本功能更新;2:功能更新;3:bug修复]") + @CheckEnum(value = ChangeLogTypeEnum.class, message = "更新类型:[1:特大版本功能更新;2:功能更新;3:bug修复] 错误") + private Integer type; + + @ApiModelProperty(value = "关键字") + private String keyword; + + @ApiModelProperty(value = "发布日期") + private LocalDate publicDateBegin; + + @ApiModelProperty(value = "发布日期") + private LocalDate publicDateEnd; + + @ApiModelProperty(value = "创建时间") + private LocalDate createTime; + + @ApiModelProperty(value = "跳转链接") + private String link; + +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/changelog/domain/form/ChangeLogUpdateForm.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/changelog/domain/form/ChangeLogUpdateForm.java new file mode 100644 index 00000000..1a3c4363 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/changelog/domain/form/ChangeLogUpdateForm.java @@ -0,0 +1,50 @@ +package net.lab1024.sa.common.module.support.changelog.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import java.time.LocalDate; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import lombok.Data; +import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum; +import net.lab1024.sa.common.common.validator.enumeration.CheckEnum; +import net.lab1024.sa.common.module.support.changelog.constant.ChangeLogTypeEnum; + +/** + * 系统更新日志 更新表单 + * + * @Author 卓大 + * @Date 2022-09-26 14:53:50 + * @Copyright 1024创新实验室 + */ + +@Data +public class ChangeLogUpdateForm { + + @ApiModelProperty(value = "更新日志id", required = true) + @NotNull(message = "更新日志id 不能为空") + private Long changeLogId; + + @ApiModelProperty(value = "版本", required = true) + @NotBlank(message = "版本 不能为空") + private String version; + + @ApiModelPropertyEnum(value = ChangeLogTypeEnum.class, desc = "更新类型:[1:特大版本功能更新;2:功能更新;3:bug修复]") + @CheckEnum(value = ChangeLogTypeEnum.class, message = "更新类型:[1:特大版本功能更新;2:功能更新;3:bug修复] 错误", required = true) + private Integer type; + + @ApiModelProperty(value = "发布人", required = true) + @NotBlank(message = "发布人 不能为空") + private String publishAuthor; + + @ApiModelProperty(value = "发布日期", required = true) + @NotNull(message = "发布日期 不能为空") + private LocalDate publicDate; + + @ApiModelProperty(value = "更新内容", required = true) + @NotBlank(message = "更新内容 不能为空") + private String content; + + @ApiModelProperty(value = "跳转链接") + private String link; + +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/changelog/domain/vo/ChangeLogVO.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/changelog/domain/vo/ChangeLogVO.java new file mode 100644 index 00000000..cf147c7c --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/changelog/domain/vo/ChangeLogVO.java @@ -0,0 +1,49 @@ +package net.lab1024.sa.common.module.support.changelog.domain.vo; + +import io.swagger.annotations.ApiModelProperty; + +import java.time.LocalDate; +import java.time.LocalDateTime; + +import lombok.Data; +import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum; +import net.lab1024.sa.common.module.support.changelog.constant.ChangeLogTypeEnum; + +/** + * 系统更新日志 列表VO + * + * @Author 卓大 + * @Date 2022-09-26 14:53:50 + * @Copyright 1024创新实验室 + */ + +@Data +public class ChangeLogVO { + + private Long changeLogId; + + @ApiModelProperty(value = "版本") + private String version; + + @ApiModelPropertyEnum(value = ChangeLogTypeEnum.class, desc = "更新类型:[1:特大版本功能更新;2:功能更新;3:bug修复]") + private Integer type; + + @ApiModelProperty(value = "发布人") + private String publishAuthor; + + @ApiModelProperty(value = "发布日期") + private LocalDate publicDate; + + @ApiModelProperty(value = "更新内容") + private String content; + + @ApiModelProperty(value = "跳转链接") + private String link; + + @ApiModelProperty(value = "创建时间") + private LocalDateTime createTime; + + @ApiModelProperty(value = "更新时间") + private LocalDateTime updateTime; + +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/changelog/manager/ChangeLogManager.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/changelog/manager/ChangeLogManager.java new file mode 100644 index 00000000..ee90a6b2 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/changelog/manager/ChangeLogManager.java @@ -0,0 +1,20 @@ +package net.lab1024.sa.common.module.support.changelog.manager; + +import net.lab1024.sa.common.module.support.changelog.dao.ChangeLogDao; +import net.lab1024.sa.common.module.support.changelog.domain.entity.ChangeLogEntity; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * 系统更新日志 Manager + * + * @Author 卓大 + * @Date 2022-09-26 14:53:50 + * @Copyright 1024创新实验室 + */ +@Service +public class ChangeLogManager extends ServiceImpl { + + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/changelog/service/ChangeLogService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/changelog/service/ChangeLogService.java new file mode 100644 index 00000000..a8d95e2f --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/changelog/service/ChangeLogService.java @@ -0,0 +1,103 @@ +package net.lab1024.sa.common.module.support.changelog.service; + +import java.util.List; + +import net.lab1024.sa.common.module.support.changelog.dao.ChangeLogDao; +import net.lab1024.sa.common.module.support.changelog.domain.entity.ChangeLogEntity; +import net.lab1024.sa.common.module.support.changelog.domain.form.ChangeLogAddForm; +import net.lab1024.sa.common.module.support.changelog.domain.form.ChangeLogQueryForm; +import net.lab1024.sa.common.module.support.changelog.domain.form.ChangeLogUpdateForm; +import net.lab1024.sa.common.module.support.changelog.domain.vo.ChangeLogVO; +import net.lab1024.sa.common.common.util.SmartBeanUtil; +import net.lab1024.sa.common.common.util.SmartPageUtil; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.domain.PageResult; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * 系统更新日志 Service + * + * @Author 卓大 + * @Date 2022-09-26 14:53:50 + * @Copyright 1024创新实验室 + */ + +@Service +public class ChangeLogService { + + @Autowired + private ChangeLogDao changeLogDao; + + /** + * 分页查询 + * + * @param queryForm + * @return + */ + public PageResult queryPage(ChangeLogQueryForm queryForm) { + Page page = SmartPageUtil.convert2PageQuery(queryForm); + List list = changeLogDao.queryPage(page, queryForm); + PageResult pageResult = SmartPageUtil.convert2PageResult(page, list); + return pageResult; + } + + /** + * 添加 + */ + public synchronized ResponseDTO add(ChangeLogAddForm addForm) { + ChangeLogEntity existVersion = changeLogDao.selectByVersion(addForm.getVersion()); + if (existVersion != null) { + return ResponseDTO.userErrorParam("此版本已经存在"); + } + + ChangeLogEntity changeLogEntity = SmartBeanUtil.copy(addForm, ChangeLogEntity.class); + changeLogDao.insert(changeLogEntity); + return ResponseDTO.ok(); + } + + /** + * 更新 + * + * @param updateForm + * @return + */ + public synchronized ResponseDTO update(ChangeLogUpdateForm updateForm) { + ChangeLogEntity existVersion = changeLogDao.selectByVersion(updateForm.getVersion()); + if (existVersion != null && !updateForm.getChangeLogId().equals(existVersion.getChangeLogId())) { + return ResponseDTO.userErrorParam("此版本已经存在"); + } + ChangeLogEntity changeLogEntity = SmartBeanUtil.copy(updateForm, ChangeLogEntity.class); + changeLogDao.updateById(changeLogEntity); + return ResponseDTO.ok(); + } + + /** + * 批量删除 + * + * @param idList + * @return + */ + public synchronized ResponseDTO batchDelete(List idList) { + if (CollectionUtils.isEmpty(idList)) { + return ResponseDTO.ok(); + } + + changeLogDao.deleteBatchIds(idList); + return ResponseDTO.ok(); + } + + /** + * 单个删除 + */ + public synchronized ResponseDTO delete(Long changeLogId) { + if (null == changeLogId) { + return ResponseDTO.ok(); + } + + changeLogDao.deleteById(changeLogId); + return ResponseDTO.ok(); + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/constant/CodeDeleteEnum.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/constant/CodeDeleteEnum.java new file mode 100644 index 00000000..c5308601 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/constant/CodeDeleteEnum.java @@ -0,0 +1,38 @@ +package net.lab1024.sa.common.module.support.codegenerator.constant; + +import net.lab1024.sa.common.common.enumeration.BaseEnum; + +/** + * 删除类型 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-06-30 22:15:38 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public enum CodeDeleteEnum implements BaseEnum { + + SINGLE("Single", "单个删除"), + BATCH("Batch", "批量删除"), + SINGLE_AND_BATCH("SingleAndBatch", "单个和批量删除"); + + private String value; + + private String desc; + + CodeDeleteEnum(String value, String desc) { + this.value = value; + this.desc = desc; + } + + @Override + public Object getValue() { + return value; + } + + @Override + public String getDesc() { + return desc; + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/constant/CodeFrontComponentEnum.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/constant/CodeFrontComponentEnum.java new file mode 100644 index 00000000..ee94ab74 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/constant/CodeFrontComponentEnum.java @@ -0,0 +1,52 @@ +package net.lab1024.sa.common.module.support.codegenerator.constant; + +import net.lab1024.sa.common.common.enumeration.BaseEnum; + +/** + * 前端组件类型 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-06-30 20:15:38 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public enum CodeFrontComponentEnum implements BaseEnum { + + INPUT("Input", "输入框"), + + INPUT_NUMBER("InputNumber", "数字输入框"), + + TEXTAREA("Textarea", " 文本"), + + BOOLEAN_SELECT("BooleanSelect", "布尔下拉框"), + + ENUM_SELECT("SmartEnumSelect", "枚举下拉"), + + DICT_SELECT("DictSelect", "字典下拉"), + + DATE("Date", "日期选择"), + + DATE_TIME("DateTime", "时间选择"), + + FILE_UPLOAD("FileUpload", "文件上传"); + + private String value; + + private String desc; + + CodeFrontComponentEnum(String value, String desc) { + this.value = value; + this.desc = desc; + } + + @Override + public Object getValue() { + return value; + } + + @Override + public String getDesc() { + return desc; + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/constant/CodeGeneratorConstant.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/constant/CodeGeneratorConstant.java new file mode 100644 index 00000000..dccdf337 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/constant/CodeGeneratorConstant.java @@ -0,0 +1,30 @@ +package net.lab1024.sa.common.module.support.codegenerator.constant; + +/** + * 常量 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022-06-30 22:15:38 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public class CodeGeneratorConstant { + + /** + * 主键 + */ + public final static String PRIMARY_KEY = "PRI"; + + /** + * 自增 + */ + public final static String AUTO_INCREMENT = "auto_increment"; + + /** + * 默认逻辑删除字段名称 + */ + public static String DELETED_FLAG = "deleted_flag"; + + +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/constant/CodeGeneratorPageTypeEnum.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/constant/CodeGeneratorPageTypeEnum.java new file mode 100644 index 00000000..4a33e00a --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/constant/CodeGeneratorPageTypeEnum.java @@ -0,0 +1,38 @@ +package net.lab1024.sa.common.module.support.codegenerator.constant; + +import net.lab1024.sa.common.common.enumeration.BaseEnum; + +/** + * 页面类型 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-06-29 19:11:22 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public enum CodeGeneratorPageTypeEnum implements BaseEnum { + + MODAL("modal", "弹窗"), + DRAWER("drawer", "抽屉"), + PAGE("page", "新页面"); + + private String value; + + private String desc; + + CodeGeneratorPageTypeEnum(String value, String desc) { + this.value = value; + this.desc = desc; + } + + @Override + public Object getValue() { + return value; + } + + @Override + public String getDesc() { + return desc; + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/constant/CodeQueryFieldQueryTypeEnum.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/constant/CodeQueryFieldQueryTypeEnum.java new file mode 100644 index 00000000..e68d811d --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/constant/CodeQueryFieldQueryTypeEnum.java @@ -0,0 +1,43 @@ +package net.lab1024.sa.common.module.support.codegenerator.constant; + +import net.lab1024.sa.common.common.enumeration.BaseEnum; + +/** + * 查询条件类型 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-06-29 20:23:46 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public enum CodeQueryFieldQueryTypeEnum implements BaseEnum { + + LIKE("Like", "模糊查询"), + EQUAL("Equal", "等于"), + DATE_RANGE("DateRange", "日期范围"), + DATE("Date", "指定日期"), + ENUM("Enum", "枚举"), + + DICT("Dict", "字典"), + ; + + private String value; + + private String desc; + + CodeQueryFieldQueryTypeEnum(String value, String desc) { + this.value = value; + this.desc = desc; + } + + @Override + public Object getValue() { + return value; + } + + @Override + public String getDesc() { + return desc; + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/controller/CodeGeneratorController.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/controller/CodeGeneratorController.java new file mode 100644 index 00000000..93cf4551 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/controller/CodeGeneratorController.java @@ -0,0 +1,106 @@ +package net.lab1024.sa.common.module.support.codegenerator.controller; + +import com.alibaba.fastjson.JSON; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import net.lab1024.sa.common.common.controller.SupportBaseController; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.constant.SwaggerTagConst; +import net.lab1024.sa.common.module.support.codegenerator.domain.form.CodeGeneratorConfigForm; +import net.lab1024.sa.common.module.support.codegenerator.domain.form.CodeGeneratorPreviewForm; +import net.lab1024.sa.common.module.support.codegenerator.domain.form.TableQueryForm; +import net.lab1024.sa.common.module.support.codegenerator.domain.vo.TableColumnVO; +import net.lab1024.sa.common.module.support.codegenerator.domain.vo.TableConfigVO; +import net.lab1024.sa.common.module.support.codegenerator.domain.vo.TableVO; +import net.lab1024.sa.common.module.support.codegenerator.service.CodeGeneratorService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + +/** + * 代码生成 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-06-29 20:23:46 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Api(tags = SwaggerTagConst.Support.CODE_GENERATOR) +@Controller +public class CodeGeneratorController extends SupportBaseController { + + @Autowired + private CodeGeneratorService codeGeneratorService; + + // ------------------- 查询 ------------------- + @ApiOperation("获取表的列 @author 卓大") + @GetMapping("/codeGenerator/table/getTableColumns/{table}") + @ResponseBody + public ResponseDTO> getTableColumns(@PathVariable String table) { + return ResponseDTO.ok(codeGeneratorService.getTableColumns(table)); + } + + @ApiOperation("查询数据库的表 @author 卓大") + @PostMapping("/codeGenerator/table/queryTableList") + @ResponseBody + public ResponseDTO> queryTableList(@RequestBody @Valid TableQueryForm tableQueryForm) { + return ResponseDTO.ok(codeGeneratorService.queryTableList(tableQueryForm)); + } + + // ------------------- 配置 ------------------- + + @ApiOperation("获取表的配置信息 @author 卓大") + @GetMapping("/codeGenerator/table/getConfig/{table}") + @ResponseBody + public ResponseDTO getTableConfig(@PathVariable String table) { + return ResponseDTO.ok(codeGeneratorService.getTableConfig(table)); + } + + @ApiOperation("更新配置信息 @author 卓大") + @PostMapping("/codeGenerator/table/updateConfig") + @ResponseBody + public ResponseDTO updateConfig(@RequestBody @Valid CodeGeneratorConfigForm form) { + return codeGeneratorService.updateConfig(form); + } + + // ------------------- 生成 ------------------- + + @ApiOperation("代码预览 @author 卓大") + @PostMapping("/codeGenerator/code/preview") + @ResponseBody + public ResponseDTO preview(@RequestBody @Valid CodeGeneratorPreviewForm form) { + return codeGeneratorService.preview(form); + } + + @ApiOperation("代码下载 @author 卓大") + @GetMapping(value = "/codeGenerator/code/download/{tableName}", produces = "application/octet-stream") + public ResponseEntity download(@PathVariable String tableName) { + + ResponseDTO download = codeGeneratorService.download(tableName); + + if (download.getOk()) { + HttpHeaders heads = new HttpHeaders(); + heads.add(HttpHeaders.CONTENT_TYPE, "application/octet-stream; charset=UTF-8"); + heads.add(HttpHeaders.CONTENT_LENGTH, "" + download.getData().length); + heads.add(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + tableName + "-code.zip"); + ResponseEntity responseEntity = new ResponseEntity<>(download.getData(), heads, HttpStatus.OK); + return responseEntity; + } else { + byte[] data = JSON.toJSONString(download).getBytes(); + HttpHeaders heads = new HttpHeaders(); + heads.add(HttpHeaders.CONTENT_TYPE, "application/json; charset=UTF-8"); + heads.add(HttpHeaders.CONTENT_LENGTH, "" + data.length); + ResponseEntity responseEntity = new ResponseEntity<>(data, heads, HttpStatus.OK); + return responseEntity; + } + } + +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/dao/CodeGeneratorConfigDao.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/dao/CodeGeneratorConfigDao.java new file mode 100644 index 00000000..cc27319e --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/dao/CodeGeneratorConfigDao.java @@ -0,0 +1,20 @@ +package net.lab1024.sa.common.module.support.codegenerator.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import net.lab1024.sa.common.module.support.codegenerator.domain.entity.CodeGeneratorConfigEntity; +import org.apache.ibatis.annotations.Mapper; +import org.springframework.stereotype.Component; + +/** + * 表的 代码生成配置 Dao + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-09-23 20:15:38 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Mapper +@Component +public interface CodeGeneratorConfigDao extends BaseMapper { + +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/dao/CodeGeneratorDao.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/dao/CodeGeneratorDao.java new file mode 100644 index 00000000..f1407d3a --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/dao/CodeGeneratorDao.java @@ -0,0 +1,45 @@ +package net.lab1024.sa.common.module.support.codegenerator.dao; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import net.lab1024.sa.common.module.support.codegenerator.domain.form.TableQueryForm; +import net.lab1024.sa.common.module.support.codegenerator.domain.vo.TableColumnVO; +import net.lab1024.sa.common.module.support.codegenerator.domain.vo.TableVO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @Author 1024创新实验室: 罗伊 + * @Date 2022-06-30 22:15:38 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Mapper +@Component +public interface CodeGeneratorDao { + + /** + * 分页查询表 + */ + List queryTableList(Page page, @Param("queryForm") TableQueryForm queryForm); + + /** + * 查询表是否存在 + * + * @param tableName + * @return + */ + long countByTableName(@Param("tableName") String tableName); + + + /** + * 查询表列信息 + * + * @param tableName + * @return + */ + List selectTableColumn(@Param("tableName") String tableName); +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/entity/CodeGeneratorConfigEntity.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/entity/CodeGeneratorConfigEntity.java new file mode 100644 index 00000000..c05bebd9 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/entity/CodeGeneratorConfigEntity.java @@ -0,0 +1,74 @@ +package net.lab1024.sa.common.module.support.codegenerator.domain.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * 代码生成-配置 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022/6/23 21:59:22 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +@TableName("t_code_generator_config") +public class CodeGeneratorConfigEntity { + + /** + * 表名 + */ + @TableId(type = IdType.NONE) + private String tableName; + + /** + * 基础命名信息 + */ + private String basic; + + /** + * 字段列表 + */ + private String fields; + + /** + * 增加、修改 信息 + */ + private String insertAndUpdate; + + /** + * 删除 信息 + */ + private String deleteInfo; + + /** + * 查询字段 + */ + private String queryFields; + + /** + * 列表字段 + */ + private String tableFields; + + /** + * 详情 + */ + private String detail; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/form/CodeGeneratorConfigForm.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/form/CodeGeneratorConfigForm.java new file mode 100644 index 00000000..4a545f2d --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/form/CodeGeneratorConfigForm.java @@ -0,0 +1,64 @@ +package net.lab1024.sa.common.module.support.codegenerator.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import net.lab1024.sa.common.module.support.codegenerator.domain.model.*; + +import javax.validation.Valid; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.util.List; + +/** + * 代码生成 配置信息表单 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-06-29 20:23:46 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ + +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class CodeGeneratorConfigForm { + + @NotBlank(message = "表名 不能为空") + @ApiModelProperty("表名") + private String tableName; + + + @Valid + @NotNull(message = "基础信息不能为空") + @ApiModelProperty("基础信息") + private CodeBasic basic; + + @Valid + @NotNull(message = "字段信息不能为空") + @ApiModelProperty("字段信息") + private List fields; + + @Valid + @NotNull(message = "增加、修改 信息 不能为空") + @ApiModelProperty("增加、修改 信息") + private CodeInsertAndUpdate insertAndUpdate; + + @Valid + @NotNull(message = "删除 信息 不能为空") + @ApiModelProperty("删除 信息") + private CodeDelete deleteInfo; + + @Valid + @ApiModelProperty("查询字段") + private List queryFields; + + @Valid + @ApiModelProperty("列表字段") + private List tableFields; + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/form/CodeGeneratorPreviewForm.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/form/CodeGeneratorPreviewForm.java new file mode 100644 index 00000000..37d65468 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/form/CodeGeneratorPreviewForm.java @@ -0,0 +1,28 @@ +package net.lab1024.sa.common.module.support.codegenerator.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * 代码生成 预览 表单 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022/6/23 23:20:46 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +@Data +public class CodeGeneratorPreviewForm { + + @NotBlank(message = "模板文件 不能为空") + @ApiModelProperty("模板文件") + private String templateFile; + + @NotBlank(message = "表名 不能为空") + @ApiModelProperty("表名") + private String tableName; + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/form/TableQueryForm.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/form/TableQueryForm.java new file mode 100644 index 00000000..3ffd4359 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/form/TableQueryForm.java @@ -0,0 +1,23 @@ +package net.lab1024.sa.common.module.support.codegenerator.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.domain.PageParam; + + +/** + * 查询表数据 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-06-30 22:15:38 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class TableQueryForm extends PageParam { + + @ApiModelProperty("表名关键字") + private String tableNameKeywords; + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/model/CodeBasic.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/model/CodeBasic.java new file mode 100644 index 00000000..35f96fd0 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/model/CodeBasic.java @@ -0,0 +1,55 @@ +package net.lab1024.sa.common.module.support.codegenerator.domain.model; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.time.LocalDateTime; + +/** + * 代码生成 基础数据 模型 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-06-30 22:15:38 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ + +@Data +public class CodeBasic { + + @ApiModelProperty("业务名称") + @NotBlank(message = "1.基础命名 基础命名 不能为空") + private String moduleName; + + @ApiModelProperty("java包名") + @NotBlank(message = "1.基础命名 java包名 不能为空") + private String javaPackageName; + + @ApiModelProperty("注释") + @NotBlank(message = "1.基础命名 注释 不能为空") + private String description; + + @ApiModelProperty("前端作者") + @NotBlank(message = "1.基础命名 前端作者 不能为空") + private String frontAuthor; + + @ApiModelProperty("前端时间") + @NotNull(message = "1.基础命名 前端时间 不能为空") + private LocalDateTime frontDate; + + @ApiModelProperty("后端作者") + @NotBlank(message = "1.基础命名 后端作者 不能为空") + private String backendAuthor; + + @ApiModelProperty("后端时间") + @NotNull(message = "1.基础命名 后端时间 不能为空") + private LocalDateTime backendDate; + + @ApiModelProperty("版权信息") + @NotNull(message = "1.基础命名 版权信息 不能为空") + private String copyright; + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/model/CodeDelete.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/model/CodeDelete.java new file mode 100644 index 00000000..d334abfa --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/model/CodeDelete.java @@ -0,0 +1,40 @@ +package net.lab1024.sa.common.module.support.codegenerator.domain.model; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum; +import net.lab1024.sa.common.common.validator.enumeration.CheckEnum; +import net.lab1024.sa.common.module.support.codegenerator.constant.CodeDeleteEnum; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +/** + * 代码生成 删除 模型 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-06-30 22:15:38 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ + +@Data +public class CodeDelete { + + @ApiModelProperty("是否支持删除 ") + @NotNull(message = "4.删除 是否支持删除 不能为空") + private Boolean isSupportDelete; + + @ApiModelProperty("是否为物理删除") + @NotNull(message = "4.删除 是否为物理删除 不能为空") + private Boolean isPhysicallyDeleted; + + @ApiModelProperty("删除类型") + @NotBlank(message = "4.删除 删除类型 不能为空") + @ApiModelPropertyEnum(CodeDeleteEnum.class) + @CheckEnum(value = CodeDeleteEnum.class, message = "删除 删除类型 枚举值错误") + private String deleteEnum; + + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/model/CodeField.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/model/CodeField.java new file mode 100644 index 00000000..00cce05e --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/model/CodeField.java @@ -0,0 +1,59 @@ +package net.lab1024.sa.common.module.support.codegenerator.domain.model; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +/** + * 代码生成 基础字段 模型 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-06-30 22:15:38 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ + +@Data +public class CodeField { + + @ApiModelProperty("列") + @NotBlank(message = " 2.字段列表 列名 不能为空") + private String columnName; + + @ApiModelProperty("列备注") + private String columnComment; + + @ApiModelProperty("字段名词") + @NotBlank(message = "2.字段列表 字段名词 不能为空") + private String label; + + @ApiModelProperty("字段命名") + @NotBlank(message = "2.字段列表 字段命名 不能为空") + private String fieldName; + + @ApiModelProperty("java类型") + @NotBlank(message = "2.字段列表 java类型 不能为空") + private String javaType; + + @ApiModelProperty("js类型") + @NotBlank(message = "2.字段列表 js类型 不能为空") + private String jsType; + + @ApiModelProperty("字典key") + private String dict; + + @ApiModelProperty("枚举名称") + private String enumName; + + @ApiModelProperty("主键") + @NotNull(message = "2.字段列表 主键 不能为空") + private Boolean primaryKeyFlag; + + @ApiModelProperty("自增") + @NotNull(message = "2.字段列表 自增 不能为空") + private Boolean autoIncreaseFlag; + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/model/CodeInsertAndUpdate.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/model/CodeInsertAndUpdate.java new file mode 100644 index 00000000..54df13b5 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/model/CodeInsertAndUpdate.java @@ -0,0 +1,42 @@ +package net.lab1024.sa.common.module.support.codegenerator.domain.model; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum; +import net.lab1024.sa.common.common.validator.enumeration.CheckEnum; +import net.lab1024.sa.common.module.support.codegenerator.constant.CodeGeneratorPageTypeEnum; + +import javax.validation.constraints.NotNull; +import java.util.List; + +/** + * 代码生成 增加、修改 模型 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-06-30 22:15:38 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ + +@Data +public class CodeInsertAndUpdate { + + @NotNull(message = "3.增加、修改 是否支持增加、修改 不能为空") + private Boolean isSupportInsertAndUpdate; + + @ApiModelPropertyEnum(CodeGeneratorPageTypeEnum.class) + @CheckEnum(value = CodeGeneratorPageTypeEnum.class, message = "3.增加、修改 增加、修改 页面类型 枚举值错误") + private String pageType; + + @ApiModelProperty("宽度") + private String width; + + @NotNull(message = "3.增加、修改 每行字段数量 不能为空") + @ApiModelProperty("每行字段数量") + private Integer countPerLine; + + @ApiModelProperty("字段列表") + private List fieldList; + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/model/CodeInsertAndUpdateField.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/model/CodeInsertAndUpdateField.java new file mode 100644 index 00000000..43c062ca --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/model/CodeInsertAndUpdateField.java @@ -0,0 +1,46 @@ +package net.lab1024.sa.common.module.support.codegenerator.domain.model; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum; +import net.lab1024.sa.common.common.validator.enumeration.CheckEnum; +import net.lab1024.sa.common.module.support.codegenerator.constant.CodeFrontComponentEnum; +import net.lab1024.sa.common.module.support.codegenerator.constant.CodeGeneratorPageTypeEnum; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +/** + * 代码生成 增加、修改的字段 模型 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-06-30 22:15:38 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ + +@Data +public class CodeInsertAndUpdateField { + + @NotBlank(message = "3.增加、修改 列名 不能为空") + @ApiModelProperty("列名") + private String columnName; + + @NotNull(message = "3.增加、修改 必须 不能为空") + @ApiModelProperty("必须") + private Boolean requiredFlag; + + @NotNull(message = "3.增加、修改 插入标识 不能为空") + @ApiModelProperty("插入标识") + private Boolean insertFlag; + + @NotNull(message = "3.增加、修改 更新标识 不能为空") + @ApiModelProperty("更新标识") + private Boolean updateFlag; + + @ApiModelPropertyEnum(value = CodeGeneratorPageTypeEnum.class) + @CheckEnum(value = CodeFrontComponentEnum.class, message = "3.增加、修改 增加、修改 组件类型 枚举值错误", required = true) + private String frontComponent; + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/model/CodeQueryField.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/model/CodeQueryField.java new file mode 100644 index 00000000..614b7fc7 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/model/CodeQueryField.java @@ -0,0 +1,47 @@ +package net.lab1024.sa.common.module.support.codegenerator.domain.model; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum; +import net.lab1024.sa.common.common.validator.enumeration.CheckEnum; +import net.lab1024.sa.common.module.support.codegenerator.constant.CodeQueryFieldQueryTypeEnum; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import java.util.List; + +/** + * 代码生成 查询条件 模型 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-06-30 22:15:38 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ + +@Data +public class CodeQueryField { + + @NotBlank(message = "5、查询条件 条件名称 不能为空") + @ApiModelProperty("条件名称") + private String label; + + @NotBlank(message = "5、查询条件 字段名 不能为空") + @ApiModelProperty("字段名") + private String fieldName; + + @ApiModelPropertyEnum(CodeQueryFieldQueryTypeEnum.class) + @CheckEnum(value = CodeQueryFieldQueryTypeEnum.class, message = "5、查询条件 查询条件 查询类型 枚举值错误") + private String queryTypeEnum; + + @NotEmpty(message = "5、查询条件 列 不能为空") + @ApiModelProperty("列") + private List columnNameList; + + @NotBlank(message = "5、查询条件 宽度 不能为空") + @ApiModelProperty("宽度") + private String width; + + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/model/CodeTableField.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/model/CodeTableField.java new file mode 100644 index 00000000..ac126954 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/model/CodeTableField.java @@ -0,0 +1,46 @@ +package net.lab1024.sa.common.module.support.codegenerator.domain.model; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +/** + * 代码生成 列表表格 模型 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-06-30 22:15:38 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ + +@Data +public class CodeTableField { + + @NotBlank(message = "6、列表 列名 不能为空") + @ApiModelProperty("列名") + private String columnName; + + @NotBlank(message = "6、列表 字段名词 不能为空") + @ApiModelProperty("字段名词") + private String label; + + @NotBlank(message = "6、列表 字段命名 不能为空") + @ApiModelProperty("字段命名") + private String fieldName; + + @NotNull(message = "6、列表 列表显示 不能为空") + @ApiModelProperty("列表显示") + private Boolean showFlag; + + @ApiModelProperty("宽度") + private Integer width; + + @NotNull(message = "6、列表 自动省略标识 不能为空") + @ApiModelProperty("自动省略标识") + private Boolean ellipsisFlag; + + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/vo/TableColumnVO.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/vo/TableColumnVO.java new file mode 100644 index 00000000..251bfca0 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/vo/TableColumnVO.java @@ -0,0 +1,44 @@ + +package net.lab1024.sa.common.module.support.codegenerator.domain.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * 列 + * + * @Author 1024创新实验室-主任:卓大 + * @Date 2022/9/21 21:07:58 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ + +@Data +public class TableColumnVO { + + @ApiModelProperty("列名") + private String columnName; + + @ApiModelProperty("列描述") + private String columnComment; + + @ApiModelProperty("columnKey") + private String columnKey; + + @ApiModelProperty("extra") + private String extra; + + @ApiModelProperty("是否为空") + private String isNullable; + + @ApiModelProperty("数据类型varchar") + private String dataType; + + @ApiModelProperty("列类型varchar(50)") + private String columnType; + + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/vo/TableConfigVO.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/vo/TableConfigVO.java new file mode 100644 index 00000000..33df9523 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/vo/TableConfigVO.java @@ -0,0 +1,40 @@ + +package net.lab1024.sa.common.module.support.codegenerator.domain.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.module.support.codegenerator.domain.model.*; + +import java.util.List; + +/** + * 表的配置信息 + * + * @Author 1024创新实验室-主任:卓大 + * @Date 2022/9/21 21:07:58 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ + +@Data +public class TableConfigVO { + + @ApiModelProperty("基础命名信息") + private CodeBasic basic; + + @ApiModelProperty("字段列") + private List fields; + + @ApiModelProperty("增加、修改 信息") + private CodeInsertAndUpdate insertAndUpdate; + + @ApiModelProperty("删除 信息") + private CodeDelete deleteInfo; + + @ApiModelProperty("查询字段") + private List queryFields; + + @ApiModelProperty("列表字段") + private List tableFields; +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/vo/TableVO.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/vo/TableVO.java new file mode 100644 index 00000000..286a2a33 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/domain/vo/TableVO.java @@ -0,0 +1,37 @@ + +package net.lab1024.sa.common.module.support.codegenerator.domain.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * 表信息 + * + * @Author 1024创新实验室-主任:卓大 + * @Date 2022/9/21 18:07:58 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ + +@Data +public class TableVO { + + @ApiModelProperty("表名") + private String tableName; + + @ApiModelProperty("表备注") + private String tableComment; + + @ApiModelProperty("创建时间") + private LocalDateTime createTime; + + @ApiModelProperty("更新时间") + private LocalDateTime updateTime; + + @ApiModelProperty("配置时间") + private LocalDateTime configTime; + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/CodeGeneratorService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/CodeGeneratorService.java new file mode 100644 index 00000000..f7b9aae5 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/CodeGeneratorService.java @@ -0,0 +1,223 @@ +package net.lab1024.sa.common.module.support.codegenerator.service; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.extern.slf4j.Slf4j; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.util.SmartPageUtil; +import net.lab1024.sa.common.common.util.SmartStringUtil; +import net.lab1024.sa.common.module.support.codegenerator.constant.CodeGeneratorConstant; +import net.lab1024.sa.common.module.support.codegenerator.dao.CodeGeneratorConfigDao; +import net.lab1024.sa.common.module.support.codegenerator.dao.CodeGeneratorDao; +import net.lab1024.sa.common.module.support.codegenerator.domain.entity.CodeGeneratorConfigEntity; +import net.lab1024.sa.common.module.support.codegenerator.domain.form.CodeGeneratorConfigForm; +import net.lab1024.sa.common.module.support.codegenerator.domain.form.CodeGeneratorPreviewForm; +import net.lab1024.sa.common.module.support.codegenerator.domain.form.TableQueryForm; +import net.lab1024.sa.common.module.support.codegenerator.domain.model.*; +import net.lab1024.sa.common.module.support.codegenerator.domain.vo.TableColumnVO; +import net.lab1024.sa.common.module.support.codegenerator.domain.vo.TableConfigVO; +import net.lab1024.sa.common.module.support.codegenerator.domain.vo.TableVO; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.io.ByteArrayOutputStream; +import java.util.List; +import java.util.Optional; + +/** + * 代码生成器 Service + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-06-30 22:15:38 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Slf4j +@Service +public class CodeGeneratorService { + + @Autowired + private CodeGeneratorDao codeGeneratorDao; + + @Autowired + private CodeGeneratorConfigDao codeGeneratorConfigDao; + + @Autowired + private CodeGeneratorTemplateService codeGeneratorTemplateService; + + + /** + * 列信息 + * + * @param tableName + * @return + */ + public List getTableColumns(String tableName) { + return codeGeneratorDao.selectTableColumn(tableName); + } + + + /** + * 查询数据库表数据 + * + * @param tableQueryForm + * @return + */ + public PageResult queryTableList(TableQueryForm tableQueryForm) { + Page page = SmartPageUtil.convert2PageQuery(tableQueryForm); + List tableVOList = codeGeneratorDao.queryTableList(page, tableQueryForm); + return SmartPageUtil.convert2PageResult(page, tableVOList); + } + + /** + * 获取 表的 配置信息 + * + * @param table + * @return + */ + public TableConfigVO getTableConfig(String table) { + + TableConfigVO config = new TableConfigVO(); + + CodeGeneratorConfigEntity codeGeneratorConfigEntity = codeGeneratorConfigDao.selectById(table); + if (codeGeneratorConfigEntity == null) { + return config; + } + + if (SmartStringUtil.isNotEmpty(codeGeneratorConfigEntity.getBasic())) { + CodeBasic basic = JSON.parseObject(codeGeneratorConfigEntity.getBasic(), CodeBasic.class); + config.setBasic(basic); + } + + if (SmartStringUtil.isNotEmpty(codeGeneratorConfigEntity.getFields())) { + List fields = JSONArray.parseArray(codeGeneratorConfigEntity.getFields(), CodeField.class); + config.setFields(fields); + } + + if (SmartStringUtil.isNotEmpty(codeGeneratorConfigEntity.getInsertAndUpdate())) { + CodeInsertAndUpdate insertAndUpdate = JSON.parseObject(codeGeneratorConfigEntity.getInsertAndUpdate(), CodeInsertAndUpdate.class); + config.setInsertAndUpdate(insertAndUpdate); + } + + if (SmartStringUtil.isNotEmpty(codeGeneratorConfigEntity.getDeleteInfo())) { + CodeDelete deleteInfo = JSON.parseObject(codeGeneratorConfigEntity.getDeleteInfo(), CodeDelete.class); + config.setDeleteInfo(deleteInfo); + } + + if (SmartStringUtil.isNotEmpty(codeGeneratorConfigEntity.getQueryFields())) { + List queryFields = JSONArray.parseArray(codeGeneratorConfigEntity.getQueryFields(), CodeQueryField.class); + config.setQueryFields(queryFields); + } + + if (SmartStringUtil.isNotEmpty(codeGeneratorConfigEntity.getTableFields())) { + List tableFields = JSONArray.parseArray(codeGeneratorConfigEntity.getTableFields(), CodeTableField.class); + config.setTableFields(tableFields); + } + + return config; + } + + /** + * 更新配置 + * + * @param form + * @return + */ + public synchronized ResponseDTO updateConfig(CodeGeneratorConfigForm form) { + long existCount = codeGeneratorDao.countByTableName(form.getTableName()); + if (existCount == 0) { + return ResponseDTO.userErrorParam("表不存在,请联系后端查看下数据库"); + } + + CodeGeneratorConfigEntity codeGeneratorConfigEntity = codeGeneratorConfigDao.selectById(form.getTableName()); + boolean updateFlag = true; + if (codeGeneratorConfigEntity == null) { + codeGeneratorConfigEntity = new CodeGeneratorConfigEntity(); + updateFlag = false; + } + + // 校验假删,必须有 deleted_flag 字段 + List tableColumns = getTableColumns(form.getTableName()); + if (null != form.getDeleteInfo() && form.getDeleteInfo().getIsSupportDelete() && !form.getDeleteInfo().getIsPhysicallyDeleted()) { + Optional any = tableColumns.stream().filter(e -> e.getColumnName().equals(CodeGeneratorConstant.DELETED_FLAG)).findAny(); + if (!any.isPresent()) { + return ResponseDTO.userErrorParam("表结构中没有假删字段:" + CodeGeneratorConstant.DELETED_FLAG + ",请仔细排查"); + } + } + + codeGeneratorConfigEntity.setTableName(form.getTableName()); + codeGeneratorConfigEntity.setBasic(JSON.toJSONString(form.getBasic())); + codeGeneratorConfigEntity.setFields(JSONArray.toJSONString(form.getFields())); + codeGeneratorConfigEntity.setInsertAndUpdate(JSON.toJSONString(form.getInsertAndUpdate())); + codeGeneratorConfigEntity.setDeleteInfo(JSON.toJSONString(form.getDeleteInfo())); + codeGeneratorConfigEntity.setQueryFields(JSONArray.toJSONString(form.getQueryFields())); + codeGeneratorConfigEntity.setTableFields(JSONArray.toJSONString(form.getTableFields())); + + if (updateFlag) { + codeGeneratorConfigDao.updateById(codeGeneratorConfigEntity); + } else { + codeGeneratorConfigDao.insert(codeGeneratorConfigEntity); + } + return ResponseDTO.ok(); + } + + /** + * 预览 + * + * @param form + * @return + */ + public ResponseDTO preview(CodeGeneratorPreviewForm form) { + long existCount = codeGeneratorDao.countByTableName(form.getTableName()); + if (existCount == 0) { + return ResponseDTO.userErrorParam("表不存在,请联系后端查看下数据库"); + } + + CodeGeneratorConfigEntity codeGeneratorConfigEntity = codeGeneratorConfigDao.selectById(form.getTableName()); + if (codeGeneratorConfigEntity == null) { + return ResponseDTO.userErrorParam("配置信息不存在,请先进行配置"); + } + + List columns = getTableColumns(form.getTableName()); + if (CollectionUtils.isEmpty(columns)) { + return ResponseDTO.userErrorParam("表没有列信息无法生成"); + } + + String result = codeGeneratorTemplateService.generate(form.getTableName(), form.getTemplateFile(), codeGeneratorConfigEntity); + return ResponseDTO.ok(result); + + } + + /** + * 下载代码 + * @param tableName + * @return + */ + public ResponseDTO download(String tableName) { + if (SmartStringUtil.isBlank(tableName)) { + return ResponseDTO.userErrorParam("表名不能为空"); + } + + long existCount = codeGeneratorDao.countByTableName(tableName); + if (existCount == 0) { + return ResponseDTO.userErrorParam("表不存在,请联系后端查看下数据库"); + } + + CodeGeneratorConfigEntity codeGeneratorConfigEntity = codeGeneratorConfigDao.selectById(tableName); + if (codeGeneratorConfigEntity == null) { + return ResponseDTO.userErrorParam("配置信息不存在,请先进行配置"); + } + + List columns = getTableColumns(tableName); + if (CollectionUtils.isEmpty(columns)) { + return ResponseDTO.userErrorParam("表没有列信息无法生成"); + } + ByteArrayOutputStream out = new ByteArrayOutputStream(); + codeGeneratorTemplateService.zipGeneratedFiles(out, tableName, codeGeneratorConfigEntity); + return ResponseDTO.ok(out.toByteArray()); + } +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/CodeGeneratorTemplateService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/CodeGeneratorTemplateService.java new file mode 100644 index 00000000..d9808e2f --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/CodeGeneratorTemplateService.java @@ -0,0 +1,238 @@ +package net.lab1024.sa.common.module.support.codegenerator.service; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.io.FileUtil; +import cn.hutool.core.io.IORuntimeException; +import cn.hutool.core.util.ZipUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.google.common.base.CaseFormat; +import lombok.extern.slf4j.Slf4j; +import net.lab1024.sa.common.common.util.SmartStringUtil; +import net.lab1024.sa.common.module.support.codegenerator.domain.entity.CodeGeneratorConfigEntity; +import net.lab1024.sa.common.module.support.codegenerator.domain.form.CodeGeneratorConfigForm; +import net.lab1024.sa.common.module.support.codegenerator.domain.model.*; +import net.lab1024.sa.common.module.support.codegenerator.service.variable.backend.ControllerVariableService; +import net.lab1024.sa.common.module.support.codegenerator.service.variable.backend.DaoVariableService; +import net.lab1024.sa.common.module.support.codegenerator.service.variable.backend.ManagerVariableService; +import net.lab1024.sa.common.module.support.codegenerator.service.variable.backend.ServiceVariableService; +import net.lab1024.sa.common.module.support.codegenerator.service.variable.backend.domain.*; +import net.lab1024.sa.common.module.support.codegenerator.service.variable.front.ApiVariableService; +import net.lab1024.sa.common.module.support.codegenerator.service.variable.front.ConstVariableService; +import net.lab1024.sa.common.module.support.codegenerator.service.variable.front.FormVariableService; +import net.lab1024.sa.common.module.support.codegenerator.service.variable.front.ListVariableService; +import net.lab1024.sa.common.module.support.codegenerator.service.variable.CodeGenerateBaseVariableService; +import net.lab1024.sa.common.module.support.codegenerator.util.CodeGeneratorTool; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.velocity.Template; +import org.apache.velocity.app.Velocity; +import org.apache.velocity.app.VelocityEngine; +import org.apache.velocity.tools.ToolContext; +import org.apache.velocity.tools.ToolManager; +import org.springframework.stereotype.Service; + +import javax.annotation.PostConstruct; +import java.io.File; +import java.io.OutputStream; +import java.io.StringWriter; +import java.nio.charset.Charset; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 代码生成器 模板 Service + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-06-30 22:15:38 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ + +@Service +@Slf4j +public class CodeGeneratorTemplateService { + + + private Map map = new HashMap<>(); + + @PostConstruct + public void init() { + // 后端 + map.put("java/domain/entity/Entity.java", new EntityVariableService()); + map.put("java/domain/form/AddForm.java", new AddFormVariableService()); + map.put("java/domain/form/UpdateForm.java", new UpdateFormVariableService()); + map.put("java/domain/form/QueryForm.java", new QueryFormVariableService()); + map.put("java/domain/vo/VO.java", new VOVariableService()); + map.put("java/controller/Controller.java", new ControllerVariableService()); + map.put("java/service/Service.java", new ServiceVariableService()); + map.put("java/manager/Manager.java", new ManagerVariableService()); + map.put("java/dao/Dao.java", new DaoVariableService()); + map.put("java/mapper/Mapper.xml", new MapperVariableService()); + // 前端 + map.put("js/api.js", new ApiVariableService()); + map.put("js/const.js", new ConstVariableService()); + map.put("js/list.vue", new ListVariableService()); + map.put("js/form.vue", new FormVariableService()); + } + + public void zipGeneratedFiles(OutputStream outputStream, String tableName, CodeGeneratorConfigEntity codeGeneratorConfigEntity) { + String uuid = UUID.randomUUID().toString(); + File dir = new File(uuid); + + // 1、生产文件 + CodeBasic basic = JSON.parseObject(codeGeneratorConfigEntity.getBasic(), CodeBasic.class); + String moduleName = basic.getModuleName(); + + for (Map.Entry entry : map.entrySet()) { + try { + String templateFile = entry.getKey(); + String upperCamel = new CodeGeneratorTool().lowerCamel2UpperCamel(moduleName); + String lowerHyphen = new CodeGeneratorTool().lowerCamel2LowerHyphen(moduleName); + String[] templateSplit = templateFile.split("/"); + String fileName = templateFile.startsWith("java") ? upperCamel + templateSplit[templateSplit.length - 1] : lowerHyphen + "-" + templateSplit[templateSplit.length - 1]; + String fullPathFileName = templateFile.replaceAll(templateSplit[templateSplit.length - 1], fileName); + fullPathFileName = fullPathFileName.replaceAll("java/", "java/" + basic.getModuleName().toLowerCase() + "/"); + + String fileContent = generate(tableName, templateFile, codeGeneratorConfigEntity); + File file = new File(uuid + "/" + fullPathFileName); + file.getParentFile().mkdirs(); + FileUtil.appendUtf8String(fileContent, file); + } catch (IORuntimeException e) { + log.error(e.getMessage(), e); + } + } + + // 2、后端的枚举文件 + List fields = JSONArray.parseArray(codeGeneratorConfigEntity.getFields(), CodeField.class); + if (CollectionUtils.isNotEmpty(fields)) { + List enumFiledList = fields.stream().filter(e -> SmartStringUtil.isNotBlank(e.getEnumName())).collect(Collectors.toList()); + for (CodeField codeField : enumFiledList) { + Map variablesMap = new HashMap<>(); + + String enumName = CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_CAMEL, codeField.getEnumName()); + if (!enumName.endsWith("Enum")) { + enumName = enumName + "Enum"; + } + variablesMap.put("enumName", enumName); + variablesMap.put("enumDesc", codeField.getColumnComment()); + variablesMap.put("enumJavaType", codeField.getJavaType()); + variablesMap.put("basic", basic); + variablesMap.put("packageName", basic.getJavaPackageName() + ".constant"); + + String fileContent = render("code-generator-template/java/constant/enum.java.vm", variablesMap); + File file = new File(uuid + "/java/" + basic.getModuleName().toLowerCase() + "/constant/" + enumName + ".java"); + file.getParentFile().mkdirs(); + FileUtil.appendUtf8String(fileContent, file); + } + } + + + ZipUtil.zip(outputStream, Charset.forName("utf-8"), false, null, dir); + + FileUtil.del(dir); + + } + + + public String generate(String tableName, String file, CodeGeneratorConfigEntity codeGeneratorConfigEntity) { + + // -------------------- 1 校验不支持的代码生成,比如增加、删除等 -------------------- + + String finalFile = file; + Optional optional = map.keySet().stream().filter(e -> e.contains(finalFile)).findFirst(); + if (!optional.isPresent()) { + return "不存在此模板!"; + } + + file = optional.get(); + CodeGenerateBaseVariableService codeGenerateBaseVariableService = map.get(file); + if (codeGenerateBaseVariableService == null) { + return "代码生成Service不存在,请检查相关代码!"; + } + + CodeBasic basic = JSON.parseObject(codeGeneratorConfigEntity.getBasic(), CodeBasic.class); + List fields = JSONArray.parseArray(codeGeneratorConfigEntity.getFields(), CodeField.class); + CodeInsertAndUpdate insertAndUpdate = JSON.parseObject(codeGeneratorConfigEntity.getInsertAndUpdate(), CodeInsertAndUpdate.class); + CodeDelete deleteInfo = JSON.parseObject(codeGeneratorConfigEntity.getDeleteInfo(), CodeDelete.class); + List queryFields = JSONArray.parseArray(codeGeneratorConfigEntity.getQueryFields(), CodeQueryField.class); + List tableFields = JSONArray.parseArray(codeGeneratorConfigEntity.getTableFields(), CodeTableField.class); + tableFields.stream().forEach(e -> e.setWidth(e.getWidth() == null ? 0 : e.getWidth())); + + CodeGeneratorConfigForm form = CodeGeneratorConfigForm.builder().basic(basic).fields(fields).insertAndUpdate(insertAndUpdate).deleteInfo(deleteInfo).queryFields(queryFields).tableFields(tableFields).deleteInfo(deleteInfo).build(); + form.setTableName(tableName); + if (!codeGenerateBaseVariableService.isSupport(form)) { + return "业务不需要此功能,故没有生成代码;"; + } + + // -------------------- 2 通用模板的变量 -------------------- + Map variablesMap = new HashMap<>(); + + + Map basicMap = BeanUtil.beanToMap(basic); + basicMap.put("frontDate", DateUtil.formatLocalDateTime(basic.getFrontDate())); + basicMap.put("backendDate", DateUtil.formatLocalDateTime(basic.getBackendDate())); + + variablesMap.put("basic", basicMap); + variablesMap.put("fields", fields); + variablesMap.put("insertAndUpdate", insertAndUpdate); + variablesMap.put("deleteInfo", deleteInfo); + variablesMap.put("queryFields", queryFields); + variablesMap.put("tableFields", tableFields); + variablesMap.put("tableName", tableName); + + //名词的大写开头和小写开头 + HashMap names = new HashMap<>(); + names.put("lowerCamel", CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_CAMEL, basic.getModuleName())); + names.put("upperCamel", CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_CAMEL, basic.getModuleName())); + names.put("lowerHyphenCamel", CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_HYPHEN, basic.getModuleName())); + variablesMap.put("name", names); + + //主键字段名称和java类型 + CodeField primaryKeycodeField = fields.stream().filter(e -> e.getPrimaryKeyFlag()).findFirst().get(); + if (primaryKeycodeField != null) { + variablesMap.put("primaryKeyJavaType", primaryKeycodeField.getJavaType()); + variablesMap.put("primaryKeyFieldName", primaryKeycodeField.getFieldName()); + variablesMap.put("primaryKeyColumnName", primaryKeycodeField.getColumnName()); + } + + // -------------------- 3、针对此 模板 的特殊变量 -------------------- + + Map specialVariables = codeGenerateBaseVariableService.getInjectVariablesMap(form); + variablesMap.putAll(specialVariables); + + // -------------------- 4、模板 生成代码 -------------------- + + return render("code-generator-template/" + file + ".vm", variablesMap); + } + + /** + * 渲染 + * + * @param templateFile + * @param variablesMap + * @return + */ + private String render(String templateFile, Map variablesMap) { + VelocityEngine engine = new VelocityEngine(); + engine.setProperty(Velocity.FILE_RESOURCE_LOADER_CACHE, true); + engine.setProperty(Velocity.INPUT_ENCODING, "UTF-8"); + engine.setProperty("resource.loader.file.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader"); + engine.init(); + Template template = engine.getTemplate(templateFile); + + //加载tools.xml配置文件 + ToolManager toolManager = new ToolManager(); + toolManager.configure("code-generator-template/tools.xml"); + + //注入变量 + ToolContext context = toolManager.createContext(); + context.putAll(variablesMap); + + StringWriter sw = new StringWriter(); + template.merge(context, sw); + return sw.toString(); + } + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/CodeGenerateBaseVariableService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/CodeGenerateBaseVariableService.java new file mode 100644 index 00000000..d412d1fc --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/CodeGenerateBaseVariableService.java @@ -0,0 +1,162 @@ +package net.lab1024.sa.common.module.support.codegenerator.service.variable; + +import com.google.common.base.CaseFormat; +import net.lab1024.sa.common.common.util.SmartStringUtil; +import net.lab1024.sa.common.module.support.codegenerator.domain.form.CodeGeneratorConfigForm; +import net.lab1024.sa.common.module.support.codegenerator.domain.model.CodeField; +import net.lab1024.sa.common.module.support.codegenerator.domain.model.CodeInsertAndUpdate; +import net.lab1024.sa.common.module.support.codegenerator.domain.model.CodeInsertAndUpdateField; +import org.apache.commons.collections4.CollectionUtils; + +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * @Author 1024创新实验室-主任:卓大 + * @Date 2022/9/29 17:20:41 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ +public abstract class CodeGenerateBaseVariableService { + + public abstract Map getInjectVariablesMap(CodeGeneratorConfigForm form); + + /** + * 是否支持 : + * 1、增加、修改 + * 2、删除 + * + * @param form + * @return + */ + public abstract boolean isSupport(CodeGeneratorConfigForm form); + + /** + * 获取所有javabean的 import 包名 + * + * @param form + * @return + */ + public List getJavaBeanImportClass(CodeGeneratorConfigForm form) { + String upperCamelName = CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_CAMEL, form.getBasic().getModuleName()); + ArrayList list = new ArrayList<>(); + + list.add("import " + form.getBasic().getJavaPackageName() + ".domain.entity." + upperCamelName + "Entity;" ); + + list.add("import " + form.getBasic().getJavaPackageName() + ".domain.form." + upperCamelName + "AddForm;" ); + list.add("import " + form.getBasic().getJavaPackageName() + ".domain.form." + upperCamelName + "UpdateForm;" ); + list.add("import " + form.getBasic().getJavaPackageName() + ".domain.form." + upperCamelName + "QueryForm;" ); + + list.add("import " + form.getBasic().getJavaPackageName() + ".domain.vo." + upperCamelName + "VO;" ); + return list; + } + + + /** + * 根据列名查找 CodeField + */ + public CodeField getCodeFieldByColumnName(String columnName, CodeGeneratorConfigForm form) { + List fields = form.getFields(); + if (CollectionUtils.isEmpty(fields)) { + return null; + } + + return fields.stream().filter(e -> columnName.equals(e.getColumnName())) + .findFirst().get(); + } + + + /** + * 是否为文件上传字段 + */ + protected boolean isFile(String columnName, CodeGeneratorConfigForm form) { + CodeInsertAndUpdate insertAndUpdate = form.getInsertAndUpdate(); + if (insertAndUpdate == null) { + return false; + } + + List fieldList = insertAndUpdate.getFieldList(); + if (CollectionUtils.isEmpty(fieldList)) { + return false; + } + + Optional first = fieldList.stream().filter(e -> columnName.equals(e.getColumnName())).findFirst(); + if (!first.isPresent()) { + return false; + } + + CodeInsertAndUpdateField field = first.get(); + return SmartStringUtil.contains(field.getFrontComponent(), "Upload" ); + } + + /** + * 是否为 枚举 + */ + protected boolean isDict(String columnName, CodeGeneratorConfigForm form) { + List fields = form.getFields(); + if (CollectionUtils.isEmpty(fields)) { + return false; + } + + Optional first = fields.stream().filter(e -> columnName.equals(e.getColumnName())).findFirst(); + if (first.isPresent()) { + return false; + } + + CodeField codeField = first.get(); + return codeField.getDict() != null; + } + + /** + * 是否为 枚举 + */ + protected boolean isEnum(String columnName, CodeGeneratorConfigForm form) { + List fields = form.getFields(); + if (CollectionUtils.isEmpty(fields)) { + return false; + } + + Optional first = fields.stream().filter(e -> columnName.equals(e.getColumnName())).findFirst(); + if (first.isPresent()) { + return false; + } + + CodeField codeField = first.get(); + return codeField.getEnumName() != null; + } + + /** + * 获取字段集合 + * + * @param form + * @return + */ + protected Map getFieldMap(CodeGeneratorConfigForm form) { + List fields = form.getFields(); + if (fields == null) { + return new HashMap<>(); + } + + return fields.stream().collect(Collectors.toMap(CodeField::getColumnName, Function.identity())); + } + + /** + * 获取java类型 + * + * @return + */ + protected String getJavaPackageName(String javaType) { + if ("BigDecimal".equals(javaType)) { + return "import java.math.BigDecimal"; + } else if ("LocalDate".equals(javaType)) { + return "import java.time.LocalDate;"; + } else if ("LocalDateTime".equals(javaType)) { + return "import java.time.LocalDateTime;"; + } else { + return null; + } + } + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/ControllerVariableService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/ControllerVariableService.java new file mode 100644 index 00000000..60543b3a --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/ControllerVariableService.java @@ -0,0 +1,78 @@ +package net.lab1024.sa.common.module.support.codegenerator.service.variable.backend; + +import com.google.common.base.CaseFormat; +import net.lab1024.sa.common.common.util.SmartEnumUtil; +import net.lab1024.sa.common.module.support.codegenerator.constant.CodeDeleteEnum; +import net.lab1024.sa.common.module.support.codegenerator.domain.form.CodeGeneratorConfigForm; +import net.lab1024.sa.common.module.support.codegenerator.domain.model.CodeInsertAndUpdateField; +import net.lab1024.sa.common.module.support.codegenerator.service.variable.CodeGenerateBaseVariableService; +import org.apache.commons.collections4.CollectionUtils; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @Author 1024创新实验室-主任:卓大 + * @Date 2022/9/29 17:20:41 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ + +public class ControllerVariableService extends CodeGenerateBaseVariableService { + + @Override + public boolean isSupport(CodeGeneratorConfigForm form) { + return true; + } + + @Override + public Map getInjectVariablesMap(CodeGeneratorConfigForm form) { + Map variablesMap = new HashMap<>(); + + List updateFieldList = form.getInsertAndUpdate().getFieldList().stream().filter(e -> Boolean.TRUE.equals(e.getInsertFlag())).collect(Collectors.toList()); + + variablesMap.put("packageName", form.getBasic().getJavaPackageName() + ".controller"); + + List packageList = getPackageList(updateFieldList, form); + variablesMap.put("importPackageList", packageList); + + return variablesMap; + } + + + public List getPackageList(List fields, CodeGeneratorConfigForm form) { + if (CollectionUtils.isEmpty(fields)) { + return new ArrayList<>(); + } + + HashSet packageSet = new HashSet<>(); + + //1、javabean相关的包 + packageSet.addAll(getJavaBeanImportClass(form).stream().filter(e -> !e.contains("Entity;")).collect(Collectors.toList())); + + //2、其他包 + if (form.getDeleteInfo().getIsSupportDelete()) { + + CodeDeleteEnum codeDeleteEnum = SmartEnumUtil.getEnumByValue(form.getDeleteInfo().getDeleteEnum(), CodeDeleteEnum.class); + if (codeDeleteEnum == CodeDeleteEnum.BATCH || codeDeleteEnum == CodeDeleteEnum.SINGLE_AND_BATCH) { + //2、批量删除的话,要导入ValidateList + packageSet.add("import net.lab1024.sa.common.common.domain.ValidateList;"); + } + + if (codeDeleteEnum == CodeDeleteEnum.SINGLE || codeDeleteEnum == CodeDeleteEnum.SINGLE_AND_BATCH) { + //3、单个删除的话,要导入 @PathVariable + packageSet.add("import org.springframework.web.bind.annotation.PathVariable;"); + packageSet.add("import org.springframework.web.bind.annotation.GetMapping;"); + } + } + + packageSet.add("import " + form.getBasic().getJavaPackageName() + ".service." + CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_CAMEL, form.getBasic().getModuleName()) + "Service;"); + + // 排序一下 + ArrayList packageList = new ArrayList<>(packageSet); + Collections.sort(packageList); + return packageList; + } + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/DaoVariableService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/DaoVariableService.java new file mode 100644 index 00000000..caf4963f --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/DaoVariableService.java @@ -0,0 +1,59 @@ +package net.lab1024.sa.common.module.support.codegenerator.service.variable.backend; + +import net.lab1024.sa.common.module.support.codegenerator.domain.form.CodeGeneratorConfigForm; +import net.lab1024.sa.common.module.support.codegenerator.domain.model.CodeInsertAndUpdateField; +import net.lab1024.sa.common.module.support.codegenerator.service.variable.CodeGenerateBaseVariableService; +import org.apache.commons.collections4.CollectionUtils; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @Author 1024创新实验室-主任:卓大 + * @Date 2022/9/29 17:20:41 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ + +public class DaoVariableService extends CodeGenerateBaseVariableService { + + @Override + public boolean isSupport(CodeGeneratorConfigForm form) { + return true; + } + + @Override + public Map getInjectVariablesMap(CodeGeneratorConfigForm form) { + Map variablesMap = new HashMap<>(); + + List updateFieldList = form.getInsertAndUpdate().getFieldList().stream().filter(e -> Boolean.TRUE.equals(e.getInsertFlag())).collect(Collectors.toList()); + List packageList = getPackageList(updateFieldList, form); + + variablesMap.put("packageName", form.getBasic().getJavaPackageName() + ".dao" ); + variablesMap.put("importPackageList", packageList); + + return variablesMap; + } + + + public List getPackageList(List fields, CodeGeneratorConfigForm form) { + if (CollectionUtils.isEmpty(fields)) { + return new ArrayList<>(); + } + + HashSet packageSet = new HashSet<>(); + + //1、javabean相关的包 + packageSet.addAll(getJavaBeanImportClass(form).stream().filter( e-> e.contains("QueryForm;") || e.contains("VO;")|| e.contains("Entity;")).collect(Collectors.toList())); + + //2、util + packageSet.add("import java.util.List;"); + + //3、 排序一下 + ArrayList packageList = new ArrayList<>(packageSet); + Collections.sort(packageList); + return packageList; + } + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/ManagerVariableService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/ManagerVariableService.java new file mode 100644 index 00000000..f4e43e0b --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/ManagerVariableService.java @@ -0,0 +1,55 @@ +package net.lab1024.sa.common.module.support.codegenerator.service.variable.backend; + +import net.lab1024.sa.common.module.support.codegenerator.domain.form.CodeGeneratorConfigForm; +import net.lab1024.sa.common.module.support.codegenerator.domain.model.CodeInsertAndUpdateField; +import net.lab1024.sa.common.module.support.codegenerator.service.variable.CodeGenerateBaseVariableService; +import org.apache.commons.collections4.CollectionUtils; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @Author 1024创新实验室-主任:卓大 + * @Date 2022/9/29 17:20:41 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ + +public class ManagerVariableService extends CodeGenerateBaseVariableService { + + @Override + public boolean isSupport(CodeGeneratorConfigForm form) { + return true; + } + + @Override + public Map getInjectVariablesMap(CodeGeneratorConfigForm form) { + Map variablesMap = new HashMap<>(); + + List updateFieldList = form.getInsertAndUpdate().getFieldList().stream().filter(e -> Boolean.TRUE.equals(e.getInsertFlag())).collect(Collectors.toList()); + List packageList = getPackageList(updateFieldList, form); + + variablesMap.put("packageName", form.getBasic().getJavaPackageName() + ".manager" ); + variablesMap.put("importPackageList", packageList); + + return variablesMap; + } + + + public List getPackageList(List fields, CodeGeneratorConfigForm form) { + if (CollectionUtils.isEmpty(fields)) { + return new ArrayList<>(); + } + + HashSet packageList = new HashSet<>(); + + //1、javabean相关的包 + packageList.addAll(getJavaBeanImportClass(form).stream().filter(e -> e.contains("Entity;")).collect(Collectors.toList())); + + //2、dao + packageList.add("import " + form.getBasic().getJavaPackageName() + ".dao."+ form.getBasic().getModuleName() + "Dao;" ); + return new ArrayList<>(packageList); + } + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/ServiceVariableService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/ServiceVariableService.java new file mode 100644 index 00000000..a87473cf --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/ServiceVariableService.java @@ -0,0 +1,62 @@ +package net.lab1024.sa.common.module.support.codegenerator.service.variable.backend; + +import net.lab1024.sa.common.module.support.codegenerator.domain.form.CodeGeneratorConfigForm; +import net.lab1024.sa.common.module.support.codegenerator.domain.model.CodeInsertAndUpdateField; +import net.lab1024.sa.common.module.support.codegenerator.service.variable.CodeGenerateBaseVariableService; +import org.apache.commons.collections4.CollectionUtils; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @Author 1024创新实验室-主任:卓大 + * @Date 2022/9/29 17:20:41 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ + +public class ServiceVariableService extends CodeGenerateBaseVariableService { + + @Override + public boolean isSupport(CodeGeneratorConfigForm form) { + return true; + } + + @Override + public Map getInjectVariablesMap(CodeGeneratorConfigForm form) { + Map variablesMap = new HashMap<>(); + + List updateFieldList = form.getInsertAndUpdate().getFieldList().stream().filter(e -> Boolean.TRUE.equals(e.getInsertFlag())).collect(Collectors.toList()); + List packageList = getPackageList(updateFieldList, form); + + variablesMap.put("packageName", form.getBasic().getJavaPackageName() + ".service" ); + variablesMap.put("importPackageList", packageList); + + return variablesMap; + } + + + public List getPackageList(List fields, CodeGeneratorConfigForm form) { + if (CollectionUtils.isEmpty(fields)) { + return new ArrayList<>(); + } + + HashSet packageSet = new HashSet<>(); + + //1、javabean相关的包 + packageSet.addAll(getJavaBeanImportClass(form)); + + //2、dao + packageSet.add("import " + form.getBasic().getJavaPackageName() + ".dao."+ form.getBasic().getModuleName() + "Dao;" ); + + //3、util list + packageSet.add("import java.util.List;"); + + //3、 排序一下 + ArrayList packageList = new ArrayList<>(packageSet); + Collections.sort(packageList); + return packageList; + } + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/domain/AddFormVariableService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/domain/AddFormVariableService.java new file mode 100644 index 00000000..ee9822ab --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/domain/AddFormVariableService.java @@ -0,0 +1,131 @@ +package net.lab1024.sa.common.module.support.codegenerator.service.variable.backend.domain; + +import cn.hutool.core.bean.BeanUtil; +import net.lab1024.sa.common.common.util.SmartStringUtil; +import net.lab1024.sa.common.module.support.codegenerator.domain.form.CodeGeneratorConfigForm; +import net.lab1024.sa.common.module.support.codegenerator.domain.model.CodeField; +import net.lab1024.sa.common.module.support.codegenerator.domain.model.CodeInsertAndUpdate; +import net.lab1024.sa.common.module.support.codegenerator.domain.model.CodeInsertAndUpdateField; +import net.lab1024.sa.common.module.support.codegenerator.service.variable.CodeGenerateBaseVariableService; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.tuple.ImmutablePair; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @Author 1024创新实验室-主任:卓大 + * @Date 2022/9/29 17:20:41 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ + +public class AddFormVariableService extends CodeGenerateBaseVariableService { + + + @Override + public boolean isSupport(CodeGeneratorConfigForm form) { + CodeInsertAndUpdate insertAndUpdate = form.getInsertAndUpdate(); + return insertAndUpdate != null && insertAndUpdate.getIsSupportInsertAndUpdate() != null && insertAndUpdate.getIsSupportInsertAndUpdate(); + } + + @Override + public Map getInjectVariablesMap(CodeGeneratorConfigForm form) { + Map variablesMap = new HashMap<>(); + + List updateFieldList = form.getInsertAndUpdate().getFieldList().stream().filter(e -> Boolean.TRUE.equals(e.getInsertFlag())).collect(Collectors.toList()); + ImmutablePair, List>> packageListAndFields = getPackageListAndFields(updateFieldList, form); + + variablesMap.put("packageName", form.getBasic().getJavaPackageName() + ".domain.form"); + variablesMap.put("importPackageList", packageListAndFields.getLeft()); + variablesMap.put("fields", packageListAndFields.getRight()); + + return variablesMap; + } + + + public ImmutablePair, List>> getPackageListAndFields(List fields, CodeGeneratorConfigForm form) { + if (CollectionUtils.isEmpty(fields)) { + return ImmutablePair.of(new ArrayList<>(), new ArrayList<>()); + } + + Map fieldMap = getFieldMap(form); + HashSet packageList = new HashSet<>(); + + + /** + * 1、LocalDate、LocalDateTime、BigDecimal 类型的包名 + * 2、排序 + */ + + List> finalFieldList = new ArrayList<>(); + + for (CodeInsertAndUpdateField field : fields) { + CodeField codeField = fieldMap.get(field.getColumnName()); + if (codeField == null) { + continue; + } + + // CodeField 和 InsertAndUpdateField 合并 + Map finalFieldMap = BeanUtil.beanToMap(field); + finalFieldMap.putAll(BeanUtil.beanToMap(codeField)); + + // 枚举 + if (SmartStringUtil.isNotEmpty(codeField.getEnumName())) { + packageList.add("import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum;"); + packageList.add("import net.lab1024.sa.common.common.validator.enumeration.CheckEnum;"); + packageList.add("import " + form.getBasic().getJavaPackageName() + ".constant." + codeField.getEnumName() + ";"); + + //enum check + String checkEnumPrefix = "@CheckEnum(value = " + codeField.getEnumName() + ".class, message = \"" + codeField.getLabel() + " 错误\""; + String checkEnum = checkEnumPrefix + (field.getRequiredFlag() ? ", required = true)" : ")"); + + finalFieldMap.put("apiModelProperty", "@ApiModelPropertyEnum(value = " + codeField.getEnumName() + ".class, desc = \"" + codeField.getLabel() + "\")"); + finalFieldMap.put("checkEnum", checkEnum); + finalFieldMap.put("isEnum", true); + + } else { + String prefix = "@ApiModelProperty(value = \"" + codeField.getLabel() + "\""; + String apiModelProperty = prefix + (field.getRequiredFlag() ? ", required = true)" : ")"); + finalFieldMap.put("apiModelProperty", apiModelProperty); + + packageList.add("import io.swagger.annotations.ApiModelProperty;"); + + if (Boolean.TRUE.equals(field.getRequiredFlag())) { + String notEmptyPrefix = "String".equals(codeField.getJavaType()) ? "@NotBlank" : "@NotNull"; + finalFieldMap.put("notEmpty", "\n " + notEmptyPrefix + "(message = \"" + codeField.getLabel() + " 不能为空\")"); + packageList.add("String".equals(codeField.getJavaType()) ? "import javax.validation.constraints.NotBlank;" + : "import javax.validation.constraints.NotNull;"); + } + } + + + //字典 + if (SmartStringUtil.isNotEmpty(codeField.getDict())) { + finalFieldMap.put("dict", "\n @JsonDeserialize(using = DictValueVoDeserializer.class)"); + packageList.add("import com.fasterxml.jackson.databind.annotation.JsonDeserialize;"); + packageList.add("import net.lab1024.sa.common.common.json.deserializer.DictValueVoDeserializer;"); + } + + //文件上传 + if (SmartStringUtil.contains(field.getFrontComponent(), "Upload")) { + finalFieldMap.put("file", "\n @JsonDeserialize(using = FileKeyVoDeserializer.class)"); + packageList.add("import com.fasterxml.jackson.databind.annotation.JsonDeserialize;"); + packageList.add("import net.lab1024.sa.common.common.json.deserializer.FileKeyVoDeserializer;"); + } + + packageList.add(getJavaPackageName(codeField.getJavaType())); + finalFieldList.add(finalFieldMap); + } + + + // lombok + packageList.add("import lombok.Data;"); + + List packageNameList = packageList.stream().filter(Objects::nonNull).collect(Collectors.toList()); + Collections.sort(packageNameList); + return ImmutablePair.of(packageNameList, finalFieldList); + } + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/domain/DeleteFormVariableService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/domain/DeleteFormVariableService.java new file mode 100644 index 00000000..52525f58 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/domain/DeleteFormVariableService.java @@ -0,0 +1,130 @@ +package net.lab1024.sa.common.module.support.codegenerator.service.variable.backend.domain; + +import cn.hutool.core.bean.BeanUtil; +import net.lab1024.sa.common.common.util.SmartStringUtil; +import net.lab1024.sa.common.module.support.codegenerator.domain.form.CodeGeneratorConfigForm; +import net.lab1024.sa.common.module.support.codegenerator.domain.model.CodeDelete; +import net.lab1024.sa.common.module.support.codegenerator.domain.model.CodeField; +import net.lab1024.sa.common.module.support.codegenerator.domain.model.CodeInsertAndUpdateField; +import net.lab1024.sa.common.module.support.codegenerator.service.variable.CodeGenerateBaseVariableService; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.tuple.ImmutablePair; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @Author 1024创新实验室-主任:卓大 + * @Date 2022/9/29 17:20:41 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ + +public class DeleteFormVariableService extends CodeGenerateBaseVariableService { + + @Override + public boolean isSupport(CodeGeneratorConfigForm form) { + CodeDelete deleteInfo = form.getDeleteInfo(); + return deleteInfo != null && deleteInfo.getIsSupportDelete() != null && deleteInfo.getIsSupportDelete(); + } + + @Override + public Map getInjectVariablesMap(CodeGeneratorConfigForm form) { + + Map variablesMap = new HashMap<>(); + + List updateFieldList = form.getInsertAndUpdate().getFieldList().stream().filter(e -> Boolean.TRUE.equals(e.getInsertFlag())).collect(Collectors.toList()); + ImmutablePair, List>> packageListAndFields = getPackageListAndFields(updateFieldList, form); + + variablesMap.put("packageName", form.getBasic().getJavaPackageName() + ".domain.form"); + variablesMap.put("importPackageList", packageListAndFields.getLeft()); + variablesMap.put("fields", packageListAndFields.getRight()); + + return variablesMap; + } + + public ImmutablePair, List>> getPackageListAndFields(List fields, CodeGeneratorConfigForm form) { + if (CollectionUtils.isEmpty(fields)) { + return ImmutablePair.of(new ArrayList<>(), new ArrayList<>()); + } + + Map fieldMap = getFieldMap(form); + HashSet packageList = new HashSet<>(); + + + /** + * 1、LocalDate、LocalDateTime、BigDecimal 类型的包名 + * 2、排序 + */ + + List> finalFieldList = new ArrayList<>(); + + for (CodeInsertAndUpdateField field : fields) { + CodeField codeField = fieldMap.get(field.getColumnName()); + if (codeField == null) { + continue; + } + + // CodeField 和 InsertAndUpdateField 合并 + Map finalFieldMap = BeanUtil.beanToMap(field); + finalFieldMap.putAll(BeanUtil.beanToMap(codeField)); + + // 枚举 + if (SmartStringUtil.isNotEmpty(codeField.getEnumName())) { + packageList.add("import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum;"); + packageList.add("import net.lab1024.sa.common.common.validator.enumeration.CheckEnum;"); + packageList.add("import " + form.getBasic().getJavaPackageName() + ".constant." + codeField.getEnumName() + ";"); + + //enum check + String checkEnumPrefix = "@CheckEnum(value = " + codeField.getEnumName() + ".class, message = \"" + codeField.getLabel() + " 错误\""; + String checkEnum = checkEnumPrefix + (field.getRequiredFlag() ? ", required = true)" : ")"); + + finalFieldMap.put("apiModelProperty", "@ApiModelPropertyEnum(value = " + codeField.getEnumName() + ".class, desc = \"" + codeField.getLabel() + "\")"); + finalFieldMap.put("checkEnum", checkEnum); + finalFieldMap.put("isEnum", true); + + } else { + String prefix = "@ApiModelProperty(value = \"" + codeField.getLabel() + "\""; + String apiModelProperty = prefix + (field.getRequiredFlag() ? ", required = true)" : ")"); + finalFieldMap.put("apiModelProperty", apiModelProperty); + + packageList.add("import io.swagger.annotations.ApiModelProperty;"); + + if (Boolean.TRUE.equals(field.getRequiredFlag())) { + String notEmptyPrefix = "String".equals(codeField.getJavaType()) ? "@NotBlank" : "@NotNull"; + finalFieldMap.put("notEmpty", "\n " + notEmptyPrefix + "(message = \"" + codeField.getLabel() + " 不能为空\")"); + packageList.add("String".equals(codeField.getJavaType()) ? "import javax.validation.constraints.NotBlank;" + : "import javax.validation.constraints.NotNull;"); + } + } + + + //字典 + if (SmartStringUtil.isNotEmpty(codeField.getDict())) { + finalFieldMap.put("dict", "\n @JsonDeserialize(using = DictValueVoDeserializer.class)"); + packageList.add("import com.fasterxml.jackson.databind.annotation.JsonDeserialize;"); + packageList.add("import net.lab1024.sa.common.common.json.deserializer.DictValueVoDeserializer;"); + } + + //文件上传 + if (SmartStringUtil.contains(field.getFrontComponent(), "Upload")) { + finalFieldMap.put("file", "\n @JsonDeserialize(using = FileKeyVoDeserializer.class)"); + packageList.add("import com.fasterxml.jackson.databind.annotation.JsonDeserialize;"); + packageList.add("import net.lab1024.sa.common.common.json.deserializer.FileKeyVoDeserializer;"); + } + + packageList.add(getJavaPackageName(codeField.getJavaType())); + finalFieldList.add(finalFieldMap); + } + + + // lombok + packageList.add("import lombok.Data;"); + + List packageNameList = packageList.stream().filter(Objects::nonNull).collect(Collectors.toList()); + Collections.sort(packageNameList); + return ImmutablePair.of(packageNameList, finalFieldList); + } + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/domain/EntityVariableService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/domain/EntityVariableService.java new file mode 100644 index 00000000..f1943853 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/domain/EntityVariableService.java @@ -0,0 +1,73 @@ +package net.lab1024.sa.common.module.support.codegenerator.service.variable.backend.domain; + +import com.google.common.collect.Lists; +import net.lab1024.sa.common.module.support.codegenerator.domain.form.CodeGeneratorConfigForm; +import net.lab1024.sa.common.module.support.codegenerator.domain.model.CodeField; +import net.lab1024.sa.common.module.support.codegenerator.service.variable.CodeGenerateBaseVariableService; +import org.apache.commons.collections4.CollectionUtils; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @Author 1024创新实验室-主任:卓大 + * @Date 2022/9/29 17:20:41 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ + +public class EntityVariableService extends CodeGenerateBaseVariableService { + + @Override + public boolean isSupport(CodeGeneratorConfigForm form) { + return true; + } + + @Override + public Map getInjectVariablesMap(CodeGeneratorConfigForm form) { + Map variablesMap = new HashMap<>(); + + + variablesMap.put("packageName", form.getBasic().getJavaPackageName() + ".domain.entity"); + variablesMap.put("importPackageList", getImportPackageList(form.getFields())); + + + return variablesMap; + } + + + public List getImportPackageList(List fields) { + if (CollectionUtils.isEmpty(fields)) { + return Lists.newArrayList(); + } + + /** + * 1、LocalDate、LocalDateTime、BigDecimal 类型的包名 + * 2、排序 + */ + List result = fields.stream().map(e -> getJavaPackageName(e.getJavaType())).filter(Objects::nonNull).distinct().collect(Collectors.toList()); + + // lombok + result.add("import lombok.Data;"); + + // mybatis plus + result.add("import com.baomidou.mybatisplus.annotation.TableName;"); + + //主键 + boolean isExistPrimaryKey = fields.stream().filter(e -> e.getPrimaryKeyFlag() != null && e.getPrimaryKeyFlag()).findFirst().isPresent(); + if (isExistPrimaryKey) { + result.add("import com.baomidou.mybatisplus.annotation.TableId;"); + } + + //自增 + boolean isExistAutoIncrease = fields.stream().filter(e -> e.getAutoIncreaseFlag() != null && e.getAutoIncreaseFlag()).findFirst().isPresent(); + if (isExistAutoIncrease) { + result.add("import com.baomidou.mybatisplus.annotation.IdType;"); + } + + Collections.sort(result); + return result; + } + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/domain/MapperVariableService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/domain/MapperVariableService.java new file mode 100644 index 00000000..7a6bbd26 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/domain/MapperVariableService.java @@ -0,0 +1,93 @@ +package net.lab1024.sa.common.module.support.codegenerator.service.variable.backend.domain; + +import cn.hutool.core.bean.BeanUtil; +import net.lab1024.sa.common.module.support.codegenerator.constant.CodeQueryFieldQueryTypeEnum; +import net.lab1024.sa.common.module.support.codegenerator.domain.form.CodeGeneratorConfigForm; +import net.lab1024.sa.common.module.support.codegenerator.domain.model.CodeInsertAndUpdateField; +import net.lab1024.sa.common.module.support.codegenerator.domain.model.CodeQueryField; +import net.lab1024.sa.common.module.support.codegenerator.service.variable.CodeGenerateBaseVariableService; +import org.apache.commons.collections4.CollectionUtils; + +import java.util.*; + +/** + * @Author 1024创新实验室-主任:卓大 + * @Date 2022/9/29 17:20:41 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ + +public class MapperVariableService extends CodeGenerateBaseVariableService { + + @Override + public boolean isSupport(CodeGeneratorConfigForm form) { + return true; + } + + @Override + public Map getInjectVariablesMap(CodeGeneratorConfigForm form) { + Map variablesMap = new HashMap<>(); + List> finalQueryFiledList = new ArrayList<>(); + for (CodeQueryField queryField : form.getQueryFields()) { + Map fieldMap = BeanUtil.beanToMap(queryField); + finalQueryFiledList.add(fieldMap); + + //模糊查询 + if (CodeQueryFieldQueryTypeEnum.LIKE.getValue().equals(queryField.getQueryTypeEnum())) { + StringBuilder stringBuilder = new StringBuilder(); + List columnNameList = queryField.getColumnNameList(); + if (columnNameList.size() == 1) { + // AND INSTR(t_notice.title,#{query.keywords}) + stringBuilder.append(" AND INSTR(" )// + .append(form.getTableName()).append("." ).append(queryField.getColumnNameList().get(0)) + .append(",#{queryForm." ) + .append(queryField.getFieldName()) + .append("})" ); + } else { + for (int i = 0; i < columnNameList.size(); i++) { + if (i == 0) { + stringBuilder.append("AND ( INSTR(" )// + .append(form.getTableName()).append("." ).append(queryField.getColumnNameList().get(i)) + .append(",#{queryForm." ) + .append(queryField.getFieldName()) + .append("})" ); + } else { + // OR INSTR(t_notice.author,#{query.keywords}) + stringBuilder.append("\n OR INSTR(" )// + .append(form.getTableName()).append("." ).append(queryField.getColumnNameList().get(i)) + .append(",#{queryForm." ) + .append(queryField.getFieldName()) + .append("})" ); + } + } + stringBuilder.append("\n )" ); + } + fieldMap.put("likeStr", stringBuilder.toString()); + }else{ + fieldMap.put("columnName",queryField.getColumnNameList().get(0)); + } + } + + variablesMap.put("queryFields", finalQueryFiledList); + variablesMap.put("daoClassName", form.getBasic().getJavaPackageName() + ".dao." + form.getBasic().getModuleName() + "Dao" ); + return variablesMap; + } + + + public List getPackageList(List fields, CodeGeneratorConfigForm form) { + if (CollectionUtils.isEmpty(fields)) { + return new ArrayList<>(); + } + + HashSet packageList = new HashSet<>(); + + //1、javabean相关的包 + packageList.addAll(getJavaBeanImportClass(form)); + + //2、dao + packageList.add("import " + form.getBasic().getJavaPackageName() + ".dao." + form.getBasic().getModuleName() + "Dao;" ); + return new ArrayList<>(packageList); + } + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/domain/QueryFormVariableService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/domain/QueryFormVariableService.java new file mode 100644 index 00000000..18bf844e --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/domain/QueryFormVariableService.java @@ -0,0 +1,128 @@ +package net.lab1024.sa.common.module.support.codegenerator.service.variable.backend.domain; + +import cn.hutool.core.bean.BeanUtil; +import net.lab1024.sa.common.common.util.SmartEnumUtil; +import net.lab1024.sa.common.module.support.codegenerator.constant.CodeQueryFieldQueryTypeEnum; +import net.lab1024.sa.common.module.support.codegenerator.domain.form.CodeGeneratorConfigForm; +import net.lab1024.sa.common.module.support.codegenerator.domain.model.CodeField; +import net.lab1024.sa.common.module.support.codegenerator.domain.model.CodeQueryField; +import net.lab1024.sa.common.module.support.codegenerator.service.variable.CodeGenerateBaseVariableService; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.tuple.ImmutablePair; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @Author 1024创新实验室-主任:卓大 + * @Date 2022/9/29 17:20:41 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ + +public class QueryFormVariableService extends CodeGenerateBaseVariableService { + + + @Override + public boolean isSupport(CodeGeneratorConfigForm form) { + return true; + } + + @Override + public Map getInjectVariablesMap(CodeGeneratorConfigForm form) { + Map variablesMap = new HashMap<>(); + ImmutablePair, List>> packageListAndFields = getPackageListAndFields(form); + variablesMap.put("packageName", form.getBasic().getJavaPackageName() + ".domain.form"); + variablesMap.put("importPackageList", packageListAndFields.getLeft()); + variablesMap.put("fields", packageListAndFields.getRight()); + return variablesMap; + } + + + public ImmutablePair, List>> getPackageListAndFields(CodeGeneratorConfigForm form) { + List fields = form.getQueryFields(); + if (CollectionUtils.isEmpty(fields)) { + return ImmutablePair.of(new ArrayList<>(), new ArrayList<>()); + } + + HashSet packageList = new HashSet<>(); + + + /** + * 1、LocalDate、LocalDateTime、BigDecimal 类型的包名 + * 2、排序 + */ + + List> finalFieldList = new ArrayList<>(); + + for (CodeQueryField field : fields) { + + // CodeField 和 InsertAndUpdateField 合并 + Map finalFieldMap = BeanUtil.beanToMap(field); + finalFieldMap.putAll(BeanUtil.beanToMap(field)); + + String queryTypeEnumStr = field.getQueryTypeEnum(); + CodeQueryFieldQueryTypeEnum queryTypeEnum = SmartEnumUtil.getEnumByValue(queryTypeEnumStr, CodeQueryFieldQueryTypeEnum.class); + if (queryTypeEnum == null) { + continue; + } + + String apiModelProperty = "@ApiModelProperty(value = \"" + field.getLabel() + "\")"; + finalFieldMap.put("apiModelProperty", apiModelProperty); + packageList.add("import io.swagger.annotations.ApiModelProperty;"); + + CodeField codeField = null; + + switch (queryTypeEnum) { + case LIKE: + finalFieldMap.put("javaType", "String"); + break; + case EQUAL: + codeField = getCodeFieldByColumnName(field.getColumnNameList().get(0), form); + if (codeField == null) { + finalFieldMap.put("javaType", "String"); + } else { + finalFieldMap.put("javaType", codeField.getJavaType()); + } + break; + case DATE_RANGE: + case DATE: + packageList.add("import java.time.LocalDate;"); + finalFieldMap.put("javaType", "LocalDate"); + break; + case ENUM: + codeField = getCodeFieldByColumnName(field.getColumnNameList().get(0), form); + if (codeField == null) { + continue; + } + + packageList.add("import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum;"); + packageList.add("import net.lab1024.sa.common.common.validator.enumeration.CheckEnum;"); + packageList.add("import " + form.getBasic().getJavaPackageName() + ".constant." + codeField.getEnumName() + ";"); + + //enum check + String checkEnum = "@CheckEnum(value = " + codeField.getEnumName() + ".class, message = \"" + codeField.getLabel() + " 错误\")"; + finalFieldMap.put("apiModelProperty", "@ApiModelPropertyEnum(value = " + codeField.getEnumName() + ".class, desc = \"" + codeField.getLabel() + "\")"); + finalFieldMap.put("checkEnum", checkEnum); + finalFieldMap.put("isEnum", true); + + finalFieldMap.put("javaType", codeField.getJavaType()); + break; + default: + finalFieldMap.put("javaType", "String"); + } + + finalFieldList.add(finalFieldMap); + } + + + // lombok + packageList.add("import lombok.Data;"); + + List packageNameList = packageList.stream().filter(Objects::nonNull).collect(Collectors.toList()); + Collections.sort(packageNameList); + return ImmutablePair.of(packageNameList, finalFieldList); + } + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/domain/UpdateFormVariableService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/domain/UpdateFormVariableService.java new file mode 100644 index 00000000..b0323ad5 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/domain/UpdateFormVariableService.java @@ -0,0 +1,145 @@ +package net.lab1024.sa.common.module.support.codegenerator.service.variable.backend.domain; + +import cn.hutool.core.bean.BeanUtil; +import net.lab1024.sa.common.common.util.SmartStringUtil; +import net.lab1024.sa.common.module.support.codegenerator.domain.form.CodeGeneratorConfigForm; +import net.lab1024.sa.common.module.support.codegenerator.domain.model.CodeField; +import net.lab1024.sa.common.module.support.codegenerator.domain.model.CodeInsertAndUpdate; +import net.lab1024.sa.common.module.support.codegenerator.domain.model.CodeInsertAndUpdateField; +import net.lab1024.sa.common.module.support.codegenerator.service.variable.CodeGenerateBaseVariableService; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.tuple.ImmutablePair; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @Author 1024创新实验室-主任:卓大 + * @Date 2022/9/29 17:20:41 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ + +public class UpdateFormVariableService extends CodeGenerateBaseVariableService { + + + @Override + public boolean isSupport(CodeGeneratorConfigForm form) { + CodeInsertAndUpdate insertAndUpdate = form.getInsertAndUpdate(); + return insertAndUpdate != null && insertAndUpdate.getIsSupportInsertAndUpdate() != null && insertAndUpdate.getIsSupportInsertAndUpdate(); + } + + @Override + public Map getInjectVariablesMap(CodeGeneratorConfigForm form) { + Map variablesMap = new HashMap<>(); + + Map fieldMap = getFieldMap(form); + List updateFieldList = form.getInsertAndUpdate().getFieldList().stream().filter(e -> { + boolean isUpdate = Boolean.TRUE.equals(e.getUpdateFlag()); + CodeField codeField = fieldMap.get(e.getColumnName()); + if (codeField == null) { + return false; + } + + if(Boolean.TRUE.equals(codeField.getPrimaryKeyFlag())){ + e.setRequiredFlag(true); + } + + return isUpdate || Boolean.TRUE.equals(codeField.getPrimaryKeyFlag()); + } + + ).collect(Collectors.toList()); + + ImmutablePair, List>> packageListAndFields = getPackageListAndFields(updateFieldList, form); + + variablesMap.put("packageName", form.getBasic().getJavaPackageName() + ".domain.form"); + variablesMap.put("importPackageList", packageListAndFields.getLeft()); + variablesMap.put("fields", packageListAndFields.getRight()); + + return variablesMap; + } + + public ImmutablePair, List>> getPackageListAndFields(List fields, CodeGeneratorConfigForm form) { + if (CollectionUtils.isEmpty(fields)) { + return ImmutablePair.of(new ArrayList<>(), new ArrayList<>()); + } + + Map fieldMap = getFieldMap(form); + HashSet packageList = new HashSet<>(); + + + /** + * 1、LocalDate、LocalDateTime、BigDecimal 类型的包名 + * 2、排序 + */ + + List> finalFieldList = new ArrayList<>(); + + for (CodeInsertAndUpdateField field : fields) { + CodeField codeField = fieldMap.get(field.getColumnName()); + if (codeField == null) { + continue; + } + + // CodeField 和 InsertAndUpdateField 合并 + Map finalFieldMap = BeanUtil.beanToMap(field); + finalFieldMap.putAll(BeanUtil.beanToMap(codeField)); + + // 枚举 + if (SmartStringUtil.isNotEmpty(codeField.getEnumName())) { + packageList.add("import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum;"); + packageList.add("import net.lab1024.sa.common.common.validator.enumeration.CheckEnum;"); + packageList.add("import " + form.getBasic().getJavaPackageName() + ".constant." + codeField.getEnumName() + ";"); + + //enum check + String checkEnumPrefix = "@CheckEnum(value = " + codeField.getEnumName() + ".class, message = \"" + codeField.getLabel() + " 错误\""; + String checkEnum = checkEnumPrefix + (field.getRequiredFlag() ? ", required = true)" : ")"); + + finalFieldMap.put("apiModelProperty", "@ApiModelPropertyEnum(value = " + codeField.getEnumName() + ".class, desc = \"" + codeField.getLabel() + "\")"); + finalFieldMap.put("checkEnum", checkEnum); + finalFieldMap.put("isEnum", true); + + } else { + String prefix = "@ApiModelProperty(value = \"" + codeField.getLabel() + "\""; + String apiModelProperty = prefix + (field.getRequiredFlag() ? ", required = true)" : ")"); + finalFieldMap.put("apiModelProperty", apiModelProperty); + + packageList.add("import io.swagger.annotations.ApiModelProperty;"); + + if (Boolean.TRUE.equals(field.getRequiredFlag())) { + String notEmptyPrefix = "String".equals(codeField.getJavaType()) ? "@NotBlank" : "@NotNull"; + finalFieldMap.put("notEmpty", "\n " + notEmptyPrefix + "(message = \"" + codeField.getLabel() + " 不能为空\")"); + packageList.add("String".equals(codeField.getJavaType()) ? "import javax.validation.constraints.NotBlank;" : "import javax.validation.constraints.NotNull;"); + } + } + + + //字典 + if (SmartStringUtil.isNotEmpty(codeField.getDict())) { + finalFieldMap.put("dict", "\n @JsonDeserialize(using = DictValueVoDeserializer.class)"); + packageList.add("import com.fasterxml.jackson.databind.annotation.JsonDeserialize;"); + packageList.add("import net.lab1024.sa.common.common.json.deserializer.DictValueVoDeserializer;"); + } + + //文件上传 + if (SmartStringUtil.contains(field.getFrontComponent(), "Upload")) { + finalFieldMap.put("file", "\n @JsonDeserialize(using = FileKeyVoDeserializer.class)"); + packageList.add("import com.fasterxml.jackson.databind.annotation.JsonDeserialize;"); + packageList.add("import net.lab1024.sa.common.common.json.deserializer.FileKeyVoDeserializer;"); + } + + packageList.add(getJavaPackageName(codeField.getJavaType())); + finalFieldList.add(finalFieldMap); + } + + + // lombok + packageList.add("import lombok.Data;"); + + List packageNameList = packageList.stream().filter(Objects::nonNull).collect(Collectors.toList()); + Collections.sort(packageNameList); + return ImmutablePair.of(packageNameList, finalFieldList); + } + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/domain/VOVariableService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/domain/VOVariableService.java new file mode 100644 index 00000000..821629e1 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/backend/domain/VOVariableService.java @@ -0,0 +1,115 @@ +package net.lab1024.sa.common.module.support.codegenerator.service.variable.backend.domain; + +import cn.hutool.core.bean.BeanUtil; +import net.lab1024.sa.common.common.util.SmartStringUtil; +import net.lab1024.sa.common.module.support.codegenerator.domain.form.CodeGeneratorConfigForm; +import net.lab1024.sa.common.module.support.codegenerator.domain.model.CodeField; +import net.lab1024.sa.common.module.support.codegenerator.domain.model.CodeTableField; +import net.lab1024.sa.common.module.support.codegenerator.service.variable.CodeGenerateBaseVariableService; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.tuple.ImmutablePair; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @Author 1024创新实验室-主任:卓大 + * @Date 2022/9/29 17:20:41 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ + +public class VOVariableService extends CodeGenerateBaseVariableService { + + @Override + public boolean isSupport(CodeGeneratorConfigForm form) { + return true; + } + + @Override + public Map getInjectVariablesMap(CodeGeneratorConfigForm form) { + Map variablesMap = new HashMap<>(); + + Map fieldMap = getFieldMap(form); + List updateFieldList = form.getTableFields().stream().filter(e -> Boolean.TRUE.equals(e.getShowFlag())).collect(Collectors.toList()); + + ImmutablePair, List>> packageListAndFields = getPackageListAndFields(updateFieldList, form); + + variablesMap.put("packageName", form.getBasic().getJavaPackageName() + ".domain.vo"); + variablesMap.put("importPackageList", packageListAndFields.getLeft()); + variablesMap.put("fields", packageListAndFields.getRight()); + + return variablesMap; + } + + public ImmutablePair, List>> getPackageListAndFields(List fields, CodeGeneratorConfigForm form) { + if (CollectionUtils.isEmpty(fields)) { + return ImmutablePair.of(new ArrayList<>(), new ArrayList<>()); + } + + Map fieldMap = getFieldMap(form); + HashSet packageList = new HashSet<>(); + + + /** + * 1、LocalDate、LocalDateTime、BigDecimal 类型的包名 + * 2、排序 + */ + + List> finalFieldList = new ArrayList<>(); + + for (CodeTableField field : fields) { + CodeField codeField = fieldMap.get(field.getColumnName()); + if (codeField == null) { + continue; + } + + // CodeField 和 CodeTableField 合并 + Map finalFieldMap = BeanUtil.beanToMap(field); + finalFieldMap.putAll(BeanUtil.beanToMap(codeField)); + + // 枚举 + if (SmartStringUtil.isNotEmpty(codeField.getEnumName())) { + packageList.add("import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum;"); + packageList.add("import " + form.getBasic().getJavaPackageName() + ".constant." + codeField.getEnumName() + ";"); + + finalFieldMap.put("apiModelProperty", "@ApiModelPropertyEnum(value = " + codeField.getEnumName() + ".class, desc = \"" + codeField.getLabel() + "\")"); + finalFieldMap.put("isEnum", true); + + } else { + String apiModelProperty = "@ApiModelProperty(value = \"" + codeField.getLabel() + "\")"; + finalFieldMap.put("apiModelProperty", apiModelProperty); + + packageList.add("import io.swagger.annotations.ApiModelProperty;"); + } + + + //字典 + if (isDict(field.getColumnName(), form)) { + finalFieldMap.put("dict", "\n @JsonDeserialize(using = DictValueVoDeserializer.class)"); + packageList.add("import com.fasterxml.jackson.databind.annotation.JsonDeserialize;"); + packageList.add("import net.lab1024.sa.common.common.json.deserializer.DictValueVoDeserializer;"); + } + + //文件上传 + if (isFile(field.getColumnName(), form)) { + finalFieldMap.put("file", "\n @JsonDeserialize(using = FileKeyVoDeserializer.class)"); + packageList.add("import com.fasterxml.jackson.databind.annotation.JsonDeserialize;"); + packageList.add("import net.lab1024.sa.common.common.json.deserializer.FileKeyVoDeserializer;"); + } + + packageList.add(getJavaPackageName(codeField.getJavaType())); + finalFieldList.add(finalFieldMap); + } + + + // lombok + packageList.add("import lombok.Data;"); + + List packageNameList = packageList.stream().filter(Objects::nonNull).collect(Collectors.toList()); + Collections.sort(packageNameList); + return ImmutablePair.of(packageNameList, finalFieldList); + } + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/front/ApiVariableService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/front/ApiVariableService.java new file mode 100644 index 00000000..22af04c9 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/front/ApiVariableService.java @@ -0,0 +1,29 @@ +package net.lab1024.sa.common.module.support.codegenerator.service.variable.front; + +import net.lab1024.sa.common.module.support.codegenerator.domain.form.CodeGeneratorConfigForm; +import net.lab1024.sa.common.module.support.codegenerator.service.variable.CodeGenerateBaseVariableService; + +import java.util.*; + +/** + * @Author 1024创新实验室-主任:卓大 + * @Date 2022/9/29 17:20:41 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ + +public class ApiVariableService extends CodeGenerateBaseVariableService { + + @Override + public boolean isSupport(CodeGeneratorConfigForm form) { + return true; + } + + @Override + public Map getInjectVariablesMap(CodeGeneratorConfigForm form) { + Map variablesMap = new HashMap<>(); + + return variablesMap; + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/front/ConstVariableService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/front/ConstVariableService.java new file mode 100644 index 00000000..0ce4b954 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/front/ConstVariableService.java @@ -0,0 +1,45 @@ +package net.lab1024.sa.common.module.support.codegenerator.service.variable.front; + +import cn.hutool.core.bean.BeanUtil; +import com.google.common.base.CaseFormat; +import net.lab1024.sa.common.common.util.SmartStringUtil; +import net.lab1024.sa.common.module.support.codegenerator.domain.form.CodeGeneratorConfigForm; +import net.lab1024.sa.common.module.support.codegenerator.domain.model.CodeField; +import net.lab1024.sa.common.module.support.codegenerator.service.variable.CodeGenerateBaseVariableService; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @Author 1024创新实验室-主任:卓大 + * @Date 2022/9/29 17:20:41 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ + +public class ConstVariableService extends CodeGenerateBaseVariableService { + + @Override + public boolean isSupport(CodeGeneratorConfigForm form) { + return true; + } + + @Override + public Map getInjectVariablesMap(CodeGeneratorConfigForm form) { + Map variablesMap = new HashMap<>(); + List> enumList = new ArrayList<>(); + List enumFiledList = form.getFields().stream().filter(e -> SmartStringUtil.isNotBlank(e.getEnumName())).collect(Collectors.toList()); + for (CodeField codeField : enumFiledList) { + Map beanToMap = BeanUtil.beanToMap(codeField); + String upperUnderscoreEnum = CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, codeField.getEnumName()); + beanToMap.put("upperUnderscoreEnum", upperUnderscoreEnum); + enumList.add(beanToMap); + } + variablesMap.put("enumList", enumList); + return variablesMap; + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/front/FormVariableService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/front/FormVariableService.java new file mode 100644 index 00000000..544d74fa --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/front/FormVariableService.java @@ -0,0 +1,82 @@ +package net.lab1024.sa.common.module.support.codegenerator.service.variable.front; + +import cn.hutool.core.bean.BeanUtil; +import com.google.common.base.CaseFormat; +import net.lab1024.sa.common.common.util.SmartStringUtil; +import net.lab1024.sa.common.module.support.codegenerator.constant.CodeFrontComponentEnum; +import net.lab1024.sa.common.module.support.codegenerator.domain.form.CodeGeneratorConfigForm; +import net.lab1024.sa.common.module.support.codegenerator.domain.model.CodeField; +import net.lab1024.sa.common.module.support.codegenerator.domain.model.CodeInsertAndUpdateField; +import net.lab1024.sa.common.module.support.codegenerator.service.variable.CodeGenerateBaseVariableService; + +import java.util.*; + +/** + * @Author 1024创新实验室-主任:卓大 + * @Date 2022/9/29 17:20:41 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ + +public class FormVariableService extends CodeGenerateBaseVariableService { + + @Override + public boolean isSupport(CodeGeneratorConfigForm form) { + return true; + } + + @Override + public Map getInjectVariablesMap(CodeGeneratorConfigForm form) { + Map variablesMap = new HashMap<>(); + List> fieldsVariableList = new ArrayList<>(); + List fieldList = form.getInsertAndUpdate().getFieldList(); + + HashSet frontImportSet = new HashSet<>(); + + for (CodeInsertAndUpdateField field : fieldList) { + // 不存在 添加 和 更新 + if (!(field.getInsertFlag() || field.getUpdateFlag())) { + continue; + } + + Map objectMap = BeanUtil.beanToMap(field); + + CodeField codeField = getCodeFieldByColumnName(field.getColumnName(), form); + if (codeField == null) { + continue; + } + objectMap.put("label", codeField.getLabel()); + objectMap.put("fieldName", codeField.getFieldName()); + objectMap.put("dict", codeField.getDict()); + + if (SmartStringUtil.isNotBlank(codeField.getEnumName())) { + String upperUnderscoreEnum = CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, codeField.getEnumName()); + objectMap.put("upperUnderscoreEnum", upperUnderscoreEnum); + } + + fieldsVariableList.add(objectMap); + + if (CodeFrontComponentEnum.ENUM_SELECT.getValue().equals(field.getFrontComponent())) { + frontImportSet.add("import SmartEnumSelect from '/@/components/framework/smart-enum-select/index.vue';"); + } + + if (CodeFrontComponentEnum.BOOLEAN_SELECT.getValue().equals(field.getFrontComponent())) { + frontImportSet.add("import BooleanSelect from '/@/components/framework/boolean-select/index.vue';"); + } + + if (CodeFrontComponentEnum.DICT_SELECT.getValue().equals(field.getFrontComponent())) { + frontImportSet.add("import DictSelect from '/@/components/support/dict-select/index.vue';"); + } + + if (CodeFrontComponentEnum.FILE_UPLOAD.getValue().equals(field.getFrontComponent())) { + frontImportSet.add("import FileUpload from '/@/components/support/file-upload/index.vue';"); + } + } + + variablesMap.put("formFields", fieldsVariableList); + variablesMap.put("frontImportList", new ArrayList<>(frontImportSet)); + + return variablesMap; + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/front/ListVariableService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/front/ListVariableService.java new file mode 100644 index 00000000..df051618 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/service/variable/front/ListVariableService.java @@ -0,0 +1,57 @@ +package net.lab1024.sa.common.module.support.codegenerator.service.variable.front; + +import cn.hutool.core.bean.BeanUtil; +import com.google.common.base.CaseFormat; +import net.lab1024.sa.common.module.support.codegenerator.constant.CodeQueryFieldQueryTypeEnum; +import net.lab1024.sa.common.module.support.codegenerator.domain.form.CodeGeneratorConfigForm; +import net.lab1024.sa.common.module.support.codegenerator.domain.model.CodeQueryField; +import net.lab1024.sa.common.module.support.codegenerator.service.variable.CodeGenerateBaseVariableService; + +import java.util.*; + +/** + * @Author 1024创新实验室-主任:卓大 + * @Date 2022/9/29 17:20:41 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ + +public class ListVariableService extends CodeGenerateBaseVariableService { + + @Override + public boolean isSupport(CodeGeneratorConfigForm form) { + return true; + } + + @Override + public Map getInjectVariablesMap(CodeGeneratorConfigForm form) { + Map variablesMap = new HashMap<>(); + + List> variableList = new ArrayList<>(); + List queryFields = form.getQueryFields(); + HashSet frontImportSet = new HashSet<>(); + frontImportSet.add("import " + CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_CAMEL, form.getBasic().getModuleName()) + "Form from './" + CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_HYPHEN, form.getBasic().getModuleName()) + "-form.vue';"); + + for (CodeQueryField queryField : queryFields) { + Map objectMap = BeanUtil.beanToMap(queryField); + variableList.add(objectMap); + + if("Enum".equals(queryField.getQueryTypeEnum())){ + frontImportSet.add("import SmartEnumSelect from '/@/components/framework/smart-enum-select/index.vue';"); + } + + if("Dict".equals(queryField.getQueryTypeEnum())){ + frontImportSet.add("import DictSelect from '/@/components/support/dict-select/index.vue';"); + } + + if(CodeQueryFieldQueryTypeEnum.DATE_RANGE.getValue().equals(queryField.getQueryTypeEnum())){ + frontImportSet.add("import { defaultTimeRanges } from '/@/lib/default-time-ranges';"); + } + + } + variablesMap.put("queryFields",variableList); + variablesMap.put("frontImportList",new ArrayList<>(frontImportSet)); + return variablesMap; + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/util/CodeGeneratorTool.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/util/CodeGeneratorTool.java new file mode 100644 index 00000000..b4843e66 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/codegenerator/util/CodeGeneratorTool.java @@ -0,0 +1,59 @@ +package net.lab1024.sa.common.module.support.codegenerator.util; + +import com.google.common.base.CaseFormat; +import net.lab1024.sa.common.common.constant.StringConst; + +/** + * 代码生成 velocity 工具类 + * + * @Author 1024创新实验室-主任:卓大 + * @Date 2022/9/30 19:02:17 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),2012-2022 + */ + +public class CodeGeneratorTool { + + /** + * 小写驼峰,转为大写驼峰 + */ + public String lowerCamel2UpperCamel(String str) { + if (str == null) { + return StringConst.EMPTY; + } + return CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_CAMEL, str); + } + + /** + * 小写驼峰,转为小写中划线 + */ + public String lowerCamel2LowerHyphen(String str) { + if (str == null) { + return StringConst.EMPTY; + } + return CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_HYPHEN, str); + } + + + /** + * 去掉 注释 枚举类型 + */ + public String removeEnumDesc(String str) { + if (str == null) { + return StringConst.EMPTY; + } + + int index = str.indexOf("["); + if (index == -1) { + index = str.indexOf("【"); + } + + if (index == -1) { + return str; + } + + return str.substring(0, index - 1); + } + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/config/ConfigController.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/config/ConfigController.java new file mode 100644 index 00000000..5eee1999 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/config/ConfigController.java @@ -0,0 +1,36 @@ +package net.lab1024.sa.common.module.support.config; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import net.lab1024.sa.common.common.controller.SupportBaseController; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.constant.SwaggerTagConst; +import net.lab1024.sa.common.module.support.config.domain.ConfigVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * 配置 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-03-14 20:46:27 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Api(tags = {SwaggerTagConst.Support.CONFIG}) +@RestController +public class ConfigController extends SupportBaseController { + + @Autowired + private ConfigService configService; + + @ApiOperation("查询配置详情 @author 卓大") + @GetMapping("/config/queryByKey") + public ResponseDTO queryByKey(@RequestParam String configKey) { + return ResponseDTO.ok(configService.getConfig(configKey)); + } + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/config/ConfigDao.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/config/ConfigDao.java new file mode 100644 index 00000000..e2e9cde8 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/config/ConfigDao.java @@ -0,0 +1,41 @@ +package net.lab1024.sa.common.module.support.config; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import net.lab1024.sa.common.module.support.config.domain.ConfigEntity; +import net.lab1024.sa.common.module.support.config.domain.ConfigQueryForm; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * 系统参数配置 t_config Dao层 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-03-14 20:46:27 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Component +@Mapper +public interface ConfigDao extends BaseMapper { + + /** + * 分页查询系统配置 + * + * @param page + * @return + */ + List queryByPage(Page page, @Param("query") ConfigQueryForm queryDTO); + + /** + * 根据key查询获取数据 + * + * @param key + * @return + */ + ConfigEntity selectByKey(String key); +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/config/ConfigKeyEnum.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/config/ConfigKeyEnum.java new file mode 100644 index 00000000..eb3b0a22 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/config/ConfigKeyEnum.java @@ -0,0 +1,35 @@ +package net.lab1024.sa.common.module.support.config; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import net.lab1024.sa.common.common.enumeration.BaseEnum; + +/** + * 系统配置常量类 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-03-14 20:46:27 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Getter +@AllArgsConstructor +public enum ConfigKeyEnum implements BaseEnum { + + /** + * 本地上传路径前缀 + */ + LOCAL_UPLOAD_URL_PREFIX("local_upload_url_prefix", "本地上传路径前缀"), + + /** + * 万能密码 + */ + SUPER_PASSWORD("super_password", "万能密码"), + + ; + + private final String value; + + private final String desc; +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/config/ConfigService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/config/ConfigService.java new file mode 100644 index 00000000..04285106 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/config/ConfigService.java @@ -0,0 +1,205 @@ +package net.lab1024.sa.common.module.support.config; + +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.extern.slf4j.Slf4j; +import net.lab1024.sa.common.common.code.UserErrorCode; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.util.SmartBeanUtil; +import net.lab1024.sa.common.common.util.SmartPageUtil; +import net.lab1024.sa.common.constant.ReloadConst; +import net.lab1024.sa.common.module.support.config.domain.*; +import net.lab1024.sa.common.module.support.reload.core.annoation.SmartReload; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.annotation.PostConstruct; +import java.util.List; +import java.util.Objects; +import java.util.concurrent.ConcurrentHashMap; + +/** + * 系统配置业务类 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-03-14 20:46:27 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Slf4j +@Service +public class ConfigService { + + /** + * 一个简单的系统配置缓存 + */ + private final ConcurrentHashMap configCache = new ConcurrentHashMap<>(); + + @Autowired + private ConfigDao configDao; + + @SmartReload(ReloadConst.CONFIG_RELOAD) + public void configReload(String param) { + this.loadConfigCache(); + } + + /** + * 初始化系统设置缓存 + */ + @PostConstruct + private void loadConfigCache() { + configCache.clear(); + List entityList = configDao.selectList(null); + if (CollectionUtils.isEmpty(entityList)) { + return; + } + entityList.forEach(entity -> this.configCache.put(entity.getConfigKey().toLowerCase(), entity)); + log.info("################# 系统配置缓存初始化完毕:{} ###################", configCache.size()); + } + + /** + * 刷新系统设置缓存 + */ + private void refreshConfigCache(Long configId) { + // 重新查询 加入缓存 + ConfigEntity configEntity = configDao.selectById(configId); + if (null == configEntity) { + return; + } + this.configCache.put(configEntity.getConfigKey().toLowerCase(), configEntity); + } + + /** + * 分页查询系统配置 + * + * @param queryDTO + * @return + */ + public ResponseDTO> queryConfigPage(ConfigQueryForm queryDTO) { + Page page = SmartPageUtil.convert2PageQuery(queryDTO); + List entityList = configDao.queryByPage(page, queryDTO); + PageResult pageResult = SmartPageUtil.convert2PageResult(page, entityList, ConfigVO.class); + return ResponseDTO.ok(pageResult); + } + + /** + * 查询配置缓存 + * + * @param configKey + * @return + */ + public ConfigVO getConfig(ConfigKeyEnum configKey) { + return this.getConfig(configKey.getValue()); + } + + /** + * 查询配置缓存 + * + * @param configKey + * @return + */ + public ConfigVO getConfig(String configKey) { + if (StrUtil.isBlank(configKey)) { + return null; + } + ConfigEntity entity = this.configCache.get(configKey.toLowerCase()); + return SmartBeanUtil.copy(entity, ConfigVO.class); + } + + /** + * 查询配置缓存参数 + * + * @param configKey + * @return + */ + public String getConfigValue(ConfigKeyEnum configKey) { + return this.getConfig(configKey).getConfigValue(); + } + + /** + * 根据参数key查询 并转换为对象 + * + * @param configKey + * @param clazz + * @param + * @return + */ + public T getConfigValue2Obj(ConfigKeyEnum configKey, Class clazz) { + String configValue = this.getConfigValue(configKey); + return JSON.parseObject(configValue, clazz); + } + + /** + * 添加系统配置 + * + * @param configAddDTO + * @return + */ + public ResponseDTO add(ConfigAddForm configAddDTO) { + ConfigEntity entity = configDao.selectByKey(configAddDTO.getConfigKey()); + if (null != entity) { + return ResponseDTO.error(UserErrorCode.ALREADY_EXIST); + } + entity = SmartBeanUtil.copy(configAddDTO, ConfigEntity.class); + configDao.insert(entity); + + // 刷新缓存 + this.refreshConfigCache(entity.getConfigId()); + return ResponseDTO.ok(); + } + + /** + * 更新系统配置 + * + * @param updateDTO + * @return + */ + public ResponseDTO updateSystemConfig(ConfigUpdateForm updateDTO) { + Long configId = updateDTO.getConfigId(); + ConfigEntity entity = configDao.selectById(configId); + if (null == entity) { + return ResponseDTO.error(UserErrorCode.DATA_NOT_EXIST); + } + ConfigEntity alreadyEntity = configDao.selectByKey(updateDTO.getConfigKey()); + if (null != alreadyEntity && !Objects.equals(configId, alreadyEntity.getConfigId())) { + return ResponseDTO.error(UserErrorCode.ALREADY_EXIST, "config key 已存在"); + } + + // 更新数据 + entity = SmartBeanUtil.copy(updateDTO, ConfigEntity.class); + configDao.updateById(entity); + + // 刷新缓存 + this.refreshConfigCache(configId); + return ResponseDTO.ok(); + } + + /** + * 更新系统配置 + * + * @param key + * @param value + * @return + */ + public ResponseDTO updateValueByKey(ConfigKeyEnum key, String value) { + ConfigVO config = this.getConfig(key); + if (null == config) { + return ResponseDTO.error(UserErrorCode.DATA_NOT_EXIST); + } + + // 更新数据 + Long configId = config.getConfigId(); + ConfigEntity entity = new ConfigEntity(); + entity.setConfigId(configId); + entity.setConfigValue(value); + configDao.updateById(entity); + + // 刷新缓存 + this.refreshConfigCache(configId); + return ResponseDTO.ok(); + } +} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/domain/dto/SystemConfigAddDTO.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/config/domain/ConfigAddForm.java similarity index 61% rename from smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/domain/dto/SystemConfigAddDTO.java rename to smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/config/domain/ConfigAddForm.java index 18b8a7c9..e7b480cf 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/domain/dto/SystemConfigAddDTO.java +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/config/domain/ConfigAddForm.java @@ -1,4 +1,4 @@ -package net.lab1024.smartadmin.module.system.systemconfig.domain.dto; +package net.lab1024.sa.common.module.support.config.domain; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -7,17 +7,16 @@ import org.hibernate.validator.constraints.Length; import javax.validation.constraints.NotBlank; /** - * [ ] + * 添加配置表单 * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - * @since JDK1.8 + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-03-14 20:46:27 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) */ @Data -public class SystemConfigAddDTO { +public class ConfigAddForm { @ApiModelProperty("参数key") @NotBlank(message = "参数key不能为空") @@ -26,7 +25,7 @@ public class SystemConfigAddDTO { @ApiModelProperty("参数的值") @NotBlank(message = "参数的值不能为空") - @Length(max = 65530, message = "参数的值最多65530个字符") + @Length(max = 60000, message = "参数的值最多60000个字符") private String configValue; @ApiModelProperty("参数名称") @@ -34,11 +33,6 @@ public class SystemConfigAddDTO { @Length(max = 255, message = "参数名称最多255个字符") private String configName; - @ApiModelProperty("参数类别") - @NotBlank(message = "参数类别不能为空") - @Length(max = 255, message = "参数类别最多255个字符") - private String configGroup; - @ApiModelProperty("备注") @Length(max = 255, message = "备注最多255个字符") private String remark; diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/config/domain/ConfigEntity.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/config/domain/ConfigEntity.java new file mode 100644 index 00000000..13a3abca --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/config/domain/ConfigEntity.java @@ -0,0 +1,49 @@ +package net.lab1024.sa.common.module.support.config.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * 系统配置参数 实体类 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-03-14 20:46:27 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +@TableName("t_config") +public class ConfigEntity { + + @TableId(type = IdType.AUTO) + private Long configId; + + /** + * 参数key + */ + private String configKey; + + /** + * 参数的值 + */ + private String configValue; + + /** + * 参数名称 + */ + private String configName; + + /** + * 备注 + */ + private String remark; + + private LocalDateTime updateTime; + + private LocalDateTime createTime; +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/config/domain/ConfigQueryForm.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/config/domain/ConfigQueryForm.java new file mode 100644 index 00000000..8e56af1b --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/config/domain/ConfigQueryForm.java @@ -0,0 +1,23 @@ +package net.lab1024.sa.common.module.support.config.domain; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.domain.PageParam; +import org.hibernate.validator.constraints.Length; + +/** + * 分页查询 系统配置 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-03-14 20:46:27 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class ConfigQueryForm extends PageParam { + + @ApiModelProperty("参数KEY") + @Length(max = 50, message = "参数Key最多50字符") + private String configKey; +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/config/domain/ConfigUpdateForm.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/config/domain/ConfigUpdateForm.java new file mode 100644 index 00000000..816ced02 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/config/domain/ConfigUpdateForm.java @@ -0,0 +1,23 @@ +package net.lab1024.sa.common.module.support.config.domain; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * 配置更新表单 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-03-14 20:46:27 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class ConfigUpdateForm extends ConfigAddForm { + + @ApiModelProperty("configId") + @NotNull(message = "configId不能为空") + private Long configId; +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/config/domain/ConfigVO.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/config/domain/ConfigVO.java new file mode 100644 index 00000000..17230d81 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/config/domain/ConfigVO.java @@ -0,0 +1,39 @@ +package net.lab1024.sa.common.module.support.config.domain; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * 配置信息 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-03-14 20:46:27 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class ConfigVO { + @ApiModelProperty("主键") + private Long configId; + + @ApiModelProperty("参数key") + private String configKey; + + @ApiModelProperty("参数的值") + private String configValue; + + @ApiModelProperty("参数名称") + private String configName; + + @ApiModelProperty("备注") + private String remark; + + @ApiModelProperty("创建时间") + private LocalDateTime createTime; + + @ApiModelProperty("上次修改时间") + private LocalDateTime updateTime; +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/annoation/DataTracerFieldBigDecimal.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/annoation/DataTracerFieldBigDecimal.java new file mode 100644 index 00000000..adb292c7 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/annoation/DataTracerFieldBigDecimal.java @@ -0,0 +1,21 @@ +package net.lab1024.sa.common.module.support.datatracer.annoation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 数据变动字段注解 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-07-23 19:38:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +public @interface DataTracerFieldBigDecimal { + int scale() default 2; +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/annoation/DataTracerFieldDict.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/annoation/DataTracerFieldDict.java new file mode 100644 index 00000000..898a3936 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/annoation/DataTracerFieldDict.java @@ -0,0 +1,22 @@ +package net.lab1024.sa.common.module.support.datatracer.annoation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 字典的字段 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-07-23 19:38:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +public @interface DataTracerFieldDict { + + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/annoation/DataTracerFieldEnum.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/annoation/DataTracerFieldEnum.java new file mode 100644 index 00000000..d9841c75 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/annoation/DataTracerFieldEnum.java @@ -0,0 +1,25 @@ +package net.lab1024.sa.common.module.support.datatracer.annoation; + +import net.lab1024.sa.common.common.enumeration.BaseEnum; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 字段枚举 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-07-23 19:38:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +public @interface DataTracerFieldEnum { + + Class enumClass() default BaseEnum.class; + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/annoation/DataTracerFieldLabel.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/annoation/DataTracerFieldLabel.java new file mode 100644 index 00000000..089325b4 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/annoation/DataTracerFieldLabel.java @@ -0,0 +1,26 @@ +package net.lab1024.sa.common.module.support.datatracer.annoation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 字段标签 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-07-23 19:38:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +public @interface DataTracerFieldLabel { + /** + * 本属性的注释信息 + * @return + */ + String value() default ""; + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/annoation/DataTracerFieldSql.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/annoation/DataTracerFieldSql.java new file mode 100644 index 00000000..4f76636a --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/annoation/DataTracerFieldSql.java @@ -0,0 +1,40 @@ +package net.lab1024.sa.common.module.support.datatracer.annoation; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 支持查询sql + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-07-23 19:38:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +public @interface DataTracerFieldSql { + + /** + * 关联字段名称 + * @return + */ + String relateColumn() default "id"; + + /** + * 关联显示的字段 + * @return + */ + String relateDisplayColumn() default ""; + /** + * 是否关联字段查询Mapper + * @return + */ + Class relateMapper() default BaseMapper.class; + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/constant/DataTracerConst.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/constant/DataTracerConst.java new file mode 100644 index 00000000..729a241f --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/constant/DataTracerConst.java @@ -0,0 +1,27 @@ +package net.lab1024.sa.common.module.support.datatracer.constant; + +/** + * 常量 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-07-23 19:38:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public class DataTracerConst { + + public static final String TAB = " "; + + public static final String SPLIT_LINE = "-----------------------------"; + + public static final String BLANK = " "; + public static final String SPLIT = ": "; + public static final String HTML_BR = "
"; + + public static final String INSERT = "新增"; + + public static final String DELETE = "删除"; + + public static final String UPDATE = "修改"; +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/constant/DataTracerTypeEnum.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/constant/DataTracerTypeEnum.java new file mode 100644 index 00000000..0bed6700 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/constant/DataTracerTypeEnum.java @@ -0,0 +1,32 @@ +package net.lab1024.sa.common.module.support.datatracer.constant; + + +import lombok.AllArgsConstructor; +import lombok.Getter; +import net.lab1024.sa.common.common.enumeration.BaseEnum; + +/** + * 数据业务类型 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-07-23 19:38:52- + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@AllArgsConstructor +@Getter +public enum DataTracerTypeEnum implements BaseEnum { + + GOODS(1, "商品"), + + OA_NOTICE(2, "OA-通知公告"), + + OA_ENTERPRISE(3, "OA-企业信息"), + + ; + + private final Integer value; + + private final String desc; +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/controller/DataTracerController.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/controller/DataTracerController.java new file mode 100644 index 00000000..2fabdd6a --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/controller/DataTracerController.java @@ -0,0 +1,40 @@ +package net.lab1024.sa.common.module.support.datatracer.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import net.lab1024.sa.common.common.controller.SupportBaseController; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.constant.SwaggerTagConst; +import net.lab1024.sa.common.module.support.datatracer.domain.form.DataTracerQueryForm; +import net.lab1024.sa.common.module.support.datatracer.domain.vo.DataTracerVO; +import net.lab1024.sa.common.module.support.datatracer.service.DataTracerService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +import javax.validation.Valid; + +/** + * 数据变动记录 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-07-23 19:38:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Api(tags = {SwaggerTagConst.Support.DATA_TRACER}) +@RestController +public class DataTracerController extends SupportBaseController { + + @Autowired + private DataTracerService dataTracerService; + + @ApiOperation("分页查询业务操作日志 - @author 卓大") + @PostMapping("/dataTracer/query") + public ResponseDTO> query(@Valid @RequestBody DataTracerQueryForm queryForm) { + return dataTracerService.query(queryForm); + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/dao/DataTracerDao.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/dao/DataTracerDao.java new file mode 100644 index 00000000..989b6382 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/dao/DataTracerDao.java @@ -0,0 +1,42 @@ +package net.lab1024.sa.common.module.support.datatracer.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import net.lab1024.sa.common.module.support.datatracer.domain.entity.DataTracerEntity; +import net.lab1024.sa.common.module.support.datatracer.domain.form.DataTracerQueryForm; +import net.lab1024.sa.common.module.support.datatracer.domain.vo.DataTracerVO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * dao: t_data_tracker + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-07-23 19:38:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Mapper +@Component +public interface DataTracerDao extends BaseMapper { + + /** + * 操作记录查询 + * + * @return + */ + List selectRecord(@Param("dataId") Long dataId, @Param("dataType") Integer dataType); + + /** + * 分页查询 + * + * @param page + * @param queryForm + * @return + */ + List query(Page page, @Param("query") DataTracerQueryForm queryForm); +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/domain/bo/DataTracerContentBO.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/domain/bo/DataTracerContentBO.java new file mode 100644 index 00000000..5333642f --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/domain/bo/DataTracerContentBO.java @@ -0,0 +1,39 @@ +package net.lab1024.sa.common.module.support.datatracer.domain.bo; + +import lombok.Data; + +import java.lang.reflect.Field; + +/** + * 变动内容 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-07-23 19:38:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class DataTracerContentBO { + + /** + * 变动字段 + */ + private Field field; + + /** + * 变动字段的值 + */ + private Object fieldValue; + + /** + * 变动字段描述 + */ + private String fieldDesc; + + /** + * 变动内容 + */ + private String fieldContent; + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/domain/entity/DataTracerEntity.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/domain/entity/DataTracerEntity.java new file mode 100644 index 00000000..5732a8f2 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/domain/entity/DataTracerEntity.java @@ -0,0 +1,90 @@ +package net.lab1024.sa.common.module.support.datatracer.domain.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import net.lab1024.sa.common.module.support.datatracer.constant.DataTracerTypeEnum; + +import java.time.LocalDateTime; + +/** + * 数据记录 实体 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-07-23 19:38:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +@TableName("t_data_tracer") +public class DataTracerEntity { + + @TableId(type = IdType.AUTO) + private Long dataTracerId; + /** + * 数据id + */ + private Long dataId; + /** + * 业务类型 + * {@link DataTracerTypeEnum} + */ + private Integer type; + + /** + * 内容 + */ + private String content; + + /** + * diff 差异:旧的数据 + */ + private String diffOld; + + /** + * 差异:新的数据 + */ + private String diffNew; + + /** + * 扩展字段 + */ + private String extraData; + + /** + * 用户 + */ + private Long userId; + + /** + * 用户类型 + */ + private Integer userType; + + /** + * 用户名 + */ + private String userName; + + /** + * 请求ip + */ + private String ip; + + /** + * 请求头 + */ + private String userAgent; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/domain/form/DataTracerForm.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/domain/form/DataTracerForm.java new file mode 100644 index 00000000..607d1e66 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/domain/form/DataTracerForm.java @@ -0,0 +1,54 @@ +package net.lab1024.sa.common.module.support.datatracer.domain.form; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import net.lab1024.sa.common.module.support.datatracer.constant.DataTracerTypeEnum; + +/** + * 数据变动表单 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-07-23 19:38:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class DataTracerForm { + + /** + * 业务id + */ + private Long dataId; + + /** + * 业务类型 + */ + private DataTracerTypeEnum type; + + /** + * 操作内容 + */ + private String content; + + /** + * diff 差异:旧的数据 + */ + private String diffOld; + + /** + * 差异:新的数据 + */ + private String diffNew; + + /** + * 扩展字段 + */ + private String extraData; + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/domain/form/DataTracerQueryForm.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/domain/form/DataTracerQueryForm.java new file mode 100644 index 00000000..4eccbe5b --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/domain/form/DataTracerQueryForm.java @@ -0,0 +1,32 @@ +package net.lab1024.sa.common.module.support.datatracer.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.domain.PageParam; +import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum; +import net.lab1024.sa.common.module.support.datatracer.constant.DataTracerTypeEnum; + +import javax.validation.constraints.NotNull; + +/** + * 查询表单 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-07-23 19:38:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class DataTracerQueryForm extends PageParam { + + @ApiModelPropertyEnum(DataTracerTypeEnum.class) + private Integer type; + + @ApiModelProperty("业务id") + @NotNull(message = "业务id不能为空") + private Long dataId; + + @ApiModelProperty("关键字") + private String keywords; +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/domain/vo/DataTracerVO.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/domain/vo/DataTracerVO.java new file mode 100644 index 00000000..e55beb98 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/domain/vo/DataTracerVO.java @@ -0,0 +1,62 @@ +package net.lab1024.sa.common.module.support.datatracer.domain.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.enumeration.UserTypeEnum; +import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum; +import net.lab1024.sa.common.module.support.datatracer.constant.DataTracerTypeEnum; + +import java.time.LocalDateTime; + +/** + * 变动记录 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-07-23 19:38:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class DataTracerVO { + + @ApiModelProperty("日志id") + private Long dataTracerId; + + @ApiModelProperty("单据id") + private Long dataId; + + @ApiModelPropertyEnum(value = DataTracerTypeEnum.class, desc = "业务类型") + private Integer type; + + @ApiModelProperty("操作内容") + private String content; + + @ApiModelProperty("diff 差异:旧的数据") + private String diffOld; + + @ApiModelProperty("差异:新的数据") + private String diffNew; + + @ApiModelProperty("扩展字段") + private String extraData; + + @ApiModelProperty("操作人") + private Long userId; + + @ApiModelPropertyEnum(value = UserTypeEnum.class, desc = "用户类型") + private Integer userType; + + @ApiModelProperty("操作人名称") + private String userName; + + @ApiModelProperty("userAgent") + private String userAgent; + + @ApiModelProperty("ip") + private String ip; + + @ApiModelProperty("操作时间") + private LocalDateTime createTime; + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/manager/DataTracerManger.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/manager/DataTracerManger.java new file mode 100644 index 00000000..8586cdfb --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/manager/DataTracerManger.java @@ -0,0 +1,19 @@ +package net.lab1024.sa.common.module.support.datatracer.manager; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import net.lab1024.sa.common.module.support.datatracer.dao.DataTracerDao; +import net.lab1024.sa.common.module.support.datatracer.domain.entity.DataTracerEntity; +import org.springframework.stereotype.Service; + +/** + * manager层 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-07-23 19:38:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Service +public class DataTracerManger extends ServiceImpl { +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/service/DataTracerChangeContentService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/service/DataTracerChangeContentService.java new file mode 100644 index 00000000..24af9f40 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/service/DataTracerChangeContentService.java @@ -0,0 +1,486 @@ +package net.lab1024.sa.common.module.support.datatracer.service; + +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.date.LocalDateTimeUtil; +import cn.hutool.json.JSONUtil; +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.google.common.base.CaseFormat; +import com.google.common.collect.Lists; +import lombok.extern.slf4j.Slf4j; +import net.lab1024.sa.common.common.util.SmartBigDecimalUtil; +import net.lab1024.sa.common.common.util.SmartEnumUtil; +import net.lab1024.sa.common.common.util.SmartStringUtil; +import net.lab1024.sa.common.module.support.datatracer.annoation.*; +import net.lab1024.sa.common.module.support.datatracer.constant.DataTracerConst; +import net.lab1024.sa.common.module.support.datatracer.domain.bo.DataTracerContentBO; +import net.lab1024.sa.common.module.support.dict.service.DictCacheService; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationContext; +import org.springframework.stereotype.Service; + +import java.beans.PropertyDescriptor; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.ConcurrentHashMap; + +/** + * 数据变更内容 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-07-23 19:38:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Slf4j +@Service +public class DataTracerChangeContentService { + + @Autowired + private ApplicationContext applicationContext; + @Autowired + private DictCacheService dictCacheService; + /** + * 字段描述缓存 + */ + private ConcurrentHashMap fieldDescCacheMap = new ConcurrentHashMap<>(); + + /** + * 类 加注解字段缓存 + */ + private ConcurrentHashMap> fieldMap = new ConcurrentHashMap<>(); + + /** + * 数据批量对比 + * + * @param oldObjectList + * @param newObjectList + * @param + * @return + */ + public String getChangeContent(List oldObjectList, List newObjectList) { + boolean valid = this.valid(oldObjectList, newObjectList); + if (!valid) { + return ""; + } + String operateType = this.getOperateType(oldObjectList, newObjectList); + String operateContent = ""; + if (DataTracerConst.INSERT.equals(operateType) || DataTracerConst.DELETE.equals(operateType)) { + operateContent = this.getObjectListContent(newObjectList); + if (StringUtils.isEmpty(operateContent)) { + return ""; + } + return operateType + ":" + operateContent; + } + if (DataTracerConst.UPDATE.equals(operateType)) { + return this.getUpdateContentList(oldObjectList, newObjectList); + } + return operateContent; + } + + + /** + * 解析多个对象的变更,删除,新增 + * oldObject 为空 ,newObject 不为空 为新增 + * oldObject 不为空 ,newObject 不空 为删除 + * 都不为空为编辑 + * + * @param oldObject + * @param newObject + * @return + */ + public String getChangeContent(Object oldObject, Object newObject) { + boolean valid = this.valid(oldObject, newObject); + if (!valid) { + return ""; + } + String operateType = this.getOperateType(oldObject, newObject); + String operateContent = ""; + if (DataTracerConst.INSERT.equals(operateType) || DataTracerConst.DELETE.equals(operateType)) { + operateContent = this.getAddDeleteContent(newObject); + } + if (DataTracerConst.UPDATE.equals(operateType)) { + operateContent = this.getUpdateContent(oldObject, newObject); + } + if (StringUtils.isEmpty(operateContent)) { + return ""; + } + return operateContent; + } + + /** + * 解析单个bean的内容 + * + * @param object + * @return + */ + public String getChangeContent(Object object) { + return this.getAddDeleteContent(object); + } + + // ---------------------------- 以下 是 私有private 方法 ---------------------------- + + /** + * 获取新增或删除操作内容 + * + * @param object 新增或删除的对象 + * @return + */ + private String getAddDeleteContent(Object object) { + List fields = this.getField(object); + Map beanParseMap = this.fieldParse(object, fields); + return this.getAddDeleteContent(beanParseMap); + } + + /** + * 单个对象变动内容 + * + * @param oldObjectList + * @param newObjectList + * @param + * @return + */ + private String getUpdateContentList(List oldObjectList, List newObjectList) { + String oldContent = this.getObjectListContent(oldObjectList); + String newContent = this.getObjectListContent(newObjectList); + if (oldContent.equals(newContent)) { + return ""; + } + if (StringUtils.isEmpty(oldContent) && StringUtils.isEmpty(newContent)) { + return ""; + } + return "【原数据】:
" + oldContent + "
" + "【新数据】:
" + newContent; + } + + /** + * 获取一个对象的内容信息 + * + * @param objectList + * @param + * @return + */ + private String getObjectListContent(List objectList) { + if (CollectionUtils.isEmpty(objectList)) { + return ""; + } + List fields = this.getField(objectList.get(0)); + List contentList = Lists.newArrayList(); + for (Object objItem : objectList) { + Map beanParseMap = this.fieldParse(objItem, fields); + contentList.add(this.getAddDeleteContent(beanParseMap)); + } + return StringUtils.join(contentList, "
"); + } + + private String getAddDeleteContent(Map beanParseMap) { + List contentList = new ArrayList<>(); + for (Entry entry : beanParseMap.entrySet()) { + DataTracerContentBO dataTracerContentBO = entry.getValue(); + Boolean jsonFlag = JSONUtil.isTypeJSON(dataTracerContentBO.getFieldContent()); + String filedDesc = dataTracerContentBO.getFieldDesc(); + if (jsonFlag) { + contentList.add(filedDesc + "(请进入详情查看)"); + } else { + contentList.add(dataTracerContentBO.getFieldDesc() + ":" + dataTracerContentBO.getFieldContent()); + } + } + String operateContent = StringUtils.join(contentList, "
"); + if (StringUtils.isEmpty(operateContent)) { + return ""; + } + return operateContent; + } + + + /** + * 获取更新操作内容 + * + * @param oldObject + * @param newObject + * @return + */ + private String getUpdateContent(T oldObject, T newObject) { + List fields = this.getField(oldObject); + List contentList = new ArrayList<>(); + Map oldBeanParseMap = this.fieldParse(oldObject, fields); + Map newBeanParseMap = this.fieldParse(newObject, fields); + //oldBeanParseMap与newBeanParseMap size一定相同 + for (Entry entry : oldBeanParseMap.entrySet()) { + String fieldName = entry.getKey(); + // 新旧对象内容 + DataTracerContentBO oldContentBO = entry.getValue(); + DataTracerContentBO newContentBO = newBeanParseMap.get(fieldName); + // fieldContent + String oldContent = oldContentBO.getFieldContent() == null ? "" : oldContentBO.getFieldContent(); + String newContent = newContentBO.getFieldContent() == null ? "" : newContentBO.getFieldContent(); + + if (oldContent.equals(newContent)) { + continue; + } + String fieldDesc = oldContentBO.getFieldDesc(); + Boolean jsonFlag = JSONUtil.isTypeJSON(oldContent) || JSONUtil.isTypeJSON(newContent); + if (jsonFlag) { + String content = fieldDesc + "【进入详情查看】"; + contentList.add(content); + continue; + } + String content = fieldDesc + ":" + "由【" + oldContent + "】变更为【" + newContent + "】"; + contentList.add(content); + } + if (CollectionUtils.isEmpty(contentList)) { + return ""; + } + String operateContent = StringUtils.join(contentList, "
"); + if (StringUtils.isEmpty(operateContent)) { + return ""; + } + return operateContent; + } + + + /** + * 接bean对象 + * + * @param object + * @param fields + * @return + */ + private Map fieldParse(Object object, List fields) { + if (fields == null || fields.size() == 0) { + return new HashMap<>(); + } + //对象解析结果 + Map objectParse = new HashMap<>(16); + for (Field field : fields) { + field.setAccessible(true); + String desc = this.getFieldDesc(field); + if (StringUtils.isEmpty(desc)) { + continue; + } + DataTracerContentBO dataTracerContentBO = this.getFieldValue(field, object); + if (dataTracerContentBO != null) { + dataTracerContentBO.setFieldDesc(desc); + objectParse.put(field.getName(), dataTracerContentBO); + } + } + return objectParse; + } + + /** + * 获取字段值 + * + * @param field + * @param object + * @return + */ + private DataTracerContentBO getFieldValue(Field field, Object object) { + Object fieldValue = ""; + Class clazz = object.getClass(); + try { + PropertyDescriptor pd = new PropertyDescriptor(field.getName(), clazz); + Method get = pd.getReadMethod(); + fieldValue = get.invoke(object); + } catch (Exception e) { + log.error("bean operate log: reflect field value error " + field.getName()); + return null; + } + if (fieldValue == null) { + return null; + } + + String fieldContent = ""; + DataTracerFieldEnum dataTracerFieldEnum = field.getAnnotation(DataTracerFieldEnum.class); + DataTracerFieldSql dataTracerFieldSql = field.getAnnotation(DataTracerFieldSql.class); + DataTracerFieldDict dataTracerFieldDict = field.getAnnotation(DataTracerFieldDict.class); + if (dataTracerFieldEnum != null) { + if (fieldValue instanceof Collection) { + fieldContent = SmartEnumUtil.getEnumDescByValueList((Collection) fieldValue, dataTracerFieldEnum.enumClass()); + } else { + fieldContent = SmartEnumUtil.getEnumDescByValue(fieldValue, dataTracerFieldEnum.enumClass()); + } + } else if (dataTracerFieldDict != null) { + fieldContent = dictCacheService.selectValueNameByValueCodeSplit(fieldValue.toString()); + } else if (dataTracerFieldSql != null) { + fieldContent = this.getRelateDisplayValue(fieldValue, dataTracerFieldSql); + } else if (fieldValue instanceof Date) { + fieldContent = DateUtil.formatDateTime((Date) fieldValue); + } else if (fieldValue instanceof LocalDateTime) { + fieldContent = LocalDateTimeUtil.formatNormal((LocalDateTime) fieldValue); + } else if (fieldValue instanceof LocalDate) { + fieldContent = LocalDateTimeUtil.formatNormal((LocalDate) fieldValue); + } else if (fieldValue instanceof BigDecimal) { + DataTracerFieldBigDecimal dataTracerFieldBigDecimal = field.getAnnotation(DataTracerFieldBigDecimal.class); + if (dataTracerFieldBigDecimal != null) { + BigDecimal value = SmartBigDecimalUtil.setScale((BigDecimal) fieldValue, dataTracerFieldBigDecimal.scale()); + fieldContent = value.toString(); + } + } else { + fieldContent = JSON.toJSONString(fieldValue); + } + DataTracerContentBO dataTracerContentBO = new DataTracerContentBO(); + dataTracerContentBO.setField(field); + dataTracerContentBO.setFieldValue(fieldValue); + dataTracerContentBO.setFieldContent(fieldContent); + return dataTracerContentBO; + } + + /** + * 获取关联字段的显示值 + * + * @param fieldValue + * @return + */ + private String getRelateDisplayValue(Object fieldValue, DataTracerFieldSql dataTracerFieldSql) { + Class relateMapper = dataTracerFieldSql.relateMapper(); + BaseMapper mapper = applicationContext.getBean(relateMapper); + if (mapper == null) { + return ""; + } + String relateFieldValue = fieldValue.toString(); + QueryWrapper qw = new QueryWrapper(); + qw.select(CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, dataTracerFieldSql.relateDisplayColumn())); + qw.in(CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, dataTracerFieldSql.relateColumn()), relateFieldValue); + List displayValue = mapper.selectObjs(qw); + if (CollectionUtils.isEmpty(displayValue)) { + return ""; + } + return SmartStringUtil.join(",", displayValue); + } + + /** + * 获取字段描述信息 优先 OperateField 没得话swagger判断 + * + * @param field + * @return + */ + private String getFieldDesc(Field field) { + // 根据字段名称 从缓存中查询 + String fieldName = field.toGenericString(); + String desc = fieldDescCacheMap.get(fieldName); + if (null != desc) { + return desc; + } + DataTracerFieldLabel operateField = field.getAnnotation(DataTracerFieldLabel.class); + if (operateField != null) { + return operateField.value(); + } + fieldDescCacheMap.put(fieldName, desc); + return desc; + } + + /** + * 获取操作类型 + * + * @param oldObject + * @param newObject + * @return + */ + private String getOperateType(Object oldObject, Object newObject) { + if (oldObject == null && newObject != null) { + return DataTracerConst.INSERT; + } + if (oldObject != null && newObject == null) { + return DataTracerConst.DELETE; + } + return DataTracerConst.UPDATE; + } + + /** + * 校验是否进行比对 + * + * @param oldObject + * @param newObject + * @return + */ + private boolean valid(Object oldObject, Object newObject) { + if (oldObject == null && newObject == null) { + return false; + } + if (oldObject == null && newObject != null) { + return true; + } + if (oldObject != null && newObject == null) { + return true; + } + if (oldObject != null && newObject != null) { + String oldClass = oldObject.getClass().getName(); + String newClass = newObject.getClass().getName(); + return oldClass.equals(newClass); + } + return true; + } + + + /** + * 校验 + * + * @param oldObjectList + * @param newObjectList + * @param + * @return + */ + private boolean valid(List oldObjectList, List newObjectList) { + if (CollectionUtils.isEmpty(oldObjectList) && CollectionUtils.isEmpty(newObjectList)) { + return false; + } + if (CollectionUtils.isEmpty(oldObjectList) && CollectionUtils.isNotEmpty(newObjectList)) { + return true; + } + if (CollectionUtils.isNotEmpty(oldObjectList) && CollectionUtils.isEmpty(newObjectList)) { + return true; + } + if (CollectionUtils.isNotEmpty(oldObjectList) && CollectionUtils.isNotEmpty(newObjectList)) { + T oldObject = oldObjectList.get(0); + T newObject = newObjectList.get(0); + String oldClass = oldObject.getClass().getName(); + String newClass = newObject.getClass().getName(); + return oldClass.equals(newClass); + } + return true; + } + + /** + * 查询 包含 file key 注解的字段 + * 使用缓存 + * + * @param obj + * @return + */ + private List getField(Object obj) { + // 从缓存中查询 + Class tClass = obj.getClass(); + List fieldList = fieldMap.get(tClass); + if (null != fieldList) { + return fieldList; + } + + // 这一段递归代码 是为了 从父类中获取属性 + Class tempClass = tClass; + fieldList = new ArrayList<>(); + while (tempClass != null) { + Field[] declaredFields = tempClass.getDeclaredFields(); + for (Field field : declaredFields) { + // 过虑出有注解字段 + if (!field.isAnnotationPresent(DataTracerFieldLabel.class)) { + continue; + } + field.setAccessible(true); + fieldList.add(field); + } + tempClass = tempClass.getSuperclass(); + } + fieldMap.put(tClass, fieldList); + return fieldList; + } + + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/service/DataTracerService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/service/DataTracerService.java new file mode 100644 index 00000000..2968ed5a --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/datatracer/service/DataTracerService.java @@ -0,0 +1,224 @@ +package net.lab1024.sa.common.module.support.datatracer.service; + + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.extern.slf4j.Slf4j; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.RequestUser; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.util.SmartBeanUtil; +import net.lab1024.sa.common.common.util.SmartPageUtil; +import net.lab1024.sa.common.common.util.SmartRequestUtil; +import net.lab1024.sa.common.module.support.datatracer.constant.DataTracerConst; +import net.lab1024.sa.common.module.support.datatracer.constant.DataTracerTypeEnum; +import net.lab1024.sa.common.module.support.datatracer.dao.DataTracerDao; +import net.lab1024.sa.common.module.support.datatracer.domain.entity.DataTracerEntity; +import net.lab1024.sa.common.module.support.datatracer.domain.form.DataTracerForm; +import net.lab1024.sa.common.module.support.datatracer.domain.form.DataTracerQueryForm; +import net.lab1024.sa.common.module.support.datatracer.domain.vo.DataTracerVO; +import net.lab1024.sa.common.module.support.datatracer.manager.DataTracerManger; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.stream.Collectors; + +/** + * 数据变动记录 Service + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-07-23 19:38:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Slf4j +@Service +public class DataTracerService { + + @Autowired + private DataTracerDao dataTracerDao; + + @Autowired + private DataTracerManger dataTracerManger; + + @Autowired + private DataTracerChangeContentService dataTracerChangeContentService; + + /** + * 获取变更内容 + * + * @param object + * @return + */ + public String getChangeContent(Object object) { + return dataTracerChangeContentService.getChangeContent(object); + } + + /** + * 获取变更内容 + */ + public String getChangeContent(Object oldObject, Object newObject) { + return dataTracerChangeContentService.getChangeContent(oldObject, newObject); + } + + + /** + * 获取变更内容 + */ + public String getChangeContent(List oldObjectList, List newObjectList) { + return dataTracerChangeContentService.getChangeContent(oldObjectList, newObjectList); + } + + + /** + * 保存【修改】数据变动记录 + * + * @param dataId + * @param type + */ + public void update(Long dataId, DataTracerTypeEnum type, Object oldObject, Object newObject) { + DataTracerForm form = DataTracerForm.builder() + .dataId(dataId) + .type(type) + .content(dataTracerChangeContentService.getChangeContent(oldObject, newObject)) + .build(); + this.addTrace(form); + } + + + /** + * 保存【新增】数据变动记录 + * + * @param dataId + * @param type + */ + public void insert(Long dataId, DataTracerTypeEnum type) { + DataTracerForm form = DataTracerForm.builder().dataId(dataId).type(type).content(DataTracerConst.INSERT).build(); + this.addTrace(form); + } + + /** + * 保存【删除】数据变动记录 + * + * @param dataId + * @param type + */ + public void delete(Long dataId, DataTracerTypeEnum type) { + DataTracerForm form = DataTracerForm.builder().dataId(dataId).type(type).content(DataTracerConst.DELETE).build(); + this.addTrace(form); + } + + /** + * 保存【删除】数据变动记录 + * + * @param dataId + * @param type + */ + public void delete(Long dataId, DataTracerTypeEnum type, Object object) { + DataTracerForm form = DataTracerForm.builder().dataId(dataId).type(type).content(DataTracerConst.DELETE).build(); + this.addTrace(form); + } + + /** + * 保存【批量删除】数据变动记录 + * + * @param dataIdList + * @param type + */ + public void batchDelete(List dataIdList, DataTracerTypeEnum type) { + if (CollectionUtils.isEmpty(dataIdList)) { + return; + } + + this.addTraceList(dataIdList.stream().map(e -> DataTracerForm.builder() + .dataId(e) + .type(type) + .content(DataTracerConst.DELETE) + .build()) + .collect(Collectors.toList()) + ); + } + + /** + * 保存数据变动记录 + * + * @param dataId + * @param type + * @param content + */ + public void addTrace(Long dataId, DataTracerTypeEnum type, String content) { + DataTracerForm form = DataTracerForm.builder().dataId(dataId).type(type).content(content).build(); + this.addTrace(form); + } + + /** + * 保存数据变动记录 + */ + public void addTrace(DataTracerForm tracerForm) { + RequestUser requestUser = SmartRequestUtil.getRequestUser(); + this.addTrace(tracerForm, requestUser); + } + + + /** + * 保存数据变动记录 + */ + public void addTrace(DataTracerForm tracerForm, RequestUser requestUser) { + DataTracerEntity tracerEntity = SmartBeanUtil.copy(tracerForm, DataTracerEntity.class); + tracerEntity.setType(tracerForm.getType().getValue()); + if (requestUser != null) { + tracerEntity.setIp(requestUser.getIp()); + tracerEntity.setUserAgent(requestUser.getUserAgent()); + tracerEntity.setUserId(requestUser.getUserId()); + tracerEntity.setUserType(requestUser.getUserType().getValue()); + tracerEntity.setUserName(requestUser.getUserName()); + } + dataTracerManger.save(tracerEntity); + } + + /** + * 批量保存数据变动记录 + */ + public void addTraceList(List tracerFormList) { + RequestUser requestUser = SmartRequestUtil.getRequestUser(); + this.addTraceList(tracerFormList, requestUser); + } + + /** + * 批量保存数据变动记录 + */ + public void addTraceList(List tracerFormList, RequestUser requestUser) { + if (CollectionUtils.isEmpty(tracerFormList)) { + return; + } + + List tracerEntityList = tracerFormList.stream().map(e -> { + DataTracerEntity tracerEntity = SmartBeanUtil.copy(e, DataTracerEntity.class); + tracerEntity.setType(e.getType().getValue()); + tracerEntity.setIp(requestUser.getIp()); + tracerEntity.setUserAgent(requestUser.getUserAgent()); + tracerEntity.setUserId(requestUser.getUserId()); + tracerEntity.setUserType(requestUser.getUserType().getValue()); + tracerEntity.setUserName(requestUser.getUserName()); + return tracerEntity; + }).collect(Collectors.toList()); + dataTracerManger.saveBatch(tracerEntityList); + } + + + /** + * 分页查询 + * + * @param queryForm + * @return + */ + public ResponseDTO> query(DataTracerQueryForm queryForm) { + Page page = SmartPageUtil.convert2PageQuery(queryForm); + List list = dataTracerDao.query(page, queryForm); + PageResult pageResult = SmartPageUtil.convert2PageResult(page, list); + return ResponseDTO.ok(pageResult); + } + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/controller/DictController.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/controller/DictController.java new file mode 100644 index 00000000..ae71b8ec --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/controller/DictController.java @@ -0,0 +1,63 @@ +package net.lab1024.sa.common.module.support.dict.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import net.lab1024.sa.common.common.controller.SupportBaseController; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.constant.SwaggerTagConst; +import net.lab1024.sa.common.module.support.dict.service.DictCacheService; +import net.lab1024.sa.common.module.support.dict.service.DictService; +import net.lab1024.sa.common.module.support.dict.domain.form.*; +import net.lab1024.sa.common.module.support.dict.domain.vo.DictKeyVO; +import net.lab1024.sa.common.module.support.dict.domain.vo.DictValueVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + +/** + * 字典 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022/5/26 19:40:55 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Api(tags = {SwaggerTagConst.Support.DICT}) +@RestController +public class DictController extends SupportBaseController { + + @Autowired + private DictService dictService; + @Autowired + private DictCacheService dictCacheService; + + + @ApiOperation("查询全部字典key - @author 卓大") + @GetMapping("/dict/key/queryAll") + public ResponseDTO> queryAll() { + return ResponseDTO.ok(dictService.queryAllKey()); + } + + @ApiOperation("分页查询数据字典value - @author 罗伊") + @PostMapping("/dict/value/query") + public ResponseDTO> valueQuery(@Valid @RequestBody DictValueQueryForm queryForm) { + return dictService.valueQuery(queryForm); + } + + @ApiOperation("数据字典缓存-刷新- @author 罗伊") + @GetMapping("/dict/cache/refresh") + public ResponseDTO cacheRefresh() { + return dictCacheService.cacheRefresh(); + } + + @ApiOperation("数据字典-值列表- @author 罗伊") + @GetMapping("/dict/value/list/{keyCode}") + public ResponseDTO> valueList(@PathVariable String keyCode) { + List dictValueVOList = dictCacheService.selectByKeyCode(keyCode); + return ResponseDTO.ok(dictValueVOList); + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/dao/DictKeyDao.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/dao/DictKeyDao.java new file mode 100644 index 00000000..f4d48a55 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/dao/DictKeyDao.java @@ -0,0 +1,58 @@ +package net.lab1024.sa.common.module.support.dict.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import net.lab1024.sa.common.module.support.dict.domain.entity.DictKeyEntity; +import net.lab1024.sa.common.module.support.dict.domain.form.DictKeyQueryForm; +import net.lab1024.sa.common.module.support.dict.domain.vo.DictKeyVO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * 字典 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022/5/26 19:40:55 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Mapper +@Component +public interface DictKeyDao extends BaseMapper { + + /** + * 查找所有未删除的自带key + * @param deletedFlag + * @return + */ + List selectByDeletedFlag(@Param("deletedFlag") Boolean deletedFlag); + + /** + * 逻辑删除 + * + * @param dictKeyIdList + * @param deletedFlag + */ + void updateDeletedFlagByIdList(@Param("dictKeyIdList") List dictKeyIdList, @Param("deletedFlag") Boolean deletedFlag); + + /** + * 分页查询 + * + * @param page + * @param queryForm + * @return + */ + List query(Page page, @Param("query") DictKeyQueryForm queryForm); + + /** + * 跟进code查询 + * @param keyCode + * @param deletedFlag + * @return + */ + DictKeyEntity selectByCode(@Param("keyCode")String keyCode, @Param("deletedFlag") Boolean deletedFlag); +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/dao/DictValueDao.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/dao/DictValueDao.java new file mode 100644 index 00000000..4cefc6bd --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/dao/DictValueDao.java @@ -0,0 +1,69 @@ +package net.lab1024.sa.common.module.support.dict.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import net.lab1024.sa.common.module.support.dict.domain.entity.DictValueEntity; +import net.lab1024.sa.common.module.support.dict.domain.form.DictValueQueryForm; +import net.lab1024.sa.common.module.support.dict.domain.vo.DictValueVO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * 字典 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022/5/26 19:40:55 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Mapper +@Component +public interface DictValueDao extends BaseMapper { + + /** + * 查找所有未删除的自带key + * + * @param deletedFlag + * @return + */ + List selectByDeletedFlag(@Param("deletedFlag") Boolean deletedFlag); + + /** + * 查找所有未删除的自带key + * + * @param dictKeyId + * @param deletedFlag + * @return + */ + List selectByDeletedFlagAndKeyId(@Param("dictKeyId") Long dictKeyId, @Param("deletedFlag") Boolean deletedFlag); + + /** + * 逻辑删除 + * + * @param dictValueIdList + * @param deletedFlag + */ + void updateDeletedFlagByIdList(@Param("dictValueIdList") List dictValueIdList, @Param("deletedFlag") Boolean deletedFlag); + + /** + * 分页查询 + * + * @param page + * @param queryForm + * @return + */ + List query(Page page, @Param("query") DictValueQueryForm queryForm); + + /** + * 跟进code查询 + * + * @param valueCode + * @param deletedFlag + * @return + */ + DictValueEntity selectByCode(@Param("valueCode") String valueCode, @Param("deletedFlag") Boolean deletedFlag); +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/domain/entity/DictKeyEntity.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/domain/entity/DictKeyEntity.java new file mode 100644 index 00000000..1696440a --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/domain/entity/DictKeyEntity.java @@ -0,0 +1,54 @@ +package net.lab1024.sa.common.module.support.dict.domain.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * 字典 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022/5/26 19:40:55 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +@TableName("t_dict_key") +public class DictKeyEntity { + + @TableId(type = IdType.AUTO) + private Long dictKeyId; + + /** + * 编码 + */ + private String keyCode; + /** + * 名称 + */ + private String keyName; + + /** + * 备注 + */ + private String remark; + + /** + * 删除标识 + */ + private Boolean deletedFlag; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/domain/entity/DictValueEntity.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/domain/entity/DictValueEntity.java new file mode 100644 index 00000000..ff46e340 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/domain/entity/DictValueEntity.java @@ -0,0 +1,58 @@ +package net.lab1024.sa.common.module.support.dict.domain.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * 字典 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022/5/26 19:40:55 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +@TableName("t_dict_value") +public class DictValueEntity { + + @TableId(type = IdType.AUTO) + private Long dictValueId; + + private Long dictKeyId; + /** + * 编码 + */ + private String valueCode; + /** + * 名称 + */ + private String valueName; + /** + * 备注 + */ + private String remark; + + /** + * 排序 + */ + private Integer sort; + /** + * 删除标识 + */ + private Boolean deletedFlag; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/domain/form/DictKeyAddForm.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/domain/form/DictKeyAddForm.java new file mode 100644 index 00000000..d6bc67b6 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/domain/form/DictKeyAddForm.java @@ -0,0 +1,34 @@ +package net.lab1024.sa.common.module.support.dict.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; + +/** + * 字典 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022/5/26 19:40:55 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class DictKeyAddForm { + + @ApiModelProperty("编码") + @NotBlank(message = "编码不能为空") + @Length(max = 50,message = "编码太长了,不能超过50字符") + private String keyCode; + + @ApiModelProperty("名称") + @NotBlank(message = "名称不能为空") + @Length(max = 50,message = "名称太长了,不能超过50字符") + private String keyName; + + @ApiModelProperty("备注") + @Length(max = 500,message = "备注太长了") + private String remark; +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/domain/form/DictKeyQueryForm.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/domain/form/DictKeyQueryForm.java new file mode 100644 index 00000000..8cd26dd4 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/domain/form/DictKeyQueryForm.java @@ -0,0 +1,24 @@ +package net.lab1024.sa.common.module.support.dict.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.domain.PageParam; + +/** + * 字典 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022/5/26 19:40:55 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class DictKeyQueryForm extends PageParam { + + @ApiModelProperty("搜索词") + private String searchWord; + + @ApiModelProperty(value = "删除标识",hidden = true) + private Boolean deletedFlag; +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/domain/form/DictKeyUpdateForm.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/domain/form/DictKeyUpdateForm.java new file mode 100644 index 00000000..87bfb204 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/domain/form/DictKeyUpdateForm.java @@ -0,0 +1,23 @@ +package net.lab1024.sa.common.module.support.dict.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * 字典 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022/5/26 19:40:55 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class DictKeyUpdateForm extends DictKeyAddForm { + + @ApiModelProperty("keyId") + @NotNull(message = "keyId不能为空") + private Long dictKeyId; +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/domain/form/DictValueAddForm.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/domain/form/DictValueAddForm.java new file mode 100644 index 00000000..7f5b0931 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/domain/form/DictValueAddForm.java @@ -0,0 +1,44 @@ +package net.lab1024.sa.common.module.support.dict.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +/** + * 字典 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022/5/26 19:40:55 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class DictValueAddForm { + + @ApiModelProperty("dictKeyId") + @NotNull(message = "dictKeyId不能为空") + private Long dictKeyId; + + @ApiModelProperty("编码") + @NotBlank(message = "编码不能为空") + @Length(max = 50,message = "编码太长了,不能超过50字符") + private String valueCode; + + @ApiModelProperty("名称") + @NotBlank(message = "名称不能为空") + @Length(max = 50,message = "名称太长了,不能超过50字符") + private String valueName; + + @ApiModelProperty("排序") + @NotNull(message = "排序不能为空") + private Integer sort; + + @ApiModelProperty("备注") + @Length(max = 500,message = "备注太长了") + private String remark; + +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/domain/form/DictValueQueryForm.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/domain/form/DictValueQueryForm.java new file mode 100644 index 00000000..40540ea2 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/domain/form/DictValueQueryForm.java @@ -0,0 +1,30 @@ +package net.lab1024.sa.common.module.support.dict.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.domain.PageParam; + +import javax.validation.constraints.NotNull; + +/** + * 字典 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022/5/26 19:40:55 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class DictValueQueryForm extends PageParam { + + @ApiModelProperty("dictKeyId") + @NotNull(message = "dictKeyId不能为空") + private Long dictKeyId; + + @ApiModelProperty("搜索词") + private String searchWord; + + @ApiModelProperty(value = "删除标识",hidden = true) + private Boolean deletedFlag; +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/domain/form/DictValueUpdateForm.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/domain/form/DictValueUpdateForm.java new file mode 100644 index 00000000..273100a4 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/domain/form/DictValueUpdateForm.java @@ -0,0 +1,23 @@ +package net.lab1024.sa.common.module.support.dict.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * 字典 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022/5/26 19:40:55 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class DictValueUpdateForm extends DictValueAddForm { + + @ApiModelProperty("valueId") + @NotNull(message = "valueId不能为空") + private Long dictValueId; +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/domain/vo/DictKeyVO.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/domain/vo/DictKeyVO.java new file mode 100644 index 00000000..f9864955 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/domain/vo/DictKeyVO.java @@ -0,0 +1,29 @@ +package net.lab1024.sa.common.module.support.dict.domain.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * 字典 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022/5/26 19:40:55 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class DictKeyVO { + + @ApiModelProperty("dictKeyId") + private Long dictKeyId; + + @ApiModelProperty("编码") + private String keyCode; + + @ApiModelProperty("名称") + private String keyName; + + @ApiModelProperty("备注") + private String remark; +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/domain/vo/DictValueVO.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/domain/vo/DictValueVO.java new file mode 100644 index 00000000..ec7535cf --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/domain/vo/DictValueVO.java @@ -0,0 +1,35 @@ +package net.lab1024.sa.common.module.support.dict.domain.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * 字典 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022/5/26 19:40:55 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class DictValueVO { + + @ApiModelProperty("valueId") + private Long dictValueId; + + @ApiModelProperty("dictKeyId") + private Long dictKeyId; + + @ApiModelProperty("编码") + private String valueCode; + + @ApiModelProperty("名称") + private String valueName; + + @ApiModelProperty("排序") + private Integer sort; + + @ApiModelProperty("备注") + private String remark; +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/service/DictCacheService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/service/DictCacheService.java new file mode 100644 index 00000000..63c9a66f --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/service/DictCacheService.java @@ -0,0 +1,133 @@ +package net.lab1024.sa.common.module.support.dict.service; + +import cn.hutool.core.util.StrUtil; +import com.google.common.collect.Lists; +import lombok.extern.slf4j.Slf4j; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.util.SmartBeanUtil; +import net.lab1024.sa.common.module.support.dict.dao.DictKeyDao; +import net.lab1024.sa.common.module.support.dict.dao.DictValueDao; +import net.lab1024.sa.common.module.support.dict.domain.entity.DictKeyEntity; +import net.lab1024.sa.common.module.support.dict.domain.entity.DictValueEntity; +import net.lab1024.sa.common.module.support.dict.domain.vo.DictValueVO; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.annotation.PostConstruct; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.stream.Collectors; + +/** + * 字典缓存 服务 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022/5/26 19:40:55 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Slf4j +@Service +public class DictCacheService { + + @Autowired + private DictKeyDao dictKeyDao; + @Autowired + private DictValueDao dictValueDao; + + private ConcurrentHashMap> DICT_CACHE = new ConcurrentHashMap<>(); + + private ConcurrentHashMap VALUE_CACHE = new ConcurrentHashMap<>(); + + + @PostConstruct + public void dictCache() { + this.cacheInit(); + } + + public void cacheInit() { + List dictKeyEntityList = dictKeyDao.selectByDeletedFlag(false); + if (CollectionUtils.isEmpty(dictKeyEntityList)) { + return; + } + List dictKeyValueList = dictValueDao.selectByDeletedFlag(false); + List dictValueVOList = SmartBeanUtil.copyList(dictKeyValueList, DictValueVO.class); + Map> valueListMap = dictValueVOList.stream().collect(Collectors.groupingBy(DictValueVO::getDictKeyId)); + //字典键值对缓存 + for (DictKeyEntity dictKeyEntity : dictKeyEntityList) { + String keyCode = dictKeyEntity.getKeyCode(); + Long dictKeyId = dictKeyEntity.getDictKeyId(); + DICT_CACHE.put(keyCode, valueListMap.getOrDefault(dictKeyId, Lists.newArrayList())); + } + //字典值缓存 + dictValueVOList.forEach(e -> { + VALUE_CACHE.put(e.getValueCode(), e); + }); + log.info("################# 数据字典缓存初始化完毕 ###################"); + } + + /** + * 刷新缓存 + */ + public ResponseDTO cacheRefresh() { + DICT_CACHE.clear(); + VALUE_CACHE.clear(); + this.cacheInit(); + return ResponseDTO.ok(); + } + + /** + * 查询某个key对应的字典值列表 + * + * @param keyCode + * @return + */ + public List selectByKeyCode(String keyCode) { + return DICT_CACHE.getOrDefault(keyCode, Lists.newArrayList()); + } + + /** + * 查询值code名称 + * + * @param valueCode + * @return + */ + public String selectValueNameByValueCode(String valueCode) { + if (StrUtil.isEmpty(valueCode)) { + return null; + } + + DictValueVO dictValueVO = VALUE_CACHE.get(valueCode); + if (dictValueVO == null) { + return ""; + } + return dictValueVO.getValueName(); + } + + public DictValueVO selectValueByValueCode(String valueCode) { + if (StrUtil.isEmpty(valueCode)) { + return null; + } + return VALUE_CACHE.get(valueCode); + } + + public String selectValueNameByValueCodeSplit(String valueCodes) { + if (StrUtil.isEmpty(valueCodes)) { + return ""; + } + List valueNameList = Lists.newArrayList(); + String[] valueCodeArray = valueCodes.split(","); + for (String valueCode : valueCodeArray) { + DictValueVO dictValueVO = VALUE_CACHE.get(valueCode); + if (dictValueVO != null) { + valueNameList.add(dictValueVO.getValueName()); + } + } + return StringUtils.join(valueNameList, ","); + } + +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/service/DictService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/service/DictService.java new file mode 100644 index 00000000..ad624157 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/dict/service/DictService.java @@ -0,0 +1,196 @@ +package net.lab1024.sa.common.module.support.dict.service; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.google.common.collect.Interner; +import com.google.common.collect.Interners; +import net.lab1024.sa.common.common.code.UserErrorCode; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.util.SmartBeanUtil; +import net.lab1024.sa.common.common.util.SmartPageUtil; +import net.lab1024.sa.common.module.support.dict.dao.DictKeyDao; +import net.lab1024.sa.common.module.support.dict.dao.DictValueDao; +import net.lab1024.sa.common.module.support.dict.domain.entity.DictKeyEntity; +import net.lab1024.sa.common.module.support.dict.domain.entity.DictValueEntity; +import net.lab1024.sa.common.module.support.dict.domain.form.*; +import net.lab1024.sa.common.module.support.dict.domain.vo.DictKeyVO; +import net.lab1024.sa.common.module.support.dict.domain.vo.DictValueVO; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 字典 服务 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2022/5/26 19:40:55 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Service +public class DictService { + + @Autowired + private DictKeyDao dictKeyDao; + @Autowired + private DictValueDao dictValueDao; + @Autowired + private DictCacheService dictCacheService; + /** + * CODE锁 + */ + private static final Interner CODE_POOL = Interners.newWeakInterner(); + + + /** + * key添加 + * + * @param keyAddForm + * @return + */ + public ResponseDTO keyAdd(DictKeyAddForm keyAddForm) { + synchronized (CODE_POOL.intern(keyAddForm.getKeyCode())) { + DictKeyEntity dictKeyEntity = dictKeyDao.selectByCode(keyAddForm.getKeyCode(), false); + if (dictKeyEntity != null) { + return ResponseDTO.error(UserErrorCode.ALREADY_EXIST); + } + dictKeyEntity = SmartBeanUtil.copy(keyAddForm, DictKeyEntity.class); + dictKeyDao.insert(dictKeyEntity); + } + return ResponseDTO.ok(); + } + + /** + * 值添加 + * + * @param valueAddForm + * @return + */ + public ResponseDTO valueAdd(DictValueAddForm valueAddForm) { + synchronized (CODE_POOL.intern(valueAddForm.getValueCode())) { + DictValueEntity dictValueEntity = dictValueDao.selectByCode(valueAddForm.getValueCode(), false); + if (dictValueEntity != null) { + return ResponseDTO.error(UserErrorCode.ALREADY_EXIST); + } + dictValueEntity = SmartBeanUtil.copy(valueAddForm, DictValueEntity.class); + dictValueDao.insert(dictValueEntity); + } + return ResponseDTO.ok(); + } + + /** + * key 编辑 + * + * @param keyUpdateForm + * @return + */ + public ResponseDTO keyEdit(DictKeyUpdateForm keyUpdateForm) { + synchronized (CODE_POOL.intern(keyUpdateForm.getKeyCode())) { + DictKeyEntity dictKeyEntity = dictKeyDao.selectByCode(keyUpdateForm.getKeyCode(), false); + if (dictKeyEntity != null && !dictKeyEntity.getDictKeyId().equals(keyUpdateForm.getDictKeyId())) { + return ResponseDTO.error(UserErrorCode.ALREADY_EXIST); + } + DictKeyEntity dictKeyUpdateEntity = SmartBeanUtil.copy(keyUpdateForm, DictKeyEntity.class); + dictKeyDao.updateById(dictKeyUpdateEntity); + } + return ResponseDTO.ok(); + } + + /** + * 值编辑 + * + * @param valueUpdateForm + * @return + */ + public ResponseDTO valueEdit(DictValueUpdateForm valueUpdateForm) { + DictKeyEntity dictKeyEntity = dictKeyDao.selectById(valueUpdateForm.getDictKeyId()); + if (dictKeyEntity == null || dictKeyEntity.getDeletedFlag()) { + return ResponseDTO.userErrorParam("key不能存在"); + } + synchronized (CODE_POOL.intern(valueUpdateForm.getValueCode())) { + DictValueEntity dictValueEntity = dictValueDao.selectByCode(valueUpdateForm.getValueCode(), false); + if (dictValueEntity != null && !dictValueEntity.getDictValueId().equals(valueUpdateForm.getDictValueId())) { + return ResponseDTO.error(UserErrorCode.ALREADY_EXIST); + } + DictValueEntity dictValueUpdateEntity = SmartBeanUtil.copy(valueUpdateForm, DictValueEntity.class); + dictValueDao.updateById(dictValueUpdateEntity); + } + return ResponseDTO.ok(); + } + + /** + * key删除 + * + * @param keyIdList + * @return + */ + public ResponseDTO keyDelete(List keyIdList) { + if (CollectionUtils.isEmpty(keyIdList)) { + return ResponseDTO.ok(); + } + dictKeyDao.updateDeletedFlagByIdList(keyIdList, true); + return ResponseDTO.ok(); + } + + /** + * 值删除 + * + * @param valueIdList + * @return + */ + public ResponseDTO valueDelete(List valueIdList) { + if (CollectionUtils.isEmpty(valueIdList)) { + return ResponseDTO.ok(); + } + dictValueDao.updateDeletedFlagByIdList(valueIdList, true); + return ResponseDTO.ok(); + } + + /** + * 分页查询key + * + * @param queryForm + * @return + */ + public ResponseDTO> keyQuery(DictKeyQueryForm queryForm) { + queryForm.setDeletedFlag(false); + Page page = SmartPageUtil.convert2PageQuery(queryForm); + List list = dictKeyDao.query(page, queryForm); + PageResult pageResult = SmartPageUtil.convert2PageResult(page, list); + if (pageResult.getEmptyFlag()) { + return ResponseDTO.ok(pageResult); + } + return ResponseDTO.ok(pageResult); + } + + /** + * 所有key + * + * @return + */ + public List queryAllKey() { + return SmartBeanUtil.copyList(dictKeyDao.selectList(null), DictKeyVO.class); + } + + /** + * 分页查询值 + * + * @param queryForm + * @return + */ + public ResponseDTO> valueQuery(DictValueQueryForm queryForm) { + queryForm.setDeletedFlag(false); + Page page = SmartPageUtil.convert2PageQuery(queryForm); + List list = dictValueDao.query(page, queryForm); + PageResult pageResult = SmartPageUtil.convert2PageResult(page, list); + if (pageResult.getEmptyFlag()) { + return ResponseDTO.ok(pageResult); + } + return ResponseDTO.ok(pageResult); + } + + +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/feedback/controller/FeedbackController.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/feedback/controller/FeedbackController.java new file mode 100644 index 00000000..b9a1cd09 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/feedback/controller/FeedbackController.java @@ -0,0 +1,53 @@ +package net.lab1024.sa.common.module.support.feedback.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import net.lab1024.sa.common.common.controller.SupportBaseController; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.RequestUser; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.util.SmartRequestUtil; +import net.lab1024.sa.common.constant.SwaggerTagConst; +import net.lab1024.sa.common.module.support.feedback.domain.FeedbackAddForm; +import net.lab1024.sa.common.module.support.feedback.domain.FeedbackQueryForm; +import net.lab1024.sa.common.module.support.feedback.domain.FeedbackVO; +import net.lab1024.sa.common.module.support.feedback.service.FeedbackService; +import net.lab1024.sa.common.module.support.repeatsubmit.annoation.RepeatSubmit; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +import javax.validation.Valid; + +/** + * 意见反馈 + * + * @Author 1024创新实验室: 开云 + * @Date 2022-08-11 20:48:09 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Slf4j +@Api(tags = SwaggerTagConst.Support.FEEDBACK) +@RestController +public class FeedbackController extends SupportBaseController { + + @Autowired + private FeedbackService feedbackService; + + @ApiOperation("意见反馈-分页查询 @author 开云") + @PostMapping("/feedback/query") + public ResponseDTO> query(@RequestBody @Valid FeedbackQueryForm queryForm) { + return feedbackService.query(queryForm); + } + + @ApiOperation("意见反馈-新增 @author 开云") + @PostMapping("/feedback/add") + public ResponseDTO add(@RequestBody @Valid FeedbackAddForm addForm) { + RequestUser employee = SmartRequestUtil.getRequestUser(); + return feedbackService.add(addForm, employee); + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/feedback/dao/FeedbackDao.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/feedback/dao/FeedbackDao.java new file mode 100644 index 00000000..e03e2e14 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/feedback/dao/FeedbackDao.java @@ -0,0 +1,31 @@ +package net.lab1024.sa.common.module.support.feedback.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import net.lab1024.sa.common.module.support.feedback.domain.FeedbackEntity; +import net.lab1024.sa.common.module.support.feedback.domain.FeedbackQueryForm; +import net.lab1024.sa.common.module.support.feedback.domain.FeedbackVO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * 意见反馈 dao + * + * @Author 1024创新实验室: 开云 + * @Date 2022-08-11 20:48:09 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Mapper +@Component +public interface FeedbackDao extends BaseMapper { + + /** + * 分页查询 + */ + List queryPage(Page page, @Param("query") FeedbackQueryForm query); +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/feedback/domain/FeedbackAddForm.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/feedback/domain/FeedbackAddForm.java new file mode 100644 index 00000000..dd32ea57 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/feedback/domain/FeedbackAddForm.java @@ -0,0 +1,33 @@ +package net.lab1024.sa.common.module.support.feedback.domain; + +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.json.deserializer.FileKeyVoDeserializer; +import net.lab1024.sa.common.common.json.serializer.FileKeyVoSerializer; + +import javax.validation.constraints.NotBlank; + +/** + * 意见反馈 添加表单 + * + * @Author 1024创新实验室: 开云 + * @Date 2022-08-11 20:48:09 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class FeedbackAddForm { + + @ApiModelProperty("反馈内容") + @NotBlank(message = "反馈内容不能为空") + private String feedbackContent; + + @ApiModelProperty("反馈图片") + @JsonSerialize(using = FileKeyVoSerializer.class) + @JsonDeserialize(using = FileKeyVoDeserializer.class) + private String feedbackAttachment; + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/feedback/domain/FeedbackEntity.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/feedback/domain/FeedbackEntity.java new file mode 100644 index 00000000..1a5a9899 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/feedback/domain/FeedbackEntity.java @@ -0,0 +1,62 @@ +package net.lab1024.sa.common.module.support.feedback.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * 意见反馈 表 + * + * @Author 1024创新实验室: 开云 + * @Date 2022-08-11 20:48:09 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +@TableName("t_feedback") +public class FeedbackEntity { + /** + * 主键 + */ + @TableId(type = IdType.AUTO) + private Long feedbackId; + + /** + * 反馈内容 + */ + private String feedbackContent; + + /** + * 反馈附件 + */ + private String feedbackAttachment; + + /** + * 创建人id + */ + private Long userId; + + /** + * 用户类型 + */ + private Integer userType; + + /** + * 创建人姓名 + */ + private String userName; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; + + /** + * 创建时间 + */ + private LocalDateTime createTime; +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/feedback/domain/FeedbackQueryForm.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/feedback/domain/FeedbackQueryForm.java new file mode 100644 index 00000000..954a2e9f --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/feedback/domain/FeedbackQueryForm.java @@ -0,0 +1,31 @@ +package net.lab1024.sa.common.module.support.feedback.domain; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.domain.PageParam; +import org.hibernate.validator.constraints.Length; + +import java.time.LocalDate; + +/** + * 意见反馈 查询 + * + * @Author 1024创新实验室: 开云 + * @Date 2022-08-11 20:48:09 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class FeedbackQueryForm extends PageParam { + + @ApiModelProperty("搜索词") + @Length(max = 25, message = "搜索词最多25字符") + private String searchWord; + + @ApiModelProperty(value = "开始时间", example = "2021-02-14") + private LocalDate startDate; + + @ApiModelProperty(value = "截止时间", example = "2022-10-15") + private LocalDate endDate; +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/feedback/domain/FeedbackVO.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/feedback/domain/FeedbackVO.java new file mode 100644 index 00000000..83d19674 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/feedback/domain/FeedbackVO.java @@ -0,0 +1,51 @@ +package net.lab1024.sa.common.module.support.feedback.domain; + +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.enumeration.UserTypeEnum; +import net.lab1024.sa.common.common.json.deserializer.FileKeyVoDeserializer; +import net.lab1024.sa.common.common.json.serializer.FileKeyVoSerializer; +import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum; + +import java.time.LocalDateTime; + +/** + * 意见反馈 返回对象 + * + * @Author 1024创新实验室: 开云 + * @Date 2022-08-11 20:48:09 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class FeedbackVO { + + @ApiModelProperty(value = "主键") + private Long feedbackId; + + @ApiModelProperty(value = "反馈内容") + private String feedbackContent; + + @ApiModelProperty("反馈图片") + @JsonSerialize(using = FileKeyVoSerializer.class) + @JsonDeserialize(using = FileKeyVoDeserializer.class) + private String feedbackAttachment; + + @ApiModelProperty(value = "创建人id") + private Long userId; + + @ApiModelProperty(value = "创建人姓名") + private String userName; + + @ApiModelPropertyEnum(value = UserTypeEnum.class, desc = "创建人类型") + private Integer userType; + + @ApiModelProperty(value = "更新时间") + private LocalDateTime updateTime; + + @ApiModelProperty(value = "创建时间") + private LocalDateTime createTime; +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/feedback/service/FeedbackService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/feedback/service/FeedbackService.java new file mode 100644 index 00000000..a534cc7e --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/feedback/service/FeedbackService.java @@ -0,0 +1,62 @@ +package net.lab1024.sa.common.module.support.feedback.service; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.RequestUser; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.util.SmartBeanUtil; +import net.lab1024.sa.common.common.util.SmartPageUtil; +import net.lab1024.sa.common.module.support.feedback.dao.FeedbackDao; +import net.lab1024.sa.common.module.support.feedback.domain.FeedbackAddForm; +import net.lab1024.sa.common.module.support.feedback.domain.FeedbackEntity; +import net.lab1024.sa.common.module.support.feedback.domain.FeedbackQueryForm; +import net.lab1024.sa.common.module.support.feedback.domain.FeedbackVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + + +/** + * 意见反馈 + * + * @Author 1024创新实验室: 开云 + * @Date 2022-08-11 20:48:09 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Service +public class FeedbackService { + + @Autowired + private FeedbackDao feedbackDao; + + /** + * 分页查询 + * + * @param queryForm + * @return + */ + public ResponseDTO> query(FeedbackQueryForm queryForm) { + Page page = SmartPageUtil.convert2PageQuery(queryForm); + List list = feedbackDao.queryPage(page, queryForm); + PageResult pageResultDTO = SmartPageUtil.convert2PageResult(page, list); + if (pageResultDTO.getEmptyFlag()) { + return ResponseDTO.ok(pageResultDTO); + } + return ResponseDTO.ok(pageResultDTO); + } + + /** + * 新建 + */ + public ResponseDTO add(FeedbackAddForm addForm, RequestUser requestUser) { + FeedbackEntity feedback = SmartBeanUtil.copy(addForm, FeedbackEntity.class); + feedback.setUserType(requestUser.getUserType().getValue()); + feedback.setUserId(requestUser.getUserId()); + feedback.setUserName(requestUser.getUserName()); + feedbackDao.insert(feedback); + return ResponseDTO.ok(); + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/constant/FileFolderTypeEnum.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/constant/FileFolderTypeEnum.java new file mode 100644 index 00000000..5428c418 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/constant/FileFolderTypeEnum.java @@ -0,0 +1,49 @@ +package net.lab1024.sa.common.module.support.file.constant; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import net.lab1024.sa.common.common.enumeration.BaseEnum; + +/** + * 文件服务 文件夹位置类型枚举类 + * + * @Author 1024创新实验室: 胡克 + * @Date 2019年10月11日 15:34:47 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@AllArgsConstructor +@Getter +public enum FileFolderTypeEnum implements BaseEnum { + + COMMON(1, FileFolderTypeEnum.FOLDER_PUBLIC + "/common/", "通用"), + + NOTICE(2, FileFolderTypeEnum.FOLDER_PUBLIC + "/notice/", "公告"), + + HELP_DOC(3, FileFolderTypeEnum.FOLDER_PUBLIC + "help-doc", "帮助中心"), + + FEEDBACK(4, FileFolderTypeEnum.FOLDER_PUBLIC + "/feedback/", "意见反馈"), + + ; + + /** + * 公用读取文件夹 public + */ + public static final String FOLDER_PUBLIC = "public"; + + /** + * 私有读取文件夹 private + */ + public static final String FOLDER_PRIVATE = "private"; + + + public static final String INFO = "1:通用"; + + private final Integer value; + + private final String folder; + + private final String desc; +} + diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/controller/FileController.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/controller/FileController.java new file mode 100644 index 00000000..04dc3f10 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/controller/FileController.java @@ -0,0 +1,72 @@ +package net.lab1024.sa.common.module.support.file.controller; + +import cn.hutool.extra.servlet.ServletUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import net.lab1024.sa.common.common.constant.RequestHeaderConst; +import net.lab1024.sa.common.common.controller.SupportBaseController; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.RequestUser; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.util.SmartRequestUtil; +import net.lab1024.sa.common.constant.SwaggerTagConst; +import net.lab1024.sa.common.module.support.file.domain.form.FileQueryForm; +import net.lab1024.sa.common.module.support.file.domain.form.FileUrlUploadForm; +import net.lab1024.sa.common.module.support.file.domain.vo.FileUploadVO; +import net.lab1024.sa.common.module.support.file.domain.vo.FileVO; +import net.lab1024.sa.common.module.support.repeatsubmit.annoation.RepeatSubmit; +import net.lab1024.sa.common.module.support.file.constant.FileFolderTypeEnum; +import net.lab1024.sa.common.module.support.file.service.FileService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletRequest; +import javax.validation.Valid; + +/** + * 文件服务 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2019年10月11日 15:34:47 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@RestController +@Api(tags = {SwaggerTagConst.Support.FILE}) +public class FileController extends SupportBaseController { + + @Autowired + private FileService fileService; + + + @ApiOperation(value = "文件上传 @author 胡克", notes = FileFolderTypeEnum.INFO) + @PostMapping("/file/upload") + public ResponseDTO upload(@RequestParam MultipartFile file, + @RequestParam Integer folder) { + RequestUser requestUser = SmartRequestUtil.getRequestUser(); + return fileService.fileUpload(file, folder, requestUser); + } + + @ApiOperation(value = "文件上传,通过url上传 @author 胡克", notes = FileFolderTypeEnum.INFO) + @PostMapping("/file/upload/url") + public ResponseDTO uploadByUrl(@RequestBody @Valid FileUrlUploadForm uploadForm) { + RequestUser requestUser = SmartRequestUtil.getRequestUser(); + return fileService.fileUpload(uploadForm,requestUser); + } + + @ApiOperation("获取文件URL:根据fileKey @author 胡克") + @GetMapping("/file/getFileUrl") + public ResponseDTO getUrl(@RequestParam String fileKey) { + return fileService.getFileUrl(fileKey); + } + + @ApiOperation(value = "下载文件流(根据fileKey) @author 胡克") + @GetMapping("/file/downLoad") + public ResponseEntity downLoad(@RequestParam String fileKey, HttpServletRequest request) { + String userAgent = ServletUtil.getHeaderIgnoreCase(request, RequestHeaderConst.USER_AGENT); + return fileService.downloadByFileKey(fileKey, userAgent); + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/dao/FileDao.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/dao/FileDao.java new file mode 100644 index 00000000..f49b4177 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/dao/FileDao.java @@ -0,0 +1,44 @@ +package net.lab1024.sa.common.module.support.file.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import net.lab1024.sa.common.module.support.file.domain.vo.FileVO; +import net.lab1024.sa.common.module.support.file.domain.entity.FileEntity; +import net.lab1024.sa.common.module.support.file.domain.form.FileQueryForm; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * 文件服务 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2019年10月11日 15:34:47 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Mapper +@Component +public interface FileDao extends BaseMapper { + + /** + * 文件key单个查询 + * + * @param fileKey + * @return + */ + FileVO getByFileKey(@Param("fileKey") String fileKey); + + /** + * 分页 查询 + * + * @param page + * @param queryForm + * @return + */ + List queryPage(Page page, @Param("queryForm") FileQueryForm queryForm); + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/domain/entity/FileEntity.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/domain/entity/FileEntity.java new file mode 100644 index 00000000..194a4ecb --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/domain/entity/FileEntity.java @@ -0,0 +1,73 @@ +package net.lab1024.sa.common.module.support.file.domain.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * 文件服务 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2019年10月11日 15:34:47 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +@TableName(value = "t_file") +public class FileEntity { + + /** + * 主键id + */ + @TableId(type = IdType.AUTO) + private Long fileId; + + /** + * 文件夹类型 + */ + private Integer folderType; + + /** + * 文件名称 + */ + private String fileName; + + /** + * 文件大小 + */ + private Long fileSize; + + /** + * 文件key,用于文件下载 + */ + private String fileKey; + + /** + * 文件类型 + */ + private String fileType; + + /** + * 创建人,即上传人 + */ + private Long creatorId; + + /** + * 用户类型 + */ + private Integer creatorUserType; + + /** + * 创建人 姓名 + */ + private String creatorName; + + private LocalDateTime updateTime; + + private LocalDateTime createTime; +} + diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/domain/form/FileQueryForm.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/domain/form/FileQueryForm.java new file mode 100644 index 00000000..29bc58ce --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/domain/form/FileQueryForm.java @@ -0,0 +1,47 @@ +package net.lab1024.sa.common.module.support.file.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.domain.PageParam; +import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum; +import net.lab1024.sa.common.common.validator.enumeration.CheckEnum; +import net.lab1024.sa.common.module.support.file.constant.FileFolderTypeEnum; +import org.hibernate.validator.constraints.Length; + +import java.time.LocalDate; + +/** + * 文件信息查询 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2019年10月11日 15:34:47 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class FileQueryForm extends PageParam { + + @ApiModelPropertyEnum(value = FileFolderTypeEnum.class, desc = "文件夹类型") + @CheckEnum(value = FileFolderTypeEnum.class, message = "文件夹类型 错误") + private Integer folderType; + + @ApiModelProperty(value = "文件名词") + private String fileName; + + @ApiModelProperty(value = "文件Key") + private String fileKey; + + @ApiModelProperty(value = "文件类型") + private String fileType; + + @ApiModelProperty(value = "创建人") + private String creatorName; + + @ApiModelProperty(value = "创建时间") + private LocalDate createTimeBegin; + + @ApiModelProperty(value = "创建时间") + private LocalDate createTimeEnd; + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/domain/form/FileUrlUploadForm.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/domain/form/FileUrlUploadForm.java new file mode 100644 index 00000000..a3468851 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/domain/form/FileUrlUploadForm.java @@ -0,0 +1,31 @@ +package net.lab1024.sa.common.module.support.file.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum; +import net.lab1024.sa.common.common.validator.enumeration.CheckEnum; +import net.lab1024.sa.common.module.support.file.constant.FileFolderTypeEnum; + +import javax.validation.constraints.NotBlank; + +/** + * url上传文件 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2019年10月11日 15:34:47 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class FileUrlUploadForm { + + @ApiModelPropertyEnum(value = FileFolderTypeEnum.class, desc = "业务类型") + @CheckEnum(value = FileFolderTypeEnum.class, required = true, message = "业务类型错误") + private Integer folder; + + @ApiModelProperty("文件url") + @NotBlank(message = "文件url不能为空") + private String fileUrl; + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/domain/vo/FileDownloadVO.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/domain/vo/FileDownloadVO.java new file mode 100644 index 00000000..42e76ddf --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/domain/vo/FileDownloadVO.java @@ -0,0 +1,28 @@ +package net.lab1024.sa.common.module.support.file.domain.vo; + +import lombok.Data; + +/** + * 文件下载 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2019年10月11日 15:34:47 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class FileDownloadVO { + + /** + * 文件字节数据 + */ + private byte[] data; + + /** + * 文件元数据 + */ + private FileMetadataVO metadata; + + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/domain/vo/FileMetadataVO.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/domain/vo/FileMetadataVO.java new file mode 100644 index 00000000..ad268891 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/domain/vo/FileMetadataVO.java @@ -0,0 +1,31 @@ +package net.lab1024.sa.common.module.support.file.domain.vo; + +import lombok.Data; + +/** + * 文件元数据 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2019年10月11日 15:34:47 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class FileMetadataVO { + + /** + * 文件名称 + */ + private String fileName; + + /** + * 文件大小/字节 + */ + private Long fileSize; + + /** + * 文件格式 + */ + private String fileFormat; +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/domain/vo/FileUploadVO.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/domain/vo/FileUploadVO.java new file mode 100644 index 00000000..345c337f --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/domain/vo/FileUploadVO.java @@ -0,0 +1,35 @@ +package net.lab1024.sa.common.module.support.file.domain.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * 文件信息 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2019年10月11日 15:34:47 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class FileUploadVO { + + @ApiModelProperty(value = "文件id") + private Long fileId; + + @ApiModelProperty(value = "文件名称") + private String fileName; + + @ApiModelProperty(value = "fileUrl") + private String fileUrl; + + @ApiModelProperty(value = "fileKey") + private String fileKey; + + @ApiModelProperty(value = "文件大小") + private Long fileSize; + + @ApiModelProperty(value = "文件类型") + private String fileType; +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/domain/vo/FileVO.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/domain/vo/FileVO.java new file mode 100644 index 00000000..9ab82174 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/domain/vo/FileVO.java @@ -0,0 +1,56 @@ +package net.lab1024.sa.common.module.support.file.domain.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.enumeration.UserTypeEnum; +import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum; +import net.lab1024.sa.common.module.support.file.constant.FileFolderTypeEnum; + +import java.time.LocalDateTime; + +/** + * 文件信息 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2019年10月11日 15:34:47 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class FileVO { + + @ApiModelProperty("主键") + private Long fileId; + + @ApiModelProperty("存储文件夹类型") + @ApiModelPropertyEnum(FileFolderTypeEnum.class) + private Integer folderType; + + @ApiModelProperty("文件名称") + private String fileName; + + @ApiModelProperty("文件大小") + private Integer fileSize; + + @ApiModelProperty("文件类型") + private String fileType; + + @ApiModelProperty("文件路径") + private String fileKey; + + @ApiModelProperty("上传人") + private Long creatorId; + + @ApiModelProperty("上传人") + private String creatorName; + + @ApiModelPropertyEnum(value = UserTypeEnum.class, desc = "创建人类型") + private Integer creatorUserType; + + @ApiModelProperty("文件展示url") + private String fileUrl; + + @ApiModelProperty("创建时间") + private LocalDateTime createTime; +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/service/FileService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/service/FileService.java new file mode 100644 index 00000000..34449f32 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/service/FileService.java @@ -0,0 +1,272 @@ +package net.lab1024.sa.common.module.support.file.service; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.google.common.collect.Lists; +import net.lab1024.sa.common.common.code.SystemErrorCode; +import net.lab1024.sa.common.common.code.UserErrorCode; +import net.lab1024.sa.common.common.constant.StringConst; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.RequestUser; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.util.SmartBeanUtil; +import net.lab1024.sa.common.common.util.SmartEnumUtil; +import net.lab1024.sa.common.common.util.SmartPageUtil; +import net.lab1024.sa.common.constant.RedisKeyConst; +import net.lab1024.sa.common.module.support.file.constant.FileFolderTypeEnum; +import net.lab1024.sa.common.module.support.file.dao.FileDao; +import net.lab1024.sa.common.module.support.file.domain.entity.FileEntity; +import net.lab1024.sa.common.module.support.file.domain.form.FileQueryForm; +import net.lab1024.sa.common.module.support.file.domain.form.FileUrlUploadForm; +import net.lab1024.sa.common.module.support.file.domain.vo.FileDownloadVO; +import net.lab1024.sa.common.module.support.file.domain.vo.FileMetadataVO; +import net.lab1024.sa.common.module.support.file.domain.vo.FileUploadVO; +import net.lab1024.sa.common.module.support.file.domain.vo.FileVO; +import net.lab1024.sa.common.module.support.redis.RedisService; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.mock.web.MockMultipartFile; +import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import java.io.IOException; +import java.net.URL; +import java.net.URLConnection; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * 文件服务 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2019年10月11日 15:34:47 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Service +public class FileService { + + /** + * 文件名最大长度 + */ + private static final int FILE_NAME_MAX_LENGTH = 100; + + @Resource + private IFileStorageService fileStorageService; + + @Autowired + private FileDao fileDao; + + @Autowired + private RedisService redisService; + + @Value("${spring.servlet.multipart.max-file-size}") + private String maxFileSize; + + /** + * 文件上传服务:通过 url 上传 + * + * @param urlUploadForm + * @param requestUser + * @return + */ + public ResponseDTO fileUpload(FileUrlUploadForm urlUploadForm, RequestUser requestUser) { + try { + URL url = new URL(urlUploadForm.getFileUrl()); + URLConnection urlConnection = url.openConnection(); + // 获取文件格式 + String contentType = urlConnection.getContentType(); + String fileType = fileStorageService.getFileTypeByContentType(contentType); + // 生成文件key + String fileKey = fileStorageService.generateFileNameByType(fileType); + MockMultipartFile file = new MockMultipartFile(fileKey, fileKey, contentType, urlConnection.getInputStream()); + return this.fileUpload(file, urlUploadForm.getFolder(), requestUser); + } catch (IOException e) { + return ResponseDTO.error(SystemErrorCode.SYSTEM_ERROR, "上传失败"); + } + } + + /** + * 文件上传服务 + * + * @param file + * @param folderType 文件夹类型 + * @return + */ + public ResponseDTO fileUpload(MultipartFile file, Integer folderType, RequestUser requestUser) { + FileFolderTypeEnum folderTypeEnum = SmartEnumUtil.getEnumByValue(folderType, FileFolderTypeEnum.class); + if (null == folderTypeEnum) { + return ResponseDTO.userErrorParam("文件夹错误"); + } + if (null == file || file.getSize() == 0) { + return ResponseDTO.userErrorParam("上传文件不能为空"); + } + // 校验文件名称 + String originalFilename = file.getOriginalFilename(); + if (StringUtils.isBlank(originalFilename)) { + return ResponseDTO.userErrorParam("上传文件名称不能为空"); + } + if (originalFilename.length() > FILE_NAME_MAX_LENGTH) { + return ResponseDTO.userErrorParam("文件名称最大长度为:" + FILE_NAME_MAX_LENGTH); + } + // 校验文件大小 + String maxSizeStr = maxFileSize.toLowerCase().replace("mb", ""); + long maxSize = Integer.parseInt(maxSizeStr) * 1024 * 1024L; + if (file.getSize() > maxSize) { + return ResponseDTO.userErrorParam("上传文件最大:" + maxSize); + } + // 获取文件服务 + ResponseDTO response = fileStorageService.fileUpload(file, folderTypeEnum.getFolder()); + if (!response.getOk()) { + return response; + } + + // 上传成功 保存记录数据库 + FileUploadVO uploadVO = response.getData(); + + FileEntity fileEntity = new FileEntity(); + fileEntity.setFolderType(folderTypeEnum.getValue()); + fileEntity.setFileName(originalFilename); + fileEntity.setFileSize(file.getSize()); + fileEntity.setFileKey(uploadVO.getFileKey()); + fileEntity.setFileType(uploadVO.getFileType()); + fileEntity.setCreatorId(requestUser == null ? null:requestUser.getUserId()); + fileEntity.setCreatorName(requestUser == null ? null:requestUser.getUserName()); + fileEntity.setCreatorUserType(requestUser == null ? null:requestUser.getUserType().getValue()); + fileDao.insert(fileEntity); + uploadVO.setFileId(fileEntity.getFileId()); + // 添加缓存 + String redisKey = redisService.generateRedisKey(RedisKeyConst.Support.FILE_URL, uploadVO.getFileKey()); + redisService.set(redisKey, uploadVO.getFileUrl(), fileStorageService.cacheExpireSecond()); + + String fileRedisKey = redisService.generateRedisKey(RedisKeyConst.Support.FILE_VO, uploadVO.getFileKey()); + FileVO fileVO = SmartBeanUtil.copy(fileEntity, FileVO.class); + redisService.set(fileRedisKey, fileVO, fileStorageService.cacheExpireSecond()); + return response; + } + + public List getFileList(List fileKeyList) { + if (CollectionUtils.isEmpty(fileKeyList)) { + return Lists.newArrayList(); + } + return fileKeyList.stream().map(this::getCacheFileVO).filter(Objects::nonNull).collect(Collectors.toList()); + } + + private FileVO getCacheFileVO(String fileKey) { + String redisKey = redisService.generateRedisKey(RedisKeyConst.Support.FILE_VO, fileKey); + FileVO fileVO = redisService.getObject(redisKey, FileVO.class); + if (fileVO == null) { + fileVO = fileDao.getByFileKey(fileKey); + if (fileVO == null) { + return null; + } + redisService.set(redisKey, fileVO, fileStorageService.cacheExpireSecond()); + } + fileVO.setFileUrl(this.getCacheUrl(fileKey)); + return fileVO; + } + + /** + * 根据文件绝对路径 获取文件URL + * 支持单个 key 逗号分隔的形式 + * + * @param fileKey + * @return + */ + public ResponseDTO getFileUrl(String fileKey) { + if (StringUtils.isBlank(fileKey)) { + return ResponseDTO.error(UserErrorCode.PARAM_ERROR); + } + // 处理逗号分隔的字符串 + String keyList = StrUtil.split(fileKey, StringConst.SEPARATOR) + .stream().map(this::getCacheUrl) + .collect(Collectors.joining(StringConst.SEPARATOR)); + return ResponseDTO.ok(keyList); + } + + + private String getCacheUrl(String fileKey) { + String redisKey = redisService.generateRedisKey(RedisKeyConst.Support.FILE_URL, fileKey); + String fileUrl = redisService.get(redisKey); + if (null != fileUrl) { + return fileUrl; + } + ResponseDTO responseDTO = fileStorageService.getFileUrl(fileKey); + if (!responseDTO.getOk()) { + return null; + } + fileUrl = responseDTO.getData(); + redisService.set(redisKey, fileUrl, fileStorageService.cacheExpireSecond()); + return fileUrl; + } + + /** + * 分页查询 + * + * @param queryForm + * @return + */ + public PageResult queryPage(FileQueryForm queryForm) { + Page page = SmartPageUtil.convert2PageQuery(queryForm); + List list = fileDao.queryPage(page, queryForm); + PageResult pageResult = SmartPageUtil.convert2PageResult(page, list); + return pageResult; + } + + /** + * 根据文件服务类型 和 FileKey 下载文件 + * + * @param fileKey + * @return + * @throws IOException + */ + public ResponseEntity downloadByFileKey(String fileKey, String userAgent) { + // 根据文件服务类 获取对应文件服务 查询 url + ResponseDTO responseDTO = fileStorageService.fileDownload(fileKey); + if (!responseDTO.getOk()) { + HttpHeaders heads = new HttpHeaders(); + heads.add(HttpHeaders.CONTENT_TYPE, "text/html;charset=UTF-8"); + return new ResponseEntity<>(responseDTO.getMsg() + ":" + fileKey, heads, HttpStatus.OK); + } + // 设置下载头 + HttpHeaders heads = new HttpHeaders(); + heads.add(HttpHeaders.CONTENT_TYPE, "application/octet-stream; charset=utf-8"); + // 设置对应浏览器的文件名称编码 + FileDownloadVO fileDownloadVO = responseDTO.getData(); + FileMetadataVO metadata = fileDownloadVO.getMetadata(); + String fileName = null != metadata ? metadata.getFileName() : fileKey.substring(fileKey.lastIndexOf("/")); + fileName = fileStorageService.getDownloadFileNameByUA(fileName, userAgent); + heads.add(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + fileName); + ResponseEntity responseEntity = new ResponseEntity<>(fileDownloadVO.getData(), heads, HttpStatus.OK); + return responseEntity; + } + + /** + * 根据文件key 删除 + * + * @param fileKey + * @return + */ + public ResponseDTO deleteByFileKey(String fileKey) { + if (StringUtils.isBlank(fileKey)) { + return ResponseDTO.error(UserErrorCode.PARAM_ERROR); + } + FileEntity fileEntity = new FileEntity(); + fileEntity.setFileKey(fileKey); + fileEntity = fileDao.selectOne(new QueryWrapper<>(fileEntity)); + if (null == fileEntity) { + return ResponseDTO.error(UserErrorCode.DATA_NOT_EXIST); + } + // 根据文件服务类 获取对应文件服务 删除文件 + return fileStorageService.delete(fileKey); + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/service/FileStorageCloudServiceImpl.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/service/FileStorageCloudServiceImpl.java new file mode 100644 index 00000000..5b414c5e --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/service/FileStorageCloudServiceImpl.java @@ -0,0 +1,215 @@ +package net.lab1024.sa.common.module.support.file.service; + +import com.amazonaws.services.s3.AmazonS3; +import com.amazonaws.services.s3.model.CannedAccessControlList; +import com.amazonaws.services.s3.model.ObjectMetadata; +import com.amazonaws.services.s3.model.S3Object; +import lombok.extern.slf4j.Slf4j; +import net.lab1024.sa.common.common.code.SystemErrorCode; +import net.lab1024.sa.common.common.code.UserErrorCode; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.config.FileCloudConfig; +import net.lab1024.sa.common.module.support.file.domain.vo.FileDownloadVO; +import net.lab1024.sa.common.module.support.file.domain.vo.FileMetadataVO; +import net.lab1024.sa.common.module.support.file.domain.vo.FileUploadVO; +import net.lab1024.sa.common.module.support.file.constant.FileFolderTypeEnum; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.io.FilenameUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.FileCopyUtils; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.net.URL; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +/** + * 云计算 实现 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2019年10月11日 15:34:47 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Slf4j +public class FileStorageCloudServiceImpl implements IFileStorageService { + + @Autowired + private AmazonS3 amazonS3; + + @Autowired + private FileCloudConfig cloudConfig; + + /** + * 自定义元数据 文件名称 + */ + private static final String USER_METADATA_FILE_NAME = "file-name"; + + /** + * 自定义元数据 文件格式 + */ + private static final String USER_METADATA_FILE_FORMAT = "file-format"; + + /** + * 自定义元数据 文件大小 + */ + private static final String USER_METADATA_FILE_SIZE = "file-size"; + + @Override + public ResponseDTO fileUpload(MultipartFile file, String path) { + // 设置文件 key + String originalFilename = file.getOriginalFilename(); + String fileType = FilenameUtils.getExtension(originalFilename); + String fileKey = path + this.generateFileName(originalFilename); + // 文件名称 URL 编码 + String urlEncoderFilename; + try { + urlEncoderFilename = URLEncoder.encode(originalFilename, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + log.error("阿里云文件上传服务URL ENCODE-发生异常:", e); + return ResponseDTO.error(SystemErrorCode.SYSTEM_ERROR,"上传失败"); + } + ObjectMetadata meta = new ObjectMetadata(); + meta.setContentEncoding(StandardCharsets.UTF_8.name()); + meta.setContentDisposition("attachment;filename=" + urlEncoderFilename); + Map userMetadata = new HashMap(10); + userMetadata.put(USER_METADATA_FILE_NAME, urlEncoderFilename); + userMetadata.put(USER_METADATA_FILE_FORMAT, fileType); + userMetadata.put(USER_METADATA_FILE_SIZE, String.valueOf(file.getSize())); + meta.setUserMetadata(userMetadata); + meta.setContentLength(file.getSize()); + meta.setContentType(this.getContentType(fileType)); + try { + amazonS3.putObject(cloudConfig.getBucketName(), fileKey, file.getInputStream(), meta); + } catch (IOException e) { + log.error("文件上传-发生异常:", e); + return ResponseDTO.error(SystemErrorCode.SYSTEM_ERROR,"上传失败"); + } + // 根据文件路径获取并设置访问权限 + CannedAccessControlList acl = this.getACL(path); + amazonS3.setObjectAcl(cloudConfig.getBucketName(), fileKey, acl); + // 返回上传结果 + FileUploadVO uploadVO = new FileUploadVO(); + uploadVO.setFileName(originalFilename); + uploadVO.setFileType(fileType); + // 根据 访问权限 返回不同的 URL + String url = cloudConfig.getPublicUrl() + fileKey; + if (CannedAccessControlList.Private.equals(acl)) { + // 获取临时访问的URL + url = this.getFileUrl(fileKey).getData(); + } + uploadVO.setFileUrl(url); + uploadVO.setFileKey(fileKey); + uploadVO.setFileSize(file.getSize()); + return ResponseDTO.ok(uploadVO); + } + + /** + * 获取文件url + * + * @param fileKey + * @return + */ + @Override + public ResponseDTO getFileUrl(String fileKey) { + if (StringUtils.isBlank(fileKey)) { + return ResponseDTO.userErrorParam(); + } + if (!fileKey.startsWith(FileFolderTypeEnum.FOLDER_PRIVATE)) { + // 不是私有的 都公共读 + return ResponseDTO.ok(cloudConfig.getPublicUrl() + fileKey); + } + Date expiration = new Date(System.currentTimeMillis() + cloudConfig.getUrlExpire()); + URL url = amazonS3.generatePresignedUrl(cloudConfig.getBucketName(), fileKey, expiration); + String urlStr = url.toString().replace("http://", "https://"); + return ResponseDTO.ok(urlStr); + } + + /** + * 流式下载(名称为原文件) + */ + @Override + public ResponseDTO fileDownload(String key) { + //获取oss对象 + S3Object s3Object = amazonS3.getObject(cloudConfig.getBucketName(), key); + // 获取文件 meta + ObjectMetadata metadata = s3Object.getObjectMetadata(); + Map userMetadata = metadata.getUserMetadata(); + FileMetadataVO metadataDTO = null; + if (MapUtils.isNotEmpty(userMetadata)) { + metadataDTO = new FileMetadataVO(); + metadataDTO.setFileFormat(userMetadata.get(USER_METADATA_FILE_FORMAT)); + metadataDTO.setFileName(userMetadata.get(USER_METADATA_FILE_NAME)); + String fileSizeStr = userMetadata.get(USER_METADATA_FILE_SIZE); + Long fileSize = StringUtils.isBlank(fileSizeStr) ? null : Long.valueOf(fileSizeStr); + metadataDTO.setFileSize(fileSize); + } + + // 获得输入流 + InputStream objectContent = s3Object.getObjectContent(); + try { + // 输入流转换为字节流 + byte[] buffer = FileCopyUtils.copyToByteArray(objectContent); + + FileDownloadVO fileDownloadVO = new FileDownloadVO(); + fileDownloadVO.setData(buffer); + fileDownloadVO.setMetadata(metadataDTO); + return ResponseDTO.ok(fileDownloadVO); + } catch (IOException e) { + log.error("文件下载-发生异常:", e); + return ResponseDTO.error(SystemErrorCode.SYSTEM_ERROR,"下载失败"); + } finally { + try { + // 关闭输入流 + objectContent.close(); + s3Object.close(); + } catch (IOException e) { + log.error("文件下载-发生异常:", e); + } + } + } + + /** + * 根据文件夹路径 返回对应的访问权限 + * + * @param fileKey + * @return + */ + private CannedAccessControlList getACL(String fileKey) { + // 公用读 + if (fileKey.contains(FileFolderTypeEnum.FOLDER_PUBLIC)) { + return CannedAccessControlList.PublicRead; + } + // 其他默认私有读写 + return CannedAccessControlList.Private; + } + + /** + * 单个删除文件 + * 根据 file key 删除文件 + * ps:不能删除fileKey不为空的文件夹 + * + * @param fileKey 文件or文件夹 + * @return + */ + @Override + public ResponseDTO delete(String fileKey) { + amazonS3.deleteObject(cloudConfig.getBucketName(), fileKey); + return ResponseDTO.ok(); + } + + + @Override + public Long cacheExpireSecond(){ + return cloudConfig.getUrlExpire() - 1800; + } + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/service/FileStorageLocalServiceImpl.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/service/FileStorageLocalServiceImpl.java new file mode 100644 index 00000000..3842aef6 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/service/FileStorageLocalServiceImpl.java @@ -0,0 +1,149 @@ +package net.lab1024.sa.common.module.support.file.service; + +import lombok.extern.slf4j.Slf4j; +import net.lab1024.sa.common.common.code.SystemErrorCode; +import net.lab1024.sa.common.common.code.UserErrorCode; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.module.support.file.domain.vo.FileDownloadVO; +import net.lab1024.sa.common.module.support.file.domain.vo.FileUploadVO; +import net.lab1024.sa.common.module.support.config.ConfigKeyEnum; +import net.lab1024.sa.common.module.support.config.ConfigService; +import org.apache.commons.io.FileUtils; +import org.apache.commons.io.FilenameUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.util.FileCopyUtils; +import org.springframework.web.multipart.MultipartFile; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; + +/** + * 本地存储 实现 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2019年10月11日 15:34:47 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Slf4j +public class FileStorageLocalServiceImpl implements IFileStorageService { + + @Value("${file.storage.local.path}") + private String localPath; + + @Autowired + private ConfigService configService; + + @Override + public ResponseDTO fileUpload(MultipartFile multipartFile, String path) { + if (null == multipartFile) { + return ResponseDTO.userErrorParam("上传文件不能为空"); + } + String filePath = localPath + path; + File directory = new File(filePath); + if (!directory.exists()) { + // 目录不存在,新建 + directory.mkdirs(); + } + if (!path.endsWith("/")) { + path = path + "/"; + } + FileUploadVO fileUploadVO = new FileUploadVO(); + //原文件名 + String originalFileName = multipartFile.getOriginalFilename(); + //新文件名 + String newFileName = this.generateFileName(originalFileName); + //生成文件key + String fileKey = path + newFileName; + //创建文件 + File fileTemp = new File(new File(filePath + newFileName).getAbsolutePath()); + try { + multipartFile.transferTo(fileTemp); + fileUploadVO.setFileUrl(this.generateFileUrl(fileKey)); + fileUploadVO.setFileName(newFileName); + fileUploadVO.setFileKey(fileKey); + fileUploadVO.setFileSize(multipartFile.getSize()); + fileUploadVO.setFileType(FilenameUtils.getExtension(originalFileName)); + } catch (IOException e) { + if (fileTemp.exists() && fileTemp.isFile()) { + fileTemp.delete(); + } + log.error("", e); + return ResponseDTO.error(SystemErrorCode.SYSTEM_ERROR, "上传失败"); + } + return ResponseDTO.ok(fileUploadVO); + } + + /** + * 生成fileUrl地址 + * + * @param fileKey + * @return + */ + public String generateFileUrl(String fileKey) { + String configValue = configService.getConfigValue(ConfigKeyEnum.LOCAL_UPLOAD_URL_PREFIX); + String fileUrl = configValue + fileKey; + return fileUrl; + } + + /** + * 获取文件Url + * + * @param fileKey + * @return + */ + @Override + public ResponseDTO getFileUrl(String fileKey) { + String fileUrl = this.generateFileUrl(fileKey); + return ResponseDTO.ok(fileUrl); + } + + /** + * 文件下载 + * + * @param fileKey + * @return + */ + @Override + public ResponseDTO fileDownload(String fileKey) { + String filePath = localPath + fileKey; + File localFile = new File(filePath); + InputStream in = null; + try { + in = new FileInputStream(localFile); + // 输入流转换为字节流 + byte[] buffer = FileCopyUtils.copyToByteArray(in); + FileDownloadVO fileDownloadVO = new FileDownloadVO(); + fileDownloadVO.setData(buffer); + return ResponseDTO.ok(fileDownloadVO); + } catch (IOException e) { + log.error("文件下载-发生异常:", e); + return ResponseDTO.error(SystemErrorCode.SYSTEM_ERROR, "文件下载失败"); + } finally { + try { + // 关闭输入流 + if (in != null) { + in.close(); + } + } catch (IOException e) { + log.error("文件下载-发生异常:", e); + } + } + } + + @Override + public ResponseDTO delete(String fileKey) { + String filePath = localPath + fileKey; + File localFile = new File(filePath); + try { + FileUtils.forceDelete(localFile); + } catch (IOException e) { + log.error("删除本地文件失败:{}", e); + } + return ResponseDTO.ok(); + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/service/IFileStorageService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/service/IFileStorageService.java new file mode 100644 index 00000000..7fd4690d --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/file/service/IFileStorageService.java @@ -0,0 +1,209 @@ +package net.lab1024.sa.common.module.support.file.service; + +import cn.hutool.core.date.DatePattern; +import cn.hutool.core.date.LocalDateTimeUtil; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.module.support.file.domain.vo.FileDownloadVO; +import net.lab1024.sa.common.module.support.file.domain.vo.FileUploadVO; +import org.apache.commons.io.FilenameUtils; +import org.springframework.web.multipart.MultipartFile; + +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.time.LocalDateTime; +import java.util.UUID; + +/** + * 接口 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2019年10月11日 15:34:47 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public interface IFileStorageService { + + /** + * 文件上传 + * + * @param file + * @param path + * @return + */ + ResponseDTO fileUpload(MultipartFile file, String path); + + /** + * 获取文件url + * + * @param fileKey + * @return + */ + ResponseDTO getFileUrl(String fileKey); + + /** + * 流式下载(名称为原文件) + * + * @param key + * @return + */ + ResponseDTO fileDownload(String key); + + /** + * 单个删除文件 + * 根据文件key删除 + * + * @param fileKey + * @return + */ + ResponseDTO delete(String fileKey); + + + /** + * 缓存过期秒数 + * + * @return + */ + default Long cacheExpireSecond() { + return 3600L; + } + + /** + * 生成文件名字 + * 当前年月日时分秒 +32位 uuid + 文件格式后缀 + * + * @param originalFileName + * @return String + */ + default String generateFileName(String originalFileName) { + return generateFileNameByType(FilenameUtils.getExtension(originalFileName)); + } + + /** + * 根据文件类型 生成文件名,格式如下: + * [uuid]_[日期时间]_[文件类型] + * + * @param fileType + * @return + */ + default String generateFileNameByType(String fileType) { + String uuid = UUID.randomUUID().toString().replaceAll("-", ""); + String time = LocalDateTimeUtil.format(LocalDateTime.now(), DatePattern.PURE_DATETIME_FORMATTER); + return uuid + "_" + time + "_" + fileType; + } + + /** + * 获取文件类型 + * + * @param fileExt + * @return + */ + default String getContentType(String fileExt) { + // 文件的后缀名 + if ("bmp".equalsIgnoreCase(fileExt)) { + return "image/bmp"; + } + if ("gif".equalsIgnoreCase(fileExt)) { + return "image/gif"; + } + if ("jpeg".equalsIgnoreCase(fileExt) || "jpg".equalsIgnoreCase(fileExt)) { + return "image/jpeg"; + } + if ("png".equalsIgnoreCase(fileExt)) { + return "image/png"; + } + if ("html".equalsIgnoreCase(fileExt)) { + return "text/html"; + } + if ("txt".equalsIgnoreCase(fileExt)) { + return "text/plain"; + } + if ("vsd".equalsIgnoreCase(fileExt)) { + return "application/vnd.visio"; + } + if ("ppt".equalsIgnoreCase(fileExt) || "pptx".equalsIgnoreCase(fileExt)) { + return "application/vnd.ms-powerpoint"; + } + if ("doc".equalsIgnoreCase(fileExt) || "docx".equalsIgnoreCase(fileExt)) { + return "application/msword"; + } + if ("pdf".equalsIgnoreCase(fileExt)) { + return "application/pdf"; + } + if ("xml".equalsIgnoreCase(fileExt)) { + return "text/xml"; + } + return ""; + } + + /** + * 获取文件格式 根据 content-type + * + * @param contentType + * @return + */ + default String getFileTypeByContentType(String contentType) { + // 文件的后缀名 + if ("image/bmp".equalsIgnoreCase(contentType)) { + return "bmp"; + } + if ("image/gif".equalsIgnoreCase(contentType)) { + return "gif"; + } + if ("image/jpeg".equalsIgnoreCase(contentType) || "image/jpg".equalsIgnoreCase(contentType)) { + return "jpg"; + } + if ("image/png".equalsIgnoreCase(contentType)) { + return "png"; + } + if ("text/html".equalsIgnoreCase(contentType)) { + return "html"; + } + if ("text/plain".equalsIgnoreCase(contentType)) { + return "txt"; + } + if ("application/vnd.visio".equalsIgnoreCase(contentType)) { + return "vsd"; + } + if ("application/vnd.ms-powerpoint".equalsIgnoreCase(contentType)) { + return "pptx"; + } + if ("application/msword".equalsIgnoreCase(contentType)) { + return "docx"; + } + if ("application/pdf".equalsIgnoreCase(contentType)) { + return "pdf"; + } + if ("text/xml".equalsIgnoreCase(contentType)) { + return "xml"; + } + return ""; + } + + /** + * 根据不同的浏览器 返回对应编码的文件名称 + * + * @param fileName + * @param userAgent + * @return + */ + default String getDownloadFileNameByUA(String fileName, String userAgent) { + try { + userAgent = userAgent.toUpperCase(); + if (userAgent.indexOf("MSIE") > 0) { + // IE浏览器 + fileName = URLEncoder.encode(fileName, StandardCharsets.UTF_8.name()); + } else if (userAgent.indexOf("EDGE") > 0) { + // WIN10浏览器 + fileName = URLEncoder.encode(fileName, StandardCharsets.UTF_8.name()); + } else { + // 其他 + fileName = new String(fileName.getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1); + } + } catch (UnsupportedEncodingException e) { + return null; + } + return fileName; + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/heartbeat/HeartBeatRecordDao.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/heartbeat/HeartBeatRecordDao.java new file mode 100644 index 00000000..9859bb83 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/heartbeat/HeartBeatRecordDao.java @@ -0,0 +1,51 @@ +package net.lab1024.sa.common.module.support.heartbeat; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import net.lab1024.sa.common.module.support.heartbeat.domain.HeartBeatRecordEntity; +import net.lab1024.sa.common.module.support.heartbeat.domain.HeartBeatRecordQueryForm; +import net.lab1024.sa.common.module.support.heartbeat.domain.HeartBeatRecordVO; +import net.lab1024.sa.common.module.support.operatelog.domain.OperateLogQueryForm; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Component; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * 心跳记录 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-01-09 20:57:24 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Component +@Mapper +public interface HeartBeatRecordDao extends BaseMapper { + + /** + * 更新心跳日志 + * + * @param id + * @param heartBeatTime + */ + void updateHeartBeatTimeById(@Param("id") Long id, @Param("heartBeatTime") LocalDateTime heartBeatTime); + + /** + * 查询心跳日志 + * + * @param heartBeatRecordEntity + * @return + */ + HeartBeatRecordEntity query(HeartBeatRecordEntity heartBeatRecordEntity); + + /** + * 分页查询 + * @param heartBeatRecordQueryForm + * @return + */ + List pageQuery(Page page, @Param("query") HeartBeatRecordQueryForm heartBeatRecordQueryForm); +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/heartbeat/HeartBeatRecordHandler.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/heartbeat/HeartBeatRecordHandler.java new file mode 100644 index 00000000..c666ecef --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/heartbeat/HeartBeatRecordHandler.java @@ -0,0 +1,42 @@ +package net.lab1024.sa.common.module.support.heartbeat; + +import lombok.extern.slf4j.Slf4j; +import net.lab1024.sa.common.common.util.SmartBeanUtil; +import net.lab1024.sa.common.module.support.heartbeat.domain.HeartBeatRecordEntity; +import net.lab1024.sa.common.module.support.heartbeat.core.HeartBeatRecord; +import net.lab1024.sa.common.module.support.heartbeat.core.IHeartBeatRecordHandler; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * 心跳记录 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-01-09 20:57:24 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Slf4j +@Service +public class HeartBeatRecordHandler implements IHeartBeatRecordHandler { + + @Autowired + private HeartBeatRecordDao heartBeatRecordDao; + + /** + * 心跳日志处理方法 + * @param heartBeatRecord + */ + @Override + public void handler(HeartBeatRecord heartBeatRecord) { + HeartBeatRecordEntity heartBeatRecordEntity = SmartBeanUtil.copy(heartBeatRecord, HeartBeatRecordEntity.class); + HeartBeatRecordEntity heartBeatRecordOld = heartBeatRecordDao.query(heartBeatRecordEntity); + if (heartBeatRecordOld == null) { + heartBeatRecordDao.insert(heartBeatRecordEntity); + } else { + heartBeatRecordDao.updateHeartBeatTimeById(heartBeatRecordOld.getHeartBeatRecordId(), heartBeatRecordEntity.getHeartBeatTime()); + } + } + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/heartbeat/HeartBeatService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/heartbeat/HeartBeatService.java new file mode 100644 index 00000000..1964b684 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/heartbeat/HeartBeatService.java @@ -0,0 +1,38 @@ +package net.lab1024.sa.common.module.support.heartbeat; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.extern.slf4j.Slf4j; +import net.lab1024.sa.common.common.domain.PageParam; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.util.SmartPageUtil; +import net.lab1024.sa.common.module.support.heartbeat.domain.HeartBeatRecordQueryForm; +import net.lab1024.sa.common.module.support.heartbeat.domain.HeartBeatRecordVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 心跳记录 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-01-09 20:57:24 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Slf4j +@Service +public class HeartBeatService { + + @Autowired + private HeartBeatRecordDao heartBeatRecordDao; + + public ResponseDTO> pageQuery(HeartBeatRecordQueryForm pageParam) { + Page pageQueryInfo = SmartPageUtil.convert2PageQuery(pageParam); + List recordVOList = heartBeatRecordDao.pageQuery(pageQueryInfo,pageParam); + PageResult pageResult = SmartPageUtil.convert2PageResult(pageQueryInfo, recordVOList); + return ResponseDTO.ok(pageResult); + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/heartbeat/core/HeartBeatManager.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/heartbeat/core/HeartBeatManager.java new file mode 100644 index 00000000..72973dda --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/heartbeat/core/HeartBeatManager.java @@ -0,0 +1,59 @@ +package net.lab1024.sa.common.module.support.heartbeat.core; + +import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + +/** + * 心跳核心调度管理器 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-01-09 20:57:24 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public class HeartBeatManager { + + private static final String THREAD_NAME_PREFIX = "sa-heart-beat"; + private static final int THREAD_COUNT = 1; + private static final long INITIAL_DELAY = 60 * 1000L; + + private ScheduledThreadPoolExecutor threadPoolExecutor; + + /** + * 服务状态持久化处理类 + */ + private IHeartBeatRecordHandler heartBeatRecordHandler; + + /** + * 调度配置信息 + */ + private long intervalMilliseconds; + + /** + * @param intervalMilliseconds 间隔执行时间(毫秒) + */ + public HeartBeatManager(Long intervalMilliseconds, + IHeartBeatRecordHandler heartBeatRecordHandler) { + this.intervalMilliseconds = intervalMilliseconds; + this.heartBeatRecordHandler = heartBeatRecordHandler; + //使用守护线程去处理 + this.threadPoolExecutor = new ScheduledThreadPoolExecutor(THREAD_COUNT, r -> { + Thread t = new Thread(r, THREAD_NAME_PREFIX); + if (!t.isDaemon()) { + t.setDaemon(true); + } + return t; + }); + // 开始心跳 + this.beginHeartBeat(); + } + + /** + * 开启心跳 + */ + private void beginHeartBeat() { + HeartBeatRunnable heartBeatRunnable = new HeartBeatRunnable(heartBeatRecordHandler); + threadPoolExecutor.scheduleWithFixedDelay(heartBeatRunnable, INITIAL_DELAY, intervalMilliseconds, TimeUnit.MILLISECONDS); + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/heartbeat/core/HeartBeatRecord.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/heartbeat/core/HeartBeatRecord.java new file mode 100644 index 00000000..42698a13 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/heartbeat/core/HeartBeatRecord.java @@ -0,0 +1,41 @@ +package net.lab1024.sa.common.module.support.heartbeat.core; + +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * 心跳记录日志 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-01-09 20:57:24 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class HeartBeatRecord { + + /** + * 项目名字 + */ + private String projectPath; + /** + * 服务器ip + */ + private String serverIp; + /** + * 进程号 + */ + private Integer processNo; + /** + * 进程开启时间 + */ + private LocalDateTime processStartTime; + /** + * 心跳当前时间 + */ + private LocalDateTime heartBeatTime; + + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/heartbeat/core/HeartBeatRunnable.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/heartbeat/core/HeartBeatRunnable.java new file mode 100644 index 00000000..475780fe --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/heartbeat/core/HeartBeatRunnable.java @@ -0,0 +1,71 @@ +package net.lab1024.sa.common.module.support.heartbeat.core; + +import cn.hutool.core.net.NetUtil; +import org.apache.commons.lang3.StringUtils; + +import java.lang.management.ManagementFactory; +import java.lang.management.RuntimeMXBean; +import java.time.Instant; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.util.ArrayList; +import java.util.List; + +/** + * 心跳线程 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-01-09 20:57:24 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public class HeartBeatRunnable implements Runnable { + + /** + * 项目路径 + */ + private String projectPath; + /** + * 服务器ip(多网卡) + */ + private List serverIps; + /** + * 进程号 + */ + private Integer processNo; + /** + * 进程开启时间 + */ + private LocalDateTime processStartTime; + + private IHeartBeatRecordHandler recordHandler; + + public HeartBeatRunnable(IHeartBeatRecordHandler recordHandler) { + this.recordHandler = recordHandler; + this.initServerInfo(); + } + + /** + * 初始化心跳相关信息 + */ + private void initServerInfo(){ + RuntimeMXBean runtimeMXBean = ManagementFactory.getRuntimeMXBean(); + this.projectPath = System.getProperty("user.dir"); + this.serverIps = new ArrayList<>(NetUtil.localIpv4s()); + this.processNo = Integer.valueOf(runtimeMXBean.getName().split("@")[0]).intValue(); + this.processStartTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(runtimeMXBean.getStartTime()), ZoneId.systemDefault()); + } + + + @Override + public void run() { + HeartBeatRecord heartBeatRecord = new HeartBeatRecord(); + heartBeatRecord.setProjectPath(this.projectPath); + heartBeatRecord.setServerIp(StringUtils.join(this.serverIps, ";")); + heartBeatRecord.setProcessNo(this.processNo); + heartBeatRecord.setProcessStartTime(this.processStartTime); + heartBeatRecord.setHeartBeatTime(LocalDateTime.now()); + recordHandler.handler(heartBeatRecord); + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/heartbeat/core/IHeartBeatRecordHandler.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/heartbeat/core/IHeartBeatRecordHandler.java new file mode 100644 index 00000000..ac5fa589 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/heartbeat/core/IHeartBeatRecordHandler.java @@ -0,0 +1,20 @@ +package net.lab1024.sa.common.module.support.heartbeat.core; + +/** + * 心跳处理接口 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-01-09 20:57:24 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public interface IHeartBeatRecordHandler { + + /** + * 心跳日志处理方法 + * + * @param heartBeatRecord + */ + void handler(HeartBeatRecord heartBeatRecord); +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/heartbeat/domain/HeartBeatRecordEntity.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/heartbeat/domain/HeartBeatRecordEntity.java new file mode 100644 index 00000000..052f3d89 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/heartbeat/domain/HeartBeatRecordEntity.java @@ -0,0 +1,53 @@ +package net.lab1024.sa.common.module.support.heartbeat.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Date; + +/** + * 心跳记录 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-01-09 20:57:24 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +@TableName(value = "t_heart_beat_record") +public class HeartBeatRecordEntity implements Serializable { + + /** + * 主键id + */ + @TableId(type = IdType.AUTO) + private Long heartBeatRecordId; + + /** + * 项目名字 + */ + private String projectPath; + /** + * 服务器ip + */ + private String serverIp; + /** + * 进程号 + */ + private Integer processNo; + /** + * 进程开启时间 + */ + private LocalDateTime processStartTime; + /** + * 心跳当前时间 + */ + private LocalDateTime heartBeatTime; + + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/heartbeat/domain/HeartBeatRecordQueryForm.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/heartbeat/domain/HeartBeatRecordQueryForm.java new file mode 100644 index 00000000..c9408bbf --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/heartbeat/domain/HeartBeatRecordQueryForm.java @@ -0,0 +1,30 @@ +package net.lab1024.sa.common.module.support.heartbeat.domain; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.domain.PageParam; + +import java.time.LocalDate; + +/** + * 心跳记录 查询 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-01-09 20:57:24 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class HeartBeatRecordQueryForm extends PageParam { + + @ApiModelProperty("关键字") + private String keywords; + + @ApiModelProperty("开始日期") + private LocalDate startDate; + + @ApiModelProperty("结束日期") + private LocalDate endDate; + +} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/heartbeat/HeartBeatRecordVO.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/heartbeat/domain/HeartBeatRecordVO.java similarity index 53% rename from smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/heartbeat/HeartBeatRecordVO.java rename to smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/heartbeat/domain/HeartBeatRecordVO.java index 34e98932..9f94f175 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/heartbeat/HeartBeatRecordVO.java +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/heartbeat/domain/HeartBeatRecordVO.java @@ -1,23 +1,25 @@ -package net.lab1024.smartadmin.module.support.heartbeat; +package net.lab1024.sa.common.module.support.heartbeat.domain; import io.swagger.annotations.ApiModelProperty; import lombok.Data; -import java.io.Serializable; import java.util.Date; /** - * 心跳记录日志 - * User: simajinqiang - * Date: 2018/7/9 - * Time: 11:11 + * 心跳记录 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-01-09 20:57:24 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) */ @Data -public class HeartBeatRecordVO implements Serializable { +public class HeartBeatRecordVO { - private Integer id; + private Integer heartBeatRecordId; - @ApiModelProperty("项目名字") + @ApiModelProperty("项目路径") private String projectPath; @ApiModelProperty("服务器ip") diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/controller/HelpDocController.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/controller/HelpDocController.java new file mode 100644 index 00000000..cd3eb398 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/controller/HelpDocController.java @@ -0,0 +1,77 @@ +package net.lab1024.sa.common.module.support.helpdoc.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import net.lab1024.sa.common.common.controller.SupportBaseController; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.util.SmartRequestUtil; +import net.lab1024.sa.common.constant.SwaggerTagConst; +import net.lab1024.sa.common.module.support.helpdoc.domain.form.HelpDocViewRecordQueryForm; +import net.lab1024.sa.common.module.support.helpdoc.domain.vo.HelpDocCatalogVO; +import net.lab1024.sa.common.module.support.helpdoc.domain.vo.HelpDocDetailVO; +import net.lab1024.sa.common.module.support.helpdoc.domain.vo.HelpDocVO; +import net.lab1024.sa.common.module.support.helpdoc.domain.vo.HelpDocViewRecordVO; +import net.lab1024.sa.common.module.support.helpdoc.service.HelpDocCatalogService; +import net.lab1024.sa.common.module.support.helpdoc.service.HelpDocUserService; +import net.lab1024.sa.common.module.support.repeatsubmit.annoation.RepeatSubmit; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import javax.validation.Valid; +import java.util.List; + +/** + * 帮助文档 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-20 23:11:42 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Api(tags = SwaggerTagConst.Support.HELP_DOC) +@RestController +public class HelpDocController extends SupportBaseController { + + @Autowired + private HelpDocCatalogService helpDocCatalogService; + + @Autowired + private HelpDocUserService helpDocUserService; + + // --------------------- 帮助文档 【目录】 ------------------------- + + @ApiOperation("帮助文档目录-获取全部 @author 卓大") + @GetMapping("/helpDoc/helpDocCatalog/getAll") + public ResponseDTO> getAll() { + return ResponseDTO.ok(helpDocCatalogService.getAll()); + } + + // --------------------- 帮助文档 【用户】------------------------- + + @ApiOperation("【用户】帮助文档-查看详情 @author 卓大") + @GetMapping("/helpDoc/user/view/{helpDocId}") + @RepeatSubmit + public ResponseDTO view(@PathVariable Long helpDocId, HttpServletRequest request) { + return helpDocUserService.view( + SmartRequestUtil.getRequestUser(), + helpDocId); + } + + @ApiOperation("【用户】帮助文档-查询全部 @author 卓大") + @GetMapping("/helpDoc/user/queryAllHelpDocList") + @RepeatSubmit + public ResponseDTO> queryAllHelpDocList() { + return helpDocUserService.queryAllHelpDocList(); + } + + + @ApiOperation("【用户】帮助文档-查询 查看记录 @author 卓大") + @PostMapping("/helpDoc/user/queryViewRecord") + @RepeatSubmit + public ResponseDTO> queryViewRecord(@RequestBody @Valid HelpDocViewRecordQueryForm helpDocViewRecordQueryForm) { + return ResponseDTO.ok(helpDocUserService.queryViewRecord(helpDocViewRecordQueryForm)); + } +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/dao/HelpDocCatalogDao.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/dao/HelpDocCatalogDao.java new file mode 100644 index 00000000..68dac20a --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/dao/HelpDocCatalogDao.java @@ -0,0 +1,21 @@ +package net.lab1024.sa.common.module.support.helpdoc.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import net.lab1024.sa.common.module.support.helpdoc.domain.entity.HelpDocCatalogEntity; +import org.apache.ibatis.annotations.Mapper; +import org.springframework.stereotype.Component; + +/** + * 帮助文档目录 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-20 23:11:42 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Mapper +@Component +public interface HelpDocCatalogDao extends BaseMapper { + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/dao/HelpDocDao.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/dao/HelpDocDao.java new file mode 100644 index 00000000..cab687c2 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/dao/HelpDocDao.java @@ -0,0 +1,137 @@ +package net.lab1024.sa.common.module.support.helpdoc.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import net.lab1024.sa.common.module.support.helpdoc.domain.entity.HelpDocEntity; +import net.lab1024.sa.common.module.support.helpdoc.domain.form.HelpDocQueryForm; +import net.lab1024.sa.common.module.support.helpdoc.domain.form.HelpDocRelationForm; +import net.lab1024.sa.common.module.support.helpdoc.domain.form.HelpDocViewRecordQueryForm; +import net.lab1024.sa.common.module.support.helpdoc.domain.vo.HelpDocRelationVO; +import net.lab1024.sa.common.module.support.helpdoc.domain.vo.HelpDocVO; +import net.lab1024.sa.common.module.support.helpdoc.domain.vo.HelpDocViewRecordVO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * 帮助文档 dao + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-20 23:11:42 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Mapper +@Component +public interface HelpDocDao extends BaseMapper { + + // ================================= 帮助文档【主表 t_help_doc 】 ================================= + + + /** + * 查询 全部相关文档 + * + * @return + */ + List queryAllHelpDocList(); + + /** + * 后管分页查询帮助文档 + * + * @param page + * @param queryForm + * @return + */ + List query(Page page, @Param("query") HelpDocQueryForm queryForm); + + + /** + * 更新 阅读量 + * @param helpDocId + * @param userViewCountIncrease + * @param pageViewCountIncrease + */ + void updateViewCount(@Param("helpDocId")Long helpDocId, @Param("userViewCountIncrease")Integer userViewCountIncrease,@Param("pageViewCountIncrease") Integer pageViewCountIncrease); + + + /** + * 根据目录,查询文档 + * + * @param helpDocCatalogId + * @return + */ + List queryHelpDocByCatalogId( @Param("helpDocCatalogId") Long helpDocCatalogId); + + /** + * 根据关联文档id,查询文档 + * + * @param relationId + * @return + */ + List queryHelpDocByRelationId( @Param("relationId") Long relationId); + + // ================================= 关联项目 【子表 t_help_doc_relation 】 ================================= + + /** + * 保存 关联 + * + * @param helpDocId + * @param relationList + */ + void insertRelation(@Param("helpDocId") Long helpDocId, @Param("relationList") List relationList); + + /** + * 删除关联 + * + * @param helpDocId + */ + void deleteRelation(@Param("helpDocId") Long helpDocId); + + /** + * 查询关联 + * + * @param helpDocId + */ + List queryRelationByHelpDoc(@Param("helpDocId") Long helpDocId); + + // ================================= 查看记录【子表 t_help_doc_view_record】 ================================= + + /** + * 查询某个用户的指定文档的阅读量 + * @param helpDocId + * @param userId + * @return + */ + long viewRecordCount(@Param("helpDocId")Long helpDocId, @Param("userId")Long userId); + + /** + * 查询帮助文档的 查看记录 + * @param page + * @param helpDocViewRecordQueryForm + * @return + */ + List queryViewRecordList(Page page, @Param("queryForm") HelpDocViewRecordQueryForm helpDocViewRecordQueryForm); + + /** + * 保存查看记录 + * @param helpDocId + * @param userId + * @param userName + * @param ip + * @param userAgent + */ + void insertViewRecord(@Param("helpDocId") Long helpDocId, @Param("userId") Long userId, @Param("userName") String userName, @Param("ip") String ip, @Param("userAgent") String userAgent,@Param("pageViewCount") Integer pageViewCount); + + /** + * 更新查看记录 + * @param helpDocId + * @param userId + * @param ip + * @param userAgent + */ + void updateViewRecord(@Param("helpDocId")Long helpDocId, @Param("userId")Long userId,@Param("ip") String ip, @Param("userAgent")String userAgent); + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/entity/HelpDocCatalogEntity.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/entity/HelpDocCatalogEntity.java new file mode 100644 index 00000000..04a2afb6 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/entity/HelpDocCatalogEntity.java @@ -0,0 +1,53 @@ +package net.lab1024.sa.common.module.support.helpdoc.domain.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.LocalDateTime; + +/** + * 帮助文档的 类型 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-20 23:11:42 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +@TableName("t_help_doc_catalog") +@NoArgsConstructor +@AllArgsConstructor +@Builder +public class HelpDocCatalogEntity { + + @TableId(type = IdType.AUTO) + private Long helpDocCatalogId; + + /** + * 名称 + */ + private String name; + + /** + * 父id + */ + private Long parentId; + + /** + * 排序 + */ + @TableField("`sort`") + private Integer sort; + + + private LocalDateTime updateTime; + + private LocalDateTime createTime; +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/entity/HelpDocEntity.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/entity/HelpDocEntity.java new file mode 100644 index 00000000..fe3d033e --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/entity/HelpDocEntity.java @@ -0,0 +1,77 @@ +package net.lab1024.sa.common.module.support.helpdoc.domain.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * 帮助文档 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-20 23:11:42 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +@TableName("t_help_doc") +public class HelpDocEntity { + + @TableId(type = IdType.AUTO) + private Long helpDocId; + + /** + * 类型 + */ + private Long helpDocCatalogId; + + /** + * 标题 + */ + private String title; + + /** + * 内容 纯文本 + */ + private String contentText; + + /** + * 内容 html + */ + private String contentHtml; + + /** + * 附件 + * 多个英文逗号分隔 + */ + private String attachment; + + /** + * 排序 + */ + @TableField("`sort`") + private Integer sort; + + /** + * 页面浏览量 + */ + private Integer pageViewCount; + + /** + * 用户浏览量 + */ + private Integer userViewCount; + + /** + * 作者 + */ + private String author; + + private LocalDateTime updateTime; + + private LocalDateTime createTime; +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/form/HelpDocAddForm.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/form/HelpDocAddForm.java new file mode 100644 index 00000000..116cd001 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/form/HelpDocAddForm.java @@ -0,0 +1,57 @@ +package net.lab1024.sa.common.module.support.helpdoc.domain.form; + +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.json.deserializer.FileKeyVoDeserializer; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.util.List; + +/** + * 帮助文档 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-20 23:11:42 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class HelpDocAddForm { + + @ApiModelProperty("标题") + @NotBlank(message = "标题不能为空") + @Length(max = 200, message = "标题最多200字符") + private String title; + + @ApiModelProperty("分类") + @NotNull(message = "分类不能为空") + private Long helpDocCatalogId; + + @ApiModelProperty("纯文本内容") + @NotNull(message = "文本内容不能为空") + private String contentText; + + @ApiModelProperty("html内容") + @NotNull(message = "html内容不能为空") + private String contentHtml; + + @ApiModelProperty("附件,多个英文逗号分隔|可选") + @Length(max = 1000, message = "最多1000字符") + @JsonDeserialize(using = FileKeyVoDeserializer.class) + private String attachment; + + @ApiModelProperty("排序") + @NotNull(message = "排序不能为空") + private Integer sort; + + @ApiModelProperty("关联的集合") + private List relationList; + + @ApiModelProperty("作者") + @NotBlank(message = "作者不能为空") + private String author; +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/form/HelpDocCatalogAddForm.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/form/HelpDocCatalogAddForm.java new file mode 100644 index 00000000..9e449675 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/form/HelpDocCatalogAddForm.java @@ -0,0 +1,31 @@ +package net.lab1024.sa.common.module.support.helpdoc.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; + +/** + * 帮助文档 目录 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-20 23:11:42 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class HelpDocCatalogAddForm { + + @ApiModelProperty("名称") + @NotBlank(message = "名称不能为空") + @Length(max = 200, message = "名称最多200字符") + private String name; + + @ApiModelProperty("父级") + private Long parentId; + + @ApiModelProperty("排序") + private Integer sort; +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/form/HelpDocCatalogUpdateForm.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/form/HelpDocCatalogUpdateForm.java new file mode 100644 index 00000000..7e2f1366 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/form/HelpDocCatalogUpdateForm.java @@ -0,0 +1,23 @@ +package net.lab1024.sa.common.module.support.helpdoc.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * 帮助文档 目录 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-20 23:11:42 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class HelpDocCatalogUpdateForm extends HelpDocCatalogAddForm { + + @ApiModelProperty("id") + @NotNull(message = "id") + private Long helpDocCatalogId; +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/form/HelpDocQueryForm.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/form/HelpDocQueryForm.java new file mode 100644 index 00000000..beac2c10 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/form/HelpDocQueryForm.java @@ -0,0 +1,33 @@ +package net.lab1024.sa.common.module.support.helpdoc.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.domain.PageParam; + +import java.time.LocalDate; + +/** + * 帮助文档 分页查询 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-20 23:11:42 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class HelpDocQueryForm extends PageParam { + + @ApiModelProperty("分类") + private Long helpDocCatalogId; + + @ApiModelProperty("标题") + private String keywords; + + @ApiModelProperty("创建-开始时间") + private LocalDate createTimeBegin; + + @ApiModelProperty("创建-截止时间") + private LocalDate createTimeEnd; + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/form/HelpDocRelationForm.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/form/HelpDocRelationForm.java new file mode 100644 index 00000000..374a8753 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/form/HelpDocRelationForm.java @@ -0,0 +1,28 @@ +package net.lab1024.sa.common.module.support.helpdoc.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +/** + * 帮助文档 关联项目 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-20 23:11:42 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class HelpDocRelationForm { + + @ApiModelProperty("关联名称") + @NotBlank(message = "关联名称不能为空") + private String relationName; + + @ApiModelProperty("关联id") + @NotNull(message = "关联id不能为空") + private Long relationId; +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/form/HelpDocUpdateForm.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/form/HelpDocUpdateForm.java new file mode 100644 index 00000000..37f2e1aa --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/form/HelpDocUpdateForm.java @@ -0,0 +1,24 @@ +package net.lab1024.sa.common.module.support.helpdoc.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * 更新 帮助文档 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-20 23:11:42 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class HelpDocUpdateForm extends HelpDocAddForm { + + @ApiModelProperty("id") + @NotNull(message = "通知id不能为空") + private Long helpDocId; + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/form/HelpDocViewRecordQueryForm.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/form/HelpDocViewRecordQueryForm.java new file mode 100644 index 00000000..fc6bebb9 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/form/HelpDocViewRecordQueryForm.java @@ -0,0 +1,32 @@ +package net.lab1024.sa.common.module.support.helpdoc.domain.form; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.domain.PageParam; + +import javax.validation.constraints.NotNull; + +/** + * 查阅记录 查询 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-20 23:11:42 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class HelpDocViewRecordQueryForm extends PageParam { + + @ApiModelProperty("帮助文档id") + @NotNull(message = "帮助文档id不能为空") + private Long helpDocId; + + @ApiModelProperty("用户id") + private Long userId; + + @ApiModelProperty("关键字") + private String keywords; + + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/vo/HelpDocCatalogVO.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/vo/HelpDocCatalogVO.java new file mode 100644 index 00000000..423bc3e5 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/vo/HelpDocCatalogVO.java @@ -0,0 +1,30 @@ +package net.lab1024.sa.common.module.support.helpdoc.domain.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * 帮助文档的 目录 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-20 23:11:42 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class HelpDocCatalogVO { + + @ApiModelProperty("帮助文档目录id") + private Long helpDocCatalogId; + + @ApiModelProperty("帮助文档目录-名称") + private String name; + + @ApiModelProperty("帮助文档目录-父级id") + private Long parentId; + + @ApiModelProperty("帮助文档目录-排序") + private Integer sort; + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/vo/HelpDocDetailVO.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/vo/HelpDocDetailVO.java new file mode 100644 index 00000000..eef39d1d --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/vo/HelpDocDetailVO.java @@ -0,0 +1,65 @@ +package net.lab1024.sa.common.module.support.helpdoc.domain.vo; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.json.serializer.FileKeyVoSerializer; + +import javax.validation.constraints.NotBlank; +import java.time.LocalDateTime; +import java.util.List; + +/** + * 帮助文档 详情 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-20 23:11:42 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class HelpDocDetailVO { + + @ApiModelProperty("id") + private Long helpDocId; + + @ApiModelProperty("标题") + private String title; + + @ApiModelProperty("分类") + private Long helpDocCatalogId; + + @ApiModelProperty("分类名称") + private Long helpDocCatalogName; + + @ApiModelProperty("纯文本内容") + private String contentText; + + @ApiModelProperty("html内容") + private String contentHtml; + + @ApiModelProperty("附件") + @JsonSerialize(using = FileKeyVoSerializer.class) + private String attachment; + + @ApiModelProperty("作者") + @NotBlank(message = "作者不能为空") + private String author; + + @ApiModelProperty("页面浏览量") + private Integer pageViewCount; + + @ApiModelProperty("用户浏览量") + private Integer userViewCount; + + @ApiModelProperty("创建时间") + private LocalDateTime createTime; + + @ApiModelProperty("更新时间") + private LocalDateTime updateTime; + + @ApiModelProperty("关联项目") + private List relationList; + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/vo/HelpDocRecordVO.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/vo/HelpDocRecordVO.java new file mode 100644 index 00000000..3eabf68b --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/vo/HelpDocRecordVO.java @@ -0,0 +1,49 @@ +package net.lab1024.sa.common.module.support.helpdoc.domain.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * 帮助文档 - 浏览记录 VO + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-20 23:11:42 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class HelpDocRecordVO { + + @ApiModelProperty("员工ID") + private Long employeeId; + + @ApiModelProperty("员工姓名") + private String employeeName; + + @ApiModelProperty("员工部门名称") + private String departmentName; + + @ApiModelProperty("查看次数") + private Integer pageViewCount; + + @ApiModelProperty("首次ip") + private String firstIp; + + @ApiModelProperty("首次用户设备等标识") + private String firstUserAgent; + + @ApiModelProperty("首次查看时间") + private LocalDateTime createTime; + + @ApiModelProperty("最后一次 ip") + private String lastIp; + + @ApiModelProperty("最后一次 用户设备等标识") + private String lastUserAgent; + + @ApiModelProperty("最后一次查看时间") + private LocalDateTime updateTime; +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/vo/HelpDocRelationVO.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/vo/HelpDocRelationVO.java new file mode 100644 index 00000000..753a92e1 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/vo/HelpDocRelationVO.java @@ -0,0 +1,23 @@ +package net.lab1024.sa.common.module.support.helpdoc.domain.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * 帮助文档 关联项目 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-20 23:11:42 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class HelpDocRelationVO { + + @ApiModelProperty("关联名称") + private String relationName; + + @ApiModelProperty("关联id") + private Long relationId; +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/vo/HelpDocVO.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/vo/HelpDocVO.java new file mode 100644 index 00000000..c668caad --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/vo/HelpDocVO.java @@ -0,0 +1,50 @@ +package net.lab1024.sa.common.module.support.helpdoc.domain.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * 帮助文档 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-20 23:11:42 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class HelpDocVO { + + @ApiModelProperty("id") + private Long helpDocId; + + @ApiModelProperty("标题") + private String title; + + @ApiModelProperty("分类") + private Long helpDocCatalogId; + + @ApiModelProperty("分类名称") + private String helpDocCatalogName; + + @ApiModelProperty("作者") + private String author; + + @ApiModelProperty("排序") + private Integer sort; + + @ApiModelProperty("页面浏览量") + private Integer pageViewCount; + + @ApiModelProperty("用户浏览量") + private Integer userViewCount; + + @ApiModelProperty("创建时间") + private LocalDateTime createTime; + + @ApiModelProperty("更新时间") + private LocalDateTime updateTime; + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/vo/HelpDocViewRecordVO.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/vo/HelpDocViewRecordVO.java new file mode 100644 index 00000000..c03cb736 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/domain/vo/HelpDocViewRecordVO.java @@ -0,0 +1,46 @@ +package net.lab1024.sa.common.module.support.helpdoc.domain.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * 帮助文档 - 浏览记录 VO + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-20 23:11:42 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class HelpDocViewRecordVO { + + @ApiModelProperty("ID") + private Long userId; + + @ApiModelProperty("姓名") + private String userName; + + @ApiModelProperty("查看次数") + private Integer pageViewCount; + + @ApiModelProperty("首次ip") + private String firstIp; + + @ApiModelProperty("首次用户设备等标识") + private String firstUserAgent; + + @ApiModelProperty("首次查看时间") + private LocalDateTime createTime; + + @ApiModelProperty("最后一次 ip") + private String lastIp; + + @ApiModelProperty("最后一次 用户设备等标识") + private String lastUserAgent; + + @ApiModelProperty("最后一次查看时间") + private LocalDateTime updateTime; +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/manager/HelpDocManager.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/manager/HelpDocManager.java new file mode 100644 index 00000000..44cd84d7 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/manager/HelpDocManager.java @@ -0,0 +1,60 @@ +package net.lab1024.sa.common.module.support.helpdoc.manager; + +import net.lab1024.sa.common.module.support.helpdoc.dao.HelpDocDao; +import net.lab1024.sa.common.module.support.helpdoc.domain.entity.HelpDocEntity; +import net.lab1024.sa.common.module.support.helpdoc.domain.form.HelpDocRelationForm; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * 帮助文档 manager + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-20 23:11:42 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Service +public class HelpDocManager { + + @Autowired + private HelpDocDao helpDocDao; + + /** + * 保存 + * + * @param helpDocEntity + * @param relationList + */ + @Transactional(rollbackFor = Throwable.class) + public void save(HelpDocEntity helpDocEntity, List relationList) { + helpDocDao.insert(helpDocEntity); + Long helpDocId = helpDocEntity.getHelpDocId(); + // 保存关联 + if (CollectionUtils.isNotEmpty(relationList)) { + helpDocDao.insertRelation(helpDocId, relationList); + } + } + + /** + * 更新 + * + * @param helpDocEntity + * @param relationList + */ + @Transactional(rollbackFor = Throwable.class) + public void update(HelpDocEntity helpDocEntity, List relationList) { + helpDocDao.updateById(helpDocEntity); + Long helpDocId = helpDocEntity.getHelpDocId(); + // 保存关联 + if (CollectionUtils.isNotEmpty(relationList)) { + helpDocDao.deleteRelation(helpDocId); + helpDocDao.insertRelation(helpDocId, relationList); + } + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/service/HelpDocCatalogService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/service/HelpDocCatalogService.java new file mode 100644 index 00000000..9a8ec360 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/service/HelpDocCatalogService.java @@ -0,0 +1,115 @@ +package net.lab1024.sa.common.module.support.helpdoc.service; + +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.util.SmartBeanUtil; +import net.lab1024.sa.common.module.support.helpdoc.dao.HelpDocCatalogDao; +import net.lab1024.sa.common.module.support.helpdoc.dao.HelpDocDao; +import net.lab1024.sa.common.module.support.helpdoc.domain.entity.HelpDocCatalogEntity; +import net.lab1024.sa.common.module.support.helpdoc.domain.form.HelpDocCatalogAddForm; +import net.lab1024.sa.common.module.support.helpdoc.domain.form.HelpDocCatalogUpdateForm; +import net.lab1024.sa.common.module.support.helpdoc.domain.vo.HelpDocCatalogVO; +import net.lab1024.sa.common.module.support.helpdoc.domain.vo.HelpDocVO; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Optional; + +/** + * 帮助文档 目录 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-20 23:11:42 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Service +public class HelpDocCatalogService { + + @Autowired + private HelpDocCatalogDao helpDocCatalogDao; + + @Autowired + private HelpDocDao helpDocDao; + + /** + * 查询全部目录 + * + * @return + */ + public List getAll() { + return SmartBeanUtil.copyList(helpDocCatalogDao.selectList(null), HelpDocCatalogVO.class); + } + + /** + * 添加目录 + * + * @param helpDocCatalogAddForm + * @return + */ + public synchronized ResponseDTO add(HelpDocCatalogAddForm helpDocCatalogAddForm) { + List helpDocCatalogList = getAll(); + Optional exist = helpDocCatalogList.stream().filter(e -> helpDocCatalogAddForm.getName().equals(e.getName())).findFirst(); + if (exist.isPresent()) { + return ResponseDTO.userErrorParam("存在相同名称的目录了"); + } + + helpDocCatalogDao.insert(SmartBeanUtil.copy(helpDocCatalogAddForm, HelpDocCatalogEntity.class)); + return ResponseDTO.ok(); + } + + /** + * 更新目录 + * + * @param updateForm + * @return + */ + public synchronized ResponseDTO update(HelpDocCatalogUpdateForm updateForm) { + HelpDocCatalogEntity helpDocCatalogEntity = helpDocCatalogDao.selectById(updateForm.getHelpDocCatalogId()); + if (helpDocCatalogEntity == null) { + return ResponseDTO.userErrorParam("目录不存在"); + } + + List helpDocCatalogList = getAll(); + Optional exist = helpDocCatalogList.stream().filter(e -> updateForm.getName().equals(e.getName())).findFirst(); + if (exist.isPresent() && !exist.get().getHelpDocCatalogId().equals(updateForm.getHelpDocCatalogId())) { + return ResponseDTO.userErrorParam("存在相同名称的目录了"); + } + helpDocCatalogDao.updateById(SmartBeanUtil.copy(updateForm, HelpDocCatalogEntity.class)); + return ResponseDTO.ok(); + } + + /** + * 删除目录(如果有子目录、或者有帮助文档,则不能删除) + * + * @param helpDocCatalogId + * @return + */ + public synchronized ResponseDTO delete(Long helpDocCatalogId) { + if (helpDocCatalogId == null) { + return ResponseDTO.ok(); + } + + HelpDocCatalogEntity helpDocCatalogEntity = helpDocCatalogDao.selectById(helpDocCatalogId); + if (helpDocCatalogEntity == null) { + return ResponseDTO.userErrorParam("目录不存在"); + } + + //如果有子目录,则不能删除 + Optional existOptional = getAll().stream().filter(e -> helpDocCatalogId.equals(e.getParentId())).findFirst(); + if (existOptional.isPresent()) { + return ResponseDTO.userErrorParam("存在子目录:" + existOptional.get().getName()); + } + + //查询是否有帮助文档 + List helpDocVOList = helpDocDao.queryHelpDocByCatalogId(helpDocCatalogId); + if (CollectionUtils.isNotEmpty(helpDocVOList)) { + return ResponseDTO.userErrorParam("目录下存在文档,不能删除"); + } + helpDocCatalogDao.deleteById(helpDocCatalogId); + return ResponseDTO.ok(); + } + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/service/HelpDocService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/service/HelpDocService.java new file mode 100644 index 00000000..9d6ba2d3 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/service/HelpDocService.java @@ -0,0 +1,117 @@ +package net.lab1024.sa.common.module.support.helpdoc.service; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.util.SmartBeanUtil; +import net.lab1024.sa.common.common.util.SmartPageUtil; +import net.lab1024.sa.common.module.support.helpdoc.dao.HelpDocDao; +import net.lab1024.sa.common.module.support.helpdoc.domain.entity.HelpDocEntity; +import net.lab1024.sa.common.module.support.helpdoc.domain.form.HelpDocAddForm; +import net.lab1024.sa.common.module.support.helpdoc.domain.form.HelpDocQueryForm; +import net.lab1024.sa.common.module.support.helpdoc.domain.form.HelpDocUpdateForm; +import net.lab1024.sa.common.module.support.helpdoc.domain.vo.HelpDocDetailVO; +import net.lab1024.sa.common.module.support.helpdoc.domain.vo.HelpDocVO; +import net.lab1024.sa.common.module.support.helpdoc.manager.HelpDocManager; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 后台管理业务 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-20 23:11:42 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Service +public class HelpDocService { + + @Autowired + private HelpDocDao helpDocDao; + + @Autowired + private HelpDocManager helpDaoManager; + + + /** + * 查询 帮助文档 + * + * @param queryForm + * @return + */ + public PageResult query(HelpDocQueryForm queryForm) { + Page page = SmartPageUtil.convert2PageQuery(queryForm); + List list = helpDocDao.query(page, queryForm); + return SmartPageUtil.convert2PageResult(page, list); + } + + /** + * 添加 + * + * @param addForm + * @return + */ + public ResponseDTO add(HelpDocAddForm addForm) { + HelpDocEntity helpDaoEntity = SmartBeanUtil.copy(addForm, HelpDocEntity.class); + helpDaoManager.save(helpDaoEntity, addForm.getRelationList()); + return ResponseDTO.ok(); + } + + + /** + * 更新 + * + * @param updateForm + * @return + */ + public ResponseDTO update(HelpDocUpdateForm updateForm) { + // 更新 + HelpDocEntity helpDaoEntity = SmartBeanUtil.copy(updateForm, HelpDocEntity.class); + helpDaoManager.update(helpDaoEntity, updateForm.getRelationList()); + return ResponseDTO.ok(); + } + + + /** + * 删除 + * + * @param helpDocId + * @return + */ + public ResponseDTO delete(Long helpDocId) { + HelpDocEntity helpDaoEntity = helpDocDao.selectById(helpDocId); + if (helpDaoEntity != null) { + helpDocDao.deleteById(helpDocId); + } + return ResponseDTO.ok(); + } + + /** + * 获取详情 + * + * @param helpDocId + * @return + */ + public HelpDocDetailVO getDetail(Long helpDocId) { + HelpDocEntity helpDaoEntity = helpDocDao.selectById(helpDocId); + HelpDocDetailVO detail = SmartBeanUtil.copy(helpDaoEntity, HelpDocDetailVO.class); + if (detail != null) { + detail.setRelationList(helpDocDao.queryRelationByHelpDoc(helpDocId)); + } + return detail; + } + + /** + * 获取详情 + * + * @param relationId + * @return + */ + public List queryHelpDocByRelationId(Long relationId) { + return helpDocDao.queryHelpDocByRelationId(relationId); + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/service/HelpDocUserService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/service/HelpDocUserService.java new file mode 100644 index 00000000..16830b72 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/helpdoc/service/HelpDocUserService.java @@ -0,0 +1,85 @@ +package net.lab1024.sa.common.module.support.helpdoc.service; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.RequestUser; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.util.SmartBeanUtil; +import net.lab1024.sa.common.common.util.SmartPageUtil; +import net.lab1024.sa.common.module.support.helpdoc.dao.HelpDocDao; +import net.lab1024.sa.common.module.support.helpdoc.domain.entity.HelpDocEntity; +import net.lab1024.sa.common.module.support.helpdoc.domain.form.HelpDocViewRecordQueryForm; +import net.lab1024.sa.common.module.support.helpdoc.domain.vo.HelpDocDetailVO; +import net.lab1024.sa.common.module.support.helpdoc.domain.vo.HelpDocVO; +import net.lab1024.sa.common.module.support.helpdoc.domain.vo.HelpDocViewRecordVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 用户查看 帮助文档 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-20 23:11:42 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Service +public class HelpDocUserService { + + @Autowired + private HelpDocDao helpDocDao; + + + /** + * 查询全部 帮助文档 + * + * @return + */ + public ResponseDTO> queryAllHelpDocList() { + return ResponseDTO.ok(helpDocDao.queryAllHelpDocList()); + } + + + /** + * 查询我的 待查看的 帮助文档清单 + * + * @return + */ + public ResponseDTO view(RequestUser requestUser, Long helpDocId) { + HelpDocEntity helpDocEntity = helpDocDao.selectById(helpDocId); + if (helpDocEntity == null) { + return ResponseDTO.userErrorParam("帮助文档不存在"); + } + + HelpDocDetailVO helpDocDetailVO = SmartBeanUtil.copy(helpDocEntity, HelpDocDetailVO.class); + long viewCount = helpDocDao.viewRecordCount(helpDocId, requestUser.getUserId()); + if (viewCount == 0) { + helpDocDao.insertViewRecord(helpDocId, requestUser.getUserId(), requestUser.getUserName(), requestUser.getIp(), requestUser.getUserAgent(), 1); + helpDocDao.updateViewCount(helpDocId, 1, 1); + helpDocDetailVO.setPageViewCount(helpDocDetailVO.getPageViewCount() + 1); + helpDocDetailVO.setUserViewCount(helpDocDetailVO.getUserViewCount() + 1); + } else { + helpDocDao.updateViewRecord(helpDocId, requestUser.getUserId(), requestUser.getIp(), requestUser.getUserAgent()); + helpDocDao.updateViewCount(helpDocId, 0, 1); + helpDocDetailVO.setPageViewCount(helpDocDetailVO.getPageViewCount() + 1); + } + + return ResponseDTO.ok(helpDocDetailVO); + } + + + /** + * 分页查询 查看记录 + * + * @param helpDocViewRecordQueryForm + * @return + */ + public PageResult queryViewRecord(HelpDocViewRecordQueryForm helpDocViewRecordQueryForm) { + Page page = SmartPageUtil.convert2PageQuery(helpDocViewRecordQueryForm); + List noticeViewRecordVOS = helpDocDao.queryViewRecordList(page, helpDocViewRecordQueryForm); + return SmartPageUtil.convert2PageResult(page, noticeViewRecordVOS); + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/jwe/DecryptData.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/jwe/DecryptData.java new file mode 100644 index 00000000..d23f329a --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/jwe/DecryptData.java @@ -0,0 +1,18 @@ +package net.lab1024.sa.common.module.support.jwe; + +import lombok.Data; + +/** + * 加密数据 包装类 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2021/6/29 20:49:23 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +class DecryptData { + + private String data; +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/jwe/JweAspect.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/jwe/JweAspect.java new file mode 100644 index 00000000..7a2dbc64 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/jwe/JweAspect.java @@ -0,0 +1,128 @@ +package net.lab1024.sa.common.module.support.jwe; + +import cn.hutool.crypto.Mode; +import cn.hutool.crypto.Padding; +import cn.hutool.crypto.SecureUtil; +import cn.hutool.crypto.symmetric.AES; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.serializer.SerializerFeature; +import lombok.extern.slf4j.Slf4j; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.annotation.AfterReturning; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Before; +import org.aspectj.lang.reflect.MethodSignature; +import org.springframework.core.annotation.Order; +import org.springframework.util.Base64Utils; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; +import java.lang.reflect.Method; +import java.util.function.Function; + +/** + * 加密数据切口 + * + * @Author 1024创新实验室: 胡克 + * @Date 2020/11/25 10:46 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Slf4j +@Aspect +@Order(100) +public class JweAspect { + + private static final String MD5_SALT_FORMAT = "sa_%s_salt"; + + private Function userFunction; + + public JweAspect(Function userFunction) { + this.userFunction = userFunction; + } + + @Before("@annotation(net.lab1024.sa.common.module.support.jwe.JweDecrypt)") + public void before(JoinPoint joinPoint) { + Method method = ((MethodSignature) joinPoint.getSignature()).getMethod(); + JweDecrypt annotation = method.getAnnotation(JweDecrypt.class); + if (annotation == null) { + return; + } + Object[] params = joinPoint.getArgs(); + if (params == null) { + return; + } + if (params.length == 0) { + return; + } + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + JweUserKey user = this.userFunction.apply(request); + if (user == null) { + return; + } + Boolean decryptParamFlag = params[0] instanceof DecryptData; + if (!decryptParamFlag) { + return; + } + DecryptData decryptData = (DecryptData) params[0]; + String data = decryptData.getData(); + log.info("解密前数据:{}", data); + + String key = SecureUtil.md5(String.format(MD5_SALT_FORMAT, user.getUserId())); + log.info("解密KEY数据:{}", key); + //初始化向量是16位长度 + String iv = key.substring(0, 16); + //解密 + AES aes = new AES(Mode.CTS, Padding.PKCS5Padding, key.getBytes(), iv.getBytes()); + data = aes.decryptStr(data); + log.info("解密后数据:{}", data); + //base64解码 + data = new String(Base64Utils.decodeFromString(data)); + log.info("base64解码后数据:{}", data); + decryptData.setData(data); + } + + + @AfterReturning(returning = "object", pointcut = "@annotation(net.lab1024.sa.common.module.support.jwe.JweEncrypt)") + public void afterReturning(JoinPoint joinPoint, Object object) { + Method method = ((MethodSignature) joinPoint.getSignature()).getMethod(); + JweEncrypt annotation = method.getAnnotation(JweEncrypt.class); + if (annotation == null) { + return; + } + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + JweUserKey user = this.userFunction.apply(request); + if (user == null) { + return; + } + try { + ResponseDTO responseDTO = (ResponseDTO) object; + Object data = responseDTO.getData(); + if (data == null) { + return; + } + String jsonData = JSON.toJSONString(data, SerializerFeature.DisableCircularReferenceDetect); + log.info("JSON 原数据:{}", jsonData); + //base64编码 + jsonData = Base64Utils.encodeToString(jsonData.getBytes("utf-8")); + log.info("JSON Base64数据:{}", jsonData); + //加密秘钥 + String key = SecureUtil.md5(String.format(MD5_SALT_FORMAT, user.getUserId())); + log.info("JSON MD5 KEY数据:{}", key); + //初始化向量是16位长度 + String iv = key.substring(0, 16); + //AES 加密 + AES aes = new AES(Mode.CTS, Padding.PKCS5Padding, key.getBytes(), iv.getBytes()); + data = aes.encryptBase64(jsonData); + log.info("JSON ASE 加密数据:{}", jsonData); + responseDTO.setData(jsonData); + } catch (Exception e) { + log.error(e.getMessage(),e); + return; + } + } + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/jwe/JweDecrypt.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/jwe/JweDecrypt.java new file mode 100644 index 00000000..5900f439 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/jwe/JweDecrypt.java @@ -0,0 +1,20 @@ +package net.lab1024.sa.common.module.support.jwe; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 解密注解 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2020/11/25 20:46 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.METHOD) +public @interface JweDecrypt { +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/jwe/JweEncrypt.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/jwe/JweEncrypt.java new file mode 100644 index 00000000..e6e93940 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/jwe/JweEncrypt.java @@ -0,0 +1,20 @@ +package net.lab1024.sa.common.module.support.jwe; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 加密注解 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2020/11/25 20:46 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.METHOD) +public @interface JweEncrypt { +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/jwe/JweUserKey.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/jwe/JweUserKey.java new file mode 100644 index 00000000..ce020667 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/jwe/JweUserKey.java @@ -0,0 +1,32 @@ +package net.lab1024.sa.common.module.support.jwe; + +import lombok.Data; + +/** + * 解密用用户信息作为key + * + * @Author 1024创新实验室: 罗伊 + * @Date 2020/11/25 20:46 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class JweUserKey { + + /** + * 用户id + */ + private Long userId; + + /** + * 用户名 + */ + private String userName; + + /** + * 扩展信息 + */ + private String extData; + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/loginlog/LoginLogDao.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/loginlog/LoginLogDao.java new file mode 100644 index 00000000..e7fe6183 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/loginlog/LoginLogDao.java @@ -0,0 +1,46 @@ +package net.lab1024.sa.common.module.support.loginlog; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import net.lab1024.sa.common.module.support.loginlog.domain.LoginLogEntity; +import net.lab1024.sa.common.module.support.loginlog.domain.LoginLogQueryForm; +import net.lab1024.sa.common.module.support.loginlog.domain.LoginLogVO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * 登录日志 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022/07/22 19:46:23 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Mapper +@Component +public interface LoginLogDao extends BaseMapper { + + /** + * 分页查询 + * + * @param page + * @param queryForm + * @return LoginLogVO + */ + List queryByPage(Page page, @Param("query") LoginLogQueryForm queryForm); + + /** + * 查询上一个登录记录 + * + * @param userId + * @param userType + * @return LoginLogVO + */ + LoginLogVO queryLastByUserId(@Param("userId") Long userId,@Param("userType") Integer userType); + + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/loginlog/LoginLogResultEnum.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/loginlog/LoginLogResultEnum.java new file mode 100644 index 00000000..2ccb7503 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/loginlog/LoginLogResultEnum.java @@ -0,0 +1,37 @@ +package net.lab1024.sa.common.module.support.loginlog; + +import net.lab1024.sa.common.common.enumeration.BaseEnum; + +/** + * 登录类型 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022/07/22 19:46:23 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public enum LoginLogResultEnum implements BaseEnum { + + LOGIN_SUCCESS(0, "登录成功"), + LOGIN_FAIL(1, "登录失败"), + LOGIN_OUT(2, "退出登录"); + + private Integer type; + private String desc; + + LoginLogResultEnum(Integer type, String desc) { + this.type = type; + this.desc = desc; + } + + @Override + public Integer getValue() { + return type; + } + + @Override + public String getDesc() { + return desc; + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/loginlog/LoginLogService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/loginlog/LoginLogService.java new file mode 100644 index 00000000..0c6fb039 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/loginlog/LoginLogService.java @@ -0,0 +1,67 @@ +package net.lab1024.sa.common.module.support.loginlog; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.extern.slf4j.Slf4j; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.enumeration.UserTypeEnum; +import net.lab1024.sa.common.common.util.SmartPageUtil; +import net.lab1024.sa.common.module.support.loginlog.domain.LoginLogEntity; +import net.lab1024.sa.common.module.support.loginlog.domain.LoginLogQueryForm; +import net.lab1024.sa.common.module.support.loginlog.domain.LoginLogVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 登录日志 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022/07/22 19:46:23 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Service +@Slf4j +public class LoginLogService { + + @Autowired + private LoginLogDao loginLogDao; + + /** + * @author 卓大 + * @description 分页查询 + */ + public ResponseDTO> queryByPage(LoginLogQueryForm queryForm) { + Page page = SmartPageUtil.convert2PageQuery(queryForm); + List logList = loginLogDao.queryByPage(page, queryForm); + PageResult pageResult = SmartPageUtil.convert2PageResult(page, logList); + return ResponseDTO.ok(pageResult); + } + + /** + * @author 卓大 + * @description 添加 + */ + public void log(LoginLogEntity loginLogEntity) { + try { + loginLogDao.insert(loginLogEntity); + } catch (Throwable e) { + log.error(e.getMessage(), e); + } + } + + + /** + * 查询上一个登录记录 + * + * @author 卓大 + * @description 查询上一个登录记录 + */ + public LoginLogVO queryLastByUserId(Long userId, UserTypeEnum userTypeEnum) { + return loginLogDao.queryLastByUserId(userId,userTypeEnum.getValue()); + } + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/loginlog/domain/LoginLogEntity.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/loginlog/domain/LoginLogEntity.java new file mode 100644 index 00000000..50c785b4 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/loginlog/domain/LoginLogEntity.java @@ -0,0 +1,67 @@ +package net.lab1024.sa.common.module.support.loginlog.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Builder; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * 登录日志 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022/07/22 19:46:23 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@TableName("t_login_log") +@Data +@Builder +public class LoginLogEntity { + + @TableId(type = IdType.AUTO) + private Long loginLogId; + + /** + * 用户id + */ + private Long userId; + + /** + * 用户类型 + */ + private Integer userType; + + /** + * 用户名 + */ + private String userName; + + /** + * 登录ip + */ + private String loginIp; + + /** + * user-agent + */ + private String userAgent; + + /** + * 备注 + */ + private String remark; + + /** + * 登录类型 + */ + private Integer loginResult; + + private LocalDateTime updateTime; + + private LocalDateTime createTime; + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/loginlog/domain/LoginLogQueryForm.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/loginlog/domain/LoginLogQueryForm.java new file mode 100644 index 00000000..92d69c18 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/loginlog/domain/LoginLogQueryForm.java @@ -0,0 +1,31 @@ +package net.lab1024.sa.common.module.support.loginlog.domain; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.domain.PageParam; + +/** + * 登录查询日志 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022/07/22 19:46:23 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class LoginLogQueryForm extends PageParam { + + @ApiModelProperty("开始日期") + private String startDate; + + @ApiModelProperty("结束日期") + private String endDate; + + @ApiModelProperty("用户名称") + private String userName; + + @ApiModelProperty("ip") + private String ip; + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/loginlog/domain/LoginLogVO.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/loginlog/domain/LoginLogVO.java new file mode 100644 index 00000000..753dd49c --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/loginlog/domain/LoginLogVO.java @@ -0,0 +1,48 @@ +package net.lab1024.sa.common.module.support.loginlog.domain; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.enumeration.UserTypeEnum; +import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum; +import net.lab1024.sa.common.module.support.loginlog.LoginLogResultEnum; + +import java.time.LocalDateTime; + +/** + * 登录日志 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022/07/22 19:46:23 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class LoginLogVO { + + private Long loginLogId; + + @ApiModelProperty("用户id") + private Long userId; + + @ApiModelPropertyEnum(value = UserTypeEnum.class, desc = "用户类型") + private Integer userType; + + @ApiModelProperty("用户名") + private String userName; + + @ApiModelProperty("登录ip") + private String loginIp; + + @ApiModelProperty("user-agent") + private String userAgent; + + @ApiModelProperty("remark") + private String remark; + + @ApiModelPropertyEnum(LoginLogResultEnum.class) + private Integer loginResult; + + private LocalDateTime createTime; + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/operatelog/OperateLogDao.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/operatelog/OperateLogDao.java new file mode 100644 index 00000000..be5af95e --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/operatelog/OperateLogDao.java @@ -0,0 +1,49 @@ +package net.lab1024.sa.common.module.support.operatelog; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import net.lab1024.sa.common.module.support.operatelog.domain.OperateLogEntity; +import net.lab1024.sa.common.module.support.operatelog.domain.OperateLogQueryForm; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * 操作日志 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2021-12-08 20:48:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Mapper +@Component +public interface OperateLogDao extends BaseMapper { + + /** + * 分页查询 + * @param page + * @param queryForm + * @return UserOperateLogEntity + */ + List queryByPage(Page page, @Param("query") OperateLogQueryForm queryForm); + + /** + * 根据id删除 + * + * @param id + * @return + */ + void deleteById(@Param("id") Long id); + + /** + * 批量删除 + * + * @param idList + * @return + */ + void deleteByIds(@Param("idList") List idList); +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/operatelog/OperateLogService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/operatelog/OperateLogService.java new file mode 100644 index 00000000..d3ac8bf3 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/operatelog/OperateLogService.java @@ -0,0 +1,57 @@ +package net.lab1024.sa.common.module.support.operatelog; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import net.lab1024.sa.common.common.code.UserErrorCode; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.util.SmartBeanUtil; +import net.lab1024.sa.common.common.util.SmartPageUtil; +import net.lab1024.sa.common.module.support.operatelog.domain.OperateLogEntity; +import net.lab1024.sa.common.module.support.operatelog.domain.OperateLogQueryForm; +import net.lab1024.sa.common.module.support.operatelog.domain.OperateLogVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 操作日志 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2021-12-08 20:48:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Service +public class OperateLogService { + + @Autowired + private OperateLogDao operateLogDao; + + /** + * @author 罗伊 + * @description 分页查询 + */ + public ResponseDTO> queryByPage(OperateLogQueryForm queryForm) { + Page page = SmartPageUtil.convert2PageQuery(queryForm); + List logEntityList = operateLogDao.queryByPage(page, queryForm); + PageResult pageResult = SmartPageUtil.convert2PageResult(page, logEntityList, OperateLogVO.class); + return ResponseDTO.ok(pageResult); + } + + + /** + * 查询详情 + * @param operateLogId + * @return + */ + public ResponseDTO detail(Long operateLogId) { + OperateLogEntity operateLogEntity = operateLogDao.selectById(operateLogId); + if(operateLogEntity == null){ + return ResponseDTO.error(UserErrorCode.DATA_NOT_EXIST); + } + OperateLogVO operateLogVO = SmartBeanUtil.copy(operateLogEntity, OperateLogVO.class); + return ResponseDTO.ok(operateLogVO); + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/operatelog/annoation/OperateLog.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/operatelog/annoation/OperateLog.java new file mode 100644 index 00000000..f8acadfb --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/operatelog/annoation/OperateLog.java @@ -0,0 +1,19 @@ +package net.lab1024.sa.common.module.support.operatelog.annoation; + +import java.lang.annotation.*; + +/** + * 用户操作日志 注解 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2021-12-08 20:48:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +@Documented +public @interface OperateLog { + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/operatelog/core/OperateLogAspect.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/operatelog/core/OperateLogAspect.java new file mode 100644 index 00000000..169a7ce3 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/operatelog/core/OperateLogAspect.java @@ -0,0 +1,276 @@ +package net.lab1024.sa.common.module.support.operatelog.core; + +import cn.hutool.core.util.StrUtil; +import cn.hutool.extra.servlet.ServletUtil; +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import net.lab1024.sa.common.common.constant.RequestHeaderConst; +import net.lab1024.sa.common.common.domain.RequestUser; +import net.lab1024.sa.common.common.util.SmartRequestUtil; +import net.lab1024.sa.common.module.support.operatelog.OperateLogDao; +import net.lab1024.sa.common.module.support.operatelog.annoation.OperateLog; +import net.lab1024.sa.common.module.support.operatelog.domain.OperateLogEntity; +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.Signature; +import org.aspectj.lang.annotation.AfterReturning; +import org.aspectj.lang.annotation.AfterThrowing; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.aspectj.lang.reflect.MethodSignature; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationContext; +import org.springframework.core.annotation.AnnotationUtils; +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.lang.reflect.Method; +import java.util.concurrent.ThreadPoolExecutor; + +/** + * 操作日志记录处理,对所有OperateLog注解的Controller进行操作日志监控 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2021-12-08 20:48:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Slf4j +@Aspect +public abstract class OperateLogAspect { + + private static final String pointCut = "@within(net.lab1024.sa.common.module.support.operatelog.annoation.OperateLog)"; + + @Autowired + private ApplicationContext applicationContext; + /** + * 线程池 + */ + private ThreadPoolTaskExecutor taskExecutor; + + public abstract OperateLogConfig getOperateLogConfig(); + + public OperateLogAspect() { + this.initThread(); + } + + @Pointcut(pointCut) + public void logPointCut() { + } + + @AfterReturning(pointcut = "logPointCut()") + public void doAfterReturning(JoinPoint joinPoint) { + handleLog(joinPoint, null); + } + + @AfterThrowing(value = "logPointCut()", throwing = "e") + public void doAfterThrowing(JoinPoint joinPoint, Exception e) { + handleLog(joinPoint, e); + } + + /** + * 初始化线程池 + */ + private void initThread() { + OperateLogConfig config = getOperateLogConfig(); + int corePoolSize = Runtime.getRuntime().availableProcessors(); + if (null != config.getCorePoolSize()) { + corePoolSize = config.getCorePoolSize(); + } + taskExecutor = new ThreadPoolTaskExecutor(); + //线程初始化 + taskExecutor.initialize(); + // 设置核心线程数 + taskExecutor.setCorePoolSize(corePoolSize); + // 设置最大线程数 + taskExecutor.setMaxPoolSize(corePoolSize * 2); + // 设置队列容量 + taskExecutor.setQueueCapacity(1000); + // 设置线程活跃时间(秒) + taskExecutor.setKeepAliveSeconds(60); + // 设置默认线程名称 + taskExecutor.setThreadNamePrefix("smart-logs"); + // 设置拒绝策略 + taskExecutor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); + // 等待所有任务结束后再关闭线程池 + taskExecutor.setWaitForTasksToCompleteOnShutdown(true); + } + + protected void handleLog(final JoinPoint joinPoint, final Exception e) { + try { + OperateLog operateLog = this.getAnnotationLog(joinPoint); + if (operateLog == null) { + return; + } + this.submitLog(joinPoint, e); + } catch (Exception exp) { + log.error("保存操作日志异常:{}", exp.getMessage()); + exp.printStackTrace(); + } + } + + private OperateLog getAnnotationLog(JoinPoint joinPoint) throws Exception { + Signature signature = joinPoint.getSignature(); + MethodSignature methodSignature = (MethodSignature) signature; + Method method = methodSignature.getMethod(); + OperateLog classAnnotation = AnnotationUtils.findAnnotation(method.getDeclaringClass(), OperateLog.class); + if (method != null) { + return classAnnotation; + } + return null; + } + + /** + * swagger API + * + * @param joinPoint + * @return + * @throws Exception + */ + private Api getApi(JoinPoint joinPoint) { + Signature signature = joinPoint.getSignature(); + MethodSignature methodSignature = (MethodSignature) signature; + Method method = methodSignature.getMethod(); + Api classAnnotation = AnnotationUtils.findAnnotation(method.getDeclaringClass(), Api.class); + if (method != null) { + return classAnnotation; + } + return null; + } + + /** + * swagger ApiOperation + * + * @param joinPoint + * @return + * @throws Exception + */ + private ApiOperation getApiOperation(JoinPoint joinPoint) { + Signature signature = joinPoint.getSignature(); + MethodSignature methodSignature = (MethodSignature) signature; + Method method = methodSignature.getMethod(); + + if (method != null) { + return method.getAnnotation(ApiOperation.class); + } + return null; + } + + /** + * 提交存储操作日志 + * + * @param joinPoint + * @param e + * @throws Exception + */ + private void submitLog(final JoinPoint joinPoint, final Throwable e) throws Exception { + Boolean isOpen = this.isOpen(); + if (!isOpen) { + return; + } + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + Boolean filter = this.filterUrl(request.getRequestURI()); + if (filter) { + return; + } + //设置用户信息 + RequestUser user = SmartRequestUtil.getRequestUser(); + if (user == null) { + return; + } + + Object[] args = joinPoint.getArgs(); + String params = JSON.toJSONString(args); + // 设置方法名称 + String className = joinPoint.getTarget().getClass().getName(); + String methodName = joinPoint.getSignature().getName(); + String operateMethod = className + "." + methodName; + String failReason = null; + Boolean successFlag = true; + if (e != null) { + successFlag = false; + failReason = getExceptionString(e); + } + + + OperateLogEntity operateLogEntity = + OperateLogEntity.builder() + .operateUserId(user.getUserId()) + .operateUserType(user.getUserType().getValue()) + .operateUserName(user.getUserName()) + .url(request.getRequestURI()) + .method(operateMethod) + .param(params) + .ip(user.getIp()) + .userAgent(user.getUserAgent()) + .failReason(failReason) + .successFlag(successFlag).build(); + ApiOperation apiOperation = this.getApiOperation(joinPoint); + if (apiOperation != null) { + operateLogEntity.setContent(apiOperation.value()); + } + Api api = this.getApi(joinPoint); + if (api != null) { + String[] tags = api.tags(); + operateLogEntity.setModule(StrUtil.join(",", tags)); + } + taskExecutor.execute(() -> { + this.saveLog(operateLogEntity); + }); + } + + + private String getExceptionString(Throwable e) { + StringWriter sw = new StringWriter(); + try (PrintWriter pw = new PrintWriter(sw);) { + e.printStackTrace(pw); + } + return sw.toString(); + } + + /** + * 是否开启操作日志 + * + * @return + */ + private Boolean isOpen() { + return Boolean.TRUE; + } + + /** + * 需要过滤的url + * + * @param url + * @return + */ + private Boolean filterUrl(String url) { + return Boolean.FALSE; + } + + /** + * 保存操作日志 + * + * @param operateLogEntity + * @return + */ + private Boolean saveLog(OperateLogEntity operateLogEntity) { + OperateLogConfig operateLogConfig = getOperateLogConfig(); + if (operateLogConfig.getSaveFunction() == null) { + BaseMapper mapper = applicationContext.getBean(OperateLogDao.class); + if (mapper == null) { + return false; + } + mapper.insert(operateLogEntity); + return true; + } + return operateLogConfig.getSaveFunction().apply(operateLogEntity); + } + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/operatelog/core/OperateLogConfig.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/operatelog/core/OperateLogConfig.java new file mode 100644 index 00000000..7bc65256 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/operatelog/core/OperateLogConfig.java @@ -0,0 +1,38 @@ +package net.lab1024.sa.common.module.support.operatelog.core; + +import lombok.Builder; +import lombok.Data; +import net.lab1024.sa.common.module.support.operatelog.domain.OperateLogEntity; + +import java.util.function.Function; + +/** + * 配置 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2021-12-08 20:48:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +@Builder +public class OperateLogConfig { + + /** + * 操作日志存储方法 + */ + private Function saveFunction; + + /** + * 核心线程数 + */ + private Integer corePoolSize; + + /** + * 队列大小 + */ + private Integer queueCapacity; + + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/operatelog/domain/OperateLogEntity.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/operatelog/domain/OperateLogEntity.java new file mode 100644 index 00000000..0a51993e --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/operatelog/domain/OperateLogEntity.java @@ -0,0 +1,106 @@ +package net.lab1024.sa.common.module.support.operatelog.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.LocalDateTime; + +/** + * 操作记录 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2021-12-08 20:48:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@TableName("t_operate_log") +public class OperateLogEntity { + + /** + * 主键id + */ + @TableId(type = IdType.AUTO) + private Long operateLogId; + + /** + * 操作人id + */ + private Long operateUserId; + + /** + * 用户类型 + */ + private Integer operateUserType; + + /** + * 操作人名称 + */ + private String operateUserName; + /** + * 操作模块 + */ + private String module; + + /** + * 操作内容 + */ + private String content; + + /** + * 请求路径 + */ + private String url; + + /** + * 请求方法 + */ + private String method; + + /** + * 请求参数 + */ + private String param; + + /** + * 客户ip + */ + private String ip; + + /** + * user-agent + */ + private String userAgent; + + /** + * 请求结果 0失败 1成功 + */ + private Boolean successFlag; + + /** + * 失败原因 + */ + private String failReason; + + + /** + * 更新时间 + */ + private LocalDateTime updateTime; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/operatelog/domain/OperateLogQueryForm.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/operatelog/domain/OperateLogQueryForm.java new file mode 100644 index 00000000..2e92f11b --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/operatelog/domain/OperateLogQueryForm.java @@ -0,0 +1,33 @@ +package net.lab1024.sa.common.module.support.operatelog.domain; + +import net.lab1024.sa.common.common.domain.PageParam; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * 操作日志查询 表单 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2021-12-08 20:48:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class OperateLogQueryForm extends PageParam { + + + @ApiModelProperty("开始日期") + private String startDate; + + @ApiModelProperty("结束日期") + private String endDate; + + + @ApiModelProperty("用户名称") + private String userName; + + @ApiModelProperty("请求结果 false失败 true成功") + private Boolean successFlag; + +} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/useroperatelog/domain/UserOperateLogDTO.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/operatelog/domain/OperateLogVO.java similarity index 51% rename from smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/useroperatelog/domain/UserOperateLogDTO.java rename to smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/operatelog/domain/OperateLogVO.java index 39fd2f99..b71f083f 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/useroperatelog/domain/UserOperateLogDTO.java +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/operatelog/domain/OperateLogVO.java @@ -1,30 +1,37 @@ -package net.lab1024.smartadmin.module.business.log.useroperatelog.domain; -import lombok.Data; -import java.util.Date; +package net.lab1024.sa.common.module.support.operatelog.domain; + import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.enumeration.UserTypeEnum; +import net.lab1024.sa.common.common.swagger.ApiModelPropertyEnum; + +import java.time.LocalDateTime; +import java.util.Date; /** - * [ ] + * 操作日志信息 * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/3/27 0027 下午 12:27 - * @since JDK1.8 + * @Author 1024创新实验室: 罗伊 + * @Date 2021-12-08 20:48:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) */ @Data -public class UserOperateLogDTO { +public class OperateLogVO { @ApiModelProperty("主键") - private Long id; + private Long operateLogId; @ApiModelProperty("用户id") - private Long userId; + private Long operateUserId; + + @ApiModelPropertyEnum(value = UserTypeEnum.class, desc = "用户类型") + private Integer operateUserType; @ApiModelProperty("用户名称") - private String userName; + private String operateUserName; @ApiModelProperty("操作模块") private String module; @@ -41,19 +48,25 @@ public class UserOperateLogDTO { @ApiModelProperty("请求参数") private String param; + @ApiModelProperty("客户ip") + private String ip; + + @ApiModelProperty("user-agent") + private String userAgent; + @ApiModelProperty("请求结果 0失败 1成功") - private Integer result; + private Boolean successFlag; @ApiModelProperty("失败原因") private String failReason; @ApiModelProperty("更新时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private Date updateTime; + private LocalDateTime updateTime; @ApiModelProperty("创建时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private Date createTime; + private LocalDateTime createTime; } diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/redis/RedisService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/redis/RedisService.java new file mode 100644 index 00000000..f99f29ef --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/redis/RedisService.java @@ -0,0 +1,222 @@ +package net.lab1024.sa.common.module.support.redis; + +import com.alibaba.fastjson.JSON; +import net.lab1024.sa.common.common.domain.SystemEnvironment; +import net.lab1024.sa.common.common.enumeration.SystemEnvironmentEnum; +import net.lab1024.sa.common.common.util.SmartStringUtil; +import net.lab1024.sa.common.constant.RedisKeyConst; +import org.slf4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.*; +import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.temporal.ChronoUnit; +import java.util.Collection; +import java.util.List; +import java.util.concurrent.TimeUnit; + +/** + * redis 一顿操作 + * + * @Author 1024创新实验室: 罗伊 + * @Date 2020/8/25 21:57 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Component +public class RedisService { + + private static final Logger log = org.slf4j.LoggerFactory.getLogger(RedisService.class); + + @Autowired + private StringRedisTemplate stringRedisTemplate; + + @Autowired + private RedisTemplate redisTemplate; + + @Autowired + private ValueOperations redisValueOperations; + + @Autowired + private HashOperations redisHashOperations; + + @Autowired + private ListOperations redisListOperations; + + @Autowired + private SetOperations redisSetOperations; + + @Autowired + private SystemEnvironment systemEnvironment; + + + /** + * 生成redis key + * @param prefix + * @param key + * @return + */ + public String generateRedisKey(String prefix, String key) { + SystemEnvironmentEnum currentEnvironment = systemEnvironment.getCurrentEnvironment(); + return systemEnvironment.getProjectName() + RedisKeyConst.SEPARATOR + currentEnvironment.getValue() + RedisKeyConst.SEPARATOR + prefix + key; + } + + /** + * redis key 解析成真实的内容 + * @param redisKey + * @return + */ + public static String redisKeyParse(String redisKey) { + if(SmartStringUtil.isBlank(redisKey)){ + return ""; + } + int index = redisKey.lastIndexOf(RedisKeyConst.SEPARATOR); + if(index < 1){ + return redisKey; + } + return redisKey.substring(index); + } + + public boolean getLock(String key, long expire) { + return redisValueOperations.setIfAbsent(key, String.valueOf(System.currentTimeMillis()), expire, TimeUnit.MILLISECONDS); + } + + public void unLock(String key) { + redisValueOperations.getOperations().delete(key); + } + + /** + * 指定缓存失效时间 + * + * @param key 键 + * @param time 时间(秒) + * @return + */ + public boolean expire(String key, long time) { + return redisTemplate.expire(key, time, TimeUnit.SECONDS); + } + + /** + * 获取当天剩余的秒数 + * + * @return + */ + public static long currentDaySecond() { + return ChronoUnit.SECONDS.between(LocalDateTime.now(), LocalDateTime.of(LocalDate.now(), LocalTime.MAX)); + } + + /** + * 根据key 获取过期时间 + * + * @param key 键 不能为null + * @return 时间(秒) 返回0代表为永久有效 + */ + public long getExpire(String key) { + return redisTemplate.getExpire(key, TimeUnit.SECONDS); + } + + /** + * 判断key是否存在 + * + * @param key 键 + * @return true 存在 false不存在 + */ + public boolean hasKey(String key) { + return redisTemplate.hasKey(key); + } + + /** + * 删除缓存 + * + * @param key 可以传一个值 或多个 + */ + @SuppressWarnings("unchecked") + public void delete(String... key) { + if (key != null && key.length > 0) { + if (key.length == 1) { + redisTemplate.delete(key[0]); + } else { + redisTemplate.delete((Collection) CollectionUtils.arrayToList(key)); + } + } + } + + /** + * 删除缓存 + * + * @param keyList + */ + public void delete(List keyList) { + if (CollectionUtils.isEmpty(keyList)) { + return; + } + redisTemplate.delete(keyList); + } + + //============================String============================= + + /** + * 普通缓存获取 + * + * @param key 键 + * @return 值 + */ + public String get(String key) { + return key == null ? null : redisValueOperations.get(key); + } + + public T getObject(String key, Class clazz) { + Object json = this.get(key); + if (json == null) { + return null; + } + T obj = JSON.parseObject(json.toString(), clazz); + return obj; + } + + + /** + * 普通缓存放入 + */ + public void set(String key, String value) { + redisValueOperations.set(key, value); + } + public void set(Object key, Object value) { + String jsonString = JSON.toJSONString(value); + redisValueOperations.set(key.toString(), jsonString); + } + + /** + * 普通缓存放入 + */ + public void set(String key, String value, long second) { + redisValueOperations.set(key, value, second, TimeUnit.SECONDS); + } + + /** + * 普通缓存放入并设置时间 + */ + public void set(Object key, Object value, long time) { + String jsonString = JSON.toJSONString(value); + if (time > 0) { + redisValueOperations.set(key.toString(), jsonString, time, TimeUnit.SECONDS); + } else { + set(key.toString(), jsonString); + } + } + + //============================ map ============================= + public void mset(String key, String hashKey, Object value) { + redisHashOperations.put(key, hashKey, value); + } + + public Object mget(String key, String hashKey) { + return redisHashOperations.get(key, hashKey); + } + +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/ReloadCommand.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/ReloadCommand.java new file mode 100644 index 00000000..ad039f38 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/ReloadCommand.java @@ -0,0 +1,56 @@ +package net.lab1024.sa.common.module.support.reload; + +import net.lab1024.sa.common.common.util.SmartBeanUtil; +import net.lab1024.sa.common.module.support.reload.dao.ReloadItemDao; +import net.lab1024.sa.common.module.support.reload.dao.ReloadResultDao; +import net.lab1024.sa.common.module.support.reload.core.AbstractSmartReloadCommand; +import net.lab1024.sa.common.module.support.reload.core.domain.SmartReloadItem; +import net.lab1024.sa.common.module.support.reload.core.domain.SmartReloadResult; +import net.lab1024.sa.common.module.support.reload.domain.ReloadItemEntity; +import net.lab1024.sa.common.module.support.reload.domain.ReloadResultEntity; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * reload 操作 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2015-03-02 19:11:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Component +public class ReloadCommand extends AbstractSmartReloadCommand { + + @Autowired + private ReloadItemDao reloadItemDao; + + @Autowired + private ReloadResultDao reloadResultDao; + + /** + * 读取数据库中SmartReload项 + * + * @return List + */ + @Override + public List readReloadItem() { + List reloadItemEntityList = reloadItemDao.selectList(null); + return SmartBeanUtil.copyList(reloadItemEntityList, SmartReloadItem.class); + } + + + /** + * 保存reload结果 + * + * @param smartReloadResult + */ + @Override + public void handleReloadResult(SmartReloadResult smartReloadResult) { + ReloadResultEntity reloadResultEntity = SmartBeanUtil.copy(smartReloadResult, ReloadResultEntity.class); + reloadResultDao.insert(reloadResultEntity); + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/ReloadService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/ReloadService.java new file mode 100644 index 00000000..9737f19a --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/ReloadService.java @@ -0,0 +1,68 @@ +package net.lab1024.sa.common.module.support.reload; + +import net.lab1024.sa.common.common.code.UserErrorCode; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.module.support.reload.dao.ReloadItemDao; +import net.lab1024.sa.common.module.support.reload.dao.ReloadResultDao; +import net.lab1024.sa.common.module.support.reload.domain.ReloadForm; +import net.lab1024.sa.common.module.support.reload.domain.ReloadItemEntity; +import net.lab1024.sa.common.module.support.reload.domain.ReloadItemVO; +import net.lab1024.sa.common.module.support.reload.domain.ReloadResultVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * reload (内存热加载、钩子等) + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2015-03-02 19:11:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Service +public class ReloadService { + + @Autowired + private ReloadItemDao reloadItemDao; + + @Autowired + private ReloadResultDao reloadResultDao; + + /** + * 查询 + * + * @return + */ + public ResponseDTO> query() { + List list = reloadItemDao.query(); + return ResponseDTO.ok(list); + } + + public ResponseDTO> queryReloadItemResult(String tag) { + List reloadResultList = reloadResultDao.query(tag); + return ResponseDTO.ok(reloadResultList); + } + + + /** + * 通过标签更新标识符 + * + * @param reloadForm + * @return + */ + public ResponseDTO updateByTag(ReloadForm reloadForm) { + ReloadItemEntity reloadItemEntity = reloadItemDao.selectById(reloadForm.getTag()); + if (null == reloadItemEntity) { + return ResponseDTO.error(UserErrorCode.DATA_NOT_EXIST); + } + reloadItemEntity.setIdentification(reloadForm.getIdentification()); + reloadItemEntity.setUpdateTime(LocalDateTime.now()); + reloadItemEntity.setArgs(reloadForm.getArgs()); + reloadItemDao.updateById(reloadItemEntity); + return ResponseDTO.ok(); + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/core/AbstractSmartReloadCommand.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/core/AbstractSmartReloadCommand.java new file mode 100644 index 00000000..8479c60f --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/core/AbstractSmartReloadCommand.java @@ -0,0 +1,96 @@ +package net.lab1024.sa.common.module.support.reload.core; + + +import net.lab1024.sa.common.module.support.reload.core.domain.SmartReloadItem; +import net.lab1024.sa.common.module.support.reload.core.domain.SmartReloadObject; +import net.lab1024.sa.common.module.support.reload.core.domain.SmartReloadResult; + +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * 检测是否 Reload 的类 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2015-03-02 19:11:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public abstract class AbstractSmartReloadCommand { + + /** + * 当前ReloadItem的存储器 + */ + private ConcurrentHashMap tagIdentifierMap = new ConcurrentHashMap<>(); + + private SmartReloadManager smartReloadManager; + + /** + * @return + */ + public void setReloadManager(SmartReloadManager smartReloadManager) { + this.smartReloadManager = smartReloadManager; + } + + public void init() { + List smartReloadItems = this.readReloadItem(); + if (smartReloadItems != null) { + for (SmartReloadItem smartReloadItem : smartReloadItems) { + tagIdentifierMap.put(smartReloadItem.getTag(), smartReloadItem.getIdentification()); + } + } + } + + + /** + * 该方法返回一个List:
+ * ReloadItem对象的tagIdentify为:该tag的 状态(状态其实就是个字符串,如果该字符串跟上次有变化则进行reload操作)
+ * ReloadItem对象的args为: reload操作需要的参数

+ * + * @return List + */ + public abstract List readReloadItem(); + + /** + * 处理Reload结果 + * + * @param smartReloadResult + */ + public abstract void handleReloadResult(SmartReloadResult smartReloadResult); + + + /** + * 获取本地缓存tag标识 + * + * @return + */ + public ConcurrentHashMap getTagIdentifierMap() { + return tagIdentifierMap; + } + + /** + * 设置新的缓存标识 + * + * @param tag + * @param identification + */ + public void putIdentifierMap(String tag, String identification) { + tagIdentifierMap.put(tag, identification); + } + + + /** + * 获取重载对象 + * + * @return + */ + public SmartReloadObject reloadObject(String tag) { + if (this.smartReloadManager == null) { + return null; + } + Map reloadObjectMap = smartReloadManager.reloadObjectMap(); + return reloadObjectMap.get(tag); + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/core/SmartReloadManager.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/core/SmartReloadManager.java new file mode 100644 index 00000000..a3aad41d --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/core/SmartReloadManager.java @@ -0,0 +1,97 @@ +package net.lab1024.sa.common.module.support.reload.core; + + +import lombok.extern.slf4j.Slf4j; +import net.lab1024.sa.common.module.support.reload.core.annoation.SmartReload; +import net.lab1024.sa.common.module.support.reload.core.domain.SmartReloadObject; +import net.lab1024.sa.common.module.support.reload.core.thread.SmartReloadRunnable; +import org.springframework.beans.BeansException; +import org.springframework.beans.factory.config.BeanPostProcessor; +import org.springframework.util.ReflectionUtils; + +import java.lang.reflect.Method; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + +/** + * SmartReloadManager 管理器 + *

+ * 可以在此类中添加 检测任务 以及注册 处理程序 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2015-03-02 19:11:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Slf4j +public class SmartReloadManager implements BeanPostProcessor { + + private static final String THREAD_NAME_PREFIX = "smart-admin-reload"; + private static final int THREAD_COUNT = 1; + + private Map reloadObjectMap = new ConcurrentHashMap<>(); + + private ScheduledThreadPoolExecutor threadPoolExecutor; + + public SmartReloadManager(AbstractSmartReloadCommand reloadCommand, int intervalSeconds) { + this.threadPoolExecutor = new ScheduledThreadPoolExecutor(THREAD_COUNT, r -> { + Thread t = new Thread(r, THREAD_NAME_PREFIX); + if (!t.isDaemon()) { + t.setDaemon(true); + } + return t; + }); + this.threadPoolExecutor.scheduleWithFixedDelay(new SmartReloadRunnable(reloadCommand), 10, intervalSeconds, TimeUnit.SECONDS); + reloadCommand.setReloadManager(this); + } + + + @Override + public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { + Method[] methods = ReflectionUtils.getAllDeclaredMethods(bean.getClass()); + if (methods == null) { + return bean; + } + for (Method method : methods) { + SmartReload smartReload = method.getAnnotation(SmartReload.class); + if (smartReload == null) { + continue; + } + int paramCount = method.getParameterCount(); + if (paramCount > 1) { + log.error("<> register tag reload : " + smartReload.value() + " , param count cannot greater than one !"); + continue; + } + String reloadTag = smartReload.value(); + this.register(reloadTag, new SmartReloadObject(bean, method)); + } + return bean; + } + + /** + * 注册reload + * + * @param tag + * @param smartReloadObject + */ + private void register(String tag, SmartReloadObject smartReloadObject) { + if (reloadObjectMap.containsKey(tag)) { + log.error("<> register duplicated tag reload : " + tag + " , and it will be cover!"); + } + reloadObjectMap.put(tag, smartReloadObject); + } + + /** + * 获取重载对象 + * + * @return + */ + public Map reloadObjectMap() { + return this.reloadObjectMap; + } + + +} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/annotation/SmartReload.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/core/annoation/SmartReload.java similarity index 56% rename from smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/annotation/SmartReload.java rename to smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/core/annoation/SmartReload.java index eac54afd..d22f119f 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/annotation/SmartReload.java +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/core/annoation/SmartReload.java @@ -1,4 +1,4 @@ -package net.lab1024.smartadmin.common.reload.annotation; +package net.lab1024.sa.common.module.support.reload.core.annoation; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; @@ -8,7 +8,11 @@ import java.lang.annotation.Target; /** * 定义 SmartReload 注解 * - * @author zhuoda + * @Author 1024创新实验室-主任: 卓大 + * @Date 2015-03-02 19:11:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) */ @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/core/domain/SmartReloadItem.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/core/domain/SmartReloadItem.java new file mode 100644 index 00000000..3820d9d8 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/core/domain/SmartReloadItem.java @@ -0,0 +1,32 @@ +package net.lab1024.sa.common.module.support.reload.core.domain; + +import lombok.Data; + +/** + * reload项目 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2015-03-02 19:11:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class SmartReloadItem { + + /** + * 项名称 + */ + private String tag; + + /** + * 参数 + */ + private String args; + + /** + * 标识 + */ + private String identification; + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/core/domain/SmartReloadObject.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/core/domain/SmartReloadObject.java new file mode 100644 index 00000000..8242a07e --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/core/domain/SmartReloadObject.java @@ -0,0 +1,32 @@ +package net.lab1024.sa.common.module.support.reload.core.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.lang.reflect.Method; + +/** + * Reload 处理程序的实现方法,用于包装以注解 SmartReload 实现的处理类 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2015-03-02 19:11:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +@AllArgsConstructor +public class SmartReloadObject { + + /** + * 方法对应的实例化对象 + */ + private Object reloadObject; + + /** + * 重新加载执行的方法 + */ + private Method method; + + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/core/domain/SmartReloadResult.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/core/domain/SmartReloadResult.java new file mode 100644 index 00000000..58278a78 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/core/domain/SmartReloadResult.java @@ -0,0 +1,43 @@ +package net.lab1024.sa.common.module.support.reload.core.domain; + +import lombok.Data; + +/** + * t_reload_result 表 实体类 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2015-03-02 19:11:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class SmartReloadResult { + + /** + * 项名称 + */ + private String tag; + + /** + * 参数 + */ + private String args; + + /** + * 标识 + */ + private String identification; + + /** + * 处理结果 + */ + private boolean result; + + /** + * 异常说明 + */ + private String exception; + + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/core/thread/SmartReloadRunnable.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/core/thread/SmartReloadRunnable.java new file mode 100644 index 00000000..be88f8b9 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/core/thread/SmartReloadRunnable.java @@ -0,0 +1,120 @@ +package net.lab1024.sa.common.module.support.reload.core.thread; + +import lombok.extern.slf4j.Slf4j; +import net.lab1024.sa.common.module.support.reload.core.AbstractSmartReloadCommand; +import net.lab1024.sa.common.module.support.reload.core.domain.SmartReloadItem; +import net.lab1024.sa.common.module.support.reload.core.domain.SmartReloadObject; +import net.lab1024.sa.common.module.support.reload.core.domain.SmartReloadResult; + +import java.io.PrintWriter; +import java.io.StringWriter; +import java.lang.reflect.Method; +import java.util.List; +import java.util.concurrent.ConcurrentHashMap; + +/** + * reload 线程 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2015-03-02 19:11:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Slf4j +public class SmartReloadRunnable implements Runnable { + + private AbstractSmartReloadCommand abstractSmartReloadCommand; + + private boolean isInit = false; + + public SmartReloadRunnable(AbstractSmartReloadCommand abstractSmartReloadCommand) { + this.abstractSmartReloadCommand = abstractSmartReloadCommand; + } + + @Override + public void run() { + try { + this.doTask(); + } catch (Throwable e) { + log.error("", e); + } + } + + /** + * 检测Identifier变化,执行reload + */ + private void doTask() { + if (!isInit) { + this.abstractSmartReloadCommand.init(); + isInit = true; + return; + } + + List smartReloadItemList = this.abstractSmartReloadCommand.readReloadItem(); + ConcurrentHashMap tagIdentifierMap = this.abstractSmartReloadCommand.getTagIdentifierMap(); + for (SmartReloadItem smartReloadItem : smartReloadItemList) { + String tag = smartReloadItem.getTag(); + String tagIdentifier = smartReloadItem.getIdentification(); + String preTagChangeIdentifier = tagIdentifierMap.get(tag); + // 数据不一致 + if (preTagChangeIdentifier == null || !preTagChangeIdentifier.equals(tagIdentifier)) { + this.abstractSmartReloadCommand.putIdentifierMap(tag, tagIdentifier); + // 执行重新加载此项的动作 + SmartReloadResult smartReloadResult = this.doReload(smartReloadItem); + this.abstractSmartReloadCommand.handleReloadResult(smartReloadResult); + } + } + } + + /** + * 方法调用 + * + * @param smartReloadItem + * @return + */ + private SmartReloadResult doReload(SmartReloadItem smartReloadItem) { + SmartReloadResult result = new SmartReloadResult(); + SmartReloadObject smartReloadObject = this.abstractSmartReloadCommand.reloadObject(smartReloadItem.getTag()); + try { + if (smartReloadObject == null) { + result.setResult(false); + result.setException("不能从系统中找到对应的tag:" + smartReloadItem.getTag()); + return result; + } + + Method method = smartReloadObject.getMethod(); + if (method == null) { + result.setResult(false); + result.setException("reload方法不存在"); + return result; + } + + result.setTag(smartReloadItem.getTag()); + result.setArgs(smartReloadItem.getArgs()); + result.setIdentification(smartReloadItem.getIdentification()); + result.setResult(true); + int paramCount = method.getParameterCount(); + if (paramCount > 1) { + result.setResult(false); + result.setException("reload方法" + method.getName() + "参数太多"); + return result; + } + + if (paramCount == 0) { + method.invoke(smartReloadObject.getReloadObject()); + } else { + method.invoke(smartReloadObject.getReloadObject(), smartReloadItem.getArgs()); + } + } catch (Throwable throwable) { + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + throwable.printStackTrace(pw); + + result.setResult(false); + result.setException(throwable.toString()); + } + return result; + } + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/dao/ReloadItemDao.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/dao/ReloadItemDao.java new file mode 100644 index 00000000..d063ba5d --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/dao/ReloadItemDao.java @@ -0,0 +1,25 @@ +package net.lab1024.sa.common.module.support.reload.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import net.lab1024.sa.common.module.support.reload.domain.ReloadItemEntity; +import net.lab1024.sa.common.module.support.reload.domain.ReloadItemVO; +import org.apache.ibatis.annotations.Mapper; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * t_reload_item 数据表dao + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2015-03-02 19:11:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Component +@Mapper +public interface ReloadItemDao extends BaseMapper { + + List query(); +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/dao/ReloadResultDao.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/dao/ReloadResultDao.java new file mode 100644 index 00000000..298100a7 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/dao/ReloadResultDao.java @@ -0,0 +1,26 @@ +package net.lab1024.sa.common.module.support.reload.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import net.lab1024.sa.common.module.support.reload.domain.ReloadResultEntity; +import net.lab1024.sa.common.module.support.reload.domain.ReloadResultVO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * t_reload_result 数据表dao + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2015-03-02 19:11:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Component +@Mapper +public interface ReloadResultDao extends BaseMapper { + + List query(@Param("tag") String tag); +} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/smartreload/domain/dto/ReloadItemUpdateDTO.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/domain/ReloadForm.java similarity index 53% rename from smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/smartreload/domain/dto/ReloadItemUpdateDTO.java rename to smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/domain/ReloadForm.java index 20ad98f5..45913124 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/smartreload/domain/dto/ReloadItemUpdateDTO.java +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/domain/ReloadForm.java @@ -1,20 +1,21 @@ -package net.lab1024.smartadmin.module.support.smartreload.domain.dto; +package net.lab1024.sa.common.module.support.reload.domain; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import javax.validation.constraints.NotBlank; + /** + * reload (内存热加载、钩子等) * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - * @since JDK1.8 + * @Author 1024创新实验室-主任: 卓大 + * @Date 2015-03-02 19:11:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) */ @Data -public class ReloadItemUpdateDTO { +public class ReloadForm { @ApiModelProperty("标签") @NotBlank(message = "标签不能为空") @@ -24,6 +25,7 @@ public class ReloadItemUpdateDTO { @NotBlank(message = "状态标识不能为空") private String identification; - @ApiModelProperty("reload时传入的参数,可以为空") + @ApiModelProperty("参数") private String args; + } diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/smartreload/domain/entity/ReloadItemEntity.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/domain/ReloadItemEntity.java similarity index 62% rename from smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/smartreload/domain/entity/ReloadItemEntity.java rename to smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/domain/ReloadItemEntity.java index cbd264c1..54b01131 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/smartreload/domain/entity/ReloadItemEntity.java +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/domain/ReloadItemEntity.java @@ -1,16 +1,20 @@ -package net.lab1024.smartadmin.module.support.smartreload.domain.entity; +package net.lab1024.sa.common.module.support.reload.domain; + import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; -import java.util.Date; +import java.time.LocalDateTime; /** * t_reload_item 数据表 实体类 * - * @author listen - * @date 2018/02/10 09:29 + * @Author 1024创新实验室-主任: 卓大 + * @Date 2015-03-02 19:11:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) */ @Data @TableName("t_reload_item") @@ -35,12 +39,12 @@ public class ReloadItemEntity { /** * 更新时间 */ - private Date updateTime; + private LocalDateTime updateTime; /** * 创建时间 */ - private Date createTime; + private LocalDateTime createTime; } diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/domain/ReloadItemVO.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/domain/ReloadItemVO.java new file mode 100644 index 00000000..b21b8e69 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/domain/ReloadItemVO.java @@ -0,0 +1,36 @@ +package net.lab1024.sa.common.module.support.reload.domain; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * reload (内存热加载、钩子等) + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2015-03-02 19:11:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class ReloadItemVO { + + @ApiModelProperty("加载项标签") + private String tag; + + @ApiModelProperty("参数") + private String args; + + @ApiModelProperty("运行标识") + private String identification; + + @ApiModelProperty("更新时间") + private LocalDateTime updateTime; + + @ApiModelProperty("创建时间") + private LocalDateTime createTime; + + +} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/smartreload/domain/entity/ReloadResultEntity.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/domain/ReloadResultEntity.java similarity index 62% rename from smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/smartreload/domain/entity/ReloadResultEntity.java rename to smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/domain/ReloadResultEntity.java index bb79c21e..004156d8 100644 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/smartreload/domain/entity/ReloadResultEntity.java +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/domain/ReloadResultEntity.java @@ -1,14 +1,19 @@ -package net.lab1024.smartadmin.module.support.smartreload.domain.entity; +package net.lab1024.sa.common.module.support.reload.domain; + import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; -import java.util.Date; +import java.time.LocalDateTime; /** + * reload结果
* t_reload_result 数据表 实体类 * - * @author listen - * @date 2018/02/10 09:29 + * @Author 1024创新实验室-主任: 卓大 + * @Date 2015-03-02 19:11:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) */ @Data @TableName("t_reload_result") @@ -42,7 +47,7 @@ public class ReloadResultEntity { /** * 创建时间 */ - private Date createTime; + private LocalDateTime createTime; } diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/domain/ReloadResultVO.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/domain/ReloadResultVO.java new file mode 100644 index 00000000..d7d68836 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/reload/domain/ReloadResultVO.java @@ -0,0 +1,34 @@ +package net.lab1024.sa.common.module.support.reload.domain; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * reload结果 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2015-03-02 19:11:52 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class ReloadResultVO { + + @ApiModelProperty("加载项标签") + private String tag; + + @ApiModelProperty("参数") + private String args; + + @ApiModelProperty("运行结果") + private Boolean result; + + @ApiModelProperty("异常") + private String exception; + + @ApiModelProperty("创建时间") + private LocalDateTime createTime; +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/repeatsubmit/RepeatSubmitAspect.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/repeatsubmit/RepeatSubmitAspect.java new file mode 100644 index 00000000..1bf8cae0 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/repeatsubmit/RepeatSubmitAspect.java @@ -0,0 +1,82 @@ +package net.lab1024.sa.common.module.support.repeatsubmit; + +import lombok.extern.slf4j.Slf4j; +import net.lab1024.sa.common.common.code.UserErrorCode; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.module.support.repeatsubmit.annoation.RepeatSubmit; +import net.lab1024.sa.common.module.support.repeatsubmit.ticket.AbstractRepeatSubmitTicket; +import org.apache.commons.lang3.StringUtils; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.reflect.MethodSignature; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import java.lang.reflect.Method; + +/** + * 重复提交 aop切口 + * + * @Author 1024创新实验室: 胡克 + * @Date 2020-11-25 20:56:58 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Aspect +@Slf4j +public class RepeatSubmitAspect { + + private AbstractRepeatSubmitTicket repeatSubmitTicket; + + /** + * 获取凭证信息 + * rep + * + * @param repeatSubmitTicket + */ + public RepeatSubmitAspect(AbstractRepeatSubmitTicket repeatSubmitTicket) { + this.repeatSubmitTicket = repeatSubmitTicket; + } + + /** + * 定义切入点 + * + * @param point + * @return + * @throws Throwable + */ + @Around("@annotation(net.lab1024.sa.common.module.support.repeatsubmit.annoation.RepeatSubmit)") + public Object around(ProceedingJoinPoint point) throws Throwable { + + ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + String ticketToken = attributes.getRequest().getServletPath(); + String ticket = this.repeatSubmitTicket.getTicket(ticketToken); + if (StringUtils.isEmpty(ticket)) { + return point.proceed(); + } + Long timeStamp = this.repeatSubmitTicket.getTicketTimestamp(ticket); + if (timeStamp != null) { + Method method = ((MethodSignature) point.getSignature()).getMethod(); + RepeatSubmit annotation = method.getAnnotation(RepeatSubmit.class); + int interval = Math.min(annotation.value(), RepeatSubmit.MAX_INTERVAL); + if (System.currentTimeMillis() < timeStamp + interval) { + // 提交频繁 + return ResponseDTO.error(UserErrorCode.REPEAT_SUBMIT); + } + } + Object obj = null; + try { + obj = point.proceed(); + this.repeatSubmitTicket.putTicket(ticket); + } catch (Throwable throwable) { + log.error("", throwable); + throw throwable; + } finally { + this.repeatSubmitTicket.removeTicket(ticket); + } + return obj; + } + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/repeatsubmit/annoation/RepeatSubmit.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/repeatsubmit/annoation/RepeatSubmit.java new file mode 100644 index 00000000..aed05382 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/repeatsubmit/annoation/RepeatSubmit.java @@ -0,0 +1,33 @@ +package net.lab1024.sa.common.module.support.repeatsubmit.annoation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 标记 需要防止重复提交 的注解
+ * 单位:毫秒 + * + * @Author 1024创新实验室: 胡克 + * @Date 2020-11-25 20:56:58 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.METHOD) +public @interface RepeatSubmit { + + /** + * 重复提交间隔时间/毫秒 + * + * @return + */ + int value() default 300; + + /** + * 最长间隔30s + */ + int MAX_INTERVAL = 30000; +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/repeatsubmit/ticket/AbstractRepeatSubmitTicket.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/repeatsubmit/ticket/AbstractRepeatSubmitTicket.java new file mode 100644 index 00000000..fd6d7758 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/repeatsubmit/ticket/AbstractRepeatSubmitTicket.java @@ -0,0 +1,56 @@ +package net.lab1024.sa.common.module.support.repeatsubmit.ticket; + +import java.util.function.Function; + +/** + * 凭证(用于校验重复提交的东西) + * + * @Author 1024创新实验室: 罗伊 + * @Date 2020-11-25 20:56:58 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public abstract class AbstractRepeatSubmitTicket { + + private Function ticketFunction; + + + public AbstractRepeatSubmitTicket(Function ticketFunction) { + this.ticketFunction = ticketFunction; + } + + + /** + * 获取凭证 + * + * @param ticketToken + * @return + */ + public String getTicket(String ticketToken) { + return this.ticketFunction.apply(ticketToken); + } + + /** + * 获取凭证 时间戳 + * + * @param ticket + * @return + */ + public abstract Long getTicketTimestamp(String ticket); + + + /** + * 设置本次请求时间 + * + * @param ticket + */ + public abstract void putTicket(String ticket); + + /** + * 移除凭证 + * + * @param ticket + */ + public abstract void removeTicket(String ticket); +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/repeatsubmit/ticket/RepeatSubmitCaffeineTicket.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/repeatsubmit/ticket/RepeatSubmitCaffeineTicket.java new file mode 100644 index 00000000..be6f7960 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/repeatsubmit/ticket/RepeatSubmitCaffeineTicket.java @@ -0,0 +1,50 @@ +package net.lab1024.sa.common.module.support.repeatsubmit.ticket; + +import com.github.benmanes.caffeine.cache.Cache; +import com.github.benmanes.caffeine.cache.Caffeine; +import net.lab1024.sa.common.module.support.repeatsubmit.annoation.RepeatSubmit; + +import java.util.concurrent.TimeUnit; +import java.util.function.Function; + +/** + * 凭证(内存实现) + * + * @Author 1024创新实验室: 罗伊 + * @Date 2020-11-25 20:56:58 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public class RepeatSubmitCaffeineTicket extends AbstractRepeatSubmitTicket { + + /** + * 限制缓存最大数量 超过后先放入的会自动移除 + * 默认缓存时间 + * 初始大小为:100万 + */ + private static Cache cache = Caffeine.newBuilder() + .maximumSize(100 * 10000) + .expireAfterWrite(RepeatSubmit.MAX_INTERVAL, TimeUnit.MILLISECONDS).build(); + + + public RepeatSubmitCaffeineTicket(Function ticketFunction) { + super(ticketFunction); + } + + @Override + public Long getTicketTimestamp(String ticket) { + return cache.getIfPresent(ticket); + } + + + @Override + public void putTicket(String ticket) { + cache.put(ticket, System.currentTimeMillis()); + } + + @Override + public void removeTicket(String ticket) { + cache.invalidate(ticket); + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/repeatsubmit/ticket/RepeatSubmitRedisTicket.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/repeatsubmit/ticket/RepeatSubmitRedisTicket.java new file mode 100644 index 00000000..806b7324 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/repeatsubmit/ticket/RepeatSubmitRedisTicket.java @@ -0,0 +1,48 @@ +package net.lab1024.sa.common.module.support.repeatsubmit.ticket; + +import net.lab1024.sa.common.module.support.repeatsubmit.annoation.RepeatSubmit; +import org.springframework.data.redis.core.ValueOperations; + +import java.util.concurrent.TimeUnit; +import java.util.function.Function; + +/** + * 凭证(redis实现) + * + * @Author 1024创新实验室: 罗伊 + * @Date 2020-11-25 20:56:58 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public class RepeatSubmitRedisTicket extends AbstractRepeatSubmitTicket { + + private ValueOperations redisValueOperations; + + public RepeatSubmitRedisTicket(ValueOperations redisValueOperations, + Function ticketFunction) { + super(ticketFunction); + this.redisValueOperations = redisValueOperations; + } + + @Override + public Long getTicketTimestamp(String ticket) { + Long timeStamp = System.currentTimeMillis(); + boolean setFlag = redisValueOperations.setIfAbsent(ticket, String.valueOf(timeStamp), RepeatSubmit.MAX_INTERVAL, TimeUnit.MILLISECONDS); + if (!setFlag) { + timeStamp = Long.valueOf(redisValueOperations.get(ticket)); + } + return timeStamp; + } + + @Override + public void putTicket(String ticket) { + redisValueOperations.getOperations().delete(ticket); + this.getTicketTimestamp(ticket); + } + + @Override + public void removeTicket(String ticket) { + redisValueOperations.getOperations().delete(ticket); + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/constant/SerialNumberIdEnum.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/constant/SerialNumberIdEnum.java new file mode 100644 index 00000000..72eb8586 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/constant/SerialNumberIdEnum.java @@ -0,0 +1,42 @@ +package net.lab1024.sa.common.module.support.serialnumber.constant; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import net.lab1024.sa.common.common.enumeration.BaseEnum; + +/** + * 单据序列号 枚举 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-03-25 21:46:07 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@AllArgsConstructor +@Getter +public enum SerialNumberIdEnum implements BaseEnum { + + ORDER(1, "订单id"), + + CONTRACT(2, "合同id"), + + ; + + private final Integer serialNumberId; + + private final String desc; + + @Override + public Integer getValue() { + return serialNumberId; + } + + @Override + public String toString() { + return "SerialNumberIdEnum{" + + "serialNumberId=" + serialNumberId + + ", desc='" + desc + '\'' + + '}'; + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/constant/SerialNumberRuleTypeEnum.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/constant/SerialNumberRuleTypeEnum.java new file mode 100644 index 00000000..5fc08557 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/constant/SerialNumberRuleTypeEnum.java @@ -0,0 +1,44 @@ +package net.lab1024.sa.common.module.support.serialnumber.constant; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import net.lab1024.sa.common.common.constant.StringConst; +import net.lab1024.sa.common.common.enumeration.BaseEnum; + +/** + * 单据序列号 周期 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-03-25 21:46:07 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@AllArgsConstructor +@Getter +public enum SerialNumberRuleTypeEnum implements BaseEnum { + /** + * 没有周期 + */ + NONE(StringConst.EMPTY, "", "没有周期"), + /** + * 年周期 + */ + YEAR("[yyyy]", "\\[yyyy\\]", "年"), + /** + * 月周期 + */ + MONTH("[mm]", "\\[mm\\]", "年月"), + /** + * 日周期 + */ + DAY("[dd]", "\\[dd\\]", "年月日"); + + private final String value; + + private final String regex; + + private final String desc; + + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/dao/SerialNumberDao.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/dao/SerialNumberDao.java new file mode 100644 index 00000000..50d32b64 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/dao/SerialNumberDao.java @@ -0,0 +1,41 @@ +package net.lab1024.sa.common.module.support.serialnumber.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import net.lab1024.sa.common.module.support.serialnumber.domain.SerialNumberEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Component; + +import java.time.LocalDateTime; + +/** + * 单据序列号 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-03-25 21:46:07 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Mapper +@Component +public interface SerialNumberDao extends BaseMapper { + + /** + * 排他锁查询 + * + * @param serialNumberId + * @return + */ + SerialNumberEntity selectForUpdate(@Param("serialNumberId") Integer serialNumberId); + + /** + * 更新上一次的 数值和时间 + * + * @param serialNumberId + * @param lastNumber + * @param lastTime + */ + void updateLastNumberAndTime(@Param("serialNumberId") Integer serialNumberId, @Param("lastNumber") Long lastNumber, @Param("lastTime") LocalDateTime lastTime); + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/dao/SerialNumberRecordDao.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/dao/SerialNumberRecordDao.java new file mode 100644 index 00000000..7d66a469 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/dao/SerialNumberRecordDao.java @@ -0,0 +1,55 @@ +package net.lab1024.sa.common.module.support.serialnumber.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import net.lab1024.sa.common.module.support.serialnumber.domain.SerialNumberRecordEntity; +import net.lab1024.sa.common.module.support.serialnumber.domain.SerialNumberRecordQueryForm; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Component; + +import java.time.LocalDate; +import java.util.List; + +/** + * 单据序列号 生成的记录 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-03-25 21:46:07 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Mapper +@Component +public interface SerialNumberRecordDao extends BaseMapper { + + /** + * 根据 id和日期 查询 记录id + * + * @param serialNumberId + * @param recordDate + * @return + */ + Long selectRecordIdBySerialNumberIdAndDate(@Param("serialNumberId") Integer serialNumberId, @Param("recordDate") String recordDate); + + /** + * 更新记录 + * + * @param serialNumberId + * @param recordDate + * @param lastNumber + * @param count + * @return + */ + Long updateRecord(@Param("serialNumberId") Integer serialNumberId, @Param("recordDate") LocalDate recordDate, @Param("lastNumber") Long lastNumber, @Param("count") int count); + + /** + * 分页查询记录 + * + * @param page + * @param queryForm + * @return + */ + List query(Page page, @Param("queryForm") SerialNumberRecordQueryForm queryForm); +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/domain/SerialNumberEntity.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/domain/SerialNumberEntity.java new file mode 100644 index 00000000..79b589f1 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/domain/SerialNumberEntity.java @@ -0,0 +1,79 @@ +package net.lab1024.sa.common.module.support.serialnumber.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import net.lab1024.sa.common.module.support.serialnumber.constant.SerialNumberIdEnum; +import net.lab1024.sa.common.module.support.serialnumber.constant.SerialNumberRuleTypeEnum; + +import java.time.LocalDateTime; + +/** + * 单据序列号 定义表 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-03-25 21:46:07 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +@TableName("t_serial_number") +public class SerialNumberEntity { + + /** + * 主键id + * + * @see SerialNumberIdEnum + */ + @TableId(type = IdType.INPUT) + private Integer serialNumberId; + + /** + * 业务 + */ + private String businessName; + + /** + * 格式 + */ + private String format; + + /** + * 生成规则 + * + * @see SerialNumberRuleTypeEnum + */ + private String ruleType; + + + /** + * 初始值 + */ + private Long initNumber; + + /** + * 步长随机数范围 + */ + private Integer stepRandomRange; + + /** + * 备注 + */ + private String remark; + + /** + * 上次产生的单号, 默认为空 + */ + private Long lastNumber; + + /** + * 上次产生的单号时间 + */ + private LocalDateTime lastTime; + + private LocalDateTime updateTime; + + private LocalDateTime createTime; +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/domain/SerialNumberGenerateForm.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/domain/SerialNumberGenerateForm.java new file mode 100644 index 00000000..30e0b777 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/domain/SerialNumberGenerateForm.java @@ -0,0 +1,28 @@ +package net.lab1024.sa.common.module.support.serialnumber.domain; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * 单据序列号 生成表单 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-03-25 21:46:07 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class SerialNumberGenerateForm { + + @ApiModelProperty("单号id") + @NotNull(message = "单号id不能为空") + private Integer serialNumberId; + + @ApiModelProperty("生成的数量") + @NotNull(message = "生成的数量") + private Integer count; + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/domain/SerialNumberGenerateResultBO.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/domain/SerialNumberGenerateResultBO.java new file mode 100644 index 00000000..f4dfe3ae --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/domain/SerialNumberGenerateResultBO.java @@ -0,0 +1,52 @@ +package net.lab1024.sa.common.module.support.serialnumber.domain; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * 单据序列号 生成结果 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-03-25 21:46:07 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class SerialNumberGenerateResultBO { + + /** + * 序号id + */ + private Integer serialNumberId; + + /** + * 是否重置的初始值 + */ + private Boolean isReset; + + /** + * 上次生成的数字 + */ + private Long lastNumber; + + /** + * 上次生成的时间 + */ + private LocalDateTime lastTime; + + /** + * 生成的 number 集合 + */ + private List numberList; + + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/domain/SerialNumberInfoBO.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/domain/SerialNumberInfoBO.java new file mode 100644 index 00000000..89fae4e6 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/domain/SerialNumberInfoBO.java @@ -0,0 +1,97 @@ +package net.lab1024.sa.common.module.support.serialnumber.domain; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; +import net.lab1024.sa.common.module.support.serialnumber.constant.SerialNumberIdEnum; +import net.lab1024.sa.common.module.support.serialnumber.constant.SerialNumberRuleTypeEnum; + +/** + * 单据序列号 信息 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-03-25 21:46:07 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ + +@Getter +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class SerialNumberInfoBO { + + /** + * 主键id + * + * @see SerialNumberIdEnum + */ + private Integer serialNumberId; + + /** + * 业务 + */ + private String businessName; + + /** + * 格式 + */ + private String format; + + /** + * 生成规则 + * + * @see SerialNumberRuleTypeEnum + */ + private String ruleType; + + + /** + * 初始值 + */ + private Long initNumber; + + /** + * 步长随机数范围 + */ + private Integer stepRandomRange; + + /** + * 备注 + */ + private String remark; + + /** + * 规则枚举 + */ + private SerialNumberRuleTypeEnum serialNumberRuleTypeEnum; + + + /** + * 存在[nnnnnn]中 n 的数量 + */ + private Integer numberCount; + + /** + * [nnnnnn] 的格式(主要用于替换) + */ + private String numberFormat; + + /** + * 是否存在年份 + */ + private Boolean haveYearFlag; + + /** + * 是否存在月份 + */ + private Boolean haveMonthFlag; + + /** + * 是否存在 月 + */ + private Boolean haveDayFlag; + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/domain/SerialNumberLastGenerateBO.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/domain/SerialNumberLastGenerateBO.java new file mode 100644 index 00000000..5ccf4e75 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/domain/SerialNumberLastGenerateBO.java @@ -0,0 +1,41 @@ +package net.lab1024.sa.common.module.support.serialnumber.domain; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.LocalDateTime; + +/** + * 上次生成信息 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-03-25 21:46:07 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class SerialNumberLastGenerateBO { + + /** + * 序号id + */ + private Integer serialNumberId; + + /** + * 上次生成的数字 + */ + private Long lastNumber; + + /** + * 上次生成的时间 + */ + private LocalDateTime lastTime; + + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/domain/SerialNumberRecordEntity.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/domain/SerialNumberRecordEntity.java new file mode 100644 index 00000000..a32982e4 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/domain/SerialNumberRecordEntity.java @@ -0,0 +1,57 @@ +package net.lab1024.sa.common.module.support.serialnumber.domain; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.LocalDate; +import java.time.LocalDateTime; + +/** + * 单据序列号 表结构 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-03-25 21:46:07 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@TableName("t_serial_number_record") +public class SerialNumberRecordEntity { + + /** + * 单号id + */ + private Integer serialNumberId; + + /** + * 记录日期 + */ + private LocalDate recordDate; + + /** + * 最后更新值 + */ + private Long lastNumber; + + /** + * 上次生成时间 + */ + private LocalDateTime lastTime; + + /** + * 数量 + */ + private Long count; + + private LocalDateTime updateTime; + + private LocalDateTime createTime; + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/domain/SerialNumberRecordQueryForm.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/domain/SerialNumberRecordQueryForm.java new file mode 100644 index 00000000..7fe36829 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/domain/SerialNumberRecordQueryForm.java @@ -0,0 +1,24 @@ +package net.lab1024.sa.common.module.support.serialnumber.domain; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import net.lab1024.sa.common.common.domain.PageParam; + +import javax.validation.constraints.NotNull; + +/** + * 单据序列号 生成记录 查询 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-03-25 21:46:07 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class SerialNumberRecordQueryForm extends PageParam { + + @ApiModelProperty("单号id") + @NotNull(message = "单号id不能为空") + private Integer serialNumberId; +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/service/SerialNumberBaseService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/service/SerialNumberBaseService.java new file mode 100644 index 00000000..1a85af11 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/service/SerialNumberBaseService.java @@ -0,0 +1,252 @@ +package net.lab1024.sa.common.module.support.serialnumber.service; + +import com.google.common.collect.Lists; +import net.lab1024.sa.common.common.exception.BusinessException; +import net.lab1024.sa.common.common.util.SmartEnumUtil; +import net.lab1024.sa.common.module.support.serialnumber.constant.SerialNumberIdEnum; +import net.lab1024.sa.common.module.support.serialnumber.constant.SerialNumberRuleTypeEnum; +import net.lab1024.sa.common.module.support.serialnumber.dao.SerialNumberDao; +import net.lab1024.sa.common.module.support.serialnumber.dao.SerialNumberRecordDao; +import net.lab1024.sa.common.module.support.serialnumber.domain.*; +import org.apache.commons.lang3.RandomUtils; +import org.springframework.beans.factory.annotation.Autowired; + +import javax.annotation.PostConstruct; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ConcurrentHashMap; + +/** + * 单据序列号 基类 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-03-25 21:46:07 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public abstract class SerialNumberBaseService implements SerialNumberService { + + @Autowired + protected SerialNumberRecordDao serialNumberRecordDao; + + @Autowired + protected SerialNumberDao serialNumberDao; + + private ConcurrentHashMap serialNumberMap = new ConcurrentHashMap<>(); + + public abstract List generateSerialNumberList(SerialNumberInfoBO serialNumber, int count); + + @PostConstruct + void init() { + List serialNumberEntityList = serialNumberDao.selectList(null); + if (serialNumberEntityList == null) { + return; + } + for (SerialNumberEntity serialNumberEntity : serialNumberEntityList) { + SerialNumberRuleTypeEnum ruleTypeEnum = SmartEnumUtil.getEnumByName(serialNumberEntity.getRuleType().toUpperCase(), SerialNumberRuleTypeEnum.class); + if (ruleTypeEnum == null) { + throw new ExceptionInInitializerError("cannot find rule type , id : " + serialNumberEntity.getSerialNumberId()); + } + + String format = serialNumberEntity.getFormat(); + int startIndex = format.indexOf("[n"); + int endIndex = format.indexOf("n]"); + if (startIndex == -1 || endIndex == -1 || endIndex <= startIndex) { + throw new ExceptionInInitializerError("[nnn] 配置错误,请仔细查看 id : " + serialNumberEntity.getSerialNumberId()); + } + + String numberFormat = format.substring(startIndex + 1, endIndex + 1); + + if (serialNumberEntity.getStepRandomRange() < 1) { + throw new ExceptionInInitializerError("random step range must greater than 1 " + serialNumberEntity.getSerialNumberId()); + } + + SerialNumberInfoBO serialNumberInfoBO = SerialNumberInfoBO.builder() + .serialNumberId(serialNumberEntity.getSerialNumberId()) + .serialNumberRuleTypeEnum(ruleTypeEnum) + .initNumber(serialNumberEntity.getInitNumber()) + .format(serialNumberEntity.getFormat()) + .stepRandomRange(serialNumberEntity.getStepRandomRange()) + .haveDayFlag(format.contains(SerialNumberRuleTypeEnum.DAY.getValue())) + .haveMonthFlag(format.contains(SerialNumberRuleTypeEnum.MONTH.getValue())) + .haveYearFlag(format.contains(SerialNumberRuleTypeEnum.YEAR.getValue())) + .numberCount(endIndex - startIndex) + .numberFormat("\\[" + numberFormat + "\\]") + .build(); + + this.serialNumberMap.put(serialNumberEntity.getSerialNumberId(), serialNumberInfoBO); + } + + //初始化数据 + initLastGenerateData(serialNumberEntityList); + } + + /** + * 初始化上次生成的数据 + * + * @param serialNumberEntityList + */ + public abstract void initLastGenerateData(List serialNumberEntityList); + + @Override + public String generate(SerialNumberIdEnum serialNumberIdEnum) { + List generateList = this.generate(serialNumberIdEnum, 1); + if (generateList == null || generateList.isEmpty()) { + throw new BusinessException("cannot generate : " + serialNumberIdEnum.toString()); + } + return generateList.get(0); + } + + @Override + public List generate(SerialNumberIdEnum serialNumberIdEnum, int count) { + SerialNumberInfoBO serialNumberInfoBO = serialNumberMap.get(serialNumberIdEnum.getSerialNumberId()); + if (serialNumberInfoBO == null) { + throw new BusinessException("cannot found SerialNumberId : " + serialNumberIdEnum.toString()); + } + return this.generateSerialNumberList(serialNumberInfoBO, count); + } + + /** + * 循环生成 number 集合 + * + * @param lastGenerate + * @param serialNumberInfo + * @param count + * @return + */ + protected SerialNumberGenerateResultBO loopNumberList(SerialNumberLastGenerateBO lastGenerate, SerialNumberInfoBO serialNumberInfo, int count) { + Long lastNumber = lastGenerate.getLastNumber(); + boolean isReset = false; + if (isResetInitNumber(lastGenerate, serialNumberInfo)) { + lastNumber = serialNumberInfo.getInitNumber(); + isReset = true; + } + + ArrayList numberList = Lists.newArrayListWithCapacity(count); + for (int i = 0; i < count; i++) { + Integer stepRandomRange = serialNumberInfo.getStepRandomRange(); + if (stepRandomRange > 1) { + lastNumber = lastNumber + RandomUtils.nextInt(1, stepRandomRange + 1); + } else { + lastNumber = lastNumber + 1; + } + + numberList.add(lastNumber); + } + + return SerialNumberGenerateResultBO + .builder() + .serialNumberId(serialNumberInfo.getSerialNumberId()) + .lastNumber(lastNumber) + .lastTime(LocalDateTime.now()) + .numberList(numberList) + .isReset(isReset) + .build(); + } + + protected void saveRecord(SerialNumberGenerateResultBO resultBO) { + Long effectRows = serialNumberRecordDao.updateRecord(resultBO.getSerialNumberId(), + resultBO.getLastTime().toLocalDate(), + resultBO.getLastNumber(), + resultBO.getNumberList().size() + ); + + // 需要插入 + if (effectRows == null || effectRows == 0) { + SerialNumberRecordEntity recordEntity = SerialNumberRecordEntity.builder() + .serialNumberId(resultBO.getSerialNumberId()) + .recordDate(LocalDate.now()) + .lastTime(resultBO.getLastTime()) + .lastNumber(resultBO.getLastNumber()) + .count((long) resultBO.getNumberList().size()) + .build(); + serialNumberRecordDao.insert(recordEntity); + } + + } + + /** + * 若不在规则周期内,重制初始值 + * + * @return + */ + private boolean isResetInitNumber(SerialNumberLastGenerateBO lastGenerate, SerialNumberInfoBO serialNumberInfo) { + LocalDateTime lastTime = lastGenerate.getLastTime(); + if (lastTime == null) { + return true; + } + + SerialNumberRuleTypeEnum serialNumberRuleTypeEnum = serialNumberInfo.getSerialNumberRuleTypeEnum(); + int lastTimeYear = lastTime.getYear(); + int lastTimeMonth = lastTime.getMonthValue(); + int lastTimeDay = lastTime.getDayOfYear(); + + LocalDateTime now = LocalDateTime.now(); + + switch (serialNumberRuleTypeEnum) { + case YEAR: + return lastTimeYear != now.getYear(); + case MONTH: + return lastTimeYear != now.getYear() || lastTimeMonth != now.getMonthValue(); + case DAY: + return lastTimeYear != now.getYear() || lastTimeDay != now.getDayOfYear(); + default: + return false; + } + } + + /** + * 替换特殊rule,即替换[yyyy][mm][dd][nnn]等规则 + */ + protected List formatNumberList(SerialNumberGenerateResultBO generteResult, SerialNumberInfoBO serialNumberInfo) { + + /** + * 第一步:替换年、月、日 + */ + LocalDate lastTime = generteResult.getLastTime().toLocalDate(); + String year = String.valueOf(lastTime.getYear()); + String month = lastTime.getMonthValue() > 9 ? String.valueOf(lastTime.getMonthValue()) : "0" + lastTime.getMonthValue(); + String day = lastTime.getDayOfMonth() > 9 ? String.valueOf(lastTime.getDayOfMonth()) : "0" + lastTime.getDayOfMonth(); + + // 把年月日替换 + String format = serialNumberInfo.getFormat(); + + if (serialNumberInfo.getHaveYearFlag()) { + format = format.replaceAll(SerialNumberRuleTypeEnum.YEAR.getRegex(), year); + } + if (serialNumberInfo.getHaveMonthFlag()) { + format = format.replaceAll(SerialNumberRuleTypeEnum.MONTH.getRegex(), month); + } + if (serialNumberInfo.getHaveDayFlag()) { + format = format.replaceAll(SerialNumberRuleTypeEnum.DAY.getRegex(), day); + } + + + /** + * 第二步:替换数字 + */ + + List numberList = Lists.newArrayListWithCapacity(generteResult.getNumberList().size()); + for (Long number : generteResult.getNumberList()) { + StringBuilder numberStringBuilder = new StringBuilder(); + int currentNumberCount = String.valueOf(number).length(); + //数量不够,前面补0 + if (serialNumberInfo.getNumberCount() > currentNumberCount) { + int remain = serialNumberInfo.getNumberCount() - currentNumberCount; + for (int i = 0; i < remain; i++) { + numberStringBuilder.append(0); + } + } + numberStringBuilder.append(number); + //最终替换 + String finalNumber = format.replaceAll(serialNumberInfo.getNumberFormat(), numberStringBuilder.toString()); + numberList.add(finalNumber); + } + return numberList; + } + + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/service/SerialNumberRecordService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/service/SerialNumberRecordService.java new file mode 100644 index 00000000..664e24fa --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/service/SerialNumberRecordService.java @@ -0,0 +1,39 @@ +package net.lab1024.sa.common.module.support.serialnumber.service; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import net.lab1024.sa.common.common.domain.PageResult; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.util.SmartPageUtil; +import net.lab1024.sa.common.module.support.operatelog.domain.OperateLogEntity; +import net.lab1024.sa.common.module.support.operatelog.domain.OperateLogVO; +import net.lab1024.sa.common.module.support.serialnumber.constant.SerialNumberIdEnum; +import net.lab1024.sa.common.module.support.serialnumber.dao.SerialNumberDao; +import net.lab1024.sa.common.module.support.serialnumber.dao.SerialNumberRecordDao; +import net.lab1024.sa.common.module.support.serialnumber.domain.SerialNumberRecordEntity; +import net.lab1024.sa.common.module.support.serialnumber.domain.SerialNumberRecordQueryForm; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 单据序列号 记录 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-03-25 21:46:07 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Service +public class SerialNumberRecordService { + + @Autowired + private SerialNumberRecordDao serialNumberRecordDao; + + public PageResult query(SerialNumberRecordQueryForm queryForm) { + Page page = SmartPageUtil.convert2PageQuery(queryForm); + List recordList = serialNumberRecordDao.query(page, queryForm); + return SmartPageUtil.convert2PageResult(page, recordList); + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/service/SerialNumberService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/service/SerialNumberService.java new file mode 100644 index 00000000..ce40d7fa --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/service/SerialNumberService.java @@ -0,0 +1,36 @@ +package net.lab1024.sa.common.module.support.serialnumber.service; + +import net.lab1024.sa.common.module.support.serialnumber.constant.SerialNumberIdEnum; + +import java.util.List; + +/** + * 单据序列号 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-03-25 21:46:07 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public interface SerialNumberService { + + /** + * 生成 + * + * @param serialNumberIdEnum + * @return + */ + String generate(SerialNumberIdEnum serialNumberIdEnum); + + + /** + * 生成n个 + * + * @param serialNumberIdEnum + * @param count + * @return + */ + List generate(SerialNumberIdEnum serialNumberIdEnum, int count); + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/service/impl/SerialNumberInternService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/service/impl/SerialNumberInternService.java new file mode 100644 index 00000000..db8c04e7 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/service/impl/SerialNumberInternService.java @@ -0,0 +1,78 @@ +package net.lab1024.sa.common.module.support.serialnumber.service.impl; + +import com.google.common.collect.Interner; +import com.google.common.collect.Interners; +import net.lab1024.sa.common.module.support.serialnumber.domain.SerialNumberEntity; +import net.lab1024.sa.common.module.support.serialnumber.domain.SerialNumberGenerateResultBO; +import net.lab1024.sa.common.module.support.serialnumber.domain.SerialNumberInfoBO; +import net.lab1024.sa.common.module.support.serialnumber.domain.SerialNumberLastGenerateBO; +import net.lab1024.sa.common.module.support.serialnumber.service.SerialNumberBaseService; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.concurrent.ConcurrentHashMap; + +/** + * 单据序列号 基于内存锁实现 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-03-25 21:46:07 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Service +public class SerialNumberInternService extends SerialNumberBaseService { + + /** + * 按照 serialNumberId 进行锁 + */ + private static final Interner POOL = Interners.newWeakInterner(); + + + private ConcurrentHashMap serialNumberLastGenerateMap = new ConcurrentHashMap<>(); + + @Override + public void initLastGenerateData(List serialNumberEntityList) { + if (serialNumberEntityList == null) { + return; + } + + for (SerialNumberEntity serialNumberEntity : serialNumberEntityList) { + SerialNumberLastGenerateBO lastGenerateBO = SerialNumberLastGenerateBO + .builder() + .serialNumberId(serialNumberEntity.getSerialNumberId()) + .lastNumber(serialNumberEntity.getLastNumber()) + .lastTime(serialNumberEntity.getLastTime()) + .build(); + serialNumberLastGenerateMap.put(serialNumberEntity.getSerialNumberId(), lastGenerateBO); + } + } + + @Override + public List generateSerialNumberList(SerialNumberInfoBO serialNumberInfo, int count) { + SerialNumberGenerateResultBO serialNumberGenerateResult = null; + synchronized (POOL.intern(serialNumberInfo.getSerialNumberId())) { + + // 获取上次的生成结果 + SerialNumberLastGenerateBO lastGenerateBO = serialNumberLastGenerateMap.get(serialNumberInfo.getSerialNumberId()); + + // 生成 + serialNumberGenerateResult = super.loopNumberList(lastGenerateBO, serialNumberInfo, count); + + // 将生成信息保存的内存和数据库 + lastGenerateBO.setLastNumber(serialNumberGenerateResult.getLastNumber()); + lastGenerateBO.setLastTime(serialNumberGenerateResult.getLastTime()); + serialNumberDao.updateLastNumberAndTime(serialNumberInfo.getSerialNumberId(), + serialNumberGenerateResult.getLastNumber(), + serialNumberGenerateResult.getLastTime()); + + // 把生成过程保存到数据库里 + super.saveRecord(serialNumberGenerateResult); + } + + return formatNumberList(serialNumberGenerateResult, serialNumberInfo); + } + + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/service/impl/SerialNumberMysqlService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/service/impl/SerialNumberMysqlService.java new file mode 100644 index 00000000..8d2413a7 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/service/impl/SerialNumberMysqlService.java @@ -0,0 +1,61 @@ +package net.lab1024.sa.common.module.support.serialnumber.service.impl; + +import lombok.extern.slf4j.Slf4j; +import net.lab1024.sa.common.common.exception.BusinessException; +import net.lab1024.sa.common.module.support.serialnumber.domain.SerialNumberEntity; +import net.lab1024.sa.common.module.support.serialnumber.domain.SerialNumberGenerateResultBO; +import net.lab1024.sa.common.module.support.serialnumber.domain.SerialNumberInfoBO; +import net.lab1024.sa.common.module.support.serialnumber.domain.SerialNumberLastGenerateBO; +import net.lab1024.sa.common.module.support.serialnumber.service.SerialNumberBaseService; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * 单据序列号 基于mysql锁实现 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-03-25 21:46:07 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Slf4j +public class SerialNumberMysqlService extends SerialNumberBaseService { + + @Override + @Transactional(rollbackFor = Throwable.class) + public List generateSerialNumberList(SerialNumberInfoBO serialNumberInfo, int count) { + // // 获取上次的生成结果 + SerialNumberEntity serialNumberEntity = serialNumberDao.selectForUpdate(serialNumberInfo.getSerialNumberId()); + if (serialNumberEntity == null) { + throw new BusinessException("cannot found SerialNumberId 数据库不存在:" + serialNumberInfo.getSerialNumberId()); + } + SerialNumberLastGenerateBO lastGenerateBO = SerialNumberLastGenerateBO + .builder() + .lastNumber(serialNumberEntity.getLastNumber()) + .lastTime(serialNumberEntity.getLastTime()) + .serialNumberId(serialNumberEntity.getSerialNumberId()) + .build(); + + // 生成 + SerialNumberGenerateResultBO serialNumberGenerateResult = super.loopNumberList(lastGenerateBO, serialNumberInfo, count); + + // 将生成信息保存的内存和数据库 + lastGenerateBO.setLastNumber(serialNumberGenerateResult.getLastNumber()); + lastGenerateBO.setLastTime(serialNumberGenerateResult.getLastTime()); + serialNumberDao.updateLastNumberAndTime(serialNumberInfo.getSerialNumberId(), + serialNumberGenerateResult.getLastNumber(), + serialNumberGenerateResult.getLastTime()); + + // 把生成过程保存到数据库里 + super.saveRecord(serialNumberGenerateResult); + + return formatNumberList(serialNumberGenerateResult, serialNumberInfo); + } + + @Override + public void initLastGenerateData(List serialNumberEntityList) { + + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/service/impl/SerialNumberRedisService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/service/impl/SerialNumberRedisService.java new file mode 100644 index 00000000..1c54f0ed --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/serialnumber/service/impl/SerialNumberRedisService.java @@ -0,0 +1,105 @@ +package net.lab1024.sa.common.module.support.serialnumber.service.impl; + +import lombok.extern.slf4j.Slf4j; +import net.lab1024.sa.common.common.exception.BusinessException; +import net.lab1024.sa.common.constant.RedisKeyConst; +import net.lab1024.sa.common.module.support.redis.RedisService; +import net.lab1024.sa.common.module.support.serialnumber.domain.SerialNumberEntity; +import net.lab1024.sa.common.module.support.serialnumber.domain.SerialNumberGenerateResultBO; +import net.lab1024.sa.common.module.support.serialnumber.domain.SerialNumberInfoBO; +import net.lab1024.sa.common.module.support.serialnumber.domain.SerialNumberLastGenerateBO; +import net.lab1024.sa.common.module.support.serialnumber.service.SerialNumberBaseService; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.List; + +/** + * 单据序列号 基于redis锁实现 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-03-25 21:46:07 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Slf4j +public class SerialNumberRedisService extends SerialNumberBaseService { + + private static final int MAX_GET_LOCK_COUNT = 5; + + private static final long SLEEP_MILLISECONDS = 200L; + + @Autowired + private RedisService redisService; + + @Override + public void initLastGenerateData(List serialNumberEntityList) { + if (serialNumberEntityList == null) { + return; + } + + //删除之前的 + redisService.delete(RedisKeyConst.Support.SERIAL_NUMBER_LAST_INFO); + + for (SerialNumberEntity serialNumberEntity : serialNumberEntityList) { + SerialNumberLastGenerateBO lastGenerateBO = SerialNumberLastGenerateBO + .builder() + .serialNumberId(serialNumberEntity.getSerialNumberId()) + .lastNumber(serialNumberEntity.getLastNumber()) + .lastTime(serialNumberEntity.getLastTime()) + .build(); + + redisService.mset(RedisKeyConst.Support.SERIAL_NUMBER_LAST_INFO, + String.valueOf(serialNumberEntity.getSerialNumberId()), + lastGenerateBO + ); + } + } + + @Override + public List generateSerialNumberList(SerialNumberInfoBO serialNumberInfo, int count) { + SerialNumberGenerateResultBO serialNumberGenerateResult = null; + String lockKey = RedisKeyConst.Support.SERIAL_NUMBER + serialNumberInfo.getSerialNumberId(); + try { + boolean lock = false; + for (int i = 0; i < MAX_GET_LOCK_COUNT; i++) { + try { + lock = redisService.getLock(lockKey, 60 * 1000L); + if (lock) { + break; + } + Thread.sleep(SLEEP_MILLISECONDS); + } catch (Throwable e) { + log.error(e.getMessage(), e); + } + } + if (!lock) { + throw new BusinessException("SerialNumber 尝试5次,未能生成单号"); + } + // 获取上次的生成结果 + SerialNumberLastGenerateBO lastGenerateBO = (SerialNumberLastGenerateBO) redisService.mget( + RedisKeyConst.Support.SERIAL_NUMBER_LAST_INFO, + String.valueOf(serialNumberInfo.getSerialNumberId())); + + // 生成 + serialNumberGenerateResult = super.loopNumberList(lastGenerateBO, serialNumberInfo, count); + + // 将生成信息保存的内存和数据库 + lastGenerateBO.setLastNumber(serialNumberGenerateResult.getLastNumber()); + lastGenerateBO.setLastTime(serialNumberGenerateResult.getLastTime()); + serialNumberDao.updateLastNumberAndTime(serialNumberInfo.getSerialNumberId(), + serialNumberGenerateResult.getLastNumber(), + serialNumberGenerateResult.getLastTime()); + + // 把生成过程保存到数据库里 + super.saveRecord(serialNumberGenerateResult); + } catch (Throwable e) { + log.error(e.getMessage(), e); + throw e; + } finally { + redisService.unLock(lockKey); + } + + return formatNumberList(serialNumberGenerateResult, serialNumberInfo); + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/table/TableColumnController.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/table/TableColumnController.java new file mode 100644 index 00000000..fd657e09 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/table/TableColumnController.java @@ -0,0 +1,51 @@ +package net.lab1024.sa.common.module.support.table; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import net.lab1024.sa.common.common.controller.SupportBaseController; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.util.SmartRequestUtil; +import net.lab1024.sa.common.constant.SwaggerTagConst; +import net.lab1024.sa.common.module.support.repeatsubmit.annoation.RepeatSubmit; +import net.lab1024.sa.common.module.support.table.domain.TableColumnUpdateForm; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + +/** + * 表格自定义列(前端用户自定义表格列,并保存到数据库里) + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-12 22:52:21 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@RestController +@Api(tags = {SwaggerTagConst.Support.TABLE_COLUMN}) +public class TableColumnController extends SupportBaseController { + + @Autowired + private TableColumnService tableColumnService; + + @ApiOperation("修改表格列 @author 卓大") + @PostMapping("/tableColumn/update") + @RepeatSubmit + public ResponseDTO updateTableColumn(@RequestBody @Valid TableColumnUpdateForm updateForm) { + return tableColumnService.updateTableColumns(SmartRequestUtil.getRequestUser(), updateForm); + } + + @ApiOperation("恢复默认(删除) @author 卓大") + @GetMapping("/tableColumn/delete/{tableId}") + @RepeatSubmit + public ResponseDTO deleteTableColumn(@PathVariable Integer tableId) { + return tableColumnService.deleteTableColumn(SmartRequestUtil.getRequestUser(), tableId); + } + + @ApiOperation("查询表格列 @author 卓大") + @GetMapping("/tableColumn/getColumns/{tableId}") + public ResponseDTO getColumns(@PathVariable Integer tableId) { + return ResponseDTO.ok(tableColumnService.getTableColumns(SmartRequestUtil.getRequestUser(), tableId)); + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/table/TableColumnDao.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/table/TableColumnDao.java new file mode 100644 index 00000000..2a7d6cdc --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/table/TableColumnDao.java @@ -0,0 +1,23 @@ +package net.lab1024.sa.common.module.support.table; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import net.lab1024.sa.common.module.support.table.domain.TableColumnEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 表格自定义列(前端用户自定义表格列,并保存到数据库里) + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-12 22:52:21 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Mapper +public interface TableColumnDao extends BaseMapper { + + TableColumnEntity selectByUserIdAndTableId(@Param("userId") Long userId, @Param("userType") Integer userType, @Param("tableId") Integer tableId); + + void delete(@Param("userId") Long userId, @Param("userType") Integer userType, @Param("tableId") Integer tableId); +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/table/TableColumnService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/table/TableColumnService.java new file mode 100644 index 00000000..5f388c4a --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/table/TableColumnService.java @@ -0,0 +1,72 @@ +package net.lab1024.sa.common.module.support.table; + +import com.alibaba.fastjson.JSONArray; +import net.lab1024.sa.common.common.domain.RequestUser; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.module.support.table.domain.TableColumnEntity; +import net.lab1024.sa.common.module.support.table.domain.TableColumnUpdateForm; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * 表格自定义列(前端用户自定义表格列,并保存到数据库里) + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-12 22:52:21 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Service +public class TableColumnService { + + @Autowired + private TableColumnDao tableColumnDao; + + /** + * 获取 - 表格列 + * + * @return + */ + public String getTableColumns(RequestUser requestUser, Integer tableId) { + TableColumnEntity tableColumnEntity = tableColumnDao.selectByUserIdAndTableId(requestUser.getUserId(), requestUser.getUserType().getValue(), tableId); + return tableColumnEntity == null ? null : tableColumnEntity.getColumns(); + } + + /** + * 更新表格列 + * + * @return + */ + public ResponseDTO updateTableColumns(RequestUser requestUser, TableColumnUpdateForm updateForm) { + if (CollectionUtils.isEmpty(updateForm.getColumnList())) { + return ResponseDTO.ok(); + } + Integer tableId = updateForm.getTableId(); + TableColumnEntity tableColumnEntity = tableColumnDao.selectByUserIdAndTableId(requestUser.getUserId(), requestUser.getUserType().getValue(), tableId); + if (tableColumnEntity == null) { + tableColumnEntity = new TableColumnEntity(); + tableColumnEntity.setTableId(tableId); + tableColumnEntity.setUserId(requestUser.getUserId()); + tableColumnEntity.setUserType(requestUser.getUserType().getValue()); + + tableColumnEntity.setColumns(JSONArray.toJSONString(updateForm.getColumnList())); + tableColumnDao.insert(tableColumnEntity); + } else { + tableColumnEntity.setColumns(JSONArray.toJSONString(updateForm.getColumnList())); + tableColumnDao.updateById(tableColumnEntity); + } + return ResponseDTO.ok(); + } + + /** + * 删除表格列 + * + * @return + */ + public ResponseDTO deleteTableColumn(RequestUser requestUser, Integer tableId) { + tableColumnDao.delete(requestUser.getUserId(), requestUser.getUserType().getValue(), tableId); + return ResponseDTO.ok(); + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/table/domain/TableColumnEntity.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/table/domain/TableColumnEntity.java new file mode 100644 index 00000000..c177ed16 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/table/domain/TableColumnEntity.java @@ -0,0 +1,49 @@ +package net.lab1024.sa.common.module.support.table.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * 自定义表格列 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-12 22:52:21 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +@TableName("t_table_column") +public class TableColumnEntity { + + @TableId(type = IdType.AUTO) + private Long tableColumnId; + + /** + * 用户id + */ + private Long userId; + + /** + * 用户类型 + */ + private Integer userType; + + /** + * 表id + */ + private Integer tableId; + + /** + * 表列 + */ + private String columns; + + private LocalDateTime createTime; + + private LocalDateTime updateTime; +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/table/domain/TableColumnItemForm.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/table/domain/TableColumnItemForm.java new file mode 100644 index 00000000..0a50f8e9 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/table/domain/TableColumnItemForm.java @@ -0,0 +1,37 @@ +package net.lab1024.sa.common.module.support.table.domain; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; + +/** + * 自定义表格列 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-12 22:52:21 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class TableColumnItemForm { + + @NotEmpty(message = "列不能为空") + @ApiModelProperty("字段") + private String columnKey; + + @ApiModelProperty("宽度") + private Integer width; + + @NotNull(message = "显示不能为空") + @ApiModelProperty("是否显示") + private Boolean showFlag; + + @NotNull(message = "排序不能为空") + @ApiModelProperty("排序") + private Integer sort; + + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/table/domain/TableColumnUpdateForm.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/table/domain/TableColumnUpdateForm.java new file mode 100644 index 00000000..106bf61b --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/table/domain/TableColumnUpdateForm.java @@ -0,0 +1,27 @@ +package net.lab1024.sa.common.module.support.table.domain; + +import lombok.Data; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.util.List; + +/** + * 自定义表格列 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2022-08-12 22:52:21 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Data +public class TableColumnUpdateForm { + + @NotNull(message = "表id不能为空") + private Integer tableId; + + @NotEmpty(message = "请上传列") + private List columnList; + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/token/JwtConst.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/token/JwtConst.java new file mode 100644 index 00000000..79084efe --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/token/JwtConst.java @@ -0,0 +1,38 @@ +package net.lab1024.sa.common.module.support.token; + +/** + * jwt相关常量 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2021-11-29 19:48:35 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +class JwtConst { + /** + * Id + */ + static final String CLAIM_ID_KEY = "id"; + + /** + * NAME + */ + static final String CLAIM_NAME_KEY = "name"; + + /** + * user type + */ + static final String CLAIM_USER_TYPE_KEY = "type"; + + /** + * 设备 + */ + static final String CLAIM_DEVICE_KEY = "device"; + + /** + * 万能密码登录的标识 + */ + static final String CLAIM_SUPER_PASSWORD_FLAG = "superPasswordFlag"; + +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/token/LoginDeviceEnum.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/token/LoginDeviceEnum.java new file mode 100644 index 00000000..3fa94198 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/token/LoginDeviceEnum.java @@ -0,0 +1,43 @@ +package net.lab1024.sa.common.module.support.token; + +import net.lab1024.sa.common.common.enumeration.BaseEnum; + +/** + * 登录设备类型 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2021-11-29 19:48:35 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +public enum LoginDeviceEnum implements BaseEnum { + + PC(1, "电脑端"), + + ANDROID(2, "安卓"), + + APPLE(3, "苹果"), + + H5(4, "H5"), + + WEIXIN_MP(5, "微信小程序"); + + LoginDeviceEnum(Integer value, String desc) { + this.value = value; + this.desc = desc; + } + + private Integer value; + private String desc; + + @Override + public Integer getValue() { + return value; + } + + @Override + public String getDesc() { + return desc; + } +} diff --git a/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/token/TokenService.java b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/token/TokenService.java new file mode 100644 index 00000000..e3af8649 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/token/TokenService.java @@ -0,0 +1,220 @@ +package net.lab1024.sa.common.module.support.token; + +import io.jsonwebtoken.Claims; +import io.jsonwebtoken.JwtBuilder; +import io.jsonwebtoken.Jwts; +import io.jsonwebtoken.SignatureAlgorithm; +import lombok.extern.slf4j.Slf4j; +import net.lab1024.sa.common.common.enumeration.UserTypeEnum; +import net.lab1024.sa.common.constant.RedisKeyConst; +import net.lab1024.sa.common.module.support.redis.RedisService; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.math.NumberUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +import java.util.Date; +import java.util.Map; + +/** + * 与用户token的相关的服务 + * + * @Author 1024创新实验室-主任: 卓大 + * @Date 2021-11-29 19:48:35 + * @Wechat zhuoda1024 + * @Email lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ) + */ +@Component +@Slf4j +public class TokenService { + private static final long HOUR_TIME_MILLI = 60 * 60 * 1000; + + @Value("${token.key}") + private String tokenKey; + + @Value("${token.expire-day}") + private Integer tokenExpire; + + @Autowired + private RedisService redisService; + + /** + * 生成Token,并存入redis + * + * @param userId + * @param userName + * @param userTypeEnum + * @param loginDeviceEnum + * @param superPasswordFlag 特殊万能密码标识 + * @return + */ + public String generateToken(Long userId, String userName, UserTypeEnum userTypeEnum, LoginDeviceEnum loginDeviceEnum, Boolean superPasswordFlag) { + long nowTimeMilli = System.currentTimeMillis(); + Claims jwtClaims = Jwts.claims(); + jwtClaims.put(JwtConst.CLAIM_ID_KEY, userId); + jwtClaims.put(JwtConst.CLAIM_NAME_KEY, userName); + jwtClaims.put(JwtConst.CLAIM_USER_TYPE_KEY, userTypeEnum.getValue()); + jwtClaims.put(JwtConst.CLAIM_DEVICE_KEY, loginDeviceEnum.getValue()); + jwtClaims.put(JwtConst.CLAIM_SUPER_PASSWORD_FLAG, superPasswordFlag); + JwtBuilder jwtBuilder = Jwts.builder() + .setClaims(jwtClaims) + .setIssuedAt(new Date(nowTimeMilli)) + .signWith(SignatureAlgorithm.HS512, tokenKey); + + // 如果是万能密码,则不需要记录到redis中;万能密码最多半个小时有效期 + if (superPasswordFlag) { + jwtBuilder.setExpiration(new Date(nowTimeMilli + (HOUR_TIME_MILLI / 2))); + return jwtBuilder.compact(); + } + + jwtBuilder.setExpiration(new Date(nowTimeMilli + tokenExpire * 24 * HOUR_TIME_MILLI)); + String token = jwtBuilder.compact(); + String redisKey = this.generateTokenRedisKey(userId, userTypeEnum.getValue(), loginDeviceEnum.getValue()); + redisService.set(redisKey, token, tokenExpire * 24 * 3600); + return token; + } + + /** + * 生成登录信息: 含设备信息 + * + * @param userId + * @param device + * @return + */ + private String generateTokenRedisKey(Long userId, Integer userType, Integer device) { + String userKey = userType + "_" + userId + "_" + device; + return redisService.generateRedisKey(RedisKeyConst.Support.TOKEN, userKey); + } + + + /** + * 强制移除 此用户各端的登录信息 + * + * @param token + */ + public void removeToken(String token) { + Map tokenData = this.decryptTokenData(token); + if (MapUtils.isEmpty(tokenData)) { + return; + } + + //特殊账号 + if (tokenData.get(JwtConst.CLAIM_SUPER_PASSWORD_FLAG) != null) { + try { + Boolean superPasswordFlag = Boolean.valueOf(tokenData.get(JwtConst.CLAIM_SUPER_PASSWORD_FLAG).toString()); + if (superPasswordFlag) { + return; + } + } catch (Exception e) { + log.error(e.getMessage(), e); + return; + } + } + + boolean isValid = this.checkRedisToken(tokenData, token); + if (!isValid) { + return; + } + + Long userId = Long.valueOf(tokenData.get(JwtConst.CLAIM_ID_KEY).toString()); + Integer userType = Integer.valueOf(tokenData.get(JwtConst.CLAIM_USER_TYPE_KEY).toString()); + Integer device = Integer.valueOf(tokenData.get(JwtConst.CLAIM_DEVICE_KEY).toString()); + + String redisKey = this.generateTokenRedisKey(userId, userType, device); + redisService.delete(redisKey); + } + + /** + * 解析并校验token信息 获取 userId + * + * @param token + * @return + */ + public Long getUserIdAndValidateToken(String token) { + Map parseJwtData = this.decryptTokenData(token); + boolean isValid = this.checkRedisToken(parseJwtData, token); + if (!isValid) { + return null; + } + Long userId = Long.valueOf(parseJwtData.get(JwtConst.CLAIM_ID_KEY).toString()); + return userId; + } + + /** + * 解密和解析token + * + * @param token + * @return + */ + private Map decryptTokenData(String token) { + try { + return Jwts.parser() + .setSigningKey(tokenKey) + .parseClaimsJws(token) + .getBody(); + } catch (Exception e) { + } + return null; + } + + /** + * 校验token是否有效 + * + * @param token + * @return + */ + private boolean checkRedisToken(Map parseJwtData, String token) { + if (MapUtils.isEmpty(parseJwtData)) { + return false; + } + //特殊账号 + if (parseJwtData.get(JwtConst.CLAIM_SUPER_PASSWORD_FLAG) != null) { + try { + Boolean superPasswordFlag = Boolean.valueOf(parseJwtData.get(JwtConst.CLAIM_SUPER_PASSWORD_FLAG).toString()); + if (superPasswordFlag) { + return true; + } + } catch (Exception e) { + log.error(e.getMessage(), e); + return false; + } + } + + Long userId = null; + Integer userType = null, device = null; + + if (null != parseJwtData.get(JwtConst.CLAIM_ID_KEY)) { + userId = NumberUtils.toLong(parseJwtData.get(JwtConst.CLAIM_ID_KEY).toString(), -1); + userId = userId == -1 ? null : userId; + } + + if (null != parseJwtData.get(JwtConst.CLAIM_USER_TYPE_KEY)) { + userType = NumberUtils.toInt(parseJwtData.get(JwtConst.CLAIM_USER_TYPE_KEY).toString(), -1); + userType = userType == -1 ? null : userType; + } + + if (null != parseJwtData.get(JwtConst.CLAIM_DEVICE_KEY)) { + device = NumberUtils.toInt(parseJwtData.get(JwtConst.CLAIM_DEVICE_KEY).toString(), -1); + device = device == -1 ? null : device; + } + + if (userId == null || userType == null || device == null) { + return false; + } + + String redisKey = this.generateTokenRedisKey(userId, userType, device); + String redisToken = redisService.get(redisKey); + return token.equals(redisToken); + } + + /** + * 批量移除用户所有设备的token + */ + public void batchRemoveRedisToken(Long userId, UserTypeEnum userTypeEnum) { + for (LoginDeviceEnum device : LoginDeviceEnum.values()) { + redisService.delete(this.generateTokenRedisKey(userId, userTypeEnum.getValue(), device.getValue())); + } + } +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/resources/META-INF/spring.factories b/smart-admin-api/sa-common/src/main/resources/META-INF/spring.factories new file mode 100644 index 00000000..99b8129c --- /dev/null +++ b/smart-admin-api/sa-common/src/main/resources/META-INF/spring.factories @@ -0,0 +1,2 @@ +org.springframework.boot.env.EnvironmentPostProcessor=\ + net.lab1024.sa.common.config.PostProcessorConfig \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/resources/banner.txt b/smart-admin-api/sa-common/src/main/resources/banner.txt similarity index 50% rename from smart-admin-service/smart-admin-api/src/main/resources/banner.txt rename to smart-admin-api/sa-common/src/main/resources/banner.txt index d3187732..92bf81a5 100644 --- a/smart-admin-service/smart-admin-api/src/main/resources/banner.txt +++ b/smart-admin-api/sa-common/src/main/resources/banner.txt @@ -1,8 +1,19 @@ + ${AnsiColor.BRIGHT_GREEN} + / ____| | | /\ | | (_) | (___ _ __ ___ __ _ _ __| |_ / \ __| |_ __ ___ _ _ __ \___ \| '_ ` _ \ / _` | '__| __| / /\ \ / _` | '_ ` _ \| | '_ \ ____) | | | | | | (_| | | | |_ / ____ \ (_| | | | | | | | | | | |_____/|_| |_| |_|\__,_|_| \__/_/ \_\__,_|_| |_| |_|_|_| |_| -SmartAdmin v1.2.0 +保持谦逊 保持学习 ! +热爱代码 热爱生活 ! +永远年轻 永远前行 ! +SmartAdmin v2.X ,作者:1024创新实验室 @copyright:【 1024lab 】 + +SmartAdmin 文档地址:https://smartadmin.1024lab.net + +1024创新实验室:https://www.1024lab.net + +${AnsiColor.DEFAULT} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/resources/code-generator-template/java/constant/enum.java.vm b/smart-admin-api/sa-common/src/main/resources/code-generator-template/java/constant/enum.java.vm new file mode 100644 index 00000000..6511a80d --- /dev/null +++ b/smart-admin-api/sa-common/src/main/resources/code-generator-template/java/constant/enum.java.vm @@ -0,0 +1,24 @@ +package ${packageName}; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import net.lab1024.sa.common.common.enumeration.BaseEnum; + +/** + * ${enumDesc} + * + * @Author ${basic.backendAuthor} + * @Date ${basic.backendDate} + * @Copyright ${basic.copyright} + */ + +@AllArgsConstructor +@Getter +public enum ${enumName} implements BaseEnum { + + ; + + private final ${enumJavaType} value; + + private final String desc; +} diff --git a/smart-admin-api/sa-common/src/main/resources/code-generator-template/java/controller/Controller.java.vm b/smart-admin-api/sa-common/src/main/resources/code-generator-template/java/controller/Controller.java.vm new file mode 100644 index 00000000..42f93dc2 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/resources/code-generator-template/java/controller/Controller.java.vm @@ -0,0 +1,68 @@ +package ${packageName}; + +#foreach ($importClass in $importPackageList) +$importClass +#end +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.domain.PageResult; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import javax.validation.Valid; + +/** + * ${basic.description} Controller + * + * @Author ${basic.backendAuthor} + * @Date ${basic.backendDate} + * @Copyright ${basic.copyright} + */ + +@RestController +@Api(tags = "") +public class ${name.upperCamel}Controller { + + @Autowired + private ${name.upperCamel}Service ${name.lowerCamel}Service; + + @ApiOperation("分页查询 @author ${basic.backendAuthor}") + @PostMapping("/${name.lowerCamel}/queryPage") + public ResponseDTO> queryPage(@RequestBody @Valid ${name.upperCamel}QueryForm queryForm) { + return ResponseDTO.ok(${name.lowerCamel}Service.queryPage(queryForm)); + } + +#if($insertAndUpdate.isSupportInsertAndUpdate) + @ApiOperation("添加 @author ${basic.backendAuthor}") + @PostMapping("/${name.lowerCamel}/add") + public ResponseDTO add(@RequestBody @Valid ${name.upperCamel}AddForm addForm) { + return ${name.lowerCamel}Service.add(addForm); + } + + @ApiOperation("更新 @author ${basic.backendAuthor}") + @PostMapping("/${name.lowerCamel}/update") + public ResponseDTO update(@RequestBody @Valid ${name.upperCamel}UpdateForm updateForm) { + return ${name.lowerCamel}Service.update(updateForm); + } +#end + +#if($deleteInfo.isSupportDelete) + #if($deleteInfo.deleteEnum == "Batch" || $deleteInfo.deleteEnum == "SingleAndBatch") + @ApiOperation("批量删除 @author ${basic.backendAuthor}") + @PostMapping("/${name.lowerCamel}/batchDelete") + public ResponseDTO batchDelete(@RequestBody ValidateList<${primaryKeyJavaType}> idList) { + return ${name.lowerCamel}Service.batchDelete(idList); + } + #end + + #if($deleteInfo.deleteEnum == "Single" || $deleteInfo.deleteEnum == "SingleAndBatch") + @ApiOperation("单个删除 @author ${basic.backendAuthor}") + @GetMapping("/${name.lowerCamel}/delete/{${name.lowerCamel}Id}") + public ResponseDTO batchDelete(@PathVariable ${primaryKeyJavaType} ${primaryKeyFieldName}) { + return ${name.lowerCamel}Service.delete(${name.lowerCamel}Id); + } + #end +#end +} diff --git a/smart-admin-api/sa-common/src/main/resources/code-generator-template/java/dao/Dao.java.vm b/smart-admin-api/sa-common/src/main/resources/code-generator-template/java/dao/Dao.java.vm new file mode 100644 index 00000000..b14411a9 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/resources/code-generator-template/java/dao/Dao.java.vm @@ -0,0 +1,51 @@ +package ${packageName}; + +#foreach ($importClass in $importPackageList) +$importClass +#end +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Component; + +/** + * ${basic.description} Dao + * + * @Author ${basic.backendAuthor} + * @Date ${basic.backendDate} + * @Copyright ${basic.copyright} + */ + +@Mapper +@Component +public interface ${name.upperCamel}Dao extends BaseMapper<${name.upperCamel}Entity> { + + /** + * 分页 查询 + * + * @param page + * @param queryForm + * @return + */ + List<${name.upperCamel}VO> queryPage(Page page, @Param("queryForm") ${name.upperCamel}QueryForm queryForm); + +#if($deleteInfo.isSupportDelete) +### 假删除 +#if(!${deleteInfo.isPhysicallyDeleted}) +#if($deleteInfo.deleteEnum == "Single" || $deleteInfo.deleteEnum == "SingleAndBatch") + /** + * 更新删除状态 + */ + long updateDeleted(@Param("${primaryKeyFieldName}")${primaryKeyJavaType} ${primaryKeyFieldName},@Param("${deletedFlag}")boolean deletedFlag); +#end +#if($deleteInfo.deleteEnum == "Batch" || $deleteInfo.deleteEnum == "SingleAndBatch") + /** + * 批量更新删除状态 + */ + void batchUpdateDeleted(@Param("idList")List<${primaryKeyJavaType}> idList,@Param("${deletedFlag}")boolean deletedFlag); +#end +#end +#end + +} diff --git a/smart-admin-api/sa-common/src/main/resources/code-generator-template/java/domain/entity/Entity.java.vm b/smart-admin-api/sa-common/src/main/resources/code-generator-template/java/domain/entity/Entity.java.vm new file mode 100644 index 00000000..dd1fe0bb --- /dev/null +++ b/smart-admin-api/sa-common/src/main/resources/code-generator-template/java/domain/entity/Entity.java.vm @@ -0,0 +1,32 @@ +package ${basic.javaPackageName}.domain.entity; + +#foreach ($importClass in $importPackageList) +$importClass +#end + +/** + * ${basic.description} 实体类 + * + * @Author ${basic.backendAuthor} + * @Date ${basic.backendDate} + * @Copyright ${basic.copyright} + */ + +@Data +@TableName("${tableName}") +public class ${name.upperCamel}Entity { +#foreach ($field in $fields) + + /** + * $field.label + */ +#if($field.primaryKeyFlag && $field.autoIncreaseFlag) + @TableId(type = IdType.AUTO) +#end +#if($field.primaryKeyFlag && !$field.autoIncreaseFlag) + @TableId +#end + private $field.javaType $field.fieldName; +#end + +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/resources/code-generator-template/java/domain/form/AddForm.java.vm b/smart-admin-api/sa-common/src/main/resources/code-generator-template/java/domain/form/AddForm.java.vm new file mode 100644 index 00000000..d1e8581c --- /dev/null +++ b/smart-admin-api/sa-common/src/main/resources/code-generator-template/java/domain/form/AddForm.java.vm @@ -0,0 +1,30 @@ +package ${packageName}; + +#foreach ($importClass in $importPackageList) +$importClass +#end + +/** + * ${basic.description} 新建表单 + * + * @Author ${basic.backendAuthor} + * @Date ${basic.backendDate} + * @Copyright ${basic.copyright} + */ + +@Data +public class ${name.upperCamel}AddForm { +#foreach ($field in $fields) + +#if($field.isEnum) + ${field.apiModelProperty} + ${field.checkEnum} + private $field.javaType $field.fieldName; +#end +#if(!$field.isEnum) + ${field.apiModelProperty}$!{field.notEmpty}$!{field.dict}$!{field.file} + private $field.javaType $field.fieldName; +#end +#end + +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/resources/code-generator-template/java/domain/form/QueryForm.java.vm b/smart-admin-api/sa-common/src/main/resources/code-generator-template/java/domain/form/QueryForm.java.vm new file mode 100644 index 00000000..ed672d95 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/resources/code-generator-template/java/domain/form/QueryForm.java.vm @@ -0,0 +1,38 @@ +package ${packageName}; + +import net.lab1024.sa.common.common.domain.PageParam; +#foreach ($importClass in $importPackageList) +$importClass +#end + +/** + * ${basic.description} 分页查询表单 + * + * @Author ${basic.backendAuthor} + * @Date ${basic.backendDate} + * @Copyright ${basic.copyright} + */ + +@Data +public class ${name.upperCamel}QueryForm extends PageParam{ +#foreach ($field in $fields) + +#if($field.isEnum) + ${field.apiModelProperty} + ${field.checkEnum} + private $field.javaType $field.fieldName; +#end +#if(!$field.isEnum && $field.queryTypeEnum != "DateRange") + ${field.apiModelProperty}$!{field.dict} + private $field.javaType $field.fieldName; +#end +#if(!$field.isEnum && $field.queryTypeEnum == "DateRange") + ${field.apiModelProperty} + private $field.javaType ${field.fieldName}Begin; + + ${field.apiModelProperty} + private $field.javaType ${field.fieldName}End; +#end +#end + +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/resources/code-generator-template/java/domain/form/UpdateForm.java.vm b/smart-admin-api/sa-common/src/main/resources/code-generator-template/java/domain/form/UpdateForm.java.vm new file mode 100644 index 00000000..15cbe9a5 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/resources/code-generator-template/java/domain/form/UpdateForm.java.vm @@ -0,0 +1,30 @@ +package ${packageName}; + +#foreach ($importClass in $importPackageList) +$importClass +#end + +/** + * ${basic.description} 更新表单 + * + * @Author ${basic.backendAuthor} + * @Date ${basic.backendDate} + * @Copyright ${basic.copyright} + */ + +@Data +public class ${name.upperCamel}UpdateForm { +#foreach ($field in $fields) + +#if($field.isEnum) + ${field.apiModelProperty} + ${field.checkEnum} + private $field.javaType $field.fieldName; +#end +#if(!$field.isEnum) + ${field.apiModelProperty}$!{field.notEmpty}$!{field.dict}$!{field.file} + private $field.javaType $field.fieldName; +#end +#end + +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/resources/code-generator-template/java/domain/vo/VO.java.vm b/smart-admin-api/sa-common/src/main/resources/code-generator-template/java/domain/vo/VO.java.vm new file mode 100644 index 00000000..e2c84f82 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/resources/code-generator-template/java/domain/vo/VO.java.vm @@ -0,0 +1,32 @@ +package ${packageName}; + +#foreach ($importClass in $importPackageList) +$importClass +#end + +/** + * ${basic.description} 列表VO + * + * @Author ${basic.backendAuthor} + * @Date ${basic.backendDate} + * @Copyright ${basic.copyright} + */ + +@Data +public class ${name.upperCamel}VO { + + private $!{primaryKeyJavaType} $!{primaryKeyFieldName}; + +#foreach ($field in $fields) + +#if($field.isEnum) + ${field.apiModelProperty} + private $field.javaType $field.fieldName; +#end +#if(!$field.isEnum) + ${field.apiModelProperty}$!{field.dict}$!{field.file} + private $field.javaType $field.fieldName; +#end +#end + +} \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/resources/code-generator-template/java/manager/Manager.java.vm b/smart-admin-api/sa-common/src/main/resources/code-generator-template/java/manager/Manager.java.vm new file mode 100644 index 00000000..52811ca0 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/resources/code-generator-template/java/manager/Manager.java.vm @@ -0,0 +1,21 @@ +package ${packageName}; + +#foreach ($importClass in $importPackageList) +$importClass +#end + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * ${basic.description} Manager + * + * @Author ${basic.backendAuthor} + * @Date ${basic.backendDate} + * @Copyright ${basic.copyright} + */ +@Service +public class ${name.upperCamel}Manager extends ServiceImpl<${name.upperCamel}Dao, ${name.upperCamel}Entity> { + + +} diff --git a/smart-admin-api/sa-common/src/main/resources/code-generator-template/java/mapper/Mapper.xml.vm b/smart-admin-api/sa-common/src/main/resources/code-generator-template/java/mapper/Mapper.xml.vm new file mode 100644 index 00000000..d6809423 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/resources/code-generator-template/java/mapper/Mapper.xml.vm @@ -0,0 +1,74 @@ + + + + + + + +#if($dao.deletedFieldUpperName != $null) + + update ${mapper.tableName} set ${mapper.deletedColumnName} = #{deletedFlag} + where ${mapper.mainKeyColumnName} in + + #{item} + + +#end + +#if($deleteInfo.isSupportDelete) +### 假删除 +#if(!${deleteInfo.isPhysicallyDeleted}) +#if($deleteInfo.deleteEnum == "Batch" || $deleteInfo.deleteEnum == "SingleAndBatch") + + + update ${tableName} set deleted_flag = #{deletedFlag} + where ${primaryKeyColumnName} in + + #{item} + + +#end +#if($deleteInfo.deleteEnum == "Single" || $deleteInfo.deleteEnum == "SingleAndBatch") + + + update ${tableName} set deleted_flag = #{deletedFlag} + where ${primaryKeyColumnName} = #{${primaryKeyFieldName}} + +#end +#end +#end + \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/resources/code-generator-template/java/service/Service.java.vm b/smart-admin-api/sa-common/src/main/resources/code-generator-template/java/service/Service.java.vm new file mode 100644 index 00000000..02f43a19 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/resources/code-generator-template/java/service/Service.java.vm @@ -0,0 +1,108 @@ +package ${packageName}; + +#foreach ($importClass in $importPackageList) +$importClass +#end +import net.lab1024.sa.common.common.util.SmartBeanUtil; +import net.lab1024.sa.common.common.util.SmartPageUtil; +import net.lab1024.sa.common.common.domain.ResponseDTO; +import net.lab1024.sa.common.common.domain.PageResult; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * ${basic.description} Service + * + * @Author ${basic.backendAuthor} + * @Date ${basic.backendDate} + * @Copyright ${basic.copyright} + */ + +@Service +public class ${name.upperCamel}Service { + + @Autowired + private ${name.upperCamel}Dao ${name.lowerCamel}Dao; + + /** + * 分页查询 + * + * @param queryForm + * @return + */ + public PageResult<${name.upperCamel}VO> queryPage(${name.upperCamel}QueryForm queryForm) { + Page page = SmartPageUtil.convert2PageQuery(queryForm); + List<${name.upperCamel}VO> list = ${name.lowerCamel}Dao.queryPage(page, queryForm); + PageResult<${name.upperCamel}VO> pageResult = SmartPageUtil.convert2PageResult(page, list); + return pageResult; + } + +#if($insertAndUpdate.isSupportInsertAndUpdate) + /** + * 添加 + */ + public ResponseDTO add(${name.upperCamel}AddForm addForm) { + ${name.upperCamel}Entity ${name.lowerCamel}Entity = SmartBeanUtil.copy(addForm, ${name.upperCamel}Entity.class); + ${name.lowerCamel}Dao.insert(${name.lowerCamel}Entity); + return ResponseDTO.ok(); + } + + /** + * 更新 + * + * @param updateForm + * @return + */ + public ResponseDTO update(${name.upperCamel}UpdateForm updateForm) { + ${name.upperCamel}Entity ${name.lowerCamel}Entity = SmartBeanUtil.copy(updateForm, ${name.upperCamel}Entity.class); + ${name.lowerCamel}Dao.updateById(${name.lowerCamel}Entity); + return ResponseDTO.ok(); + } +#end + +#if($deleteInfo.isSupportDelete) + #if($deleteInfo.deleteEnum == "BATCH" || $deleteInfo.deleteEnum == "SingleAndBatch") + /** + * 批量删除 + * + * @param idList + * @return + */ + public ResponseDTO batchDelete(List<${primaryKeyJavaType}> idList) { + if (CollectionUtils.isEmpty(idList)){ + return ResponseDTO.ok(); + } + +### 真删除 or 假删除 +#if(!${deleteInfo.isPhysicallyDeleted}) + ${name.lowerCamel}Dao.batchUpdateDeleted(idList, true); +#else + ${name.lowerCamel}Dao.deleteBatchIds(idList); +#end + return ResponseDTO.ok(); + } + #end + + #if($deleteInfo.deleteEnum == "Single" || $deleteInfo.deleteEnum == "SingleAndBatch") + /** + * 单个删除 + */ + public ResponseDTO delete(${primaryKeyJavaType} ${primaryKeyFieldName}) { + if (null == ${primaryKeyFieldName}){ + return ResponseDTO.ok(); + } + +### 真删除 or 假删除 +#if(!${deleteInfo.isPhysicallyDeleted}) + ${name.lowerCamel}Dao.updateDeleted(${primaryKeyFieldName},true); +#end +#if(${deleteInfo.isPhysicallyDeleted}) + ${name.lowerCamel}Dao.deleteById(${primaryKeyFieldName}); +#end + return ResponseDTO.ok(); + } + #end +#end +} diff --git a/smart-admin-api/sa-common/src/main/resources/code-generator-template/js/api.js.vm b/smart-admin-api/sa-common/src/main/resources/code-generator-template/js/api.js.vm new file mode 100644 index 00000000..b249d0c2 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/resources/code-generator-template/js/api.js.vm @@ -0,0 +1,78 @@ +/** + * ${basic.description} api 封装 + * + * @Author: ${basic.frontAuthor} + * @Date: ${basic.frontDate} + * @Copyright ${basic.copyright} + */ +import { postRequest, getRequest } from '/@/lib/axios'; + +export const ${name.lowerCamel}Api = { + + /** + * 分页查询 @author ${basic.frontAuthor} + */ + queryPage : (param) => { + return postRequest('/${name.lowerCamel}/queryPage', param); + }, + + /** + * 增加 @author ${basic.frontAuthor} + */ + add: (param) => { + return postRequest('/${name.lowerCamel}/add', param); + }, + + /** + * 修改 @author ${basic.frontAuthor} + */ + update: (param) => { + return postRequest('/${name.lowerCamel}/update', param); + }, +## ------------------ 详情 ------------------ + +#if($deleteInfo.isSupportDetail) + /** + * 获取详情 @author ${basic.frontAuthor} + */ + getDetail: (id) => { + return getRequest(`/${name.lowerCamel}/getDetail/\${id}`); + }, +#end + +## ------------------ 删除 ------------------ +#if($deleteInfo.isSupportDelete) + #if($deleteInfo.deleteEnum == 'Single') + /** + * 删除 @author ${basic.frontAuthor} + */ + delete: (id) => { + return getRequest(`/${name.lowerCamel}/delete/${id}`); + }, + #end + #if($deleteInfo.deleteEnum == 'Batch') + /** + * 批量删除 @author ${basic.frontAuthor} + */ + batchDelete: (idList) => { + return postRequest('/${name.lowerCamel}/batchDelete', idList); + }, + #end + #if($deleteInfo.deleteEnum == 'SingleAndBatch') + /** + * 删除 @author ${basic.frontAuthor} + */ + delete: (id) => { + return getRequest(`/${name.lowerCamel}/delete/${id}`); + }, + + /** + * 批量删除 @author ${basic.frontAuthor} + */ + batchDelete: (idList) => { + return postRequest('/${name.lowerCamel}/batchDelete', idList); + }, + #end +#end + +}; diff --git a/smart-admin-api/sa-common/src/main/resources/code-generator-template/js/const.js.vm b/smart-admin-api/sa-common/src/main/resources/code-generator-template/js/const.js.vm new file mode 100644 index 00000000..30ca06a3 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/resources/code-generator-template/js/const.js.vm @@ -0,0 +1,23 @@ +/** + * ${basic.description} 枚举 + * + * @Author: ${basic.frontAuthor} + * @Date: ${basic.frontDate} + * @Copyright ${basic.copyright} + */ + +#foreach ($enum in $enumList) + +/** + * $enum.columnComment + */ +export const $enum.upperUnderscoreEnum = { + +} +#end + +export default { +#foreach ($enum in $enumList) + $enum.upperUnderscoreEnum, +#end +}; \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/resources/code-generator-template/js/form.vue.vm b/smart-admin-api/sa-common/src/main/resources/code-generator-template/js/form.vue.vm new file mode 100644 index 00000000..e302c22c --- /dev/null +++ b/smart-admin-api/sa-common/src/main/resources/code-generator-template/js/form.vue.vm @@ -0,0 +1,181 @@ + + + diff --git a/smart-admin-api/sa-common/src/main/resources/code-generator-template/js/list.vue.vm b/smart-admin-api/sa-common/src/main/resources/code-generator-template/js/list.vue.vm new file mode 100644 index 00000000..a7d3fdf1 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/resources/code-generator-template/js/list.vue.vm @@ -0,0 +1,317 @@ + + + diff --git a/smart-admin-api/sa-common/src/main/resources/code-generator-template/tools.xml b/smart-admin-api/sa-common/src/main/resources/code-generator-template/tools.xml new file mode 100644 index 00000000..7f8f8681 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/resources/code-generator-template/tools.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/smart-admin-api/sa-common/src/main/resources/dev/sa-common.yaml b/smart-admin-api/sa-common/src/main/resources/dev/sa-common.yaml new file mode 100644 index 00000000..887fa286 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/resources/dev/sa-common.yaml @@ -0,0 +1,134 @@ +spring: + # 数据库连接信息 + datasource: + url: jdbc:p6spy:mysql://127.0.0.1:3306/smart_admin_v2?autoReconnect=true&useServerPreparedStmts=false&rewriteBatchedStatements=true&characterEncoding=UTF-8&useSSL=false&allowMultiQueries=true&serverTimezone=Asia/Shanghai + username: root + password: Zhuoda123456 + initial-size: 2 + min-idle: 2 + max-active: 10 + max-wait: 60000 + time-between-eviction-runs-millis: 60000 + min-evictable-idle-time-millis: 300000 + driver-class-name: com.p6spy.engine.spy.P6SpyDriver + filters: stat + druid: + username: druid + password: 1024 + login: + enabled: true + method: + pointcut: net.lab1024.sa..*Service.* + + # mvc swagger bugfix + mvc: + pathmatch: + matching-strategy: ant_path_matcher + + # redis 连接池配置信息 + redis: + database: 1 + host: 127.0.0.1 + lettuce: + pool: + max-active: 5 + min-idle: 1 + max-idle: 3 + max-wait: 30000ms + port: 6379 + timeout: 10000ms + password: + + # 上传文件大小配置 + servlet: + multipart: + max-file-size: 30MB + max-request-size: 30MB + + # json序列化相关配置 + jackson: + serialization: + write-enums-using-to-string: true + write-dates-as-timestamps: false + deserialization: + read-enums-using-to-string: true + fail-on-unknown-properties: false + default-property-inclusion: always + date-format: yyyy-MM-dd HH:mm:ss + time-zone: GMT+8 + + # 缓存实现类型 + cache: + type: caffeine + +# tomcat 配置,主要用于 配置 访问日志(便于将来排查错误) +server: + tomcat: + basedir: ${localPath:/home}/logs/smart_admin_v2/tomcat-logs + accesslog: + enabled: true + pattern: '%t %{X-Forwarded-For}i %a "%r" %s %D (%D ms)' + +#swagger: 提高swagger 方法名称有重复的日志提示 +logging: + level: + springfox: + documentation: + spring: + web: + readers: + operation: + CachingOperationNameGenerator: warn + scanners: + ApiListingReferenceScanner: warn + +# 文件上传 配置 +file: + storage: + mode: cloud + local: + path: ${localPath:/home}/smart_admin_v2/upload/ + cloud: + region: oss-cn-qingdao + endpoint: oss-cn-qingdao.aliyuncs.com + bucket-name: common-sit + access-key: + secret-key: + url: + expire: 7200000 + public: https://${file.storage.cloud.bucket-name}.${file.storage.cloud.endpoint}/ + +# swagger 配置 +swagger: + title: SmartAdmin + description: SmartAdmin 2.0 + version: 2.0 + host: localhost:${server.port} + package: net.lab1024.sa + tag-class: net.lab1024.sa.common.constant.SwaggerTagConst + team-url: https://www.1024lab.net/ + +# RestTemplate 请求配置 +http: + pool: + max-total: 20 + connect-timeout: 50000 + read-timeout: 50000 + write-timeout: 50000 + keep-alive: 300000 + +# token相关配置 +token: + key: sa-jwt-key + expire-day: 7 + +# 跨域配置 +access-control-allow-origin: '*' + +# 心跳配置 +heart-beat: + interval-seconds: 60 + +# 热加载配置 +reload: + interval-seconds: 60 \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/resources/mapper/support/ChangeLogMapper.xml b/smart-admin-api/sa-common/src/main/resources/mapper/support/ChangeLogMapper.xml new file mode 100644 index 00000000..7f5b7dbf --- /dev/null +++ b/smart-admin-api/sa-common/src/main/resources/mapper/support/ChangeLogMapper.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/resources/mapper/support/CodeGeneratorMapper.xml b/smart-admin-api/sa-common/src/main/resources/mapper/support/CodeGeneratorMapper.xml new file mode 100644 index 00000000..4376face --- /dev/null +++ b/smart-admin-api/sa-common/src/main/resources/mapper/support/CodeGeneratorMapper.xml @@ -0,0 +1,36 @@ + + + + + + + + + + \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/resources/mapper/support/ConfigMapper.xml b/smart-admin-api/sa-common/src/main/resources/mapper/support/ConfigMapper.xml new file mode 100644 index 00000000..1fb8474d --- /dev/null +++ b/smart-admin-api/sa-common/src/main/resources/mapper/support/ConfigMapper.xml @@ -0,0 +1,22 @@ + + + + + + + + + + \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/resources/mapper/support/DataTracerMapper.xml b/smart-admin-api/sa-common/src/main/resources/mapper/support/DataTracerMapper.xml new file mode 100644 index 00000000..546e62a5 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/resources/mapper/support/DataTracerMapper.xml @@ -0,0 +1,31 @@ + + + + + + + + + \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/resources/mapper/support/DictKeyMapper.xml b/smart-admin-api/sa-common/src/main/resources/mapper/support/DictKeyMapper.xml new file mode 100644 index 00000000..619269bb --- /dev/null +++ b/smart-admin-api/sa-common/src/main/resources/mapper/support/DictKeyMapper.xml @@ -0,0 +1,37 @@ + + + + + + update t_dict_key set deleted_flag = #{deletedFlag} where dict_key_id in + + #{item} + + + + + + + + + + \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/resources/mapper/support/DictValueMapper.xml b/smart-admin-api/sa-common/src/main/resources/mapper/support/DictValueMapper.xml new file mode 100644 index 00000000..6f0fbc15 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/resources/mapper/support/DictValueMapper.xml @@ -0,0 +1,44 @@ + + + + + + update t_dict_value set deleted_flag = #{deletedFlag} where dict_value_id in + + #{item} + + + + + + + + + + + \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/resources/mapper/support/FeedbackMapper.xml b/smart-admin-api/sa-common/src/main/resources/mapper/support/FeedbackMapper.xml new file mode 100644 index 00000000..740037a2 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/resources/mapper/support/FeedbackMapper.xml @@ -0,0 +1,26 @@ + + + + + + \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/resources/mapper/support/FileMapper.xml b/smart-admin-api/sa-common/src/main/resources/mapper/support/FileMapper.xml new file mode 100644 index 00000000..405f79f8 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/resources/mapper/support/FileMapper.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/resources/mapper/support/HeartBeatRecordMapper.xml b/smart-admin-api/sa-common/src/main/resources/mapper/support/HeartBeatRecordMapper.xml new file mode 100644 index 00000000..e37f08ab --- /dev/null +++ b/smart-admin-api/sa-common/src/main/resources/mapper/support/HeartBeatRecordMapper.xml @@ -0,0 +1,37 @@ + + + + + + + update t_heart_beat_record + set heart_beat_time = #{heartBeatTime} + + heart_beat_record_id = #{id} + + + + + + + + diff --git a/smart-admin-api/sa-common/src/main/resources/mapper/support/HelpDocDao.xml b/smart-admin-api/sa-common/src/main/resources/mapper/support/HelpDocDao.xml new file mode 100644 index 00000000..6bbbf5e3 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/resources/mapper/support/HelpDocDao.xml @@ -0,0 +1,130 @@ + + + + + + + + + + + + update t_help_doc + set page_view_count = page_view_count + #{pageViewCountIncrease}, + user_view_count = user_view_count + #{userViewCountIncrease} + where help_doc_id = #{helpDocId} + + + + + + + + + + insert into t_help_doc_relation + (relation_id, relation_name, help_doc_id) + values + + ( #{item.relationId} ,#{item.relationName}, #{helpDocId} ) + + + + + delete + from t_help_doc_relation + where help_doc_id = #{helpDocId} + + + + + + + + insert into t_help_doc_view_record (help_doc_id, user_id,user_name, first_ip, first_user_agent, page_view_count) + values (#{helpDocId}, #{userId},#{userName}, #{ip}, #{userAgent}, #{pageViewCount}) + + + update t_help_doc_view_record + set page_view_count = page_view_count + 1, + last_ip = #{ip}, + last_user_agent = #{userAgent} + where help_doc_id = #{helpDocId} + and user_id = #{userId} + + + + + \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/resources/mapper/support/LoginLogMapper.xml b/smart-admin-api/sa-common/src/main/resources/mapper/support/LoginLogMapper.xml new file mode 100644 index 00000000..6126a290 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/resources/mapper/support/LoginLogMapper.xml @@ -0,0 +1,37 @@ + + + + + + + + + \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/resources/mapper/support/OperateLogMapper.xml b/smart-admin-api/sa-common/src/main/resources/mapper/support/OperateLogMapper.xml new file mode 100644 index 00000000..e432a896 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/resources/mapper/support/OperateLogMapper.xml @@ -0,0 +1,37 @@ + + + + + + + + delete from t_operate_log where id = #{id} + + + + delete from t_operate_log where id in + + #{item} + + + + \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/resources/mapper/support/ReloadItemMapper.xml b/smart-admin-api/sa-common/src/main/resources/mapper/support/ReloadItemMapper.xml new file mode 100644 index 00000000..85b6ffb4 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/resources/mapper/support/ReloadItemMapper.xml @@ -0,0 +1,10 @@ + + + + + + + + \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/resources/mapper/support/ReloadResultMapper.xml b/smart-admin-api/sa-common/src/main/resources/mapper/support/ReloadResultMapper.xml new file mode 100644 index 00000000..a1f96b83 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/resources/mapper/support/ReloadResultMapper.xml @@ -0,0 +1,10 @@ + + + + + + + + \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/resources/mapper/support/SerialNumberMapper.xml b/smart-admin-api/sa-common/src/main/resources/mapper/support/SerialNumberMapper.xml new file mode 100644 index 00000000..3afd34a3 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/resources/mapper/support/SerialNumberMapper.xml @@ -0,0 +1,21 @@ + + + + + + update t_serial_number + set + last_number = #{lastNumber}, + last_time = #{lastTime} + where + serial_number_id = #{serialNumberId} + + + + + + + + \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/resources/mapper/support/SerialNumberRecordMapper.xml b/smart-admin-api/sa-common/src/main/resources/mapper/support/SerialNumberRecordMapper.xml new file mode 100644 index 00000000..f13636aa --- /dev/null +++ b/smart-admin-api/sa-common/src/main/resources/mapper/support/SerialNumberRecordMapper.xml @@ -0,0 +1,32 @@ + + + + + + update t_serial_number_record + set last_number = #{lastNumber}, + count = count + #{count} + where + serial_number_id = #{serialNumberId} + and + record_date = #{recordDate} + + + + + + + + \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/resources/mapper/support/TableColumnMapper.xml b/smart-admin-api/sa-common/src/main/resources/mapper/support/TableColumnMapper.xml new file mode 100644 index 00000000..530888b1 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/resources/mapper/support/TableColumnMapper.xml @@ -0,0 +1,18 @@ + + + + + delete + from t_table_column + where user_id = #{userId} + and table_id = #{tableId} + + + + \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/resources/pre/sa-common.yaml b/smart-admin-api/sa-common/src/main/resources/pre/sa-common.yaml new file mode 100644 index 00000000..059b6df2 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/resources/pre/sa-common.yaml @@ -0,0 +1,134 @@ +spring: + # 数据库连接信息 + datasource: + url: jdbc:p6spy:mysql://127.0.0.1:3306/smart_admin_v2_pre?autoReconnect=true&useServerPreparedStmts=false&rewriteBatchedStatements=true&characterEncoding=UTF-8&useSSL=false&allowMultiQueries=true&serverTimezone=Asia/Shanghai + username: root + password: Zhuoda123456 + initial-size: 5 + min-idle: 5 + max-active: 50 + max-wait: 60000 + time-between-eviction-runs-millis: 60000 + min-evictable-idle-time-millis: 300000 + driver-class-name: com.mysql.cj.jdbc.Driver + filters: stat + druid: + username: druid + password: 1024 + login: + enabled: true + method: + pointcut: net.lab1024.sa..*Service.* + + # mvc swagger bugfix + mvc: + pathmatch: + matching-strategy: ant_path_matcher + + # redis 连接池配置信息 + redis: + database: 1 + host: 127.0.0.1 + lettuce: + pool: + max-active: 50 + min-idle: 5 + max-idle: 5 + max-wait: 30000ms + port: 6379 + timeout: 10000ms + password: + + # 上传文件大小配置 + servlet: + multipart: + max-file-size: 30MB + max-request-size: 30MB + + # json序列化相关配置 + jackson: + serialization: + write-enums-using-to-string: true + write-dates-as-timestamps: false + deserialization: + read-enums-using-to-string: true + fail-on-unknown-properties: false + default-property-inclusion: always + date-format: yyyy-MM-dd HH:mm:ss + time-zone: GMT+8 + + # 缓存实现类型 + cache: + type: caffeine + +# tomcat 配置,主要用于 配置 访问日志(便于将来排查错误) +server: + tomcat: + basedir: ${localPath:/home}/logs/smart_admin_v2/tomcat-logs + accesslog: + enabled: true + pattern: '%t %{X-Forwarded-For}i %a "%r" %s %D (%D ms)' + +#swagger: 提高swagger 方法名称有重复的日志提示 +logging: + level: + springfox: + documentation: + spring: + web: + readers: + operation: + CachingOperationNameGenerator: warn + scanners: + ApiListingReferenceScanner: warn + +# 文件上传 配置 +file: + storage: + mode: cloud + local: + path: ${localPath:/home}/smart_admin_v2/upload/ + cloud: + region: oss-cn-qingdao + endpoint: oss-cn-qingdao.aliyuncs.com + bucket-name: common-sit + access-key: + secret-key: + url: + expire: 7200000 + public: https://${file.storage.cloud.bucket-name}.${file.storage.cloud.endpoint}/ + +# swagger 配置 +swagger: + title: SmartAdmin + description: SmartAdmin 2.0 + version: 2.0 + host: localhost:${server.port} + package: net.lab1024.sa + tag-class: net.lab1024.sa.common.constant.SwaggerTagConst + team-url: https://www.1024lab.net/ + +# RestTemplate 请求配置 +http: + pool: + max-total: 20 + connect-timeout: 50000 + read-timeout: 50000 + write-timeout: 50000 + keep-alive: 300000 + +# token相关配置 +token: + key: sa-jwt-key + expire-day: 7 + +# 跨域配置 +access-control-allow-origin: '*' + +# 心跳配置 +heart-beat: + interval-seconds: 60 + +# 热加载配置 +reload: + interval-seconds: 60 \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/resources/prod/sa-common.yaml b/smart-admin-api/sa-common/src/main/resources/prod/sa-common.yaml new file mode 100644 index 00000000..d4bf12d1 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/resources/prod/sa-common.yaml @@ -0,0 +1,134 @@ +spring: + # 数据库连接信息 + datasource: + url: jdbc:mysql://127.0.0.1:3306/smart_admin_v2_prod?autoReconnect=true&useServerPreparedStmts=false&rewriteBatchedStatements=true&characterEncoding=UTF-8&useSSL=false&allowMultiQueries=true&serverTimezone=Asia/Shanghai + username: root + password: Zhuoda123456 + initial-size: 10 + min-idle: 10 + max-active: 100 + max-wait: 60000 + time-between-eviction-runs-millis: 60000 + min-evictable-idle-time-millis: 300000 + driver-class-name: com.mysql.cj.jdbc.Driver + filters: stat + druid: + username: druid + password: 1024 + login: + enabled: true + method: + pointcut: net.lab1024.sa..*Service.* + + # mvc swagger bugfix + mvc: + pathmatch: + matching-strategy: ant_path_matcher + + # redis 连接池配置信息 + redis: + database: 1 + host: 127.0.0.1 + lettuce: + pool: + max-active: 100 + min-idle: 10 + max-idle: 10 + max-wait: 30000ms + port: 6379 + timeout: 10000ms + password: + + # 上传文件大小配置 + servlet: + multipart: + max-file-size: 30MB + max-request-size: 30MB + + # json序列化相关配置 + jackson: + serialization: + write-enums-using-to-string: true + write-dates-as-timestamps: false + deserialization: + read-enums-using-to-string: true + fail-on-unknown-properties: false + default-property-inclusion: always + date-format: yyyy-MM-dd HH:mm:ss + time-zone: GMT+8 + + # 缓存实现类型 + cache: + type: caffeine + +# tomcat 配置,主要用于 配置 访问日志(便于将来排查错误) +server: + tomcat: + basedir: ${localPath:/home}/logs/smart_admin_v2/tomcat-logs + accesslog: + enabled: true + pattern: '%t %{X-Forwarded-For}i %a "%r" %s %D (%D ms)' + +#swagger: 提高swagger 方法名称有重复的日志提示 +logging: + level: + springfox: + documentation: + spring: + web: + readers: + operation: + CachingOperationNameGenerator: warn + scanners: + ApiListingReferenceScanner: warn + +# 文件上传 配置 +file: + storage: + mode: cloud + local: + path: ${localPath:/home}/smart_admin_v2/upload/ + cloud: + region: oss-cn-qingdao + endpoint: oss-cn-qingdao.aliyuncs.com + bucket-name: common-sit + access-key: + secret-key: + url: + expire: 7200000 + public: https://${file.storage.cloud.bucket-name}.${file.storage.cloud.endpoint}/ + +# swagger 配置 +swagger: + title: SmartAdmin + description: SmartAdmin 2.0 + version: 2.0 + host: localhost:${server.port} + package: net.lab1024.sa + tag-class: net.lab1024.sa.common.constant.SwaggerTagConst + team-url: https://www.1024lab.net/ + +# RestTemplate 请求配置 +http: + pool: + max-total: 20 + connect-timeout: 50000 + read-timeout: 50000 + write-timeout: 50000 + keep-alive: 300000 + +# token相关配置 +token: + key: sa-jwt-key + expire-day: 7 + +# 跨域配置 +access-control-allow-origin: '*' + +# 心跳配置 +heart-beat: + interval-seconds: 60 + +# 热加载配置 +reload: + interval-seconds: 60 \ No newline at end of file diff --git a/smart-admin-api/sa-common/src/main/resources/test/sa-common.yaml b/smart-admin-api/sa-common/src/main/resources/test/sa-common.yaml new file mode 100644 index 00000000..29439a18 --- /dev/null +++ b/smart-admin-api/sa-common/src/main/resources/test/sa-common.yaml @@ -0,0 +1,134 @@ +spring: + # 数据库连接信息 + datasource: + url: jdbc:p6spy:mysql://127.0.0.1:3306/smart_admin_v2_test?autoReconnect=true&useServerPreparedStmts=false&rewriteBatchedStatements=true&characterEncoding=UTF-8&useSSL=false&allowMultiQueries=true&serverTimezone=Asia/Shanghai + username: root + password: Zhuoda123456 + initial-size: 2 + min-idle: 5 + max-active: 20 + max-wait: 60000 + time-between-eviction-runs-millis: 60000 + min-evictable-idle-time-millis: 300000 + driver-class-name: com.p6spy.engine.spy.P6SpyDriver + filters: stat + druid: + username: druid + password: 1024 + login: + enabled: true + method: + pointcut: net.lab1024.sa..*Service.* + + # mvc swagger bugfix + mvc: + pathmatch: + matching-strategy: ant_path_matcher + + # redis 连接池配置信息 + redis: + database: 1 + host: 127.0.0.1 + lettuce: + pool: + max-active: 10 + min-idle: 1 + max-idle: 3 + max-wait: 30000ms + port: 6379 + timeout: 10000ms + password: + + # 上传文件大小配置 + servlet: + multipart: + max-file-size: 30MB + max-request-size: 30MB + + # json序列化相关配置 + jackson: + serialization: + write-enums-using-to-string: true + write-dates-as-timestamps: false + deserialization: + read-enums-using-to-string: true + fail-on-unknown-properties: false + default-property-inclusion: always + date-format: yyyy-MM-dd HH:mm:ss + time-zone: GMT+8 + + # 缓存实现类型 + cache: + type: caffeine + +# tomcat 配置,主要用于 配置 访问日志(便于将来排查错误) +server: + tomcat: + basedir: ${localPath:/home}/logs/smart_admin_v2/tomcat-logs + accesslog: + enabled: true + pattern: '%t %{X-Forwarded-For}i %a "%r" %s %D (%D ms)' + +#swagger: 提高swagger 方法名称有重复的日志提示 +logging: + level: + springfox: + documentation: + spring: + web: + readers: + operation: + CachingOperationNameGenerator: warn + scanners: + ApiListingReferenceScanner: warn + +# 文件上传 配置 +file: + storage: + mode: cloud + local: + path: ${localPath:/home}/smart_admin_v2/upload/ + cloud: + region: oss-cn-qingdao + endpoint: oss-cn-qingdao.aliyuncs.com + bucket-name: common-sit + access-key: + secret-key: + url: + expire: 7200000 + public: https://${file.storage.cloud.bucket-name}.${file.storage.cloud.endpoint}/ + +# swagger 配置 +swagger: + title: SmartAdmin + description: SmartAdmin 2.0 + version: 2.0 + host: localhost:${server.port} + package: net.lab1024.sa + tag-class: net.lab1024.sa.common.constant.SwaggerTagConst + team-url: https://www.1024lab.net/ + +# RestTemplate 请求配置 +http: + pool: + max-total: 20 + connect-timeout: 50000 + read-timeout: 50000 + write-timeout: 50000 + keep-alive: 300000 + +# token相关配置 +token: + key: sa-jwt-key + expire-day: 7 + +# 跨域配置 +access-control-allow-origin: '*' + +# 心跳配置 +heart-beat: + interval-seconds: 60 + +# 热加载配置 +reload: + interval-seconds: 60 \ No newline at end of file diff --git a/smart-admin-h5/.browserslistrc b/smart-admin-h5/.browserslistrc deleted file mode 100644 index d6471a38..00000000 --- a/smart-admin-h5/.browserslistrc +++ /dev/null @@ -1,2 +0,0 @@ -> 1% -last 2 versions diff --git a/smart-admin-h5/.editorconfig b/smart-admin-h5/.editorconfig deleted file mode 100644 index 4881e66d..00000000 --- a/smart-admin-h5/.editorconfig +++ /dev/null @@ -1,15 +0,0 @@ -root = true - -[*] -# 字符 -charset = utf-8 -# 空格 -indent_style = space -# 2个空格缩进 -indent_size = 2 -# 换行符 -end_of_line = lf -# 文件的最后插入一个空行 -insert_final_newline = true -# 删除行尾的空格 -trim_trailing_whitespace = true diff --git a/smart-admin-h5/.env.development b/smart-admin-h5/.env.development deleted file mode 100644 index b698907c..00000000 --- a/smart-admin-h5/.env.development +++ /dev/null @@ -1,3 +0,0 @@ -NODE_ENV = development -VUE_APP_ENV = dev -VUE_APP_URL = http://127.0.0.1:10086/smart-admin-api diff --git a/smart-admin-h5/.env.local b/smart-admin-h5/.env.local deleted file mode 100644 index 6d07d04c..00000000 --- a/smart-admin-h5/.env.local +++ /dev/null @@ -1,3 +0,0 @@ -NODE_ENV = development -VUE_APP_ENV = local -VUE_APP_URL = http://127.0.0.1:10086/smart-admin-api diff --git a/smart-admin-h5/.env.pre b/smart-admin-h5/.env.pre deleted file mode 100644 index 80c46b0e..00000000 --- a/smart-admin-h5/.env.pre +++ /dev/null @@ -1,3 +0,0 @@ -NODE_ENV = production -VUE_APP_ENV = pre -VUE_APP_URL = http://smartadmin.1024lab.net/smart-admin-api diff --git a/smart-admin-h5/.env.prod b/smart-admin-h5/.env.prod deleted file mode 100644 index 0e1616d4..00000000 --- a/smart-admin-h5/.env.prod +++ /dev/null @@ -1,3 +0,0 @@ -NODE_ENV = production -VUE_APP_ENV = prod -VUE_APP_URL = http://smartadmin.1024lab.net/smart-admin-api diff --git a/smart-admin-h5/.env.sit b/smart-admin-h5/.env.sit deleted file mode 100644 index 411bc968..00000000 --- a/smart-admin-h5/.env.sit +++ /dev/null @@ -1,3 +0,0 @@ -NODE_ENV = production -VUE_APP_ENV = sit -VUE_APP_URL = http://smartadmin.1024lab.net/smart-admin-api diff --git a/smart-admin-h5/.eslintignore b/smart-admin-h5/.eslintignore deleted file mode 100644 index 7c435adc..00000000 --- a/smart-admin-h5/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ - -# 忽略项目中某些文件的提交代码规范 - -build/*.js -src/assets -public -dist diff --git a/smart-admin-h5/.eslintrc.js b/smart-admin-h5/.eslintrc.js deleted file mode 100644 index 27350869..00000000 --- a/smart-admin-h5/.eslintrc.js +++ /dev/null @@ -1,232 +0,0 @@ -module.exports = { - root: true, - env: { - node: true - }, - extends: [ - 'plugin:vue/essential', - 'eslint:recommended' - ], - parserOptions: { - parser: 'babel-eslint' - }, - rules: { - // 具体请看 https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/max-attributes-per-line.md - 'vue/max-attributes-per-line': [ - 2, - { - singleline: 10, - multiline: { - max: 1, - allowFirstLine: false - } - } - ], - // 在单行元素的内容前后需要换行符 - 'vue/singleline-html-element-content-newline': 'off', - // 在多行元素的内容之前和之后需要换行符 - 'vue/multiline-html-element-content-newline': 'off', - // JS/JSX中的组件名应该 大写驼峰 命名法 - 'vue/name-property-casing': ['error', 'PascalCase'], - // 给v-for设置键值,与key结合使用,可以高效的更新虚拟DOM - "vue/require-v-for-key": 1, - 'vue/no-v-html': 'off', - // 在对象中强制使用getter/setter - 'accessor-pairs': 2, - // 在箭头函数之前/之后需要空格 - 'arrow-spacing': [ - 2, - { - before: true, - after: true - } - ], - // 在打开块之后和关闭块之前,禁止或强制执行块内部的空格 - 'block-spacing': [2, 'always'], - // 需要大括号样式 - 'brace-style': [ - 2, - '1tbs', - { - allowSingleLine: true - } - ], - // 需要驼峰命名 - camelcase: [ - 0, - { - properties: 'always' - } - ], - // 要求或禁止使用尾随逗号;最后一个属性是不需要逗号 - 'comma-dangle': [2, 'never'], - // 强制逗号旁边的间距: 左右一个空格 - 'comma-spacing': [ - 2, - { - before: false, - after: true - } - ], - // 逗号风格 - 'comma-style': [2, 'last'], - // 构建方法中使用super方法 - 'constructor-super': 2, - curly: [2, 'multi-line'], - // 在dot之前和之后强制换行 - 'dot-location': [2, 'property'], - // 在文件末尾要求或禁止换行 - 'eol-last': 2, - // 是否使用全等 - eqeqeq: ['error', 'always', { null: 'ignore' }], - // 在生成器函数中强制执行*周围的间距 - 'generator-star-spacing': [2, { - 'before': true, - 'after': true - }], - // 强制执行回调错误处理 - 'handle-callback-err': [1, '^(err|error)$'], - // 强制执行一致的缩进 - 'indent': [2, 2, { - 'SwitchCase': 1 - }], - // 强制在JSX文件中一致使用单引号 - 'jsx-quotes': [2, 'prefer-single'], - // 在对象属性中强制键和值之间的一致间距 - 'key-spacing': [2, { - 'beforeColon': false, - 'afterColon': true - }], - // 关键字前后强制执行一致的间距 - 'keyword-spacing': [2, { - 'before': true, - 'after': true - }], - // 要求构造函数名称以大写字母开头 - 'new-cap': [2, { - 'newIsCap': true, - 'capIsNew': false - }], - 'new-parens': 2, // 调用不带参数的函数时需要括号 - 'no-array-constructor': 2, // 禁止阵列构建器 - 'no-caller': 2, // 禁止使用来电者/被叫者 - 'no-console': 'off', // 不允许使用控制台 - 'no-class-assign': 2, // 禁止修改类声明的变量 - 'no-cond-assign': 2, // 在条件语句中禁止赋值运算符 - 'no-const-assign': 2, // 禁止修改使用const声明的变量 - 'no-control-regex': 0, // 禁止正则表达式中的控制字符 - 'no-delete-var': 2, // 禁止删除变量 - 'no-dupe-args': 2, // 在函数定义中禁止重复参数 - 'no-dupe-class-members': 2, // 禁止在类成员中重复名称 - 'no-dupe-keys': 2, // 禁止对象重复声明属性 - 'no-duplicate-case': 2, // 规则禁止重复案例标签 - 'no-empty-character-class': 2, // 禁止在正则表达式中使用空字符类 - 'no-empty-pattern': 2, // 不允许空的解构模式 - 'no-eval': 2, // 禁止使用eval() - 'no-ex-assign': 2, // 禁止在catch子句中重新分配异常 - 'no-extend-native': 2, // 禁止扩展原生对象 - 'no-extra-bind': 2, // 禁止不必要的功能绑定 - 'no-extra-boolean-cast': 2, // 禁止不必要的布尔类型转换 - 'no-extra-parens': [2, 'functions'], // 禁止不必要的括号 - 'no-fallthrough': 2, // 禁止太多陈述描述 - 'no-floating-decimal': 2, // 禁止浮动小数 - 'no-func-assign': 2, // 禁止重新分配函数声明 - 'no-implied-eval': 2, - 'no-inner-declarations': [2, 'functions'], // 禁止嵌套块中的变量或函数声明 - 'no-invalid-regexp': 2, // 禁止在RegExp中使用无效的正则表达式字符串 - 'no-irregular-whitespace': 2, // 不允许不规则的空白 - 'no-iterator': 2, // 禁止迭代器 - 'no-label-var': 2, // 禁止变量名称的标签 - 'no-labels': [2, { - 'allowLoop': false, - 'allowSwitch': false - }], - 'no-lone-blocks': 2, // 禁止不必要的嵌套块 - 'no-mixed-spaces-and-tabs': 2, // 禁止使用混合空格和制表符进行缩进 - 'no-multi-spaces': 2, // 禁止多个空格 - 'no-multi-str': 2, // 禁止多行字符串 - 'no-multiple-empty-lines': [2, { // 禁止多个空行 - 'max': 1 - }], - 'no-native-reassign': 2, - 'no-negated-in-lhs': 2, - 'no-new-object': 2, - 'no-new-require': 2, - 'no-new-symbol': 2, - 'no-new-wrappers': 2, - 'no-obj-calls': 2, - 'no-octal': 2, - 'no-octal-escape': 2, - 'no-path-concat': 2, - 'no-proto': 2, - 'no-redeclare': 2, - 'no-regex-spaces': 2, - 'no-return-assign': [2, 'except-parens'], - 'no-self-assign': 2, - 'no-self-compare': 2, - 'no-sequences': 2, - 'no-shadow-restricted-names': 2, - 'no-spaced-func': 2, - 'no-sparse-arrays': 2, - 'no-this-before-super': 2, - 'no-throw-literal': 2, - 'no-trailing-spaces': 2, - 'no-undef': 0, - 'no-undef-init': 2, - 'no-unexpected-multiline': 2, - 'no-unmodified-loop-condition': 2, // 禁止未修改的循环条件 - 'no-unneeded-ternary': [2, { // 当存在更简单的替代方案时,不允许三元运算符 - 'defaultAssignment': false - }], - 'no-unreachable': 2, // 返回,抛出,继续和中断语句后禁止无法访问的代码 - 'no-unsafe-finally': 2, // 禁止finally块中的控制流语句 - 'no-unused-vars': [2, { // 禁止使用未声明的变量 - 'vars': 'all', - 'args': 'none' - }], - 'no-useless-call': 2, // 禁止不必要的call()和apply()方法 - 'no-useless-computed-key': 2, // 禁止在对象上使用不必要的计算属性键 - 'no-useless-constructor': 2, // 禁止不必要的构造方法 - 'no-useless-escape': 0, // 禁止不必要的转义用法 - 'no-whitespace-before-property': 2, // 在属性之前禁止空格 - 'no-with': 2, - 'one-var': [2, { - 'initialized': 'never' - }], - 'operator-linebreak': [2, 'after', { // 为维护强制执行一致的换行方式 - 'overrides': { - '?': 'before', - ':': 'before' - } - }], - 'padded-blocks': [2, 'never'], // 在块内要求或禁止填充 - 'quotes': [2, 'single', { - 'avoidEscape': true, - 'allowTemplateLiterals': true - }], - semi: ["error", "always"], - 'space-before-blocks': [2, 'always'], // 不要存在多余的块空间 - 'space-before-function-paren': [2, 'never'], - 'space-in-parens': [2, 'never'], - 'space-infix-ops': 2, - 'space-unary-ops': [2, { - 'words': true, - 'nonwords': false - }], - 'spaced-comment': [2, 'always', { - 'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ','] - }], - 'template-curly-spacing': [2, 'never'], - 'use-isnan': 2, - 'valid-typeof': 2, - 'wrap-iife': [2, 'any'], - 'yield-star-spacing': [2, 'both'], - 'yoda': [2, 'never'], - 'prefer-const': 1, - 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, - 'object-curly-spacing': [2, 'always', { - objectsInObjects: false - }], - 'array-bracket-spacing': [2, 'never'] - } -} diff --git a/smart-admin-h5/.gitignore b/smart-admin-h5/.gitignore deleted file mode 100644 index 24d694ca..00000000 --- a/smart-admin-h5/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -node_modules -/dist - -# Log files -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# Editor directories and files -.DS_Store -.idea -.vscode -*.suo -*.ntvs* -*.njsproj -*.sln -*.sw? - -package-lock.json -yarn.lock - -build/env.js diff --git a/smart-admin-h5/.postcssrc.js b/smart-admin-h5/.postcssrc.js deleted file mode 100644 index e2783a57..00000000 --- a/smart-admin-h5/.postcssrc.js +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = { - plugins: { - autoprefixer: { - overrideBrowserslist: ['Android 4.1', 'iOS 7.1', 'Chrome > 31', 'ff > 31', 'ie >= 8'] - }, - 'postcss-pxtorem': { - rootValue: 37.5, - propList: ['*'], - } - } -} diff --git a/smart-admin-h5/.prettierrc.js b/smart-admin-h5/.prettierrc.js deleted file mode 100644 index c19422ec..00000000 --- a/smart-admin-h5/.prettierrc.js +++ /dev/null @@ -1,31 +0,0 @@ -module.exports = { - // 缩进字节数 - tabWidth: 2, - // 使用单引号代替双引号 - singleQuote: true, - // 在对象或数组最后一个元素后面是否加逗号(在ES5中加尾逗号) - trailingComma: 'none', - // 句尾添加分号 - semi: true, - // 默认值。因为使用了一些折行敏感型的渲染器(如GitHub comment)而按照markdown文本样式进行折行 - proseWrap: 'always', - // (x) => {} 箭头函数参数只有一个时是否要有小括号。avoid:省略括号 - arrowParens: 'avoid', - // 在对象,数组括号与文字之间加空格 "{ foo: bar }" - bracketSpacing: true, - // 在jsx中把'>' 是否单独放一行 - jsxBracketSameLine: false, - // 缩进不使用tab,使用空格 - useTabs: false, - // 不让prettier使用eslint的代码格式进行校验 - eslintIntegration: true, - overrides: [ - { - files: '.prettierrc', - options: { - parser: 'json' - } - } - ], - endOfLine: 'auto' -} diff --git a/smart-admin-h5/.sentryclirc b/smart-admin-h5/.sentryclirc deleted file mode 100644 index b6f61dbd..00000000 --- a/smart-admin-h5/.sentryclirc +++ /dev/null @@ -1,7 +0,0 @@ -[defaults] -url = https://sentry.1024lab.net/ -org = 1024lab-sentry -project = smart-admin-h5 - -[auth] -token = 8dflijsldjkasdo3u49230948pkjdasoia8023jl3k4jr29o81029i40534p545ke diff --git a/smart-admin-h5/README.md b/smart-admin-h5/README.md deleted file mode 100644 index c5f8fa10..00000000 --- a/smart-admin-h5/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# SmartAdmin-H5 - -#### 介绍 -SmartAdmin-H5 是SmartAdmin 平台的移动端web项目 diff --git a/smart-admin-h5/babel.config.js b/smart-admin-h5/babel.config.js deleted file mode 100644 index 58b18fe8..00000000 --- a/smart-admin-h5/babel.config.js +++ /dev/null @@ -1,16 +0,0 @@ - -module.exports = { - presets: [['@vue/cli-plugin-babel/preset', {useBuiltIns: 'usage', corejs: 3}]], - plugins:[ - // vant-ui 按需引入,详情:https://github.com/ElementUI/babel-plugin-component - // [ - // 'import', - // { - // libraryName: 'vant', - // libraryDirectory: 'es', - // style: true - // }, - // 'vant' - // ] - ] -}; diff --git a/smart-admin-h5/package.json b/smart-admin-h5/package.json deleted file mode 100644 index cd09ecb3..00000000 --- a/smart-admin-h5/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "smart-admin-h5", - "version": "1.0.0", - "description": "基于vue和vant的h5模板", - "author": "zhuoluodada@qq.com", - "private": true, - "scripts": { - "local": "vue-cli-service serve --open --mode local", - "dev": "vue-cli-service serve --open", - "build": "vue-cli-service build", - "build:sit": "vue-cli-service build --mode sit", - "build:pre": "vue-cli-service build --mode pre", - "build:prod": "vue-cli-service build --mode prod", - "stage": "vue-cli-service build --mode staging", - "lint": "vue-cli-service lint" - }, - "dependencies": { - "@sentry/browser": "^5.13.2", - "@sentry/integrations": "^5.13.2", - "axios": "^0.19.2", - "core-js": "^3.6.5", - "fastclick": "^1.0.6", - "js-cookie": "^2.2.1", - "lib-flexible": "^0.3.2", - "lodash": "^4.17.20", - "moment": "^2.29.0", - "nprogress": "^0.2.0", - "regenerator-runtime": "^0.13.5", - "vant": "^2.11.1", - "vue": "^2.6.12", - "vue-enum": "^1.0.5", - "vue-loading-overlay": "^3.4.2", - "vue-router": "^3.4.0", - "vuex": "^3.6.0" - }, - "devDependencies": { - "@sentry/webpack-plugin": "^1.11.1", - "@vue/cli-plugin-babel": "~4.5.0", - "@vue/cli-plugin-eslint": "~4.5.0", - "@vue/cli-plugin-router": "~4.5.0", - "@vue/cli-plugin-vuex": "~4.5.0", - "@vue/cli-service": "~4.5.0", - "babel-eslint": "^10.1.0", - "babel-plugin-import": "^1.13.0", - "babel-plugin-transform-remove-console": "^6.9.4", - "compression-webpack-plugin": "^3.1.0", - "eslint": "^6.7.2", - "eslint-plugin-vue": "^6.2.2", - "node-sass": "^4.14.1", - "postcss-pxtorem": "^5.1.1", - "sass": "^1.3.0", - "sass-loader": "^9.0.3", - "script-ext-html-webpack-plugin": "^2.1.5", - "uglifyjs-webpack-plugin": "^2.2.0", - "vue-template-compiler": "^2.6.12", - "webpack-bundle-analyzer": "^4.2.0" - } -} diff --git a/smart-admin-h5/public/index.html b/smart-admin-h5/public/index.html deleted file mode 100644 index 5f5a1f86..00000000 --- a/smart-admin-h5/public/index.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - <% if (process.env.NODE_ENV === 'production') { %> - <% for(var css of htmlWebpackPlugin.options.cdn.css) { %> - - - <% } %> <% for(var js of htmlWebpackPlugin.options.cdn.js) { %> - - - <% } %> <% } %> - - - - <% if (process.env.NODE_ENV === 'development') { %> - - <% } %> - - - - - - <%= htmlWebpackPlugin.options.title %> - - - - - -

- - - diff --git a/smart-admin-h5/src/App.vue b/smart-admin-h5/src/App.vue deleted file mode 100644 index f3b5bda4..00000000 --- a/smart-admin-h5/src/App.vue +++ /dev/null @@ -1,16 +0,0 @@ - - - - diff --git a/smart-admin-h5/src/api/employee.js b/smart-admin-h5/src/api/employee.js deleted file mode 100644 index 76f30459..00000000 --- a/smart-admin-h5/src/api/employee.js +++ /dev/null @@ -1,43 +0,0 @@ -import { postAxios, getAxios } from '@/lib/http'; -export const employeeApi = { - // 员工管理查询 - getEmployeeList: (data) => { - return postAxios('admin/employee/query', data); - }, - // 添加员工 - addEmployee: (data) => { - return postAxios('admin/employee/add', data); - }, - // 更新员工信息 - updateEmployee: (data) => { - return postAxios('admin/employee/update', data); - }, - // 禁用启用单个员工 - updateStatus: (employeeId, status) => { - return getAxios('admin/employee/updateStatus/' + employeeId + '/' + status); - }, - // 批量禁用 - updateStatusBatch: (data) => { - return postAxios('admin/employee/batchUpdateStatus', data); - }, - // 单个员工角色授权 - updateRoles: (data) => { - return postAxios('admin/employee/updateRoles', data); - }, - // 修改密码 - updatePwd: (data) => { - return postAxios('admin/employee/updatePwd', data); - }, - // 重置密码 - resetPassword: (employeeId) => { - return getAxios('admin/employee/resetPasswd/' + employeeId); - }, - // 通过部门id获取当前部门的人员&没有部门的人 - getListEmployeeByDeptId: (departmentId) => { - return getAxios('admin/employee/listEmployeeByDeptId/' + departmentId); - }, - // 删除员工 - deleteEmployee: (employeeId) => { - return postAxios('admin/employee/delete/' + employeeId); - } -}; diff --git a/smart-admin-h5/src/api/file.js b/smart-admin-h5/src/api/file.js deleted file mode 100644 index 2bc1a85a..00000000 --- a/smart-admin-h5/src/api/file.js +++ /dev/null @@ -1,14 +0,0 @@ -import { postAxios, getAxios } from '@/lib/http'; -import config from '@/config'; -import Cookies from '@/lib/cookie'; -const baseUrl = config.baseUrl.apiUrl; - -export const fileApi = { - // 文件上传 - fileUpload: (folder, data) => { - const url = baseUrl + '/common/file/upload/' + folder + '?x-access-token=' + Cookies.getToken(); - return postAxios(url, data, { - headers: { 'Content-Type': 'multipart/form-data' } - }); - } -}; diff --git a/smart-admin-h5/src/api/login.js b/smart-admin-h5/src/api/login.js deleted file mode 100644 index aad9ae16..00000000 --- a/smart-admin-h5/src/api/login.js +++ /dev/null @@ -1,10 +0,0 @@ -import { getAxios, postAxios } from '@/lib/http'; - -export const loginApi = { - login: (data) => { - return postAxios('/session/login', data); - }, - logout: (token) => { - return getAxios(`/session/logOut?x-access-token=${token}`); - } -}; diff --git a/smart-admin-h5/src/api/system-config.js b/smart-admin-h5/src/api/system-config.js deleted file mode 100644 index a9384d21..00000000 --- a/smart-admin-h5/src/api/system-config.js +++ /dev/null @@ -1,31 +0,0 @@ -// 系统参数API -import { - postAxios, - getAxios -} from '@/lib/http'; -export const systemConfigApi = { - // 查询系统参数列表 - getSystemConfigList: (data) => { - return postAxios('/admin/systemConfig/getListPage', data); - }, - // 添加系统参数 - addSystemConfig: (data) => { - return postAxios('/admin/systemConfig/add', data); - }, - // 更新单条系统参数 - updateSystemConfig: (data) => { - return postAxios('/admin/systemConfig/update', data); - }, - // 通过key获取对应的信息 - getConfigListByKey: (key) => { - return getAxios(`/admin/systemConfig/selectByKey?configKey=${key}`); - }, - // 根据分组查询所有系统配置 - getListByGroup: (group) => { - return getAxios(`/admin/systemConfig/getListByGroup?group=${group}`); - }, - // 获取系统版本信息 - getCodeVersion: () => { - return getAxios('/admin/codeVersion'); - } -}; diff --git a/smart-admin-h5/src/api/user.js b/smart-admin-h5/src/api/user.js deleted file mode 100644 index 7d2b2a83..00000000 --- a/smart-admin-h5/src/api/user.js +++ /dev/null @@ -1,7 +0,0 @@ -import { getAxios } from '@/lib/http'; - -export const userApi = { - getSession: () => { - return getAxios('/session/get'); - } -}; diff --git a/smart-admin-h5/src/assets/css/index.scss b/smart-admin-h5/src/assets/css/index.scss deleted file mode 100644 index 27597440..00000000 --- a/smart-admin-h5/src/assets/css/index.scss +++ /dev/null @@ -1,5 +0,0 @@ -$text-color: #323233; -$border-color: #ebedf0; -$active-color: #f2f3f5; -$background-color: #f7f8fa; -$background-color-light: #fafafa; diff --git a/smart-admin-h5/src/assets/logo.png b/smart-admin-h5/src/assets/logo.png deleted file mode 100644 index f3d2503fc2a44b5053b0837ebea6e87a2d339a43..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6849 zcmaKRcUV(fvo}bjDT-7nLI_nlK}sT_69H+`qzVWDA|yaU?}j417wLi^B1KB1SLsC& zL0ag7$U(XW5YR7p&Ux?sP$d4lvMt8C^+TcQu4F zQqv!UF!I+kw)c0jhd6+g6oCr9P?7)?!qX1ui*iL{p}sKCAGuJ{{W)0z1pLF|=>h}& zt(2Lr0Z`2ig8<5i%Zk}cO5Fm=LByqGWaS`oqChZdEFmc`0hSb#gg|Aap^{+WKOYcj zHjINK)KDG%&s?Mt4CL(T=?;~U@bU2x_mLKN!#GJuK_CzbNw5SMEJorG!}_5;?R>@1 zSl)jns3WlU7^J%=(hUtfmuUCU&C3%8B5C^f5>W2Cy8jW3#{Od{lF1}|?c61##3dzA zsPlFG;l_FzBK}8>|H_Ru_H#!_7$UH4UKo3lKOA}g1(R&|e@}GINYVzX?q=_WLZCgh z)L|eJMce`D0EIwgRaNETDsr+?vQknSGAi=7H00r`QnI%oQnFxm`G2umXso9l+8*&Q z7WqF|$p49js$mdzo^BXpH#gURy=UO;=IMrYc5?@+sR4y_?d*~0^YP7d+y0{}0)zBM zIKVM(DBvICK#~7N0a+PY6)7;u=dutmNqK3AlsrUU9U`d;msiucB_|8|2kY=(7XA;G zwDA8AR)VCA#JOkxm#6oHNS^YVuOU;8p$N)2{`;oF|rQ?B~K$%rHDxXs+_G zF5|-uqHZvSzq}L;5Kcy_P+x0${33}Ofb6+TX&=y;;PkEOpz%+_bCw_{<&~ zeLV|!bP%l1qxywfVr9Z9JI+++EO^x>ZuCK);=$VIG1`kxK8F2M8AdC$iOe3cj1fo(ce4l-9 z7*zKy3={MixvUk=enQE;ED~7tv%qh&3l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CBsdXFB1+adOO)03+nczfWa#vwk#r{o{dF)QWya9v2nv43Zp3%Ps}($lA02*_g25t;|T{A5snSY?3A zrRQ~(Ygh_ebltHo1VCbJb*eOAr;4cnlXLvI>*$-#AVsGg6B1r7@;g^L zFlJ_th0vxO7;-opU@WAFe;<}?!2q?RBrFK5U{*ai@NLKZ^};Ul}beukveh?TQn;$%9=R+DX07m82gP$=}Uo_%&ngV`}Hyv8g{u z3SWzTGV|cwQuFIs7ZDOqO_fGf8Q`8MwL}eUp>q?4eqCmOTcwQuXtQckPy|4F1on8l zP*h>d+cH#XQf|+6c|S{7SF(Lg>bR~l(0uY?O{OEVlaxa5@e%T&xju=o1`=OD#qc16 zSvyH*my(dcp6~VqR;o(#@m44Lug@~_qw+HA=mS#Z^4reBy8iV?H~I;{LQWk3aKK8$bLRyt$g?- - -
- - - -
- 全选 - 反选 -
- - - - - - diff --git a/smart-admin-h5/src/components/form/select-picker/SmartEnumSelectPicker.vue b/smart-admin-h5/src/components/form/select-picker/SmartEnumSelectPicker.vue deleted file mode 100644 index 976211d1..00000000 --- a/smart-admin-h5/src/components/form/select-picker/SmartEnumSelectPicker.vue +++ /dev/null @@ -1,61 +0,0 @@ - - - - diff --git a/smart-admin-h5/src/components/form/select-picker/SmartSelectPicker b/smart-admin-h5/src/components/form/select-picker/SmartSelectPicker deleted file mode 100644 index c15bf200..00000000 --- a/smart-admin-h5/src/components/form/select-picker/SmartSelectPicker +++ /dev/null @@ -1,59 +0,0 @@ - - - - - diff --git a/smart-admin-h5/src/components/mixin/session-mixin.js b/smart-admin-h5/src/components/mixin/session-mixin.js deleted file mode 100644 index 94026bb0..00000000 --- a/smart-admin-h5/src/components/mixin/session-mixin.js +++ /dev/null @@ -1,25 +0,0 @@ -import cookie from '@/lib/cookie'; -import { userApi } from 'api/user'; - -/** - * 此 mixin为登录以后的页面用的,因为所有的有效路由(排除登录、注册、404,500 这个几个特殊页面)都会走 App.vue里的router - * @author zhuoda - */ -export default { - created: function() { - const token = cookie.getToken(); - // 如果登录过,获取token - if (token && !this.$store.state.user.isHaveGotSessionInfo) { - (async() => { - try { - console.debug(' request session info '); - const res = await userApi.getSession(); - const loginInfo = res.data; - this.$store.commit('user/updateSession', loginInfo); - } catch (e) { - this.$smartSentry.captureException(e); - } - })(); - } - } -}; diff --git a/smart-admin-h5/src/components/van-bar/BackNavBar.vue b/smart-admin-h5/src/components/van-bar/BackNavBar.vue deleted file mode 100644 index bca0b99e..00000000 --- a/smart-admin-h5/src/components/van-bar/BackNavBar.vue +++ /dev/null @@ -1,24 +0,0 @@ - - - diff --git a/smart-admin-h5/src/components/van-bar/RouterNavBar.vue b/smart-admin-h5/src/components/van-bar/RouterNavBar.vue deleted file mode 100644 index 355a57d6..00000000 --- a/smart-admin-h5/src/components/van-bar/RouterNavBar.vue +++ /dev/null @@ -1,27 +0,0 @@ - - - diff --git a/smart-admin-h5/src/config/index.js b/smart-admin-h5/src/config/index.js deleted file mode 100644 index dafb4212..00000000 --- a/smart-admin-h5/src/config/index.js +++ /dev/null @@ -1,46 +0,0 @@ -console.log('project api url : ', process.env.VUE_APP_URL); - -const isProductionEnv = ['production'].includes(process.env.NODE_ENV); - -module.exports = { - // 配置显示在浏览器标签的title - title: 'Smart-Admin-H5', - // token在Cookie中存储的天数,默认7天 - cookieExpires: 7, - /** - * @description api请求基础路径 - */ - baseUrl: { - apiUrl: process.env.VUE_APP_URL, - erpApiUrl: process.env.VUE_APP_ERP_URL, - webSocketUrl: process.env.VUE_APP_SOCKET_URL - }, - /** - * 打包后静态资源地址;如果是走cdn的话,可以配置如下: - * publicPath: isProd ? 'https://cdn.1024lab.net/static/smart-h5/' : '/' - */ - publicPath: isProductionEnv ? '/manage-h5/' : '/', - - // ==================== cdn 相关 begin ==================== - cdn: { - cdnResource: { - css: [], - js: [ - 'https://cdn.bootcss.com/vue/2.6.11/vue.min.js', - 'https://cdn.bootcss.com/vue-router/3.2.0/vue-router.min.js', - 'https://cdn.bootcdn.net/ajax/libs/vuex/3.5.1/vuex.min.js', - 'https://cdn.bootcss.com/axios/0.19.2/axios.min.js', - 'https://cdn.bootcdn.net/ajax/libs/lodash.js/4.17.20/lodash.min.js' - ] - }, - // 指定资源加载cdn - externals: { - vue: 'Vue', - 'vue-router': 'VueRouter', - vuex: 'Vuex', - axios: 'axios', - lodash: '_' - } - } - // ==================== cdn 相关 end ==================== -}; diff --git a/smart-admin-h5/src/constants/area.js b/smart-admin-h5/src/constants/area.js deleted file mode 100644 index 26e2ca99..00000000 --- a/smart-admin-h5/src/constants/area.js +++ /dev/null @@ -1,4047 +0,0 @@ -export default { - province_list: { - 110000: '北京市', - 120000: '天津市', - 130000: '河北省', - 140000: '山西省', - 150000: '内蒙古自治区', - 210000: '辽宁省', - 220000: '吉林省', - 230000: '黑龙江省', - 310000: '上海市', - 320000: '江苏省', - 330000: '浙江省', - 340000: '安徽省', - 350000: '福建省', - 360000: '江西省', - 370000: '山东省', - 410000: '河南省', - 420000: '湖北省', - 430000: '湖南省', - 440000: '广东省', - 450000: '广西壮族自治区', - 460000: '海南省', - 500000: '重庆市', - 510000: '四川省', - 520000: '贵州省', - 530000: '云南省', - 540000: '西藏自治区', - 610000: '陕西省', - 620000: '甘肃省', - 630000: '青海省', - 640000: '宁夏回族自治区', - 650000: '新疆维吾尔自治区', - 710000: '台湾省', - 810000: '香港特别行政区', - 820000: '澳门特别行政区', - 900000: '海外' - }, - city_list: { - 110100: '北京市', - 120100: '天津市', - 130100: '石家庄市', - 130200: '唐山市', - 130300: '秦皇岛市', - 130400: '邯郸市', - 130500: '邢台市', - 130600: '保定市', - 130700: '张家口市', - 130800: '承德市', - 130900: '沧州市', - 131000: '廊坊市', - 131100: '衡水市', - 140100: '太原市', - 140200: '大同市', - 140300: '阳泉市', - 140400: '长治市', - 140500: '晋城市', - 140600: '朔州市', - 140700: '晋中市', - 140800: '运城市', - 140900: '忻州市', - 141000: '临汾市', - 141100: '吕梁市', - 150100: '呼和浩特市', - 150200: '包头市', - 150300: '乌海市', - 150400: '赤峰市', - 150500: '通辽市', - 150600: '鄂尔多斯市', - 150700: '呼伦贝尔市', - 150800: '巴彦淖尔市', - 150900: '乌兰察布市', - 152200: '兴安盟', - 152500: '锡林郭勒盟', - 152900: '阿拉善盟', - 210100: '沈阳市', - 210200: '大连市', - 210300: '鞍山市', - 210400: '抚顺市', - 210500: '本溪市', - 210600: '丹东市', - 210700: '锦州市', - 210800: '营口市', - 210900: '阜新市', - 211000: '辽阳市', - 211100: '盘锦市', - 211200: '铁岭市', - 211300: '朝阳市', - 211400: '葫芦岛市', - 220100: '长春市', - 220200: '吉林市', - 220300: '四平市', - 220400: '辽源市', - 220500: '通化市', - 220600: '白山市', - 220700: '松原市', - 220800: '白城市', - 222400: '延边朝鲜族自治州', - 230100: '哈尔滨市', - 230200: '齐齐哈尔市', - 230300: '鸡西市', - 230400: '鹤岗市', - 230500: '双鸭山市', - 230600: '大庆市', - 230700: '伊春市', - 230800: '佳木斯市', - 230900: '七台河市', - 231000: '牡丹江市', - 231100: '黑河市', - 231200: '绥化市', - 232700: '大兴安岭地区', - 310100: '上海市', - 320100: '南京市', - 320200: '无锡市', - 320300: '徐州市', - 320400: '常州市', - 320500: '苏州市', - 320600: '南通市', - 320700: '连云港市', - 320800: '淮安市', - 320900: '盐城市', - 321000: '扬州市', - 321100: '镇江市', - 321200: '泰州市', - 321300: '宿迁市', - 330100: '杭州市', - 330200: '宁波市', - 330300: '温州市', - 330400: '嘉兴市', - 330500: '湖州市', - 330600: '绍兴市', - 330700: '金华市', - 330800: '衢州市', - 330900: '舟山市', - 331000: '台州市', - 331100: '丽水市', - 340100: '合肥市', - 340200: '芜湖市', - 340300: '蚌埠市', - 340400: '淮南市', - 340500: '马鞍山市', - 340600: '淮北市', - 340700: '铜陵市', - 340800: '安庆市', - 341000: '黄山市', - 341100: '滁州市', - 341200: '阜阳市', - 341300: '宿州市', - 341500: '六安市', - 341600: '亳州市', - 341700: '池州市', - 341800: '宣城市', - 350100: '福州市', - 350200: '厦门市', - 350300: '莆田市', - 350400: '三明市', - 350500: '泉州市', - 350600: '漳州市', - 350700: '南平市', - 350800: '龙岩市', - 350900: '宁德市', - 360100: '南昌市', - 360200: '景德镇市', - 360300: '萍乡市', - 360400: '九江市', - 360500: '新余市', - 360600: '鹰潭市', - 360700: '赣州市', - 360800: '吉安市', - 360900: '宜春市', - 361000: '抚州市', - 361100: '上饶市', - 370100: '济南市', - 370200: '青岛市', - 370300: '淄博市', - 370400: '枣庄市', - 370500: '东营市', - 370600: '烟台市', - 370700: '潍坊市', - 370800: '济宁市', - 370900: '泰安市', - 371000: '威海市', - 371100: '日照市', - 371300: '临沂市', - 371400: '德州市', - 371500: '聊城市', - 371600: '滨州市', - 371700: '菏泽市', - 410100: '郑州市', - 410200: '开封市', - 410300: '洛阳市', - 410400: '平顶山市', - 410500: '安阳市', - 410600: '鹤壁市', - 410700: '新乡市', - 410800: '焦作市', - 410900: '濮阳市', - 411000: '许昌市', - 411100: '漯河市', - 411200: '三门峡市', - 411300: '南阳市', - 411400: '商丘市', - 411500: '信阳市', - 411600: '周口市', - 411700: '驻马店市', - 419000: '省直辖县', - 420100: '武汉市', - 420200: '黄石市', - 420300: '十堰市', - 420500: '宜昌市', - 420600: '襄阳市', - 420700: '鄂州市', - 420800: '荆门市', - 420900: '孝感市', - 421000: '荆州市', - 421100: '黄冈市', - 421200: '咸宁市', - 421300: '随州市', - 422800: '恩施土家族苗族自治州', - 429000: '省直辖县', - 430100: '长沙市', - 430200: '株洲市', - 430300: '湘潭市', - 430400: '衡阳市', - 430500: '邵阳市', - 430600: '岳阳市', - 430700: '常德市', - 430800: '张家界市', - 430900: '益阳市', - 431000: '郴州市', - 431100: '永州市', - 431200: '怀化市', - 431300: '娄底市', - 433100: '湘西土家族苗族自治州', - 440100: '广州市', - 440200: '韶关市', - 440300: '深圳市', - 440400: '珠海市', - 440500: '汕头市', - 440600: '佛山市', - 440700: '江门市', - 440800: '湛江市', - 440900: '茂名市', - 441200: '肇庆市', - 441300: '惠州市', - 441400: '梅州市', - 441500: '汕尾市', - 441600: '河源市', - 441700: '阳江市', - 441800: '清远市', - 441900: '东莞市', - 442000: '中山市', - 445100: '潮州市', - 445200: '揭阳市', - 445300: '云浮市', - 450100: '南宁市', - 450200: '柳州市', - 450300: '桂林市', - 450400: '梧州市', - 450500: '北海市', - 450600: '防城港市', - 450700: '钦州市', - 450800: '贵港市', - 450900: '玉林市', - 451000: '百色市', - 451100: '贺州市', - 451200: '河池市', - 451300: '来宾市', - 451400: '崇左市', - 460100: '海口市', - 460200: '三亚市', - 460300: '三沙市', - 460400: '儋州市', - 469000: '省直辖县', - 500100: '重庆市', - 500200: '县', - 510100: '成都市', - 510300: '自贡市', - 510400: '攀枝花市', - 510500: '泸州市', - 510600: '德阳市', - 510700: '绵阳市', - 510800: '广元市', - 510900: '遂宁市', - 511000: '内江市', - 511100: '乐山市', - 511300: '南充市', - 511400: '眉山市', - 511500: '宜宾市', - 511600: '广安市', - 511700: '达州市', - 511800: '雅安市', - 511900: '巴中市', - 512000: '资阳市', - 513200: '阿坝藏族羌族自治州', - 513300: '甘孜藏族自治州', - 513400: '凉山彝族自治州', - 520100: '贵阳市', - 520200: '六盘水市', - 520300: '遵义市', - 520400: '安顺市', - 520500: '毕节市', - 520600: '铜仁市', - 522300: '黔西南布依族苗族自治州', - 522600: '黔东南苗族侗族自治州', - 522700: '黔南布依族苗族自治州', - 530100: '昆明市', - 530300: '曲靖市', - 530400: '玉溪市', - 530500: '保山市', - 530600: '昭通市', - 530700: '丽江市', - 530800: '普洱市', - 530900: '临沧市', - 532300: '楚雄彝族自治州', - 532500: '红河哈尼族彝族自治州', - 532600: '文山壮族苗族自治州', - 532800: '西双版纳傣族自治州', - 532900: '大理白族自治州', - 533100: '德宏傣族景颇族自治州', - 533300: '怒江傈僳族自治州', - 533400: '迪庆藏族自治州', - 540100: '拉萨市', - 540200: '日喀则市', - 540300: '昌都市', - 540400: '林芝市', - 540500: '山南市', - 540600: '那曲市', - 542500: '阿里地区', - 610100: '西安市', - 610200: '铜川市', - 610300: '宝鸡市', - 610400: '咸阳市', - 610500: '渭南市', - 610600: '延安市', - 610700: '汉中市', - 610800: '榆林市', - 610900: '安康市', - 611000: '商洛市', - 620100: '兰州市', - 620200: '嘉峪关市', - 620300: '金昌市', - 620400: '白银市', - 620500: '天水市', - 620600: '武威市', - 620700: '张掖市', - 620800: '平凉市', - 620900: '酒泉市', - 621000: '庆阳市', - 621100: '定西市', - 621200: '陇南市', - 622900: '临夏回族自治州', - 623000: '甘南藏族自治州', - 630100: '西宁市', - 630200: '海东市', - 632200: '海北藏族自治州', - 632300: '黄南藏族自治州', - 632500: '海南藏族自治州', - 632600: '果洛藏族自治州', - 632700: '玉树藏族自治州', - 632800: '海西蒙古族藏族自治州', - 640100: '银川市', - 640200: '石嘴山市', - 640300: '吴忠市', - 640400: '固原市', - 640500: '中卫市', - 650100: '乌鲁木齐市', - 650200: '克拉玛依市', - 650400: '吐鲁番市', - 650500: '哈密市', - 652300: '昌吉回族自治州', - 652700: '博尔塔拉蒙古自治州', - 652800: '巴音郭楞蒙古自治州', - 652900: '阿克苏地区', - 653000: '克孜勒苏柯尔克孜自治州', - 653100: '喀什地区', - 653200: '和田地区', - 654000: '伊犁哈萨克自治州', - 654200: '塔城地区', - 654300: '阿勒泰地区', - 659000: '自治区直辖县级行政区划', - 710100: '台北市', - 710200: '高雄市', - 710300: '台南市', - 710400: '台中市', - 710500: '金门县', - 710600: '南投县', - 710700: '基隆市', - 710800: '新竹市', - 710900: '嘉义市', - 711100: '新北市', - 711200: '宜兰县', - 711300: '新竹县', - 711400: '桃园县', - 711500: '苗栗县', - 711700: '彰化县', - 711900: '嘉义县', - 712100: '云林县', - 712400: '屏东县', - 712500: '台东县', - 712600: '花莲县', - 712700: '澎湖县', - 712800: '连江县', - 810100: '香港岛', - 810200: '九龙', - 810300: '新界', - 820100: '澳门半岛', - 820200: '离岛', - 900400: '阿富汗', - 900800: '阿尔巴尼亚', - 901000: '南极洲', - 901200: '阿尔及利亚', - 901600: '美属萨摩亚', - 902000: '安道尔', - 902400: '安哥拉', - 902800: '安提瓜和巴布达', - 903100: '阿塞拜疆', - 903200: '阿根廷', - 903600: '澳大利亚', - 904000: '奥地利', - 904400: '巴哈马', - 904800: '巴林', - 905000: '孟加拉', - 905100: '亚美尼亚', - 905200: '巴巴多斯', - 905600: '比利时', - 906000: '百慕大', - 906400: '不丹', - 906800: '玻利维亚', - 907000: '波黑', - 907200: '博茨瓦纳', - 907400: '布韦岛', - 907600: '巴西', - 908400: '伯利兹', - 908600: '英属印度洋领地', - 909000: '所罗门群岛', - 909200: '英属维尔京群岛', - 909600: '文莱', - 910000: '保加利亚', - 910400: '缅甸', - 910800: '布隆迪', - 911200: '白俄罗斯', - 911600: '柬埔寨', - 912000: '喀麦隆', - 912400: '加拿大', - 913200: '佛得角', - 913600: '开曼群岛', - 914000: '中非', - 914400: '斯里兰卡', - 914800: '乍得', - 915200: '智利', - 916200: '圣诞岛', - 916600: '科科斯群岛', - 917000: '哥伦比亚', - 917400: '科摩罗', - 917500: '马约特', - 917800: '刚果(布)', - 918000: '刚果(金)', - 918400: '库克群岛', - 918800: '哥斯达黎加', - 919100: '克罗地亚', - 919200: '古巴', - 919600: '塞浦路斯', - 920300: '捷克', - 920400: '贝宁', - 920800: '丹麦', - 921200: '多米尼克', - 921400: '多米尼加', - 921800: '厄瓜多尔', - 922200: '萨尔瓦多', - 922600: '赤道几内亚', - 923100: '埃塞俄比亚', - 923200: '厄立特里亚', - 923300: '爱沙尼亚', - 923400: '法罗群岛', - 923800: '马尔维纳斯群岛( 福克兰)', - 923900: '南乔治亚岛和南桑威奇群岛', - 924200: '斐济群岛', - 924600: '芬兰', - 924800: '奥兰群岛', - 925000: '法国', - 925400: '法属圭亚那', - 925800: '法属波利尼西亚', - 926000: '法属南部领地', - 926200: '吉布提', - 926600: '加蓬', - 926800: '格鲁吉亚', - 927000: '冈比亚', - 927500: '巴勒斯坦', - 927600: '德国', - 928800: '加纳', - 929200: '直布罗陀', - 929600: '基里巴斯', - 930000: '希腊', - 930400: '格陵兰', - 930800: '格林纳达', - 931200: '瓜德罗普', - 931600: '关岛', - 932000: '危地马拉', - 932400: '几内亚', - 932800: '圭亚那', - 933200: '海地', - 933400: '赫德岛和麦克唐纳群岛', - 933600: '梵蒂冈', - 934000: '洪都拉斯', - 934800: '匈牙利', - 935200: '冰岛', - 935600: '印度', - 936000: '印尼', - 936400: '伊朗', - 936800: '伊拉克', - 937200: '爱尔兰', - 937600: '以色列', - 938000: '意大利', - 938400: '科特迪瓦', - 938800: '牙买加', - 939200: '日本', - 939800: '哈萨克斯坦', - 940000: '约旦', - 940400: '肯尼亚', - 940800: '朝鲜 北朝鲜', - 941000: '韩国', - 941400: '科威特', - 941700: '吉尔吉斯斯坦', - 941800: '老挝', - 942200: '黎巴嫩', - 942600: '莱索托', - 942800: '拉脱维亚', - 943000: '利比里亚', - 943400: '利比亚', - 943800: '列支敦士登', - 944000: '立陶宛', - 944200: '卢森堡', - 945000: '马达加斯加', - 945400: '马拉维', - 945800: '马来西亚', - 946200: '马尔代夫', - 946600: '马里', - 947000: '马耳他', - 947400: '马提尼克', - 947800: '毛里塔尼亚', - 948000: '毛里求斯', - 948400: '墨西哥', - 949200: '摩纳哥', - 949600: '蒙古国', - 949800: '摩尔多瓦', - 949900: '黑山', - 950000: '蒙塞拉特岛', - 950400: '摩洛哥', - 950800: '莫桑比克', - 951200: '阿曼', - 951600: '纳米比亚', - 952000: '瑙鲁', - 952400: '尼泊尔', - 952800: '荷兰', - 953300: '阿鲁巴', - 953500: '荷兰加勒比区', - 954000: '新喀里多尼亚', - 954800: '瓦努阿图', - 955400: '新西兰', - 955800: '尼加拉瓜', - 956200: '尼日尔', - 956600: '尼日利亚', - 957000: '纽埃', - 957400: '诺福克岛', - 957800: '挪威', - 958000: '北马里亚纳群岛', - 958100: '美国本土外小岛屿', - 958300: '密克罗尼西亚联邦', - 958400: '马绍尔群岛', - 958500: '帕劳', - 958600: '巴基斯坦', - 959100: '巴拿马', - 959800: '巴布亚新几内亚', - 960000: '巴拉圭', - 960400: '秘鲁', - 960800: '菲律宾', - 961200: '皮特凯恩群岛', - 961600: '波兰', - 962000: '葡萄牙', - 962400: '几内亚比绍', - 962600: '东帝汶', - 963000: '波多黎各', - 963400: '卡塔尔', - 963800: '留尼汪', - 964200: '罗马尼亚', - 964300: '俄罗斯', - 964600: '卢旺达', - 965200: '圣巴泰勒米岛', - 965400: '圣赫勒拿', - 965900: '圣基茨和尼维斯', - 966000: '安圭拉', - 966200: '圣卢西亚', - 966300: '法属圣马丁', - 966600: '圣皮埃尔和密克隆', - 967000: '圣文森特和格林纳丁斯', - 967400: '圣马力诺', - 967800: '圣多美和普林西比', - 968200: '沙特阿拉伯', - 968600: '塞内加尔', - 968800: '塞尔维亚', - 969000: '塞舌尔', - 969400: '塞拉利昂', - 970200: '新加坡', - 970300: '斯洛伐克', - 970400: '越南', - 970500: '斯洛文尼亚', - 970600: '索马里', - 971000: '南非', - 971600: '津巴布韦', - 972400: '西班牙', - 972800: '南苏丹', - 972900: '苏丹', - 973200: '西撒哈拉', - 974000: '苏里南', - 974400: '斯瓦尔巴群岛和 扬马延岛', - 974800: '斯威士兰', - 975200: '瑞典', - 975600: '瑞士', - 976000: '叙利亚', - 976200: '塔吉克斯坦', - 976400: '泰国', - 976800: '多哥', - 977200: '托克劳', - 977600: '汤加', - 978000: '特立尼达和多巴哥', - 978400: '阿联酋', - 978800: '突尼斯', - 979200: '土耳其', - 979500: '土库曼斯坦', - 979600: '特克斯和凯科斯群岛', - 979800: '图瓦卢', - 980000: '乌干达', - 980400: '乌克兰', - 980700: '马其顿', - 981800: '埃及', - 982600: '英国', - 983100: '根西岛', - 983200: '泽西岛', - 983300: '马恩岛', - 983400: '坦桑尼亚', - 984000: '美国', - 985000: '美属维尔京群岛', - 985400: '布基纳法索', - 985800: '乌拉圭', - 986000: '乌兹别克斯坦', - 986200: '委内瑞拉', - 987600: '瓦利斯和富图纳', - 988200: '萨摩亚', - 988700: '也门', - 989400: '赞比亚' - }, - county_list: { - 110101: '东城区', - 110102: '西城区', - 110105: '朝阳区', - 110106: '丰台区', - 110107: '石景山区', - 110108: '海淀区', - 110109: '门头沟区', - 110111: '房山区', - 110112: '通州区', - 110113: '顺义区', - 110114: '昌平区', - 110115: '大兴区', - 110116: '怀柔区', - 110117: '平谷区', - 110118: '密云区', - 110119: '延庆区', - 120101: '和平区', - 120102: '河东区', - 120103: '河西区', - 120104: '南开区', - 120105: '河北区', - 120106: '红桥区', - 120110: '东丽区', - 120111: '西青区', - 120112: '津南区', - 120113: '北辰区', - 120114: '武清区', - 120115: '宝坻区', - 120116: '滨海新区', - 120117: '宁河区', - 120118: '静海区', - 120119: '蓟州区', - 130102: '长安区', - 130104: '桥西区', - 130105: '新华区', - 130107: '井陉矿区', - 130108: '裕华区', - 130109: '藁城区', - 130110: '鹿泉区', - 130111: '栾城区', - 130121: '井陉县', - 130123: '正定县', - 130125: '行唐县', - 130126: '灵寿县', - 130127: '高邑县', - 130128: '深泽县', - 130129: '赞皇县', - 130130: '无极县', - 130131: '平山县', - 130132: '元氏县', - 130133: '赵县', - 130181: '辛集市', - 130183: '晋州市', - 130184: '新乐市', - 130202: '路南区', - 130203: '路北区', - 130204: '古冶区', - 130205: '开平区', - 130207: '丰南区', - 130208: '丰润区', - 130209: '曹妃甸区', - 130224: '滦南县', - 130225: '乐亭县', - 130227: '迁西县', - 130229: '玉田县', - 130281: '遵化市', - 130283: '迁安市', - 130284: '滦州市', - 130302: '海港区', - 130303: '山海关区', - 130304: '北戴河区', - 130306: '抚宁区', - 130321: '青龙满族自治县', - 130322: '昌黎县', - 130324: '卢龙县', - 130390: '经济技术开发区', - 130402: '邯山区', - 130403: '丛台区', - 130404: '复兴区', - 130406: '峰峰矿区', - 130407: '肥乡区', - 130408: '永年区', - 130423: '临漳县', - 130424: '成安县', - 130425: '大名县', - 130426: '涉县', - 130427: '磁县', - 130430: '邱县', - 130431: '鸡泽县', - 130432: '广平县', - 130433: '馆陶县', - 130434: '魏县', - 130435: '曲周县', - 130481: '武安市', - 130502: '桥东区', - 130503: '桥西区', - 130521: '邢台县', - 130522: '临城县', - 130523: '内丘县', - 130524: '柏乡县', - 130525: '隆尧县', - 130526: '任县', - 130527: '南和县', - 130528: '宁晋县', - 130529: '巨鹿县', - 130530: '新河县', - 130531: '广宗县', - 130532: '平乡县', - 130533: '威县', - 130534: '清河县', - 130535: '临西县', - 130581: '南宫市', - 130582: '沙河市', - 130602: '竞秀区', - 130606: '莲池区', - 130607: '满城区', - 130608: '清苑区', - 130609: '徐水区', - 130623: '涞水县', - 130624: '阜平县', - 130626: '定兴县', - 130627: '唐县', - 130628: '高阳县', - 130629: '容城县', - 130630: '涞源县', - 130631: '望都县', - 130632: '安新县', - 130633: '易县', - 130634: '曲阳县', - 130635: '蠡县', - 130636: '顺平县', - 130637: '博野县', - 130638: '雄县', - 130681: '涿州市', - 130682: '定州市', - 130683: '安国市', - 130684: '高碑店市', - 130702: '桥东区', - 130703: '桥西区', - 130705: '宣化区', - 130706: '下花园区', - 130708: '万全区', - 130709: '崇礼区', - 130722: '张北县', - 130723: '康保县', - 130724: '沽源县', - 130725: '尚义县', - 130726: '蔚县', - 130727: '阳原县', - 130728: '怀安县', - 130730: '怀来县', - 130731: '涿鹿县', - 130732: '赤城县', - 130802: '双桥区', - 130803: '双滦区', - 130804: '鹰手营子矿区', - 130821: '承德县', - 130822: '兴隆县', - 130824: '滦平县', - 130825: '隆化县', - 130826: '丰宁满族自治县', - 130827: '宽城满族自治县', - 130828: '围场满族蒙古族自治县', - 130881: '平泉市', - 130902: '新华区', - 130903: '运河区', - 130921: '沧县', - 130922: '青县', - 130923: '东光县', - 130924: '海兴县', - 130925: '盐山县', - 130926: '肃宁县', - 130927: '南皮县', - 130928: '吴桥县', - 130929: '献县', - 130930: '孟村回族自治县', - 130981: '泊头市', - 130982: '任丘市', - 130983: '黄骅市', - 130984: '河间市', - 131002: '安次区', - 131003: '广阳区', - 131022: '固安县', - 131023: '永清县', - 131024: '香河县', - 131025: '大城县', - 131026: '文安县', - 131028: '大厂回族自治县', - 131081: '霸州市', - 131082: '三河市', - 131090: '开发区', - 131102: '桃城区', - 131103: '冀州区', - 131121: '枣强县', - 131122: '武邑县', - 131123: '武强县', - 131124: '饶阳县', - 131125: '安平县', - 131126: '故城县', - 131127: '景县', - 131128: '阜城县', - 131182: '深州市', - 140105: '小店区', - 140106: '迎泽区', - 140107: '杏花岭区', - 140108: '尖草坪区', - 140109: '万柏林区', - 140110: '晋源区', - 140121: '清徐县', - 140122: '阳曲县', - 140123: '娄烦县', - 140181: '古交市', - 140212: '新荣区', - 140213: '平城区', - 140214: '云冈区', - 140215: '云州区', - 140221: '阳高县', - 140222: '天镇县', - 140223: '广灵县', - 140224: '灵丘县', - 140225: '浑源县', - 140226: '左云县', - 140302: '城区', - 140303: '矿区', - 140311: '郊区', - 140321: '平定县', - 140322: '盂县', - 140403: '潞州区', - 140404: '上党区', - 140405: '屯留区', - 140406: '潞城区', - 140423: '襄垣县', - 140425: '平顺县', - 140426: '黎城县', - 140427: '壶关县', - 140428: '长子县', - 140429: '武乡县', - 140430: '沁县', - 140431: '沁源县', - 140502: '城区', - 140521: '沁水县', - 140522: '阳城县', - 140524: '陵川县', - 140525: '泽州县', - 140581: '高平市', - 140602: '朔城区', - 140603: '平鲁区', - 140621: '山阴县', - 140622: '应县', - 140623: '右玉县', - 140681: '怀仁市', - 140702: '榆次区', - 140721: '榆社县', - 140722: '左权县', - 140723: '和顺县', - 140724: '昔阳县', - 140725: '寿阳县', - 140726: '太谷县', - 140727: '祁县', - 140728: '平遥县', - 140729: '灵石县', - 140781: '介休市', - 140802: '盐湖区', - 140821: '临猗县', - 140822: '万荣县', - 140823: '闻喜县', - 140824: '稷山县', - 140825: '新绛县', - 140826: '绛县', - 140827: '垣曲县', - 140828: '夏县', - 140829: '平陆县', - 140830: '芮城县', - 140881: '永济市', - 140882: '河津市', - 140902: '忻府区', - 140921: '定襄县', - 140922: '五台县', - 140923: '代县', - 140924: '繁峙县', - 140925: '宁武县', - 140926: '静乐县', - 140927: '神池县', - 140928: '五寨县', - 140929: '岢岚县', - 140930: '河曲县', - 140931: '保德县', - 140932: '偏关县', - 140981: '原平市', - 141002: '尧都区', - 141021: '曲沃县', - 141022: '翼城县', - 141023: '襄汾县', - 141024: '洪洞县', - 141025: '古县', - 141026: '安泽县', - 141027: '浮山县', - 141028: '吉县', - 141029: '乡宁县', - 141030: '大宁县', - 141031: '隰县', - 141032: '永和县', - 141033: '蒲县', - 141034: '汾西县', - 141081: '侯马市', - 141082: '霍州市', - 141102: '离石区', - 141121: '文水县', - 141122: '交城县', - 141123: '兴县', - 141124: '临县', - 141125: '柳林县', - 141126: '石楼县', - 141127: '岚县', - 141128: '方山县', - 141129: '中阳县', - 141130: '交口县', - 141181: '孝义市', - 141182: '汾阳市', - 150102: '新城区', - 150103: '回民区', - 150104: '玉泉区', - 150105: '赛罕区', - 150121: '土默特左旗', - 150122: '托克托县', - 150123: '和林格尔县', - 150124: '清水河县', - 150125: '武川县', - 150202: '东河区', - 150203: '昆都仑区', - 150204: '青山区', - 150205: '石拐区', - 150206: '白云鄂博矿区', - 150207: '九原区', - 150221: '土默特右旗', - 150222: '固阳县', - 150223: '达尔罕茂明安联合旗', - 150302: '海勃湾区', - 150303: '海南区', - 150304: '乌达区', - 150402: '红山区', - 150403: '元宝山区', - 150404: '松山区', - 150421: '阿鲁科尔沁旗', - 150422: '巴林左旗', - 150423: '巴林右旗', - 150424: '林西县', - 150425: '克什克腾旗', - 150426: '翁牛特旗', - 150428: '喀喇沁旗', - 150429: '宁城县', - 150430: '敖汉旗', - 150502: '科尔沁区', - 150521: '科尔沁左翼中旗', - 150522: '科尔沁左翼后旗', - 150523: '开鲁县', - 150524: '库伦旗', - 150525: '奈曼旗', - 150526: '扎鲁特旗', - 150581: '霍林郭勒市', - 150602: '东胜区', - 150603: '康巴什区', - 150621: '达拉特旗', - 150622: '准格尔旗', - 150623: '鄂托克前旗', - 150624: '鄂托克旗', - 150625: '杭锦旗', - 150626: '乌审旗', - 150627: '伊金霍洛旗', - 150702: '海拉尔区', - 150703: '扎赉诺尔区', - 150721: '阿荣旗', - 150722: '莫力达瓦达斡尔族自治旗', - 150723: '鄂伦春自治旗', - 150724: '鄂温克族自治旗', - 150725: '陈巴尔虎旗', - 150726: '新巴尔虎左旗', - 150727: '新巴尔虎右旗', - 150781: '满洲里市', - 150782: '牙克石市', - 150783: '扎兰屯市', - 150784: '额尔古纳市', - 150785: '根河市', - 150802: '临河区', - 150821: '五原县', - 150822: '磴口县', - 150823: '乌拉特前旗', - 150824: '乌拉特中旗', - 150825: '乌拉特后旗', - 150826: '杭锦后旗', - 150902: '集宁区', - 150921: '卓资县', - 150922: '化德县', - 150923: '商都县', - 150924: '兴和县', - 150925: '凉城县', - 150926: '察哈尔右翼前旗', - 150927: '察哈尔右翼中旗', - 150928: '察哈尔右翼后旗', - 150929: '四子王旗', - 150981: '丰镇市', - 152201: '乌兰浩特市', - 152202: '阿尔山市', - 152221: '科尔沁右翼前旗', - 152222: '科尔沁右翼中旗', - 152223: '扎赉特旗', - 152224: '突泉县', - 152501: '二连浩特市', - 152502: '锡林浩特市', - 152522: '阿巴嘎旗', - 152523: '苏尼特左旗', - 152524: '苏尼特右旗', - 152525: '东乌珠穆沁旗', - 152526: '西乌珠穆沁旗', - 152527: '太仆寺旗', - 152528: '镶黄旗', - 152529: '正镶白旗', - 152530: '正蓝旗', - 152531: '多伦县', - 152921: '阿拉善左旗', - 152922: '阿拉善右旗', - 152923: '额济纳旗', - 210102: '和平区', - 210103: '沈河区', - 210104: '大东区', - 210105: '皇姑区', - 210106: '铁西区', - 210111: '苏家屯区', - 210112: '浑南区', - 210113: '沈北新区', - 210114: '于洪区', - 210115: '辽中区', - 210123: '康平县', - 210124: '法库县', - 210181: '新民市', - 210190: '经济技术开发区', - 210202: '中山区', - 210203: '西岗区', - 210204: '沙河口区', - 210211: '甘井子区', - 210212: '旅顺口区', - 210213: '金州区', - 210214: '普兰店区', - 210224: '长海县', - 210281: '瓦房店市', - 210283: '庄河市', - 210302: '铁东区', - 210303: '铁西区', - 210304: '立山区', - 210311: '千山区', - 210321: '台安县', - 210323: '岫岩满族自治县', - 210381: '海城市', - 210390: '高新区', - 210402: '新抚区', - 210403: '东洲区', - 210404: '望花区', - 210411: '顺城区', - 210421: '抚顺县', - 210422: '新宾满族自治县', - 210423: '清原满族自治县', - 210502: '平山区', - 210503: '溪湖区', - 210504: '明山区', - 210505: '南芬区', - 210521: '本溪满族自治县', - 210522: '桓仁满族自治县', - 210602: '元宝区', - 210603: '振兴区', - 210604: '振安区', - 210624: '宽甸满族自治县', - 210681: '东港市', - 210682: '凤城市', - 210702: '古塔区', - 210703: '凌河区', - 210711: '太和区', - 210726: '黑山县', - 210727: '义县', - 210781: '凌海市', - 210782: '北镇市', - 210793: '经济技术开发区', - 210802: '站前区', - 210803: '西市区', - 210804: '鲅鱼圈区', - 210811: '老边区', - 210881: '盖州市', - 210882: '大石桥市', - 210902: '海州区', - 210903: '新邱区', - 210904: '太平区', - 210905: '清河门区', - 210911: '细河区', - 210921: '阜新蒙古族自治县', - 210922: '彰武县', - 211002: '白塔区', - 211003: '文圣区', - 211004: '宏伟区', - 211005: '弓长岭区', - 211011: '太子河区', - 211021: '辽阳县', - 211081: '灯塔市', - 211102: '双台子区', - 211103: '兴隆台区', - 211104: '大洼区', - 211122: '盘山县', - 211202: '银州区', - 211204: '清河区', - 211221: '铁岭县', - 211223: '西丰县', - 211224: '昌图县', - 211281: '调兵山市', - 211282: '开原市', - 211302: '双塔区', - 211303: '龙城区', - 211321: '朝阳县', - 211322: '建平县', - 211324: '喀喇沁左翼蒙古族自治县', - 211381: '北票市', - 211382: '凌源市', - 211402: '连山区', - 211403: '龙港区', - 211404: '南票区', - 211421: '绥中县', - 211422: '建昌县', - 211481: '兴城市', - 220102: '南关区', - 220103: '宽城区', - 220104: '朝阳区', - 220105: '二道区', - 220106: '绿园区', - 220112: '双阳区', - 220113: '九台区', - 220122: '农安县', - 220182: '榆树市', - 220183: '德惠市', - 220192: '经济技术开发区', - 220202: '昌邑区', - 220203: '龙潭区', - 220204: '船营区', - 220211: '丰满区', - 220221: '永吉县', - 220281: '蛟河市', - 220282: '桦甸市', - 220283: '舒兰市', - 220284: '磐石市', - 220302: '铁西区', - 220303: '铁东区', - 220322: '梨树县', - 220323: '伊通满族自治县', - 220381: '公主岭市', - 220382: '双辽市', - 220402: '龙山区', - 220403: '西安区', - 220421: '东丰县', - 220422: '东辽县', - 220502: '东昌区', - 220503: '二道江区', - 220521: '通化县', - 220523: '辉南县', - 220524: '柳河县', - 220581: '梅河口市', - 220582: '集安市', - 220602: '浑江区', - 220605: '江源区', - 220621: '抚松县', - 220622: '靖宇县', - 220623: '长白朝鲜族自治县', - 220681: '临江市', - 220702: '宁江区', - 220721: '前郭尔罗斯蒙古族自治县', - 220722: '长岭县', - 220723: '乾安县', - 220781: '扶余市', - 220802: '洮北区', - 220821: '镇赉县', - 220822: '通榆县', - 220881: '洮南市', - 220882: '大安市', - 222401: '延吉市', - 222402: '图们市', - 222403: '敦化市', - 222404: '珲春市', - 222405: '龙井市', - 222406: '和龙市', - 222424: '汪清县', - 222426: '安图县', - 230102: '道里区', - 230103: '南岗区', - 230104: '道外区', - 230108: '平房区', - 230109: '松北区', - 230110: '香坊区', - 230111: '呼兰区', - 230112: '阿城区', - 230113: '双城区', - 230123: '依兰县', - 230124: '方正县', - 230125: '宾县', - 230126: '巴彦县', - 230127: '木兰县', - 230128: '通河县', - 230129: '延寿县', - 230183: '尚志市', - 230184: '五常市', - 230202: '龙沙区', - 230203: '建华区', - 230204: '铁锋区', - 230205: '昂昂溪区', - 230206: '富拉尔基区', - 230207: '碾子山区', - 230208: '梅里斯达斡尔族区', - 230221: '龙江县', - 230223: '依安县', - 230224: '泰来县', - 230225: '甘南县', - 230227: '富裕县', - 230229: '克山县', - 230230: '克东县', - 230231: '拜泉县', - 230281: '讷河市', - 230302: '鸡冠区', - 230303: '恒山区', - 230304: '滴道区', - 230305: '梨树区', - 230306: '城子河区', - 230307: '麻山区', - 230321: '鸡东县', - 230381: '虎林市', - 230382: '密山市', - 230402: '向阳区', - 230403: '工农区', - 230404: '南山区', - 230405: '兴安区', - 230406: '东山区', - 230407: '兴山区', - 230421: '萝北县', - 230422: '绥滨县', - 230502: '尖山区', - 230503: '岭东区', - 230505: '四方台区', - 230506: '宝山区', - 230521: '集贤县', - 230522: '友谊县', - 230523: '宝清县', - 230524: '饶河县', - 230602: '萨尔图区', - 230603: '龙凤区', - 230604: '让胡路区', - 230605: '红岗区', - 230606: '大同区', - 230621: '肇州县', - 230622: '肇源县', - 230623: '林甸县', - 230624: '杜尔伯特蒙古族自治县', - 230702: '伊春区', - 230703: '南岔区', - 230704: '友好区', - 230705: '西林区', - 230706: '翠峦区', - 230707: '新青区', - 230708: '美溪区', - 230709: '金山屯区', - 230710: '五营区', - 230711: '乌马河区', - 230712: '汤旺河区', - 230713: '带岭区', - 230714: '乌伊岭区', - 230715: '红星区', - 230716: '上甘岭区', - 230722: '嘉荫县', - 230781: '铁力市', - 230803: '向阳区', - 230804: '前进区', - 230805: '东风区', - 230811: '郊区', - 230822: '桦南县', - 230826: '桦川县', - 230828: '汤原县', - 230881: '同江市', - 230882: '富锦市', - 230883: '抚远市', - 230902: '新兴区', - 230903: '桃山区', - 230904: '茄子河区', - 230921: '勃利县', - 231002: '东安区', - 231003: '阳明区', - 231004: '爱民区', - 231005: '西安区', - 231025: '林口县', - 231081: '绥芬河市', - 231083: '海林市', - 231084: '宁安市', - 231085: '穆棱市', - 231086: '东宁市', - 231102: '爱辉区', - 231121: '嫩江县', - 231123: '逊克县', - 231124: '孙吴县', - 231181: '北安市', - 231182: '五大连池市', - 231202: '北林区', - 231221: '望奎县', - 231222: '兰西县', - 231223: '青冈县', - 231224: '庆安县', - 231225: '明水县', - 231226: '绥棱县', - 231281: '安达市', - 231282: '肇东市', - 231283: '海伦市', - 232701: '漠河市', - 232721: '呼玛县', - 232722: '塔河县', - 232790: '松岭区', - 232791: '呼中区', - 232792: '加格达奇区', - 232793: '新林区', - 310101: '黄浦区', - 310104: '徐汇区', - 310105: '长宁区', - 310106: '静安区', - 310107: '普陀区', - 310109: '虹口区', - 310110: '杨浦区', - 310112: '闵行区', - 310113: '宝山区', - 310114: '嘉定区', - 310115: '浦东新区', - 310116: '金山区', - 310117: '松江区', - 310118: '青浦区', - 310120: '奉贤区', - 310151: '崇明区', - 320102: '玄武区', - 320104: '秦淮区', - 320105: '建邺区', - 320106: '鼓楼区', - 320111: '浦口区', - 320113: '栖霞区', - 320114: '雨花台区', - 320115: '江宁区', - 320116: '六合区', - 320117: '溧水区', - 320118: '高淳区', - 320205: '锡山区', - 320206: '惠山区', - 320211: '滨湖区', - 320213: '梁溪区', - 320214: '新吴区', - 320281: '江阴市', - 320282: '宜兴市', - 320302: '鼓楼区', - 320303: '云龙区', - 320305: '贾汪区', - 320311: '泉山区', - 320312: '铜山区', - 320321: '丰县', - 320322: '沛县', - 320324: '睢宁县', - 320381: '新沂市', - 320382: '邳州市', - 320391: '工业园区', - 320402: '天宁区', - 320404: '钟楼区', - 320411: '新北区', - 320412: '武进区', - 320413: '金坛区', - 320481: '溧阳市', - 320505: '虎丘区', - 320506: '吴中区', - 320507: '相城区', - 320508: '姑苏区', - 320509: '吴江区', - 320581: '常熟市', - 320582: '张家港市', - 320583: '昆山市', - 320585: '太仓市', - 320590: '工业园区', - 320591: '高新区', - 320602: '崇川区', - 320611: '港闸区', - 320612: '通州区', - 320623: '如东县', - 320681: '启东市', - 320682: '如皋市', - 320684: '海门市', - 320685: '海安市', - 320691: '高新区', - 320703: '连云区', - 320706: '海州区', - 320707: '赣榆区', - 320722: '东海县', - 320723: '灌云县', - 320724: '灌南县', - 320803: '淮安区', - 320804: '淮阴区', - 320812: '清江浦区', - 320813: '洪泽区', - 320826: '涟水县', - 320830: '盱眙县', - 320831: '金湖县', - 320890: '经济开发区', - 320902: '亭湖区', - 320903: '盐都区', - 320904: '大丰区', - 320921: '响水县', - 320922: '滨海县', - 320923: '阜宁县', - 320924: '射阳县', - 320925: '建湖县', - 320981: '东台市', - 321002: '广陵区', - 321003: '邗江区', - 321012: '江都区', - 321023: '宝应县', - 321081: '仪征市', - 321084: '高邮市', - 321090: '经济开发区', - 321102: '京口区', - 321111: '润州区', - 321112: '丹徒区', - 321181: '丹阳市', - 321182: '扬中市', - 321183: '句容市', - 321202: '海陵区', - 321203: '高港区', - 321204: '姜堰区', - 321281: '兴化市', - 321282: '靖江市', - 321283: '泰兴市', - 321302: '宿城区', - 321311: '宿豫区', - 321322: '沭阳县', - 321323: '泗阳县', - 321324: '泗洪县', - 330102: '上城区', - 330103: '下城区', - 330104: '江干区', - 330105: '拱墅区', - 330106: '西湖区', - 330108: '滨江区', - 330109: '萧山区', - 330110: '余杭区', - 330111: '富阳区', - 330112: '临安区', - 330122: '桐庐县', - 330127: '淳安县', - 330182: '建德市', - 330203: '海曙区', - 330205: '江北区', - 330206: '北仑区', - 330211: '镇海区', - 330212: '鄞州区', - 330213: '奉化区', - 330225: '象山县', - 330226: '宁海县', - 330281: '余姚市', - 330282: '慈溪市', - 330302: '鹿城区', - 330303: '龙湾区', - 330304: '瓯海区', - 330305: '洞头区', - 330324: '永嘉县', - 330326: '平阳县', - 330327: '苍南县', - 330328: '文成县', - 330329: '泰顺县', - 330381: '瑞安市', - 330382: '乐清市', - 330402: '南湖区', - 330411: '秀洲区', - 330421: '嘉善县', - 330424: '海盐县', - 330481: '海宁市', - 330482: '平湖市', - 330483: '桐乡市', - 330502: '吴兴区', - 330503: '南浔区', - 330521: '德清县', - 330522: '长兴县', - 330523: '安吉县', - 330602: '越城区', - 330603: '柯桥区', - 330604: '上虞区', - 330624: '新昌县', - 330681: '诸暨市', - 330683: '嵊州市', - 330702: '婺城区', - 330703: '金东区', - 330723: '武义县', - 330726: '浦江县', - 330727: '磐安县', - 330781: '兰溪市', - 330782: '义乌市', - 330783: '东阳市', - 330784: '永康市', - 330802: '柯城区', - 330803: '衢江区', - 330822: '常山县', - 330824: '开化县', - 330825: '龙游县', - 330881: '江山市', - 330902: '定海区', - 330903: '普陀区', - 330921: '岱山县', - 330922: '嵊泗县', - 331002: '椒江区', - 331003: '黄岩区', - 331004: '路桥区', - 331022: '三门县', - 331023: '天台县', - 331024: '仙居县', - 331081: '温岭市', - 331082: '临海市', - 331083: '玉环市', - 331102: '莲都区', - 331121: '青田县', - 331122: '缙云县', - 331123: '遂昌县', - 331124: '松阳县', - 331125: '云和县', - 331126: '庆元县', - 331127: '景宁畲族自治县', - 331181: '龙泉市', - 340102: '瑶海区', - 340103: '庐阳区', - 340104: '蜀山区', - 340111: '包河区', - 340121: '长丰县', - 340122: '肥东县', - 340123: '肥西县', - 340124: '庐江县', - 340181: '巢湖市', - 340190: '高新技术开发区', - 340191: '经济技术开发区', - 340202: '镜湖区', - 340203: '弋江区', - 340207: '鸠江区', - 340208: '三山区', - 340221: '芜湖县', - 340222: '繁昌县', - 340223: '南陵县', - 340225: '无为县', - 340302: '龙子湖区', - 340303: '蚌山区', - 340304: '禹会区', - 340311: '淮上区', - 340321: '怀远县', - 340322: '五河县', - 340323: '固镇县', - 340402: '大通区', - 340403: '田家庵区', - 340404: '谢家集区', - 340405: '八公山区', - 340406: '潘集区', - 340421: '凤台县', - 340422: '寿县', - 340503: '花山区', - 340504: '雨山区', - 340506: '博望区', - 340521: '当涂县', - 340522: '含山县', - 340523: '和县', - 340602: '杜集区', - 340603: '相山区', - 340604: '烈山区', - 340621: '濉溪县', - 340705: '铜官区', - 340706: '义安区', - 340711: '郊区', - 340722: '枞阳县', - 340802: '迎江区', - 340803: '大观区', - 340811: '宜秀区', - 340822: '怀宁县', - 340824: '潜山县', - 340825: '太湖县', - 340826: '宿松县', - 340827: '望江县', - 340828: '岳西县', - 340881: '桐城市', - 341002: '屯溪区', - 341003: '黄山区', - 341004: '徽州区', - 341021: '歙县', - 341022: '休宁县', - 341023: '黟县', - 341024: '祁门县', - 341102: '琅琊区', - 341103: '南谯区', - 341122: '来安县', - 341124: '全椒县', - 341125: '定远县', - 341126: '凤阳县', - 341181: '天长市', - 341182: '明光市', - 341202: '颍州区', - 341203: '颍东区', - 341204: '颍泉区', - 341221: '临泉县', - 341222: '太和县', - 341225: '阜南县', - 341226: '颍上县', - 341282: '界首市', - 341302: '埇桥区', - 341321: '砀山县', - 341322: '萧县', - 341323: '灵璧县', - 341324: '泗县', - 341390: '经济开发区', - 341502: '金安区', - 341503: '裕安区', - 341504: '叶集区', - 341522: '霍邱县', - 341523: '舒城县', - 341524: '金寨县', - 341525: '霍山县', - 341602: '谯城区', - 341621: '涡阳县', - 341622: '蒙城县', - 341623: '利辛县', - 341702: '贵池区', - 341721: '东至县', - 341722: '石台县', - 341723: '青阳县', - 341802: '宣州区', - 341821: '郎溪县', - 341822: '广德县', - 341823: '泾县', - 341824: '绩溪县', - 341825: '旌德县', - 341881: '宁国市', - 350102: '鼓楼区', - 350103: '台江区', - 350104: '仓山区', - 350105: '马尾区', - 350111: '晋安区', - 350112: '长乐区', - 350121: '闽侯县', - 350122: '连江县', - 350123: '罗源县', - 350124: '闽清县', - 350125: '永泰县', - 350128: '平潭县', - 350181: '福清市', - 350203: '思明区', - 350205: '海沧区', - 350206: '湖里区', - 350211: '集美区', - 350212: '同安区', - 350213: '翔安区', - 350302: '城厢区', - 350303: '涵江区', - 350304: '荔城区', - 350305: '秀屿区', - 350322: '仙游县', - 350402: '梅列区', - 350403: '三元区', - 350421: '明溪县', - 350423: '清流县', - 350424: '宁化县', - 350425: '大田县', - 350426: '尤溪县', - 350427: '沙县', - 350428: '将乐县', - 350429: '泰宁县', - 350430: '建宁县', - 350481: '永安市', - 350502: '鲤城区', - 350503: '丰泽区', - 350504: '洛江区', - 350505: '泉港区', - 350521: '惠安县', - 350524: '安溪县', - 350525: '永春县', - 350526: '德化县', - 350527: '金门县', - 350581: '石狮市', - 350582: '晋江市', - 350583: '南安市', - 350602: '芗城区', - 350603: '龙文区', - 350622: '云霄县', - 350623: '漳浦县', - 350624: '诏安县', - 350625: '长泰县', - 350626: '东山县', - 350627: '南靖县', - 350628: '平和县', - 350629: '华安县', - 350681: '龙海市', - 350702: '延平区', - 350703: '建阳区', - 350721: '顺昌县', - 350722: '浦城县', - 350723: '光泽县', - 350724: '松溪县', - 350725: '政和县', - 350781: '邵武市', - 350782: '武夷山市', - 350783: '建瓯市', - 350802: '新罗区', - 350803: '永定区', - 350821: '长汀县', - 350823: '上杭县', - 350824: '武平县', - 350825: '连城县', - 350881: '漳平市', - 350902: '蕉城区', - 350921: '霞浦县', - 350922: '古田县', - 350923: '屏南县', - 350924: '寿宁县', - 350925: '周宁县', - 350926: '柘荣县', - 350981: '福安市', - 350982: '福鼎市', - 360102: '东湖区', - 360103: '西湖区', - 360104: '青云谱区', - 360105: '湾里区', - 360111: '青山湖区', - 360112: '新建区', - 360121: '南昌县', - 360123: '安义县', - 360124: '进贤县', - 360190: '经济技术开发区', - 360192: '高新区', - 360202: '昌江区', - 360203: '珠山区', - 360222: '浮梁县', - 360281: '乐平市', - 360302: '安源区', - 360313: '湘东区', - 360321: '莲花县', - 360322: '上栗县', - 360323: '芦溪县', - 360402: '濂溪区', - 360403: '浔阳区', - 360404: '柴桑区', - 360423: '武宁县', - 360424: '修水县', - 360425: '永修县', - 360426: '德安县', - 360428: '都昌县', - 360429: '湖口县', - 360430: '彭泽县', - 360481: '瑞昌市', - 360482: '共青城市', - 360483: '庐山市', - 360490: '经济技术开发区', - 360502: '渝水区', - 360521: '分宜县', - 360602: '月湖区', - 360603: '余江区', - 360681: '贵溪市', - 360702: '章贡区', - 360703: '南康区', - 360704: '赣县区', - 360722: '信丰县', - 360723: '大余县', - 360724: '上犹县', - 360725: '崇义县', - 360726: '安远县', - 360727: '龙南县', - 360728: '定南县', - 360729: '全南县', - 360730: '宁都县', - 360731: '于都县', - 360732: '兴国县', - 360733: '会昌县', - 360734: '寻乌县', - 360735: '石城县', - 360781: '瑞金市', - 360802: '吉州区', - 360803: '青原区', - 360821: '吉安县', - 360822: '吉水县', - 360823: '峡江县', - 360824: '新干县', - 360825: '永丰县', - 360826: '泰和县', - 360827: '遂川县', - 360828: '万安县', - 360829: '安福县', - 360830: '永新县', - 360881: '井冈山市', - 360902: '袁州区', - 360921: '奉新县', - 360922: '万载县', - 360923: '上高县', - 360924: '宜丰县', - 360925: '靖安县', - 360926: '铜鼓县', - 360981: '丰城市', - 360982: '樟树市', - 360983: '高安市', - 361002: '临川区', - 361003: '东乡区', - 361021: '南城县', - 361022: '黎川县', - 361023: '南丰县', - 361024: '崇仁县', - 361025: '乐安县', - 361026: '宜黄县', - 361027: '金溪县', - 361028: '资溪县', - 361030: '广昌县', - 361102: '信州区', - 361103: '广丰区', - 361121: '上饶县', - 361123: '玉山县', - 361124: '铅山县', - 361125: '横峰县', - 361126: '弋阳县', - 361127: '余干县', - 361128: '鄱阳县', - 361129: '万年县', - 361130: '婺源县', - 361181: '德兴市', - 370102: '历下区', - 370103: '市中区', - 370104: '槐荫区', - 370105: '天桥区', - 370112: '历城区', - 370113: '长清区', - 370114: '章丘区', - 370115: '济阳区', - 370116: '莱芜区', - 370117: '钢城区', - 370124: '平阴县', - 370126: '商河县', - 370190: '高新区', - 370202: '市南区', - 370203: '市北区', - 370211: '黄岛区', - 370212: '崂山区', - 370213: '李沧区', - 370214: '城阳区', - 370215: '即墨区', - 370281: '胶州市', - 370283: '平度市', - 370285: '莱西市', - 370290: '开发区', - 370302: '淄川区', - 370303: '张店区', - 370304: '博山区', - 370305: '临淄区', - 370306: '周村区', - 370321: '桓台县', - 370322: '高青县', - 370323: '沂源县', - 370402: '市中区', - 370403: '薛城区', - 370404: '峄城区', - 370405: '台儿庄区', - 370406: '山亭区', - 370481: '滕州市', - 370502: '东营区', - 370503: '河口区', - 370505: '垦利区', - 370522: '利津县', - 370523: '广饶县', - 370602: '芝罘区', - 370611: '福山区', - 370612: '牟平区', - 370613: '莱山区', - 370634: '长岛县', - 370681: '龙口市', - 370682: '莱阳市', - 370683: '莱州市', - 370684: '蓬莱市', - 370685: '招远市', - 370686: '栖霞市', - 370687: '海阳市', - 370690: '开发区', - 370702: '潍城区', - 370703: '寒亭区', - 370704: '坊子区', - 370705: '奎文区', - 370724: '临朐县', - 370725: '昌乐县', - 370781: '青州市', - 370782: '诸城市', - 370783: '寿光市', - 370784: '安丘市', - 370785: '高密市', - 370786: '昌邑市', - 370790: '开发区', - 370791: '高新区', - 370811: '任城区', - 370812: '兖州区', - 370826: '微山县', - 370827: '鱼台县', - 370828: '金乡县', - 370829: '嘉祥县', - 370830: '汶上县', - 370831: '泗水县', - 370832: '梁山县', - 370881: '曲阜市', - 370883: '邹城市', - 370890: '高新区', - 370902: '泰山区', - 370911: '岱岳区', - 370921: '宁阳县', - 370923: '东平县', - 370982: '新泰市', - 370983: '肥城市', - 371002: '环翠区', - 371003: '文登区', - 371082: '荣成市', - 371083: '乳山市', - 371091: '经济技术开发区', - 371102: '东港区', - 371103: '岚山区', - 371121: '五莲县', - 371122: '莒县', - 371302: '兰山区', - 371311: '罗庄区', - 371312: '河东区', - 371321: '沂南县', - 371322: '郯城县', - 371323: '沂水县', - 371324: '兰陵县', - 371325: '费县', - 371326: '平邑县', - 371327: '莒南县', - 371328: '蒙阴县', - 371329: '临沭县', - 371402: '德城区', - 371403: '陵城区', - 371422: '宁津县', - 371423: '庆云县', - 371424: '临邑县', - 371425: '齐河县', - 371426: '平原县', - 371427: '夏津县', - 371428: '武城县', - 371481: '乐陵市', - 371482: '禹城市', - 371502: '东昌府区', - 371521: '阳谷县', - 371522: '莘县', - 371523: '茌平县', - 371524: '东阿县', - 371525: '冠县', - 371526: '高唐县', - 371581: '临清市', - 371602: '滨城区', - 371603: '沾化区', - 371621: '惠民县', - 371622: '阳信县', - 371623: '无棣县', - 371625: '博兴县', - 371681: '邹平市', - 371702: '牡丹区', - 371703: '定陶区', - 371721: '曹县', - 371722: '单县', - 371723: '成武县', - 371724: '巨野县', - 371725: '郓城县', - 371726: '鄄城县', - 371728: '东明县', - 410102: '中原区', - 410103: '二七区', - 410104: '管城回族区', - 410105: '金水区', - 410106: '上街区', - 410108: '惠济区', - 410122: '中牟县', - 410181: '巩义市', - 410182: '荥阳市', - 410183: '新密市', - 410184: '新郑市', - 410185: '登封市', - 410190: '高新技术开发区', - 410191: '经济技术开发区', - 410202: '龙亭区', - 410203: '顺河回族区', - 410204: '鼓楼区', - 410205: '禹王台区', - 410212: '祥符区', - 410221: '杞县', - 410222: '通许县', - 410223: '尉氏县', - 410225: '兰考县', - 410302: '老城区', - 410303: '西工区', - 410304: '瀍河回族区', - 410305: '涧西区', - 410306: '吉利区', - 410311: '洛龙区', - 410322: '孟津县', - 410323: '新安县', - 410324: '栾川县', - 410325: '嵩县', - 410326: '汝阳县', - 410327: '宜阳县', - 410328: '洛宁县', - 410329: '伊川县', - 410381: '偃师市', - 410402: '新华区', - 410403: '卫东区', - 410404: '石龙区', - 410411: '湛河区', - 410421: '宝丰县', - 410422: '叶县', - 410423: '鲁山县', - 410425: '郏县', - 410481: '舞钢市', - 410482: '汝州市', - 410502: '文峰区', - 410503: '北关区', - 410505: '殷都区', - 410506: '龙安区', - 410522: '安阳县', - 410523: '汤阴县', - 410526: '滑县', - 410527: '内黄县', - 410581: '林州市', - 410590: '开发区', - 410602: '鹤山区', - 410603: '山城区', - 410611: '淇滨区', - 410621: '浚县', - 410622: '淇县', - 410702: '红旗区', - 410703: '卫滨区', - 410704: '凤泉区', - 410711: '牧野区', - 410721: '新乡县', - 410724: '获嘉县', - 410725: '原阳县', - 410726: '延津县', - 410727: '封丘县', - 410728: '长垣县', - 410781: '卫辉市', - 410782: '辉县市', - 410802: '解放区', - 410803: '中站区', - 410804: '马村区', - 410811: '山阳区', - 410821: '修武县', - 410822: '博爱县', - 410823: '武陟县', - 410825: '温县', - 410882: '沁阳市', - 410883: '孟州市', - 410902: '华龙区', - 410922: '清丰县', - 410923: '南乐县', - 410926: '范县', - 410927: '台前县', - 410928: '濮阳县', - 411002: '魏都区', - 411003: '建安区', - 411024: '鄢陵县', - 411025: '襄城县', - 411081: '禹州市', - 411082: '长葛市', - 411102: '源汇区', - 411103: '郾城区', - 411104: '召陵区', - 411121: '舞阳县', - 411122: '临颍县', - 411202: '湖滨区', - 411203: '陕州区', - 411221: '渑池县', - 411224: '卢氏县', - 411281: '义马市', - 411282: '灵宝市', - 411302: '宛城区', - 411303: '卧龙区', - 411321: '南召县', - 411322: '方城县', - 411323: '西峡县', - 411324: '镇平县', - 411325: '内乡县', - 411326: '淅川县', - 411327: '社旗县', - 411328: '唐河县', - 411329: '新野县', - 411330: '桐柏县', - 411381: '邓州市', - 411402: '梁园区', - 411403: '睢阳区', - 411421: '民权县', - 411422: '睢县', - 411423: '宁陵县', - 411424: '柘城县', - 411425: '虞城县', - 411426: '夏邑县', - 411481: '永城市', - 411502: '浉河区', - 411503: '平桥区', - 411521: '罗山县', - 411522: '光山县', - 411523: '新县', - 411524: '商城县', - 411525: '固始县', - 411526: '潢川县', - 411527: '淮滨县', - 411528: '息县', - 411602: '川汇区', - 411621: '扶沟县', - 411622: '西华县', - 411623: '商水县', - 411624: '沈丘县', - 411625: '郸城县', - 411626: '淮阳县', - 411627: '太康县', - 411628: '鹿邑县', - 411681: '项城市', - 411690: '经济开发区', - 411702: '驿城区', - 411721: '西平县', - 411722: '上蔡县', - 411723: '平舆县', - 411724: '正阳县', - 411725: '确山县', - 411726: '泌阳县', - 411727: '汝南县', - 411728: '遂平县', - 411729: '新蔡县', - 419001: '济源市', - 420102: '江岸区', - 420103: '江汉区', - 420104: '硚口区', - 420105: '汉阳区', - 420106: '武昌区', - 420107: '青山区', - 420111: '洪山区', - 420112: '东西湖区', - 420113: '汉南区', - 420114: '蔡甸区', - 420115: '江夏区', - 420116: '黄陂区', - 420117: '新洲区', - 420202: '黄石港区', - 420203: '西塞山区', - 420204: '下陆区', - 420205: '铁山区', - 420222: '阳新县', - 420281: '大冶市', - 420302: '茅箭区', - 420303: '张湾区', - 420304: '郧阳区', - 420322: '郧西县', - 420323: '竹山县', - 420324: '竹溪县', - 420325: '房县', - 420381: '丹江口市', - 420502: '西陵区', - 420503: '伍家岗区', - 420504: '点军区', - 420505: '猇亭区', - 420506: '夷陵区', - 420525: '远安县', - 420526: '兴山县', - 420527: '秭归县', - 420528: '长阳土家族自治县', - 420529: '五峰土家族自治县', - 420581: '宜都市', - 420582: '当阳市', - 420583: '枝江市', - 420590: '经济开发区', - 420602: '襄城区', - 420606: '樊城区', - 420607: '襄州区', - 420624: '南漳县', - 420625: '谷城县', - 420626: '保康县', - 420682: '老河口市', - 420683: '枣阳市', - 420684: '宜城市', - 420702: '梁子湖区', - 420703: '华容区', - 420704: '鄂城区', - 420802: '东宝区', - 420804: '掇刀区', - 420822: '沙洋县', - 420881: '钟祥市', - 420882: '京山市', - 420902: '孝南区', - 420921: '孝昌县', - 420922: '大悟县', - 420923: '云梦县', - 420981: '应城市', - 420982: '安陆市', - 420984: '汉川市', - 421002: '沙市区', - 421003: '荆州区', - 421022: '公安县', - 421023: '监利县', - 421024: '江陵县', - 421081: '石首市', - 421083: '洪湖市', - 421087: '松滋市', - 421102: '黄州区', - 421121: '团风县', - 421122: '红安县', - 421123: '罗田县', - 421124: '英山县', - 421125: '浠水县', - 421126: '蕲春县', - 421127: '黄梅县', - 421181: '麻城市', - 421182: '武穴市', - 421202: '咸安区', - 421221: '嘉鱼县', - 421222: '通城县', - 421223: '崇阳县', - 421224: '通山县', - 421281: '赤壁市', - 421303: '曾都区', - 421321: '随县', - 421381: '广水市', - 422801: '恩施市', - 422802: '利川市', - 422822: '建始县', - 422823: '巴东县', - 422825: '宣恩县', - 422826: '咸丰县', - 422827: '来凤县', - 422828: '鹤峰县', - 429004: '仙桃市', - 429005: '潜江市', - 429006: '天门市', - 429021: '神农架林区', - 430102: '芙蓉区', - 430103: '天心区', - 430104: '岳麓区', - 430105: '开福区', - 430111: '雨花区', - 430112: '望城区', - 430121: '长沙县', - 430181: '浏阳市', - 430182: '宁乡市', - 430202: '荷塘区', - 430203: '芦淞区', - 430204: '石峰区', - 430211: '天元区', - 430212: '渌口区', - 430223: '攸县', - 430224: '茶陵县', - 430225: '炎陵县', - 430281: '醴陵市', - 430302: '雨湖区', - 430304: '岳塘区', - 430321: '湘潭县', - 430381: '湘乡市', - 430382: '韶山市', - 430405: '珠晖区', - 430406: '雁峰区', - 430407: '石鼓区', - 430408: '蒸湘区', - 430412: '南岳区', - 430421: '衡阳县', - 430422: '衡南县', - 430423: '衡山县', - 430424: '衡东县', - 430426: '祁东县', - 430481: '耒阳市', - 430482: '常宁市', - 430502: '双清区', - 430503: '大祥区', - 430511: '北塔区', - 430521: '邵东县', - 430522: '新邵县', - 430523: '邵阳县', - 430524: '隆回县', - 430525: '洞口县', - 430527: '绥宁县', - 430528: '新宁县', - 430529: '城步苗族自治县', - 430581: '武冈市', - 430602: '岳阳楼区', - 430603: '云溪区', - 430611: '君山区', - 430621: '岳阳县', - 430623: '华容县', - 430624: '湘阴县', - 430626: '平江县', - 430681: '汨罗市', - 430682: '临湘市', - 430702: '武陵区', - 430703: '鼎城区', - 430721: '安乡县', - 430722: '汉寿县', - 430723: '澧县', - 430724: '临澧县', - 430725: '桃源县', - 430726: '石门县', - 430781: '津市市', - 430802: '永定区', - 430811: '武陵源区', - 430821: '慈利县', - 430822: '桑植县', - 430902: '资阳区', - 430903: '赫山区', - 430921: '南县', - 430922: '桃江县', - 430923: '安化县', - 430981: '沅江市', - 431002: '北湖区', - 431003: '苏仙区', - 431021: '桂阳县', - 431022: '宜章县', - 431023: '永兴县', - 431024: '嘉禾县', - 431025: '临武县', - 431026: '汝城县', - 431027: '桂东县', - 431028: '安仁县', - 431081: '资兴市', - 431102: '零陵区', - 431103: '冷水滩区', - 431121: '祁阳县', - 431122: '东安县', - 431123: '双牌县', - 431124: '道县', - 431125: '江永县', - 431126: '宁远县', - 431127: '蓝山县', - 431128: '新田县', - 431129: '江华瑶族自治县', - 431202: '鹤城区', - 431221: '中方县', - 431222: '沅陵县', - 431223: '辰溪县', - 431224: '溆浦县', - 431225: '会同县', - 431226: '麻阳苗族自治县', - 431227: '新晃侗族自治县', - 431228: '芷江侗族自治县', - 431229: '靖州苗族侗族自治县', - 431230: '通道侗族自治县', - 431281: '洪江市', - 431302: '娄星区', - 431321: '双峰县', - 431322: '新化县', - 431381: '冷水江市', - 431382: '涟源市', - 433101: '吉首市', - 433122: '泸溪县', - 433123: '凤凰县', - 433124: '花垣县', - 433125: '保靖县', - 433126: '古丈县', - 433127: '永顺县', - 433130: '龙山县', - 440103: '荔湾区', - 440104: '越秀区', - 440105: '海珠区', - 440106: '天河区', - 440111: '白云区', - 440112: '黄埔区', - 440113: '番禺区', - 440114: '花都区', - 440115: '南沙区', - 440117: '从化区', - 440118: '增城区', - 440203: '武江区', - 440204: '浈江区', - 440205: '曲江区', - 440222: '始兴县', - 440224: '仁化县', - 440229: '翁源县', - 440232: '乳源瑶族自治县', - 440233: '新丰县', - 440281: '乐昌市', - 440282: '南雄市', - 440303: '罗湖区', - 440304: '福田区', - 440305: '南山区', - 440306: '宝安区', - 440307: '龙岗区', - 440308: '盐田区', - 440309: '龙华区', - 440310: '坪山区', - 440311: '光明区', - 440402: '香洲区', - 440403: '斗门区', - 440404: '金湾区', - 440507: '龙湖区', - 440511: '金平区', - 440512: '濠江区', - 440513: '潮阳区', - 440514: '潮南区', - 440515: '澄海区', - 440523: '南澳县', - 440604: '禅城区', - 440605: '南海区', - 440606: '顺德区', - 440607: '三水区', - 440608: '高明区', - 440703: '蓬江区', - 440704: '江海区', - 440705: '新会区', - 440781: '台山市', - 440783: '开平市', - 440784: '鹤山市', - 440785: '恩平市', - 440802: '赤坎区', - 440803: '霞山区', - 440804: '坡头区', - 440811: '麻章区', - 440823: '遂溪县', - 440825: '徐闻县', - 440881: '廉江市', - 440882: '雷州市', - 440883: '吴川市', - 440890: '经济技术开发区', - 440902: '茂南区', - 440904: '电白区', - 440981: '高州市', - 440982: '化州市', - 440983: '信宜市', - 441202: '端州区', - 441203: '鼎湖区', - 441204: '高要区', - 441223: '广宁县', - 441224: '怀集县', - 441225: '封开县', - 441226: '德庆县', - 441284: '四会市', - 441302: '惠城区', - 441303: '惠阳区', - 441322: '博罗县', - 441323: '惠东县', - 441324: '龙门县', - 441402: '梅江区', - 441403: '梅县区', - 441422: '大埔县', - 441423: '丰顺县', - 441424: '五华县', - 441426: '平远县', - 441427: '蕉岭县', - 441481: '兴宁市', - 441502: '城区', - 441521: '海丰县', - 441523: '陆河县', - 441581: '陆丰市', - 441602: '源城区', - 441621: '紫金县', - 441622: '龙川县', - 441623: '连平县', - 441624: '和平县', - 441625: '东源县', - 441702: '江城区', - 441704: '阳东区', - 441721: '阳西县', - 441781: '阳春市', - 441802: '清城区', - 441803: '清新区', - 441821: '佛冈县', - 441823: '阳山县', - 441825: '连山壮族瑶族自治县', - 441826: '连南瑶族自治县', - 441881: '英德市', - 441882: '连州市', - 441901: '中堂镇', - 441903: '南城街道办事处', - 441904: '长安镇', - 441905: '东坑镇', - 441906: '樟木头镇', - 441907: '莞城街道办事处', - 441908: '石龙镇', - 441909: '桥头镇', - 441910: '万江街道办事处', - 441911: '麻涌镇', - 441912: '虎门镇', - 441913: '谢岗镇', - 441914: '石碣镇', - 441915: '茶山镇', - 441916: '东城街道办事处', - 441917: '洪梅镇', - 441918: '道滘镇', - 441919: '高埗镇', - 441920: '企石镇', - 441921: '凤岗镇', - 441922: '大岭山镇', - 441923: '松山湖管委会', - 441924: '清溪镇', - 441925: '望牛墩镇', - 441926: '厚街镇', - 441927: '常平镇', - 441928: '寮步镇', - 441929: '石排镇', - 441930: '横沥镇', - 441931: '塘厦镇', - 441932: '黄江镇', - 441933: '大朗镇', - 441934: '东莞港', - 441935: '东莞生态园', - 441990: '沙田镇', - 442001: '南头镇', - 442002: '神湾镇', - 442003: '东凤镇', - 442004: '五桂山街道办事处', - 442005: '黄圃镇', - 442006: '小榄镇', - 442007: '石岐区街道办事处', - 442008: '横栏镇', - 442009: '三角镇', - 442010: '三乡镇', - 442011: '港口镇', - 442012: '沙溪镇', - 442013: '板芙镇', - 442015: '东升镇', - 442016: '阜沙镇', - 442017: '民众镇', - 442018: '东区街道办事处', - 442019: '火炬开发区街道办事处', - 442020: '西区街道办事处', - 442021: '南区街道办事处', - 442022: '古镇镇', - 442023: '坦洲镇', - 442024: '大涌镇', - 442025: '南朗镇', - 445102: '湘桥区', - 445103: '潮安区', - 445122: '饶平县', - 445202: '榕城区', - 445203: '揭东区', - 445222: '揭西县', - 445224: '惠来县', - 445281: '普宁市', - 445302: '云城区', - 445303: '云安区', - 445321: '新兴县', - 445322: '郁南县', - 445381: '罗定市', - 450102: '兴宁区', - 450103: '青秀区', - 450105: '江南区', - 450107: '西乡塘区', - 450108: '良庆区', - 450109: '邕宁区', - 450110: '武鸣区', - 450123: '隆安县', - 450124: '马山县', - 450125: '上林县', - 450126: '宾阳县', - 450127: '横县', - 450202: '城中区', - 450203: '鱼峰区', - 450204: '柳南区', - 450205: '柳北区', - 450206: '柳江区', - 450222: '柳城县', - 450223: '鹿寨县', - 450224: '融安县', - 450225: '融水苗族自治县', - 450226: '三江侗族自治县', - 450302: '秀峰区', - 450303: '叠彩区', - 450304: '象山区', - 450305: '七星区', - 450311: '雁山区', - 450312: '临桂区', - 450321: '阳朔县', - 450323: '灵川县', - 450324: '全州县', - 450325: '兴安县', - 450326: '永福县', - 450327: '灌阳县', - 450328: '龙胜各族自治县', - 450329: '资源县', - 450330: '平乐县', - 450332: '恭城瑶族自治县', - 450381: '荔浦市', - 450403: '万秀区', - 450405: '长洲区', - 450406: '龙圩区', - 450421: '苍梧县', - 450422: '藤县', - 450423: '蒙山县', - 450481: '岑溪市', - 450502: '海城区', - 450503: '银海区', - 450512: '铁山港区', - 450521: '合浦县', - 450602: '港口区', - 450603: '防城区', - 450621: '上思县', - 450681: '东兴市', - 450702: '钦南区', - 450703: '钦北区', - 450721: '灵山县', - 450722: '浦北县', - 450802: '港北区', - 450803: '港南区', - 450804: '覃塘区', - 450821: '平南县', - 450881: '桂平市', - 450902: '玉州区', - 450903: '福绵区', - 450921: '容县', - 450922: '陆川县', - 450923: '博白县', - 450924: '兴业县', - 450981: '北流市', - 451002: '右江区', - 451021: '田阳县', - 451022: '田东县', - 451023: '平果县', - 451024: '德保县', - 451026: '那坡县', - 451027: '凌云县', - 451028: '乐业县', - 451029: '田林县', - 451030: '西林县', - 451031: '隆林各族自治县', - 451081: '靖西市', - 451102: '八步区', - 451103: '平桂区', - 451121: '昭平县', - 451122: '钟山县', - 451123: '富川瑶族自治县', - 451202: '金城江区', - 451203: '宜州区', - 451221: '南丹县', - 451222: '天峨县', - 451223: '凤山县', - 451224: '东兰县', - 451225: '罗城仫佬族自治县', - 451226: '环江毛南族自治县', - 451227: '巴马瑶族自治县', - 451228: '都安瑶族自治县', - 451229: '大化瑶族自治县', - 451302: '兴宾区', - 451321: '忻城县', - 451322: '象州县', - 451323: '武宣县', - 451324: '金秀瑶族自治县', - 451381: '合山市', - 451402: '江州区', - 451421: '扶绥县', - 451422: '宁明县', - 451423: '龙州县', - 451424: '大新县', - 451425: '天等县', - 451481: '凭祥市', - 460105: '秀英区', - 460106: '龙华区', - 460107: '琼山区', - 460108: '美兰区', - 460202: '海棠区', - 460203: '吉阳区', - 460204: '天涯区', - 460205: '崖州区', - 460321: '西沙群岛', - 460322: '南沙群岛', - 460323: '中沙群岛的岛礁及其海域', - 460401: '那大镇', - 460402: '和庆镇', - 460403: '南丰镇', - 460404: '大成镇', - 460405: '雅星镇', - 460406: '兰洋镇', - 460407: '光村镇', - 460408: '木棠镇', - 460409: '海头镇', - 460410: '峨蔓镇', - 460411: '王五镇', - 460412: '白马井镇', - 460413: '中和镇', - 460414: '排浦镇', - 460415: '东成镇', - 460416: '新州镇', - 460417: '洋浦经济开发区', - 460418: '华南热作学院', - 469001: '五指山市', - 469002: '琼海市', - 469005: '文昌市', - 469006: '万宁市', - 469007: '东方市', - 469021: '定安县', - 469022: '屯昌县', - 469023: '澄迈县', - 469024: '临高县', - 469025: '白沙黎族自治县', - 469026: '昌江黎族自治县', - 469027: '乐东黎族自治县', - 469028: '陵水黎族自治县', - 469029: '保亭黎族苗族自治县', - 469030: '琼中黎族苗族自治县', - 500101: '万州区', - 500102: '涪陵区', - 500103: '渝中区', - 500104: '大渡口区', - 500105: '江北区', - 500106: '沙坪坝区', - 500107: '九龙坡区', - 500108: '南岸区', - 500109: '北碚区', - 500110: '綦江区', - 500111: '大足区', - 500112: '渝北区', - 500113: '巴南区', - 500114: '黔江区', - 500115: '长寿区', - 500116: '江津区', - 500117: '合川区', - 500118: '永川区', - 500119: '南川区', - 500120: '璧山区', - 500151: '铜梁区', - 500152: '潼南区', - 500153: '荣昌区', - 500154: '开州区', - 500155: '梁平区', - 500156: '武隆区', - 500229: '城口县', - 500230: '丰都县', - 500231: '垫江县', - 500233: '忠县', - 500235: '云阳县', - 500236: '奉节县', - 500237: '巫山县', - 500238: '巫溪县', - 500240: '石柱土家族自治县', - 500241: '秀山土家族苗族自治县', - 500242: '酉阳土家族苗族自治县', - 500243: '彭水苗族土家族自治县', - 510104: '锦江区', - 510105: '青羊区', - 510106: '金牛区', - 510107: '武侯区', - 510108: '成华区', - 510112: '龙泉驿区', - 510113: '青白江区', - 510114: '新都区', - 510115: '温江区', - 510116: '双流区', - 510117: '郫都区', - 510121: '金堂县', - 510129: '大邑县', - 510131: '蒲江县', - 510132: '新津县', - 510181: '都江堰市', - 510182: '彭州市', - 510183: '邛崃市', - 510184: '崇州市', - 510185: '简阳市', - 510191: '高新区', - 510302: '自流井区', - 510303: '贡井区', - 510304: '大安区', - 510311: '沿滩区', - 510321: '荣县', - 510322: '富顺县', - 510402: '东区', - 510403: '西区', - 510411: '仁和区', - 510421: '米易县', - 510422: '盐边县', - 510502: '江阳区', - 510503: '纳溪区', - 510504: '龙马潭区', - 510521: '泸县', - 510522: '合江县', - 510524: '叙永县', - 510525: '古蔺县', - 510603: '旌阳区', - 510604: '罗江区', - 510623: '中江县', - 510681: '广汉市', - 510682: '什邡市', - 510683: '绵竹市', - 510703: '涪城区', - 510704: '游仙区', - 510705: '安州区', - 510722: '三台县', - 510723: '盐亭县', - 510725: '梓潼县', - 510726: '北川羌族自治县', - 510727: '平武县', - 510781: '江油市', - 510791: '高新区', - 510802: '利州区', - 510811: '昭化区', - 510812: '朝天区', - 510821: '旺苍县', - 510822: '青川县', - 510823: '剑阁县', - 510824: '苍溪县', - 510903: '船山区', - 510904: '安居区', - 510921: '蓬溪县', - 510922: '射洪县', - 510923: '大英县', - 511002: '市中区', - 511011: '东兴区', - 511024: '威远县', - 511025: '资中县', - 511083: '隆昌市', - 511102: '市中区', - 511111: '沙湾区', - 511112: '五通桥区', - 511113: '金口河区', - 511123: '犍为县', - 511124: '井研县', - 511126: '夹江县', - 511129: '沐川县', - 511132: '峨边彝族自治县', - 511133: '马边彝族自治县', - 511181: '峨眉山市', - 511302: '顺庆区', - 511303: '高坪区', - 511304: '嘉陵区', - 511321: '南部县', - 511322: '营山县', - 511323: '蓬安县', - 511324: '仪陇县', - 511325: '西充县', - 511381: '阆中市', - 511402: '东坡区', - 511403: '彭山区', - 511421: '仁寿县', - 511423: '洪雅县', - 511424: '丹棱县', - 511425: '青神县', - 511502: '翠屏区', - 511503: '南溪区', - 511504: '叙州区', - 511523: '江安县', - 511524: '长宁县', - 511525: '高县', - 511526: '珙县', - 511527: '筠连县', - 511528: '兴文县', - 511529: '屏山县', - 511602: '广安区', - 511603: '前锋区', - 511621: '岳池县', - 511622: '武胜县', - 511623: '邻水县', - 511681: '华蓥市', - 511702: '通川区', - 511703: '达川区', - 511722: '宣汉县', - 511723: '开江县', - 511724: '大竹县', - 511725: '渠县', - 511781: '万源市', - 511802: '雨城区', - 511803: '名山区', - 511822: '荥经县', - 511823: '汉源县', - 511824: '石棉县', - 511825: '天全县', - 511826: '芦山县', - 511827: '宝兴县', - 511902: '巴州区', - 511903: '恩阳区', - 511921: '通江县', - 511922: '南江县', - 511923: '平昌县', - 512002: '雁江区', - 512021: '安岳县', - 512022: '乐至县', - 513201: '马尔康市', - 513221: '汶川县', - 513222: '理县', - 513223: '茂县', - 513224: '松潘县', - 513225: '九寨沟县', - 513226: '金川县', - 513227: '小金县', - 513228: '黑水县', - 513230: '壤塘县', - 513231: '阿坝县', - 513232: '若尔盖县', - 513233: '红原县', - 513301: '康定市', - 513322: '泸定县', - 513323: '丹巴县', - 513324: '九龙县', - 513325: '雅江县', - 513326: '道孚县', - 513327: '炉霍县', - 513328: '甘孜县', - 513329: '新龙县', - 513330: '德格县', - 513331: '白玉县', - 513332: '石渠县', - 513333: '色达县', - 513334: '理塘县', - 513335: '巴塘县', - 513336: '乡城县', - 513337: '稻城县', - 513338: '得荣县', - 513401: '西昌市', - 513422: '木里藏族自治县', - 513423: '盐源县', - 513424: '德昌县', - 513425: '会理县', - 513426: '会东县', - 513427: '宁南县', - 513428: '普格县', - 513429: '布拖县', - 513430: '金阳县', - 513431: '昭觉县', - 513432: '喜德县', - 513433: '冕宁县', - 513434: '越西县', - 513435: '甘洛县', - 513436: '美姑县', - 513437: '雷波县', - 520102: '南明区', - 520103: '云岩区', - 520111: '花溪区', - 520112: '乌当区', - 520113: '白云区', - 520115: '观山湖区', - 520121: '开阳县', - 520122: '息烽县', - 520123: '修文县', - 520181: '清镇市', - 520201: '钟山区', - 520203: '六枝特区', - 520221: '水城县', - 520281: '盘州市', - 520302: '红花岗区', - 520303: '汇川区', - 520304: '播州区', - 520322: '桐梓县', - 520323: '绥阳县', - 520324: '正安县', - 520325: '道真仡佬族苗族自治县', - 520326: '务川仡佬族苗族自治县', - 520327: '凤冈县', - 520328: '湄潭县', - 520329: '余庆县', - 520330: '习水县', - 520381: '赤水市', - 520382: '仁怀市', - 520402: '西秀区', - 520403: '平坝区', - 520422: '普定县', - 520423: '镇宁布依族苗族自治县', - 520424: '关岭布依族苗族自治县', - 520425: '紫云苗族布依族自治县', - 520502: '七星关区', - 520521: '大方县', - 520522: '黔西县', - 520523: '金沙县', - 520524: '织金县', - 520525: '纳雍县', - 520526: '威宁彝族回族苗族自治县', - 520527: '赫章县', - 520602: '碧江区', - 520603: '万山区', - 520621: '江口县', - 520622: '玉屏侗族自治县', - 520623: '石阡县', - 520624: '思南县', - 520625: '印江土家族苗族自治县', - 520626: '德江县', - 520627: '沿河土家族自治县', - 520628: '松桃苗族自治县', - 522301: '兴义市', - 522302: '兴仁市', - 522323: '普安县', - 522324: '晴隆县', - 522325: '贞丰县', - 522326: '望谟县', - 522327: '册亨县', - 522328: '安龙县', - 522601: '凯里市', - 522622: '黄平县', - 522623: '施秉县', - 522624: '三穗县', - 522625: '镇远县', - 522626: '岑巩县', - 522627: '天柱县', - 522628: '锦屏县', - 522629: '剑河县', - 522630: '台江县', - 522631: '黎平县', - 522632: '榕江县', - 522633: '从江县', - 522634: '雷山县', - 522635: '麻江县', - 522636: '丹寨县', - 522701: '都匀市', - 522702: '福泉市', - 522722: '荔波县', - 522723: '贵定县', - 522725: '瓮安县', - 522726: '独山县', - 522727: '平塘县', - 522728: '罗甸县', - 522729: '长顺县', - 522730: '龙里县', - 522731: '惠水县', - 522732: '三都水族自治县', - 530102: '五华区', - 530103: '盘龙区', - 530111: '官渡区', - 530112: '西山区', - 530113: '东川区', - 530114: '呈贡区', - 530115: '晋宁区', - 530124: '富民县', - 530125: '宜良县', - 530126: '石林彝族自治县', - 530127: '嵩明县', - 530128: '禄劝彝族苗族自治县', - 530129: '寻甸回族彝族自治县', - 530181: '安宁市', - 530302: '麒麟区', - 530303: '沾益区', - 530304: '马龙区', - 530322: '陆良县', - 530323: '师宗县', - 530324: '罗平县', - 530325: '富源县', - 530326: '会泽县', - 530381: '宣威市', - 530402: '红塔区', - 530403: '江川区', - 530422: '澄江县', - 530423: '通海县', - 530424: '华宁县', - 530425: '易门县', - 530426: '峨山彝族自治县', - 530427: '新平彝族傣族自治县', - 530428: '元江哈尼族彝族傣族自治县', - 530502: '隆阳区', - 530521: '施甸县', - 530523: '龙陵县', - 530524: '昌宁县', - 530581: '腾冲市', - 530602: '昭阳区', - 530621: '鲁甸县', - 530622: '巧家县', - 530623: '盐津县', - 530624: '大关县', - 530625: '永善县', - 530626: '绥江县', - 530627: '镇雄县', - 530628: '彝良县', - 530629: '威信县', - 530681: '水富市', - 530702: '古城区', - 530721: '玉龙纳西族自治县', - 530722: '永胜县', - 530723: '华坪县', - 530724: '宁蒗彝族自治县', - 530802: '思茅区', - 530821: '宁洱哈尼族彝族自治县', - 530822: '墨江哈尼族自治县', - 530823: '景东彝族自治县', - 530824: '景谷傣族彝族自治县', - 530825: '镇沅彝族哈尼族拉祜族自治县', - 530826: '江城哈尼族彝族自治县', - 530827: '孟连傣族拉祜族佤族自治县', - 530828: '澜沧拉祜族自治县', - 530829: '西盟佤族自治县', - 530902: '临翔区', - 530921: '凤庆县', - 530922: '云县', - 530923: '永德县', - 530924: '镇康县', - 530925: '双江拉祜族佤族布朗族傣族自治县', - 530926: '耿马傣族佤族自治县', - 530927: '沧源佤族自治县', - 532301: '楚雄市', - 532322: '双柏县', - 532323: '牟定县', - 532324: '南华县', - 532325: '姚安县', - 532326: '大姚县', - 532327: '永仁县', - 532328: '元谋县', - 532329: '武定县', - 532331: '禄丰县', - 532501: '个旧市', - 532502: '开远市', - 532503: '蒙自市', - 532504: '弥勒市', - 532523: '屏边苗族自治县', - 532524: '建水县', - 532525: '石屏县', - 532527: '泸西县', - 532528: '元阳县', - 532529: '红河县', - 532530: '金平苗族瑶族傣族自治县', - 532531: '绿春县', - 532532: '河口瑶族自治县', - 532601: '文山市', - 532622: '砚山县', - 532623: '西畴县', - 532624: '麻栗坡县', - 532625: '马关县', - 532626: '丘北县', - 532627: '广南县', - 532628: '富宁县', - 532801: '景洪市', - 532822: '勐海县', - 532823: '勐腊县', - 532901: '大理市', - 532922: '漾濞彝族自治县', - 532923: '祥云县', - 532924: '宾川县', - 532925: '弥渡县', - 532926: '南涧彝族自治县', - 532927: '巍山彝族回族自治县', - 532928: '永平县', - 532929: '云龙县', - 532930: '洱源县', - 532931: '剑川县', - 532932: '鹤庆县', - 533102: '瑞丽市', - 533103: '芒市', - 533122: '梁河县', - 533123: '盈江县', - 533124: '陇川县', - 533301: '泸水市', - 533323: '福贡县', - 533324: '贡山独龙族怒族自治县', - 533325: '兰坪白族普米族自治县', - 533401: '香格里拉市', - 533422: '德钦县', - 533423: '维西傈僳族自治县', - 540102: '城关区', - 540103: '堆龙德庆区', - 540104: '达孜区', - 540121: '林周县', - 540122: '当雄县', - 540123: '尼木县', - 540124: '曲水县', - 540127: '墨竹工卡县', - 540202: '桑珠孜区', - 540221: '南木林县', - 540222: '江孜县', - 540223: '定日县', - 540224: '萨迦县', - 540225: '拉孜县', - 540226: '昂仁县', - 540227: '谢通门县', - 540228: '白朗县', - 540229: '仁布县', - 540230: '康马县', - 540231: '定结县', - 540232: '仲巴县', - 540233: '亚东县', - 540234: '吉隆县', - 540235: '聂拉木县', - 540236: '萨嘎县', - 540237: '岗巴县', - 540302: '卡若区', - 540321: '江达县', - 540322: '贡觉县', - 540323: '类乌齐县', - 540324: '丁青县', - 540325: '察雅县', - 540326: '八宿县', - 540327: '左贡县', - 540328: '芒康县', - 540329: '洛隆县', - 540330: '边坝县', - 540402: '巴宜区', - 540421: '工布江达县', - 540422: '米林县', - 540423: '墨脱县', - 540424: '波密县', - 540425: '察隅县', - 540426: '朗县', - 540502: '乃东区', - 540521: '扎囊县', - 540522: '贡嘎县', - 540523: '桑日县', - 540524: '琼结县', - 540525: '曲松县', - 540526: '措美县', - 540527: '洛扎县', - 540528: '加查县', - 540529: '隆子县', - 540530: '错那县', - 540531: '浪卡子县', - 540602: '色尼区', - 540621: '嘉黎县', - 540622: '比如县', - 540623: '聂荣县', - 540624: '安多县', - 540625: '申扎县', - 540626: '索县', - 540627: '班戈县', - 540628: '巴青县', - 540629: '尼玛县', - 540630: '双湖县', - 542521: '普兰县', - 542522: '札达县', - 542523: '噶尔县', - 542524: '日土县', - 542525: '革吉县', - 542526: '改则县', - 542527: '措勤县', - 610102: '新城区', - 610103: '碑林区', - 610104: '莲湖区', - 610111: '灞桥区', - 610112: '未央区', - 610113: '雁塔区', - 610114: '阎良区', - 610115: '临潼区', - 610116: '长安区', - 610117: '高陵区', - 610118: '鄠邑区', - 610122: '蓝田县', - 610124: '周至县', - 610202: '王益区', - 610203: '印台区', - 610204: '耀州区', - 610222: '宜君县', - 610302: '渭滨区', - 610303: '金台区', - 610304: '陈仓区', - 610322: '凤翔县', - 610323: '岐山县', - 610324: '扶风县', - 610326: '眉县', - 610327: '陇县', - 610328: '千阳县', - 610329: '麟游县', - 610330: '凤县', - 610331: '太白县', - 610402: '秦都区', - 610403: '杨陵区', - 610404: '渭城区', - 610422: '三原县', - 610423: '泾阳县', - 610424: '乾县', - 610425: '礼泉县', - 610426: '永寿县', - 610428: '长武县', - 610429: '旬邑县', - 610430: '淳化县', - 610431: '武功县', - 610481: '兴平市', - 610482: '彬州市', - 610502: '临渭区', - 610503: '华州区', - 610522: '潼关县', - 610523: '大荔县', - 610524: '合阳县', - 610525: '澄城县', - 610526: '蒲城县', - 610527: '白水县', - 610528: '富平县', - 610581: '韩城市', - 610582: '华阴市', - 610602: '宝塔区', - 610603: '安塞区', - 610621: '延长县', - 610622: '延川县', - 610623: '子长县', - 610625: '志丹县', - 610626: '吴起县', - 610627: '甘泉县', - 610628: '富县', - 610629: '洛川县', - 610630: '宜川县', - 610631: '黄龙县', - 610632: '黄陵县', - 610702: '汉台区', - 610703: '南郑区', - 610722: '城固县', - 610723: '洋县', - 610724: '西乡县', - 610725: '勉县', - 610726: '宁强县', - 610727: '略阳县', - 610728: '镇巴县', - 610729: '留坝县', - 610730: '佛坪县', - 610802: '榆阳区', - 610803: '横山区', - 610822: '府谷县', - 610824: '靖边县', - 610825: '定边县', - 610826: '绥德县', - 610827: '米脂县', - 610828: '佳县', - 610829: '吴堡县', - 610830: '清涧县', - 610831: '子洲县', - 610881: '神木市', - 610902: '汉滨区', - 610921: '汉阴县', - 610922: '石泉县', - 610923: '宁陕县', - 610924: '紫阳县', - 610925: '岚皋县', - 610926: '平利县', - 610927: '镇坪县', - 610928: '旬阳县', - 610929: '白河县', - 611002: '商州区', - 611021: '洛南县', - 611022: '丹凤县', - 611023: '商南县', - 611024: '山阳县', - 611025: '镇安县', - 611026: '柞水县', - 620102: '城关区', - 620103: '七里河区', - 620104: '西固区', - 620105: '安宁区', - 620111: '红古区', - 620121: '永登县', - 620122: '皋兰县', - 620123: '榆中县', - 620201: '市辖区', - 620290: '雄关区', - 620291: '长城区', - 620292: '镜铁区', - 620293: '新城镇', - 620294: '峪泉镇', - 620295: '文殊镇', - 620302: '金川区', - 620321: '永昌县', - 620402: '白银区', - 620403: '平川区', - 620421: '靖远县', - 620422: '会宁县', - 620423: '景泰县', - 620502: '秦州区', - 620503: '麦积区', - 620521: '清水县', - 620522: '秦安县', - 620523: '甘谷县', - 620524: '武山县', - 620525: '张家川回族自治县', - 620602: '凉州区', - 620621: '民勤县', - 620622: '古浪县', - 620623: '天祝藏族自治县', - 620702: '甘州区', - 620721: '肃南裕固族自治县', - 620722: '民乐县', - 620723: '临泽县', - 620724: '高台县', - 620725: '山丹县', - 620802: '崆峒区', - 620821: '泾川县', - 620822: '灵台县', - 620823: '崇信县', - 620825: '庄浪县', - 620826: '静宁县', - 620881: '华亭市', - 620902: '肃州区', - 620921: '金塔县', - 620922: '瓜州县', - 620923: '肃北蒙古族自治县', - 620924: '阿克塞哈萨克族自治县', - 620981: '玉门市', - 620982: '敦煌市', - 621002: '西峰区', - 621021: '庆城县', - 621022: '环县', - 621023: '华池县', - 621024: '合水县', - 621025: '正宁县', - 621026: '宁县', - 621027: '镇原县', - 621102: '安定区', - 621121: '通渭县', - 621122: '陇西县', - 621123: '渭源县', - 621124: '临洮县', - 621125: '漳县', - 621126: '岷县', - 621202: '武都区', - 621221: '成县', - 621222: '文县', - 621223: '宕昌县', - 621224: '康县', - 621225: '西和县', - 621226: '礼县', - 621227: '徽县', - 621228: '两当县', - 622901: '临夏市', - 622921: '临夏县', - 622922: '康乐县', - 622923: '永靖县', - 622924: '广河县', - 622925: '和政县', - 622926: '东乡族自治县', - 622927: '积石山保安族东乡族撒拉族自治县', - 623001: '合作市', - 623021: '临潭县', - 623022: '卓尼县', - 623023: '舟曲县', - 623024: '迭部县', - 623025: '玛曲县', - 623026: '碌曲县', - 623027: '夏河县', - 630102: '城东区', - 630103: '城中区', - 630104: '城西区', - 630105: '城北区', - 630121: '大通回族土族自治县', - 630122: '湟中县', - 630123: '湟源县', - 630202: '乐都区', - 630203: '平安区', - 630222: '民和回族土族自治县', - 630223: '互助土族自治县', - 630224: '化隆回族自治县', - 630225: '循化撒拉族自治县', - 632221: '门源回族自治县', - 632222: '祁连县', - 632223: '海晏县', - 632224: '刚察县', - 632321: '同仁县', - 632322: '尖扎县', - 632323: '泽库县', - 632324: '河南蒙古族自治县', - 632521: '共和县', - 632522: '同德县', - 632523: '贵德县', - 632524: '兴海县', - 632525: '贵南县', - 632621: '玛沁县', - 632622: '班玛县', - 632623: '甘德县', - 632624: '达日县', - 632625: '久治县', - 632626: '玛多县', - 632701: '玉树市', - 632722: '杂多县', - 632723: '称多县', - 632724: '治多县', - 632725: '囊谦县', - 632726: '曲麻莱县', - 632801: '格尔木市', - 632802: '德令哈市', - 632803: '茫崖市', - 632821: '乌兰县', - 632822: '都兰县', - 632823: '天峻县', - 640104: '兴庆区', - 640105: '西夏区', - 640106: '金凤区', - 640121: '永宁县', - 640122: '贺兰县', - 640181: '灵武市', - 640202: '大武口区', - 640205: '惠农区', - 640221: '平罗县', - 640302: '利通区', - 640303: '红寺堡区', - 640323: '盐池县', - 640324: '同心县', - 640381: '青铜峡市', - 640402: '原州区', - 640422: '西吉县', - 640423: '隆德县', - 640424: '泾源县', - 640425: '彭阳县', - 640502: '沙坡头区', - 640521: '中宁县', - 640522: '海原县', - 650102: '天山区', - 650103: '沙依巴克区', - 650104: '新市区', - 650105: '水磨沟区', - 650106: '头屯河区', - 650107: '达坂城区', - 650109: '米东区', - 650121: '乌鲁木齐县', - 650202: '独山子区', - 650203: '克拉玛依区', - 650204: '白碱滩区', - 650205: '乌尔禾区', - 650402: '高昌区', - 650421: '鄯善县', - 650422: '托克逊县', - 650502: '伊州区', - 650521: '巴里坤哈萨克自治县', - 650522: '伊吾县', - 652301: '昌吉市', - 652302: '阜康市', - 652323: '呼图壁县', - 652324: '玛纳斯县', - 652325: '奇台县', - 652327: '吉木萨尔县', - 652328: '木垒哈萨克自治县', - 652701: '博乐市', - 652702: '阿拉山口市', - 652722: '精河县', - 652723: '温泉县', - 652801: '库尔勒市', - 652822: '轮台县', - 652823: '尉犁县', - 652824: '若羌县', - 652825: '且末县', - 652826: '焉耆回族自治县', - 652827: '和静县', - 652828: '和硕县', - 652829: '博湖县', - 652901: '阿克苏市', - 652922: '温宿县', - 652923: '库车县', - 652924: '沙雅县', - 652925: '新和县', - 652926: '拜城县', - 652927: '乌什县', - 652928: '阿瓦提县', - 652929: '柯坪县', - 653001: '阿图什市', - 653022: '阿克陶县', - 653023: '阿合奇县', - 653024: '乌恰县', - 653101: '喀什市', - 653121: '疏附县', - 653122: '疏勒县', - 653123: '英吉沙县', - 653124: '泽普县', - 653125: '莎车县', - 653126: '叶城县', - 653127: '麦盖提县', - 653128: '岳普湖县', - 653129: '伽师县', - 653130: '巴楚县', - 653131: '塔什库尔干塔吉克自治县', - 653201: '和田市', - 653221: '和田县', - 653222: '墨玉县', - 653223: '皮山县', - 653224: '洛浦县', - 653225: '策勒县', - 653226: '于田县', - 653227: '民丰县', - 654002: '伊宁市', - 654003: '奎屯市', - 654004: '霍尔果斯市', - 654021: '伊宁县', - 654022: '察布查尔锡伯自治县', - 654023: '霍城县', - 654024: '巩留县', - 654025: '新源县', - 654026: '昭苏县', - 654027: '特克斯县', - 654028: '尼勒克县', - 654201: '塔城市', - 654202: '乌苏市', - 654221: '额敏县', - 654223: '沙湾县', - 654224: '托里县', - 654225: '裕民县', - 654226: '和布克赛尔蒙古自治县', - 654301: '阿勒泰市', - 654321: '布尔津县', - 654322: '富蕴县', - 654323: '福海县', - 654324: '哈巴河县', - 654325: '青河县', - 654326: '吉木乃县', - 659001: '石河子市', - 659002: '阿拉尔市', - 659003: '图木舒克市', - 659004: '五家渠市', - 659005: '北屯市', - 659006: '铁门关市', - 659007: '双河市', - 659008: '可克达拉市', - 659009: '昆玉市', - 710101: '中正区', - 710102: '大同区', - 710103: '中山区', - 710104: '松山区', - 710105: '大安区', - 710106: '万华区', - 710107: '信义区', - 710108: '士林区', - 710109: '北投区', - 710110: '内湖区', - 710111: '南港区', - 710112: '文山区', - 710199: '其它区', - 710201: '新兴区', - 710202: '前金区', - 710203: '芩雅区', - 710204: '盐埕区', - 710205: '鼓山区', - 710206: '旗津区', - 710207: '前镇区', - 710208: '三民区', - 710209: '左营区', - 710210: '楠梓区', - 710211: '小港区', - 710241: '苓雅区', - 710242: '仁武区', - 710243: '大社区', - 710244: '冈山区', - 710245: '路竹区', - 710246: '阿莲区', - 710247: '田寮区', - 710248: '燕巢区', - 710249: '桥头区', - 710250: '梓官区', - 710251: '弥陀区', - 710252: '永安区', - 710253: '湖内区', - 710254: '凤山区', - 710255: '大寮区', - 710256: '林园区', - 710257: '鸟松区', - 710258: '大树区', - 710259: '旗山区', - 710260: '美浓区', - 710261: '六龟区', - 710262: '内门区', - 710263: '杉林区', - 710264: '甲仙区', - 710265: '桃源区', - 710266: '那玛夏区', - 710267: '茂林区', - 710268: '茄萣区', - 710299: '其它区', - 710301: '中西区', - 710302: '东区', - 710303: '南区', - 710304: '北区', - 710305: '安平区', - 710306: '安南区', - 710339: '永康区', - 710340: '归仁区', - 710341: '新化区', - 710342: '左镇区', - 710343: '玉井区', - 710344: '楠西区', - 710345: '南化区', - 710346: '仁德区', - 710347: '关庙区', - 710348: '龙崎区', - 710349: '官田区', - 710350: '麻豆区', - 710351: '佳里区', - 710352: '西港区', - 710353: '七股区', - 710354: '将军区', - 710355: '学甲区', - 710356: '北门区', - 710357: '新营区', - 710358: '后壁区', - 710359: '白河区', - 710360: '东山区', - 710361: '六甲区', - 710362: '下营区', - 710363: '柳营区', - 710364: '盐水区', - 710365: '善化区', - 710366: '大内区', - 710367: '山上区', - 710368: '新市区', - 710369: '安定区', - 710399: '其它区', - 710401: '中区', - 710402: '东区', - 710403: '南区', - 710404: '西区', - 710405: '北区', - 710406: '北屯区', - 710407: '西屯区', - 710408: '南屯区', - 710431: '太平区', - 710432: '大里区', - 710433: '雾峰区', - 710434: '乌日区', - 710435: '丰原区', - 710436: '后里区', - 710437: '石冈区', - 710438: '东势区', - 710439: '和平区', - 710440: '新社区', - 710441: '潭子区', - 710442: '大雅区', - 710443: '神冈区', - 710444: '大肚区', - 710445: '沙鹿区', - 710446: '龙井区', - 710447: '梧栖区', - 710448: '清水区', - 710449: '大甲区', - 710450: '外埔区', - 710451: '大安区', - 710499: '其它区', - 710507: '金沙镇', - 710508: '金湖镇', - 710509: '金宁乡', - 710510: '金城镇', - 710511: '烈屿乡', - 710512: '乌坵乡', - 710614: '南投市', - 710615: '中寮乡', - 710616: '草屯镇', - 710617: '国姓乡', - 710618: '埔里镇', - 710619: '仁爱乡', - 710620: '名间乡', - 710621: '集集镇', - 710622: '水里乡', - 710623: '鱼池乡', - 710624: '信义乡', - 710625: '竹山镇', - 710626: '鹿谷乡', - 710701: '仁爱区', - 710702: '信义区', - 710703: '中正区', - 710704: '中山区', - 710705: '安乐区', - 710706: '暖暖区', - 710707: '七堵区', - 710799: '其它区', - 710801: '东区', - 710802: '北区', - 710803: '香山区', - 710899: '其它区', - 710901: '东区', - 710902: '西区', - 710999: '其它区', - 711130: '万里区', - 711132: '板桥区', - 711133: '汐止区', - 711134: '深坑区', - 711135: '石碇区', - 711136: '瑞芳区', - 711137: '平溪区', - 711138: '双溪区', - 711139: '贡寮区', - 711140: '新店区', - 711141: '坪林区', - 711142: '乌来区', - 711143: '永和区', - 711144: '中和区', - 711145: '土城区', - 711146: '三峡区', - 711147: '树林区', - 711148: '莺歌区', - 711149: '三重区', - 711150: '新庄区', - 711151: '泰山区', - 711152: '林口区', - 711153: '芦洲区', - 711154: '五股区', - 711155: '八里区', - 711156: '淡水区', - 711157: '三芝区', - 711158: '石门区', - 711287: '宜兰市', - 711288: '头城镇', - 711289: '礁溪乡', - 711290: '壮围乡', - 711291: '员山乡', - 711292: '罗东镇', - 711293: '三星乡', - 711294: '大同乡', - 711295: '五结乡', - 711296: '冬山乡', - 711297: '苏澳镇', - 711298: '南澳乡', - 711299: '钓鱼台', - 711387: '竹北市', - 711388: '湖口乡', - 711389: '新丰乡', - 711390: '新埔镇', - 711391: '关西镇', - 711392: '芎林乡', - 711393: '宝山乡', - 711394: '竹东镇', - 711395: '五峰乡', - 711396: '横山乡', - 711397: '尖石乡', - 711398: '北埔乡', - 711399: '峨眉乡', - 711414: '中坜区', - 711415: '平镇区', - 711417: '杨梅区', - 711418: '新屋区', - 711419: '观音区', - 711420: '桃园区', - 711421: '龟山区', - 711422: '八德区', - 711423: '大溪区', - 711425: '大园区', - 711426: '芦竹区', - 711487: '中坜市', - 711488: '平镇市', - 711489: '龙潭乡', - 711490: '杨梅市', - 711491: '新屋乡', - 711492: '观音乡', - 711493: '桃园市', - 711494: '龟山乡', - 711495: '八德市', - 711496: '大溪镇', - 711497: '复兴乡', - 711498: '大园乡', - 711499: '芦竹乡', - 711520: '头份市', - 711582: '竹南镇', - 711583: '头份镇', - 711584: '三湾乡', - 711585: '南庄乡', - 711586: '狮潭乡', - 711587: '后龙镇', - 711588: '通霄镇', - 711589: '苑里镇', - 711590: '苗栗市', - 711591: '造桥乡', - 711592: '头屋乡', - 711593: '公馆乡', - 711594: '大湖乡', - 711595: '泰安乡', - 711596: '铜锣乡', - 711597: '三义乡', - 711598: '西湖乡', - 711599: '卓兰镇', - 711736: '员林市', - 711774: '彰化市', - 711775: '芬园乡', - 711776: '花坛乡', - 711777: '秀水乡', - 711778: '鹿港镇', - 711779: '福兴乡', - 711780: '线西乡', - 711781: '和美镇', - 711782: '伸港乡', - 711783: '员林镇', - 711784: '社头乡', - 711785: '永靖乡', - 711786: '埔心乡', - 711787: '溪湖镇', - 711788: '大村乡', - 711789: '埔盐乡', - 711790: '田中镇', - 711791: '北斗镇', - 711792: '田尾乡', - 711793: '埤头乡', - 711794: '溪州乡', - 711795: '竹塘乡', - 711796: '二林镇', - 711797: '大城乡', - 711798: '芳苑乡', - 711799: '二水乡', - 711982: '番路乡', - 711983: '梅山乡', - 711984: '竹崎乡', - 711985: '阿里山乡', - 711986: '中埔乡', - 711987: '大埔乡', - 711988: '水上乡', - 711989: '鹿草乡', - 711990: '太保市', - 711991: '朴子市', - 711992: '东石乡', - 711993: '六脚乡', - 711994: '新港乡', - 711995: '民雄乡', - 711996: '大林镇', - 711997: '溪口乡', - 711998: '义竹乡', - 711999: '布袋镇', - 712180: '斗南镇', - 712181: '大埤乡', - 712182: '虎尾镇', - 712183: '土库镇', - 712184: '褒忠乡', - 712185: '东势乡', - 712186: '台西乡', - 712187: '仑背乡', - 712188: '麦寮乡', - 712189: '斗六市', - 712190: '林内乡', - 712191: '古坑乡', - 712192: '莿桐乡', - 712193: '西螺镇', - 712194: '二仑乡', - 712195: '北港镇', - 712196: '水林乡', - 712197: '口湖乡', - 712198: '四湖乡', - 712199: '元长乡', - 712451: '崁顶乡', - 712467: '屏东市', - 712468: '三地门乡', - 712469: '雾台乡', - 712470: '玛家乡', - 712471: '九如乡', - 712472: '里港乡', - 712473: '高树乡', - 712474: '盐埔乡', - 712475: '长治乡', - 712476: '麟洛乡', - 712477: '竹田乡', - 712478: '内埔乡', - 712479: '万丹乡', - 712480: '潮州镇', - 712481: '泰武乡', - 712482: '来义乡', - 712483: '万峦乡', - 712484: '莰顶乡', - 712485: '新埤乡', - 712486: '南州乡', - 712487: '林边乡', - 712488: '东港镇', - 712489: '琉球乡', - 712490: '佳冬乡', - 712491: '新园乡', - 712492: '枋寮乡', - 712493: '枋山乡', - 712494: '春日乡', - 712495: '狮子乡', - 712496: '车城乡', - 712497: '牡丹乡', - 712498: '恒春镇', - 712499: '满州乡', - 712584: '台东市', - 712585: '绿岛乡', - 712586: '兰屿乡', - 712587: '延平乡', - 712588: '卑南乡', - 712589: '鹿野乡', - 712590: '关山镇', - 712591: '海端乡', - 712592: '池上乡', - 712593: '东河乡', - 712594: '成功镇', - 712595: '长滨乡', - 712596: '金峰乡', - 712597: '大武乡', - 712598: '达仁乡', - 712599: '太麻里乡', - 712686: '花莲市', - 712687: '新城乡', - 712688: '太鲁阁', - 712689: '秀林乡', - 712690: '吉安乡', - 712691: '寿丰乡', - 712692: '凤林镇', - 712693: '光复乡', - 712694: '丰滨乡', - 712695: '瑞穗乡', - 712696: '万荣乡', - 712697: '玉里镇', - 712698: '卓溪乡', - 712699: '富里乡', - 712794: '马公市', - 712795: '西屿乡', - 712796: '望安乡', - 712797: '七美乡', - 712798: '白沙乡', - 712799: '湖西乡', - 712896: '南竿乡', - 712897: '北竿乡', - 712898: '东引乡', - 712899: '莒光乡', - 810101: '中西区', - 810102: '湾仔区', - 810103: '东区', - 810104: '南区', - 810201: '九龙城区', - 810202: '油尖旺区', - 810203: '深水埗区', - 810204: '黄大仙区', - 810205: '观塘区', - 810301: '北区', - 810302: '大埔区', - 810303: '沙田区', - 810304: '西贡区', - 810305: '元朗区', - 810306: '屯门区', - 810307: '荃湾区', - 810308: '葵青区', - 810309: '离岛区', - 820102: '花地玛堂区', - 820103: '花王堂区', - 820104: '望德堂区', - 820105: '大堂区', - 820106: '风顺堂区', - 820202: '嘉模堂区', - 820203: '路氹填海区', - 820204: '圣方济各堂区' - } -}; diff --git a/smart-admin-h5/src/constants/erp/contact-company.js b/smart-admin-h5/src/constants/erp/contact-company.js deleted file mode 100644 index b3730d9b..00000000 --- a/smart-admin-h5/src/constants/erp/contact-company.js +++ /dev/null @@ -1,165 +0,0 @@ -/** - * 往来单位性质 - * @type {{ENTERPRISE: {value: number, desc: string}, PERSONAL: {value: number, desc: string}}} - */ -export const CONTACT_COMPANY_NATURE_ENUM = - { - ENTERPRISE: { - value: 0, - desc: '企业' - }, - PERSONAL: { - value: 1, - desc: '个人' - } - }; -/** - * 往来机构类型 - * @type {{CUSTOMER: {value: number, desc: string}, SUPPLIER: {value: number, desc: string}}} - */ -export const - CONTACT_COMPANY_TYPE_ENUM = - { - CUSTOMER: { - value: 0, - desc: '客户' - }, - SUPPLIER: { - value: 1, - desc: '供应商' - }, - SCHOOL: { - value: 2, - desc: '分校' - }, - COOPERATIVE_ORG: { - value: 3, - desc: '合作机构' - } - }; - -/** - * 付款方式 - * @type {{BANK: {value: number, desc: string}, ZHI_FU_BAO: {value: number, desc: string}, WE_CHAT: {value: number, desc: string}}} - */ -export const - PAYMENT_TYPE_ENUM = - { - BANK: { - value: 0, - desc: '银行卡' - }, - WE_CHAT: { - value: 1, - desc: '微信' - }, - ZHI_FU_BAO: { - value: 2, - desc: '支付宝' - } - }; - -/** - * 往来机构余额类型 - * @type {{RECEIVE_BALANCE: {value: number, desc: string}, PAY_BALANCE: {value: number, desc: string}}} - */ -export const - CONTACT_COMPANY_BALANCE_TYPE = - { - PAY_BALANCE: { - value: 0, - desc: '应付款余额' - }, - RECEIVE_BALANCE: { - value: 1, - desc: '应收款余额' - } - }; - -/** - * 往来单位等级 - * @type {{CORE: {value: number, desc: string}, POTENTIAL: {value: number, desc: string}, BAD: {value: number, desc: string}, GENERAL: {value: number, desc: string}}} - */ -export const CONTACT_COMPANY_GRADE_ENUM = { - CORE: { - value: 1, - desc: '核心', - color: 'green' - }, - POTENTIAL: { - value: 2, - desc: '有潜力', - color: 'cyan' - }, - GENERAL: { - value: 3, - desc: '普通', - color: 'blue' - }, - BAD: { - value: 4, - desc: '较差', - color: 'purple' - } -}; - -/** - * 往来单位等级 - * @type {{OWNER: {value: number, desc: string}, SHARER: {value: number, desc: string}, COMMON: {value: number, desc: string}}} - */ -export const CONTACT_COMPANY_SHARE_TYPE_ENUM = { - OWNER: { - value: 0, - desc: '属于我的' - }, - SHARER: { - value: 1, - desc: '共享的' - }, - COMMON: { - value: 2, - desc: '公共的' - } -}; - -/** - * 往来单位标签 - * @type {{OWNER: {value: number, desc: string}, SHARER: {value: number, desc: string}, COMMON: {value: number, desc: string}}} - */ -export const CONTACT_COMPANY_TAG_ENUM = { - POTENTIAL: { - value: 0, - desc: '潜在', - color: 'green' - }, - INTENTION: { - value: 1, - desc: '意向', - color: 'cyan' - }, - NEGOTIATION: { - value: 2, - desc: '洽谈', - color: 'blue' - }, - DEAL: { - value: 3, - desc: '成交', - color: 'geekblue' - }, - LOSS: { - value: 4, - desc: '流失', - color: 'red' - } -}; - -export default { - CONTACT_COMPANY_NATURE_ENUM, - CONTACT_COMPANY_TYPE_ENUM, - PAYMENT_TYPE_ENUM, - CONTACT_COMPANY_BALANCE_TYPE, - CONTACT_COMPANY_GRADE_ENUM, - CONTACT_COMPANY_SHARE_TYPE_ENUM, - CONTACT_COMPANY_TAG_ENUM -}; diff --git a/smart-admin-h5/src/constants/erp/index.js b/smart-admin-h5/src/constants/erp/index.js deleted file mode 100644 index b14cb861..00000000 --- a/smart-admin-h5/src/constants/erp/index.js +++ /dev/null @@ -1,6 +0,0 @@ -import contactCompany from './contact-company'; - -export default { - ...contactCompany -}; - diff --git a/smart-admin-h5/src/constants/file.js b/smart-admin-h5/src/constants/file.js deleted file mode 100644 index cc72166b..00000000 --- a/smart-admin-h5/src/constants/file.js +++ /dev/null @@ -1,92 +0,0 @@ -export const COMMON_FILE_FOLDER_TYPE_ENUM = { - DISPLAY_PIC: { - value: 1, - desc: '轮播展示图' - }, - RESOURCE_LECTURER: { - value: 2, - desc: '资源-讲师图片' - }, - RESOURCE_FILE: { - value: 3, - desc: '资源-文件资源' - }, - USER_AVATAR: { - value: 4, - desc: '用户头像' - }, - STOCK_BASIC: { - value: 5, - desc: '货物基本信息图片' - }, - PUBLICATION_QR_CODE: { - value: 6, - desc: '出版物二维码图片' - }, - RESOURCE_PAGE_QR_CODE: { - value: 7, - desc: '资源页面链接二维码图片' - }, - FINANCE_RECEIVE_QR_CODE: { - value: 8, - desc: '财务收款二维码' - }, - FINANCE_WX_PAY_CERT: { - value: 9, - desc: '财务-微信支付证书' - }, - GOODS: { - value: 10, - desc: '商品图片-公用文件夹' - }, - EXCEL_EXPORT: { - value: 11, - desc: 'excel导出-私有文件夹' - }, - FINANCE_WAIT_PAYMENT_PAYMENT_PROOF: { - value: 12, - desc: '财务待支付支付凭证' - }, - FEEDBACK: { - value: 99, - desc: '用户反馈图片' - }, - EDITOR: { - value: 100, - desc: '文本编辑器' - }, - EDITOR_IMG: { - value: 100, - desc: '文本编辑器' - }, - INTERNAL_INFORMATION: { - value: 14, - desc: '内部资料' - }, - CRM_USER: { - value: 111, - desc: 'CRM学员跟进附件' - }, - CRM_SCHOOL: { - value: 112, - desc: 'CRM分校跟进附件' - }, - // = =======erp 相关 begin============ - ERP_STOCK_IMG: { - value: 201, - desc: '货物图片' - }, - ERP_CONTACT_COMPANY_RECEIVE_IMAGE: { - value: 210, - desc: '往来单位收款二维码' - }, - ERP_CONTACT_COMPANY_ATTACHMENT: { - value: 211, - desc: '往来单位附件' - } - // = =======erp 相关 end ============ -}; - -export default { - COMMON_FILE_FOLDER_TYPE_ENUM -}; diff --git a/smart-admin-h5/src/constants/index.js b/smart-admin-h5/src/constants/index.js deleted file mode 100644 index 384b7029..00000000 --- a/smart-admin-h5/src/constants/index.js +++ /dev/null @@ -1,7 +0,0 @@ -import school from '@/constants/school'; -import erp from './erp'; - -export default { - ...school, - ...erp -}; diff --git a/smart-admin-h5/src/constants/school.js b/smart-admin-h5/src/constants/school.js deleted file mode 100644 index aa69bd01..00000000 --- a/smart-admin-h5/src/constants/school.js +++ /dev/null @@ -1,71 +0,0 @@ -/** - * 分校标签 - */ -export const SCHOOL_TAG_ENUM = { - POTENTIAL: { - value: 0, - desc: '潜在' - }, - INTENTION: { - value: 1, - desc: '意向' - }, - NEGOTIATION: { - value: 2, - desc: '洽谈' - }, - DEAL: { - value: 3, - desc: '成交' - }, - LOSS: { - value: 4, - desc: '流失' - } -}; - -/** - * 分校等级 - */ -export const SCHOOL_GRADE_ENUM = { - CORE: { - value: 1, - desc: '核心' - }, - POTENTIAL: { - value: 2, - desc: '有潜力' - }, - GENERAL: { - value: 3, - desc: '普通' - }, - BAD: { - value: 4, - desc: '较差' - } -}; - -/** - * 共享类型 - */ -export const SCHOOL_SHARE_TYPE_ENUM = { - OWNER: { - value: 0, - desc: '属于我的' - }, - SHARER: { - value: 1, - desc: '共享的' - }, - COMMON: { - value: 2, - desc: '公共的' - } -}; - -export default { - SCHOOL_TAG_ENUM, - SCHOOL_GRADE_ENUM, - SCHOOL_SHARE_TYPE_ENUM -}; diff --git a/smart-admin-h5/src/filters/filter.js b/smart-admin-h5/src/filters/filter.js deleted file mode 100644 index 5bb102f2..00000000 --- a/smart-admin-h5/src/filters/filter.js +++ /dev/null @@ -1,298 +0,0 @@ -import Vue from 'vue'; - -function ellipsis(value, length) { - if (!value) return ''; - if (value.length > length) { - return value.slice(0, length) + '...'; - } - return value; -} - -/** - * 去除空格 type 1-所有空格 2-前后空格 3-前空格 4-后空格 - */ -function trim(value, trim) { - switch (trim) { - case 1: - return value.replace(/\s+/g, ''); - case 2: - return value.replace(/(^\s*)|(\s*$)/g, ''); - case 3: - return value.replace(/(^\s*)/g, ''); - case 4: - return value.replace(/(\s*$)/g, ''); - default: - return value; - } -} - -/** - * 任意格式日期处理 - 使用格式: - {{ '2018-09-14 01:05' | formatDate(yyyy-MM-dd hh:mm:ss) }} - {{ '2018-09-14 01:05' | formatDate(yyyy-MM-dd) }} - {{ '2018-09-14 01:05' | formatDate(MM/dd) }} 等 - - * @param value - * @param fmt - * @returns {*} - */ -function formatDate(value, fmt) { - var date = new Date(value); - var o = { - 'M+': date.getMonth() + 1, // 月份 - 'd+': date.getDate(), // 日 - 'h+': date.getHours(), // 小时 - 'm+': date.getMinutes(), // 分 - 's+': date.getSeconds(), // 秒 - 'w+': date.getDay(), // 星期 - 'q+': Math.floor((date.getMonth() + 3) / 3), // 季度 - 'S': date.getMilliseconds() // 毫秒 - }; - if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length)); - for (var k in o) { - if (k === 'w+') { - if (o[k] === 0) { - fmt = fmt.replace('w', '周日'); - } else if (o[k] === 1) { - fmt = fmt.replace('w', '周一'); - } else if (o[k] === 2) { - fmt = fmt.replace('w', '周二'); - } else if (o[k] === 3) { - fmt = fmt.replace('w', '周三'); - } else if (o[k] === 4) { - fmt = fmt.replace('w', '周四'); - } else if (o[k] === 5) { - fmt = fmt.replace('w', '周五'); - } else if (o[k] === 6) { - fmt = fmt.replace('w', '周六'); - } - } else if (new RegExp('(' + k + ')').test(fmt)) { - fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length))); - } - } - return fmt; -} - -/** - * 字母大小写切换 - type - 1:首字母大写 - 2:首页母小写 - 3:大小写转换 - 4:全部大写 - 5:全部小写 - * @param str - * @param type - * @returns {string|*} - */ -function changeCase(str, type) { - function ToggleCase(str) { - var itemText = ''; - str.split('').forEach( - function(item) { - if (/^([a-z]+)/.test(item)) { - itemText += item.toUpperCase(); - } else if (/^([A-Z]+)/.test(item)) { - itemText += item.toLowerCase(); - } else { - itemText += item; - } - }); - return itemText; - } - - switch (type) { - case 1: - return str.replace(/\b\w+\b/g, function(word) { - return word.substring(0, 1).toUpperCase() + word.substring(1).toLowerCase(); - }); - case 2: - return str.replace(/\b\w+\b/g, function(word) { - return word.substring(0, 1).toLowerCase() + word.substring(1).toUpperCase(); - }); - case 3: - return ToggleCase(str); - case 4: - return str.toUpperCase(); - case 5: - return str.toLowerCase(); - default: - return str; - } -} - -/** - * 字符串循环复制,count->次数 - */ -function repeatStr(str, count) { - var text = ''; - for (var i = 0; i < count; i++) { - text += str; - } - return text; -} - -/** - * 字符串替换 - */ -function replaceAll(str, AFindText, ARepText) { - const raRegExp = new RegExp(AFindText, 'g'); - return str.replace(raRegExp, ARepText); -} - -/** - * - * 字符替换*,隐藏手机号或者身份证号等 - replaceStr(字符串,字符格式, 替换方式,替换的字符(默认*)) - ecDo.replaceStr('18819322663',[3,5,3],0) - result:188*****663 - ecDo.replaceStr('asdasdasdaa',[3,5,3],1) - result:***asdas*** - ecDo.replaceStr('1asd88465asdwqe3',[5],0) - result:*****8465asdwqe3 - ecDo.replaceStr('1asd88465asdwqe3',[5],1,'+') - result:"1asd88465as+++++" - * - * @param str - * @param regArr - * @param type - * @param ARepText - * @returns {*} - */ -function replaceStr(str, regArr, type, ARepText) { - var regtext = ''; - var Reg = null; - var replaceText = ARepText || '*'; - // repeatStr是在上面定义过的(字符串循环复制),大家注意哦 - if (regArr.length === 3 && type === 0) { - regtext = '(\\w{' + regArr[0] + '})\\w{' + regArr[1] + '}(\\w{' + regArr[2] + '})'; - Reg = new RegExp(regtext); - var replaceCount = this.repeatStr(replaceText, regArr[1]); - return str.replace(Reg, '$1' + replaceCount + '$2'); - } else if (regArr.length === 3 && type === 1) { - regtext = '\\w{' + regArr[0] + '}(\\w{' + regArr[1] + '})\\w{' + regArr[2] + '}'; - Reg = new RegExp(regtext); - var replaceCount1 = this.repeatStr(replaceText, regArr[0]); - var replaceCount2 = this.repeatStr(replaceText, regArr[2]); - return str.replace(Reg, replaceCount1 + '$1' + replaceCount2); - } else if (regArr.length === 1 && type === 0) { - regtext = '(^\\w{' + regArr[0] + '})'; - Reg = new RegExp(regtext); - var replaceCount = this.repeatStr(replaceText, regArr[0]); - return str.replace(Reg, replaceCount); - } else if (regArr.length === 1 && type === 1) { - regtext = '(\\w{' + regArr[0] + '}$)'; - Reg = new RegExp(regtext); - var replaceCount = this.repeatStr(replaceText, regArr[0]); - return str.replace(Reg, replaceCount); - } -} - -/** - * 格式化处理字符串 - ecDo.formatText('1234asda567asd890') - result:"12,34a,sda,567,asd,890" - ecDo.formatText('1234asda567asd890',4,' ') - result:"1 234a sda5 67as d890" - ecDo.formatText('1234asda567asd890',4,'-') - result:"1-234a-sda5-67as-d890" - - * @param str - * @param size - * @param delimiter - * @returns {*} - */ -function formatText(str, size, delimiter) { - var _size = size || 3; - var _delimiter = delimiter || ','; - var regText = '\\B(?=(\\w{' + _size + '})+(?!\\w))'; - var reg = new RegExp(regText, 'g'); - return str.replace(reg, _delimiter); -} - -/** - * 现金额大写转换函数 - ecDo.upDigit(168752632) - result:"人民币壹亿陆仟捌佰柒拾伍万贰仟陆佰叁拾贰元整" - ecDo.upDigit(1682) - result:"人民币壹仟陆佰捌拾贰元整" - ecDo.upDigit(-1693) - result:"欠人民币壹仟陆佰玖拾叁元整" - * @param n - * @returns {string} - */ -function upDigit(n) { - var fraction = ['角', '分', '厘']; - var digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖']; - var unit = [ - ['元', '万', '亿'], - ['', '拾', '佰', '仟'] - ]; - var head = n < 0 ? '欠人民币' : '人民币'; - n = Math.abs(n); - var s = ''; - for (var i = 0; i < fraction.length; i++) { - s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, ''); - } - s = s || '整'; - n = Math.floor(n); - for (var i = 0; i < unit[0].length && n > 0; i++) { - var p = ''; - for (var j = 0; j < unit[1].length && n > 0; j++) { - p = digit[n % 10] + unit[1][j] + p; - n = Math.floor(n / 10); - } - s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s; - // s = p + unit[0][i] + s; - } - return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整'); -} - -// 保留2位小数 -function toFixed(val, acc) { - let num = parseFloat(val); - if (isNaN(num)) { - num = 0; - } - let accuracy = parseInt(acc); - if (isNaN(accuracy) || accuracy < 0 || accuracy > 10) { - accuracy = 2; - } - return num.toFixed(accuracy); -} - -// 转百分比 -function toPercent(val, acc) { - let num = parseFloat(val); - if (isNaN(num)) { - num = 0; - } - let accuracy = parseInt(acc); - if (isNaN(accuracy) || accuracy < 0 || accuracy > 10) { - accuracy = 2; - } - return (num * 100).toFixed(accuracy) + '%'; -} - -// ------------ enum begin ------------ -function getEnumDescByValue(value, enumName) { - return Vue.prototype.$enum.getDescByValue(enumName, value); -} - -// ------------ enum end ------------ - -export { - trim, - changeCase, - repeatStr, - replaceAll, - replaceStr, - formatText, - upDigit, - toFixed, - formatDate, - toPercent, - getEnumDescByValue, - ellipsis -}; diff --git a/smart-admin-h5/src/filters/index.js b/smart-admin-h5/src/filters/index.js deleted file mode 100644 index 484c0dc0..00000000 --- a/smart-admin-h5/src/filters/index.js +++ /dev/null @@ -1,5 +0,0 @@ -import Vue from 'vue' - -import * as filter from './filter' - -Object.keys(filter).forEach(key => Vue.filter(key, filter[key])) diff --git a/smart-admin-h5/src/lib/cookie.js b/smart-admin-h5/src/lib/cookie.js deleted file mode 100644 index 83386119..00000000 --- a/smart-admin-h5/src/lib/cookie.js +++ /dev/null @@ -1,21 +0,0 @@ -import Cookies from 'js-cookie'; -import config from '@/config'; -const { cookieExpires } = config; -export const TOKEN_KEY = 'token'; - -export default { - setToken: token => { - Cookies.set(TOKEN_KEY, token, { - // token在Cookie中存储的天数,默认1天 - expires: cookieExpires || 7 - }); - }, - getToken: () => { - const token = Cookies.get(TOKEN_KEY); - if (token) return token; - else return null; - }, - clearToken: () => { - Cookies.remove(TOKEN_KEY); - } -}; diff --git a/smart-admin-h5/src/lib/erp-http.js b/smart-admin-h5/src/lib/erp-http.js deleted file mode 100644 index 3f4766f8..00000000 --- a/smart-admin-h5/src/lib/erp-http.js +++ /dev/null @@ -1,65 +0,0 @@ -import Axios from 'axios'; -import config from '@/config'; -import cookie from '@/lib/cookie'; -import { Toast } from 'vant'; - -export const baseUrl = config.baseUrl.erpApiUrl; - -const axios = Axios.create({ - baseURL: baseUrl, - timeout: 30000, - headers: { - 'Content-Type': 'application/json; charset=utf-8' - } -}); - -// 添加请求拦截器 -axios.interceptors.request.use( - function(config) { - const token = cookie.getToken(); - if (token) { - config.headers['x-access-token'] = token; - } - return config; - }, - function(error) { - return Promise.reject(error); - } -); - -// 添加响应拦截器 -axios.interceptors.response.use( - res => { - const { data } = res; - if (data && data.code && data.code !== 1) { - if (data.code === 121) { - cookie.clearToken(); - localStorage.clear(); - window.location.href = window.location.pathname + '#/login'; - Toast.fail('未登录,或登录失效,请登录'); - return; - } else if (data.code === 502) { - window.location.href = window.location.pathname + '#/500'; - return; - } else { - Toast.fail(data.msg); - return Promise.reject(res); - } - } - return Promise.resolve(data); - }, - error => { - Toast.fail('服务内部错误'); - return Promise.reject(error); - } -); - -export const postAxios = (url, data, config) => { - return axios.post(url, data, config); -}; - -export const getAxios = (url, data) => { - return axios.get(url, { - params: data - }); -}; diff --git a/smart-admin-h5/src/lib/http.js b/smart-admin-h5/src/lib/http.js deleted file mode 100644 index b4c86937..00000000 --- a/smart-admin-h5/src/lib/http.js +++ /dev/null @@ -1,65 +0,0 @@ -import Axios from 'axios'; -import config from '@/config'; -import cookie from '@/lib/cookie'; -import { Toast } from 'vant'; - -export const baseUrl = config.baseUrl.apiUrl; - -const axios = Axios.create({ - baseURL: baseUrl, - timeout: 30000, - headers: { - 'Content-Type': 'application/json; charset=utf-8' - } -}); - -// 添加请求拦截器 -axios.interceptors.request.use( - function(config) { - const token = cookie.getToken(); - if (token) { - config.headers['x-access-token'] = token; - } - return config; - }, - function(error) { - return Promise.reject(error); - } -); - -// 添加响应拦截器 -axios.interceptors.response.use( - res => { - const { data } = res; - if (data && data.code && data.code !== 1) { - if (data.code === 1001) { - cookie.clearToken(); - localStorage.clear(); - window.location.href = window.location.pathname + '#/login'; - Toast.fail('未登录,或登录失效,请登录'); - return; - } else if (data.code === 502) { - window.location.href = window.location.pathname + '#/500'; - return; - } else { - Toast.fail(data.msg); - return Promise.reject(res); - } - } - return Promise.resolve(data); - }, - error => { - Toast.fail('服务内部错误'); - return Promise.reject(error); - } -); - -export const postAxios = (url, data, config) => { - return axios.post(url, data, config); -}; - -export const getAxios = (url, data) => { - return axios.get(url, { - params: data - }); -}; diff --git a/smart-admin-h5/src/lib/local.js b/smart-admin-h5/src/lib/local.js deleted file mode 100644 index c19d7e3d..00000000 --- a/smart-admin-h5/src/lib/local.js +++ /dev/null @@ -1,8 +0,0 @@ -export const localSave = (key, value) => { - localStorage.setItem(key, value); -}; - -export const localRead = key => { - return localStorage.getItem(key) || ''; -}; - diff --git a/smart-admin-h5/src/lib/menu-func.js b/smart-admin-h5/src/lib/menu-func.js deleted file mode 100644 index 914d5379..00000000 --- a/smart-admin-h5/src/lib/menu-func.js +++ /dev/null @@ -1,276 +0,0 @@ -import { forEach, hasOneOf, objEqual } from '@/lib/util'; -import config from '@/config'; -import { localRead, localSave } from '@/lib/local'; -const { title, useI18n } = config; -export const hasChild = item => { - return item.children && item.children.length !== 0; -}; - -/** - * 通过权限过滤菜单 - * @param {Object} map 权限对象 - * @param {Array} menuList 菜单列表 - * @returns {Array} - */ -export const getShowMenu = (map = {}, menuList, access = false) => { - // 判断是否为超级管理员 - if (access) { - return menuList; - } - // 返回的菜单列表 - let result = []; - for (let menuItem of menuList) { - let routerObj = JSON.parse(JSON.stringify(menuItem)); - if ( - map.hasOwnProperty(menuItem.name) && - (menuItem.name !== 'home' && menuItem.name !== '_home') - ) { - // 判断该菜单权限下是否为数组,若为数组,则为功能点权限否则为子菜单 - if (getType(map[routerObj.name]) === 'array') { - let funcPrivilege = localRead('funcPrivilegeInfo') - ? JSON.parse(localRead('funcPrivilegeInfo')) - : {}; - localSave( - 'funcPrivilegeInfo', - JSON.stringify({ - ...funcPrivilege, - [routerObj.name]: map[routerObj.name] - }) - ); - } else if ( - getType(map[routerObj.name]) !== 'array' && - !routerObj.children - ) { - // 判断是否为二级菜单,若是则需要多枚举一层赋值 - let funcPrivilege = localRead('funcPrivilegeInfo') - ? JSON.parse(localRead('funcPrivilegeInfo')) - : {}; - localSave( - 'funcPrivilegeInfo', - JSON.stringify({ - ...funcPrivilege, - [routerObj.name]: map[routerObj.name][routerObj.name] - }) - ); - } else if ( - getType(map[routerObj.name]) !== 'array' && - routerObj.children - ) { - // 循环子菜单权限 - routerObj.children = getShowMenu( - map[routerObj.name], - routerObj.children - ); - } - result.push(routerObj); - } - } - return result; -}; -// 获取数据类型 -export const getType = obj => { - return {}.toString - .call(obj) - .match(/\s([a-zA-Z]+)/)[1] - .toLowerCase(); -}; - -/** - * @description 本地存储和获取标签导航列表 - */ -export const setTagNavListInLocalStorage = list => { - localStorage.tagNaveList = JSON.stringify(list); -}; -/** - * @returns {Array} 其中的每个元素只包含路由原信息中的name, path, meta三项 - */ -export const getTagNavListFromLocalStorage = () => { - const list = localStorage.tagNaveList; - return list ? JSON.parse(list) : []; -}; -export const getBreadCrumbList = (route, homeRoute) => { - let homeItem = { - ...homeRoute, - icon: homeRoute.meta.icon - }; - let routeMatched = route.matched; - if (routeMatched.some(item => item.name === homeRoute.name)) { - return [homeItem]; - } - let res = routeMatched - .filter(item => { - return item.meta === undefined || !item.meta.hideInBread; - }) - .map(item => { - let meta = { - ...item.meta - }; - if (meta.title && typeof meta.title === 'function') { - meta.__titleIsFunction__ = true; - meta.title = meta.title(route); - } - let obj = { - icon: (item.meta && item.meta.icon) || '', - name: item.name, - meta: meta - }; - return obj; - }); - res = res.filter(item => { - return !item.meta.hideInMenu; - }); - return [...res]; -}; -/** - * @param {Array} routers 路由列表数组 - * @description 用于找到路由列表中name为home的对象 - */ -export const getHomeRoute = (routers, homeName = 'Home') => { - let i = -1; - let len = routers.length; - let homeRoute = {}; - while (++i < len) { - let item = routers[i]; - if (item.children && item.children.length) { - let res = getHomeRoute(item.children, homeName); - if (res.name) return res; - } else { - if (item.name === homeName) homeRoute = item; - } - } - return homeRoute; -}; -/** - * @param {Array} list 标签列表 - * @param {String} name 当前关闭的标签的name - */ -export const getNextRoute = (list, route) => { - let res = {}; - if (list.length === 2) { - res = getHomeRoute(list); - } else { - const index = list.findIndex(item => routeEqual(item, route)); - if (index === list.length - 1) res = list[list.length - 2]; - else res = list[index + 1]; - } - return res; -}; - -/** - * 判断打开的标签列表里是否已存在这个新添加的路由对象 - */ -export const routeHasExist = (tagNavList, routeItem) => { - let len = tagNavList.length; - let res = false; - doCustomTimes(len, index => { - if (routeEqual(tagNavList[index], routeItem)) res = true; - }); - return res; -}; -/** - * @param {*} list 现有标签导航列表 - * @param {*} newRoute 新添加的路由原信息对象 - * @description 如果该newRoute已经存在则不再添加 - */ -export const getNewTagList = (list, newRoute) => { - const { name, path, meta, query } = newRoute; - let newList = [...list]; - let index = newList.findIndex(item => item.name === name); - if (index >= 0) { - newList[index] = { name, path, meta, query }; - } else newList.push({ name, path, meta, query }); - return newList; -}; -export const routeEqual = (route1, route2) => { - return route1.name === route2.name; -}; -export const getRouteTitleHandled = route => { - let router = { - ...route - }; - let meta = { - ...route.meta - }; - let title = ''; - if (meta.title) { - if (typeof meta.title === 'function') { - meta.__titleIsFunction__ = true; - title = meta.title(router); - } else title = meta.title; - } - meta.title = title; - router.meta = meta; - return router; -}; -/** - * @param {Number} times 回调函数需要执行的次数 - * @param {Function} callback 回调函数 - */ -export const doCustomTimes = (times, callback) => { - let i = -1; - while (++i < times) { - callback(i); - } -}; -export const showTitle = (item, vm) => { - let { title, __titleIsFunction__ } = item.meta; - if (!title) return; - if (useI18n) { - if (title.includes('{{') && title.includes('}}') && useI18n) { - title = title.replace(/({{[\s\S]+?}})/, (m, str) => - str.replace(/{{([\s\S]*)}}/, (m, _) => vm.$t(_.trim())) - ); - } else if (__titleIsFunction__) title = item.meta.title; - else title = vm.$t(item.name); - } else title = (item.meta && item.meta.title) || item.name; - return title; -}; -/** - * @description 根据当前跳转的路由设置显示在浏览器标签的title - * @param {Object} routeItem 路由对象 - * @param {Object} vm Vue实例 - */ -export const setTitle = (routeItem, vm) => { - const handledRoute = getRouteTitleHandled(routeItem); - const pageTitle = showTitle(handledRoute, vm); - const resTitle = pageTitle ? `${pageTitle} - ${title}` : title; - window.document.title = resTitle; -}; - -export const findNodeUpper = (ele, tag) => { - if (ele.parentNode) { - if (ele.parentNode.tagName === tag.toUpperCase()) { - return ele.parentNode; - } else { - return findNodeUpper(ele.parentNode, tag); - } - } -}; - -export const findNodeUpperByClasses = (ele, classes) => { - let parentNode = ele.parentNode; - if (parentNode) { - let classList = parentNode.classList; - if ( - classList && - classes.every(className => classList.contains(className)) - ) { - return parentNode; - } else { - return findNodeUpperByClasses(parentNode, classes); - } - } -}; - -export const findNodeDownward = (ele, tag) => { - const tagName = tag.toUpperCase(); - if (ele.childNodes.length) { - let i = -1; - let len = ele.childNodes.length; - while (++i < len) { - let child = ele.childNodes[i]; - if (child.tagName === tagName) return child; - else return findNodeDownward(child, tag); - } - } -}; diff --git a/smart-admin-h5/src/lib/printPlugs.js b/smart-admin-h5/src/lib/printPlugs.js deleted file mode 100644 index 9c4295dd..00000000 --- a/smart-admin-h5/src/lib/printPlugs.js +++ /dev/null @@ -1,133 +0,0 @@ -// 打印类属性、方法定义 -/* eslint-disable */ -//第二个参数表明是否要关闭当前窗口 -const Print = function(dom, close, options) { - if (!(this instanceof Print)) return new Print(dom, close, options); - - this.options = this.extend( - { - noPrint: '.no-print' - }, - options - ); - - if (typeof dom === 'string') { - this.dom = document.querySelector(dom); - } else { - this.dom = dom; - } - - this.init(close); -}; -Print.prototype = { - init: function(close) { - var content = this.getStyle() + this.getHtml(); - this.writeIframe(content, close); - }, - extend: function(obj, obj2) { - for (var k in obj2) { - obj[k] = obj2[k]; - } - return obj; - }, - - getStyle: function() { - var str = '', - styles = document.querySelectorAll('style,link'); - for (var i = 0; i < styles.length; i++) { - str += styles[i].outerHTML; - } - str += - ''; - - return str; - }, - - getHtml: function() { - var inputs = document.querySelectorAll('input'); - var textareas = document.querySelectorAll('textarea'); - var selects = document.querySelectorAll('select'); - - for (var k in inputs) { - if (inputs[k].type == 'checkbox' || inputs[k].type == 'radio') { - if (inputs[k].checked == true) { - inputs[k].setAttribute('checked', 'checked'); - } else { - inputs[k].removeAttribute('checked'); - } - } else if (inputs[k].type == 'text') { - inputs[k].setAttribute('value', inputs[k].value); - } - } - - for (var k2 in textareas) { - if (textareas[k2].type == 'textarea') { - textareas[k2].innerHTML = textareas[k2].value; - } - } - - for (var k3 in selects) { - if (selects[k3].type == 'select-one') { - var child = selects[k3].children; - for (var i in child) { - if (child[i].tagName == 'OPTION') { - if (child[i].selected == true) { - child[i].setAttribute('selected', 'selected'); - } else { - child[i].removeAttribute('selected'); - } - } - } - } - } - return this.dom.outerHTML; - }, - - writeIframe: function(content, close) { - var w, - doc, - iframe = document.createElement('iframe'), - f = document.body.appendChild(iframe); - iframe.id = 'myIframe'; - iframe.style = 'position:absolute;'; - - w = f.contentWindow || f.contentDocument; - doc = f.contentDocument || f.contentWindow.document; - doc.open(); - doc.write(content); - doc.close(); - this.toPrint(w, close); - setTimeout(function() { - document.body.removeChild(iframe); - }, 500); - }, - - toPrint: function(frameWindow, close) { - try { - setTimeout(function() { - frameWindow.focus(); - try { - if (!frameWindow.document.execCommand('print', false, null)) { - frameWindow.print(); - } - } catch (e) { - frameWindow.print(); - } - frameWindow.close(); - if (close) { - window.close(); - } - }, 500); - } catch (err) { - console.log('err', err); - } - } -}; -const MyPlugin = {}; -MyPlugin.install = function(Vue, options) { - // 4. 添加实例方法 - Vue.prototype.$print = Print; -}; -export default MyPlugin; diff --git a/smart-admin-h5/src/lib/render-dom.js b/smart-admin-h5/src/lib/render-dom.js deleted file mode 100644 index 1cad207e..00000000 --- a/smart-admin-h5/src/lib/render-dom.js +++ /dev/null @@ -1,10 +0,0 @@ -export default { - name: 'RenderDom', - functional: true, - props: { - render: Function - }, - render: (h, ctx) => { - return ctx.props.render(h); - } -}; diff --git a/smart-admin-h5/src/lib/smart-sentry.js b/smart-admin-h5/src/lib/smart-sentry.js deleted file mode 100644 index 2ccd8f0a..00000000 --- a/smart-admin-h5/src/lib/smart-sentry.js +++ /dev/null @@ -1,21 +0,0 @@ -/* - * @Description: - * @Author: hanyu - * @Date: 2020-05-28 12:46:06 - * @LastEditTime: 2020-07-08 09:16:15 - * @LastEditors: hy - */ -// smart sentry -import * as Sentry from '@sentry/browser'; -export default { - /** - * sentry 主动上报 - * @param {error} error 错误信息 - */ - captureException: (error) => { - if (error.config && error.data && error && error.headers && error.request && error.status) { - return; - } - Sentry.captureException(error); - } -}; diff --git a/smart-admin-h5/src/lib/util.js b/smart-admin-h5/src/lib/util.js deleted file mode 100644 index 6a3845b0..00000000 --- a/smart-admin-h5/src/lib/util.js +++ /dev/null @@ -1,515 +0,0 @@ -import moment from 'moment'; -/** - * @param {String} url - * @description 从URL中解析参数 - */ -export const getParams = url => { - const keyValueArr = url.split('?')[1].split('&'); - let paramObj = {}; - keyValueArr.forEach(item => { - const keyValue = item.split('='); - paramObj[keyValue[0]] = keyValue[1]; - }); - return paramObj; -}; - -/** - * @param {Any} obj - * @description 获取数据类型 - */ -export const getType = obj => { - return {}.toString - .call(obj) - .match(/\s([a-zA-Z]+)/)[1] - .toLowerCase(); -}; -// 日期格式 -export const dateFormat = { - YMD: 'YMD', - YMDHM: 'YMDHM', - YMDHMS: 'YMDHMS' -}; -export const forEach = (arr, fn) => { - if (!arr.length || !fn) return; - let i = -1; - let len = arr.length; - while (++i < len) { - let item = arr[i]; - fn(item, i, arr); - } -}; - -/** - * @param {Array} arr1 - * @param {Array} arr2 - * @description 得到两个数组的交集, 两个数组的元素为数值或字符串 - */ -export const getIntersection = (arr1, arr2) => { - let len = Math.min(arr1.length, arr2.length); - let i = -1; - let res = []; - while (++i < len) { - const item = arr2[i]; - if (arr1.indexOf(item) > -1) res.push(item); - } - return res; -}; - -/** - * @param {Array} arr1 - * @param {Array} arr2 - * @description 得到两个数组的并集, 两个数组的元素为数值或字符串 - */ -export const getUnion = (arr1, arr2) => { - return Array.from(new Set([...arr1, ...arr2])); -}; - -/** - * @param {Array} target 目标数组 - * @param {Array} arr 需要查询的数组 - * @description 判断要查询的数组是否至少有一个元素包含在目标数组中 - */ -export const hasOneOf = (targetarr, arr) => { - return targetarr.some(_ => arr.indexOf(_) > -1); -}; - -/** - * @param {String|Number} value 要验证的字符串或数值 - * @param {*} validList 用来验证的列表 - */ -export function oneOf (value, validList) { - for (let i = 0; i < validList.length; i++) { - if (value === validList[i]) { - return true; - } - } - return false; -} - -/** - * @param {Number} timeStamp 判断时间戳格式是否是毫秒 - * @returns {Boolean} - */ -const isMillisecond = timeStamp => { - const timeStr = String(timeStamp); - return timeStr.length > 10; -}; - -/** - * @param {Number} timeStamp 传入的时间戳 - * @param {Number} currentTime 当前时间时间戳 - * @returns {Boolean} 传入的时间戳是否早于当前时间戳 - */ -const isEarly = (timeStamp, currentTime) => { - return timeStamp < currentTime; -}; - -/** - * @param {Number} num 数值 - * @returns {String} 处理后的字符串 - * @description 如果传入的数值小于10,即位数只有1位,则在前面补充0 - */ -const getHandledValue = num => { - return num < 10 ? '0' + num : num; -}; - -/** - * @param {Number} timeStamp 传入的时间戳 - * @param {Number} startType 要返回的时间字符串的格式类型,传入'year'则返回年开头的完整时间 - */ -const getDate = (timeStamp, startType) => { - const d = new Date(timeStamp * 1000); - const year = d.getFullYear(); - const month = getHandledValue(d.getMonth() + 1); - const date = getHandledValue(d.getDate()); - const hours = getHandledValue(d.getHours()); - const minutes = getHandledValue(d.getMinutes()); - const second = getHandledValue(d.getSeconds()); - let resStr = ''; - if (startType === 'year') { - resStr = - year + - '-' + - month + - '-' + - date + - ' ' + - hours + - ':' + - minutes + - ':' + - second; - } - else resStr = month + '-' + date + ' ' + hours + ':' + minutes; - return resStr; -}; - -/** - * @param {String|Number} timeStamp 时间戳 - * @returns {String} 相对时间字符串 - */ -export const getRelativeTime = timeStamp => { - // 判断当前传入的时间戳是秒格式还是毫秒 - const IS_MILLISECOND = isMillisecond(timeStamp); - // 如果是毫秒格式则转为秒格式 - if (IS_MILLISECOND) Math.floor((timeStamp /= 1000)); - // 传入的时间戳可以是数值或字符串类型,这里统一转为数值类型 - timeStamp = Number(timeStamp); - // 获取当前时间时间戳 - const currentTime = Math.floor(Date.parse(new Date()) / 1000); - // 判断传入时间戳是否早于当前时间戳 - const IS_EARLY = isEarly(timeStamp, currentTime); - // 获取两个时间戳差值 - let diff = currentTime - timeStamp; - // 如果IS_EARLY为false则差值取反 - if (!IS_EARLY) diff = -diff; - let resStr = ''; - const dirStr = IS_EARLY ? '前' : '后'; - // 少于等于59秒 - if (diff <= 59) resStr = diff + '秒' + dirStr; - // 多于59秒,少于等于59分钟59秒 - else if (diff > 59 && diff <= 3599) { resStr = Math.floor(diff / 60) + '分钟' + dirStr; } - // 多于59分钟59秒,少于等于23小时59分钟59秒 - else if (diff > 3599 && diff <= 86399) { resStr = Math.floor(diff / 3600) + '小时' + dirStr; } - // 多于23小时59分钟59秒,少于等于29天59分钟59秒 - else if (diff > 86399 && diff <= 2623859) { resStr = Math.floor(diff / 86400) + '天' + dirStr; } - // 多于29天59分钟59秒,少于364天23小时59分钟59秒,且传入的时间戳早于当前 - else if (diff > 2623859 && diff <= 31567859 && IS_EARLY) { resStr = getDate(timeStamp); } - else resStr = getDate(timeStamp, 'year'); - return resStr; -}; - -/** - * @returns {String} 当前浏览器名称 - */ -export const getExplorer = () => { - const ua = window.navigator.userAgent; - const isExplorer = exp => { - return ua.indexOf(exp) > -1; - }; - if (isExplorer('MSIE')) return 'IE'; - else if (isExplorer('Firefox')) return 'Firefox'; - else if (isExplorer('Chrome')) return 'Chrome'; - else if (isExplorer('Opera')) return 'Opera'; - else if (isExplorer('Safari')) return 'Safari'; -}; - -/** - * @description 绑定事件 on(element, event, handler) - */ -export const on = (function () { - if (document.addEventListener) { - return function (element, event, handler) { - if (element && event && handler) { - element.addEventListener(event, handler, false); - } - }; - } else { - return function (element, event, handler) { - if (element && event && handler) { - element.attachEvent('on' + event, handler); - } - }; - } -})(); - -/** - * @description 解绑事件 off(element, event, handler) - */ -export const off = (function () { - if (document.removeEventListener) { - return function (element, event, handler) { - if (element && event) { - element.removeEventListener(event, handler, false); - } - }; - } else { - return function (element, event, handler) { - if (element && event) { - element.detachEvent('on' + event, handler); - } - }; - } -})(); - -/** - * 判断一个对象是否存在key,如果传入第二个参数key,则是判断这个obj对象是否存在key这个属性 - * 如果没有传入key这个参数,则判断obj对象是否有键值对 - */ -export const hasKey = (obj, key) => { - if (key) return key in obj; - else { - let keysArr = Object.keys(obj); - return keysArr.length; - } -}; - -/** - * @param {*} obj1 对象 - * @param {*} obj2 对象 - * @description 判断两个对象是否相等,这两个对象的值只能是数字或字符串 - */ -export const objEqual = (obj1, obj2) => { - const keysArr1 = Object.keys(obj1); - const keysArr2 = Object.keys(obj2); - if (keysArr1.length !== keysArr2.length) return false; - else if (keysArr1.length === 0 && keysArr2.length === 0) return true; - /* eslint-disable-next-line */ else { return !keysArr1.some(key => obj1[key] != obj2[key]); } -}; - -// 相关工具类 -export const utils = { - /** - * @description table实现反选 - * @param {Object} vm Vue实例 - * @param {Array} tableSelectDate 选中的数据 - * @param {Array} allData 所有数据 - * @param {Array} key 数据中的唯一值 - */ - reverseSelect (vm, tableSelectDate, allData, key) { - let copyMess = JSON.parse(JSON.stringify(tableSelectDate)); - // 流程:先全部选中->再部分选中 - vm.handleSelectAll(false); - // 选中的idList - let idList = copyMess.map(item => item[key]); - console.log(idList); - for (let item of allData) { - if (idList.every(id => id !== item.id)) { - vm.$set(item, '_checked', true); - tableSelectDate.push(item); - } else { - vm.$set(item, '_checked', false); - } - } - }, - // 校验字符串是否相同 合同使用 - contrastString (originStr, changeStr) { - let origin = originStr - .replace(/\s*/g, '') - .replace(/"/g, '\'') - .replace(/ /g, '') - .replace(/disabled=\/'\/'/g, 'disabled'); - let change = changeStr - .replace(/\s*/g, '') - .replace(/"/g, '\'') - .replace(/ /g, '') - .replace(/disabled=\/'\/'/g, 'disabled'); - return origin === change; - }, - // 获取当前日期getDateStr(0)、前几天getDateStr(-10)、后几天getDateStr(20) - getDateStr (AddDayCount, format) { - let date = new Date(); - // 获取AddDayCount天后的日期 - date.setDate(date.getDate() + AddDayCount); - return this.getDate(date, format); - }, - getDate (date, format) { - let year = date.getFullYear(); - // day获取当前几号,不足10补0 - let day = date.getDate() > 9 ? date.getDate() : '0' + date.getDate(); - // month获取当前月份的日期,不足10补0 - let month = - date.getMonth() + 1 > 9 - ? date.getMonth() + 1 - : '0' + (date.getMonth() + 1); - // h获取当前小时,不足10补0 - let h = date.getHours() > 9 ? date.getHours() : '0' + date.getHours(); - // s获取当前分钟,不足10补0 - let m = date.getMinutes() > 9 ? date.getMinutes() : '0' + date.getMinutes(); - // s获取当前秒数,不足10补0 - let s = date.getSeconds() > 9 ? date.getSeconds() : '0' + date.getSeconds(); - let resultDate = ''; - if (format === dateFormat.YMD) { - resultDate = year + '-' + month + '-' + day; - } - if (format === dateFormat.YMDHM) { - resultDate = year + '-' + month + '-' + day + ' ' + h + ':' + m; - } - if (format === dateFormat.YMDHMS) { - resultDate = year + '-' + month + '-' + day + ' ' + h + ':' + m + ':' + s; - } - return resultDate; - }, - // 获取周一和周日日期,返回两种格式时间 - getDateWeek () { - let now = new Date(); - let nowTime = now.getTime(); - let day = now.getDay(); - let oneDayLong = 1000 * 60 * 60 * 24; - let MondayTime = nowTime - (day - 1) * oneDayLong; - let SundayTime = nowTime + (7 - day) * oneDayLong; - let monday = new Date(MondayTime); - let sunday = new Date(SundayTime); - return { - // first: this.getDateAll(monday), - // last: this.getDateAll(sunday), - firstDate: monday, - lastDate: sunday - }; - }, - // 获取月初与月末日期,返回两种时间格式 - getDateMonth () { - let dateFirter = new Date(); - let dateLast = new Date(); - dateFirter.setDate(1); - - let currentMonth = dateLast.getMonth(); - let nextMonth = ++currentMonth; - let nextMonthFirstDay = new Date(dateLast.getFullYear(), nextMonth, 1); - let oneDay = 1000 * 60 * 60 * 24; - dateLast = new Date(nextMonthFirstDay - oneDay); - - return { - // first: this.getDateAll(dateFirter), - // last: this.getDateAll(dateLast), - firstDate: dateFirter, - lastDate: dateLast - }; - }, - // 计算天数 - getDayBetweenDate (date) { - date = this.getDate(new Date(date), 'YMD'); - let startTime = Date.parse(new Date(date)); // IE支持“yyyy/MM/dd”格式 - let endTime = Date.parse(this.getDate(new Date(), 'YMD')); - let day = parseInt((endTime - startTime) / (1000 * 60 * 60 * 24)); - return day; - }, - getDateIntervalYear (firstDate, secondDate) { - if (!firstDate || !secondDate) { - return 0; - } - let first = new Date(firstDate); - let second = new Date(secondDate); - let firstYear = first.getFullYear(); - let secondYear = second.getFullYear(); - let intervalYear = secondYear - firstYear; - return intervalYear < 0 ? 0 : intervalYear; - }, - getDateIntervalYearFixed2 (firstDate, secondDate) { - if (!firstDate || !secondDate) { - return 0; - } - // 格式化时间 - let startDate = new Date(this.getDate(new Date(firstDate), 'YMD')); - let endDate = new Date(this.getDate(new Date(secondDate), 'YMD')); - // 得到毫秒值 - let startTime = Date.parse(startDate); - let endTime = Date.parse(endDate); - // 得到差了多少天 - let day = parseInt((endTime - startTime) / (1000 * 60 * 60 * 24)); - if (day <= 0) { - return 0; - } - // 得到差的多少年 保留两位小数 - let resultYear = parseFloat((day / (30 * 12)).toFixed(2)); - return resultYear; - }, - // 数字转化为中文大写 - // 代码如下所示: - convertCurrency (money) { - // 汉字的数字 - let cnNums = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖']; - // 基本单位 - let cnIntRadice = ['', '拾', '佰', '仟']; - // 对应整数部分扩展单位 - let cnIntUnits = ['', '万', '亿', '兆']; - // 对应小数部分单位 - let cnDecUnits = ['角', '分', '毫', '厘']; - // 整数金额时后面跟的字符 - let cnInteger = '整'; - // 整型完以后的单位 - let cnIntLast = '元'; - // 最大处理的数字 - let maxNum = 999999999999999.9999; - // 金额整数部分 - let integerNum; - // 金额小数部分 - let decimalNum; - // 输出的中文金额字符串 - let chineseStr = ''; - // 分离金额后用的数组,预定义 - let parts; - if (money === '') { - return ''; - } - money = parseFloat(money); - if (money >= maxNum) { - // 超出最大处理数字 - return ''; - } - if (money === 0) { - chineseStr = cnNums[0] + cnIntLast + cnInteger; - return chineseStr; - } - // 转换为字符串 - money = money.toString(); - if (money.indexOf('.') === -1) { - integerNum = money; - decimalNum = ''; - } else { - parts = money.split('.'); - integerNum = parts[0]; - decimalNum = parts[1].substr(0, 4); - } - // 获取整型部分转换 - if (parseInt(integerNum, 10) > 0) { - let zeroCount = 0; - let IntLen = integerNum.length; - for (let i = 0; i < IntLen; i++) { - let n = integerNum.substr(i, 1); - let p = IntLen - i - 1; - let q = p / 4; - let m = p % 4; - if (n === '0') { - zeroCount++; - } else { - if (zeroCount > 0) { - chineseStr += cnNums[0]; - } - // 归零 - zeroCount = 0; - chineseStr += cnNums[parseInt(n)] + cnIntRadice[m]; - } - if (m === 0 && zeroCount < 4) { - chineseStr += cnIntUnits[q]; - } - } - chineseStr += cnIntLast; - } - // 小数部分 - if (decimalNum !== '') { - let decLen = decimalNum.length; - for (let i = 0; i < decLen; i++) { - let n = decimalNum.substr(i, 1); - if (n !== '0') { - chineseStr += cnNums[Number(n)] + cnDecUnits[i]; - } - } - } - if (chineseStr === '') { - chineseStr += cnNums[0] + cnIntLast + cnInteger; - } else if (decimalNum === '') { - chineseStr += cnInteger; - } - return chineseStr; - } -}; - - -export const dateTimeRangeConvert = (timerange) => { - // timerange - let arr = []; - if (timerange[0] === '') { - arr.push(null); - } else { - arr.push(moment(timerange[0]).format("YYYY-MM-DD 00:00:00")); - } - - if (timerange[1] === '') { - arr.push(null); - } else { - arr.push(moment(timerange[1]).format("YYYY-MM-DD 23:59:59")); - } - return arr; -} - diff --git a/smart-admin-h5/src/lib/watermark.js b/smart-admin-h5/src/lib/watermark.js deleted file mode 100644 index 30747309..00000000 --- a/smart-admin-h5/src/lib/watermark.js +++ /dev/null @@ -1,49 +0,0 @@ -const watermark = {}; - -const setWatermark = (str) => { - const id = '1.23452384164.123412415'; - - if (document.getElementById(id) !== null) { - document.body.removeChild(document.getElementById(id)); - } - - const can = document.createElement('canvas'); - can.width = 150; - can.height = 120; - - const cans = can.getContext('2d'); - cans.rotate(-20 * Math.PI / 180); - cans.font = '15px Vedana'; - cans.fillStyle = 'rgba(0, 0, 0, 0.15)'; - cans.textAlign = 'left'; - cans.textBaseline = 'Middle'; - cans.fillText(str, can.width / 20, can.height); - - const div = document.createElement('div'); - div.id = id; - div.style.pointerEvents = 'none'; - div.style.top = '3px'; - div.style.left = '0px'; - div.style.position = 'fixed'; - div.style.zIndex = '100000'; - div.style.width = document.documentElement.clientWidth + 'px'; - div.style.height = document.documentElement.clientHeight + 'px'; - div.style.background = 'url(' + can.toDataURL('image/png') + ') left top repeat'; - document.body.appendChild(div); - return id; -}; - -// 该方法只允许调用一次 -watermark.set = (str) => { - let id = setWatermark(str); - setInterval(() => { - if (document.getElementById(id) === null) { - id = setWatermark(str); - } - }, 2000); - window.onresize = () => { - setWatermark(str); - }; -}; - -export default watermark; diff --git a/smart-admin-h5/src/main.js b/smart-admin-h5/src/main.js deleted file mode 100644 index 887c9198..00000000 --- a/smart-admin-h5/src/main.js +++ /dev/null @@ -1,62 +0,0 @@ -// vue 三大核心 -import Vue from 'vue'; -import router from '@/router'; -import store from '@/store'; - -// 更好的兼容性 -import 'core-js/stable'; -import 'regenerator-runtime/runtime'; -// 移动端适配 -import 'lib-flexible/flexible.js'; -import 'vant/lib/index.css'; -// 引入首个组件 -import App from './App.vue'; -// 引入自定义主题样式 -import './themes/index.scss'; -// 引入过滤器 -import './filters'; -// 引入配置信息 -import config from '@/config'; -// 引入自定义smart 插件 -import SmartPlugin from './plugins/smart'; -// Import component -import Loading from 'vue-loading-overlay'; -// Import stylesheet -import 'vue-loading-overlay/dist/vue-loading.css'; - -import Vant from 'vant'; -import 'vant/lib/index.css'; - -// sentry错误预警 -import SmartSentry from './plugins/smart-sentry'; - -import Enum from 'vue-enum'; - -import enumInfo from '@/constants'; - -import _ from 'lodash'; - -Vue.use(Vant); - -Vue.use(Loading); - -Vue.use(SmartPlugin); - -Vue.use(SmartSentry); - -Vue.prototype.$config = config; - -Vue.config.productionTip = false; - -Vue.use(Enum, { - enumInfo -}); - -window._ = _; - -new Vue({ - el: '#app', - router, - store, - render: h => h(App) -}); diff --git a/smart-admin-h5/src/plugins/smart-sentry.js b/smart-admin-h5/src/plugins/smart-sentry.js deleted file mode 100644 index b4ad2b09..00000000 --- a/smart-admin-h5/src/plugins/smart-sentry.js +++ /dev/null @@ -1,17 +0,0 @@ -import * as Sentry from '@sentry/browser'; - -const SmartSentry = {}; - -SmartSentry.install = function(Vue, options) { - Vue.prototype.$smartSentry = { - captureException: (error) => { - console.error(error); - if (error.config && error.data && error && error.headers && error.request && error.status) { - return; - } - Sentry.captureException(error); - } - }; -}; - -export default SmartSentry; diff --git a/smart-admin-h5/src/plugins/smart.js b/smart-admin-h5/src/plugins/smart.js deleted file mode 100644 index 5567acca..00000000 --- a/smart-admin-h5/src/plugins/smart.js +++ /dev/null @@ -1,24 +0,0 @@ -let loader = null; - -const SmartPlugin = {}; - -SmartPlugin.install = function(Vue, options) { - Vue.prototype.$smart = { - loading: (message) => { - if (loader) { - loader.hide(); - } - - loader = Vue.$loading.show({ - // Optional parameters - lockScroll: true, - color: '#1989fa' - }); - }, - loadingClear: () => { - loader.hide(); - } - }; -}; - -export default SmartPlugin; diff --git a/smart-admin-h5/src/plugins/vant.js b/smart-admin-h5/src/plugins/vant.js deleted file mode 100644 index 8daa8e3e..00000000 --- a/smart-admin-h5/src/plugins/vant.js +++ /dev/null @@ -1,8 +0,0 @@ -// 按需全局引入 vant组件 -import Vue from 'vue'; -import { Button, List, Cell, Tabbar, TabbarItem } from 'vant'; - -Vue.use(Button); -Vue.use(Cell); -Vue.use(List); -Vue.use(Tabbar).use(TabbarItem); diff --git a/smart-admin-h5/src/router/dashboard/index.js b/smart-admin-h5/src/router/dashboard/index.js deleted file mode 100644 index 69506bbe..00000000 --- a/smart-admin-h5/src/router/dashboard/index.js +++ /dev/null @@ -1,42 +0,0 @@ -import { ROUTER_PERMISSION_TYPE } from '@/router/router-const'; - -/** - * dashboard首页 - */ -export const dashboardRouter = [ - { - path: '/', - // redirect: '/dashboard/contact-company', - redirect: '/dashboard/user', - meta: { - title: '首页', - keepAlive: true, - permissionType: ROUTER_PERMISSION_TYPE.NEED_LOGIN.value - }, - component: () => import('@/views/dashboard/dashboard'), - children: [ - // { - // path: '/dashboard/contact-company', - // name: 'ContactCompany', - // meta: { - // title: '往来单位', - // keepAlive: true, - // showTabbar: true, - // permissionType: ROUTER_PERMISSION_TYPE.NEED_LOGIN.value - // }, - // component: () => import('@/views/erp/contact-company/contact-company') - // }, - { - path: '/dashboard/user', - name: 'Mine', - meta: { - title: '我的', - keepAlive: false, - showTabbar: true, - permissionType: ROUTER_PERMISSION_TYPE.NEED_LOGIN.value - }, - component: () => import('@/views/user/index') - } - ] - } -]; diff --git a/smart-admin-h5/src/router/develop/develop.js b/smart-admin-h5/src/router/develop/develop.js deleted file mode 100644 index a3220405..00000000 --- a/smart-admin-h5/src/router/develop/develop.js +++ /dev/null @@ -1,21 +0,0 @@ -import { ROUTER_PERMISSION_TYPE } from '@/router/router-const'; - -export const developRouter = [ - { - path: '/develop', - component: () => import('@/views/dashboard/dashboard'), - children: [ - { - path: '/develop/config', - name: 'DevelopConfig', - meta: { - title: '开发专用配置', - permissionType: ROUTER_PERMISSION_TYPE.NEED_LOGIN.value - }, - component: () => import('views/develop/config') - } - ] - } - -]; - diff --git a/smart-admin-h5/src/router/error/error.js b/smart-admin-h5/src/router/error/error.js deleted file mode 100644 index 982c0f96..00000000 --- a/smart-admin-h5/src/router/error/error.js +++ /dev/null @@ -1,26 +0,0 @@ -// 错误页 -import { ROUTER_PERMISSION_TYPE } from '@/router/router-const'; - -export const errorRouter = [ - { - path: '/404', - name: 'Error404', - meta: { - hideInMenu: true, - access: true, - permissionType: ROUTER_PERMISSION_TYPE.NO_VALID.value - }, - component: () => import('views/error/404.vue') - }, - { - path: '/500', - name: 'Error500', - meta: { - hideInMenu: true, - access: true, - noValidatePrivilege: true, - permissionType: ROUTER_PERMISSION_TYPE.NO_VALID.value - }, - component: () => import('views/error/404.vue') - } -]; diff --git a/smart-admin-h5/src/router/index.js b/smart-admin-h5/src/router/index.js deleted file mode 100644 index c47e1a4a..00000000 --- a/smart-admin-h5/src/router/index.js +++ /dev/null @@ -1,150 +0,0 @@ -import Vue from 'vue'; -import Router from 'vue-router'; -import { routers } from './routers'; -import cookie from '@/lib/cookie'; -import { ROUTER_PERMISSION_TYPE } from './router-const'; -import NProgress from 'nprogress'; -import 'nprogress/nprogress.css'; - -const projectConfig = require('@/config/index.js'); - -Vue.use(Router); - -/** - * 导入所有的router - * @type {VueRouter} - */ -const router = new Router({ - routes: routers -}); - -// 解决路由跳转相同的地址报错 -const originalPush = Router.prototype.push; -Router.prototype.push = function(location) { - try { - return originalPush.call(this, location).catch(err => err); - } catch (error) { - // TODO zhuoda sentry - console.error(error); - } -}; - -const LOGIN_PAGE_NAME = 'Login'; - -// --------------------- router 守卫 begin --------------------- - -router.beforeEach((to, from, next) => { - // 加载进度条 - NProgress.start(); - - // 权限 - const permissionType = to.meta.permissionType; - // 不需要验证,直接放行 - if (permissionType === ROUTER_PERMISSION_TYPE.NO_VALID.value) { - next(); - return; - } - - const token = cookie.getToken(); - // 需要登录 - if (permissionType === ROUTER_PERMISSION_TYPE.NEED_LOGIN.value) { - if (token) { - next(); - } else { - next({ - name: LOGIN_PAGE_NAME - }); - } - return; - } - - // 需要登录,且验证权限 - if (permissionType === ROUTER_PERMISSION_TYPE.VALIDATE_PERMISSION.value) { - if (!token) { - // TODO 验证权限 - next({ - name: LOGIN_PAGE_NAME - }); - return; - } - } - - next({ - name: 'Error404' - }); -}); - -router.afterEach(to => { - NProgress.done(); - window.scrollTo(0, 0); - if (to.meta.title) { - console.log(to.meta); - document.title = to.meta.title + ' ' + projectConfig.title; - } -}); - -// --------------------- router 守卫 end --------------------- - -/** - * router 检测 - * - * 如果存在相同的 path 或者 name 是一件非常恐怖的事情,所以在develop环境将所有router进行一次遍历
- * 检测内容如下:
- * 1、相同的router name - * 2、相同的router name - * 3、path没有以 / 开头 - * - */ - -const tempCheckObj = { - checkRouterNameMap: new Map(), - checkRouterPathMap: new Map() -}; - -function recursionCheckRouter(routerArray) { - for (const routerItem of routerArray) { - if (!routerItem.name) { - console.error('没有配置router name', routerItem); - } else { - const existNameRouter = tempCheckObj.checkRouterNameMap.get( - routerItem.name - ); - if (typeof existNameRouter !== 'undefined') { - console.error('存在相同的router name', routerItem, existNameRouter); - } else { - tempCheckObj.checkRouterNameMap.set(routerItem.name, routerItem); - } - } - - if (!routerItem.path) { - console.error('没有配置router path', routerItem); - } else { - // path必须以 / 开头 - if (routerItem.path !== '*' && routerItem.path.indexOf('/') !== 0) { - console.error('path 没有以/开头 ', routerItem); - } - - const existPathRouter = tempCheckObj.checkRouterPathMap.get( - routerItem.path - ); - if (typeof existPathRouter !== 'undefined') { - console.error('存在相同的router path', routerItem, existPathRouter); - } else { - tempCheckObj.checkRouterPathMap.set(routerItem.path, routerItem); - } - } - - if (routerItem.children) { - recursionCheckRouter(routerItem.children); - } - } -} - -// 如果是开发环境,需要检测router的规范性 -if (process.env.NODE_ENV === 'development') { - recursionCheckRouter(routers); - delete tempCheckObj.checkRouterNameMap; - delete tempCheckObj.checkRouterPathMap; -} - -export default router; diff --git a/smart-admin-h5/src/router/login/login.js b/smart-admin-h5/src/router/login/login.js deleted file mode 100644 index 7c9b6a53..00000000 --- a/smart-admin-h5/src/router/login/login.js +++ /dev/null @@ -1,15 +0,0 @@ -import { ROUTER_PERMISSION_TYPE } from '@/router/router-const'; - -export const loginRouter = [ - { - path: '/login', - name: 'Login', - meta: { - title: '登录', - keepAlive: false, - permissionType: ROUTER_PERMISSION_TYPE.NO_VALID.value - }, - component: () => import('@/views/login/login.vue') - } - -]; diff --git a/smart-admin-h5/src/router/router-const.js b/smart-admin-h5/src/router/router-const.js deleted file mode 100644 index 4d509cf8..00000000 --- a/smart-admin-h5/src/router/router-const.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - * 权限类型 - */ -export const ROUTER_PERMISSION_TYPE = { - /** - * 不 验 证 - */ - NO_VALID: { - value: 1 - }, - /** - * 需要登录 - */ - NEED_LOGIN: { - value: 2 - }, - /** - * 需要验证权限 - */ - VALIDATE_PERMISSION: { - value: 3 - } -}; diff --git a/smart-admin-h5/src/router/routers.js b/smart-admin-h5/src/router/routers.js deleted file mode 100644 index e1c106e9..00000000 --- a/smart-admin-h5/src/router/routers.js +++ /dev/null @@ -1,32 +0,0 @@ -// 全局错误页面 -import { errorRouter } from './error/error'; -// 登录注册模块 -import { loginRouter } from './login/login'; -// tabbar dashboard 框架页面 -import { dashboardRouter } from './dashboard'; -// 用户相关 -import { userRouter } from './user/user'; -// 开发相关 -import { developRouter } from './develop/develop'; - -/** - * router meta 说明:
- * - * title: 为页面的title,会显示到浏览器的title上 - * permissionType: 具体使用 router-const.js中的 ROUTER_PERMISSION_TYPE 常量;情况有: 1)不验证 2)校验登录 3)登录后校验权限 - * keepAlive: true or false ; 是否进行页面keepalive, 如果想删除keepalive,可以使用vuex中的app module里有mutation - * showTabbar: true or false ; 是否展示 tabbar, 如果是true, 则会展示tabbar - * - */ -export const routers = [ - // 登录、注册 - ...loginRouter, - // 404、500、403等 - ...errorRouter, - // tab bar 页面 - ...dashboardRouter, - // 用户 - ...userRouter, - // 开发相关 - ...developRouter -]; diff --git a/smart-admin-h5/src/router/user/user.js b/smart-admin-h5/src/router/user/user.js deleted file mode 100644 index 901e5708..00000000 --- a/smart-admin-h5/src/router/user/user.js +++ /dev/null @@ -1,21 +0,0 @@ -import { ROUTER_PERMISSION_TYPE } from '@/router/router-const'; - -export const userRouter = [ - { - path: '/user', - component: () => import('@/views/dashboard/dashboard'), - children: [ - { - path: '/user/change-password', - name: 'UserChangePassword', - meta: { - title: '修改密码', - permissionType: ROUTER_PERMISSION_TYPE.NEED_LOGIN.value - }, - component: () => - import('views/user/change-password') - } - ] - } -]; - diff --git a/smart-admin-h5/src/store/index.js b/smart-admin-h5/src/store/index.js deleted file mode 100644 index 11c4962b..00000000 --- a/smart-admin-h5/src/store/index.js +++ /dev/null @@ -1,23 +0,0 @@ -import Vue from 'vue'; -import Vuex from 'vuex'; - -import user from './module/user'; -import app from './module/app'; - -Vue.use(Vuex); - -export default new Vuex.Store({ - state: { - // - }, - mutations: { - // - }, - actions: { - // - }, - modules: { - app, - user - } -}); diff --git a/smart-admin-h5/src/store/module/app.js b/smart-admin-h5/src/store/module/app.js deleted file mode 100644 index 486defe1..00000000 --- a/smart-admin-h5/src/store/module/app.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * 整个应用相关的状态信息 - * - * 比如: keepalive等 - */ -export default { - namespaced: true, - state: { - // 缓存路由 - keepAliveIncludes: [] - }, - - mutations: { - // 加入keep-alive缓存 - pushKeepAliveIncludes(state, val) { - if (state.keepAliveIncludes.length < 30) { - const number = state.keepAliveIncludes.findIndex(e => e === val); - if (number === -1) { - state.keepAliveIncludes.push(val); - } - } - }, - // 删除缓存 - deleteKeepAliveIncludes(state, val) { - const number = state.keepAliveIncludes.findIndex(e => e === val); - if (number !== -1) { - state.keepAliveIncludes.splice(number, 1); - } - } - } - -}; diff --git a/smart-admin-h5/src/store/module/user.js b/smart-admin-h5/src/store/module/user.js deleted file mode 100644 index 5f64b72e..00000000 --- a/smart-admin-h5/src/store/module/user.js +++ /dev/null @@ -1,41 +0,0 @@ -import cookie from '@/lib/cookie.js'; - -export default { - namespaced: true, - state: { - token: cookie.getToken(), - // session 信息 - sessionInfo: {}, - // 是否获取了session - isHaveGotSessionInfo: false, - // 权限集合 - privilegeKeySet: new Set() - - }, - mutations: { - clearSession() { - state.token = null; - state.sessionInfo = null; - state.privilegeKeySet = new Set(); - }, - updateSession(state, userLoginInfo) { - state.isHaveGotSessionInfo = true; - state.sessionInfo = userLoginInfo; - if (userLoginInfo.privilegeList) { - state.privilegeKeySet = new Set(userLoginInfo.privilegeList.map(e => e.key)); - } - } - }, - getters: { - // 用户菜单权限 - privilegeKeySet: state => state.privilegeKeySet, - isSuperMan: state => state.sessionInfo.isSuperMan, - actualName: state => state.sessionInfo.actualName, - loginUserId: state => state.sessionInfo.id - }, - actions: { - // 登录 - handleLogin({ commit }, params) { - } - } -}; diff --git a/smart-admin-h5/src/themes/index.scss b/smart-admin-h5/src/themes/index.scss deleted file mode 100644 index b540e422..00000000 --- a/smart-admin-h5/src/themes/index.scss +++ /dev/null @@ -1,6 +0,0 @@ - -html, -body { - font-family: Arial, Helvetica, 'STHeiti STXihei', 'Microsoft YaHei', Tohoma, sans-serif; - background-color: $background-color; -} diff --git a/smart-admin-h5/src/utils/index.js b/smart-admin-h5/src/utils/index.js deleted file mode 100644 index 37d915fc..00000000 --- a/smart-admin-h5/src/utils/index.js +++ /dev/null @@ -1,110 +0,0 @@ -/** - * Created by PanJiaChen on 16/11/18. - */ - -/** - * Parse the time to string - * @param {(Object|string|number)} time - * @param {string} cFormat - * @returns {string} - */ -export function parseTime(time, cFormat) { - if (arguments.length === 0) { - return null - } - const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}' - let date - if (typeof time === 'object') { - date = time - } else { - if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) { - time = parseInt(time) - } - if ((typeof time === 'number') && (time.toString().length === 10)) { - time = time * 1000 - } - date = new Date(time) - } - const formatObj = { - y: date.getFullYear(), - m: date.getMonth() + 1, - d: date.getDate(), - h: date.getHours(), - i: date.getMinutes(), - s: date.getSeconds(), - a: date.getDay() - } - const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => { - let value = formatObj[key] - // Note: getDay() returns 0 on Sunday - if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value] } - if (result.length > 0 && value < 10) { - value = '0' + value - } - return value || 0 - }) - return time_str -} - -/** - * @param {number} time - * @param {string} option - * @returns {string} - */ -export function formatTime(time, option) { - if (('' + time).length === 10) { - time = parseInt(time) * 1000 - } else { - time = +time - } - const d = new Date(time) - const now = Date.now() - - const diff = (now - d) / 1000 - - if (diff < 30) { - return '刚刚' - } else if (diff < 3600) { - // less 1 hour - return Math.ceil(diff / 60) + '分钟前' - } else if (diff < 3600 * 24) { - return Math.ceil(diff / 3600) + '小时前' - } else if (diff < 3600 * 24 * 2) { - return '1天前' - } - if (option) { - return parseTime(time, option) - } else { - return ( - d.getMonth() + - 1 + - '月' + - d.getDate() + - '日' + - d.getHours() + - '时' + - d.getMinutes() + - '分' - ) - } -} - -/** - * @param {string} url - * @returns {Object} - */ -export function param2Obj(url) { - const search = url.split('?')[1] - if (!search) { - return {} - } - return JSON.parse( - '{"' + - decodeURIComponent(search) - .replace(/"/g, '\\"') - .replace(/&/g, '","') - .replace(/=/g, '":"') - .replace(/\+/g, ' ') + - '"}' - ) -} diff --git a/smart-admin-h5/src/utils/request.js b/smart-admin-h5/src/utils/request.js deleted file mode 100644 index 6788f91b..00000000 --- a/smart-admin-h5/src/utils/request.js +++ /dev/null @@ -1,58 +0,0 @@ -import axios from 'axios' -import store from '@/store' -import { Toast } from 'vant' -// 根据环境不同引入不同api地址 -import { baseApi } from '@/config' -// create an axios instance -const service = axios.create({ - baseURL: baseApi, // url = base api url + request url - withCredentials: true, // send cookies when cross-domain requests - timeout: 5000 // request timeout -}) - -// request拦截器 request interceptor -service.interceptors.request.use( - config => { - // 不传递默认开启loading - if (!config.hideloading) { - // loading - Toast.loading({ - forbidClick: true - }) - } - if (store.getters.token) { - config.headers['X-Token'] = '' - } - return config - }, - error => { - // do something with request error - console.log(error) // for debug - return Promise.reject(error) - } -) -// respone拦截器 -service.interceptors.response.use( - response => { - Toast.clear() - const res = response.data - if (res.status && res.status !== 200) { - // 登录超时,重新登录 - if (res.status === 401) { - store.dispatch('FedLogOut').then(() => { - location.reload() - }) - } - return Promise.reject(res || 'error') - } else { - return Promise.resolve(res) - } - }, - error => { - Toast.clear() - console.log('err' + error) // for debug - return Promise.reject(error) - } -) - -export default service diff --git a/smart-admin-h5/src/utils/validate.js b/smart-admin-h5/src/utils/validate.js deleted file mode 100644 index e9bd1bab..00000000 --- a/smart-admin-h5/src/utils/validate.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Created by Sunnie on 19/06/04. - */ - -/** - * @param {string} path - * @returns {Boolean} - */ -export function isExternal(path) { - return /^(https?:|mailto:|tel:)/.test(path) -} - -/** - * @param {string} str - * @returns {Boolean} - */ -export function validUsername(str) { - const valid_map = ['admin', 'editor'] - return valid_map.indexOf(str.trim()) >= 0 -} diff --git a/smart-admin-h5/src/views/dashboard/dashboard.vue b/smart-admin-h5/src/views/dashboard/dashboard.vue deleted file mode 100644 index 47b1ab24..00000000 --- a/smart-admin-h5/src/views/dashboard/dashboard.vue +++ /dev/null @@ -1,99 +0,0 @@ - - - - diff --git a/smart-admin-h5/src/views/develop/config.vue b/smart-admin-h5/src/views/develop/config.vue deleted file mode 100644 index 18b2ec08..00000000 --- a/smart-admin-h5/src/views/develop/config.vue +++ /dev/null @@ -1,47 +0,0 @@ - - - - diff --git a/smart-admin-h5/src/views/error/404.vue b/smart-admin-h5/src/views/error/404.vue deleted file mode 100644 index 66168409..00000000 --- a/smart-admin-h5/src/views/error/404.vue +++ /dev/null @@ -1,23 +0,0 @@ - - - - diff --git a/smart-admin-h5/src/views/login/login.vue b/smart-admin-h5/src/views/login/login.vue deleted file mode 100644 index 8fd8806f..00000000 --- a/smart-admin-h5/src/views/login/login.vue +++ /dev/null @@ -1,68 +0,0 @@ - - - - - diff --git a/smart-admin-h5/src/views/user/change-password.vue b/smart-admin-h5/src/views/user/change-password.vue deleted file mode 100644 index 08f4c4e8..00000000 --- a/smart-admin-h5/src/views/user/change-password.vue +++ /dev/null @@ -1,76 +0,0 @@ - - - - diff --git a/smart-admin-h5/src/views/user/index.vue b/smart-admin-h5/src/views/user/index.vue deleted file mode 100644 index be177fff..00000000 --- a/smart-admin-h5/src/views/user/index.vue +++ /dev/null @@ -1,79 +0,0 @@ - - - - diff --git a/smart-admin-h5/vue.config.js b/smart-admin-h5/vue.config.js deleted file mode 100644 index a31f3a23..00000000 --- a/smart-admin-h5/vue.config.js +++ /dev/null @@ -1,200 +0,0 @@ -const path = require('path'); -const CompressionWebpackPlugin = require('compression-webpack-plugin'); -const UglifyjsWebpackPlugin = require('uglifyjs-webpack-plugin'); -const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer'); -const ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin'); -const SentryPlugin = require('@sentry/webpack-plugin'); -const resolve = dir => path.join(__dirname, dir); -// 项目配置 -const projectConfig = require('./src/config/index.js'); - -// 生产环境,测试和正式 -const isProductionEnv = ['production'].includes(process.env.NODE_ENV); -const isProductionAppEnv = ['prod', 'pre'].includes(process.env.VUE_APP_ENV); - -module.exports = { - publicPath: projectConfig.publicPath, - // 生产环境构建文件的目录 - outputDir: 'dist', - // outputDir的静态资源(js、css、img、fonts)目录 - assetsDir: 'static', - // eslint检测 按需开启 - lintOnSave: !isProductionEnv, - // 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。 - productionSourceMap: false, - devServer: { - // 设置主机地址 - host: '0.0.0.0', - // 设置默认端口 - port: 8090, - // 禁用host验证 - disableHostCheck: true, - // 启动后打开浏览器 - open: true, - overlay: { - // 当出现编译器错误或警告时,在浏览器中显示全屏覆盖层 - warnings: false, - errors: true - } - // proxy: { - // //配置跨域 - // '/api': { - // // 接口前缀 - // target: "https://sit.smart-h5.1024lab.net/api", - // // ws:true, - // changOrigin:true, - // // 改写规则,把/api 替换为/ - // pathRewrite:{ - // '^/api':'/' - // } - // } - // } - }, - css: { - // 是否使用css分离插件 ExtractTextPlugin 是否将组件中的 CSS 提取至一个独立的 CSS 文件中 (而不是动态注入到 JavaScript 中的 inline 代码)。 - extract: isProductionEnv, - // 开启 CSS source maps - sourceMap: false, - // 使用vw布局去掉这个 - requireModuleExtension: true, - loaderOptions: { - // 引入全局变量 - scss: { - additionalData: `@import "@/assets/css/index";` // 全局引入 - } - } - }, - configureWebpack: config => { - config.name = projectConfig.title; - }, - - chainWebpack: config => { - // 移除资源预加载(路由懒加载才能正常使用) - config.plugins.delete('preload'); - config.plugins.delete('prefetch'); - - // 别名 alias - config.resolve.alias - .set('@', resolve('src')) - .set('assets', resolve('src/assets')) - .set('api', resolve('src/api')) - .set('views', resolve('src/views')) - .set('components', resolve('src/components')); - - // 应用名字 - config.plugin('html').tap(args => { - args[0].title = projectConfig.title; - return args; - }); - - // 设置保留空格 - config.module - .rule('vue') - .use('vue-loader') - .loader('vue-loader') - .tap(options => { - options.compilerOptions.preserveWhitespace = true; - return options; - }) - .end(); - - // ==================== 生产环境配置 begin ==================== - if (isProductionEnv) { - // 打包分析 - config.plugin('webpack-report').use(BundleAnalyzerPlugin, [ - { - analyzerMode: 'static' - } - ]); - // 不显示源码 - config.devtool('cheap-source-map'); - - // cdn - config.plugin('html').tap(args => { - args[0].cdn = projectConfig.cdn.cdnResource; - // 压缩html中的css - args[0].minify.minifyCSS = true; - return args; - }); - // 指定资源加载cdn - config.externals(projectConfig.cdn.externals); - - // 开启gzip , Nginx上也需要配置gzip才会生效 - config - .plugin('compression') - .use(CompressionWebpackPlugin) - .tap(() => [ - { - // 压缩 js 与 css - test: new RegExp( - '\\.(js|css)$' - ), - // 资源文件大于10240B=10kB时会被压缩 - threshold: 10240, - // 最小压缩比达到0.8时才会被压缩 - minRatio: 0.8 - } - ]); - - // sentry - if (isProductionAppEnv) { - config.plugin('sentry').use(SentryPlugin, [{ - ignore: ['node_modules'], - include: './dist', // 上传dist文件的js - configFile: './.sentryclirc' // 配置文件地址 - }]); - } - - config.optimization.minimizer = [ - new UglifyjsWebpackPlugin({ - // 生产环境推荐关闭 sourcemap 防止源码泄漏 - // 服务端通过前端发送的行列,根据 sourcemap 转为源文件位置 - sourceMap: false, - uglifyOptions: { - warnings: false, - compress: { - drop_console: true, - drop_debugger: true - } - } - }) - ]; - - config - .plugin('ScriptExtHtmlWebpackPlugin') - .after('html') - .use(ScriptExtHtmlWebpackPlugin, [ - { - // 将 runtime 作为内联引入不单独存在 - inline: /runtime\..*\.js$/ - } - ]) - .end(); - - config.optimization.splitChunks({ - chunks: 'all', - cacheGroups: { - commons: { - name: 'chunk-commons', - test: resolve('src/components'), - minChunks: 3, // 模块至少使用次数 - priority: 5, - reuseExistingChunk: true // 模块嵌套引入时,判断是否复用已经被打包的模块 - }, - node_vendors: { - name: 'chunk-libs', - chunks: 'initial', - test: /[\\/]node_modules[\\/]/, - priority: 10 - }, - vantUI: { - name: 'chunk-vantUI', - priority: 20, - test: /[\\/]node_modules[\\/]_?vant(.*)/ - } - } - }); - } - // ==================== 生产环境配置 end ==================== - } -}; diff --git a/smart-admin-service/README.md b/smart-admin-service/README.md deleted file mode 100644 index 19273c14..00000000 --- a/smart-admin-service/README.md +++ /dev/null @@ -1,17 +0,0 @@ -### 部署说明 - -#### 下载代码 - -smart-admin-service - -将两个项目导入idea - -#### 创建数据库 - -先执行:src/main/resources/sql/smart-admin.sql - -再执行:src/main/resources/sql/quartz_mysql_2.3.0.sql - -#### 启动 - -运行 smart-admin-api项目 SmartAdminApplication类 diff --git a/smart-admin-service/pom.xml b/smart-admin-service/pom.xml deleted file mode 100644 index 39a6f3ce..00000000 --- a/smart-admin-service/pom.xml +++ /dev/null @@ -1,349 +0,0 @@ - - - 4.0.0 - - net.1024lab - smart-admin-service-parent - 1.0.0 - pom - - - smart-admin-api - - - - UTF-8 - UTF-8 - 1.8 - 3.1.1 - 2.10.0 - 2.2.5.RELEASE - 1.7 - 2.0 - 2.7.0 - 2.0.4 - 3.3.1 - 1.2.73 - 28.2-jre - 2.7.0 - [7.2.0, 7.2.99] - 0.9.1 - 1.1.21 - 3.9.1 - 1.4.2 - 4.1.2 - 1.3.1 - 3.3.2 - 1.9.3 - 2.8.0 - 2.3.2 - 4.2.2 - 8.0.19 - 1.21 - 1.18.8 - - - - - - - org.springframework.boot - spring-boot-dependencies - ${smartadmin.springboot.version} - pom - import - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - com.baomidou - mybatis-plus-boot-starter - ${mybatis-plus-boot.version} - - - - - velocity - org.apache.velocity - ${velocity.version} - - - org.apache.velocity - velocity-engine-core - ${velocity-engine-core.version} - - - - - - com.alibaba - fastjson - ${fastjson.version} - - - - - com.alibaba - druid - ${druid.version} - - - - - p6spy - p6spy - ${p6spy.version} - - - - - io.springfox - springfox-swagger2 - ${swagger.version} - - - io.springfox - springfox-swagger-ui - ${swagger.version} - - - - - - com.github.xiaoymin - knife4j-spring-boot-starter - ${knife4j.version} - - - - - - com.google.guava - guava - ${guava.version} - - - - - com.aliyun.oss - aliyun-sdk-oss - ${aliyun-oss.version} - - - com.qiniu - qiniu-java-sdk - ${qiniu-oss.version} - - - commons-fileupload - commons-fileupload - ${commons-fileupload.version} - - - - - - io.jsonwebtoken - jjwt - ${jjwt.version} - - - - - cn.afterturn - easypoi-spring-boot-starter - ${easypoi.version} - - - - - - mysql - mysql-connector-java - ${mysql.version} - - - - commons-beanutils - commons-beanutils - ${commons-beanutils.version} - - - - org.apache.commons - commons-pool2 - ${commons-pool2.version} - - - - com.github.penggle - kaptcha - ${kaptcha.version} - - - - com.googlecode.concurrentlinkedhashmap - concurrentlinkedhashmap-lru - ${concurrentlinkedhashmap.version} - - - - com.squareup.okhttp3 - okhttp - ${okhttp.version} - - - - eu.bitwalker - UserAgentUtils - ${user-agent-util.version} - - - - org.projectlombok - lombok - ${lombok.version} - provided - - - - - - - - - src/main/java - - **/*.* - - - - false - src/main/resources - - dev/* - sit/* - pre/* - prod/* - - - - src/main/resources/${profiles.active} - true - - *.properties - - - - src/main/resources/${profiles.active} - false - - *.* - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - ${java.version} - ${java.version} - UTF-8 - - - - org.springframework.boot - spring-boot-maven-plugin - ${smartadmin.springboot.version} - - ${main-class} - - - - - repackage - - - - - - - - - - - - dev - - dev - - - true - - - - telework - - telework - - - - sit - - sit - - - - pre - - pre - - - - prod - - prod - - - - \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/doc/readme.txt b/smart-admin-service/smart-admin-api/doc/readme.txt deleted file mode 100644 index f586e4b8..00000000 --- a/smart-admin-service/smart-admin-api/doc/readme.txt +++ /dev/null @@ -1,15 +0,0 @@ -1 超管默认账号 -sa/123456 - -2 执行脚本: -先执行:src/main/resources/sql/smart-admin.sql -再执行:src/main/resources/sql/quartz_mysql_2.3.0.sql - -3 除dev之外文件 - -4 刷新页面,获取权限是否走缓存 -LoginService.getSession - -5 test类中去掉代码生成run - -6 前端百度统计 \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/SmartAdminApplication.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/SmartAdminApplication.java deleted file mode 100644 index b22d0670..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/SmartAdminApplication.java +++ /dev/null @@ -1,29 +0,0 @@ -package net.lab1024.smartadmin; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.cache.annotation.EnableCaching; -import org.springframework.context.annotation.EnableAspectJAutoProxy; -import org.springframework.scheduling.annotation.EnableScheduling; - -/** - * [ admin 项目启动类 ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - * @since JDK1.8 - * - */ -@SpringBootApplication(scanBasePackages = {"net.lab1024.smartadmin", "cn.afterturn.easypoi"}) -@EnableCaching -@EnableScheduling -@EnableAspectJAutoProxy(proxyTargetClass = true, exposeProxy = true) -public class SmartAdminApplication { - - public static void main(String[] args) { - SpringApplication.run(SmartAdminApplication.class, args); - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/anno/NoValidPrivilege.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/anno/NoValidPrivilege.java deleted file mode 100644 index d37e63c2..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/anno/NoValidPrivilege.java +++ /dev/null @@ -1,20 +0,0 @@ -package net.lab1024.smartadmin.common.anno; - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; - -/** - * - * [ 不需要权限验证 ] - * - * @version 1.0 - * @since JDK1.8 - * @author yandanyang - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - */ -@Retention(RetentionPolicy.RUNTIME) -public @interface NoValidPrivilege { - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/anno/OperateLog.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/anno/OperateLog.java deleted file mode 100644 index 31dd3683..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/anno/OperateLog.java +++ /dev/null @@ -1,20 +0,0 @@ -package net.lab1024.smartadmin.common.anno; - -import java.lang.annotation.*; - -/** - * [ 用户操作日志 ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - * @since JDK1.8 - */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.TYPE) -@Documented -public @interface OperateLog { - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/constant/CommentSortTypeEnum.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/constant/CommentSortTypeEnum.java deleted file mode 100644 index 1a4de4e4..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/constant/CommentSortTypeEnum.java +++ /dev/null @@ -1,57 +0,0 @@ -package net.lab1024.smartadmin.common.constant; - - -import net.lab1024.smartadmin.common.domain.BaseEnum; - -/** - * 全局排序枚举类 - * - * @author listen - * @date 2018/01/13 14:24 - */ -public enum CommentSortTypeEnum implements BaseEnum { - - /** - * 正序 ASC 1 - */ - ASC(1, "ASC"), - - /** - * 倒序 DESC 2 - */ - DESC(2, "DESC"); - - private Integer value; - - private String desc; - - /** - * 排序类型:1正序 | 2倒序 - */ - public static final String INFO = "排序类型:1正序 | 2倒序"; - - CommentSortTypeEnum(Integer value, String desc) { - this.value = value; - this.desc = desc; - } - - /** - * 获取枚举类的值 - * - * @return Integer - */ - @Override - public Integer getValue() { - return value; - } - - /** - * 获取枚举类的说明 - * - * @return String - */ - @Override - public String getDesc() { - return desc; - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/constant/JudgeEnum.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/constant/JudgeEnum.java deleted file mode 100644 index d7c55429..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/constant/JudgeEnum.java +++ /dev/null @@ -1,52 +0,0 @@ -package net.lab1024.smartadmin.common.constant; - -import net.lab1024.smartadmin.common.domain.BaseEnum; - -import java.util.Arrays; -import java.util.Optional; - -/** - * - * [ 是与否] - * - * @version 1.0 - * @since JDK1.8 - * @author yandanyang - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - */ -public enum JudgeEnum implements BaseEnum { - - NO(0, "否"), - - YES(1, "是"); - - private Integer value; - private String desc; - - JudgeEnum(Integer value, String desc) { - this.value = value; - this.desc = desc; - } - - @Override - public Integer getValue() { - return value; - } - @Override - public String getDesc() { - return desc; - } - - public static JudgeEnum valueOf(Integer status) { - JudgeEnum[] values = JudgeEnum.values(); - Optional first = Arrays.stream(values).filter(e -> e.getValue().equals(status)).findFirst(); - return !first.isPresent() ? null : first.get(); - } - - public static boolean isExist(Integer status) { - JudgeEnum judgeEnum = valueOf(status); - return judgeEnum != null; - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/constant/ResponseCodeConst.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/constant/ResponseCodeConst.java deleted file mode 100644 index c572eecd..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/constant/ResponseCodeConst.java +++ /dev/null @@ -1,181 +0,0 @@ -package net.lab1024.smartadmin.common.constant; - -import net.lab1024.smartadmin.module.system.department.DepartmentResponseCodeConst; -import net.lab1024.smartadmin.module.system.employee.constant.EmployeeResponseCodeConst; -import net.lab1024.smartadmin.module.support.file.constant.FileResponseCodeConst; -import net.lab1024.smartadmin.module.business.log.orderoperatelog.constant.OrderOperateLogOperateTypeConst; -import net.lab1024.smartadmin.module.system.login.LoginResponseCodeConst; -import net.lab1024.smartadmin.module.system.position.PositionResponseCodeConst; -import net.lab1024.smartadmin.module.system.privilege.constant.PrivilegeResponseCodeConst; -import net.lab1024.smartadmin.module.system.role.basic.RoleResponseCodeConst; -import net.lab1024.smartadmin.module.system.systemconfig.constant.SystemConfigResponseCodeConst; -import lombok.extern.slf4j.Slf4j; - -import java.lang.reflect.Field; -import java.util.HashMap; -import java.util.Map; - -/** - * 每个业务,100个范围值就够了. - */ -@Slf4j -public class ResponseCodeConst { - - // 范围声明 - static { - // 系统功能,从0开始,step=1000 - ResponseCodeContainer.register(ResponseCodeConst.class, 0, 1000); - ResponseCodeContainer.register(LoginResponseCodeConst.class, 1001, 1999); - ResponseCodeContainer.register(DepartmentResponseCodeConst.class, 2001, 2999); - ResponseCodeContainer.register(EmployeeResponseCodeConst.class, 3001, 3999); - ResponseCodeContainer.register(FileResponseCodeConst.class, 4001, 4999); - ResponseCodeContainer.register(SystemConfigResponseCodeConst.class, 5001, 5999); - ResponseCodeContainer.register(RoleResponseCodeConst.class, 6001, 6999); - ResponseCodeContainer.register(PrivilegeResponseCodeConst.class, 7001, 7999); - ResponseCodeContainer.register(OrderOperateLogOperateTypeConst.class, 8001, 8999); - ResponseCodeContainer.register(PositionResponseCodeConst.class, 13000, 13999); - - } - - public static final ResponseCodeConst SUCCESS = new ResponseCodeConst(1, "操作成功!", true); - - public static final ResponseCodeConst ERROR_PARAM = new ResponseCodeConst(101, "参数异常!"); - - public static final ResponseCodeConst ERROR_PARAM_ANY = new ResponseCodeConst(102, "%s参数异常!"); - - public static final ResponseCodeConst SYSTEM_ERROR = new ResponseCodeConst(111, "系统错误"); - - public static final ResponseCodeConst DEVELOPMENT = new ResponseCodeConst(112, "此功能正在开发中"); - - public static final ResponseCodeConst NOT_EXISTS = new ResponseCodeConst(113, "数据不存在"); - - public static ResponseCodeConst REQUEST_METHOD_ERROR = new ResponseCodeConst(114, "请求方式错误"); - - public static ResponseCodeConst JSON_FORMAT_ERROR = new ResponseCodeConst(115, "JSON格式错误"); - - protected int code; - - protected String msg; - - protected boolean success; - - public ResponseCodeConst() { - } - - protected ResponseCodeConst(int code, String msg) { - super(); - this.code = code; - this.msg = msg; - ResponseCodeContainer.put(this); - } - - protected ResponseCodeConst(int code, String msg, boolean success) { - super(); - this.code = code; - this.msg = msg; - this.success = success; - ResponseCodeContainer.put(this); - } - - protected ResponseCodeConst(int code) { - super(); - this.code = code; - ResponseCodeContainer.put(this); - } - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public String getMsg() { - return msg; - } - - public void setMsg(String msg) { - this.msg = msg; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } - - public static void init() { - log.info("ResponseCodeConst init...."); - } - - // =======================分割======================= - - /** - * 内部类,用于检测code范围 - * - * @author Anders - */ - @Slf4j - private static class ResponseCodeContainer { - - private static final Map RESPONSE_CODE_MAP = new HashMap<>(); - - private static final Map, int[]> RESPONSE_CODE_RANGE_MAP = new HashMap<>(); - - /** - * id的范围:[start, end]左闭右闭 - * - * @param clazz - * @param start - * @param end - */ - private static void register(Class clazz, int start, int end) { - if (start > end) { - throw new IllegalArgumentException(" start > end!"); - } - - if (RESPONSE_CODE_RANGE_MAP.containsKey(clazz)) { - throw new IllegalArgumentException(String.format(" Class:%s already exist!", clazz.getSimpleName())); - } - RESPONSE_CODE_RANGE_MAP.forEach((k, v) -> { - if ((start >= v[0] && start <= v[1]) || (end >= v[0] && end <= v[1])) { - throw new IllegalArgumentException(String.format(" Class:%s 's id range[%d,%d] has " + "intersection with " + "class:%s", clazz.getSimpleName(), start, end, - k.getSimpleName())); - } - }); - - RESPONSE_CODE_RANGE_MAP.put(clazz, new int[]{start, end}); - - // 提前初始化static变量,进行范围检测 - Field[] fields = clazz.getFields(); - if (fields.length != 0) { - try { - fields[0].get(clazz); - } catch (IllegalArgumentException | IllegalAccessException e) { - log.error("", e); - } - } - } - - public static void put(ResponseCodeConst codeConst) { - int[] idRange = RESPONSE_CODE_RANGE_MAP.get(codeConst.getClass()); - if (idRange == null) { - throw new IllegalArgumentException(String.format(" Class:%s has not been registered!", codeConst.getClass().getSimpleName())); - } - int code = codeConst.code; - if (code < idRange[0] || code > idRange[1]) { - throw new IllegalArgumentException(String.format(" Id(%d) out of range[%d,%d], " + "class:%s", code, idRange[0], idRange[1], codeConst.getClass().getSimpleName())); - } - if (RESPONSE_CODE_MAP.keySet().contains(code)) { - log.error(String.format(" Id(%d) out of range[%d,%d], " + "class:%s code is repeat!", code, idRange[0], idRange[1], codeConst.getClass().getSimpleName())); - System.exit(0); - } - RESPONSE_CODE_MAP.put(code, codeConst); - } - - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/controller/BaseController.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/controller/BaseController.java deleted file mode 100644 index 47b321aa..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/controller/BaseController.java +++ /dev/null @@ -1,42 +0,0 @@ -package net.lab1024.smartadmin.common.controller; - -import lombok.extern.slf4j.Slf4j; -import org.apache.poi.ss.usermodel.Workbook; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; - -/** - * @author: zhuoda - * @create: 2020-03-31 08:54 PM from win10 - */ - -@Slf4j -public class BaseController { - - /** - * 下载 Excel 消息头 - * @param fileName - * @param workbook - * @param response - */ - public void downloadExcel(String fileName, Workbook workbook, HttpServletResponse response) { - try { - fileName = URLEncoder.encode(fileName, "UTF-8"); - } catch (UnsupportedEncodingException e) { - log.error("", e); - } - response.setCharacterEncoding("utf-8"); - response.setHeader("Content-Type", "application/vnd.ms-excel"); - response.setHeader("Content-Disposition", "attachment;filename=" + fileName + ".xls"); - try { - workbook.write(response.getOutputStream()); - workbook.close(); - } catch (IOException e) { - log.error("", e); - } - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/domain/BaseEntity.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/domain/BaseEntity.java deleted file mode 100644 index e6724c94..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/domain/BaseEntity.java +++ /dev/null @@ -1,39 +0,0 @@ -package net.lab1024.smartadmin.common.domain; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import lombok.Data; - -import java.time.LocalDateTime; -import java.util.Date; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/3/27 0027 上午 11:15 - * @since JDK1.8 - */ -@Data -public class BaseEntity { - - /** - * 主键id - */ - @TableId(type = IdType.AUTO) - private Long id; - - /** - * 更新时间 - */ - private Date updateTime; - - /** - * 创建时间 - */ - private Date createTime; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/domain/ITask.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/domain/ITask.java deleted file mode 100644 index b6427c8e..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/domain/ITask.java +++ /dev/null @@ -1,16 +0,0 @@ -package net.lab1024.smartadmin.common.domain; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/4/13 0013 下午 14:23 - * @since JDK1.8 - */ -public interface ITask { - - void execute(String paramJson) throws Exception; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/domain/OrderItemDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/domain/OrderItemDTO.java deleted file mode 100644 index 759bb93d..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/domain/OrderItemDTO.java +++ /dev/null @@ -1,16 +0,0 @@ -package net.lab1024.smartadmin.common.domain; - -import lombok.Data; -import lombok.extern.slf4j.Slf4j; - -/** - * @author: zhuoda - * @create: 2020-03-20 09:07 PM from win10 - */ - -@Slf4j -@Data -public class OrderItemDTO { - private String column; - private boolean asc = true; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/domain/PageParamDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/domain/PageParamDTO.java deleted file mode 100644 index 73590fc5..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/domain/PageParamDTO.java +++ /dev/null @@ -1,33 +0,0 @@ -package net.lab1024.smartadmin.common.domain; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.Max; -import javax.validation.constraints.NotNull; -import java.util.List; - -/** - * 分页基础参数 - * - * @author lihaifan - * @Date Created in 2017/10/28 16:19 - */ -@Data -public class PageParamDTO { - - @NotNull(message = "分页参数不能为空") - @ApiModelProperty(value = "页码(不能为空)", example = "1") - protected Integer pageNum; - - @NotNull(message = "每页数量不能为空") - @ApiModelProperty(value = "每页数量(不能为空)", example = "10") - @Max(value = 500, message = "每页最大为500") - protected Integer pageSize; - - @ApiModelProperty("是否查询总条数") - protected Boolean searchCount; - - @ApiModelProperty("排序") - protected List orders; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/domain/ResponseDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/domain/ResponseDTO.java deleted file mode 100644 index 92ec781e..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/domain/ResponseDTO.java +++ /dev/null @@ -1,132 +0,0 @@ -package net.lab1024.smartadmin.common.domain; - - -import net.lab1024.smartadmin.common.constant.ResponseCodeConst; - -/** - * 返回类 - * - * @param - * @author zhuoda - */ -public class ResponseDTO { - - protected Integer code; - - protected String msg; - - protected Boolean success; - - protected T data; - - public ResponseDTO() { - } - - public ResponseDTO(ResponseCodeConst responseCodeConst, String msg) { - this.code = responseCodeConst.getCode(); - this.msg = msg; - this.success = responseCodeConst.isSuccess(); - } - - public ResponseDTO(ResponseCodeConst responseCodeConst, T data) { - super(); - this.code = responseCodeConst.getCode(); - this.msg = responseCodeConst.getMsg(); - this.data = data; - this.success = responseCodeConst.isSuccess(); - } - - public ResponseDTO(ResponseCodeConst responseCodeConst, T data, String msg) { - super(); - this.code = responseCodeConst.getCode(); - this.msg = msg; - this.data = data; - this.success = responseCodeConst.isSuccess(); - } - - private ResponseDTO(ResponseCodeConst responseCodeConst) { - this.code = responseCodeConst.getCode(); - this.msg = responseCodeConst.getMsg(); - this.success = responseCodeConst.isSuccess(); - } - - public ResponseDTO(ResponseDTO responseDTO) { - this.code = responseDTO.getCode(); - this.msg = responseDTO.getMsg(); - this.success = responseDTO.isSuccess(); - } - - public static ResponseDTO succ() { - return new ResponseDTO(ResponseCodeConst.SUCCESS); - } - - public static ResponseDTO succData(T data, String msg) { - return new ResponseDTO(ResponseCodeConst.SUCCESS, data, msg); - } - - public static ResponseDTO succData(T data) { - return new ResponseDTO(ResponseCodeConst.SUCCESS, data); - } - - public static ResponseDTO succMsg(String msg) { - return new ResponseDTO(ResponseCodeConst.SUCCESS, msg); - } - - - public static ResponseDTO wrap(ResponseCodeConst codeConst) { - return new ResponseDTO<>(codeConst); - } - - public static ResponseDTO wrap(ResponseCodeConst codeConst, T t) { - return new ResponseDTO(codeConst, t); - } - - public static ResponseDTO wrap(ResponseCodeConst codeConst, String msg) { - return new ResponseDTO(codeConst, msg); - } - - public static ResponseDTO wrapMsg(ResponseCodeConst codeConst, String msg) { - return new ResponseDTO(codeConst, msg); - } - - public String getMsg() { - return msg; - } - - public ResponseDTO setMsg(String msg) { - this.msg = msg; - return this; - } - - public int getCode() { - return code; - } - - public ResponseDTO setCode(Integer code) { - this.code = code; - return this; - } - - public T getData() { - return data; - } - - public ResponseDTO setData(T data) { - this.data = data; - return this; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } - - @Override - public String toString() { - return "ResponseDTO{" + "code=" + code + ", msg='" + msg + '\'' + ", success=" + success + ", data=" + data + - '}'; - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/exception/SmartBusinessException.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/exception/SmartBusinessException.java deleted file mode 100644 index 904f3a7b..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/exception/SmartBusinessException.java +++ /dev/null @@ -1,33 +0,0 @@ -package net.lab1024.smartadmin.common.exception; -/** - * - * [ 业务逻辑异常,全局异常拦截后统一返回ResponseCodeConst.SYSTEM_ERROR ] - * - * @version 1.0 - * @since JDK1.8 - * @author yandanyang - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - */ -public class SmartBusinessException extends RuntimeException { - - public SmartBusinessException() { - } - - public SmartBusinessException(String message) { - super(message); - } - - public SmartBusinessException(String message, Throwable cause) { - super(message, cause); - } - - public SmartBusinessException(Throwable cause) { - super(cause); - } - - public SmartBusinessException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { - super(message, cause, enableSuppression, writableStackTrace); - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/exception/SmartResponseCodeException.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/exception/SmartResponseCodeException.java deleted file mode 100644 index f3c37ed2..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/exception/SmartResponseCodeException.java +++ /dev/null @@ -1,24 +0,0 @@ -package net.lab1024.smartadmin.common.exception; - -/** - * [ 全局异常拦截后保留ResponseCode码的异常] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/8/7 0007 下午 16:11 - * @since JDK1.8 - */ -public class SmartResponseCodeException extends RuntimeException{ - private Integer code; - - public SmartResponseCodeException(Integer code, String message) { - super(message); - this.code = code; - } - - public Integer getCode() { - return code; - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/heartbeat/AbstractHeartBeatCommand.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/heartbeat/AbstractHeartBeatCommand.java deleted file mode 100644 index c62fbc3d..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/heartbeat/AbstractHeartBeatCommand.java +++ /dev/null @@ -1,90 +0,0 @@ -package net.lab1024.smartadmin.common.heartbeat; - -import com.google.common.util.concurrent.ThreadFactoryBuilder; -import java.util.Date; -import java.util.List; -import java.util.concurrent.*; - - -/** -* @Description: 心跳服务 -* @Author: simajinqiang -* @Date: 2018/7/9 16:26 -*/ -public abstract class AbstractHeartBeatCommand implements HeartBeatRecordCommendInterface { - - - ScheduledExecutorService executorService; - - int threadNum = 1; - - /** - * 项目路径 - */ - private String projectPath; - /** - * 服务器ip(多网卡) - */ - private List serverIps; - /** - * 进程号 - */ - private Integer processNo; - /** - * 进程开启时间 - */ - private Date processStartTime; - - HeartBeatLogger logger; - - /** - * 初始化 - */ - public void init(HeartBeatConfig config, HeartBeatLogger logger){ - this.handlerHeartBeat(); - ThreadFactory threadFactory = new ThreadFactoryBuilder().setNameFormat("AbstractHeartBeatCommand-%s").build(); - executorService = Executors.newScheduledThreadPool(threadNum, threadFactory); - executorService.scheduleWithFixedDelay(new DoHeartBeat(), config.getDelayHandlerTime(), config.getIntervalTime(), TimeUnit.MILLISECONDS); - } - - public void handlerHeartBeat(){ - try { - projectPath = HeatBeatRecordHelper.getProjectPath(); - serverIps = IpUtil.getLocalIPS(); - processNo = HeatBeatRecordHelper.getProcessID(); - processStartTime = HeatBeatRecordHelper.getStartTime(); - }catch (Throwable e){ - logger.error("get heart beat info error.", e); - } - } - - /** - * 销毁线程池 - */ - public void destroy(){ - if (executorService != null && !executorService.isShutdown()) { - executorService.shutdown(); - executorService = null; - } - } - - public class DoHeartBeat implements Runnable{ - - @Override - public void run() { - try { - HeartBeatRecordDTO heartBeatRecord = new HeartBeatRecordDTO(); - heartBeatRecord.setProjectPath(projectPath); - heartBeatRecord.setServerIp(StringUtil.join(serverIps,";")); - heartBeatRecord.setProcessNo(processNo); - heartBeatRecord.setProcessStartTime(processStartTime); - heartBeatRecord.setHeartBeatTime(new Date()); - handler(heartBeatRecord); - }catch (Throwable t){ - logger.error("handler heartbeat error.", t); - } - - } - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/heartbeat/HeartBeatConfig.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/heartbeat/HeartBeatConfig.java deleted file mode 100644 index 3fa1ed84..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/heartbeat/HeartBeatConfig.java +++ /dev/null @@ -1,29 +0,0 @@ -package net.lab1024.smartadmin.common.heartbeat; - -import lombok.Builder; -import lombok.Data; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/8/8 0008 下午 16:22 - * @since JDK1.8 - */ -@Data -@Builder -public class HeartBeatConfig { - - /** - * 延迟执行时间 - */ - private Long delayHandlerTime; - - /** - * 间隔执行时间 - */ - private Long intervalTime; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/heartbeat/HeartBeatLogger.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/heartbeat/HeartBeatLogger.java deleted file mode 100644 index 0376b0f0..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/heartbeat/HeartBeatLogger.java +++ /dev/null @@ -1,20 +0,0 @@ -package net.lab1024.smartadmin.common.heartbeat; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/8/8 0008 下午 16:23 - * @since JDK1.8 - */ -public interface HeartBeatLogger { - - void error(String string); - - void error(String string, Throwable e); - - void info(String string); -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/heartbeat/HeartBeatRecordCommendInterface.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/heartbeat/HeartBeatRecordCommendInterface.java deleted file mode 100644 index e94369e3..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/heartbeat/HeartBeatRecordCommendInterface.java +++ /dev/null @@ -1,17 +0,0 @@ -package net.lab1024.smartadmin.common.heartbeat; - - - -/** -* @Description: -* @Author: simajinqiang -* @Date: 2018/7/9 14:06 -*/ -public interface HeartBeatRecordCommendInterface { - /** - * 处理 - * @param heartBeatRecord - */ - void handler(HeartBeatRecordDTO heartBeatRecord); - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/heartbeat/HeartBeatRecordDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/heartbeat/HeartBeatRecordDTO.java deleted file mode 100644 index b5f4e499..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/heartbeat/HeartBeatRecordDTO.java +++ /dev/null @@ -1,37 +0,0 @@ -package net.lab1024.smartadmin.common.heartbeat; - -import lombok.Data; - -import java.util.Date; - -/** -* @Description: 心跳记录日志 -* @Author: simajinqiang -* @Date: 2018/7/9 11:11 -*/ -@Data -public class HeartBeatRecordDTO { - - /** - * 项目名字 - */ - private String projectPath; - /** - * 服务器ip - */ - private String serverIp; - /** - * 进程号 - */ - private Integer processNo; - /** - * 进程开启时间 - */ - private Date processStartTime; - /** - * 心跳当前时间 - */ - private Date heartBeatTime; - - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/heartbeat/HeatBeatRecordHelper.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/heartbeat/HeatBeatRecordHelper.java deleted file mode 100644 index ce3b04f7..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/heartbeat/HeatBeatRecordHelper.java +++ /dev/null @@ -1,45 +0,0 @@ -package net.lab1024.smartadmin.common.heartbeat; - - -import java.lang.management.ManagementFactory; -import java.lang.management.RuntimeMXBean; -import java.util.Date; - -/** -* @Description: 心跳工具类 -* @Author: simajinqiang -* @Date: 2018/7/9 11:48 -*/ -public class HeatBeatRecordHelper { - - /** - * 获取进程号 - * @return - */ - public static final Integer getProcessID() { - RuntimeMXBean runtimeMXBean = ManagementFactory.getRuntimeMXBean(); - return Integer.valueOf(runtimeMXBean.getName().split("@")[0]) - .intValue(); - } - - /** - * 获取项目名称 - * @return - */ - public static final String getProjectPath(){ - return System.getProperty("user.dir"); - } - - /** - * 获取进程启动时间 - * @return - */ - public static final Date getStartTime(){ - RuntimeMXBean runtimeMXBean = ManagementFactory.getRuntimeMXBean(); - return new Date(runtimeMXBean.getStartTime()); - } - - - - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/heartbeat/IpUtil.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/heartbeat/IpUtil.java deleted file mode 100644 index e250f074..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/heartbeat/IpUtil.java +++ /dev/null @@ -1,81 +0,0 @@ -package net.lab1024.smartadmin.common.heartbeat; - -import java.net.InetAddress; -import java.net.NetworkInterface; -import java.util.ArrayList; -import java.util.Enumeration; -import java.util.List; - -/** -* @Description: ip工具类 -* @Author: sbq -* @CreateDate: 2019/8/8 10:33 -* @Version: 1.0 -*/ -public class IpUtil { - /** - * 获得服务器的IP地址 - */ - public static String getLocalIP() { - String sIP = ""; - InetAddress ip = null; - try { - boolean bFindIP = false; - Enumeration netInterfaces = (Enumeration) NetworkInterface - .getNetworkInterfaces(); - while (netInterfaces.hasMoreElements()) { - if (bFindIP) { - break; - } - NetworkInterface ni = (NetworkInterface) netInterfaces - .nextElement(); - Enumeration ips = ni.getInetAddresses(); - while (ips.hasMoreElements()) { - ip = (InetAddress) ips.nextElement(); - if (!ip.isLoopbackAddress() - && ip.getHostAddress().matches( - "(\\d{1,3}\\.){3}\\d{1,3}")) { - bFindIP = true; - break; - } - } - } - } catch (Exception e) { - } - if (null != ip) { - sIP = ip.getHostAddress(); - } - return sIP; - } - - /** - * @Description: 获得服务器的IP地址(多网卡) - * @Author: sbq - * @CreateDate: 2019/8/8 10:34 - * @Version: 1.0 - */ - public static List getLocalIPS() { - InetAddress ip = null; - List ipList = new ArrayList(); - try { - Enumeration netInterfaces = (Enumeration) NetworkInterface - .getNetworkInterfaces(); - while (netInterfaces.hasMoreElements()) { - NetworkInterface ni = (NetworkInterface) netInterfaces - .nextElement(); - Enumeration ips = ni.getInetAddresses(); - while (ips.hasMoreElements()) { - ip = (InetAddress) ips.nextElement(); - if (!ip.isLoopbackAddress() - && ip.getHostAddress().matches( - "(\\d{1,3}\\.){3}\\d{1,3}")) { - ipList.add(ip.getHostAddress()); - } - } - } - } catch (Exception e) { - } - return ipList; - } - -} \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/heartbeat/StringUtil.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/heartbeat/StringUtil.java deleted file mode 100644 index 9e0842ec..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/heartbeat/StringUtil.java +++ /dev/null @@ -1,60 +0,0 @@ -package net.lab1024.smartadmin.common.heartbeat; - -import java.util.Iterator; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/8/8 0008 下午 16:27 - * @since JDK1.8 - */ -public class StringUtil { - - - - public static String join(Iterable iterable, String separator) { - return iterable == null ? null : join(iterable.iterator(), separator); - } - - - public static String join(Iterator iterator, String separator) { - if (iterator == null) { - return null; - } else if (!iterator.hasNext()) { - return ""; - } else { - Object first = iterator.next(); - if (!iterator.hasNext()) { - String result = toString(first); - return result; - } else { - StringBuilder buf = new StringBuilder(256); - if (first != null) { - buf.append(first); - } - - while(iterator.hasNext()) { - if (separator != null) { - buf.append(separator); - } - - Object obj = iterator.next(); - if (obj != null) { - buf.append(obj); - } - } - - return buf.toString(); - } - } - } - - public static String toString(Object obj) { - return obj == null ? "" : obj.toString(); - } - -} \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/SmartReloadManager.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/SmartReloadManager.java deleted file mode 100644 index 1d4770c4..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/SmartReloadManager.java +++ /dev/null @@ -1,134 +0,0 @@ -package net.lab1024.smartadmin.common.reload; - -import net.lab1024.smartadmin.common.reload.annotation.SmartReload; -import net.lab1024.smartadmin.common.reload.domain.AbstractSmartReloadObject; -import net.lab1024.smartadmin.common.reload.domain.AnnotationReloadObject; -import net.lab1024.smartadmin.common.reload.domain.InterfaceReloadObject; -import net.lab1024.smartadmin.common.reload.domain.entity.ReloadItem; -import net.lab1024.smartadmin.common.reload.domain.entity.SmartReloadResult; -import net.lab1024.smartadmin.common.reload.interfaces.SmartReloadCommandInterface; -import net.lab1024.smartadmin.common.reload.interfaces.SmartReloadThreadLogger; -import net.lab1024.smartadmin.common.reload.interfaces.SmartReloadable; - -import java.lang.reflect.Method; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.TimeUnit; - -import static java.util.Objects.requireNonNull; - -/** - * SmartReloadManager 管理器 - *

- * 可以在此类中添加 检测任务 以及注册 处理程序 - * - * @author zhuoda - */ -public class SmartReloadManager { - - private Map tagReloadObject; - - private SmartReloadScheduler reloadScheduler; - - private SmartReloadThreadLogger logger; - - public SmartReloadManager(SmartReloadThreadLogger logger, int threadCount) { - this.tagReloadObject = new ConcurrentHashMap<>(); - if (logger == null) { - throw new ExceptionInInitializerError("SmartReloadLoggerImp cannot be null"); - } - - if (threadCount < 1) { - throw new ExceptionInInitializerError("threadCount must be greater than 1"); - } - - this.logger = logger; - this.reloadScheduler = new SmartReloadScheduler(this.logger, threadCount); - } - - /** - * 默认创建单个线程 - * - * @param logger - */ - public SmartReloadManager(SmartReloadThreadLogger logger) { - this(logger, 1); - } - - /** - * 停止 - */ - public void shutdown() { - reloadScheduler.shutdown(); - } - - /** - * 添加任务 - * - * @param command SmartReloadCommand实现类 - * @param initialDelay 第一次执行前的延迟时间 - * @param delay 任务间隔时间 - * @param unit 延迟单位 TimeUnit 天、小时、分、秒等 - */ - public void addCommand(SmartReloadCommandInterface command, long initialDelay, long delay, TimeUnit unit) { - reloadScheduler.addCommand(command, initialDelay, delay, unit); - } - - /** - * 注册 实现接口的方式 - * - * @param tag - * @param reloadable - */ - public void register(String tag, SmartReloadable reloadable) { - requireNonNull(reloadable); - requireNonNull(tag); - if (tagReloadObject.containsKey(tag)) { - logger.error("<> register duplicated tag reload : " + tag + " , and it will be cover!"); - } - tagReloadObject.put(tag, new InterfaceReloadObject(reloadable)); - } - - /** - * 注册 要求此类必须包含使用了SmartReload注解的方法 - * - * @param reloadObject - */ - public void register(Object reloadObject) { - requireNonNull(reloadObject); - Method[] declaredMethods = reloadObject.getClass().getDeclaredMethods(); - if (declaredMethods != null) { - for (int i = 0; i < declaredMethods.length; i++) { - Method method = declaredMethods[i]; - SmartReload annotation = method.getAnnotation(SmartReload.class); - if (annotation != null) { - String reloadTag = annotation.value(); - this.register(reloadTag, new AnnotationReloadObject(reloadObject, method)); - } - } - } - } - - private void register(String tag, AbstractSmartReloadObject reloadObject) { - if (tagReloadObject.containsKey(tag)) { - logger.error("<> register duplicated tag reload : " + tag + " , and it will be cover!"); - } - tagReloadObject.put(tag, reloadObject); - } - - /** - * Reload 已注册的ReloadItem - * - * @param reloadItem - * @return SmartReloadResult - */ - public SmartReloadResult doReload(ReloadItem reloadItem) { - AbstractSmartReloadObject reloadObject = tagReloadObject.get(reloadItem.getTag()); - if (reloadObject != null) { - return reloadObject.reload(reloadItem); - } - // 返回注册结果 - return new SmartReloadResult(reloadItem.getTag(), reloadItem.getArgs(), reloadItem.getIdentification(), false, "No registered reload handler was found"); - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/SmartReloadScheduler.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/SmartReloadScheduler.java deleted file mode 100644 index 121c3056..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/SmartReloadScheduler.java +++ /dev/null @@ -1,87 +0,0 @@ -package net.lab1024.smartadmin.common.reload; - -import net.lab1024.smartadmin.common.reload.interfaces.SmartReloadCommandInterface; -import net.lab1024.smartadmin.common.reload.interfaces.SmartReloadThreadLogger; - -import java.util.concurrent.ScheduledThreadPoolExecutor; -import java.util.concurrent.ThreadFactory; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicInteger; - -/** - * Reload 调度器 - * - * @author zhuoda - */ -public class SmartReloadScheduler { - - private ScheduledThreadPoolExecutor executor; - - private SmartReloadThreadLogger logger; - - SmartReloadScheduler(SmartReloadThreadLogger logger, int threadCount) { - this.executor = new ScheduledThreadPoolExecutor(threadCount, new SmartReloadSchedulerThreadFactory()); - this.logger = logger; - } - - void shutdown() { - try { - executor.shutdown(); - } catch (Throwable e) { - logger.error("<> shutdown ", e); - } - } - - void addCommand(SmartReloadCommandInterface command, long initialDelay, long delay, TimeUnit unit) { - executor.scheduleWithFixedDelay(new ScheduleRunnable(command, this.logger), initialDelay, delay, unit); - } - - static class ScheduleRunnable implements Runnable { - - private SmartReloadCommandInterface command; - - private SmartReloadThreadLogger logger; - - public ScheduleRunnable(SmartReloadCommandInterface command, SmartReloadThreadLogger logger) { - this.command = command; - this.logger = logger; - } - - @Override - public void run() { - try { - command.doTask(); - } catch (Throwable e) { - logger.error("", e); - } - } - } - - static class SmartReloadSchedulerThreadFactory implements ThreadFactory { - - private static final AtomicInteger poolNumber = new AtomicInteger(1); - - private final ThreadGroup group; - - private final AtomicInteger threadNumber = new AtomicInteger(1); - - private final String namePrefix; - - SmartReloadSchedulerThreadFactory() { - SecurityManager s = System.getSecurityManager(); - group = (s != null) ? s.getThreadGroup() : Thread.currentThread().getThreadGroup(); - namePrefix = "smartreload-" + poolNumber.getAndIncrement() + "-thread-"; - } - - @Override - public Thread newThread(Runnable r) { - Thread t = new Thread(group, r, namePrefix + threadNumber.getAndIncrement(), 0); - if (t.isDaemon()) - t.setDaemon(false); - if (t.getPriority() != Thread.NORM_PRIORITY) - t.setPriority(Thread.NORM_PRIORITY); - return t; - } - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/abstracts/AbstractSmartReloadCommand.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/abstracts/AbstractSmartReloadCommand.java deleted file mode 100644 index 8e1dc3ed..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/abstracts/AbstractSmartReloadCommand.java +++ /dev/null @@ -1,66 +0,0 @@ -package net.lab1024.smartadmin.common.reload.abstracts; - -import net.lab1024.smartadmin.common.reload.SmartReloadManager; -import net.lab1024.smartadmin.common.reload.domain.entity.ReloadItem; -import net.lab1024.smartadmin.common.reload.interfaces.SmartReloadCommandInterface; - -import java.util.List; -import java.util.concurrent.ConcurrentHashMap; - -/** - * 检测是否 Reload 的类 - * - * @author zhuoda - */ -public abstract class AbstractSmartReloadCommand implements SmartReloadCommandInterface { - - /** - * 当前ReloadItem的存储器 - */ - private ConcurrentHashMap currentTags = null; - - /** - * Reload的执行类 - */ - private SmartReloadManager reloadManager; - - public AbstractSmartReloadCommand(SmartReloadManager reloadManager) { - this.reloadManager = reloadManager; - this.currentTags = new ConcurrentHashMap<>(); - // 初始获取ReloadItem数据 - List readTagStatesFromDb = readReloadItem(); - if (readTagStatesFromDb != null) { - for (ReloadItem reloadItem : readTagStatesFromDb) { - String tag = reloadItem.getTag(); - String tagChangeIdentifier = reloadItem.getIdentification(); - this.currentTags.put(tag, tagChangeIdentifier); - } - } - } - /** - * 任务: - * 读取数据库中 ReloadItem 数据 - * 校验是否发生变化 - * 执行重加载动作 - */ - @Override - public void doTask() { - // 获取数据库数据 - List readTagStatesFromDb = readReloadItem(); - String tag; - String tagIdentifier; - String preTagChangeIdentifier; - for (ReloadItem reloadItem : readTagStatesFromDb) { - tag = reloadItem.getTag(); - tagIdentifier = reloadItem.getIdentification(); - preTagChangeIdentifier = currentTags.get(tag); - // 数据不一致 - if (preTagChangeIdentifier == null || ! preTagChangeIdentifier.equals(tagIdentifier)) { - // 更新map数据 - currentTags.put(tag, tagIdentifier); - // 执行重新加载此项的动作 - handleReloadResult(this.reloadManager.doReload(reloadItem)); - } - } - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/abstracts/AbstractSmartReloadCommand4Spring.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/abstracts/AbstractSmartReloadCommand4Spring.java deleted file mode 100644 index 60f34a9c..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/abstracts/AbstractSmartReloadCommand4Spring.java +++ /dev/null @@ -1,67 +0,0 @@ -package net.lab1024.smartadmin.common.reload.abstracts; - -import net.lab1024.smartadmin.common.reload.SmartReloadManager; -import net.lab1024.smartadmin.common.reload.domain.entity.ReloadItem; -import net.lab1024.smartadmin.common.reload.interfaces.SmartReloadCommandInterface; -import org.springframework.beans.factory.annotation.Autowired; - -import java.util.List; -import java.util.concurrent.ConcurrentHashMap; - -/** - * 检测是否 Reload 的类 - * - * @author zhuoda - */ -public abstract class AbstractSmartReloadCommand4Spring implements SmartReloadCommandInterface { - - /** - * 当前ReloadItem的存储器 - */ - protected ConcurrentHashMap currentTags = new ConcurrentHashMap<>(); - - /** - * Reload的执行类 - */ - @Autowired - protected SmartReloadManager reloadManager; - -// @PostConstruct - public void init() { - List readTagStatesFromDb = readReloadItem(); - if (readTagStatesFromDb != null) { - for (ReloadItem reloadItem : readTagStatesFromDb) { - String tag = reloadItem.getTag(); - String tagChangeIdentifier = reloadItem.getIdentification(); - this.currentTags.put(tag, tagChangeIdentifier); - } - } - } - - /** - * 任务: - * 读取数据库中 ReloadItem 数据 - * 校验是否发生变化 - * 执行重加载动作 - */ - @Override - public void doTask() { - // 获取数据库数据 - List readTagStatesFromDb = readReloadItem(); - String tag; - String tagIdentifier; - String preTagChangeIdentifier; - for (ReloadItem reloadItem : readTagStatesFromDb) { - tag = reloadItem.getTag(); - tagIdentifier = reloadItem.getIdentification(); - preTagChangeIdentifier = currentTags.get(tag); - // 数据不一致 - if (preTagChangeIdentifier == null || ! preTagChangeIdentifier.equals(tagIdentifier)) { - // 更新map数据 - currentTags.put(tag, tagIdentifier); - // 执行重新加载此项的动作 - handleReloadResult(this.reloadManager.doReload(reloadItem)); - } - } - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/domain/AbstractSmartReloadObject.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/domain/AbstractSmartReloadObject.java deleted file mode 100644 index 907d37da..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/domain/AbstractSmartReloadObject.java +++ /dev/null @@ -1,31 +0,0 @@ -package net.lab1024.smartadmin.common.reload.domain; - -import net.lab1024.smartadmin.common.reload.domain.entity.ReloadItem; -import net.lab1024.smartadmin.common.reload.domain.entity.SmartReloadResult; - -import java.io.PrintWriter; -import java.io.StringWriter; -/** - * AbstractSmartReloadObject 处理程序的抽象类 - * - * @author zhuoda - */ -public abstract class AbstractSmartReloadObject { - - protected String getStackTrace(Throwable e) { - StringWriter sw = new StringWriter(); - PrintWriter pw = new PrintWriter(sw); - e.printStackTrace(pw); - return sw.toString(); - } - - /** - * 通过reloadItem参数reload,获得结果 - * - * @param reloadItem - * @return boolean - * @author zhuokongming - * @date 2016年10月21日 下午2:09:44 - */ - public abstract SmartReloadResult reload(ReloadItem reloadItem); -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/domain/AnnotationReloadObject.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/domain/AnnotationReloadObject.java deleted file mode 100644 index da19bcb9..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/domain/AnnotationReloadObject.java +++ /dev/null @@ -1,44 +0,0 @@ -package net.lab1024.smartadmin.common.reload.domain; - -import net.lab1024.smartadmin.common.reload.annotation.SmartReload; -import net.lab1024.smartadmin.common.reload.domain.entity.ReloadItem; -import net.lab1024.smartadmin.common.reload.domain.entity.SmartReloadResult; - -import java.lang.reflect.Method; - -/** - * Reload 处理程序的实现类 - * 用于包装以注解 SmartReload 实现的处理类 - * - * @author zhuoda - */ -public class AnnotationReloadObject extends AbstractSmartReloadObject { - - private Object reloadObject; - - private Method method; - - public AnnotationReloadObject(Object reloadObject, Method method) { - super(); - this.reloadObject = reloadObject; - this.method = method; - this.method.setAccessible(true); - } - - @Override - public SmartReloadResult reload(ReloadItem reloadItem) { - SmartReloadResult result = new SmartReloadResult(); - String tag = method.getAnnotation(SmartReload.class).value(); - result.setTag(tag); - result.setArgs(reloadItem.getArgs()); - result.setIdentification(reloadItem.getIdentification()); - try { - Object invoke = method.invoke(reloadObject, reloadItem.getArgs()); - result.setResult((Boolean) invoke); - } catch (Throwable e) { - result.setException(getStackTrace(e)); - } - return result; - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/domain/InterfaceReloadObject.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/domain/InterfaceReloadObject.java deleted file mode 100644 index e0f75ba0..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/domain/InterfaceReloadObject.java +++ /dev/null @@ -1,37 +0,0 @@ -package net.lab1024.smartadmin.common.reload.domain; - -import net.lab1024.smartadmin.common.reload.domain.entity.ReloadItem; -import net.lab1024.smartadmin.common.reload.domain.entity.SmartReloadResult; -import net.lab1024.smartadmin.common.reload.interfaces.SmartReloadable; - -/** - * Reload 处理程序的实现类 - * 用于处理以接口实现的处理类 - * - * @author zhuoda - */ -public class InterfaceReloadObject extends AbstractSmartReloadObject { - - private SmartReloadable object; - - public InterfaceReloadObject(SmartReloadable object) { - super(); - this.object = object; - } - - @Override - public SmartReloadResult reload(ReloadItem reloadItem) { - SmartReloadResult reloadResult = new SmartReloadResult(); - reloadResult.setArgs(reloadItem.getArgs()); - reloadResult.setIdentification(reloadItem.getIdentification()); - reloadResult.setTag(reloadItem.getTag()); - try { - boolean res = object.reload(reloadItem); - reloadResult.setResult(res); - } catch (Throwable e) { - reloadResult.setException(getStackTrace(e)); - } - return reloadResult; - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/domain/entity/ReloadItem.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/domain/entity/ReloadItem.java deleted file mode 100644 index 66a89b60..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/domain/entity/ReloadItem.java +++ /dev/null @@ -1,55 +0,0 @@ -package net.lab1024.smartadmin.common.reload.domain.entity; -/** - * ReloadItem 类 - * - * @author zhuoda - */ -public class ReloadItem { - - /** - * 项名称 - */ - private String tag; - - /** - * 参数 - */ - private String args; - - /** - * 标识 - */ - private String identification; - - public ReloadItem() { - - } - public ReloadItem(String tag, String identification, String args) { - this.tag = tag; - this.identification = identification; - this.args = args; - } - - public String getTag() { - return tag; - } - public void setTag(String tag) { - this.tag = tag; - } - public String getIdentification() { - return identification; - } - public void setIdentification(String identification) { - this.identification = identification; - } - public String getArgs() { - return args; - } - public void setArgs(String args) { - this.args = args; - } - @Override - public String toString() { - return "ReloadItem{" + "tag='" + tag + '\'' + ", identification='" + identification + '\'' + ", args='" + args + '\'' + '}'; - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/domain/entity/SmartReloadResult.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/domain/entity/SmartReloadResult.java deleted file mode 100644 index 07c6d2d5..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/domain/entity/SmartReloadResult.java +++ /dev/null @@ -1,102 +0,0 @@ -package net.lab1024.smartadmin.common.reload.domain.entity; -/** - * t_reload_result 表 实体类 - * - * @author zhuoda - */ -public class SmartReloadResult { - - /** - * 项名称 - */ - private String tag; - - /** - * 参数 - */ - private String args; - - /** - * 标识 - */ - private String identification; - - /** - * 处理结果 - */ - private boolean result; - - /** - * 异常说明 - */ - private String exception; - - public SmartReloadResult() { - } - - public SmartReloadResult(String tag, String args, boolean result, String exception) { - this.tag = tag; - this.args = args; - this.result = result; - this.exception = exception; - } - - public SmartReloadResult(String tag, String args, String identification, boolean result, String exception) { - this.tag = tag; - this.args = args; - this.identification = identification; - this.result = result; - this.exception = exception; - } - - public void setTag(String tag) { - this.tag = tag; - } - - public void setArgs(String args) { - this.args = args; - } - - public void setIdentification(String identification) { - this.identification = identification; - } - - public void setResult(boolean result) { - this.result = result; - } - - public void setException(String exception) { - this.exception = exception; - } - - public String getTag() { - return tag; - } - - public String getArgs() { - return args; - } - - public String getIdentification() { - return identification; - } - - public boolean isResult() { - return result; - } - - public String getException() { - return exception; - } - - @Override - public String toString() { - return "SmartReloadResult{" + - "tag='" + tag + '\'' + - ", args='" + args + '\'' + - ", identification='" + identification + '\'' + - ", result=" + result + - ", exception='" + exception + '\'' + - '}'; - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/interfaces/SmartReloadCommandInterface.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/interfaces/SmartReloadCommandInterface.java deleted file mode 100644 index c9e04237..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/interfaces/SmartReloadCommandInterface.java +++ /dev/null @@ -1,38 +0,0 @@ -package net.lab1024.smartadmin.common.reload.interfaces; - -import net.lab1024.smartadmin.common.reload.domain.entity.ReloadItem; -import net.lab1024.smartadmin.common.reload.domain.entity.SmartReloadResult; - -import java.util.List; - -/** - * 检测是否 Reload 的类 - * - * @author zhuoda - */ -public interface SmartReloadCommandInterface { - - /** - * 任务: - * 读取数据库中 ReloadItem 数据 - * 校验是否发生变化 - * 执行重加载动作 - */ - void doTask(); - - /** - * 该方法返回一个List:
- * ReloadItem对象的tagIdentify为:该tag的 状态(状态其实就是个字符串,如果该字符串跟上次有变化则进行reload操作)
- * ReloadItem对象的args为: reload操作需要的参数

- * - * @return List - */ - List readReloadItem(); - - /** - * 处理Reload结果 - * - * @param reloadResult - */ - void handleReloadResult(SmartReloadResult reloadResult); -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/interfaces/SmartReloadThreadLogger.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/interfaces/SmartReloadThreadLogger.java deleted file mode 100644 index e03c9ad7..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/interfaces/SmartReloadThreadLogger.java +++ /dev/null @@ -1,12 +0,0 @@ -package net.lab1024.smartadmin.common.reload.interfaces; - -/** - * SmartReloadThreadLogger 日志类 - */ -public interface SmartReloadThreadLogger { - - void error(String string); - - void error(String string, Throwable e); - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/interfaces/SmartReloadable.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/interfaces/SmartReloadable.java deleted file mode 100644 index 85473d5f..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/reload/interfaces/SmartReloadable.java +++ /dev/null @@ -1,19 +0,0 @@ -package net.lab1024.smartadmin.common.reload.interfaces; - -import net.lab1024.smartadmin.common.reload.domain.entity.ReloadItem; - -/** - * reload 接口
- * 需要reload的业务实现类 - */ -@FunctionalInterface -public interface SmartReloadable { - - /** - * reload - * - * @param reloadItem - * @return boolean - */ - boolean reload(ReloadItem reloadItem); -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/validator/bigdecimal/BigDecimalValidator.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/validator/bigdecimal/BigDecimalValidator.java deleted file mode 100644 index 5ba85bf7..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/validator/bigdecimal/BigDecimalValidator.java +++ /dev/null @@ -1,73 +0,0 @@ -package net.lab1024.smartadmin.common.validator.bigdecimal; - -import net.lab1024.smartadmin.util.SmartBigDecimalUtil; - -import javax.validation.ConstraintValidator; -import javax.validation.ConstraintValidatorContext; -import java.math.BigDecimal; - -/** - * BigDecimal 类校验器 - * - * @author listen - * @date 2018年3月20日 13:51:46 - */ -public class BigDecimalValidator implements ConstraintValidator { - - /** - * 获取定义的数值 - */ - private BigDecimal value; - - /** - * 获取比较符 - */ - private ComparisonSymbolEnum symbolEnum; - - /** - * 是否必须 - */ - private boolean required; - - @Override - public void initialize(CheckBigDecimal constraintAnnotation) { - // 初始化属性 - value = new BigDecimal(constraintAnnotation.value()); - symbolEnum = constraintAnnotation.symbolEnum(); - required = constraintAnnotation.required(); - } - - @Override - public boolean isValid(BigDecimal decimal, ConstraintValidatorContext constraintValidatorContext) { - - // 如果数值为空,校验是否必须 - if (null == decimal) { - return ! required; - } - - // 根据操作符,校验结果 - switch (symbolEnum) { - // 等于 - case EQUAL: - return SmartBigDecimalUtil.equals(decimal, value); - // 不等于 - case NOT_EQUAL: - return ! SmartBigDecimalUtil.equals(decimal, value); - // 小于 - case LESS_THAN: - return SmartBigDecimalUtil.isLessThan(decimal, value); - // 小于等于 - case LESS_THAN_OR_EQUAL: - return SmartBigDecimalUtil.isLessThan(decimal, value) || SmartBigDecimalUtil.equals(decimal, value); - // 大于 - case GREATER_THAN: - return SmartBigDecimalUtil.isGreaterThan(decimal, value); - // 大于等于 - case GREATER_THAN_OR_EQUAL: - return SmartBigDecimalUtil.isGreaterThan(decimal, value) || SmartBigDecimalUtil.equals(decimal, value); - default: - } - - return false; - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/validator/bigdecimal/CheckBigDecimal.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/validator/bigdecimal/CheckBigDecimal.java deleted file mode 100644 index 73ef5668..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/validator/bigdecimal/CheckBigDecimal.java +++ /dev/null @@ -1,53 +0,0 @@ -package net.lab1024.smartadmin.common.validator.bigdecimal; - -import javax.validation.Constraint; -import javax.validation.Payload; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * 自定义的属性校验注解 - * - * @author listen - * @date 2018年3月20日 13:53:33 - */ -@Target(ElementType.FIELD) -@Retention(RetentionPolicy.RUNTIME) -@Constraint(validatedBy = BigDecimalValidator.class)// 自定义验证的处理类 -public @interface CheckBigDecimal { - - /** - * 与这个数值校验 - * - * @return - */ - String value(); - - /** - * 比较符 请使用 ComparisonSymbolEnum 枚举类 - * - * @return - */ - ComparisonSymbolEnum symbolEnum(); - - /** - * 默认的错误提示信息 - * - * @return String - */ - String message() default "非法的数值"; - - /** - * 是否必须 : 默认 true - * - * @return boolean - */ - boolean required() default true; - - //下面这两个属性必须添加 :不然会报错 - Class[] groups() default {}; - - Class[] payload() default {}; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/validator/bigdecimal/ComparisonSymbolEnum.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/validator/bigdecimal/ComparisonSymbolEnum.java deleted file mode 100644 index e59d0bf3..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/common/validator/bigdecimal/ComparisonSymbolEnum.java +++ /dev/null @@ -1,40 +0,0 @@ -package net.lab1024.smartadmin.common.validator.bigdecimal; - -/** - * 比较符枚举类 - * - * @author listen - * @date 2018/03/20 14:01 - */ -public enum ComparisonSymbolEnum { - - /** - * 等于 - */ - EQUAL, - - /** - * 不等于 - */ - NOT_EQUAL, - - /** - * 小于 - */ - LESS_THAN, - - /** - * 小于等于 - */ - LESS_THAN_OR_EQUAL, - - /** - * 大于 - */ - GREATER_THAN, - - /** - * 大于等于 - */ - GREATER_THAN_OR_EQUAL, -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartAdminWebAppConfig.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartAdminWebAppConfig.java deleted file mode 100644 index 04d30c67..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartAdminWebAppConfig.java +++ /dev/null @@ -1,25 +0,0 @@ -package net.lab1024.smartadmin.config; - -import net.lab1024.smartadmin.interceptor.SmartAuthenticationInterceptor; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.servlet.config.annotation.*; - -@Configuration -public class SmartAdminWebAppConfig implements WebMvcConfigurer { - - @Autowired - private SmartAuthenticationInterceptor smartAuthenticationInterceptor; - - @Override - public void addInterceptors(InterceptorRegistry registry) { - registry.addInterceptor(smartAuthenticationInterceptor).addPathPatterns("/**"); - } - - - @Override - public void addViewControllers(ViewControllerRegistry registry) { - registry.addViewController("/druidMonitor").setViewName("redirect:/druid/index.html"); - registry.addViewController("/swaggerApi").setViewName("redirect:/swagger-ui.html"); - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartHeartBeatConfig.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartHeartBeatConfig.java deleted file mode 100644 index 14517a8f..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartHeartBeatConfig.java +++ /dev/null @@ -1,33 +0,0 @@ -package net.lab1024.smartadmin.config; - -import lombok.Data; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Configuration; - -/** - * - * [ ] - * - * @version 1.0 - * @since JDK1.8 - * @author yandanyang - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - */ -@Data -@Configuration -public class SmartHeartBeatConfig { - - /** - * 延迟执行时间 - */ - @Value("${heart-beat.delayHandlerTime}") - private Long delayHandlerTime; - - /** - * 间隔执行时间 - */ - @Value("${heart-beat.intervalTime}") - private Long intervalTime; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartMybatisPlusConfig.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartMybatisPlusConfig.java deleted file mode 100644 index 6bdcfb08..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartMybatisPlusConfig.java +++ /dev/null @@ -1,27 +0,0 @@ -package net.lab1024.smartadmin.config; - -import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; -import com.baomidou.mybatisplus.extension.plugins.pagination.optimize.JsqlParserCountOptimize; -import org.mybatis.spring.annotation.MapperScan; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.transaction.annotation.EnableTransactionManagement; - -/** - * @author zhuoda - */ -@EnableTransactionManagement -@Configuration -@MapperScan(basePackages = {"net.lab1024.smartadmin.module.*"}) -public class SmartMybatisPlusConfig { - - /** - * 分页插件 - */ - @Bean - public PaginationInterceptor paginationInterceptor() { - // 开启 count 的 join 优化,只针对 left join !!! - return new PaginationInterceptor().setCountSqlParser(new JsqlParserCountOptimize(true)); - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartReloadConfig.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartReloadConfig.java deleted file mode 100644 index bf5defdd..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartReloadConfig.java +++ /dev/null @@ -1,45 +0,0 @@ -package net.lab1024.smartadmin.config; - -import net.lab1024.smartadmin.common.reload.SmartReloadManager; -import net.lab1024.smartadmin.common.reload.interfaces.SmartReloadThreadLogger; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/3/28 0028 下午 20:15 - * @since JDK1.8 - */ -@Slf4j -@Configuration -public class SmartReloadConfig { - - @Value("${smart-reload.thread-count}") - private Integer threadCount; - - @Bean - public SmartReloadManager initSmartReloadManager() { - /** - * 创建 Reload Manager 调度器 - */ - SmartReloadManager smartReloadManager = new SmartReloadManager(new SmartReloadThreadLogger() { - @Override - public void error(String string) { - log.error(string); - } - - @Override - public void error(String string, Throwable e) { - log.error(string, e); - } - }, threadCount); - return smartReloadManager; - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartRestTemplateConfig.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartRestTemplateConfig.java deleted file mode 100644 index 70d9624c..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartRestTemplateConfig.java +++ /dev/null @@ -1,109 +0,0 @@ -package net.lab1024.smartadmin.config; - -import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter; -import org.apache.http.client.HttpClient; -import org.apache.http.client.config.RequestConfig; -import org.apache.http.config.Registry; -import org.apache.http.config.RegistryBuilder; -import org.apache.http.conn.socket.ConnectionSocketFactory; -import org.apache.http.conn.socket.PlainConnectionSocketFactory; -import org.apache.http.conn.ssl.SSLConnectionSocketFactory; -import org.apache.http.impl.client.HttpClientBuilder; -import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.http.MediaType; -import org.springframework.http.client.ClientHttpRequestFactory; -import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; -import org.springframework.http.converter.FormHttpMessageConverter; -import org.springframework.http.converter.HttpMessageConverter; -import org.springframework.http.converter.StringHttpMessageConverter; -import org.springframework.web.client.RestTemplate; - -import java.nio.charset.Charset; -import java.util.ArrayList; -import java.util.List; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - * @since JDK1.8 - */ -@Configuration -public class SmartRestTemplateConfig { - - - @Value("${http.pool.max-total}") - private Integer maxTotal; - @Value("${http.pool.default-max-per-route}") - private Integer defaultMaxPerRoute; - @Value("${http.pool.socket-timeout}") - private Integer socketTimeout; - @Value("${http.pool.connect-timeout}") - private Integer connectTimeout; - @Value("${http.pool.connection-request-timeout}") - private Integer connectionRequestTimeout; - - - @Bean - public RestTemplate restTemplate(ClientHttpRequestFactory factory) { - return new RestTemplate(factory); - } - - @Bean - public ClientHttpRequestFactory httpRequestFactory() { - HttpComponentsClientHttpRequestFactory factory = new HttpComponentsClientHttpRequestFactory(httpClient()); - return factory; - } - - /** - * fastJsonRestTemplate - * - * @return - */ - @Bean(name = "fastJsonRestTemplate") - public RestTemplate fastJsonRestTemplate() { - RestTemplate restTemplate = new RestTemplate(httpRequestFactory()); - - HttpMessageConverter converter = new StringHttpMessageConverter(Charset.forName("UTF-8")); - - FastJsonHttpMessageConverter fastConverter = new FastJsonHttpMessageConverter(); - List fastMediaTypes = new ArrayList<>(); - fastMediaTypes.add(MediaType.APPLICATION_FORM_URLENCODED); - fastMediaTypes.add(MediaType.APPLICATION_JSON_UTF8); - fastConverter.setSupportedMediaTypes(fastMediaTypes); - List> converters = restTemplate.getMessageConverters(); - converters.add(1,converter); - converters.add(fastConverter); - return restTemplate; - } - - - @Bean - public HttpClient httpClient() { - Registry registry = RegistryBuilder.create() - .register("http", PlainConnectionSocketFactory.getSocketFactory()) - .register("https", SSLConnectionSocketFactory.getSocketFactory()) - .build(); - PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(registry); - connectionManager.setMaxTotal(maxTotal); - connectionManager.setDefaultMaxPerRoute(defaultMaxPerRoute); - - RequestConfig requestConfig = RequestConfig.custom() - .setSocketTimeout(socketTimeout) - .setConnectTimeout(connectTimeout) - .setConnectionRequestTimeout(connectionRequestTimeout) - .build(); - return HttpClientBuilder.create() - .setDefaultRequestConfig(requestConfig) - .setConnectionManager(connectionManager) - .build(); - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartSwaggerApiModelEnumConfig.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartSwaggerApiModelEnumConfig.java deleted file mode 100644 index 93e45791..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartSwaggerApiModelEnumConfig.java +++ /dev/null @@ -1,29 +0,0 @@ -package net.lab1024.smartadmin.config; - -import net.lab1024.smartadmin.common.swagger.SmartSwaggerApiModelEnumPlugin; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.core.annotation.Order; -import springfox.documentation.swagger.common.SwaggerPluginSupport; - -/** - * [ 对于枚举类进行swagger注解,与前端的vue-enum相匹配 ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/8/9 0009 上午 9:46 - * @since JDK1.8 - */ -@Configuration -@Profile({"dev", "sit", "pre", "prod"}) -public class SmartSwaggerApiModelEnumConfig { - - @Bean - @Order(SwaggerPluginSupport.SWAGGER_PLUGIN_ORDER + 1) - public SmartSwaggerApiModelEnumPlugin swaggerEnum(){ - return new SmartSwaggerApiModelEnumPlugin(); - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartSwaggerDynamicGroupConfig.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartSwaggerDynamicGroupConfig.java deleted file mode 100644 index aad7b175..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartSwaggerDynamicGroupConfig.java +++ /dev/null @@ -1,236 +0,0 @@ -package net.lab1024.smartadmin.config; - -import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j; -import com.google.common.base.Optional; -import com.google.common.base.Predicate; -import com.google.common.base.Predicates; -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; -import io.swagger.annotations.Api; -import lombok.extern.slf4j.Slf4j; -import net.lab1024.smartadmin.constant.SwaggerTagConst; -import net.lab1024.smartadmin.interceptor.SmartAuthenticationInterceptor; -import org.springframework.beans.BeansException; -import org.springframework.beans.factory.config.BeanDefinition; -import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; -import org.springframework.beans.factory.support.BeanDefinitionBuilder; -import org.springframework.beans.factory.support.BeanDefinitionRegistry; -import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor; -import org.springframework.context.EnvironmentAware; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.core.env.Environment; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.bind.annotation.RestController; -import springfox.documentation.RequestHandler; -import springfox.documentation.builders.ApiInfoBuilder; -import springfox.documentation.builders.ParameterBuilder; -import springfox.documentation.builders.PathSelectors; -import springfox.documentation.builders.RequestHandlerSelectors; -import springfox.documentation.schema.ModelRef; -import springfox.documentation.service.*; -import springfox.documentation.spi.DocumentationType; -import springfox.documentation.spi.service.contexts.SecurityContext; -import springfox.documentation.spring.web.plugins.Docket; -import springfox.documentation.swagger2.annotations.EnableSwagger2; - -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -/** - * [ 根据SwaggerTagConst内部类动态生成Swagger group ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/8/7 0007 下午 19:20 - * @since JDK1.8 - */ -@Slf4j -@EnableSwagger2 -@EnableKnife4j -@Configuration -@Profile({"dev", "sit", "pre", "prod"}) -public class SmartSwaggerDynamicGroupConfig implements EnvironmentAware, BeanDefinitionRegistryPostProcessor { - - /** - * 分组名称 - */ - private String apiGroupName; - - /** - * 文档标题 - */ - private String title; - - /** - * 文档描述 - */ - private String description; - - /** - * api版本 - */ - private String version; - - /** - * service url - */ - private String serviceUrl; - - /** - * controller 包路径 - */ - private String packAge; - - private int groupIndex = 0; - - private String groupName = "default"; - - private final List groupList = Lists.newArrayList(); - - private final Map> groupMap = Maps.newHashMap(); - - @Override - public void setEnvironment(Environment environment) { - this.apiGroupName = environment.getProperty("swagger.apiGroupName"); - this.title = environment.getProperty("swagger.title"); - this.description = environment.getProperty("swagger.description"); - this.version = environment.getProperty("swagger.version"); - this.serviceUrl = environment.getProperty("swagger.serviceUrl"); - this.packAge = environment.getProperty("swagger.packAge"); - } - - @Override - public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException { - this.groupBuild(); - for (Map.Entry> entry : groupMap.entrySet()) { - String group = entry.getKey(); - BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(Docket.class, this::baseDocket); - BeanDefinition beanDefinition = builder.getRawBeanDefinition(); - registry.registerBeanDefinition(group + "Api", beanDefinition); - } - } - - private void groupBuild() { - Class clazz = SwaggerTagConst.class; - Class[] innerClazz = clazz.getDeclaredClasses(); - for (Class cls : innerClazz) { - String group = cls.getSimpleName(); - List apiTags = Lists.newArrayList(); - Field[] fields = cls.getDeclaredFields(); - for (Field field : fields) { - boolean isFinal = Modifier.isFinal(field.getModifiers()); - if (isFinal) { - try { - apiTags.add(field.get(null).toString()); - } catch (Exception e) { - log.error("", e); - } - } - } - groupList.add(group); - groupMap.put(group, apiTags); - } - } - - private Docket baseDocket() { - // 配置全局参数 token - ParameterBuilder tokenPar = new ParameterBuilder(); - Parameter parameter = tokenPar.name(SmartAuthenticationInterceptor.TOKEN_NAME) - .description("token") - .modelRef(new ModelRef("string")) - .parameterType("header") - .defaultValue("") - .required(false) - .build(); - - // 请求类型过滤规则 - Predicate controllerPredicate = getControllerPredicate(); - // controller 包路径 - Predicate controllerPackage = RequestHandlerSelectors.basePackage(packAge); - return new Docket(DocumentationType.SWAGGER_2) - .groupName(groupName) - .forCodeGeneration(true) - .select() - .apis(controllerPackage) - .apis(controllerPredicate) - .paths(PathSelectors.any()) - .build() - .apiInfo(this.serviceApiInfo()) - .securitySchemes(securitySchemes()) - .securityContexts(securityContexts()) - .globalOperationParameters(Lists.newArrayList(parameter)); - } - - private List securitySchemes() { - List apiKeyList = new ArrayList<>(); - apiKeyList.add(new ApiKey("x-access-token", "x-access-token", "header")); - return apiKeyList; - } - - private List securityContexts() { - List securityContexts = new ArrayList<>(); - securityContexts.add( - SecurityContext.builder() - .securityReferences(defaultAuth()) - .forPaths(PathSelectors.any()) - .build()); - return securityContexts; - } - - List defaultAuth() { - AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything"); - AuthorizationScope[] authorizationScopes = new AuthorizationScope[1]; - authorizationScopes[0] = authorizationScope; - List securityReferences = new ArrayList<>(); - securityReferences.add(new SecurityReference("x-access-token", authorizationScopes)); - return securityReferences; - } - - private Predicate getControllerPredicate() { - groupName = groupList.get(groupIndex); - List apiTags = groupMap.get(groupName); - Predicate methodPredicate = (input) -> { - Api api = null; - Optional apiOptional = input.findControllerAnnotation(Api.class); - if (apiOptional.isPresent()) { - api = apiOptional.get(); - } - List tags = Arrays.asList(api.tags()); - if (api != null && apiTags.containsAll(tags)) { - return true; - } - return false; - }; - groupIndex++; - return Predicates.or( - Predicates.and(RequestHandlerSelectors.withClassAnnotation(RestController.class), methodPredicate), - Predicates.and( - RequestHandlerSelectors.withMethodAnnotation(ResponseBody.class), methodPredicate) - ); - } - - private ApiInfo serviceApiInfo() { - return new ApiInfoBuilder() - .title(title) - .description(description) - .version(version) - .license("Apache License Version 2.0") - .contact(new Contact("1024创新实验室", "http://www.1024lab.net", "")) - .termsOfServiceUrl(serviceUrl) - .build(); - } - - @Override - public void postProcessBeanFactory(ConfigurableListableBeanFactory configurableListableBeanFactory) throws BeansException { - - } - - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartWebSocketConfig.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartWebSocketConfig.java deleted file mode 100644 index f431fdac..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SmartWebSocketConfig.java +++ /dev/null @@ -1,25 +0,0 @@ -package net.lab1024.smartadmin.config; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.socket.server.standard.ServerEndpointExporter; - -/** - * [ WebSocketConfig ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/7/10 0010 下午 16:07 - * @since JDK1.8 - */ -@Configuration -public class SmartWebSocketConfig { - - @Bean - public ServerEndpointExporter serverEndpointExporter() { - return new ServerEndpointExporter(); - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SystemEnvironmentCondition.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SystemEnvironmentCondition.java deleted file mode 100644 index 63c2a5ed..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/config/SystemEnvironmentCondition.java +++ /dev/null @@ -1,22 +0,0 @@ -package net.lab1024.smartadmin.config; -import net.lab1024.smartadmin.constant.SystemEnvironmentEnum; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Condition; -import org.springframework.context.annotation.ConditionContext; -import org.springframework.core.type.AnnotatedTypeMetadata; -/** - * 是否是正式环境 - * - * @author listen - * @date 2019/08/27 08:56 - */ -public class SystemEnvironmentCondition implements Condition { - - @Value("${spring.profiles.active}") - private String systemEnvironment; - - @Override - public boolean matches(ConditionContext conditionContext, AnnotatedTypeMetadata annotatedTypeMetadata) { - return ! SystemEnvironmentEnum.PROD.equalsValue(systemEnvironment); - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/constant/CommonConst.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/constant/CommonConst.java deleted file mode 100644 index b2c4a63f..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/constant/CommonConst.java +++ /dev/null @@ -1,51 +0,0 @@ -package net.lab1024.smartadmin.constant; - -import com.google.common.collect.ImmutableSet; -import org.apache.commons.collections4.CollectionUtils; - -import java.util.Set; - -/** - * - * [ 通用常量 ] - * - * @version 1.0 - * @since JDK1.8 - * @author yandanyang - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - */ -public class CommonConst { - - - public static final class Page { - public static final Integer SIZE = 10; - } - - public static final class Password { - public static final String DEFAULT = "123456"; - public static final String SALT_FORMAT = "smart_%s_admin"; - } - - public static final String IGNORE_H5_URL_MAPPING = "/h5/api"; - - public static final class CommonCollection { - public static final Set IGNORE_URL = ImmutableSet.of("/swagger", "Excel"); - - public static final Set IGNORE_URL_MAPPING = ImmutableSet.of(IGNORE_H5_URL_MAPPING); - - public static Boolean contain(Set ignores, String uri) { - if (CollectionUtils.isEmpty(ignores)) { - return false; - } - for (String ignoreUrl : ignores) { - if (uri.startsWith(ignoreUrl)) { - return true; - } - } - return false; - } - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/constant/SmartReloadTagConst.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/constant/SmartReloadTagConst.java deleted file mode 100644 index 0799bd66..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/constant/SmartReloadTagConst.java +++ /dev/null @@ -1,16 +0,0 @@ -package net.lab1024.smartadmin.constant; -/** - * smart initDefines 项 常量 - * - * @author listen - * @date 2018/02/10 14:29 - */ -public class SmartReloadTagConst { - - /** - * 系统环境设置 DEMO - */ - public static final String SYSTEM_CONFIG = "system_config"; - - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/constant/SwaggerTagConst.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/constant/SwaggerTagConst.java deleted file mode 100644 index 559f9a30..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/constant/SwaggerTagConst.java +++ /dev/null @@ -1,69 +0,0 @@ -package net.lab1024.smartadmin.constant; - -/** - * [] - * - * @author yandanyang - * @version 1.0 - * @since JDK1.8 - */ -public class SwaggerTagConst { - - - public static class Admin { - public static final String MANAGER_SYSTEM_CONFIG = "管理端-系统配置"; - - public static final String MANAGER_USER = "管理端-用户"; - - public static final String MANAGER_USER_LOGIN = "管理端-用户登录"; - - public static final String MANAGER_DEPARTMENT = "管理端-部门"; - - public static final String MANAGER_ROLE = "管理端-角色"; - - public static final String MANAGER_ROLE_USER = "管理端-角色用户"; - - public static final String MANAGER_ROLE_PRIVILEGE = "管理端-角色权限"; - - public static final String MANAGER_SMART_RELOAD = "管理端-smart reload"; - - public static final String MANAGER_ORDER_OPERATE_LOG = "管理端-单据操作日志"; - - public static final String MANAGER_TASK_SCHEDULER = "管理端-任务调度"; - - public static final String MANAGER_USER_LOGIN_LOG = "管理端-用户登录日志"; - - public static final String MANAGER_USER_OPERATE_LOG = "管理端-用户操作日志"; - - public static final String MANAGER_DATA_SCOPE = "管理端-数据范围"; - - public static final String MANAGER_JOB = "管理端-岗位"; - - public static final String MANAGER_NOTICE = "管理端-系统通知"; - - public static final String MANAGER_FILE = "通用-文件服务"; - - public static final String MANAGER_PRIVILEGE = "通用-权限"; - - public static final String MANAGER_EMAIL = "通用-邮件发送"; - - public static final String MANAGER_HEART_BEAT = "通用-心跳服务"; - } - - /** - * 自定义分组2 - */ - public static class Group2 { - - - } - - /** - * 自定义分组2 - */ - public static class Group3 { - - } - - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/constant/SystemEnvironmentEnum.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/constant/SystemEnvironmentEnum.java deleted file mode 100644 index e8d0fd75..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/constant/SystemEnvironmentEnum.java +++ /dev/null @@ -1,67 +0,0 @@ -package net.lab1024.smartadmin.constant; - -import net.lab1024.smartadmin.common.domain.BaseEnum; - -/** - * 系统环境枚举类 - * - * @author listen - * @date 2019年4月11日 17:34:59 - */ -public enum SystemEnvironmentEnum implements BaseEnum { - - - /** - * dev - */ - DEV("dev", "开发环境"), - - /** - * sit - */ - SIT("sit", "测试环境"), - - /** - * pre - */ - PRE("pre", "预发布环境"), - - /** - * prod - */ - PROD("prod", "生产环境"); - - - public static final String DEV_ENV = "dev"; - - - private String value; - - private String desc; - - SystemEnvironmentEnum(String value, String desc) { - this.value = value; - this.desc = desc; - } - - /** - * 获取定义枚举value值 - * - * @return Integer - */ - @Override - public String getValue() { - return value; - } - - /** - * 获取枚举类的说明 - * - * @return String - */ - @Override - public String getDesc() { - return desc; - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/handler/SmartGlobalExceptionHandler.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/handler/SmartGlobalExceptionHandler.java deleted file mode 100644 index dabd6fd9..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/handler/SmartGlobalExceptionHandler.java +++ /dev/null @@ -1,73 +0,0 @@ -package net.lab1024.smartadmin.handler; - -import net.lab1024.smartadmin.common.constant.ResponseCodeConst; -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.common.exception.SmartBusinessException; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.TypeMismatchException; -import org.springframework.http.converter.HttpMessageNotReadableException; -import org.springframework.validation.FieldError; -import org.springframework.web.HttpRequestMethodNotSupportedException; -import org.springframework.web.bind.MethodArgumentNotValidException; -import org.springframework.web.bind.annotation.ControllerAdvice; -import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.bind.annotation.ResponseBody; - -import java.util.List; -import java.util.stream.Collectors; - -/** - * [ 全局异常拦截 ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - * @since JDK1.8 - */ -@Slf4j -@ControllerAdvice -public class SmartGlobalExceptionHandler { - - /** - * 添加全局异常处理流程 - * - * @param e - * @return - * @throws Exception - */ - @ResponseBody - @ExceptionHandler(Exception.class) - public ResponseDTO exceptionHandler(Exception e) { - log.error("error:", e); - - // http 请求方式错误 - if (e instanceof HttpRequestMethodNotSupportedException) { - return ResponseDTO.wrap(ResponseCodeConst.REQUEST_METHOD_ERROR); - } - - // 参数类型错误 - if (e instanceof TypeMismatchException) { - return ResponseDTO.wrap(ResponseCodeConst.ERROR_PARAM); - } - - // json 格式错误 - if (e instanceof HttpMessageNotReadableException) { - return ResponseDTO.wrap(ResponseCodeConst.JSON_FORMAT_ERROR); - } - - // 参数校验未通过 - if (e instanceof MethodArgumentNotValidException) { - List fieldErrors = ((MethodArgumentNotValidException) e).getBindingResult().getFieldErrors(); - List msgList = fieldErrors.stream().map(FieldError :: getDefaultMessage).collect(Collectors.toList()); - return ResponseDTO.wrap(ResponseCodeConst.ERROR_PARAM, String.join(",", msgList)); - } - - if (e instanceof SmartBusinessException) { - return ResponseDTO.wrap(ResponseCodeConst.SYSTEM_ERROR); - } - - return ResponseDTO.wrap(ResponseCodeConst.SYSTEM_ERROR); - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/handler/SmartOperateLogAspect.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/handler/SmartOperateLogAspect.java deleted file mode 100644 index 0dd49cd2..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/handler/SmartOperateLogAspect.java +++ /dev/null @@ -1,167 +0,0 @@ -package net.lab1024.smartadmin.handler; - -import com.alibaba.fastjson.JSON; -import net.lab1024.smartadmin.common.anno.OperateLog; -import net.lab1024.smartadmin.common.constant.JudgeEnum; -import net.lab1024.smartadmin.module.business.log.LogService; -import net.lab1024.smartadmin.module.business.log.useroperatelog.domain.UserOperateLogEntity; -import net.lab1024.smartadmin.module.system.login.domain.RequestTokenBO; -import net.lab1024.smartadmin.util.SmartRequestTokenUtil; -import net.lab1024.smartadmin.util.SmartStringUtil; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.extern.slf4j.Slf4j; -import org.aspectj.lang.JoinPoint; -import org.aspectj.lang.Signature; -import org.aspectj.lang.annotation.AfterReturning; -import org.aspectj.lang.annotation.AfterThrowing; -import org.aspectj.lang.annotation.Aspect; -import org.aspectj.lang.annotation.Pointcut; -import org.aspectj.lang.reflect.MethodSignature; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.core.annotation.AnnotationUtils; -import org.springframework.stereotype.Component; -import org.springframework.web.context.request.RequestContextHolder; -import org.springframework.web.context.request.ServletRequestAttributes; - -import javax.servlet.http.HttpServletRequest; -import java.io.PrintWriter; -import java.io.StringWriter; -import java.lang.reflect.Method; -/** - * [ 操作日志记录处理,对所有OperateLog注解的Controller进行操作日志监控 ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - * @since JDK1.8 - */ -@Slf4j -@Aspect -@Component -public class SmartOperateLogAspect { - - @Autowired - private LogService logService; - - @Pointcut("execution(* net.lab1024.smartadmin.module..*Controller.*(..)))") - public void logPointCut() { - } - - @AfterReturning(pointcut = "logPointCut()") - public void doAfterReturning(JoinPoint joinPoint) { - handleLog(joinPoint, null); - } - - @AfterThrowing(value = "logPointCut()", throwing = "e") - public void doAfterThrowing(JoinPoint joinPoint, Exception e) { - handleLog(joinPoint, e); - } - - protected void handleLog(final JoinPoint joinPoint, final Exception e) { - try { - HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); - OperateLog operateLog = this.getAnnotationLog(joinPoint); - if (operateLog == null) { - return; - } - RequestTokenBO requestToken = SmartRequestTokenUtil.getRequestUser(); - if (requestToken == null) { - return; - } - // 设置方法名称 - String className = joinPoint.getTarget().getClass().getName(); - String methodName = joinPoint.getSignature().getName(); - String operateMethod = className + "." + methodName; - Object[] args = joinPoint.getArgs(); - StringBuilder sb = new StringBuilder(); - for (Object obj : args) { - sb.append(obj.getClass().getSimpleName()); - sb.append("["); - sb.append(JSON.toJSONString(obj)); - sb.append("]"); - } - String params = sb.toString(); - String failReason = null; - Integer result = JudgeEnum.YES.getValue(); - if (e != null) { - result = JudgeEnum.NO.getValue(); - StringWriter sw = new StringWriter(); - PrintWriter pw = new PrintWriter(sw, true); - e.printStackTrace(pw); - failReason = sw.toString(); - pw.flush(); - pw.close(); - sw.flush(); - sw.close(); - } - UserOperateLogEntity operateLogEntity = - UserOperateLogEntity.builder().userId(requestToken.getRequestUserId()).userName(requestToken.getEmployeeBO().getActualName()).url(request.getRequestURI()).method(operateMethod).param(params).failReason(failReason).result(result).build(); - ApiOperation apiOperation = this.getApiOperation(joinPoint); - if (apiOperation != null) { - operateLogEntity.setContent(apiOperation.value()); - } - Api api = this.getApi(joinPoint); - if (api != null) { - String[] tags = api.tags(); - operateLogEntity.setModule(SmartStringUtil.join(tags, ",")); - } - logService.addLog(operateLogEntity); - } catch (Exception exp) { - log.error("保存操作日志异常:{}", exp.getMessage()); - exp.printStackTrace(); - } - } - - private OperateLog getAnnotationLog(JoinPoint joinPoint) throws Exception { - Signature signature = joinPoint.getSignature(); - MethodSignature methodSignature = (MethodSignature) signature; - Method method = methodSignature.getMethod(); - OperateLog classAnnotation = AnnotationUtils.findAnnotation(method.getDeclaringClass(), OperateLog.class); - - if (method != null) { - return classAnnotation; - } - return null; - } - - /** - * swagger API - * - * @param joinPoint - * @return - * @throws Exception - */ - private Api getApi(JoinPoint joinPoint) { - Signature signature = joinPoint.getSignature(); - MethodSignature methodSignature = (MethodSignature) signature; - Method method = methodSignature.getMethod(); - Api classAnnotation = AnnotationUtils.findAnnotation(method.getDeclaringClass(), Api.class); - - if (method != null) { - return classAnnotation; - } - return null; - } - - /** - * swagger ApiOperation - * - * @param joinPoint - * @return - * @throws Exception - */ - private ApiOperation getApiOperation(JoinPoint joinPoint) { - Signature signature = joinPoint.getSignature(); - MethodSignature methodSignature = (MethodSignature) signature; - Method method = methodSignature.getMethod(); - - if (method != null) { - return method.getAnnotation(ApiOperation.class); - } - return null; - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/interceptor/SmartAuthenticationInterceptor.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/interceptor/SmartAuthenticationInterceptor.java deleted file mode 100644 index 30f299f9..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/interceptor/SmartAuthenticationInterceptor.java +++ /dev/null @@ -1,158 +0,0 @@ -package net.lab1024.smartadmin.interceptor; - -import com.alibaba.fastjson.JSONObject; -import net.lab1024.smartadmin.common.anno.NoNeedLogin; -import net.lab1024.smartadmin.common.anno.NoValidPrivilege; -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.constant.CommonConst; -import net.lab1024.smartadmin.module.system.login.LoginResponseCodeConst; -import net.lab1024.smartadmin.module.system.login.LoginTokenService; -import net.lab1024.smartadmin.module.system.login.domain.RequestTokenBO; -import net.lab1024.smartadmin.module.system.privilege.service.PrivilegeEmployeeService; -import net.lab1024.smartadmin.util.SmartRequestTokenUtil; -import net.lab1024.smartadmin.util.SmartStringUtil; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Component; -import org.springframework.web.method.HandlerMethod; -import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.lang.reflect.Method; -import java.util.List; - -/** - * [ 登录拦截器 ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - * @since JDK1.8 - */ -@Component -public class SmartAuthenticationInterceptor extends HandlerInterceptorAdapter { - - public static final String TOKEN_NAME = "x-access-token"; - - @Value("${access-control-allow-origin}") - private String accessControlAllowOrigin; - - @Autowired - private LoginTokenService loginTokenService; - - @Autowired - private PrivilegeEmployeeService privilegeEmployeeService; - - /** - * 拦截服务器端响应处理ajax请求返回结果 - * - * @param request - * @param response - * @param handler - * @return - * @throws Exception - */ - @Override - public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { - //跨域设置 - this.crossDomainConfig(response); - boolean isHandlerMethod = handler instanceof HandlerMethod; - if (! isHandlerMethod) { - return true; - } - - //不需要登录的注解 - Boolean isNoNeedLogin = ((HandlerMethod) handler).getMethodAnnotation(NoNeedLogin.class) != null; - if (isNoNeedLogin) { - return true; - } - - //放行的Uri前缀 - String uri = request.getRequestURI(); - String contextPath = request.getContextPath(); - String target = uri.replaceFirst(contextPath, ""); - if (CommonConst.CommonCollection.contain(CommonConst.CommonCollection.IGNORE_URL, target)) { - return true; - } - - //需要做token校验, 消息头的token优先于请求query参数的token - String xHeaderToken = request.getHeader(TOKEN_NAME); - String xRequestToken = request.getParameter(TOKEN_NAME); - String xAccessToken = null != xHeaderToken ? xHeaderToken : xRequestToken; - if (null == xAccessToken) { - this.outputResult(response, LoginResponseCodeConst.LOGIN_ERROR); - return false; - } - - //根据token获取登录用户 - RequestTokenBO requestToken = loginTokenService.getEmployeeTokenInfo(xAccessToken); - if (null == requestToken) { - this.outputResult(response, LoginResponseCodeConst.LOGIN_ERROR); - return false; - } - - //判断接口权限 - String methodName = ((HandlerMethod) handler).getMethod().getName(); - String className = ((HandlerMethod) handler).getBeanType().getName(); - List list = SmartStringUtil.splitConvertToList(className, "\\."); - String controllerName = list.get(list.size() - 1); - Method m = ((HandlerMethod) handler).getMethod(); - Class cls = ((HandlerMethod) handler).getBeanType(); - boolean isClzAnnotation = cls.isAnnotationPresent(NoValidPrivilege.class); - boolean isMethodAnnotation = m.isAnnotationPresent(NoValidPrivilege.class); - NoValidPrivilege noValidPrivilege = null; - if (isClzAnnotation) { - noValidPrivilege = cls.getAnnotation(NoValidPrivilege.class); - } else if (isMethodAnnotation) { - noValidPrivilege = m.getAnnotation(NoValidPrivilege.class); - } - //不需验证权限 - if (noValidPrivilege != null) { - SmartRequestTokenUtil.setUser(request, requestToken); - return true; - } - //需要验证权限 - Boolean privilegeValidPass = privilegeEmployeeService.checkEmployeeHavePrivilege(requestToken, controllerName, methodName); - if (! privilegeValidPass) { - this.outputResult(response, LoginResponseCodeConst.NOT_HAVE_PRIVILEGES); - return false; - } - SmartRequestTokenUtil.setUser(request, requestToken); - return true; - } - - /** - * 配置跨域 - * - * @param response - */ - private void crossDomainConfig(HttpServletResponse response) { - response.setHeader("Access-Control-Allow-Origin", accessControlAllowOrigin); - response.setHeader("Access-Control-Allow-Credentials", "true"); - response.setHeader("Access-Control-Allow-Methods", "POST, GET, PUT, OPTIONS, DELETE, PATCH"); - response.setHeader("Access-Control-Expose-Headers", "*"); - response.setHeader("Access-Control-Allow-Headers", "Authentication,Origin, X-Requested-With, Content-Type, " + "Accept, x-access-token"); - response.setHeader("Cache-Control", "no-cache"); - response.setHeader("Pragma", "no-cache"); - response.setHeader("Expires ", "-1"); - } - - /** - * 错误输出 - * - * @param response - * @param responseCodeConst - * @throws IOException - */ - private void outputResult(HttpServletResponse response, LoginResponseCodeConst responseCodeConst) throws IOException { - ResponseDTO wrap = ResponseDTO.wrap(responseCodeConst); - String msg = JSONObject.toJSONString(wrap); - response.setContentType("application/json;charset=UTF-8"); - response.getWriter().write(msg); - response.flushBuffer(); - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/listener/SmartAdminStartupRunner.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/listener/SmartAdminStartupRunner.java deleted file mode 100644 index 9205fa5b..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/listener/SmartAdminStartupRunner.java +++ /dev/null @@ -1,22 +0,0 @@ -package net.lab1024.smartadmin.listener; - -import net.lab1024.smartadmin.common.constant.ResponseCodeConst; -import org.springframework.boot.CommandLineRunner; -import org.springframework.stereotype.Component; - -/** - * 应用启动以后检测code码 - * - * @author zhuo - * @version 1.0 - * @since JDK1.8 - */ - -@Component -public class SmartAdminStartupRunner implements CommandLineRunner { - - @Override - public void run(String... args) { - ResponseCodeConst.init(); - } -} \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/email/EmailController.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/email/EmailController.java deleted file mode 100644 index b7e350bd..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/email/EmailController.java +++ /dev/null @@ -1,81 +0,0 @@ -package net.lab1024.smartadmin.module.business.email; - -import net.lab1024.smartadmin.common.anno.NoValidPrivilege; -import net.lab1024.smartadmin.common.anno.OperateLog; -import net.lab1024.smartadmin.common.domain.PageResultDTO; -import net.lab1024.smartadmin.constant.SwaggerTagConst; -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.module.business.email.domain.dto.EmailDTO; -import net.lab1024.smartadmin.module.business.email.domain.dto.EmailQueryDTO; -import net.lab1024.smartadmin.module.business.email.domain.dto.EmailVO; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import javax.validation.Valid; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date 2019-05-13 17:10:16 - * @since JDK1.8 - */ -@RestController -@OperateLog -@Api(tags = {SwaggerTagConst.Admin.MANAGER_EMAIL}) -public class EmailController { - - @Autowired - private EmailService emailService; - - @ApiOperation(value = "分页查询",notes = "@author yandanyang") - @PostMapping("/email/page/query") - @NoValidPrivilege - public ResponseDTO> queryByPage(@RequestBody @Validated EmailQueryDTO queryDTO) { - return emailService.queryByPage(queryDTO); - } - - @ApiOperation(value = "添加",notes = "@author yandanyang") - @PostMapping("/email/add") - @NoValidPrivilege - public ResponseDTO add(@RequestBody @Valid EmailDTO addTO){ - return emailService.add(addTO); - } - - @ApiOperation(value="修改",notes = "@author yandanyang") - @PostMapping("/email/update") - @NoValidPrivilege - public ResponseDTO update(@RequestBody @Valid EmailDTO updateDTO){ - return emailService.update(updateDTO); - } - - - @ApiOperation(value="删除",notes = "@author yandanyang") - @GetMapping("/email/delete/{id}") - @NoValidPrivilege - public ResponseDTO delete(@PathVariable("id") Long id){ - return emailService.delete(id); - } - - - @ApiOperation(value="详情",notes = "@author yandanyang") - @GetMapping("/email/detail/{id}") - @NoValidPrivilege - public ResponseDTO detail(@PathVariable("id") Long id){ - return emailService.detail(id); - } - - - @ApiOperation(value="发送",notes = "@author yandanyang") - @GetMapping("/email/send/{id}") - @NoValidPrivilege - public ResponseDTO send(@PathVariable("id") Long id){ - return emailService.send(id); - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/email/EmailDao.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/email/EmailDao.java deleted file mode 100644 index 76a7dea5..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/email/EmailDao.java +++ /dev/null @@ -1,47 +0,0 @@ -package net.lab1024.smartadmin.module.business.email; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import net.lab1024.smartadmin.module.business.email.domain.dto.EmailQueryDTO; -import net.lab1024.smartadmin.module.business.email.domain.entity.EmailEntity; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Component; - -import java.util.List; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019-05-13 17:10:16 - * @since JDK1.8 - */ -@Mapper -@Component -public interface EmailDao extends BaseMapper { - - /** - * 分页查询 - * @param queryDTO - * @return EmailEntity - */ - List queryByPage(Page page, @Param("queryDTO") EmailQueryDTO queryDTO); - - /** - * 根据id删除 - * @param id - * @return - */ - void deleteById(@Param("id") Long id); - - /** - * 批量删除 - * @param idList - * @return - */ - void deleteByIds(@Param("idList") List idList); -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/email/EmailSendStatusEnum.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/email/EmailSendStatusEnum.java deleted file mode 100644 index a6cf0c44..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/email/EmailSendStatusEnum.java +++ /dev/null @@ -1,37 +0,0 @@ -package net.lab1024.smartadmin.module.business.email; - - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/4/28 0028 下午 15:37 - * @since JDK1.8 - */ -public enum EmailSendStatusEnum { - - NOT_SEND(0,"未发送"), - - SEND(1,"已发送"); - - private Integer type; - private String desc; - - EmailSendStatusEnum(Integer type, String desc) { - this.type = type; - this.desc = desc; - } - - public Integer getType() { - return type; - } - - public String getDesc() { - return desc; - } - - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/email/EmailService.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/email/EmailService.java deleted file mode 100644 index 6b7e5b7d..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/email/EmailService.java +++ /dev/null @@ -1,122 +0,0 @@ -package net.lab1024.smartadmin.module.business.email; - -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import net.lab1024.smartadmin.common.constant.ResponseCodeConst; -import net.lab1024.smartadmin.common.domain.PageResultDTO; -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.module.business.email.domain.dto.EmailConfigDTO; -import net.lab1024.smartadmin.module.business.email.domain.dto.EmailDTO; -import net.lab1024.smartadmin.module.business.email.domain.dto.EmailQueryDTO; -import net.lab1024.smartadmin.module.business.email.domain.dto.EmailVO; -import net.lab1024.smartadmin.module.business.email.domain.entity.EmailEntity; -import net.lab1024.smartadmin.module.system.systemconfig.SystemConfigService; -import net.lab1024.smartadmin.module.system.systemconfig.constant.SystemConfigEnum; -import net.lab1024.smartadmin.util.SmartBeanUtil; -import net.lab1024.smartadmin.util.SmartPageUtil; -import net.lab1024.smartadmin.util.SmartSendMailUtil; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.List; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date 2019-05-13 17:10:16 - * @since JDK1.8 - */ -@Service -public class EmailService { - - @Autowired - private EmailDao emailDao; - - @Autowired - private SystemConfigService systemConfigService; - - /** - * @author yandanyang - * @description 分页查询 - * @date 2019-05-13 17:10:16 - */ - public ResponseDTO> queryByPage(EmailQueryDTO queryDTO) { - Page page = SmartPageUtil.convert2QueryPage(queryDTO); - List entities = emailDao.queryByPage(page, queryDTO); - List dtoList = SmartBeanUtil.copyList(entities, EmailVO.class); - page.setRecords(dtoList); - PageResultDTO pageResultDTO = SmartPageUtil.convert2PageResult(page); - return ResponseDTO.succData(pageResultDTO); - } - - /** - * @author yandanyang - * @description 添加 - * @date 2019-05-13 17:10:16 - */ - public ResponseDTO add(EmailDTO addDTO) { - EmailEntity entity = SmartBeanUtil.copy(addDTO, EmailEntity.class); - emailDao.insert(entity); - return ResponseDTO.succData(entity.getId()); - } - - /** - * @author yandanyang - * @description 编辑 - * @date 2019-05-13 17:10:16 - */ - @Transactional(rollbackFor = Exception.class) - public ResponseDTO update(EmailDTO updateDTO) { - EmailEntity entity = SmartBeanUtil.copy(updateDTO, EmailEntity.class); - emailDao.updateById(entity); - return ResponseDTO.succData(entity.getId()); - } - - /** - * @author yandanyang - * @description 删除 - * @date 2019-05-13 17:10:16 - */ - @Transactional(rollbackFor = Exception.class) - public ResponseDTO delete(Long id) { - emailDao.deleteById(id); - return ResponseDTO.succ(); - } - - /** - * @author yandanyang - * @description 根据ID查询 - * @date 2019-05-13 17:10:16 - */ - public ResponseDTO detail(Long id) { - EmailEntity entity = emailDao.selectById(id); - EmailVO dto = SmartBeanUtil.copy(entity, EmailVO.class); - return ResponseDTO.succData(dto); - } - - /** - * 发送某个已创建的邮件 - * - * @param id - * @return - */ - public ResponseDTO send(Long id) { - EmailEntity entity = emailDao.selectById(id); - EmailConfigDTO emailConfig = systemConfigService.selectByKey2Obj(SystemConfigEnum.Key.EMAIL_CONFIG.name(), EmailConfigDTO.class); - String toEmails = entity.getToEmails(); - if (StringUtils.isEmpty(toEmails)) { - return ResponseDTO.wrap(ResponseCodeConst.ERROR_PARAM, "收件人信息为空"); - } - String[] emails = toEmails.split(";"); - SmartSendMailUtil.sendMail(emailConfig.getUsername(), emailConfig.getPassword(), emailConfig.getUsername(), emails, "", emailConfig.getSmtpHost(), entity.getTitle(), entity.getContent()); - entity.setSendStatus(EmailSendStatusEnum.SEND.getType()); - emailDao.updateById(entity); - return ResponseDTO.succ(); - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/email/domain/dto/EmailConfigDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/email/domain/dto/EmailConfigDTO.java deleted file mode 100644 index 87f0e413..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/email/domain/dto/EmailConfigDTO.java +++ /dev/null @@ -1,30 +0,0 @@ -package net.lab1024.smartadmin.module.business.email.domain.dto; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/5/13 0013 下午 16:52 - * @since JDK1.8 - */ -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public class EmailConfigDTO { - - private String smtpHost; - - private String username; - - private String password; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/email/domain/dto/EmailDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/email/domain/dto/EmailDTO.java deleted file mode 100644 index 8300a3f5..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/email/domain/dto/EmailDTO.java +++ /dev/null @@ -1,44 +0,0 @@ -package net.lab1024.smartadmin.module.business.email.domain.dto; -import lombok.Data; -import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModelProperty; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/3/27 0027 下午 12:27 - * @since JDK1.8 - */ -@Data -public class EmailDTO { - - @ApiModelProperty("主键") - private Long id; - - @ApiModelProperty("标题") - private String title; - - @ApiModelProperty("收件人") - private String toEmails; - - @ApiModelProperty("发送状态 0未发送 1已发送") - private Integer sendStatus; - - @ApiModelProperty("邮件内容") - private String content; - - @ApiModelProperty("创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private Date createTime; - - @ApiModelProperty("更新时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private Date updateTime; - - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/email/domain/dto/EmailQueryDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/email/domain/dto/EmailQueryDTO.java deleted file mode 100644 index 6768dc4f..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/email/domain/dto/EmailQueryDTO.java +++ /dev/null @@ -1,35 +0,0 @@ -package net.lab1024.smartadmin.module.business.email.domain.dto; - -import net.lab1024.smartadmin.common.domain.PageParamDTO; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date 2019-05-13 17:10:16 - * @since JDK1.8 - */ -@Data -public class EmailQueryDTO extends PageParamDTO { - - - @ApiModelProperty("开始日期") - private String startDate; - - @ApiModelProperty("结束日期") - private String endDate; - - - @ApiModelProperty("标题") - private String title; - - - @ApiModelProperty("发送状态 0未发送 1已发送") - private Integer sendStatus; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/email/domain/dto/EmailVO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/email/domain/dto/EmailVO.java deleted file mode 100644 index 4686efad..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/email/domain/dto/EmailVO.java +++ /dev/null @@ -1,45 +0,0 @@ -package net.lab1024.smartadmin.module.business.email.domain.dto; - -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.Date; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/3/27 0027 下午 12:27 - * @since JDK1.8 - */ -@Data -public class EmailVO { - - @ApiModelProperty("主键") - private Long id; - - @ApiModelProperty("标题") - private String title; - - @ApiModelProperty("收件人") - private String toEmails; - - @ApiModelProperty("发送状态 0未发送 1已发送") - private Integer sendStatus; - - @ApiModelProperty("邮件内容") - private String content; - - @ApiModelProperty("创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private Date createTime; - - @ApiModelProperty("更新时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private Date updateTime; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/email/domain/entity/EmailEntity.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/email/domain/entity/EmailEntity.java deleted file mode 100644 index d7c0da18..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/email/domain/entity/EmailEntity.java +++ /dev/null @@ -1,40 +0,0 @@ -package net.lab1024.smartadmin.module.business.email.domain.entity; -import com.baomidou.mybatisplus.annotation.TableName; -import net.lab1024.smartadmin.common.domain.BaseEntity; -import lombok.Data; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019-05-13 17:10:16 - * @since JDK1.8 - */ -@Data -@TableName("t_email") -public class EmailEntity extends BaseEntity { - - /** - * 标题 - */ - private String title; - - /** - * 收件人 - */ - private String toEmails; - - /** - * 发送状态 0未发送 1已发送 - */ - private Integer sendStatus; - - /** - * 邮件内容 - */ - private String content; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/LogService.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/LogService.java deleted file mode 100644 index 9aae836c..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/LogService.java +++ /dev/null @@ -1,75 +0,0 @@ -package net.lab1024.smartadmin.module.business.log; - -import net.lab1024.smartadmin.module.business.log.orderoperatelog.OrderOperateLogDao; -import net.lab1024.smartadmin.module.business.log.orderoperatelog.domain.entity.OrderOperateLogEntity; -import net.lab1024.smartadmin.module.business.log.userloginlog.UserLoginLogDao; -import net.lab1024.smartadmin.module.business.log.userloginlog.domain.UserLoginLogEntity; -import net.lab1024.smartadmin.module.business.log.useroperatelog.UserOperateLogDao; -import net.lab1024.smartadmin.module.business.log.useroperatelog.domain.UserOperateLogEntity; -import net.lab1024.smartadmin.util.SmartThreadFactory; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import javax.annotation.PostConstruct; -import javax.annotation.PreDestroy; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/4/4 0004 下午 16:19 - * @since JDK1.8 - */ -@Slf4j -@Service -public class LogService { - - private ThreadPoolExecutor threadPoolExecutor; - - @Autowired - private UserLoginLogDao userLoginLogDao; - - @Autowired - private OrderOperateLogDao orderOperateLogDao; - - @Autowired - private UserOperateLogDao userOperateLogDao; - - @PostConstruct - void init() { - if (threadPoolExecutor == null) { - threadPoolExecutor = new ThreadPoolExecutor(1, 1, 10L, TimeUnit.SECONDS, new LinkedBlockingQueue<>(2000), SmartThreadFactory.create("LogAspect")); - } - } - - @PreDestroy - void destroy() { - if (threadPoolExecutor != null) { - threadPoolExecutor.shutdown(); - threadPoolExecutor = null; - } - } - - public void addLog(Object object) { - try { - if (object instanceof UserLoginLogEntity) { - threadPoolExecutor.execute(() -> userLoginLogDao.insert((UserLoginLogEntity) object)); - } - if (object instanceof OrderOperateLogEntity) { - threadPoolExecutor.execute(() -> orderOperateLogDao.insert((OrderOperateLogEntity) object)); - } - if (object instanceof UserOperateLogEntity) { - threadPoolExecutor.execute(() -> userOperateLogDao.insert((UserOperateLogEntity) object)); - } - } catch (Throwable e) { - log.error("userLogAfterAdvice:{}", e); - } - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/orderoperatelog/OrderOperateLogController.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/orderoperatelog/OrderOperateLogController.java deleted file mode 100644 index 5f84c7ab..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/orderoperatelog/OrderOperateLogController.java +++ /dev/null @@ -1,44 +0,0 @@ -package net.lab1024.smartadmin.module.business.log.orderoperatelog; - -import net.lab1024.smartadmin.common.anno.OperateLog; -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.constant.SwaggerTagConst; -import net.lab1024.smartadmin.module.business.log.orderoperatelog.constant.OrderOperateLogOrderTypeEnum; -import net.lab1024.smartadmin.module.business.log.orderoperatelog.domain.vo.OrderOperateLogVO; -import net.lab1024.smartadmin.util.SmartStringUtil; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RestController; - -import java.util.List; -import java.util.stream.Collectors; - -/** - * 单据操作记录Controller - * - * @author lidoudou - * @date: 2018/1/31 16:56 - */ - -@Api(tags = {SwaggerTagConst.Admin.MANAGER_ORDER_OPERATE_LOG}) -@OperateLog -@RestController -public class OrderOperateLogController { - - @Autowired - private OrderOperateLogService orderOperateLogService; - - @ApiOperation(value = "查询单据操作日志", notes = "查询单据操作日志") - @GetMapping("/orderOperateLog/list/{orderId}") - @ApiImplicitParams({@ApiImplicitParam(name = "orderId", value = "业务id", paramType = "path"), @ApiImplicitParam(name = "orderType", value = "业务类型" + OrderOperateLogOrderTypeEnum.INFO, paramType - = "query")}) - public ResponseDTO> list(@PathVariable Long orderId, String orderType) { - List orderTypeList = SmartStringUtil.splitConverToIntSet(orderType, ",").stream().collect(Collectors.toList()); - return orderOperateLogService.listOrderOperateLogsByOrderTypeAndOrderId(orderId, orderTypeList); - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/orderoperatelog/OrderOperateLogDao.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/orderoperatelog/OrderOperateLogDao.java deleted file mode 100644 index a720f5c5..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/orderoperatelog/OrderOperateLogDao.java +++ /dev/null @@ -1,30 +0,0 @@ -package net.lab1024.smartadmin.module.business.log.orderoperatelog; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import net.lab1024.smartadmin.module.business.log.orderoperatelog.domain.entity.OrderOperateLogEntity; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Component; - -import java.util.List; - -/** - *

- * 各种单据操作记录 - * Mapper 接口 - *

- * - * @author anders - * @since 2018-01-09 - */ -@Mapper -@Component -public interface OrderOperateLogDao extends BaseMapper { - - List listOrderOperateLogsByOrderTypeAndOrderId(@Param("orderId") Long orderId, @Param("orderTypeList") List orderTypeList); - - List listOrderOperateLogsByOrderTypeAndOrderIds(@Param("orderIds") List orderIds, @Param("orderTypeList") List orderTypeList); - - void batchInsert(List list); - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/orderoperatelog/OrderOperateLogService.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/orderoperatelog/OrderOperateLogService.java deleted file mode 100644 index 601b8cef..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/orderoperatelog/OrderOperateLogService.java +++ /dev/null @@ -1,64 +0,0 @@ -package net.lab1024.smartadmin.module.business.log.orderoperatelog; - -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.module.business.log.orderoperatelog.domain.dto.OrderOperateLogSaveDTO; -import net.lab1024.smartadmin.module.business.log.orderoperatelog.domain.entity.OrderOperateLogEntity; -import net.lab1024.smartadmin.module.business.log.orderoperatelog.domain.vo.OrderOperateLogVO; -import net.lab1024.smartadmin.util.SmartBeanUtil; -import net.lab1024.smartadmin.util.SmartStringUtil; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.time.LocalDateTime; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.stream.Collectors; - -/** - *

- * 各种单据操作记录 - * 服务实现类 - *

- * - * @author anders - * @since 2018-01-09 - */ -@Service -public class OrderOperateLogService { - - @Autowired - private OrderOperateLogDao orderOperateLogDao; - - public void batchSaveOrderOperateLog(List orderOperateLogSaveDTOList) { - List entityList = new ArrayList<>(); - orderOperateLogSaveDTOList.forEach(e -> { - OrderOperateLogEntity orderOperateLogEntity = SmartBeanUtil.copy(e, OrderOperateLogEntity.class); - orderOperateLogEntity.setOperateType(e.getOperateType().getCode()); - if (SmartStringUtil.isNotBlank(e.getOperateContent())) { - orderOperateLogEntity.setOperateContent(e.getOperateContent()); - } else { - orderOperateLogEntity.setOperateContent(e.getOperateType().getMsg()); - } - orderOperateLogEntity.setOperateRemark(e.getOperateRemark()); - orderOperateLogEntity.setExtData(e.getExtData()); - orderOperateLogEntity.setCreateTime(new Date()); - orderOperateLogEntity.setOrderType(e.getOrderType().getType()); - entityList.add(orderOperateLogEntity); - }); - //批量添加 - orderOperateLogDao.batchInsert(entityList); - } - - public ResponseDTO> listOrderOperateLogsByOrderTypeAndOrderId(Long orderId, List orderTypeList) { - List orderOperateLogEntities = orderOperateLogDao.listOrderOperateLogsByOrderTypeAndOrderId(orderId, orderTypeList); - List dtoList = orderOperateLogEntities.stream().map(e -> SmartBeanUtil.copy(e, OrderOperateLogVO.class)).collect(Collectors.toList()); - return ResponseDTO.succData(dtoList); - } - - public ResponseDTO> listOrderOperateLogsByOrderTypeAndOrderIds(List orderIds, List orderTypeList) { - List orderOperateLogEntities = orderOperateLogDao.listOrderOperateLogsByOrderTypeAndOrderIds(orderIds, orderTypeList); - List dtoList = orderOperateLogEntities.stream().map(e -> SmartBeanUtil.copy(e, OrderOperateLogVO.class)).collect(Collectors.toList()); - return ResponseDTO.succData(dtoList); - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/orderoperatelog/constant/OrderOperateLogDefaultEmpEnum.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/orderoperatelog/constant/OrderOperateLogDefaultEmpEnum.java deleted file mode 100644 index c088322d..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/orderoperatelog/constant/OrderOperateLogDefaultEmpEnum.java +++ /dev/null @@ -1,37 +0,0 @@ -package net.lab1024.smartadmin.module.business.log.orderoperatelog.constant; - -/** - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - * @since JDK1.8 - */ -public enum OrderOperateLogDefaultEmpEnum { - - DEFAULT_EMP(0,"系统"); - - - private Integer empId; - - private String empName; - - OrderOperateLogDefaultEmpEnum(Integer empId,String empName) { - this.empId = empId; - this.empName = empName; - } - - public int getEmpId() { - return empId; - } - - public String getEmpName() { - return empName; - } - - - -} - diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/orderoperatelog/constant/OrderOperateLogOperateTypeConst.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/orderoperatelog/constant/OrderOperateLogOperateTypeConst.java deleted file mode 100644 index d5d14b63..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/orderoperatelog/constant/OrderOperateLogOperateTypeConst.java +++ /dev/null @@ -1,30 +0,0 @@ -package net.lab1024.smartadmin.module.business.log.orderoperatelog.constant; - -import net.lab1024.smartadmin.common.constant.ResponseCodeConst; - -/** - * [ 8001 -8999 ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - * @since JDK1.8 - */ -public class OrderOperateLogOperateTypeConst extends ResponseCodeConst { - - - public static final OrderOperateLogOperateTypeConst ADD = new OrderOperateLogOperateTypeConst(8001, "创建并提交"); - - public static final OrderOperateLogOperateTypeConst UPDATE = new OrderOperateLogOperateTypeConst(8002, "修改并提交"); - - public static final OrderOperateLogOperateTypeConst DELETE = new OrderOperateLogOperateTypeConst(8003, "删除"); - - - private OrderOperateLogOperateTypeConst(int code, String msg) { - super(code, msg); - } - - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/orderoperatelog/constant/OrderOperateLogOrderTypeEnum.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/orderoperatelog/constant/OrderOperateLogOrderTypeEnum.java deleted file mode 100644 index 9674836e..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/orderoperatelog/constant/OrderOperateLogOrderTypeEnum.java +++ /dev/null @@ -1,51 +0,0 @@ -package net.lab1024.smartadmin.module.business.log.orderoperatelog.constant; - -import java.util.Arrays; -import java.util.Optional; - -/** - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - * @since JDK1.8 - */ -public enum OrderOperateLogOrderTypeEnum { - - EXAMPLE(1, "样例"); - - - public static final String INFO = ""; - - private int type; - - private String typeName; - - OrderOperateLogOrderTypeEnum(int type, String typeName) { - this.type = type; - this.typeName = typeName; - } - - public int getType() { - return type; - } - - public String getTypeName() { - return typeName; - } - - public static OrderOperateLogOrderTypeEnum getValueByName(String name) { - OrderOperateLogOrderTypeEnum[] values = OrderOperateLogOrderTypeEnum.values(); - Optional first = Arrays.stream(values).filter(e -> e.getTypeName().equals(name)).findFirst(); - if (!first.isPresent()) { - return null; - } - if (!first.isPresent()) { - return null; - } - OrderOperateLogOrderTypeEnum orderType = first.get(); - return orderType; - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/orderoperatelog/domain/dto/OrderOperateLogSaveDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/orderoperatelog/domain/dto/OrderOperateLogSaveDTO.java deleted file mode 100644 index a9861bdc..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/orderoperatelog/domain/dto/OrderOperateLogSaveDTO.java +++ /dev/null @@ -1,80 +0,0 @@ -package net.lab1024.smartadmin.module.business.log.orderoperatelog.domain.dto; - - -import net.lab1024.smartadmin.module.business.log.orderoperatelog.constant.OrderOperateLogOperateTypeConst; -import net.lab1024.smartadmin.module.business.log.orderoperatelog.constant.OrderOperateLogOrderTypeEnum; -import lombok.Data; - -/** - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - * @since JDK1.8 - */ -@Data -public class OrderOperateLogSaveDTO { - - /** - * 各种单据的id - */ - private Long orderId; - - /** - * 单据类型 - */ - private OrderOperateLogOrderTypeEnum orderType; - - /** - * 操作类型 - */ - private OrderOperateLogOperateTypeConst operateType; - - /** - *操作类型 对应的中文 - */ - private String operateContent; - - /** - * 操作备注 - */ - private String operateRemark; - - /** - * 员工id - */ - private Long employeeId; - - /** - * 员工名称 - */ - private String employeeName; - - /** - * 额外信息 - */ - private String extData; - - public OrderOperateLogSaveDTO() { - } - - public OrderOperateLogSaveDTO(Long orderId, OrderOperateLogOrderTypeEnum orderType, OrderOperateLogOperateTypeConst operateType, String - operateRemark, Long employeeId, String employeeName, String extData) { - this.orderId = orderId; - this.orderType = orderType; - this.operateType = operateType; - this.operateRemark = operateRemark; - this.employeeId = employeeId; - this.employeeName = employeeName; - this.extData = extData; - } - - @Override - public String toString() { - return "OrderOperateLogSaveDTO{" + "orderId=" + orderId + ", orderType=" + orderType + ", operateType=" + operateType + ", operateRemark='" - + operateRemark + '\'' + ", employeeId=" + employeeId + ", employeeName='" + employeeName + '\'' + ", extData='" + extData + '\'' + '}'; - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/orderoperatelog/domain/dto/SupplierOrderOperateVO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/orderoperatelog/domain/dto/SupplierOrderOperateVO.java deleted file mode 100644 index 9633527f..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/orderoperatelog/domain/dto/SupplierOrderOperateVO.java +++ /dev/null @@ -1,44 +0,0 @@ -package net.lab1024.smartadmin.module.business.log.orderoperatelog.domain.dto; - -import lombok.Data; - -import java.math.BigDecimal; -import java.util.Date; - -/** - * 预存款申请/提取单流水临时文件 - * @author zzr - */ -@Data -public class SupplierOrderOperateVO { - - /** - * 流水类型 - */ - private Integer tradingType; - - /** - * 总重 - */ - private BigDecimal totalWeight; - - /** - * 金额 - */ - private BigDecimal amount; - - /** - * 操作人名称 - */ - private String buyerName; - - /** - * 备注 - */ - private String remark; - - /** - * 创建时间 - */ - private Date createTime; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/orderoperatelog/domain/entity/OrderOperateLogEntity.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/orderoperatelog/domain/entity/OrderOperateLogEntity.java deleted file mode 100644 index 8f61f3ec..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/orderoperatelog/domain/entity/OrderOperateLogEntity.java +++ /dev/null @@ -1,58 +0,0 @@ -package net.lab1024.smartadmin.module.business.log.orderoperatelog.domain.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import net.lab1024.smartadmin.common.domain.BaseEntity; -import lombok.Builder; -import lombok.Data; - -/** - *

- * 各种单据操作记录 - * - *

- * - * @author anders - * @since 2018-01-09 - */ - -@Data -@Builder -@TableName("t_order_operate_log") -public class OrderOperateLogEntity extends BaseEntity { - - /** - * 各种单据的id - */ - private Long orderId; - /** - * 单据类型 - */ - private Integer orderType; - /** - * 操作类型 - */ - private Integer operateType; - /** - * 操作类型 对应的中文 - */ - private String operateContent; - /** - * 操作备注 - */ - private String operateRemark; - /** - * 员工id - */ - private Long employeeId; - /** - * 员工名称 - */ - private String employeeName; - /** - * 额外信息 - */ - private String extData; - - - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/orderoperatelog/domain/vo/OrderOperateLogVO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/orderoperatelog/domain/vo/OrderOperateLogVO.java deleted file mode 100644 index ab565691..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/orderoperatelog/domain/vo/OrderOperateLogVO.java +++ /dev/null @@ -1,69 +0,0 @@ -package net.lab1024.smartadmin.module.business.log.orderoperatelog.domain.vo; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.Date; - -/** - * @author bhr - * @Description: 操作日志 - * @date 2019/8/28 9:31 - */ -@Data -public class OrderOperateLogVO { - - private Long id; - /** - * 各种单据的id - */ - @ApiModelProperty("各种单据的id") - private Long orderId; - /** - * 单据类型 - */ - @ApiModelProperty("单据类型") - private Integer orderType; - /** - * 操作类型 - */ - @ApiModelProperty("操作类型") - private Integer operateType; - /** - * 操作类型 对应的中文 - */ - @ApiModelProperty("操作类型 对应的中文") - private String operateContent; - /** - * 操作备注 - */ - @ApiModelProperty("操作备注") - private String operateRemark; - @ApiModelProperty("操作备注,包含审批人名使用别名显示") - private String operateSecondRemark; - /** - * 员工id - */ - @ApiModelProperty("员工id") - private Long employeeId; - /** - * 员工名称 - */ - @ApiModelProperty("员工名称") - private String employeeName; - /** - * 员工名称 - */ - @ApiModelProperty("员工别名") - private String employeeSecondName; - /** - * 额外信息 - */ - @ApiModelProperty("额外信息") - private String extData; - /** - * 创建时间 - */ - @ApiModelProperty("创建时间") - private Date createTime; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/userloginlog/UserLoginLogController.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/userloginlog/UserLoginLogController.java deleted file mode 100644 index eccf2e69..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/userloginlog/UserLoginLogController.java +++ /dev/null @@ -1,54 +0,0 @@ -package net.lab1024.smartadmin.module.business.log.userloginlog; - -import net.lab1024.smartadmin.common.anno.OperateLog; -import net.lab1024.smartadmin.common.domain.PageResultDTO; -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.constant.SwaggerTagConst; -import net.lab1024.smartadmin.module.system.employee.domain.dto.EmployeeQueryDTO; -import net.lab1024.smartadmin.module.system.employee.domain.vo.EmployeeVO; -import net.lab1024.smartadmin.module.business.log.userloginlog.domain.UserLoginLogDTO; -import net.lab1024.smartadmin.module.business.log.userloginlog.domain.UserLoginLogQueryDTO; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.validation.Valid; - -/** - * [ 用户登录日志 ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date 2019-05-15 10:25:21 - * @since JDK1.8 - */ -@RestController -@Api(tags = {SwaggerTagConst.Admin.MANAGER_USER_LOGIN_LOG}) -@OperateLog -public class UserLoginLogController { - - @Autowired - private UserLoginLogService userLoginLogService; - - @ApiOperation(value = "分页查询用户登录日志", notes = "@author yandanyang") - @PostMapping("/userLoginLog/page/query") - public ResponseDTO> queryByPage(@RequestBody UserLoginLogQueryDTO queryDTO) { - return userLoginLogService.queryByPage(queryDTO); - } - - @ApiOperation(value = "删除用户登录日志", notes = "@author yandanyang") - @GetMapping("/userLoginLog/delete/{id}") - public ResponseDTO delete(@PathVariable("id") Long id) { - return userLoginLogService.delete(id); - } - - @ApiOperation(value = "查询员工在线状态", notes = "@author zzr") - @PostMapping("/userOnLine/query") - public ResponseDTO> queryUserOnLine(@RequestBody @Valid EmployeeQueryDTO queryDTO) { - return userLoginLogService.queryUserOnLine(queryDTO); - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/userloginlog/UserLoginLogDao.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/userloginlog/UserLoginLogDao.java deleted file mode 100644 index ab585690..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/userloginlog/UserLoginLogDao.java +++ /dev/null @@ -1,47 +0,0 @@ -package net.lab1024.smartadmin.module.business.log.userloginlog; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import net.lab1024.smartadmin.module.business.log.userloginlog.domain.UserLoginLogQueryDTO; -import net.lab1024.smartadmin.module.business.log.userloginlog.domain.UserLoginLogEntity; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Component; - -import java.util.List; - -/** - * [ 用户登录日志 ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019-05-15 10:25:21 - * @since JDK1.8 - */ -@Mapper -@Component -public interface UserLoginLogDao extends BaseMapper { - - /** - * 分页查询 - * @param queryDTO - * @return UserLoginLogEntity - */ - List queryByPage(Page page, @Param("queryDTO") UserLoginLogQueryDTO queryDTO); - - /** - * 根据id删除 - * @param id - * @return - */ - void deleteById(@Param("id") Long id); - - /** - * 批量删除 - * @param idList - * @return - */ - void deleteByIds(@Param("idList") List idList); -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/userloginlog/UserLoginLogService.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/userloginlog/UserLoginLogService.java deleted file mode 100644 index 0d096fe3..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/userloginlog/UserLoginLogService.java +++ /dev/null @@ -1,82 +0,0 @@ -package net.lab1024.smartadmin.module.business.log.userloginlog; - -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import net.lab1024.smartadmin.common.domain.PageResultDTO; -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.module.system.employee.EmployeeService; -import net.lab1024.smartadmin.module.system.employee.domain.dto.EmployeeQueryDTO; -import net.lab1024.smartadmin.module.system.employee.domain.vo.EmployeeVO; -import net.lab1024.smartadmin.module.business.log.userloginlog.domain.UserLoginLogDTO; -import net.lab1024.smartadmin.module.business.log.userloginlog.domain.UserLoginLogEntity; -import net.lab1024.smartadmin.module.business.log.userloginlog.domain.UserLoginLogQueryDTO; -import net.lab1024.smartadmin.module.support.websocket.WebSocketServer; -import net.lab1024.smartadmin.util.SmartBeanUtil; -import net.lab1024.smartadmin.util.SmartPageUtil; -import org.apache.commons.collections.CollectionUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.List; - -/** - * [ 用户登录日志 ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date 2019-05-15 10:25:21 - * @since JDK1.8 - */ -@Service -public class UserLoginLogService { - - @Autowired - private UserLoginLogDao userLoginLogDao; - - @Autowired - private EmployeeService employeeService; - - /** - * @author yandanyang - * @description 分页查询 - * @date 2019-05-15 10:25:21 - */ - public ResponseDTO> queryByPage(UserLoginLogQueryDTO queryDTO) { - Page page = SmartPageUtil.convert2QueryPage(queryDTO); - List entities = userLoginLogDao.queryByPage(page, queryDTO); - List dtoList = SmartBeanUtil.copyList(entities, UserLoginLogDTO.class); - page.setRecords(dtoList); - PageResultDTO pageResultDTO = SmartPageUtil.convert2PageResult(page); - return ResponseDTO.succData(pageResultDTO); - } - - /** - * @author yandanyang - * @description 删除 - * @date 2019-05-15 10:25:21 - */ - @Transactional(rollbackFor = Exception.class) - public ResponseDTO delete(Long id) { - userLoginLogDao.deleteById(id); - return ResponseDTO.succ(); - } - - /** - * 查询员工在线状态 - * - * @param queryDTO - * @return - */ - public ResponseDTO> queryUserOnLine(EmployeeQueryDTO queryDTO) { - List onLineUserList = WebSocketServer.getOnLineUserList(); - if (CollectionUtils.isEmpty(onLineUserList)) { - return ResponseDTO.succ(); - } - queryDTO.setEmployeeIds(onLineUserList); - ResponseDTO> employeeList = employeeService.selectEmployeeList(queryDTO); - return employeeList; - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/userloginlog/domain/UserLoginLogDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/userloginlog/domain/UserLoginLogDTO.java deleted file mode 100644 index efeb14de..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/userloginlog/domain/UserLoginLogDTO.java +++ /dev/null @@ -1,53 +0,0 @@ -package net.lab1024.smartadmin.module.business.log.userloginlog.domain; -import lombok.Data; -import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModelProperty; - -/** - * [ 用户登录日志 ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/3/27 0027 下午 12:27 - * @since JDK1.8 - */ -@Data -public class UserLoginLogDTO { - - @ApiModelProperty("主键") - private Long id; - - @ApiModelProperty("员工id") - private Long userId; - - @ApiModelProperty("用户名") - private String userName; - - @ApiModelProperty("用户ip") - private String remoteIp; - - @ApiModelProperty("用户端口") - private Integer remotePort; - - @ApiModelProperty("浏览器") - private String remoteBrowser; - - @ApiModelProperty("操作系统") - private String remoteOs; - - @ApiModelProperty("登录状态") - private Integer loginStatus; - - @ApiModelProperty("更新时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private Date updateTime; - - @ApiModelProperty("创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private Date createTime; - - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/userloginlog/domain/UserLoginLogEntity.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/userloginlog/domain/UserLoginLogEntity.java deleted file mode 100644 index b0d02ac9..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/userloginlog/domain/UserLoginLogEntity.java +++ /dev/null @@ -1,60 +0,0 @@ -package net.lab1024.smartadmin.module.business.log.userloginlog.domain; -import com.baomidou.mybatisplus.annotation.TableName; -import net.lab1024.smartadmin.common.domain.BaseEntity; -import lombok.*; - - -/** - * [ 用户登录日志] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019-05-15 10:25:21 - * @since JDK1.8 - */ -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -@TableName("t_user_login_log") -public class UserLoginLogEntity extends BaseEntity { - - /** - * 员工id - */ - private Long userId; - - /** - * 用户名 - */ - private String userName; - /** - * 用户ip - */ - private String remoteIp; - - /** - * 用户端口 - */ - private Integer remotePort; - - /** - * 浏览器 - */ - private String remoteBrowser; - - /** - * 操作系统 - */ - private String remoteOs; - - /** - * 登录状态 - */ - private Integer loginStatus; - - - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/userloginlog/domain/UserLoginLogQueryDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/userloginlog/domain/UserLoginLogQueryDTO.java deleted file mode 100644 index 726797cc..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/userloginlog/domain/UserLoginLogQueryDTO.java +++ /dev/null @@ -1,31 +0,0 @@ -package net.lab1024.smartadmin.module.business.log.userloginlog.domain; - -import net.lab1024.smartadmin.common.domain.PageParamDTO; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * [ 用户登录日志 ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date 2019-05-15 10:25:21 - * @since JDK1.8 - */ -@Data -public class UserLoginLogQueryDTO extends PageParamDTO { - - - @ApiModelProperty("开始日期") - private String startDate; - - @ApiModelProperty("结束日期") - private String endDate; - - - @ApiModelProperty("用户名") - private String userName; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/useroperatelog/UserOperateLogController.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/useroperatelog/UserOperateLogController.java deleted file mode 100644 index e1c2d775..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/useroperatelog/UserOperateLogController.java +++ /dev/null @@ -1,50 +0,0 @@ -package net.lab1024.smartadmin.module.business.log.useroperatelog; - -import net.lab1024.smartadmin.common.anno.OperateLog; -import net.lab1024.smartadmin.common.domain.PageResultDTO; -import net.lab1024.smartadmin.constant.SwaggerTagConst; -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.module.business.log.useroperatelog.domain.UserOperateLogDTO; -import net.lab1024.smartadmin.module.business.log.useroperatelog.domain.UserOperateLogQueryDTO; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date 2019-05-15 11:32:14 - * @since JDK1.8 - */ -@RestController -@Api(tags = {SwaggerTagConst.Admin.MANAGER_USER_OPERATE_LOG}) -@OperateLog -public class UserOperateLogController { - - @Autowired - private UserOperateLogService userOperateLogService; - - @ApiOperation(value = "分页查询",notes = "@author yandanyang") - @PostMapping("/userOperateLog/page/query") - public ResponseDTO> queryByPage(@RequestBody UserOperateLogQueryDTO queryDTO) { - return userOperateLogService.queryByPage(queryDTO); - } - - @ApiOperation(value="删除",notes = "@author yandanyang") - @GetMapping("/userOperateLog/delete/{id}") - public ResponseDTO delete(@PathVariable("id") Long id){ - return userOperateLogService.delete(id); - } - - - @ApiOperation(value="详情",notes = "@author yandanyang") - @GetMapping("/userOperateLog/detail/{id}") - public ResponseDTO detail(@PathVariable("id") Long id){ - return userOperateLogService.detail(id); - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/useroperatelog/UserOperateLogDao.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/useroperatelog/UserOperateLogDao.java deleted file mode 100644 index 8959bbed..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/useroperatelog/UserOperateLogDao.java +++ /dev/null @@ -1,47 +0,0 @@ -package net.lab1024.smartadmin.module.business.log.useroperatelog; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import net.lab1024.smartadmin.module.business.log.useroperatelog.domain.UserOperateLogQueryDTO; -import net.lab1024.smartadmin.module.business.log.useroperatelog.domain.UserOperateLogEntity; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Component; - -import java.util.List; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019-05-15 11:32:14 - * @since JDK1.8 - */ -@Mapper -@Component -public interface UserOperateLogDao extends BaseMapper { - - /** - * 分页查询 - * @param queryDTO - * @return UserOperateLogEntity - */ - List queryByPage(Page page, @Param("queryDTO") UserOperateLogQueryDTO queryDTO); - - /** - * 根据id删除 - * @param id - * @return - */ - void deleteById(@Param("id") Long id); - - /** - * 批量删除 - * @param idList - * @return - */ - void deleteByIds(@Param("idList") List idList); -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/useroperatelog/UserOperateLogService.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/useroperatelog/UserOperateLogService.java deleted file mode 100644 index 772504ce..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/useroperatelog/UserOperateLogService.java +++ /dev/null @@ -1,91 +0,0 @@ -package net.lab1024.smartadmin.module.business.log.useroperatelog; - -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import net.lab1024.smartadmin.common.domain.PageResultDTO; -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.module.business.log.useroperatelog.domain.UserOperateLogDTO; -import net.lab1024.smartadmin.module.business.log.useroperatelog.domain.UserOperateLogEntity; -import net.lab1024.smartadmin.module.business.log.useroperatelog.domain.UserOperateLogQueryDTO; -import net.lab1024.smartadmin.util.SmartBeanUtil; -import net.lab1024.smartadmin.util.SmartPageUtil; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.List; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date 2019-05-15 11:32:14 - * @since JDK1.8 - */ -@Service -public class UserOperateLogService { - - @Autowired - private UserOperateLogDao userOperateLogDao; - - /** - * @author yandanyang - * @description 分页查询 - * @date 2019-05-15 11:32:14 - */ - public ResponseDTO> queryByPage(UserOperateLogQueryDTO queryDTO) { - Page page = SmartPageUtil.convert2QueryPage(queryDTO); - List entities = userOperateLogDao.queryByPage(page, queryDTO); - List dtoList = SmartBeanUtil.copyList(entities, UserOperateLogDTO.class); - page.setRecords(dtoList); - PageResultDTO pageResultDTO = SmartPageUtil.convert2PageResult(page); - return ResponseDTO.succData(pageResultDTO); - } - - /** - * @author yandanyang - * @description 添加 - * @date 2019-05-15 11:32:14 - */ - public ResponseDTO add(UserOperateLogDTO addDTO) { - UserOperateLogEntity entity = SmartBeanUtil.copy(addDTO, UserOperateLogEntity.class); - userOperateLogDao.insert(entity); - return ResponseDTO.succ(); - } - - /** - * @author yandanyang - * @description 编辑 - * @date 2019-05-15 11:32:14 - */ - @Transactional(rollbackFor = Exception.class) - public ResponseDTO update(UserOperateLogDTO updateDTO) { - UserOperateLogEntity entity = SmartBeanUtil.copy(updateDTO, UserOperateLogEntity.class); - userOperateLogDao.updateById(entity); - return ResponseDTO.succ(); - } - - /** - * @author yandanyang - * @description 删除 - * @date 2019-05-15 11:32:14 - */ - @Transactional(rollbackFor = Exception.class) - public ResponseDTO delete(Long id) { - userOperateLogDao.deleteById(id); - return ResponseDTO.succ(); - } - - /** - * @author yandanyang - * @description 根据ID查询 - * @date 2019-05-15 11:32:14 - */ - public ResponseDTO detail(Long id) { - UserOperateLogEntity entity = userOperateLogDao.selectById(id); - UserOperateLogDTO dto = SmartBeanUtil.copy(entity, UserOperateLogDTO.class); - return ResponseDTO.succData(dto); - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/useroperatelog/domain/UserOperateLogEntity.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/useroperatelog/domain/UserOperateLogEntity.java deleted file mode 100644 index 467ce769..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/useroperatelog/domain/UserOperateLogEntity.java +++ /dev/null @@ -1,74 +0,0 @@ -package net.lab1024.smartadmin.module.business.log.useroperatelog.domain; -import com.baomidou.mybatisplus.annotation.TableName; -import net.lab1024.smartadmin.common.domain.BaseEntity; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019-05-15 11:32:14 - * @since JDK1.8 - */ -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -@TableName("t_user_operate_log") -public class UserOperateLogEntity extends BaseEntity { - - - - /** - * 用户id - */ - private Long userId; - - /** - * 用户名称 - */ - private String userName; - /** - * 操作模块 - */ - private String module; - - /** - * 操作内容 - */ - private String content; - - /** - * 请求路径 - */ - private String url; - - /** - * 请求方法 - */ - private String method; - - /** - * 请求参数 - */ - private String param; - - /** - * 请求结果 0失败 1成功 - */ - private Integer result; - - /** - * 失败原因 - */ - private String failReason; - - - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/useroperatelog/domain/UserOperateLogQueryDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/useroperatelog/domain/UserOperateLogQueryDTO.java deleted file mode 100644 index cee24b7d..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/log/useroperatelog/domain/UserOperateLogQueryDTO.java +++ /dev/null @@ -1,34 +0,0 @@ -package net.lab1024.smartadmin.module.business.log.useroperatelog.domain; - -import net.lab1024.smartadmin.common.domain.PageParamDTO; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date 2019-05-15 11:32:14 - * @since JDK1.8 - */ -@Data -public class UserOperateLogQueryDTO extends PageParamDTO { - - - @ApiModelProperty("开始日期") - private String startDate; - - @ApiModelProperty("结束日期") - private String endDate; - - - @ApiModelProperty("用户名称") - private String userName; - - @ApiModelProperty("请求结果 0失败 1成功") - private Integer resultFlag; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/NoticeController.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/NoticeController.java deleted file mode 100644 index 5d42d5d9..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/NoticeController.java +++ /dev/null @@ -1,96 +0,0 @@ -package net.lab1024.smartadmin.module.business.notice; - -import net.lab1024.smartadmin.common.anno.NoValidPrivilege; -import net.lab1024.smartadmin.common.domain.PageParamDTO; -import net.lab1024.smartadmin.common.domain.PageResultDTO; -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.constant.SwaggerTagConst; -import net.lab1024.smartadmin.module.business.notice.domain.dto.*; -import net.lab1024.smartadmin.util.SmartRequestTokenUtil; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.validation.Valid; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date 2019-07-11 16:19:48 - * @since JDK1.8 - */ -@RestController -@Api(tags = {SwaggerTagConst.Admin.MANAGER_NOTICE}) -public class NoticeController { - - @Autowired - private NoticeService noticeService; - - @ApiOperation(value = "分页查询全部消息", notes = "@author yandanyang") - @PostMapping("/notice/page/query") - @NoValidPrivilege - public ResponseDTO> queryByPage(@RequestBody NoticeQueryDTO queryDTO) { - return noticeService.queryByPage(queryDTO); - } - - @ApiOperation(value = "获取已收取的所有消息", notes = "@author yandanyang") - @PostMapping("/notice/receive/page/query") - @NoValidPrivilege - public ResponseDTO> queryReceiveByPage(@RequestBody NoticeReceiveQueryDTO queryDTO) { - return noticeService.queryReceiveByPage(queryDTO, SmartRequestTokenUtil.getRequestUser()); - } - - @ApiOperation(value = "分页查询未读消息", notes = "@author yandanyang") - @PostMapping("/notice/unread/page/query") - @NoValidPrivilege - public ResponseDTO> queryUnreadByPage(@RequestBody PageParamDTO queryDTO) { - return noticeService.queryUnreadByPage(queryDTO, SmartRequestTokenUtil.getRequestUser()); - } - - @ApiOperation(value = "添加", notes = "@author yandanyang") - @PostMapping("/notice/add") - @NoValidPrivilege - public ResponseDTO add(@RequestBody @Valid NoticeAddDTO addTO) { - return noticeService.add(addTO, SmartRequestTokenUtil.getRequestUser()); - } - - @ApiOperation(value = "修改", notes = "@author yandanyang") - @PostMapping("/notice/update") - @NoValidPrivilege - public ResponseDTO update(@RequestBody @Valid NoticeUpdateDTO updateDTO) { - return noticeService.update(updateDTO); - } - - @ApiOperation(value = "删除", notes = "@author yandanyang") - @GetMapping("/notice/delete/{id}") - @NoValidPrivilege - public ResponseDTO delete(@PathVariable("id") Long id) { - return noticeService.delete(id); - } - - @ApiOperation(value = "详情", notes = "@author yandanyang") - @GetMapping("/notice/detail/{id}") - @NoValidPrivilege - public ResponseDTO detail(@PathVariable("id") Long id) { - return noticeService.detail(id); - } - - @ApiOperation(value = "发送", notes = "@author yandanyang") - @GetMapping("/notice/send/{id}") - @NoValidPrivilege - public ResponseDTO send(@PathVariable("id") Long id) { - return noticeService.send(id, SmartRequestTokenUtil.getRequestUser()); - } - - @ApiOperation(value = "读取消息", notes = "@author yandanyang") - @GetMapping("/notice/read/{id}") - @NoValidPrivilege - public ResponseDTO read(@PathVariable("id") Long id) { - return noticeService.read(id, SmartRequestTokenUtil.getRequestUser()); - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/NoticeManage.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/NoticeManage.java deleted file mode 100644 index 7f65e416..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/NoticeManage.java +++ /dev/null @@ -1,97 +0,0 @@ -package net.lab1024.smartadmin.module.business.notice; - -import net.lab1024.smartadmin.common.constant.JudgeEnum; -import net.lab1024.smartadmin.module.system.login.domain.RequestTokenBO; -import net.lab1024.smartadmin.module.business.notice.dao.NoticeDao; -import net.lab1024.smartadmin.module.business.notice.dao.NoticeReceiveRecordDao; -import net.lab1024.smartadmin.module.business.notice.domain.dto.NoticeUpdateDTO; -import net.lab1024.smartadmin.module.business.notice.domain.entity.NoticeEntity; -import net.lab1024.smartadmin.module.business.notice.domain.entity.NoticeReceiveRecordEntity; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.time.LocalDateTime; -import java.util.Date; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/7/13 0013 下午 17:33 - * @since JDK1.8 - */ -@Service -public class NoticeManage { - - @Autowired - private NoticeDao noticeDao; - @Autowired - private NoticeReceiveRecordDao noticeReceiveRecordDao; - - /** - * 发送消息 - * @param entity - * @param requestToken - */ - @Transactional(rollbackFor = Exception.class) - public void send(NoticeEntity entity, RequestTokenBO requestToken){ - - entity.setSendStatus(JudgeEnum.YES.getValue()); - noticeDao.updateById(entity); - //默认发件人 已读此消息 - NoticeReceiveRecordEntity recordEntity = new NoticeReceiveRecordEntity(); - recordEntity.setEmployeeId(requestToken.getRequestUserId()); - recordEntity.setNoticeId(entity.getId()); - recordEntity.setCreateTime(new Date()); - recordEntity.setUpdateTime(new Date()); - noticeReceiveRecordDao.insert(recordEntity); - } - - - /** - * 保存读取记录 - * @param noticeId - * @param requestToken - */ - public void saveReadRecord(Long noticeId, RequestTokenBO requestToken){ - NoticeReceiveRecordEntity recordEntity = new NoticeReceiveRecordEntity(); - recordEntity.setEmployeeId(requestToken.getRequestUserId()); - recordEntity.setNoticeId(noticeId); - recordEntity.setCreateTime(new Date()); - recordEntity.setUpdateTime(new Date()); - noticeReceiveRecordDao.insert(recordEntity); - } - - - /** - * 消息删除 - * @param entity - */ - @Transactional(rollbackFor = Exception.class) - public void delete(NoticeEntity entity) { - if(JudgeEnum.YES.getValue().equals(entity.getSendStatus())){ - //消息已发送 执行逻辑删除 - noticeDao.logicDeleteById(entity.getId(),JudgeEnum.YES.getValue()); - }else{ - //消息未发送 执行真实删除 - noticeDao.deleteById(entity.getId()); - } - } - - /** - * 更新消息 - * @param entity - * @param updateDTO - */ - public void update(NoticeEntity entity,NoticeUpdateDTO updateDTO) { - entity.setTitle(updateDTO.getTitle()); - entity.setContent(updateDTO.getContent()); - entity.setSendStatus(JudgeEnum.NO.getValue()); - entity.setDeleted(JudgeEnum.NO.getValue()); - noticeDao.updateById(entity); - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/NoticeService.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/NoticeService.java deleted file mode 100644 index 113c285c..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/NoticeService.java +++ /dev/null @@ -1,235 +0,0 @@ -package net.lab1024.smartadmin.module.business.notice; - -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import net.lab1024.smartadmin.common.constant.JudgeEnum; -import net.lab1024.smartadmin.common.constant.ResponseCodeConst; -import net.lab1024.smartadmin.common.domain.PageParamDTO; -import net.lab1024.smartadmin.common.domain.PageResultDTO; -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.module.system.login.domain.RequestTokenBO; -import net.lab1024.smartadmin.module.business.notice.dao.NoticeDao; -import net.lab1024.smartadmin.module.business.notice.dao.NoticeReceiveRecordDao; -import net.lab1024.smartadmin.module.business.notice.domain.dto.*; -import net.lab1024.smartadmin.module.business.notice.domain.entity.NoticeEntity; -import net.lab1024.smartadmin.module.business.notice.domain.entity.NoticeReceiveRecordEntity; -import net.lab1024.smartadmin.module.support.websocket.WebSocketServer; -import net.lab1024.smartadmin.util.SmartBeanUtil; -import net.lab1024.smartadmin.util.SmartPageUtil; -import org.apache.commons.collections.CollectionUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.time.LocalDateTime; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date 2019-07-11 16:19:48 - * @since JDK1.8 - */ -@Service -public class NoticeService { - - @Autowired - private NoticeDao noticeDao; - - @Autowired - private NoticeReceiveRecordDao noticeReceiveRecordDao; - - @Autowired - private NoticeManage noticeManage; - - /** - * @author yandanyang - * @description 分页查询 - * @date 2019-07-11 16:19:48 - */ - public ResponseDTO> queryByPage(NoticeQueryDTO queryDTO) { - queryDTO.setDeleted(JudgeEnum.NO.getValue()); - Page page = SmartPageUtil.convert2QueryPage(queryDTO); - List dtoList = noticeDao.queryByPage(page, queryDTO); - page.setRecords(dtoList); - PageResultDTO pageResultDTO = SmartPageUtil.convert2PageResult(page); - return ResponseDTO.succData(pageResultDTO); - } - - /** - * 获取当前登录人的消息列表 - * - * @param queryDTO - * @param requestToken - * @return - */ - public ResponseDTO> queryReceiveByPage(NoticeReceiveQueryDTO queryDTO, RequestTokenBO requestToken) { - queryDTO.setEmployeeId(requestToken.getRequestUserId()); - queryDTO.setSendStatus(JudgeEnum.YES.getValue()); - Page page = SmartPageUtil.convert2QueryPage(queryDTO); - List dtoList = noticeDao.queryReceiveByPage(page, queryDTO); - dtoList.forEach(e -> { - if (e.getReceiveTime() == null) { - e.setReadStatus(JudgeEnum.NO.getValue()); - } else { - e.setReadStatus(JudgeEnum.YES.getValue()); - } - }); - page.setRecords(dtoList); - PageResultDTO pageResultDTO = SmartPageUtil.convert2PageResult(page); - return ResponseDTO.succData(pageResultDTO); - } - - /** - * 获取我的未读消息 - * - * @param queryDTO - * @param requestToken - * @return - */ - public ResponseDTO> queryUnreadByPage(PageParamDTO queryDTO, RequestTokenBO requestToken) { - Page page = SmartPageUtil.convert2QueryPage(queryDTO); - List dtoList = noticeDao.queryUnreadByPage(page, requestToken.getRequestUserId(), JudgeEnum.YES.getValue()); - page.setRecords(dtoList); - PageResultDTO pageResultDTO = SmartPageUtil.convert2PageResult(page); - return ResponseDTO.succData(pageResultDTO); - } - - /** - * @author yandanyang - * @description 添加 - * @date 2019-07-11 16:19:48 - */ - public ResponseDTO add(NoticeAddDTO addDTO, RequestTokenBO requestToken) { - NoticeEntity entity = SmartBeanUtil.copy(addDTO, NoticeEntity.class); - entity.setCreateTime(new Date()); - entity.setUpdateTime(new Date()); - entity.setCreateUser(requestToken.getRequestUserId()); - entity.setSendStatus(JudgeEnum.NO.getValue()); - entity.setDeleted(JudgeEnum.NO.getValue()); - noticeDao.insert(entity); - return ResponseDTO.succ(); - } - - /** - * @author yandanyang - * @description 编辑 - * @date 2019-07-11 16:19:48 - */ - @Transactional(rollbackFor = Exception.class) - public ResponseDTO update(NoticeUpdateDTO updateDTO) { - NoticeEntity entity = noticeDao.selectById(updateDTO.getId()); - if (entity == null) { - return ResponseDTO.wrap(ResponseCodeConst.ERROR_PARAM, "此系统通知不存在"); - } - if (JudgeEnum.YES.getValue().equals(entity.getSendStatus())) { - return ResponseDTO.wrap(ResponseCodeConst.ERROR_PARAM, "此系统通知已发送无法修改"); - } - noticeManage.update(entity, updateDTO); - return ResponseDTO.succ(); - } - - /** - * @author yandanyang - * @description 删除 - * @date 2019-07-11 16:19:48 - */ - public ResponseDTO delete(Long id) { - NoticeEntity entity = noticeDao.selectById(id); - if (entity == null) { - return ResponseDTO.wrap(ResponseCodeConst.ERROR_PARAM, "此系统通知不存在"); - } - noticeManage.delete(entity); - return ResponseDTO.succ(); - } - - /** - * @author yandanyang - * @description 根据ID查询 - * @date 2019-07-11 16:19:48 - */ - public ResponseDTO detail(Long id) { - NoticeDetailVO noticeDTO = noticeDao.detail(id); - return ResponseDTO.succData(noticeDTO); - } - - /** - * 获取某人的未读消息数 - * - * @param employeeId - * @return - */ - private Integer getUnreadCount(Long employeeId) { - return noticeDao.noticeUnreadCount(employeeId, JudgeEnum.YES.getValue()); - } - - /** - * 发送给所有在线用户未读消息数 - * - * @param id - * @param requestToken - * @return - */ - public ResponseDTO send(Long id, RequestTokenBO requestToken) { - NoticeEntity entity = noticeDao.selectById(id); - if (entity == null) { - return ResponseDTO.wrap(ResponseCodeConst.ERROR_PARAM, "此系统通知不存在"); - } - noticeManage.send(entity, requestToken); - this.sendMessage(requestToken); - return ResponseDTO.succ(); - } - - /** - * 发送系统通知 ,发送人不进行接收,需再事务外调用 以防止数据隔离级别不同造成未读消息数异常 - * - * @param requestToken - */ - private void sendMessage(RequestTokenBO requestToken) { - List onLineEmployeeIds = WebSocketServer.getOnLineUserList(); - if (CollectionUtils.isEmpty(onLineEmployeeIds)) { - return; - } - //在线用户已读消息数 - Map readCountMap = new HashMap<>(); - List readCountList = noticeDao.readCount(onLineEmployeeIds); - if (CollectionUtils.isNotEmpty(readCountList)) { - readCountMap = readCountList.stream().collect(Collectors.toMap(NoticeReadCountDTO :: getEmployeeId, NoticeReadCountDTO :: getReadCount)); - } - //已发送消息数 - Integer noticeCount = noticeDao.noticeCount(JudgeEnum.YES.getValue()); - for (Long employeeId : onLineEmployeeIds) { - Integer readCount = readCountMap.get(employeeId) == null ? 0 : readCountMap.get(employeeId); - Integer unReadCount = noticeCount - readCount; - if (! requestToken.getRequestUserId().equals(employeeId)) { - WebSocketServer.sendOneOnLineUser(unReadCount.toString(), employeeId); - } - } - } - - /** - * 读取消息 - * - * @param id - * @param requestToken - * @return - */ - public ResponseDTO read(Long id, RequestTokenBO requestToken) { - NoticeDetailVO noticeDTO = noticeDao.detail(id); - - NoticeReceiveRecordEntity recordEntity = noticeReceiveRecordDao.selectByEmployeeAndNotice(requestToken.getRequestUserId(), id); - if (recordEntity != null) { - return ResponseDTO.succData(noticeDTO); - } - noticeManage.saveReadRecord(id, requestToken); - this.sendMessage(requestToken); - return ResponseDTO.succData(noticeDTO); - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/dao/NoticeDao.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/dao/NoticeDao.java deleted file mode 100644 index de7caec5..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/dao/NoticeDao.java +++ /dev/null @@ -1,103 +0,0 @@ -package net.lab1024.smartadmin.module.business.notice.dao; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import net.lab1024.smartadmin.common.anno.DataScope; -import net.lab1024.smartadmin.module.business.notice.domain.dto.*; -import net.lab1024.smartadmin.module.business.notice.domain.entity.NoticeEntity; -import net.lab1024.smartadmin.module.system.datascope.constant.DataScopeWhereInTypeEnum; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Component; - -import java.util.List; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019-07-11 16:19:48 - * @since JDK1.8 - */ -@Mapper -@Component -public interface NoticeDao extends BaseMapper { - - /** - * 分页查询 - * @param queryDTO - * @return NoticeEntity - */ - @DataScope(joinSql = "n.create_user in (#employeeIds)", whereInType = DataScopeWhereInTypeEnum.EMPLOYEE) - List queryByPage(Page page, @Param("queryDTO") NoticeQueryDTO queryDTO); - - - /** - * 获取某人的未读消息 - * @param page - * @param employeeId - * @return - */ - @DataScope(joinSql = "e.department_id in (#departmentIds)", whereInType = DataScopeWhereInTypeEnum.DEPARTMENT) - List queryUnreadByPage(Page page, @Param("employeeId") Long employeeId, @Param("sendStatus") Integer sendStatus); - - - /** - * 获取 - * @param page - * @param queryDTO - * @return - */ - List queryReceiveByPage(Page page, @Param("queryDTO") NoticeReceiveQueryDTO queryDTO); - - /** - * 详情 - * @param id - * @return - */ - NoticeDetailVO detail(@Param("id") Long id); - - /** - * 根据id删除 逻辑删除 - * @param id - * @param deletedFlag - */ - void logicDeleteById(@Param("id") Long id,@Param("deletedFlag") Integer deletedFlag); - - - - /** - * 批量逻辑删除 - * @param idList - * @param deletedFlag - * @return - */ - void logicDeleteByIds(@Param("idList") List idList,@Param("deletedFlag") Integer deletedFlag); - - /** - * 获取消息总数 - * @return - */ - Integer noticeCount(@Param("sendStatus") Integer sendStatus); - - - /** - * 获取已读消息数 - * @param employeeIds - * @return - */ - List readCount(@Param("employeeIds") List employeeIds); - - - /** - * 获取某人的未读消息数 - * @param employeeId - * @param sendStatus - * @return - */ - Integer noticeUnreadCount(@Param("employeeId") Long employeeId, @Param("sendStatus") Integer sendStatus); - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/dao/NoticeReceiveRecordDao.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/dao/NoticeReceiveRecordDao.java deleted file mode 100644 index 682e0d74..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/dao/NoticeReceiveRecordDao.java +++ /dev/null @@ -1,48 +0,0 @@ -package net.lab1024.smartadmin.module.business.notice.dao; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import net.lab1024.smartadmin.module.business.notice.domain.entity.NoticeReceiveRecordEntity; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Component; - -import java.util.List; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019-07-11 16:19:48 - * @since JDK1.8 - */ -@Mapper -@Component -public interface NoticeReceiveRecordDao extends BaseMapper { - - /** - * 批量删除 - * - * @param noticeId - * @return - */ - void deleteByNoticeId(@Param("noticeId") Long noticeId); - - /** - * 批量插入 - * - * @param rolePrivilegeList - */ - void batchInsert(List rolePrivilegeList); - - /** - * 根据员工和系统通知获取读取记录 - * - * @param employeeId - * @param noticeId - * @return - */ - NoticeReceiveRecordEntity selectByEmployeeAndNotice(@Param("employeeId") Long employeeId, @Param("noticeId") Long noticeId); -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/domain/dto/NoticeAddDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/domain/dto/NoticeAddDTO.java deleted file mode 100644 index 572817d1..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/domain/dto/NoticeAddDTO.java +++ /dev/null @@ -1,28 +0,0 @@ -package net.lab1024.smartadmin.module.business.notice.domain.dto; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import org.hibernate.validator.constraints.Length; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/3/27 0027 下午 12:27 - * @since JDK1.8 - */ -@Data -public class NoticeAddDTO { - - @ApiModelProperty("消息标题") - @Length(max = 200) - private String title; - - @ApiModelProperty("消息内容") - @Length(max = 5000) - private String content; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/domain/dto/NoticeDetailVO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/domain/dto/NoticeDetailVO.java deleted file mode 100644 index 097317cd..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/domain/dto/NoticeDetailVO.java +++ /dev/null @@ -1,30 +0,0 @@ -package net.lab1024.smartadmin.module.business.notice.domain.dto; - -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.Date; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/3/27 0027 下午 12:27 - * @since JDK1.8 - */ -@Data -public class NoticeDetailVO extends NoticeVO { - - - @ApiModelProperty("消息内容") - private String content; - - @ApiModelProperty("更新时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private Date updateTime; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/domain/dto/NoticeQueryDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/domain/dto/NoticeQueryDTO.java deleted file mode 100644 index b68feb4f..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/domain/dto/NoticeQueryDTO.java +++ /dev/null @@ -1,34 +0,0 @@ -package net.lab1024.smartadmin.module.business.notice.domain.dto; - -import net.lab1024.smartadmin.common.domain.PageParamDTO; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date 2019-07-11 16:19:48 - * @since JDK1.8 - */ -@Data -public class NoticeQueryDTO extends PageParamDTO { - - - @ApiModelProperty("开始日期") - private String startDate; - - @ApiModelProperty("结束日期") - private String endDate; - - - @ApiModelProperty("消息标题") - private String title; - - @ApiModelProperty(value = "是否删除",hidden = true) - private Integer deleted; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/domain/dto/NoticeReadCountDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/domain/dto/NoticeReadCountDTO.java deleted file mode 100644 index 7821cf76..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/domain/dto/NoticeReadCountDTO.java +++ /dev/null @@ -1,26 +0,0 @@ -package net.lab1024.smartadmin.module.business.notice.domain.dto; - -import lombok.Data; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/7/12 0012 上午 8:11 - * @since JDK1.8 - */ -@Data -public class NoticeReadCountDTO { - /** - * 员工id - */ - private Long employeeId; - /** - * 已读消息数 - */ - private Integer readCount; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/domain/dto/NoticeReceiveDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/domain/dto/NoticeReceiveDTO.java deleted file mode 100644 index aa4aa7ad..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/domain/dto/NoticeReceiveDTO.java +++ /dev/null @@ -1,43 +0,0 @@ -package net.lab1024.smartadmin.module.business.notice.domain.dto; - -import com.fasterxml.jackson.annotation.JsonFormat; -import net.lab1024.smartadmin.common.anno.ApiModelPropertyEnum; -import net.lab1024.smartadmin.common.constant.JudgeEnum; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.Date; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/7/12 0012 上午 11:53 - * @since JDK1.8 - */ -@Data -public class NoticeReceiveDTO{ - - @ApiModelProperty("id") - private Long id; - - @ApiModelProperty("消息标题") - private String title; - - - @ApiModelProperty("消息创建人") - private Long createUser; - - @ApiModelProperty("消息创建人名称") - private String createUserName; - - @ApiModelProperty("结束时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private Date receiveTime; - - @ApiModelPropertyEnum(enumDesc = "读取状态",value = JudgeEnum.class) - private Integer readStatus; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/domain/dto/NoticeReceiveQueryDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/domain/dto/NoticeReceiveQueryDTO.java deleted file mode 100644 index 63bbc87b..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/domain/dto/NoticeReceiveQueryDTO.java +++ /dev/null @@ -1,25 +0,0 @@ -package net.lab1024.smartadmin.module.business.notice.domain.dto; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/7/12 0012 下午 12:32 - * @since JDK1.8 - */ -@Data -public class NoticeReceiveQueryDTO extends NoticeQueryDTO{ - - @ApiModelProperty(value = "当前登录人",hidden = true) - private Long employeeId; - - @ApiModelProperty(value = "发送状态",hidden = true) - private Integer sendStatus; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/domain/dto/NoticeUpdateDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/domain/dto/NoticeUpdateDTO.java deleted file mode 100644 index d62c00ca..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/domain/dto/NoticeUpdateDTO.java +++ /dev/null @@ -1,21 +0,0 @@ -package net.lab1024.smartadmin.module.business.notice.domain.dto; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/7/11 0011 下午 16:24 - * @since JDK1.8 - */ -@Data -public class NoticeUpdateDTO extends NoticeAddDTO{ - - @ApiModelProperty("id") - private Long id; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/domain/dto/NoticeVO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/domain/dto/NoticeVO.java deleted file mode 100644 index 04fc5fbb..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/domain/dto/NoticeVO.java +++ /dev/null @@ -1,42 +0,0 @@ -package net.lab1024.smartadmin.module.business.notice.domain.dto; -import net.lab1024.smartadmin.common.anno.ApiModelPropertyEnum; -import net.lab1024.smartadmin.common.constant.JudgeEnum; -import lombok.Data; -import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModelProperty; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/3/27 0027 下午 12:27 - * @since JDK1.8 - */ -@Data -public class NoticeVO { - - @ApiModelProperty("id") - private Long id; - - @ApiModelProperty("消息标题") - private String title; - - - @ApiModelProperty("消息创建人") - private Long createUser; - - @ApiModelPropertyEnum(enumDesc = "发送状态",value = JudgeEnum.class) - private Integer sendStatus; - - @ApiModelProperty("消息创建人名称") - private String createUserName; - - @ApiModelProperty("创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private Date createTime; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/domain/entity/NoticeEntity.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/domain/entity/NoticeEntity.java deleted file mode 100644 index 4caeca22..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/domain/entity/NoticeEntity.java +++ /dev/null @@ -1,45 +0,0 @@ -package net.lab1024.smartadmin.module.business.notice.domain.entity; -import com.baomidou.mybatisplus.annotation.TableName; -import net.lab1024.smartadmin.common.domain.BaseEntity; -import lombok.Data; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019-07-11 16:19:48 - * @since JDK1.8 - */ -@Data -@TableName("t_notice") -public class NoticeEntity extends BaseEntity { - - /** - * 消息标题 - */ - private String title; - - /** - * 消息内容 - */ - private String content; - - /** - * 消息创建人 - */ - private Long createUser; - - /** - * 发送状态 - */ - private Integer sendStatus; - - /** - * 删除状态 - */ - private Integer deleted; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/domain/entity/NoticeReceiveRecordEntity.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/domain/entity/NoticeReceiveRecordEntity.java deleted file mode 100644 index 74f5f3e7..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/notice/domain/entity/NoticeReceiveRecordEntity.java +++ /dev/null @@ -1,33 +0,0 @@ -package net.lab1024.smartadmin.module.business.notice.domain.entity; -import com.baomidou.mybatisplus.annotation.TableName; -import net.lab1024.smartadmin.common.domain.BaseEntity; -import lombok.Data; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019-07-11 16:19:48 - * @since JDK1.8 - */ -@Data -@TableName("t_notice_receive_record") -public class NoticeReceiveRecordEntity extends BaseEntity { - - - /** - * 消息id - */ - private Long noticeId; - - /** - * 消息接收人 - */ - private Long employeeId; - - - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/peony/controller/PeonyController.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/peony/controller/PeonyController.java deleted file mode 100644 index 08b12c62..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/peony/controller/PeonyController.java +++ /dev/null @@ -1,88 +0,0 @@ -package net.lab1024.smartadmin.module.business.peony.controller; - -import net.lab1024.smartadmin.common.domain.PageResultDTO; -import net.lab1024.smartadmin.common.controller.BaseController; -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.common.domain.ValidateList; -import net.lab1024.smartadmin.module.business.peony.domain.dto.PeonyAddDTO; -import net.lab1024.smartadmin.module.business.peony.domain.dto.PeonyUpdateDTO; -import net.lab1024.smartadmin.module.business.peony.domain.dto.PeonyQueryDTO; -import net.lab1024.smartadmin.module.business.peony.domain.vo.PeonyVO; -import net.lab1024.smartadmin.module.business.peony.domain.vo.PeonyExcelVO; -import net.lab1024.smartadmin.module.business.peony.service.PeonyService; -import cn.afterturn.easypoi.excel.ExcelExportUtil; -import cn.afterturn.easypoi.excel.entity.ExportParams; -import org.apache.poi.ss.usermodel.Workbook; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletResponse; -import java.util.List; - -/** - * [ 牡丹花 ] - * - * @author 卓大 - * @version 1.0 - * @company 1024创新实验室( www.1024lab.net ) - * @copyright (c) 1024创新实验室( www.1024lab.net )Inc. All rights reserved. - * @date 2020-04-06 18:17:56 - * @since JDK1.8 - */ -@RestController -@Api(tags = {"牡丹花"}) -public class PeonyController extends BaseController { - - @Autowired - private PeonyService peonyService; - - @ApiOperation(value = "分页查询牡丹花",notes = "@author 卓大") - @PostMapping("/peony/page/query") - public ResponseDTO> queryByPage(@RequestBody PeonyQueryDTO queryDTO) { - return peonyService.queryByPage(queryDTO); - } - - @ApiOperation(value = "添加牡丹花",notes = "@author 卓大") - @PostMapping("/peony/add") - public ResponseDTO add(@RequestBody @Validated PeonyAddDTO addTO){ - return peonyService.add(addTO); - } - - @ApiOperation(value="修改牡丹花",notes = "@author 卓大") - @PostMapping("/peony/update") - public ResponseDTO update(@RequestBody @Validated PeonyUpdateDTO updateDTO){ - return peonyService.update(updateDTO); - } - - @ApiOperation(value="批量删除牡丹花",notes = "@author 卓大") - @PostMapping("/peony/deleteByIds") - public ResponseDTO delete(@RequestBody @Validated ValidateList idList) { - return peonyService.deleteByIds(idList); - } - - @ApiOperation(value = "批量导出", notes = "@author 卓大") - @PostMapping("/peony/export/batch") - public void batchExport(@RequestBody @Validated ValidateList idList, HttpServletResponse response) { - //查询数据 - List peonyList = peonyService.queryBatchExportData(idList); - //导出操作 - ExportParams ex = new ExportParams("牡丹花", "Sheet1"); - Workbook workbook = ExcelExportUtil.exportExcel(ex, PeonyExcelVO.class, peonyList); - downloadExcel("牡丹花", workbook, response); - } - - @ApiOperation(value = "导出全部", notes = "@author 卓大") - @PostMapping("/peony/export/all") - public void exportAll(@RequestBody @Validated PeonyQueryDTO queryDTO, HttpServletResponse response) { - //查询数据 - List peonyList = peonyService.queryAllExportData(queryDTO); - //导出操作 - ExportParams ex = new ExportParams("牡丹花", "Sheet1"); - Workbook workbook = ExcelExportUtil.exportExcel(ex, PeonyExcelVO.class, peonyList); - downloadExcel("牡丹花", workbook, response); - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/peony/dao/PeonyDao.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/peony/dao/PeonyDao.java deleted file mode 100644 index bc131bb3..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/peony/dao/PeonyDao.java +++ /dev/null @@ -1,64 +0,0 @@ -package net.lab1024.smartadmin.module.business.peony.dao; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.baomidou.mybatisplus.core.metadata.IPage; -import net.lab1024.smartadmin.module.business.peony.domain.dto.PeonyQueryDTO; -import net.lab1024.smartadmin.module.business.peony.domain.entity.PeonyEntity; -import net.lab1024.smartadmin.module.business.peony.domain.vo.PeonyVO; -import net.lab1024.smartadmin.module.business.peony.domain.vo.PeonyExcelVO; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Component; - -import java.util.List; - -/** - * [ 牡丹花 ] - * - * @author 卓大 - * @version 1.0 - * @company 1024创新实验室( www.1024lab.net ) - * @copyright (c) 1024创新实验室( www.1024lab.net )Inc. All rights reserved. - * @date 2020-04-06 18:17:56 - * @since JDK1.8 - */ -@Mapper -@Component -public interface PeonyDao extends BaseMapper { - - /** - * 分页查询 - * @param queryDTO - * @return PeonyVO - */ - IPage queryByPage(Page page, @Param("queryDTO") PeonyQueryDTO queryDTO); - - /** - * 根据id删除 - * @param id - * @return - */ - void deleteById(@Param("id") Long id); - - /** - * 根据id批量删除 - * @param idList - * @return - */ - void deleteByIdList(@Param("idList") List idList); - - /** - * 查询所有导出数据 - * @param queryDTO - * @return - */ - List queryAllExportData(@Param("queryDTO") PeonyQueryDTO queryDTO); - - /** - * 查询批量导出数据 - * @param idList - * @return - */ - List queryBatchExportData(@Param("idList") List idList); -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/peony/domain/dto/PeonyAddDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/peony/domain/dto/PeonyAddDTO.java deleted file mode 100644 index 976a2593..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/peony/domain/dto/PeonyAddDTO.java +++ /dev/null @@ -1,41 +0,0 @@ -package net.lab1024.smartadmin.module.business.peony.domain.dto; - -import lombok.Data; -import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModelProperty; - -/** - * 新建 [ 牡丹花 ] - * - * @author 卓大 - * @version 1.0 - * @company 1024创新实验室( www.1024lab.net ) - * @copyright (c) 2018 1024创新实验室( www.1024lab.net )Inc. All rights reserved. - * @date 2020-04-06 18:17:56 - * @since JDK1.8 - */ -@Data -public class PeonyAddDTO { - @ApiModelProperty("品种") - private String kind; - - @ApiModelProperty("名字") - private String name; - - @ApiModelProperty("颜色") - private String color; - - @ApiModelProperty("图片链接") - private String imageUrl; - - @ApiModelProperty("创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private Date createTime; - - @ApiModelProperty("更新时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private Date updateTime; - - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/peony/domain/dto/PeonyQueryDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/peony/domain/dto/PeonyQueryDTO.java deleted file mode 100644 index 9841f01d..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/peony/domain/dto/PeonyQueryDTO.java +++ /dev/null @@ -1,44 +0,0 @@ -package net.lab1024.smartadmin.module.business.peony.domain.dto; - -import net.lab1024.smartadmin.common.domain.PageParamDTO; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import java.util.Date; - -/** - * [ 牡丹花 ] - * - * @author 卓大 - * @version 1.0 - * @company 1024创新实验室( www.1024lab.net ) - * @copyright (c) 1024创新实验室( www.1024lab.net )Inc. All rights reserved. - * @date 2020-04-06 18:17:56 - * @since JDK1.8 - */ -@Data -public class PeonyQueryDTO extends PageParamDTO { - - @ApiModelProperty("ID") - private Long id; - - @ApiModelProperty("品种") - private String kind; - - @ApiModelProperty("名字") - private String name; - - @ApiModelProperty("颜色") - private String color; - - @ApiModelProperty("创建时间-开始") - private Date createTimeBegin; - - @ApiModelProperty("创建时间-截止") - private Date createTimeEnd; - - @ApiModelProperty("上次更新时间-开始") - private Date updateTimeBegin; - - @ApiModelProperty("上次更新创建时间-开始") - private Date updateTimeEnd; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/peony/domain/dto/PeonyUpdateDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/peony/domain/dto/PeonyUpdateDTO.java deleted file mode 100644 index 7d7ca820..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/peony/domain/dto/PeonyUpdateDTO.java +++ /dev/null @@ -1,20 +0,0 @@ -package net.lab1024.smartadmin.module.business.peony.domain.dto; - -import lombok.Data; - -/** - * 更新 [ 牡丹花 ] - * - * @author 卓大 - * @version 1.0 - * @company 1024创新实验室( www.1024lab.net ) - * @copyright (c) 2018 1024创新实验室( www.1024lab.net )Inc. All rights reserved. - * @date 2020-04-06 18:17:56 - * @since JDK1.8 - */ -@Data -public class PeonyUpdateDTO extends PeonyAddDTO { - - private Long id; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/peony/domain/entity/PeonyEntity.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/peony/domain/entity/PeonyEntity.java deleted file mode 100644 index 48eb9d56..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/peony/domain/entity/PeonyEntity.java +++ /dev/null @@ -1,44 +0,0 @@ -package net.lab1024.smartadmin.module.business.peony.domain.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import net.lab1024.smartadmin.common.domain.BaseEntity; -import lombok.Data; - -/** - * [ 牡丹花 ] - * - * @author 卓大 - * @version 1.0 - * @company 1024创新实验室( www.1024lab.net ) - * @copyright (c) 1024创新实验室( www.1024lab.net )Inc. All rights reserved. - * @date 2020-04-06 18:17:56 - * @since JDK1.8 - */ -@Data -@TableName("t_peony") -public class PeonyEntity extends BaseEntity{ - - - /** - * 品种 - */ - private String kind; - - /** - * 名字 - */ - private String name; - - /** - * 颜色 - */ - private String color; - - /** - * 图片链接 - */ - private String imageUrl; - - - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/peony/domain/vo/PeonyExcelVO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/peony/domain/vo/PeonyExcelVO.java deleted file mode 100644 index 8964433f..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/peony/domain/vo/PeonyExcelVO.java +++ /dev/null @@ -1,42 +0,0 @@ -package net.lab1024.smartadmin.module.business.peony.domain.vo; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import lombok.Data; -import java.util.Date; - -/** - * [ 牡丹花 ] - * - * @author 卓大 - * @version 1.0 - * @company 1024创新实验室( www.1024lab.net ) - * @copyright (c) 1024创新实验室( www.1024lab.net )Inc. All rights reserved. - * @date 2020-04-06 18:17:56 - * @since JDK1.8 - */ -@Data -public class PeonyExcelVO { - @Excel(name = "ID") - private Long id; - - @Excel(name = "品种") - private String kind; - - @Excel(name = "名字") - private String name; - - @Excel(name = "颜色") - private String color; - - @Excel(name = "图片链接") - private String imageUrl; - - @Excel(name = "创建时间", format = "yyyy-MM-dd HH:mm:ss") - private Date createTime; - - @Excel(name = "更新时间", format = "yyyy-MM-dd HH:mm:ss") - private Date updateTime; - - - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/peony/domain/vo/PeonyVO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/peony/domain/vo/PeonyVO.java deleted file mode 100644 index 06590916..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/peony/domain/vo/PeonyVO.java +++ /dev/null @@ -1,45 +0,0 @@ -package net.lab1024.smartadmin.module.business.peony.domain.vo; - -import lombok.Data; -import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModelProperty; - -/** - * [ 牡丹花 ] - * - * @author 卓大 - * @version 1.0 - * @company 1024创新实验室( www.1024lab.net ) - * @copyright (c) 1024创新实验室( www.1024lab.net )Inc. All rights reserved. - * @date 2020-04-06 18:17:56 - * @since JDK1.8 - */ -@Data -public class PeonyVO { - @ApiModelProperty("ID") - private Long id; - - @ApiModelProperty("品种") - private String kind; - - @ApiModelProperty("名字") - private String name; - - @ApiModelProperty("颜色") - private String color; - - @ApiModelProperty("图片链接") - private String imageUrl; - - @ApiModelProperty("创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private Date createTime; - - @ApiModelProperty("更新时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private Date updateTime; - - - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/peony/service/PeonyService.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/peony/service/PeonyService.java deleted file mode 100644 index 50bfbb44..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/business/peony/service/PeonyService.java +++ /dev/null @@ -1,108 +0,0 @@ -package net.lab1024.smartadmin.module.business.peony.service; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import net.lab1024.smartadmin.common.domain.PageResultDTO; -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.module.business.peony.dao.PeonyDao; -import net.lab1024.smartadmin.module.business.peony.domain.dto.PeonyAddDTO; -import net.lab1024.smartadmin.module.business.peony.domain.dto.PeonyUpdateDTO; -import net.lab1024.smartadmin.module.business.peony.domain.dto.PeonyQueryDTO; -import net.lab1024.smartadmin.module.business.peony.domain.entity.PeonyEntity; -import net.lab1024.smartadmin.module.business.peony.domain.vo.PeonyVO; -import net.lab1024.smartadmin.module.business.peony.domain.vo.PeonyExcelVO; -import net.lab1024.smartadmin.util.SmartPageUtil; -import net.lab1024.smartadmin.util.SmartBeanUtil; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.List; - -/** - * [ 牡丹花 ] - * - * @author 卓大 - * @version 1.0 - * @company 1024创新实验室( www.1024lab.net ) - * @copyright (c) 1024创新实验室( www.1024lab.net )Inc. All rights reserved. - * @date 2020-04-06 18:17:56 - * @since JDK1.8 - */ -@Service -public class PeonyService { - - @Autowired - private PeonyDao peonyDao; - - /** - * 根据id查询 - */ - public PeonyEntity getById(Long id){ - return peonyDao.selectById(id); - } - - /** - * 分页查询 - * @author 卓大 - * @date 2020-04-06 18:17:56 - */ - public ResponseDTO> queryByPage(PeonyQueryDTO queryDTO) { - Page page = SmartPageUtil.convert2QueryPage(queryDTO); - IPage voList = peonyDao.queryByPage(page, queryDTO); - PageResultDTO pageResultDTO = SmartPageUtil.convert2PageResult(voList); - return ResponseDTO.succData(pageResultDTO); - } - - /** - * 添加 - * @author 卓大 - * @date 2020-04-06 18:17:56 - */ - public ResponseDTO add(PeonyAddDTO addDTO) { - PeonyEntity entity = SmartBeanUtil.copy(addDTO, PeonyEntity.class); - peonyDao.insert(entity); - return ResponseDTO.succ(); - } - - /** - * 编辑 - * @author 卓大 - * @date 2020-04-06 18:17:56 - */ - @Transactional(rollbackFor = Exception.class) - public ResponseDTO update(PeonyUpdateDTO updateDTO) { - PeonyEntity entity = SmartBeanUtil.copy(updateDTO, PeonyEntity.class); - peonyDao.updateById(entity); - return ResponseDTO.succ(); - } - - /** - * 删除 - * @author 卓大 - * @date 2020-04-06 18:17:56 - */ - @Transactional(rollbackFor = Exception.class) - public ResponseDTO deleteByIds(List idList) { - peonyDao.deleteByIdList(idList); - return ResponseDTO.succ(); - } - - /** - * 查询全部导出对象 - * @author 卓大 - * @date 2020-04-06 18:17:56 - */ - public List queryAllExportData(PeonyQueryDTO queryDTO) { - return peonyDao.queryAllExportData( queryDTO); - } - - /** - * 批量查询导出对象 - * @author 卓大 - * @date 2020-04-06 18:17:56 - */ - public List queryBatchExportData(List idList) { - return peonyDao.queryBatchExportData(idList); - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/codegenerator/constant/SqlOperateTypeEnum.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/codegenerator/constant/SqlOperateTypeEnum.java deleted file mode 100644 index 943e1c36..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/codegenerator/constant/SqlOperateTypeEnum.java +++ /dev/null @@ -1,34 +0,0 @@ -package net.lab1024.smartadmin.module.support.codegenerator.constant; - - -/** - * [ gt,lt 目前只支持Date] - * - * @author yandanyang - * @version 1.0 - * @since JDK1.8 - */ -public enum SqlOperateTypeEnum{ - - - LIKE(1, "like"), - EQUALS(2, "equals"), - IN(3, "in"); - - private Integer type; - - private String name; - - SqlOperateTypeEnum(Integer type, String name) { - this.type = type; - this.name = name; - } - - public Integer getType() { - return type; - } - - public String getName() { - return name; - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/codegenerator/dao/TableDao.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/codegenerator/dao/TableDao.java deleted file mode 100644 index f8d005ab..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/codegenerator/dao/TableDao.java +++ /dev/null @@ -1,40 +0,0 @@ -package net.lab1024.smartadmin.module.support.codegenerator.dao; - -import net.lab1024.smartadmin.module.support.codegenerator.domain.ColumnVO; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Component; - -import java.util.List; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/5/10 0010 下午 18:59 - * @since JDK1.8 - */ -@Mapper -@Component -public interface TableDao { - - - /** - * 查询表描述 - * @param tableName - * @return - */ - String selectTableDesc(@Param("tableName") String tableName); - - /** - * 查询表列信息 - * @param tableName - * @return - */ - List selectTableColumn(@Param("tableName") String tableName); - - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/codegenerator/domain/CodeGeneratorDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/codegenerator/domain/CodeGeneratorDTO.java deleted file mode 100644 index 4995aa57..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/codegenerator/domain/CodeGeneratorDTO.java +++ /dev/null @@ -1,56 +0,0 @@ -package net.lab1024.smartadmin.module.support.codegenerator.domain; - -import lombok.Builder; -import lombok.Data; - -import java.util.List; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/5/11 0011 上午 10:12 - * @since JDK1.8 - */ -@Data -@Builder -public class CodeGeneratorDTO { - - /** - * 需要生成代码的表名 - */ - private String tableName; - - /** - * 表前缀 - */ - private String tablePrefix; - - /** - * 基础包路径 - */ - private String basePackage; - - /** - * module下的子包 - */ - private String modulePackage; - - /** - * 公司 - */ - private String company; - - /** - * 作者 - */ - private String author; - - /** - * 需要构建查询方法的列 - */ - private List queryColumnList; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/codegenerator/domain/CodeGeneratorQueryColumnDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/codegenerator/domain/CodeGeneratorQueryColumnDTO.java deleted file mode 100644 index 9e1bd054..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/codegenerator/domain/CodeGeneratorQueryColumnDTO.java +++ /dev/null @@ -1,30 +0,0 @@ -package net.lab1024.smartadmin.module.support.codegenerator.domain; - -import net.lab1024.smartadmin.module.support.codegenerator.constant.SqlOperateTypeEnum; -import lombok.Builder; -import lombok.Data; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/5/11 0011 上午 10:13 - * @since JDK1.8 - */ -@Data -@Builder -public class CodeGeneratorQueryColumnDTO { - - /** - * 生成查询方法的查询列名 - */ - private String columnName; - - /** - * 此列的查询动作 - */ - private SqlOperateTypeEnum sqlOperate; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/codegenerator/domain/ColumnVO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/codegenerator/domain/ColumnVO.java deleted file mode 100644 index 9bec4d9f..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/codegenerator/domain/ColumnVO.java +++ /dev/null @@ -1,36 +0,0 @@ -package net.lab1024.smartadmin.module.support.codegenerator.domain; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/5/10 0010 下午 17:55 - * @since JDK1.8 - */ -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public class ColumnVO { - - private String columnName; - - private String columnType; - - private String columnDesc; - - private String fieldType; - - private String fieldName; - - private Boolean isNumber; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/codegenerator/domain/QueryFieldVO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/codegenerator/domain/QueryFieldVO.java deleted file mode 100644 index c2afcc53..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/codegenerator/domain/QueryFieldVO.java +++ /dev/null @@ -1,30 +0,0 @@ -package net.lab1024.smartadmin.module.support.codegenerator.domain; - -import lombok.Builder; -import lombok.Data; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/5/10 0010 下午 17:56 - * @since JDK1.8 - */ -@Data -@Builder -public class QueryFieldVO { - - private String fieldName; - - private String columnName; - - private String columnDesc; - - private String fieldType; - - private String sqlOperate; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/codegenerator/service/CodeGeneratorComponent.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/codegenerator/service/CodeGeneratorComponent.java deleted file mode 100644 index 37ee4e87..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/codegenerator/service/CodeGeneratorComponent.java +++ /dev/null @@ -1,92 +0,0 @@ -package net.lab1024.smartadmin.module.support.codegenerator.service; - -import com.google.common.base.CaseFormat; -import org.springframework.stereotype.Component; - -import java.io.File; -import java.util.HashMap; -import java.util.Map; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/5/11 0011 上午 8:33 - * @since JDK1.8 - */ -@Component -public class CodeGeneratorComponent { - - private static Map dataMap = new HashMap<>(16); - private static Map numberTypeMap = new HashMap<>(16); - - static { - dataMap(); - } - - public static void dataMap() { - numberTypeMap.put("int", "Integer"); - numberTypeMap.put("tinyint", "Integer"); - numberTypeMap.put("smallint", "Integer"); - numberTypeMap.put("integer", "Integer"); - numberTypeMap.put("bigint", "Long"); - numberTypeMap.put("float", "Float"); - numberTypeMap.put("double", "Double"); - numberTypeMap.put("decimal", "BigDecimal"); - - dataMap.put("char", "String"); - dataMap.put("varchar", "String"); - dataMap.put("tinytext", "String"); - dataMap.put("text", "String"); - dataMap.put("longtext", "String"); - - dataMap.put("date", "Date"); - dataMap.put("datetime", "Date"); - dataMap.put("timestamp", "Date"); - - } - - - public Map codeTemplates(String moduleClass, String basePackage, String modulePackage) { - String modulePath = modulePackage.replaceAll("\\.", "/"); - String javaPackagePath = "java/" + modulePath + File.separator; - String xmlPackagePath = "mapper/" + modulePath + File.separator; - String frontPackagePath = "web" + File.separator; - Map templateMap = new HashMap<>(); - //后端 - templateMap.put("templates/codegenerator/java/Controller.java.vm", javaPackagePath + "controller" + File.separator + moduleClass + "Controller.java"); - templateMap.put("templates/codegenerator/java/Dao.java.vm", javaPackagePath + "dao" + File.separator + moduleClass + "Dao.java"); - templateMap.put("templates/codegenerator/java/Dao.xml.vm", xmlPackagePath + moduleClass + "Mapper.xml"); - templateMap.put("templates/codegenerator/java/AddDTO.java.vm", javaPackagePath + "domain" + File.separator + "dto" + File.separator + moduleClass + "AddDTO.java"); - templateMap.put("templates/codegenerator/java/UpdateDTO.java.vm", javaPackagePath + "domain" + File.separator + "dto" + File.separator + moduleClass + "UpdateDTO.java"); - templateMap.put("templates/codegenerator/java/Entity.java.vm", javaPackagePath + "domain" + File.separator + "entity" + File.separator + moduleClass + "Entity.java"); - templateMap.put("templates/codegenerator/java/VO.java.vm", javaPackagePath + "domain" + File.separator + "vo" + File.separator + moduleClass + "VO.java"); - templateMap.put("templates/codegenerator/java/ExcelVO.java.vm", javaPackagePath + "domain" + File.separator + "vo" + File.separator + moduleClass + "ExcelVO.java"); - templateMap.put("templates/codegenerator/java/QueryDTO.java.vm", javaPackagePath + "domain" + File.separator + "dto" + File.separator + moduleClass + "QueryDTO.java"); - templateMap.put("templates/codegenerator/java/Service.java.vm", javaPackagePath + "service" + File.separator + moduleClass + "Service.java"); - //前端 - String webPackageName = CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, moduleClass).replaceAll("_", "-"); - templateMap.put("templates/codegenerator/web/Api.js.vm", frontPackagePath + "api" + File.separator + webPackageName + ".js"); - templateMap.put("templates/codegenerator/web/Router.js.vm", frontPackagePath + "router" + File.separator + webPackageName + ".js"); - templateMap.put("templates/codegenerator/web/List.vue.vm", frontPackagePath + webPackageName + File.separator + webPackageName + "-list.vue"); - templateMap.put("templates/codegenerator/web/ListForm.vue.vm", frontPackagePath + webPackageName + File.separator + "components" + File.separator + webPackageName + "-list-form.vue"); - return templateMap; - } - - public String getJavaType(String mysqlType) { - String javaType = dataMap.get(mysqlType); - if (javaType == null) { - javaType = numberTypeMap.get(mysqlType); - } - return javaType; - } - - public boolean isNumber(String mysqlType) { - return numberTypeMap.containsKey(mysqlType); - } - - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/codegenerator/service/CodeGeneratorService.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/codegenerator/service/CodeGeneratorService.java deleted file mode 100644 index b2b6585d..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/codegenerator/service/CodeGeneratorService.java +++ /dev/null @@ -1,336 +0,0 @@ -package net.lab1024.smartadmin.module.support.codegenerator.service; - -import com.google.common.base.CaseFormat; -import net.lab1024.smartadmin.module.support.codegenerator.dao.TableDao; -import net.lab1024.smartadmin.module.support.codegenerator.domain.CodeGeneratorDTO; -import net.lab1024.smartadmin.module.support.codegenerator.domain.CodeGeneratorQueryColumnDTO; -import net.lab1024.smartadmin.module.support.codegenerator.domain.ColumnVO; -import net.lab1024.smartadmin.module.support.codegenerator.domain.QueryFieldVO; -import net.lab1024.smartadmin.util.SmartDateUtil; -import com.google.common.collect.Lists; -import lombok.extern.slf4j.Slf4j; -import net.lab1024.smartadmin.util.SmartStringUtil; -import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.lang.WordUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.velocity.Template; -import org.apache.velocity.VelocityContext; -import org.apache.velocity.app.Velocity; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.util.ResourceUtils; - -import javax.swing.filechooser.FileSystemView; -import java.io.File; -import java.io.FileWriter; -import java.util.*; -import java.util.Map.Entry; -import java.util.stream.Collectors; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/5/11 0011 上午 9:36 - * @since JDK1.8 - */ -@Slf4j -@Service -public class CodeGeneratorService { - - @Autowired - private TableDao tableDao; - - @Autowired - private CodeGeneratorComponent codeGeneratorComponent; - - /** - * 大家注意了开始生成代码了 - * - * @param codeGenerator - * @throws Exception - */ - public void codeGenerator(CodeGeneratorDTO codeGenerator) throws Exception { - this.basicValid(codeGenerator); - String date = SmartDateUtil.formatYMDHMS(new Date()); - String tableDesc = this.getTableDesc(codeGenerator.getTableName()); - String author = codeGenerator.getAuthor(); - String basePackage = codeGenerator.getBasePackage(); - if (StringUtils.isEmpty(basePackage)) { - basePackage = "net.lab1024.smartadmin"; - } - String moduleClass = this.tableName2Class(codeGenerator.getTableName(), codeGenerator.getTablePrefix()); - String moduleVar = this.tableName2Var(codeGenerator.getTableName(), codeGenerator.getTablePrefix()); - String modulePackage = codeGenerator.getModulePackage(); - - List columnList = this.columnList(codeGenerator.getTableName()); - List queryFieldList = this.buildQueryField(codeGenerator, columnList); - Map codeTemplates = codeGeneratorComponent.codeTemplates(moduleClass, basePackage, modulePackage); - List queryImports = this.buildQueryImport(queryFieldList); - List dtoImports = this.buildDTOImport(columnList); - List entityImports = this.buildEntityImport(columnList); - Properties p = new Properties(); - p.put("file.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader"); - p.put("directive.foreach.counter.name", "velocityCount"); - p.put("directive.foreach.counter.initial.value", "1"); - Velocity.init(p); - Map map = new HashMap<>(); - map.put("company", codeGenerator.getCompany()); - map.put("tableName", codeGenerator.getTableName()); - map.put("basePackage", basePackage); - map.put("modulePackage", modulePackage); - map.put("moduleClass", moduleClass); - map.put("tableDesc", tableDesc); - map.put("author", author); - map.put("date", date); - map.put("moduleVar", moduleVar); - map.put("columnList", columnList); - map.put("queryFieldList", queryFieldList); - map.put("queryImports", queryImports); - map.put("dtoImports", dtoImports); - map.put("entityImports", entityImports); - map.put("webModuleName", CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, moduleClass).replaceAll("_", "-")); - map.put("upperCamel", CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_CAMEL, moduleClass)); - //前端的变量 - map.put("ViewUIMessage", "$Message"); - map.put("VueRefs", "$refs"); - VelocityContext context = new VelocityContext(map); - this.codeGenerator(context, codeTemplates); - } - - private List buildQueryImport(List queryFieldList) { - List queryImports = Lists.newArrayList(); - if (CollectionUtils.isNotEmpty(queryFieldList)) { - queryFieldList.forEach(e -> { - importPackage(queryImports, e.getFieldType()); - if ("in".equals(e.getSqlOperate())) { - queryImports.add("import java.util.List;"); - } - }); - } - return queryImports; - } - - private List buildDTOImport(List columnList) { - List dtoImports = Lists.newArrayList(); - if (CollectionUtils.isNotEmpty(columnList)) { - columnList.forEach(e -> { - importPackage(dtoImports, e.getFieldType()); - }); - } - return dtoImports; - } - - private List buildEntityImport(List columnList) { - List entityImports = Lists.newArrayList(); - if (CollectionUtils.isNotEmpty(columnList)) { - columnList.forEach(e -> { - if (!e.getFieldName().equals("createTime") && !e.getFieldName().equals("updateTime") && !e.getFieldName().equals("id")) { - importPackage(entityImports, e.getFieldType()); - } - }); - } - return entityImports; - } - - private void importPackage(List imports, String fieldType) { - if ("Date".equals(fieldType) && !imports.contains("import java.util.Date;")) { - imports.add("import java.util.Date;"); - } - if ("BigDecimal".equals(fieldType) && !imports.contains("import java.math.BigDecimal;")) { - imports.add("import java.math.BigDecimal;"); - } - } - - private String getOutputDir() { - File desktopDir = FileSystemView.getFileSystemView().getHomeDirectory(); - return desktopDir.getAbsolutePath() + File.separator + "smart-admin" + File.separator; - } - - /** - * 生成代码 - * - * @param context - * @param codeTemplates - */ - private void codeGenerator(VelocityContext context, Map codeTemplates) throws Exception { - String projectPath = getOutputDir(); - - Velocity.setProperty("input.encoding", "UTF-8"); - Velocity.setProperty("output.encoding", "UTF-8"); - - for (Entry entry : codeTemplates.entrySet()) { - String template = entry.getKey(); - String filePath = projectPath + entry.getValue(); - String fileName = filePath.substring(filePath.lastIndexOf(File.separator) + 1); - String fileDir = filePath.replace(fileName, ""); - File directory = new File(fileDir); - if (!directory.exists()) { - directory.mkdirs(); - } - FileWriter writer; - try { - writer = new FileWriter(filePath); - Template tpl = Velocity.getTemplate(template, "UTF-8"); - tpl.merge(context, writer); - writer.flush(); - writer.close(); - } catch (Exception e) { - log.error("", e); - } - } - - log.info("------------------------------ 代 码 生 成 完 毕 ! ------------------------------"); - log.info("代码目录:{}", projectPath); - log.info("------------------------------ 代 码 生 成 完 毕 ! ------------------------------"); - - } - - public static void main(String[] args) { - try { - int i = 1 / 0; - } catch (Exception e) { - log.error("", e); - } - } - - private void basicValid(CodeGeneratorDTO codeGenerator) throws Exception { - if (StringUtils.isEmpty(codeGenerator.getTableName())) { - throw new Exception("你没建表吗?"); - } - if (StringUtils.isEmpty(codeGenerator.getTablePrefix())) { - throw new Exception("你的表没前缀吗?"); - } - if (StringUtils.isEmpty(codeGenerator.getAuthor())) { - throw new Exception("输入下你的大名"); - } - } - - /** - * 构建查询集合 - * - * @param codeGenerator - * @param columnList - * @return - * @throws Exception - */ - private List buildQueryField(CodeGeneratorDTO codeGenerator, List columnList) throws Exception { - List queryFieldList = Lists.newArrayList(); - Map storageMap = columnList.stream().collect(Collectors.toMap(ColumnVO::getColumnName, e -> e)); - List queryColumnList = codeGenerator.getQueryColumnList(); - if (CollectionUtils.isEmpty(queryColumnList)) { - return queryFieldList; - } - for (CodeGeneratorQueryColumnDTO queryColumn : queryColumnList) { - ColumnVO columnDTO = storageMap.get(queryColumn.getColumnName()); - if (columnDTO == null) { - String errorMsg = "sql列[" + queryColumn.getColumnName() + "]在表[" + codeGenerator.getTableName() + "]中不存在。"; - log.error(errorMsg); - throw new Exception(errorMsg); - } - QueryFieldVO queryField = - QueryFieldVO.builder().fieldName(columnDTO.getFieldName()).fieldType(columnDTO.getFieldType()).columnName(columnDTO.getColumnName()).columnDesc(columnDTO.getColumnDesc()).sqlOperate(queryColumn.getSqlOperate().getName()).build(); - queryFieldList.add(queryField); - } - return queryFieldList; - } - - /** - * 列数据 组合 - * - * @param tableName - * @return - * @throws Exception - */ - private List columnList(String tableName) throws Exception { - List list = tableDao.selectTableColumn(tableName); - for (ColumnVO column : list) { - String javaType = codeGeneratorComponent.getJavaType(column.getColumnType()); - if (StringUtils.isEmpty(javaType)) { - String errorMsg = "sql数据类型[" + column.getColumnType() + "]缺少对应的java类型。"; - log.error(errorMsg); - throw new Exception(errorMsg); - } - if ("Integer".equals(javaType) && column.getColumnName().contains("id")) { - column.setFieldType("Long"); - } else { - column.setFieldType(javaType); - } - column.setFieldName(this.columnName2Field(column.getColumnName())); - if (SmartStringUtil.isBlank(column.getColumnDesc())) { - column.setColumnDesc(column.getColumnName()); - } - - column.setIsNumber(codeGeneratorComponent.isNumber(column.getColumnType())); - } - return list; - } - - /** - * 获取列注释为类描述 - * - * @param tableName - * @return - */ - private String getTableDesc(String tableName) { - return tableDao.selectTableDesc(tableName); - } - - /** - * 列名转字段名 - * - * @param columnName - * @return - */ - private String columnName2Field(String columnName) { - String transName = WordUtils.capitalizeFully(columnName, new char[]{'_'}).replace("_", ""); - return WordUtils.uncapitalize(transName); - } - - /** - * 表名转类名前缀 - * - * @param tableName - * @param tablePrefix - * @return - */ - private String tableName2Class(String tableName, String tablePrefix) { - if (StringUtils.isNotBlank(tablePrefix)) { - tableName = tableName.replaceFirst(tablePrefix, ""); - } - return WordUtils.capitalizeFully(tableName, new char[]{'_'}).replace("_", ""); - } - - /** - * 表名转包名 - * - * @param tableName - * @param tablePrefix - * @return - */ - private String tableName2Package(String tableName, String tablePrefix) { - if (StringUtils.isNotBlank(tablePrefix)) { - tableName = tableName.replaceFirst(tablePrefix, ""); - } - return tableName.replace("_", ""); - } - - /** - * 表名转 java变量前缀 - * - * @param tableName - * @param tablePrefix - * @return - */ - private String tableName2Var(String tableName, String tablePrefix) { - if (StringUtils.isNotBlank(tablePrefix)) { - tableName = tableName.replaceFirst(tablePrefix, ""); - } - String transName = WordUtils.capitalizeFully(tableName, new char[]{'_'}).replace("_", ""); - return WordUtils.uncapitalize(transName); - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/FileController.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/FileController.java deleted file mode 100644 index 001e99d2..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/FileController.java +++ /dev/null @@ -1,93 +0,0 @@ -package net.lab1024.smartadmin.module.support.file; - -import net.lab1024.smartadmin.common.anno.NoNeedLogin; -import net.lab1024.smartadmin.common.domain.PageResultDTO; -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.constant.SwaggerTagConst; -import net.lab1024.smartadmin.module.support.file.constant.FileServiceTypeEnum; -import net.lab1024.smartadmin.module.support.file.domain.dto.FileAddDTO; -import net.lab1024.smartadmin.module.support.file.domain.dto.FileQueryDTO; -import net.lab1024.smartadmin.module.support.file.domain.vo.FileVO; -import net.lab1024.smartadmin.module.support.file.domain.vo.UploadVO; -import net.lab1024.smartadmin.module.support.file.service.FileService; -import net.lab1024.smartadmin.module.system.login.domain.RequestTokenBO; -import net.lab1024.smartadmin.util.SmartRequestTokenUtil; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.servlet.http.HttpServletRequest; -import javax.validation.Valid; - -/** - * @Description: 文件服务 - * @Author: sbq - * @CreateDate: 2019/7/18 9:36 - * @Version: 1.0 - */ -@RestController -@Api(tags = {SwaggerTagConst.Admin.MANAGER_FILE}) -public class FileController { - - @Autowired - private FileService fileService; - - @ApiOperation(value = "文件本地上传", notes = "文件本地上传") - @PostMapping("/api/file/localUpload/{moduleType}") - public ResponseDTO localUpload(MultipartFile file, @PathVariable Integer moduleType) throws Exception { - return fileService.fileUpload(file, FileServiceTypeEnum.LOCAL, moduleType); - } - - @ApiOperation(value = "获取本地文件URL", notes = "获取文件URL") - @PostMapping("/api/file/get") - public ResponseDTO localGetFile(String path) { - return fileService.getFileUrl(path, FileServiceTypeEnum.LOCAL); - } - - @ApiOperation(value = "文件阿里云上传", notes = "文件阿里云上传") - @PostMapping("/api/file/aliYunUpload/{moduleType}") - public ResponseDTO aliYunUpload(MultipartFile file, @PathVariable Integer moduleType) throws Exception { - return fileService.fileUpload(file, FileServiceTypeEnum.ALI_OSS, moduleType); - } - - @ApiOperation(value = "获取阿里云文件URL", notes = "获取阿里云文件URL") - @PostMapping("/api/file/aliYunGet") - public ResponseDTO aliYunGet(String path) { - return fileService.getFileUrl(path, FileServiceTypeEnum.ALI_OSS); - } - - @ApiOperation(value = "文件七牛云上传", notes = "文件七牛云上传") - @PostMapping("/api/file/qiNiuUpload/{moduleType}") - public ResponseDTO qiNiuUpload(MultipartFile file, @PathVariable Integer moduleType) throws Exception { - return fileService.fileUpload(file, FileServiceTypeEnum.QI_NIU_OSS, moduleType); - } - - @ApiOperation(value = "获取七牛云文件URL", notes = "获取七牛云URL") - @PostMapping("/api/file/qiNiuGet") - public ResponseDTO qiNiuGet(String path) { - return fileService.getFileUrl(path, FileServiceTypeEnum.QI_NIU_OSS); - } - - @ApiOperation(value = "系统文件查询") - @PostMapping("/api/file/query") - public ResponseDTO> queryListByPage(@RequestBody FileQueryDTO queryDTO) { - return fileService.queryListByPage(queryDTO); - } - - @ApiOperation(value = "系统文件下载通用接口(流下载)") - @GetMapping("/api/file/downLoad") - @NoNeedLogin - public ResponseEntity downLoadById(Long id, HttpServletRequest request) { - return fileService.downLoadById(id, request); - } - - @ApiOperation(value = "系统文件保存通用接口") - @PostMapping("/api/file/save") - public ResponseDTO saveFile(@Valid @RequestBody FileAddDTO addDTO) { - RequestTokenBO requestToken = SmartRequestTokenUtil.getRequestUser(); - return fileService.saveFile(addDTO,requestToken); - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/FileDao.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/FileDao.java deleted file mode 100644 index 3155bf25..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/FileDao.java +++ /dev/null @@ -1,72 +0,0 @@ -package net.lab1024.smartadmin.module.support.file; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import net.lab1024.smartadmin.module.support.file.domain.dto.FileDTO; -import net.lab1024.smartadmin.module.support.file.domain.dto.FileQueryDTO; -import net.lab1024.smartadmin.module.support.file.domain.entity.FileEntity; -import net.lab1024.smartadmin.module.support.file.domain.vo.FileVO; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Component; - -import java.util.List; - -/** - * @author cyj - * @date 2018-01-05 上午 9:49 - */ -@Mapper -@Component -public interface FileDao extends BaseMapper { - - /** - * 批量添加上传文件 - * - * @param fileDTOList - * @return - */ - Integer insertFileBatch(List fileDTOList); - - - /** - * 批量添加上传文件 - * - * @param fileDTOList - * @return - */ - Integer insertFileEntityBatch(List fileDTOList); - - /** - * 批量删除 - * - * @param moduleId - * @return - */ - Integer deleteFilesByModuleId(@Param("moduleId") String moduleId); - - /** - * 批量删除 - * - * @param moduleId - * @param moduleType - * @return - */ - Integer deleteFilesByModuleIdAndModuleType(@Param("moduleId") String moduleId, @Param("moduleType") String moduleType); - - /** - * @param moduleId - * @return - */ - List listFilesByModuleId(@Param("moduleId") String moduleId); - - List listFilesByFileIds(@Param("fileIds") List fileIds); - - List listFilesByModuleIdAndModuleType(@Param("moduleId") String moduleId, @Param("moduleType") String moduleType); - - List listFilesByModuleIdAndModuleTypes(@Param("moduleId") String moduleId, @Param("moduleTypes") List moduleTypes); - - List listFilesByModuleIdsAndModuleType(@Param("moduleIds") List moduleIds, @Param("moduleType") String moduleType); - - List queryListByPage(Page page, @Param("queryDTO") FileQueryDTO queryDTO); -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/constant/FileModuleTypeEnum.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/constant/FileModuleTypeEnum.java deleted file mode 100644 index 8052b767..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/constant/FileModuleTypeEnum.java +++ /dev/null @@ -1,47 +0,0 @@ -package net.lab1024.smartadmin.module.support.file.constant; - -import net.lab1024.smartadmin.common.domain.BaseEnum; - -/** - * [] - * - * @author yandanyang - * @version 1.0 - * @since JDK1.8 - */ -public enum FileModuleTypeEnum implements BaseEnum { - - /** - * path 首字符不能包含\ 或者/ - */ - - BACK_USER(1, "backUser/config", "backUser"), - - CODE_REVIEW(2, "codeReview", "CodeReview"); - - private Integer value; - - private String path; - - private String desc; - - FileModuleTypeEnum(Integer value, String path, String desc) { - this.value = value; - this.path = path; - this.desc = desc; - } - - public String getPath() { - return path; - } - - @Override - public Integer getValue() { - return this.value; - } - - @Override - public String getDesc() { - return this.desc; - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/constant/FileResponseCodeConst.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/constant/FileResponseCodeConst.java deleted file mode 100644 index fd5abfb9..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/constant/FileResponseCodeConst.java +++ /dev/null @@ -1,37 +0,0 @@ -package net.lab1024.smartadmin.module.support.file.constant; - -import net.lab1024.smartadmin.common.constant.ResponseCodeConst; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - * @since JDK1.8 - */ -public class FileResponseCodeConst extends ResponseCodeConst { - - /** - * 4001 -4999 - */ - public static final FileResponseCodeConst FILE_EMPTY = new FileResponseCodeConst(4001, "上传文件不存在!"); - - public static final FileResponseCodeConst FILE_SIZE_ERROR = new FileResponseCodeConst(4002, "上传文件超过%s,请重新上传!"); - - public static final FileResponseCodeConst UNKNOWN_FILE_TYPE = new FileResponseCodeConst(4003, "未知的文件类型!"); - - public static final FileResponseCodeConst LOCAL_UPDATE_PREFIX_ERROR = new FileResponseCodeConst(4004, "文件本地上传缺少URL前缀配置[local_upload_url_prefix]"); - - public static final FileResponseCodeConst UPLOAD_ERROR = new FileResponseCodeConst(4005, "上传失败"); - - public static final FileResponseCodeConst URL_ERROR = new FileResponseCodeConst(4006, "获取URL失败"); - - public static final FileResponseCodeConst FILE_MODULE_ERROR = new FileResponseCodeConst(4007, "文件目录类型错误"); - - public FileResponseCodeConst(int code, String msg) { - super(code, msg); - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/constant/FileServiceNameConst.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/constant/FileServiceNameConst.java deleted file mode 100644 index 012cffbf..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/constant/FileServiceNameConst.java +++ /dev/null @@ -1,24 +0,0 @@ -package net.lab1024.smartadmin.module.support.file.constant; -/** - * 文件服务名称常量 - * - * @author listen - * @date 2019/08/27 15:24 - */ -public class FileServiceNameConst { - - /** - * 阿里OSS文件服务 - */ - public static final String ALI_OSS = "ali_oss"; - - /** - * 七牛文件服务 - */ - public static final String QI_NIU_OSS = "qi_niu_oss"; - - /** - * 本地文件服务 - */ - public static final String LOCAL = "local"; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/constant/FileServiceTypeEnum.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/constant/FileServiceTypeEnum.java deleted file mode 100644 index 793503fc..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/constant/FileServiceTypeEnum.java +++ /dev/null @@ -1,52 +0,0 @@ -package net.lab1024.smartadmin.module.support.file.constant; - -import net.lab1024.smartadmin.common.domain.BaseEnum; - -/** - * 文件服务枚举类 - * - * @author listen - * @date 2019年8月27日 14:27:16 - */ -public enum FileServiceTypeEnum implements BaseEnum { - - /** - * 本地文件服务 - */ - LOCAL(1, FileServiceNameConst.LOCAL, "本地文件服务"), - - /** - * 阿里OSS文件服务 - */ - ALI_OSS(2, FileServiceNameConst.ALI_OSS, "阿里OSS文件服务"), - - /** - * 七牛文件服务 - */ - QI_NIU_OSS(3, FileServiceNameConst.QI_NIU_OSS, "七牛文件服务"); - - private Integer locationType; - - private String serviceName; - - private String desc; - - FileServiceTypeEnum(Integer locationType, String serviceName, String desc) { - this.locationType = locationType; - this.serviceName = serviceName; - this.desc = desc; - } - - public String getServiceName() { - return serviceName; - } - @Override - public Integer getValue() { - return this.locationType; - } - - @Override - public String getDesc() { - return this.desc; - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/domain/dto/FileAddDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/domain/dto/FileAddDTO.java deleted file mode 100644 index b097df0a..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/domain/dto/FileAddDTO.java +++ /dev/null @@ -1,39 +0,0 @@ -package net.lab1024.smartadmin.module.support.file.domain.dto; - -import net.lab1024.smartadmin.common.anno.ApiModelPropertyEnum; -import net.lab1024.smartadmin.common.validator.en.CheckEnum; -import net.lab1024.smartadmin.module.support.file.constant.FileServiceTypeEnum; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotBlank; - -/** -* @Description: 文件保存DTO -* @Author: sbq -* @CreateDate: 2019/9/11 15:05 -* @Version: 1.0 -*/ -@Data -public class FileAddDTO { - - @ApiModelProperty("相关业务id(无业务可写死一个id)") - @NotBlank(message = "相关业务id不能为空") - private String moduleId; - - @ApiModelProperty("相关业务类型(无模块写1)") - @NotBlank(message = "相关业务类型不能为空") - private String moduleType; - - @ApiModelPropertyEnum(enumDesc = "文件类型",value = FileServiceTypeEnum.class) - @CheckEnum(enumClazz = FileServiceTypeEnum.class,message = "文件类型错误") - private Integer fileLocationType; - - @ApiModelProperty("文件名称") - @NotBlank(message = "文件名称不能为空") - private String fileName; - - @ApiModelProperty("文件路径") - @NotBlank(message = "文件路径不能为空") - private String filePath; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/domain/dto/FileDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/domain/dto/FileDTO.java deleted file mode 100644 index 16491d85..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/domain/dto/FileDTO.java +++ /dev/null @@ -1,58 +0,0 @@ -package net.lab1024.smartadmin.module.support.file.domain.dto; - -import net.lab1024.smartadmin.common.anno.ApiModelPropertyEnum; -import net.lab1024.smartadmin.module.support.file.constant.FileServiceTypeEnum; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.sql.Date; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - * @since JDK1.8 - */ -@Data -public class FileDTO { - - @ApiModelProperty("主键") - private Long id; - - @ApiModelProperty("相关业务id") - private String moduleId; - - @ApiModelProperty("相关业务类型") - private String moduleType; - - @ApiModelPropertyEnum(FileServiceTypeEnum.class) - private Integer fileLocationType; - - @ApiModelProperty("文件名称") - private String fileName; - - @ApiModelProperty("文件大小") - private String fileSize; - - @ApiModelProperty("文件类型") - private String fileType; - - @ApiModelProperty("文件路径") - private String filePath; - - @ApiModelProperty("上传人") - private Long createUser; - - @ApiModelProperty("updateTime") - private Date updateTime; - - @ApiModelProperty("创建时间") - private Date createTime; - - @ApiModelProperty("文件展示url(可用于下载,注:七牛云下载url要拼接 ?attname=文件名.jpg)") - private String fileUrl; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/domain/dto/FileQueryDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/domain/dto/FileQueryDTO.java deleted file mode 100644 index 85df6375..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/domain/dto/FileQueryDTO.java +++ /dev/null @@ -1,33 +0,0 @@ -package net.lab1024.smartadmin.module.support.file.domain.dto; - -import net.lab1024.smartadmin.common.anno.ApiModelPropertyEnum; -import net.lab1024.smartadmin.common.domain.PageParamDTO; -import net.lab1024.smartadmin.common.validator.en.CheckEnum; -import net.lab1024.smartadmin.module.support.file.constant.FileModuleTypeEnum; -import net.lab1024.smartadmin.module.support.file.constant.FileServiceTypeEnum; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * @Description: 文件信息查询dto - * @Author: sbq - * @CreateDate: 2019/7/3 17:38 - * @Version: 1.0 - */ -@Data -public class FileQueryDTO extends PageParamDTO { - - @ApiModelProperty(value = "文件名称") - private String fileName; - - @ApiModelProperty(value = "业务类型") - @ApiModelPropertyEnum(FileModuleTypeEnum.class) - @CheckEnum(enumClazz = FileModuleTypeEnum.class, message = "文件业务类型错误") - private Integer moduleType; - - @ApiModelProperty(value = "文件位置") - @ApiModelPropertyEnum(FileServiceTypeEnum.class) - @CheckEnum(enumClazz = FileServiceTypeEnum.class, message = "文件位置类型错误") - private Integer fileLocationType; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/domain/dto/OSSConfig.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/domain/dto/OSSConfig.java deleted file mode 100644 index 112ad4eb..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/domain/dto/OSSConfig.java +++ /dev/null @@ -1,35 +0,0 @@ -package net.lab1024.smartadmin.module.support.file.domain.dto; - -import lombok.Data; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/5/11 0011 下午 16:05 - * @since JDK1.8 - */ -@Data -public class OSSConfig { - - private String endpoint; - - private String accessKeyId; - - private String accessKeySecret; - - private String bucketName; - - @Override - public String toString() { - return "OSSConfig{" + - "endpoint='" + endpoint + '\'' + - ", accessKeyId='" + accessKeyId + '\'' + - ", accessKeySecret='" + accessKeySecret + '\'' + - ", bucketName='" + bucketName + '\'' + - '}'; - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/domain/entity/FileEntity.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/domain/entity/FileEntity.java deleted file mode 100644 index 38b0db3d..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/domain/entity/FileEntity.java +++ /dev/null @@ -1,58 +0,0 @@ -package net.lab1024.smartadmin.module.support.file.domain.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import net.lab1024.smartadmin.common.domain.BaseEntity; -import lombok.Data; - - -/** - * - * [ ] - * - * @version 1.0 - * @since JDK1.8 - * @author yandanyang - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - */ -@Data -@TableName(value = "t_file") -public class FileEntity extends BaseEntity { - - - /** - * 相关业务id - */ - private String moduleId; - /** - * 相关业务类型 - */ - private String moduleType; - /** - * 文件位置类型 - */ - private Integer fileLocationType; - /** - * 文件名称 - */ - private String fileName; - /** - * 文件大小 - */ - private String fileSize; - /** - * 文件类型,程序中枚举控制,文件类型:如身份证正面,三证合一等等 - */ - private String fileType; - /** - * 文件key,用于文件下载 - */ - private String filePath; - /** - * 创建人,即上传人 - */ - private Long createrUser; - -} - diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/domain/vo/FileVO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/domain/vo/FileVO.java deleted file mode 100644 index 7f101482..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/domain/vo/FileVO.java +++ /dev/null @@ -1,58 +0,0 @@ -package net.lab1024.smartadmin.module.support.file.domain.vo; - -import net.lab1024.smartadmin.common.anno.ApiModelPropertyEnum; -import net.lab1024.smartadmin.module.support.file.constant.FileServiceTypeEnum; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.sql.Date; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - * @since JDK1.8 - */ -@Data -public class FileVO { - - @ApiModelProperty("主键") - private Long id; - - @ApiModelProperty("相关业务id") - private String moduleId; - - @ApiModelProperty("相关业务类型") - private String moduleType; - - @ApiModelPropertyEnum(FileServiceTypeEnum.class) - private Integer fileLocationType; - - @ApiModelProperty("文件名称") - private String fileName; - - @ApiModelProperty("文件大小") - private String fileSize; - - @ApiModelProperty("文件类型") - private String fileType; - - @ApiModelProperty("文件路径") - private String filePath; - - @ApiModelProperty("上传人") - private Long createUser; - - @ApiModelProperty("updateTime") - private Date updateTime; - - @ApiModelProperty("创建时间") - private Date createTime; - - @ApiModelProperty("文件展示url(可用于下载,注:七牛云下载url要拼接 ?attname=文件名.jpg)") - private String fileUrl; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/domain/vo/UploadVO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/domain/vo/UploadVO.java deleted file mode 100644 index f878e7a7..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/domain/vo/UploadVO.java +++ /dev/null @@ -1,27 +0,0 @@ -package net.lab1024.smartadmin.module.support.file.domain.vo; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2018/12/11 0011 上午 10:57 - * @since JDK1.8 - */ -@Data -public class UploadVO { - - @ApiModelProperty(value = "文件名称") - private String fileName; - @ApiModelProperty(value = "url") - private String url; - @ApiModelProperty(value = "filePath") - private String filePath; - @ApiModelProperty(value = "文件大小") - private Long fileSize; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/service/FileService.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/service/FileService.java deleted file mode 100644 index 9f645620..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/service/FileService.java +++ /dev/null @@ -1,198 +0,0 @@ -package net.lab1024.smartadmin.module.support.file.service; - -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import net.lab1024.smartadmin.common.domain.PageResultDTO; -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.module.support.file.FileDao; -import net.lab1024.smartadmin.module.support.file.constant.FileModuleTypeEnum; -import net.lab1024.smartadmin.module.support.file.constant.FileResponseCodeConst; -import net.lab1024.smartadmin.module.support.file.constant.FileServiceTypeEnum; -import net.lab1024.smartadmin.module.support.file.domain.dto.FileAddDTO; -import net.lab1024.smartadmin.module.support.file.domain.dto.FileDTO; -import net.lab1024.smartadmin.module.support.file.domain.dto.FileQueryDTO; -import net.lab1024.smartadmin.module.support.file.domain.entity.FileEntity; -import net.lab1024.smartadmin.module.support.file.domain.vo.FileVO; -import net.lab1024.smartadmin.module.support.file.domain.vo.UploadVO; -import net.lab1024.smartadmin.module.system.login.domain.RequestTokenBO; -import net.lab1024.smartadmin.util.SmartBaseEnumUtil; -import net.lab1024.smartadmin.util.SmartBeanUtil; -import net.lab1024.smartadmin.util.SmartPageUtil; -import com.google.common.collect.Lists; -import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Service; -import org.springframework.web.multipart.MultipartFile; - -import javax.servlet.http.HttpServletRequest; -import java.time.LocalDateTime; -import java.util.Arrays; -import java.util.Date; -import java.util.List; -import java.util.stream.Collectors; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - * @since JDK1.8 - */ -@Service -public class FileService { - - @Autowired - private FileDao fileDao; - - @Autowired - private java.util.Map fileServiceMap; - - /** - * 获取文件服务实现 - * - * @param typeEnum - * @return - */ - private IFileService getFileService(FileServiceTypeEnum typeEnum) { - /** - * 获取文件服务 - */ - String serviceName = typeEnum.getServiceName(); - IFileService fileService = fileServiceMap.get(serviceName); - if (null == fileService) { - throw new RuntimeException("未找到文件服务实现类:" + serviceName); - } - return fileService; - } - - /** - * 文件上传服务 - * - * @param file - * @param typeEnum 文件服务类型枚举类 - * @param moduleType 文件夹类型 - * @return - */ - public ResponseDTO fileUpload(MultipartFile file, FileServiceTypeEnum typeEnum, Integer moduleType) { - FileModuleTypeEnum moduleTypeEnum = SmartBaseEnumUtil.getEnumByValue(moduleType, FileModuleTypeEnum.class); - if (null == moduleTypeEnum) { - return ResponseDTO.wrap(FileResponseCodeConst.FILE_MODULE_ERROR); - } - // 获取文件服务 - IFileService fileService = this.getFileService(typeEnum); - ResponseDTO response = fileService.fileUpload(file, moduleTypeEnum.getPath()); - return response; - } - - /** - * 根据文件绝对路径 获取文件URL - * - * @param path - * @return - */ - public ResponseDTO getFileUrl(String path, FileServiceTypeEnum typeEnum) { - IFileService fileService = this.getFileService(typeEnum); - return fileService.getFileUrl(path); - } - - /** - * 批量插入 - * - * @param fileDTOList - */ - public void insertFileBatch(List fileDTOList) { - fileDao.insertFileBatch(fileDTOList); - } - - /** - * 根据module 删除文件信息 - * - * @param moduleId - * @return - */ - public void deleteFilesByModuleId(String moduleId) { - fileDao.deleteFilesByModuleId(moduleId); - } - - /** - * 根据module 获取文件信息 - * - * @param moduleId - * @return - */ - public List listFilesByModuleId(String moduleId) { - return fileDao.listFilesByModuleId(moduleId); - } - - /** - * @param filesStr 逗号分隔文件id字符串 - * @return - */ - public List getFileDTOList(String filesStr) { - if (StringUtils.isEmpty(filesStr)) { - return Lists.newArrayList(); - } - String[] fileIds = filesStr.split(","); - List fileIdList = Arrays.asList(fileIds).stream().map(e -> Long.valueOf(e)).collect(Collectors.toList()); - List files = fileDao.listFilesByFileIds(fileIdList); - return files; - } - - /** - * 分页查询文件列表 - * - * @param queryDTO - * @return - */ - public ResponseDTO> queryListByPage(FileQueryDTO queryDTO) { - Page page = SmartPageUtil.convert2QueryPage(queryDTO); - List fileList = fileDao.queryListByPage(page, queryDTO); - if (CollectionUtils.isNotEmpty(fileList)) { - fileList.forEach(e -> { - // 根据文件服务类 获取对应文件服务 查询 url - FileServiceTypeEnum serviceTypeEnum = SmartBaseEnumUtil.getEnumByValue(e.getFileLocationType(), FileServiceTypeEnum.class); - IFileService fileService = this.getFileService(serviceTypeEnum); - e.setFileUrl(fileService.getFileUrl(e.getFilePath()).getData()); - }); - } - PageResultDTO pageResultDTO = SmartPageUtil.convert2PageResult(page, fileList); - return ResponseDTO.succData(pageResultDTO); - } - - /** - * 根据id 下载文件 - * - * @param id - * @param request - * @return - */ - public ResponseEntity downLoadById(Long id, HttpServletRequest request) { - FileEntity entity = fileDao.selectById(id); - if (null == entity) { - throw new RuntimeException("文件信息不存在"); - } - - // 根据文件服务类 获取对应文件服务 查询 url - FileServiceTypeEnum serviceTypeEnum = SmartBaseEnumUtil.getEnumByValue(entity.getFileLocationType(), FileServiceTypeEnum.class); - IFileService fileService = this.getFileService(serviceTypeEnum); - ResponseEntity stream = fileService.fileDownload(entity.getFilePath(), entity.getFileName(), request); - return stream; - } - - /** - * 系统文件保存通用接口 - * @param addDTO - * @return - */ - public ResponseDTO saveFile(FileAddDTO addDTO, RequestTokenBO requestToken) { - FileEntity entity = SmartBeanUtil.copy(addDTO,FileEntity.class); - entity.setCreaterUser(requestToken.getRequestUserId()); - entity.setCreateTime(new Date()); - fileDao.insert(entity); - return ResponseDTO.succ(); - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/service/FileServiceAliYun.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/service/FileServiceAliYun.java deleted file mode 100644 index 15ae3feb..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/service/FileServiceAliYun.java +++ /dev/null @@ -1,182 +0,0 @@ -package net.lab1024.smartadmin.module.support.file.service; - -import com.aliyun.oss.OSSClient; -import com.aliyun.oss.model.OSSObject; -import com.aliyun.oss.model.ObjectMetadata; -import com.aliyun.oss.model.PutObjectRequest; -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.module.support.file.constant.FileResponseCodeConst; -import net.lab1024.smartadmin.module.support.file.constant.FileServiceNameConst; -import net.lab1024.smartadmin.module.support.file.domain.dto.OSSConfig; -import net.lab1024.smartadmin.module.support.file.domain.vo.UploadVO; -import net.lab1024.smartadmin.module.system.systemconfig.SystemConfigService; -import net.lab1024.smartadmin.module.system.systemconfig.constant.SystemConfigEnum; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Service; -import org.springframework.util.FileCopyUtils; -import org.springframework.web.multipart.MultipartFile; - -import javax.servlet.http.HttpServletRequest; -import java.io.ByteArrayInputStream; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/5/10 0010 上午 8:29 - * @since JDK1.8 - */ -@Slf4j -@Service(FileServiceNameConst.ALI_OSS) -public class FileServiceAliYun implements IFileService { - - @Autowired - private SystemConfigService systemConfigService; - - OSSClient ossClient = null; - - String accessConfig = null; - - @Override - public ResponseDTO fileUpload(MultipartFile multipartFile, String path) { - OSSConfig ossConfig = systemConfigService.selectByKey2Obj(SystemConfigEnum.Key.ALI_OSS.name(), OSSConfig.class); - try { - InputStream inputStream = new ByteArrayInputStream(multipartFile.getBytes()); - if (! ossConfig.toString().equals(accessConfig)) { - //accessKeyId 发生变动自动创建新的 - if (ossClient != null) { - ossClient.shutdown(); - } - ossClient = new OSSClient(ossConfig.getEndpoint(), ossConfig.getAccessKeyId(), ossConfig.getAccessKeySecret()); - accessConfig = ossConfig.toString(); - } - String uuid = UUID.randomUUID().toString().replace("-", ""); - String ossPath = path + "/" + uuid; - String fileName = multipartFile.getOriginalFilename(); - String fileExt = fileName.substring(fileName.lastIndexOf(".") + 1); - ObjectMetadata meta = new ObjectMetadata(); - meta.setContentDisposition("attachment;filename=" + fileName); - Map userMetadata = new HashMap(); - userMetadata.put("fileName", fileName); - userMetadata.put("fileExt", fileExt); - userMetadata.put("fileSize", String.valueOf(multipartFile.getSize())); - meta.setUserMetadata(userMetadata); - meta.setContentType(this.getContentType(fileExt)); - PutObjectRequest putObjectRequest = new PutObjectRequest(ossConfig.getBucketName(), ossPath, inputStream, meta); - ossClient.putObject(putObjectRequest); - UploadVO localUploadVO = new UploadVO(); - localUploadVO.setUrl(this.getUrl(ossPath, ossConfig.getBucketName(), ossClient)); - localUploadVO.setFileName(fileName); - localUploadVO.setFilePath(ossPath); - localUploadVO.setFileSize(multipartFile.getSize()); - return ResponseDTO.succData(localUploadVO); - } catch (Exception e) { - log.error("ALI UPLOAD ERROR : {}", e); - } - return ResponseDTO.wrap(FileResponseCodeConst.UPLOAD_ERROR); - } - - @Override - public ResponseDTO getFileUrl(String path) { - OSSConfig ossConfig = systemConfigService.selectByKey2Obj(SystemConfigEnum.Key.ALI_OSS.name(), OSSConfig.class); - try { - if (! ossConfig.toString().equals(accessConfig)) { - //accessKeyId 发生变动自动创建新的 - if (ossClient != null) { - ossClient.shutdown(); - } - ossClient = new OSSClient(ossConfig.getEndpoint(), ossConfig.getAccessKeyId(), ossConfig.getAccessKeySecret()); - accessConfig = ossConfig.toString(); - } - String url = this.getUrl(path, ossConfig.getBucketName(), ossClient); - return ResponseDTO.succData(url); - } catch (Exception e) { - log.error("ALI getFileUrl ERROR : {}", e); - } - return ResponseDTO.wrap(FileResponseCodeConst.URL_ERROR); - } - - private String getUrl(String path, String bucketName, OSSClient ossClient) { - Date expiration = new Date(System.currentTimeMillis() + (60 * 60 * 1000)); - URL url = ossClient.generatePresignedUrl(bucketName, path, expiration); - return url.toString(); - } - - /** - * 流式下载(名称为原文件) - */ - @Override - public ResponseEntity fileDownload(String key, String fileName, HttpServletRequest request) { - File file = this.getFile(key, fileName); - if (file == null) { - throw new RuntimeException("文件不存在"); - } - return this.downloadMethod(file, request); - } - - /** - * 根据osskey获取文件 - * - * @param key - * @return - */ - public File getFile(String key, String fileName) { - OSSConfig ossConfig = systemConfigService.selectByKey2Obj(SystemConfigEnum.Key.ALI_OSS.name(), OSSConfig.class); - if (! ossConfig.toString().equals(accessConfig)) { - //accessKeyId 发生变动自动创建新的 - if (ossClient != null) { - ossClient.shutdown(); - } - ossClient = new OSSClient(ossConfig.getEndpoint(), ossConfig.getAccessKeyId(), ossConfig.getAccessKeySecret()); - accessConfig = ossConfig.toString(); - } - //获取oss对象 - OSSObject ossObject = ossClient.getObject(ossConfig.getBucketName(), key); - if (StringUtils.isBlank(fileName)) { - // 获取元信息 - ObjectMetadata objectMetadata = ossObject.getObjectMetadata(); - // 获取下载时文件名 - Map userMetadata = objectMetadata.getUserMetadata(); - fileName = userMetadata == null ? "" : userMetadata.get("filename"); - if (StringUtils.isBlank(fileName)) { - fileName = objectMetadata.getContentDisposition(); - } - } - // 创建文件 - File file = new File(fileName); - // 获得输入流 - InputStream objectContent = ossObject.getObjectContent(); - try { - // 输入流转换为字节流 - byte[] buffer = FileCopyUtils.copyToByteArray(objectContent); - // 字节流写入文件 - FileCopyUtils.copy(buffer, file); - // 关闭输入流 - objectContent.close(); - } catch (IOException e) { - log.error("文件获取失败:" + e); - return null; - } finally { - try { - ossObject.close(); - } catch (IOException e) { - log.error("", e); - } - } - return file; - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/service/FileServiceLocal.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/service/FileServiceLocal.java deleted file mode 100644 index 08aac36d..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/service/FileServiceLocal.java +++ /dev/null @@ -1,123 +0,0 @@ -package net.lab1024.smartadmin.module.support.file.service; - -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.module.support.file.constant.FileResponseCodeConst; -import net.lab1024.smartadmin.module.support.file.constant.FileServiceNameConst; -import net.lab1024.smartadmin.module.support.file.domain.vo.UploadVO; -import net.lab1024.smartadmin.module.system.systemconfig.SystemConfigDao; -import net.lab1024.smartadmin.module.system.systemconfig.constant.SystemConfigEnum; -import net.lab1024.smartadmin.module.system.systemconfig.domain.entity.SystemConfigEntity; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Service; -import org.springframework.web.multipart.MultipartFile; - -import javax.servlet.http.HttpServletRequest; -import java.io.File; -import java.io.IOException; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/5/11 0011 下午 16:15 - * @since JDK1.8 - */ -@Slf4j -@Service(FileServiceNameConst.LOCAL) -public class FileServiceLocal implements IFileService { - - @Autowired - private SystemConfigDao systemConfigDao; - - @Value("${spring.servlet.multipart.max-file-size}") - private String maxFileSize; - - @Value("${file-upload-service.path}") - private String fileParentPath; - - private static final Long DEFAULT_SIZE = 10 * 1024 * 1024L; - - @Override - public ResponseDTO fileUpload(MultipartFile multipartFile, String path) { - if (null == multipartFile) { - return ResponseDTO.wrap(FileResponseCodeConst.FILE_EMPTY); - } - Long maxSize = DEFAULT_SIZE; - if (StringUtils.isNotEmpty(maxFileSize)) { - String maxSizeStr = maxFileSize.toLowerCase().replace("mb", ""); - maxSize = Integer.valueOf(maxSizeStr) * 1024 * 1024L; - } - if (multipartFile.getSize() > maxSize) { - return ResponseDTO.wrap(FileResponseCodeConst.FILE_SIZE_ERROR, String.format(FileResponseCodeConst.FILE_SIZE_ERROR.getMsg(), maxFileSize)); - } - String filePath = fileParentPath; - String urlParent = this.localUrlPrefix(); - if (urlParent == null) { - return ResponseDTO.wrap(FileResponseCodeConst.LOCAL_UPDATE_PREFIX_ERROR); - } - if (StringUtils.isNotEmpty(path)) { - filePath = filePath + path + "/"; - urlParent = urlParent + path + "/"; - } - File directory = new File(filePath); - if (!directory.exists()) { - // 目录不存在,新建 - directory.mkdirs(); - } - UploadVO localUploadVO = new UploadVO(); - String newFileName; - File fileTemp; - String originalFileName; - originalFileName = multipartFile.getOriginalFilename(); - newFileName = this.generateFileName(originalFileName); - fileTemp = new File(new File(filePath + newFileName).getAbsolutePath()); - try { - multipartFile.transferTo(fileTemp); - localUploadVO.setUrl(urlParent + newFileName); - localUploadVO.setFileName(newFileName); - localUploadVO.setFilePath(path + "/" + newFileName); - localUploadVO.setFileSize(multipartFile.getSize()); - } catch (IOException e) { - if (fileTemp.exists() && fileTemp.isFile()) { - fileTemp.delete(); - } - log.error("", e); - return ResponseDTO.wrap(FileResponseCodeConst.UPLOAD_ERROR); - } - return ResponseDTO.succData(localUploadVO); - } - - @Override - public ResponseDTO getFileUrl(String path) { - String urlParent = this.localUrlPrefix(); - if (urlParent == null) { - return ResponseDTO.wrap(FileResponseCodeConst.LOCAL_UPDATE_PREFIX_ERROR); - } - String url = urlParent + path; - return ResponseDTO.succData(url); - } - - private String localUrlPrefix() { - SystemConfigEntity configEntity = systemConfigDao.getByKey(SystemConfigEnum.Key.LOCAL_UPLOAD_URL_PREFIX.name()); - if (configEntity == null) { - return null; - } - return configEntity.getConfigValue(); - } - - @Override - public ResponseEntity fileDownload(String key, String fileName, HttpServletRequest request) { - - String url = fileParentPath + key; - // 创建文件 - File file = new File(url); - return this.downloadMethod(file, request); - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/service/FileServiceQiNiuYun.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/service/FileServiceQiNiuYun.java deleted file mode 100644 index 394b7af8..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/service/FileServiceQiNiuYun.java +++ /dev/null @@ -1,175 +0,0 @@ -package net.lab1024.smartadmin.module.support.file.service; - -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.module.support.file.constant.FileResponseCodeConst; -import net.lab1024.smartadmin.module.support.file.constant.FileServiceNameConst; -import net.lab1024.smartadmin.module.support.file.domain.dto.OSSConfig; -import net.lab1024.smartadmin.module.support.file.domain.vo.UploadVO; -import net.lab1024.smartadmin.module.system.systemconfig.SystemConfigService; -import net.lab1024.smartadmin.module.system.systemconfig.constant.SystemConfigEnum; -import com.qiniu.http.Response; -import com.qiniu.storage.Configuration; -import com.qiniu.storage.UploadManager; -import com.qiniu.util.Auth; -import lombok.extern.slf4j.Slf4j; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.ResponseBody; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Service; -import org.springframework.util.FileCopyUtils; -import org.springframework.web.multipart.MultipartFile; - -import javax.servlet.http.HttpServletRequest; -import java.io.ByteArrayInputStream; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.net.URLEncoder; -import java.util.UUID; - -/** - * [ 七牛云 ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/5/10 0010 上午 8:30 - * @since JDK1.8 - */ -@Slf4j -@Service(FileServiceNameConst.QI_NIU_OSS) -public class FileServiceQiNiuYun implements IFileService { - - //1小时,可以自定义链接过期时间 - private static final Long expireInSeconds = 3600L; - - @Autowired - private SystemConfigService systemConfigService; - - UploadManager ossClient = null; - - String accessConfig = null; - - String token = null; - - @Override - public ResponseDTO fileUpload(MultipartFile multipartFile, String path) { - OSSConfig ossConfig = systemConfigService.selectByKey2Obj(SystemConfigEnum.Key.QI_NIU_OSS.name(), OSSConfig.class); - try { - InputStream inputStream = new ByteArrayInputStream(multipartFile.getBytes()); - if (! ossConfig.toString().equals(accessConfig)) { - //accessKeyId 发生变动自动重新创建新的UploadManager - ossClient = new UploadManager(new Configuration()); - token = Auth.create(ossConfig.getAccessKeyId(), ossConfig.getAccessKeySecret()). - uploadToken(ossConfig.getBucketName()); - accessConfig = ossConfig.toString(); - } - String uuid = UUID.randomUUID().toString().replace("-", ""); - String ossPath = path + "/" + uuid; - String fileName = multipartFile.getOriginalFilename(); - String fileExt = fileName.substring(fileName.lastIndexOf(".") + 1); - String mime = this.getContentType(fileExt); - Response res = ossClient.put(inputStream, ossPath, token, null, mime); - if (! res.isOK()) { - log.error("QINIU fileUpload ERROR : {}", res.toString()); - return ResponseDTO.wrap(FileResponseCodeConst.UPLOAD_ERROR); - } - UploadVO localUploadVO = new UploadVO(); - localUploadVO.setUrl(this.getFileUrl(ossPath).getData()); - localUploadVO.setFileName(fileName); - localUploadVO.setFilePath(ossPath); - localUploadVO.setFileSize(multipartFile.getSize()); - return ResponseDTO.succData(localUploadVO); - } catch (Exception e) { - log.error("QINIU fileUpload ERROR : {}", e); - } - return ResponseDTO.wrap(FileResponseCodeConst.UPLOAD_ERROR); - } - - @Override - public ResponseDTO getFileUrl(String path) { - OSSConfig ossConfig = systemConfigService.selectByKey2Obj(SystemConfigEnum.Key.QI_NIU_OSS.name(), OSSConfig.class); - try { - if (! ossConfig.toString().equals(accessConfig)) { - //accessKeyId 发生变动自动重新创建新的UploadManager - ossClient = new UploadManager(new Configuration()); - token = Auth.create(ossConfig.getAccessKeyId(), ossConfig.getAccessKeySecret()). - uploadToken(ossConfig.getBucketName()); - accessConfig = ossConfig.toString(); - } - String encodedFileName = URLEncoder.encode(path, "utf-8"); - String domainOfBucket = ossConfig.getEndpoint(); - String publicUrl = String.format("%s/%s", domainOfBucket, encodedFileName); - String accessKey = ossConfig.getAccessKeyId(); - String secretKey = ossConfig.getAccessKeySecret(); - Auth auth = Auth.create(accessKey, secretKey); - //1小时,可以自定义链接过期时间 - long expireInSeconds = 3600; - String finalUrl = auth.privateDownloadUrl(publicUrl, expireInSeconds); - return ResponseDTO.succData(finalUrl); - } catch (Exception e) { - log.error("QINIU getFileUrl ERROR : {}", e); - } - return ResponseDTO.wrap(FileResponseCodeConst.URL_ERROR); - } - - @Override - public ResponseEntity fileDownload(String key, String fileName, HttpServletRequest request) { - File file = this.getFile(key, fileName); - if (file == null) { - throw new RuntimeException("文件不存在"); - } - return this.downloadMethod(file, request); - } - - /** - * 获取下载路径 - */ - public String getDownloadUrl(String key) { - OSSConfig ossConfig = systemConfigService.selectByKey2Obj(SystemConfigEnum.Key.QI_NIU_OSS.name(), OSSConfig.class); - String domainOfBucket = ossConfig.getEndpoint(); - String finalUrl = ""; - try { - String encodedFileName = URLEncoder.encode(key, "utf-8").replace("+", "%20"); - String publicUrl = String.format("%s/%s", domainOfBucket, encodedFileName); - Auth auth = Auth.create(ossConfig.getAccessKeyId(), ossConfig.getAccessKeySecret()); - finalUrl = auth.privateDownloadUrl(publicUrl, expireInSeconds); - } catch (Exception e) { - log.error("QINIU download ERROR : {}", e); - } - return finalUrl; - } - - /** - * 获取文件 - */ - public File getFile(String key, String fileName) { - String finalUrl = getDownloadUrl(key); - OkHttpClient client = new OkHttpClient(); - Request req = new Request.Builder().url(finalUrl).build(); - okhttp3.Response resp = null; - File file = new File(fileName); - try { - resp = client.newCall(req).execute(); - if (resp.isSuccessful()) { - ResponseBody body = resp.body(); - InputStream objectContent = body.byteStream(); - // 输入流转换为字节流 - byte[] buffer = FileCopyUtils.copyToByteArray(objectContent); - // 字节流写入文件 - FileCopyUtils.copy(buffer, file); - // 关闭输入流 - objectContent.close(); - } - - } catch (IOException e) { - log.error("文件获取失败:" + e); - return null; - } finally { - } - return file; - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/service/IFileService.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/service/IFileService.java deleted file mode 100644 index a818ae42..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/file/service/IFileService.java +++ /dev/null @@ -1,152 +0,0 @@ -package net.lab1024.smartadmin.module.support.file.service; - -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.module.support.file.domain.vo.UploadVO; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.util.FileCopyUtils; -import org.springframework.web.multipart.MultipartFile; - -import javax.servlet.http.HttpServletRequest; -import java.io.File; -import java.io.FileInputStream; -import java.io.InputStream; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; -import java.util.UUID; - -/** - * 文件服务接口 - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/5/11 0011 下午 16:42 - * @since JDK1.8 - */ -public interface IFileService { - - /** - * 文件上传 - * - * @param multipartFile - * @param path - * @return - */ - ResponseDTO fileUpload(MultipartFile multipartFile, String path); - - /** - * 获取文件url - * - * @param path - * @return - */ - ResponseDTO getFileUrl(String path); - - /** - * 文件下载 - * - * @param key - * @param fileName - * @param request - * @return - */ - ResponseEntity fileDownload(String key, String fileName, HttpServletRequest request); - - /** - * 生成文件名字 - * 当前年月日时分秒 +32位 uuid + 文件格式后缀 - * - * @param originalFileName - * @return String - */ - default String generateFileName(String originalFileName) { - String time = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddhhmms")); - String uuid = UUID.randomUUID().toString().replaceAll("-", ""); - String fileType = originalFileName.substring(originalFileName.lastIndexOf(".")); - return time + uuid + fileType; - } - - /** - * 获取文件类型 - * - * @param fileExt - * @return - */ - default String getContentType(String fileExt) { - // 文件的后缀名 - if ("bmp".equalsIgnoreCase(fileExt)) { - return "image/bmp"; - } - if ("gif".equalsIgnoreCase(fileExt)) { - return "image/gif"; - } - if ("jpeg".equalsIgnoreCase(fileExt) || "jpg".equalsIgnoreCase(fileExt) || ".png".equalsIgnoreCase(fileExt)) { - return "image/jpeg"; - } - if ("png".equalsIgnoreCase(fileExt)) { - return "image/png"; - } - if ("html".equalsIgnoreCase(fileExt)) { - return "text/html"; - } - if ("txt".equalsIgnoreCase(fileExt)) { - return "text/plain"; - } - if ("vsd".equalsIgnoreCase(fileExt)) { - return "application/vnd.visio"; - } - if ("ppt".equalsIgnoreCase(fileExt) || "pptx".equalsIgnoreCase(fileExt)) { - return "application/vnd.ms-powerpoint"; - } - if ("doc".equalsIgnoreCase(fileExt) || "docx".equalsIgnoreCase(fileExt)) { - return "application/msword"; - } - if ("xml".equalsIgnoreCase(fileExt)) { - return "text/xml"; - } - return ""; - } - - default ResponseEntity downloadMethod(File file, HttpServletRequest request) { - HttpHeaders heads = new HttpHeaders(); - heads.add(HttpHeaders.CONTENT_TYPE, "application/octet-stream; charset=utf-8"); - String fileName = file.getName(); - try { - if (request.getHeader("User-Agent").toLowerCase().indexOf("firefox") > 0) { - // firefox浏览器 - fileName = new String(fileName.getBytes("UTF-8"), "ISO8859-1"); - } else if (request.getHeader("User-Agent").toUpperCase().indexOf("MSIE") > 0) { - // IE浏览器 - fileName = URLEncoder.encode(fileName, "UTF-8"); - } else if (request.getHeader("User-Agent").toUpperCase().indexOf("EDGE") > 0) { - // WIN10浏览器 - fileName = URLEncoder.encode(fileName, "UTF-8"); - } else if (request.getHeader("User-Agent").toUpperCase().indexOf("CHROME") > 0) { - // 谷歌 - fileName = new String(fileName.getBytes("UTF-8"), "ISO8859-1"); - } else { - //万能乱码问题解决 - fileName = new String(fileName.getBytes("UTF-8"), "ISO-8859-1"); - } - } catch (UnsupportedEncodingException e) { - // log.error("", e); - } - heads.add(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + fileName); - try { - InputStream in = new FileInputStream(file); - // 输入流转换为字节流 - byte[] buffer = FileCopyUtils.copyToByteArray(in); - ResponseEntity responseEntity = new ResponseEntity<>(buffer, heads, HttpStatus.OK); - //file.delete(); - return responseEntity; - } catch (Exception e) { - // log.error("", e); - } - return null; - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/heartbeat/HeartBeatController.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/heartbeat/HeartBeatController.java deleted file mode 100644 index a9671255..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/heartbeat/HeartBeatController.java +++ /dev/null @@ -1,32 +0,0 @@ -package net.lab1024.smartadmin.module.support.heartbeat; - -import net.lab1024.smartadmin.common.anno.OperateLog; -import net.lab1024.smartadmin.common.domain.PageParamDTO; -import net.lab1024.smartadmin.common.domain.PageResultDTO; -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.constant.SwaggerTagConst; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; - -import javax.validation.Valid; - - -@Api(tags = {SwaggerTagConst.Admin.MANAGER_HEART_BEAT}) -@OperateLog -@RestController -public class HeartBeatController { - - @Autowired - private HeartBeatService heartBeatService; - - @PostMapping("/heartBeat/query") - @ApiOperation("查询心跳记录 @author zhuoda") - public ResponseDTO> query(@RequestBody @Valid PageParamDTO pageParamDTO){ - return heartBeatService.pageQuery(pageParamDTO); - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/heartbeat/HeartBeatRecordDao.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/heartbeat/HeartBeatRecordDao.java deleted file mode 100644 index e10c8e8c..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/heartbeat/HeartBeatRecordDao.java +++ /dev/null @@ -1,52 +0,0 @@ -package net.lab1024.smartadmin.module.support.heartbeat; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Component; - -import java.util.Date; -import java.util.List; - -/** - * 心跳日志数据库操作 - * - * @author : simajinqiang - * Date: 2018/7/9 - * Time: 17:37 - */ -@Component -@Mapper -public interface HeartBeatRecordDao extends BaseMapper { - - /** - * 新增心跳日志 - * - * @param heartBeatRecordEntity - */ - void insertHeartBeat(HeartBeatRecordEntity heartBeatRecordEntity); - - /** - * 更新心跳日志 - * - * @param id - * @param heartBeatTime - */ - void updateHeartBeatTimeById(@Param("id") Long id, @Param("heartBeatTime") Date heartBeatTime); - - /** - * 查询心跳日志 - * - * @param heartBeatRecordEntity - * @return - */ - HeartBeatRecordEntity query(HeartBeatRecordEntity heartBeatRecordEntity); - - - /** - * 分页查询心跳记录 - * @return - */ - List pageQuery(Page page); -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/heartbeat/HeartBeatRecordEntity.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/heartbeat/HeartBeatRecordEntity.java deleted file mode 100644 index 694eb936..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/heartbeat/HeartBeatRecordEntity.java +++ /dev/null @@ -1,42 +0,0 @@ -package net.lab1024.smartadmin.module.support.heartbeat; - -import com.baomidou.mybatisplus.annotation.TableName; -import net.lab1024.smartadmin.common.domain.BaseEntity; -import lombok.Data; - -import java.io.Serializable; -import java.util.Date; - -/** - * 心跳记录日志 - * User: simajinqiang - * Date: 2018/7/9 - * Time: 11:11 - */ -@Data -@TableName(value = "t_heart_beat_record") -public class HeartBeatRecordEntity extends BaseEntity implements Serializable { - - /** - * 项目名字 - */ - private String projectPath; - /** - * 服务器ip - */ - private String serverIp; - /** - * 进程号 - */ - private Integer processNo; - /** - * 进程开启时间 - */ - private Date processStartTime; - /** - * 心跳当前时间 - */ - private Date heartBeatTime; - - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/heartbeat/HeartBeatService.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/heartbeat/HeartBeatService.java deleted file mode 100644 index b474c174..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/heartbeat/HeartBeatService.java +++ /dev/null @@ -1,90 +0,0 @@ -package net.lab1024.smartadmin.module.support.heartbeat; - -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import net.lab1024.smartadmin.common.domain.PageParamDTO; -import net.lab1024.smartadmin.common.domain.PageResultDTO; -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.common.heartbeat.AbstractHeartBeatCommand; -import net.lab1024.smartadmin.common.heartbeat.HeartBeatConfig; -import net.lab1024.smartadmin.common.heartbeat.HeartBeatLogger; -import net.lab1024.smartadmin.common.heartbeat.HeartBeatRecordDTO; -import net.lab1024.smartadmin.config.SmartHeartBeatConfig; -import net.lab1024.smartadmin.util.SmartBeanUtil; -import net.lab1024.smartadmin.util.SmartPageUtil; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import javax.annotation.PostConstruct; -import javax.annotation.PreDestroy; -import java.util.List; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - * @since JDK1.8 - */ -@Slf4j -@Service -public class HeartBeatService extends AbstractHeartBeatCommand { - - @Autowired - private HeartBeatRecordDao heartBeatRecordDao; - - @Autowired - private SmartHeartBeatConfig heartBeatConfig; - - @PostConstruct - public void init() { - - HeartBeatConfig config = HeartBeatConfig.builder().delayHandlerTime(heartBeatConfig.getDelayHandlerTime()).intervalTime(heartBeatConfig.getIntervalTime()).build(); - - super.init(config, new HeartBeatLogger() { - @Override - public void error(String string) { - log.error(string); - } - - @Override - public void error(String string, Throwable e) { - log.error(string, e); - } - - @Override - public void info(String string) { - log.info(string); - } - }); - } - - @PreDestroy - @Override - public void destroy() { - super.destroy(); - } - - @Override - public void handler(HeartBeatRecordDTO heartBeatRecordDTO) { - HeartBeatRecordEntity heartBeatRecordEntity = SmartBeanUtil.copy(heartBeatRecordDTO, HeartBeatRecordEntity.class); - HeartBeatRecordEntity heartBeatRecordOld = heartBeatRecordDao.query(heartBeatRecordEntity); - if (heartBeatRecordOld == null) { - heartBeatRecordDao.insertHeartBeat(heartBeatRecordEntity); - } else { - heartBeatRecordDao.updateHeartBeatTimeById(heartBeatRecordOld.getId(), heartBeatRecordEntity.getHeartBeatTime()); - } - - } - - public ResponseDTO> pageQuery(PageParamDTO pageParamDTO) { - Page pageQueryInfo = SmartPageUtil.convert2QueryPage(pageParamDTO); - List recordVOList = heartBeatRecordDao.pageQuery(pageQueryInfo); - PageResultDTO pageResultDTO = SmartPageUtil.convert2PageResult(pageQueryInfo, recordVOList); - return ResponseDTO.succData(pageResultDTO); - - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/idgenerator/IdGeneratorDao.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/idgenerator/IdGeneratorDao.java deleted file mode 100644 index e6e1341e..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/idgenerator/IdGeneratorDao.java +++ /dev/null @@ -1,36 +0,0 @@ -package net.lab1024.smartadmin.module.support.idgenerator; - - -import net.lab1024.smartadmin.module.support.idgenerator.domain.IdGeneratorEntity; -import net.lab1024.smartadmin.module.support.idgenerator.domain.IdGeneratorLastNumberDTO; -import net.lab1024.smartadmin.module.support.idgenerator.domain.IdGeneratorRecordDTO; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * - * zhuo - */ -@Mapper -public interface IdGeneratorDao { - - IdGeneratorLastNumberDTO selectLastNumber(Long id); - - List selectAll(); - - void updateLastNumber(@Param("generatorId") Long generatorId, @Param("lastNumber") Long lastNumber); - - int replaceIdGeneratorRecord(@Param("generatorId") Long generatorId,// - @Param("year") int year,// - @Param("month") int month,// - @Param("day") int day,// - @Param("lastNumber") Long lastNumber); - - IdGeneratorRecordDTO selectHistoryLastNumber(@Param("generatorId") Long generatorId, - @Param("year") int year, - @Param("month") int month, - @Param("day") int day); - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/idgenerator/IdGeneratorManager.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/idgenerator/IdGeneratorManager.java deleted file mode 100644 index 1b2a926d..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/idgenerator/IdGeneratorManager.java +++ /dev/null @@ -1,66 +0,0 @@ -package net.lab1024.smartadmin.module.support.idgenerator; - -import net.lab1024.smartadmin.common.exception.SmartBusinessException; -import net.lab1024.smartadmin.module.support.idgenerator.domain.IdGeneratorLastNumberDTO; -import net.lab1024.smartadmin.module.support.idgenerator.domain.IdGeneratorPOJO; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.text.SimpleDateFormat; -import java.time.LocalDate; -import java.util.Date; - -/** - * 全局id生成器 - * zhuo - */ -@Service -public class IdGeneratorManager { - - @Autowired - private IdGeneratorDao idGeneratorDao; - - @Transactional(rollbackFor = Exception.class) - public long[] generate(IdGeneratorPOJO idGeneratorPOJO, int stepLength) { - IdGeneratorLastNumberDTO idGeneratorLastNumberDTO = idGeneratorDao.selectLastNumber(idGeneratorPOJO.getIdGeneratorEntity().getId()); - if (idGeneratorLastNumberDTO == null) { - throw new SmartBusinessException("IdGenerator, id 数据库不存在" + idGeneratorPOJO.getIdGeneratorEntity().getId()); - } - - Long lastNumber = idGeneratorLastNumberDTO.getLastNumber(); - if (lastNumber == null) { - lastNumber = idGeneratorPOJO.getIdGeneratorEntity().getInitNumber(); - } else { - lastNumber = lastNumber + 1; - } - - Date updateTime = idGeneratorLastNumberDTO.getUpdateTime(); - if (updateTime == null) { - updateTime = idGeneratorLastNumberDTO.getDatabaseTime(); - } - - Long startValue = -1L, endValue = -1L; - switch (idGeneratorPOJO.getIdGeneratorRuleTypeEnum()) { - case NO_CYCLE: - startValue = lastNumber.longValue(); - endValue = startValue + stepLength; - break; - default: - SimpleDateFormat format = new SimpleDateFormat(idGeneratorPOJO.getIdGeneratorRuleTypeEnum().getExt()); - if (format.format(idGeneratorLastNumberDTO.getDatabaseTime()).equals(format.format(updateTime))) { - startValue = lastNumber.longValue(); - endValue = startValue + stepLength; - } else { - startValue = idGeneratorPOJO.getIdGeneratorEntity().getInitNumber(); - endValue = startValue + stepLength; - } - break; - } - - idGeneratorDao.updateLastNumber(idGeneratorPOJO.getIdGeneratorEntity().getId(), endValue - 1); - LocalDate localDate = LocalDate.now(); - idGeneratorDao.replaceIdGeneratorRecord(idGeneratorPOJO.getIdGeneratorEntity().getId(), localDate.getYear(), localDate.getMonthValue(), localDate.getDayOfMonth(), endValue - 1); - return new long[]{startValue, endValue}; - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/idgenerator/IdGeneratorService.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/idgenerator/IdGeneratorService.java deleted file mode 100644 index ca5d581b..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/idgenerator/IdGeneratorService.java +++ /dev/null @@ -1,140 +0,0 @@ -package net.lab1024.smartadmin.module.support.idgenerator; - -import net.lab1024.smartadmin.common.exception.SmartBusinessException; -import net.lab1024.smartadmin.module.support.idgenerator.constant.IdGeneratorEnum; -import net.lab1024.smartadmin.module.support.idgenerator.constant.IdGeneratorRuleTypeEnum; -import net.lab1024.smartadmin.module.support.idgenerator.domain.IdGeneratorEntity; -import net.lab1024.smartadmin.module.support.idgenerator.domain.IdGeneratorPOJO; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import javax.annotation.PostConstruct; -import java.time.LocalDate; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -/** - * 全局id生成器 - * zhuo - */ -@Slf4j -@Service -public class IdGeneratorService { - - private Map idGeneratorMap; - - @Autowired - private IdGeneratorDao idGeneratorDao; - - @Autowired - private IdGeneratorManager idGeneratorManager; - - @PostConstruct - void init() { - this.idGeneratorMap = new ConcurrentHashMap<>(); - List idGeneratorEntities = idGeneratorDao.selectAll(); - if (idGeneratorEntities != null) { - idGeneratorEntities.forEach(e -> { - IdGeneratorRuleTypeEnum idGeneratorRuleTypeEnum = this.getIdGeneratorRuleTypeEnum(e.getRuleType()); - if (idGeneratorRuleTypeEnum != null) { - IdGeneratorPOJO idGeneratorPOJO = new IdGeneratorPOJO(idGeneratorRuleTypeEnum, e); - String ruleFormat = e.getRuleFormat(); - int startNInx = ruleFormat.indexOf("[n"); - int endNInx = ruleFormat.indexOf("n]"); - idGeneratorPOJO.setNumberCount(endNInx - startNInx); - idGeneratorPOJO.setHaveDay(ruleFormat.contains("[dd]")); - idGeneratorPOJO.setHaveMonth(ruleFormat.contains("[mm]")); - idGeneratorPOJO.setHaveYear(ruleFormat.contains("[yyyy]")); - this.idGeneratorMap.put(e.getId(), idGeneratorPOJO); - } else { - log.error("cannot find rule type , id : {}, key name : {} ", e.getId(), e.getKeyName()); - } - }); - } - } - - public String generate(IdGeneratorEnum idGeneratorEnum) { - return generate(idGeneratorEnum, 1).get(0); - } - - /** - * @param idGeneratorEnum - * @param stepLength - * @return - */ - public List generate(IdGeneratorEnum idGeneratorEnum, int stepLength) { - IdGeneratorPOJO idGeneratorPOJO = validateParams(idGeneratorEnum, stepLength); - long[] generateIds = idGeneratorManager.generate(idGeneratorPOJO, stepLength); - Long startValue = generateIds[0], endValue = generateIds[1]; - LocalDate now = LocalDate.now(); - String year = String.valueOf(now.getYear()); - String month = now.getMonthValue() > 9 ? String.valueOf(now.getMonthValue()) : "0" + now.getMonthValue(); - String day = now.getDayOfMonth() > 9 ? String.valueOf(now.getDayOfMonth()) : "0" + now.getDayOfMonth(); - ArrayList codeList = new ArrayList<>(); - for (long loop = startValue; loop < endValue; loop++) { - String generateBillCode = this.replaceAndFill(idGeneratorPOJO, loop, year, month, day); - codeList.add(generateBillCode); - } - return codeList; - } - - private IdGeneratorRuleTypeEnum getIdGeneratorRuleTypeEnum(String ruleType) { - for (IdGeneratorRuleTypeEnum en : IdGeneratorRuleTypeEnum.values()) { - if (en.name().equalsIgnoreCase(ruleType)) { - return en; - } - } - return null; - } - - private IdGeneratorPOJO validateParams(IdGeneratorEnum idGeneratorEnum, int stepLength) { - if (stepLength < 1) { - throw new SmartBusinessException("IdGenerator, step过短" + stepLength); - } - - IdGeneratorPOJO idGeneratorPOJO = this.idGeneratorMap.get(idGeneratorEnum.getId()); - if (idGeneratorPOJO == null) { - throw new SmartBusinessException("IdGenerator, id 不存在" + idGeneratorEnum); - } - return idGeneratorPOJO; - } - - /** - * 替换特殊rule,即替换[yyyy][mm][dd][nnn]等规则 - */ - private String replaceAndFill(IdGeneratorPOJO idGeneratorPOJO, Long number, String year, String month, String day) { - StringBuilder numberStringBuilder = new StringBuilder(); - int curNumberCount = String.valueOf(number).length(); - - if (idGeneratorPOJO.getNumberCount() > curNumberCount) { - int remain = idGeneratorPOJO.getNumberCount() - curNumberCount; - for (int i = 0; i < remain; i++) { - numberStringBuilder.append(0); - } - } - numberStringBuilder.append(number); - - StringBuilder nStringBuilder = new StringBuilder(); - nStringBuilder.append("\\["); - for (int i = 0; i < idGeneratorPOJO.getNumberCount(); i++) { - nStringBuilder.append("n"); - } - nStringBuilder.append("\\]"); - - String tempRuleFormat = new String(idGeneratorPOJO.getIdGeneratorEntity().getRuleFormat().getBytes()); - if (idGeneratorPOJO.isHaveYear()) { - tempRuleFormat = tempRuleFormat.replaceAll("\\[yyyy\\]", year); - } - if (idGeneratorPOJO.isHaveMonth()) { - tempRuleFormat = tempRuleFormat.replaceAll("\\[mm\\]", month); - } - if (idGeneratorPOJO.isHaveDay()) { - tempRuleFormat = tempRuleFormat.replaceAll("\\[dd\\]", day); - } - - return tempRuleFormat.replaceAll(nStringBuilder.toString(), numberStringBuilder.toString()); - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/idgenerator/constant/IdGeneratorEnum.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/idgenerator/constant/IdGeneratorEnum.java deleted file mode 100644 index 79cebd0e..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/idgenerator/constant/IdGeneratorEnum.java +++ /dev/null @@ -1,45 +0,0 @@ -package net.lab1024.smartadmin.module.support.idgenerator.constant; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/3/8 0008 下午 13:43 - * @since JDK1.8 - */ -public enum IdGeneratorEnum { - - - /** - * 测试generate - */ - TEST_ID_GENERATOR(2, "testIdGenerator"), - - - ORDER(1, "order"); - - private long id; - private String keyName; - - IdGeneratorEnum(int id, String keyName) { - this.id = id; - this.keyName = keyName; - } - - @Override - public String toString() { - return "IdGeneratorEnum{" + "id=" + id + ", keyName='" + keyName + '\'' + '}'; - } - - public long getId() { - return id; - } - - public String getKeyName() { - return keyName; - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/idgenerator/constant/IdGeneratorRuleTypeEnum.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/idgenerator/constant/IdGeneratorRuleTypeEnum.java deleted file mode 100644 index c2dad2da..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/idgenerator/constant/IdGeneratorRuleTypeEnum.java +++ /dev/null @@ -1,40 +0,0 @@ -package net.lab1024.smartadmin.module.support.idgenerator.constant; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/3/8 0008 下午 13:43 - * @since JDK1.8 - */ -public enum IdGeneratorRuleTypeEnum { - /** - * 没有周期 - */ - NO_CYCLE(""), - /** - * 年周期 - */ - YEAR_CYCLE("yyyy"), - /** - * 月周期 - */ - MONTH_CYCLE("yyyyMM"), - /** - * 日周期 - */ - DAY_CYCLE("yyyyMMdd"); - - private String ext; - - IdGeneratorRuleTypeEnum(String ext) { - this.ext = ext; - } - - public String getExt() { - return ext; - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/idgenerator/domain/IdGeneratorEntity.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/idgenerator/domain/IdGeneratorEntity.java deleted file mode 100644 index e1d64ffc..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/idgenerator/domain/IdGeneratorEntity.java +++ /dev/null @@ -1,45 +0,0 @@ -package net.lab1024.smartadmin.module.support.idgenerator.domain; - -import com.baomidou.mybatisplus.annotation.TableName; -import net.lab1024.smartadmin.common.domain.BaseEntity; -import lombok.Data; - -import java.io.Serializable; -import java.util.Date; - -/** - * @author sun - * @Auther: anders - * @Date: 2018/8/7 0007 13:33 - * @Description: - */ -@Data -@TableName(value = "t_id_generator") -public class IdGeneratorEntity extends BaseEntity implements Serializable { - - private static final long serialVersionUID = 5582354131134766548L; - /** - * 英文key - */ - private String keyName; - /** - * 规则格式 - */ - private String ruleFormat; - /** - * 类型 - */ - private String ruleType; - /** - * 初始值 - */ - private Long initNumber; - /** - * 上次产生的id - */ - private Long lastNumber; - /** - * 备注 - */ - private String remark; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/idgenerator/domain/IdGeneratorLastNumberDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/idgenerator/domain/IdGeneratorLastNumberDTO.java deleted file mode 100644 index 69af325e..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/idgenerator/domain/IdGeneratorLastNumberDTO.java +++ /dev/null @@ -1,38 +0,0 @@ -package net.lab1024.smartadmin.module.support.idgenerator.domain; - -import java.util.Date; - -/** - * @Auther: yandanyang - * @Date: 2018/8/7 0007 13:33 - * @Description: - */ -public class IdGeneratorLastNumberDTO { - private Date updateTime; - private Long lastNumber; - private Date databaseTime; - - public Date getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Date updateTime) { - this.updateTime = updateTime; - } - - public Long getLastNumber() { - return lastNumber; - } - - public void setLastNumber(Long lastNumber) { - this.lastNumber = lastNumber; - } - - public Date getDatabaseTime() { - return databaseTime; - } - - public void setDatabaseTime(Date databaseTime) { - this.databaseTime = databaseTime; - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/idgenerator/domain/IdGeneratorPOJO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/idgenerator/domain/IdGeneratorPOJO.java deleted file mode 100644 index 6cd93931..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/idgenerator/domain/IdGeneratorPOJO.java +++ /dev/null @@ -1,71 +0,0 @@ -package net.lab1024.smartadmin.module.support.idgenerator.domain; - -import net.lab1024.smartadmin.module.support.idgenerator.constant.IdGeneratorRuleTypeEnum; - -/** - * @Auther: yandanyang - * @Date: 2018/8/7 0007 13:33 - * @Description: - */ -public class IdGeneratorPOJO { - - private IdGeneratorRuleTypeEnum idGeneratorRuleTypeEnum; - private IdGeneratorEntity idGeneratorEntity; - private int numberCount = 0; - private boolean haveYear = false; - private boolean haveMonth = false; - private boolean haveDay = false; - - public IdGeneratorPOJO(IdGeneratorRuleTypeEnum idGeneratorRuleTypeEnum, IdGeneratorEntity idGeneratorEntity) { - this.idGeneratorRuleTypeEnum = idGeneratorRuleTypeEnum; - this.idGeneratorEntity = idGeneratorEntity; - } - - public IdGeneratorRuleTypeEnum getIdGeneratorRuleTypeEnum() { - return idGeneratorRuleTypeEnum; - } - - public void setIdGeneratorRuleTypeEnum(IdGeneratorRuleTypeEnum idGeneratorRuleTypeEnum) { - this.idGeneratorRuleTypeEnum = idGeneratorRuleTypeEnum; - } - - public IdGeneratorEntity getIdGeneratorEntity() { - return idGeneratorEntity; - } - - public void setIdGeneratorEntity(IdGeneratorEntity idGeneratorEntity) { - this.idGeneratorEntity = idGeneratorEntity; - } - - public int getNumberCount() { - return numberCount; - } - - public void setNumberCount(int numberCount) { - this.numberCount = numberCount; - } - - public boolean isHaveYear() { - return haveYear; - } - - public void setHaveYear(boolean haveYear) { - this.haveYear = haveYear; - } - - public boolean isHaveMonth() { - return haveMonth; - } - - public void setHaveMonth(boolean haveMonth) { - this.haveMonth = haveMonth; - } - - public boolean isHaveDay() { - return haveDay; - } - - public void setHaveDay(boolean haveDay) { - this.haveDay = haveDay; - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/idgenerator/domain/IdGeneratorRecordDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/idgenerator/domain/IdGeneratorRecordDTO.java deleted file mode 100644 index 50f79b1e..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/idgenerator/domain/IdGeneratorRecordDTO.java +++ /dev/null @@ -1,22 +0,0 @@ -package net.lab1024.smartadmin.module.support.idgenerator.domain; - -import lombok.Data; - -/** - * @Auther: yandanyang - * @Date: 2018/8/7 0007 13:33 - * @Description: - */ -@Data -public class IdGeneratorRecordDTO { - - private Long generatorId; - - private Integer year; - - private Integer month; - - private Integer day; - - private Long lastNumber; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/constant/QuartzConst.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/constant/QuartzConst.java deleted file mode 100644 index 949da2bc..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/constant/QuartzConst.java +++ /dev/null @@ -1,17 +0,0 @@ -package net.lab1024.smartadmin.module.support.quartz.constant; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/4/13 0013 下午 15:21 - * @since JDK1.8 - */ -public class QuartzConst { - public static final String QUARTZ_PARAMS_KEY="TASK_PARAMS"; - public static final String JOB_KEY_PREFIX="TASK_"; - public static final String TRIGGER_KEY_PREFIX="TRIGGER_"; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/constant/TaskResultEnum.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/constant/TaskResultEnum.java deleted file mode 100644 index df5fbc5d..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/constant/TaskResultEnum.java +++ /dev/null @@ -1,47 +0,0 @@ -package net.lab1024.smartadmin.module.support.quartz.constant; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/4/13 0013 下午 14:19 - * @since JDK1.8 - */ -public enum TaskResultEnum { - - SUCCESS(0,"成功"), - /** - * - */ - FAIL(1,"失败"); - - public static final String INFO="0:成功,1:失败"; - - private Integer status; - - private String desc; - - TaskResultEnum(Integer status , String desc) { - this.status = status; - this.desc = desc; - } - - public Integer getStatus() { - return status; - } - - public void setStatus(Integer status) { - this.status = status; - } - - public String getDesc() { - return desc; - } - - public void setDesc(String desc) { - this.desc = desc; - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/constant/TaskStatusEnum.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/constant/TaskStatusEnum.java deleted file mode 100644 index 9a7f9bd7..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/constant/TaskStatusEnum.java +++ /dev/null @@ -1,47 +0,0 @@ -package net.lab1024.smartadmin.module.support.quartz.constant; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/4/13 0013 下午 14:19 - * @since JDK1.8 - */ -public enum TaskStatusEnum { - - NORMAL(0,"正常"), - /** - * - */ - PAUSE(1,"暂停"); - - public static final String INFO="0:正常,1:暂停"; - - private Integer status; - - private String desc; - - TaskStatusEnum(Integer status ,String desc) { - this.status = status; - this.desc = desc; - } - - public Integer getStatus() { - return status; - } - - public void setStatus(Integer status) { - this.status = status; - } - - public String getDesc() { - return desc; - } - - public void setDesc(String desc) { - this.desc = desc; - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/controller/QuartzController.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/controller/QuartzController.java deleted file mode 100644 index 59a71ad3..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/controller/QuartzController.java +++ /dev/null @@ -1,81 +0,0 @@ -package net.lab1024.smartadmin.module.support.quartz.controller; - -import net.lab1024.smartadmin.common.anno.NoValidPrivilege; -import net.lab1024.smartadmin.common.anno.OperateLog; -import net.lab1024.smartadmin.common.domain.PageResultDTO; -import net.lab1024.smartadmin.constant.SwaggerTagConst; -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.module.support.quartz.service.QuartzTaskService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import net.lab1024.smartadmin.module.support.quartz.domain.dto.*; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.validation.Valid; - -/** - * - * [ ] - * - * @version 1.0 - * @since JDK1.8 - * @author yandanyang - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - */ -@OperateLog -@RestController -@Api(tags = {SwaggerTagConst.Admin.MANAGER_TASK_SCHEDULER}) -public class QuartzController { - - @Autowired - private QuartzTaskService quartzTaskService; - - - @PostMapping("/quartz/task/query") - @ApiOperation(value = "查询任务") - @NoValidPrivilege - public ResponseDTO> query(@RequestBody @Valid QuartzQueryDTO queryDTO){ - return quartzTaskService.query(queryDTO); - } - - - @PostMapping("/quartz/task/queryLog") - @ApiOperation(value = "查询任务运行日志") - @NoValidPrivilege - public ResponseDTO> queryLog(@RequestBody @Valid QuartzLogQueryDTO queryDTO){ - return quartzTaskService.queryLog(queryDTO); - } - - @PostMapping("/quartz/task/saveOrUpdate") - @ApiOperation(value = "新建更新任务") - public ResponseDTO saveOrUpdateTask(@RequestBody @Valid QuartzTaskDTO quartzTaskDTO)throws Exception{ - return quartzTaskService.saveOrUpdateTask(quartzTaskDTO); - } - - @GetMapping("/quartz/task/run/{taskId}") - @ApiOperation(value = "立即运行某个任务") - public ResponseDTO runTask(@PathVariable("taskId") Long taskId)throws Exception{ - return quartzTaskService.runTask(taskId); - } - - @GetMapping("/quartz/task/pause/{taskId}") - @ApiOperation(value = "暂停某个任务") - public ResponseDTO pauseTask(@PathVariable("taskId")Long taskId)throws Exception{ - return quartzTaskService.pauseTask(taskId); - } - - @GetMapping("/quartz/task/resume/{taskId}") - @ApiOperation(value = "恢复某个任务") - public ResponseDTO resumeTask(@PathVariable("taskId")Long taskId)throws Exception{ - return quartzTaskService.resumeTask(taskId); - } - - @GetMapping("/quartz/task/delete/{taskId}") - @ApiOperation(value = "删除某个任务") - public ResponseDTO deleteTask(@PathVariable("taskId")Long taskId)throws Exception{ - return quartzTaskService.deleteTask(taskId); - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/dao/QuartzTaskDao.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/dao/QuartzTaskDao.java deleted file mode 100644 index f9153e9e..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/dao/QuartzTaskDao.java +++ /dev/null @@ -1,42 +0,0 @@ -package net.lab1024.smartadmin.module.support.quartz.dao; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import net.lab1024.smartadmin.module.support.quartz.domain.dto.QuartzQueryDTO; -import net.lab1024.smartadmin.module.support.quartz.domain.dto.QuartzTaskVO; -import net.lab1024.smartadmin.module.support.quartz.domain.entity.QuartzTaskEntity; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Component; - -import java.util.List; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/4/13 0013 下午 14:35 - * @since JDK1.8 - */ -@Mapper -@Component -public interface QuartzTaskDao extends BaseMapper { - - /** - * 更新任务状态 - * @param taskId - * @param taskStatus - */ - void updateStatus(@Param("taskId") Integer taskId,@Param("taskStatus") Integer taskStatus); - - /** - * 查询列表 - * @param queryDTO - * @return - */ - List queryList(Page page, @Param("queryDTO")QuartzQueryDTO queryDTO); - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/dao/QuartzTaskLogDao.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/dao/QuartzTaskLogDao.java deleted file mode 100644 index b2e9cb04..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/dao/QuartzTaskLogDao.java +++ /dev/null @@ -1,35 +0,0 @@ -package net.lab1024.smartadmin.module.support.quartz.dao; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import net.lab1024.smartadmin.module.support.quartz.domain.dto.QuartzLogQueryDTO; -import net.lab1024.smartadmin.module.support.quartz.domain.dto.QuartzTaskLogVO; -import net.lab1024.smartadmin.module.support.quartz.domain.entity.QuartzTaskLogEntity; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Component; - -import java.util.List; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/4/13 0013 下午 14:35 - * @since JDK1.8 - */ -@Mapper -@Component -public interface QuartzTaskLogDao extends BaseMapper{ - - - /** - * 查询列表 - * @param queryDTO - * @return - */ - List queryList(Page page, @Param("queryDTO")QuartzLogQueryDTO queryDTO); -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/domain/dto/QuartzLogQueryDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/domain/dto/QuartzLogQueryDTO.java deleted file mode 100644 index 84b8564e..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/domain/dto/QuartzLogQueryDTO.java +++ /dev/null @@ -1,25 +0,0 @@ -package net.lab1024.smartadmin.module.support.quartz.domain.dto; - -import net.lab1024.smartadmin.common.domain.PageParamDTO; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotNull; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/4/15 0015 上午 11:29 - * @since JDK1.8 - */ -@Data -public class QuartzLogQueryDTO extends PageParamDTO { - - @ApiModelProperty(value = "任务Id(不能为空)") - @NotNull(message = "任务Id不能为空") - private Integer taskId; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/domain/dto/QuartzQueryDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/domain/dto/QuartzQueryDTO.java deleted file mode 100644 index 51e6b584..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/domain/dto/QuartzQueryDTO.java +++ /dev/null @@ -1,16 +0,0 @@ -package net.lab1024.smartadmin.module.support.quartz.domain.dto; - -import net.lab1024.smartadmin.common.domain.PageParamDTO; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/4/15 0015 上午 11:29 - * @since JDK1.8 - */ -public class QuartzQueryDTO extends PageParamDTO { -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/domain/dto/QuartzTaskDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/domain/dto/QuartzTaskDTO.java deleted file mode 100644 index 5fb303fc..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/domain/dto/QuartzTaskDTO.java +++ /dev/null @@ -1,45 +0,0 @@ -package net.lab1024.smartadmin.module.support.quartz.domain.dto; - -import net.lab1024.smartadmin.module.support.quartz.constant.TaskStatusEnum; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotNull; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/4/13 0013 下午 15:42 - * @since JDK1.8 - */ -@Data -public class QuartzTaskDTO { - - @ApiModelProperty("id") - private Long id; - - @ApiModelProperty("任务名称") - @NotNull(message = "任务名称不能为空") - private String taskName; - - @ApiModelProperty("任务Bean") - @NotNull(message = "任务Bean不能为空") - private String taskBean; - - @ApiModelProperty("任务参数") - private String taskParams; - - @ApiModelProperty("cron") - @NotNull(message = "cron表达式不能为空") - private String taskCron; - - @ApiModelProperty("任务状态:"+ TaskStatusEnum.INFO) - private Integer taskStatus; - - @ApiModelProperty("任务备注") - private String remark; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/domain/dto/QuartzTaskLogVO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/domain/dto/QuartzTaskLogVO.java deleted file mode 100644 index 23cd35fc..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/domain/dto/QuartzTaskLogVO.java +++ /dev/null @@ -1,49 +0,0 @@ -package net.lab1024.smartadmin.module.support.quartz.domain.dto; - -import net.lab1024.smartadmin.module.support.quartz.constant.TaskResultEnum; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.Date; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/4/13 0013 下午 15:42 - * @since JDK1.8 - */ -@Data -public class QuartzTaskLogVO { - - @ApiModelProperty("id") - private Long id; - - @ApiModelProperty("任务id") - private Long taskId; - - @ApiModelProperty("任务名称") - private String taskName; - - @ApiModelProperty("任务参数") - private String taskParams; - - @ApiModelProperty("任务处理状态:"+ TaskResultEnum.INFO) - private Integer processStatus; - - @ApiModelProperty("任务时长ms") - private Long processDuration; - - @ApiModelProperty("处理日志") - private String processLog; - - @ApiModelProperty("创建时间") - private Date createTime; - - - @ApiModelProperty("主机ip") - private String ipAddress; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/domain/dto/QuartzTaskVO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/domain/dto/QuartzTaskVO.java deleted file mode 100644 index b588c532..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/domain/dto/QuartzTaskVO.java +++ /dev/null @@ -1,45 +0,0 @@ -package net.lab1024.smartadmin.module.support.quartz.domain.dto; - -import net.lab1024.smartadmin.module.support.quartz.constant.TaskStatusEnum; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotNull; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/4/13 0013 下午 15:42 - * @since JDK1.8 - */ -@Data -public class QuartzTaskVO { - - @ApiModelProperty("id") - private Long id; - - @ApiModelProperty("任务名称") - @NotNull(message = "任务名称不能为空") - private String taskName; - - @ApiModelProperty("任务Bean") - @NotNull(message = "任务Bean不能为空") - private String taskBean; - - @ApiModelProperty("任务参数") - private String taskParams; - - @ApiModelProperty("cron") - @NotNull(message = "cron表达式不能为空") - private String taskCron; - - @ApiModelProperty("任务状态:"+ TaskStatusEnum.INFO) - private Integer taskStatus; - - @ApiModelProperty("任务备注") - private String remark; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/domain/entity/QuartzTaskEntity.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/domain/entity/QuartzTaskEntity.java deleted file mode 100644 index cb419b84..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/domain/entity/QuartzTaskEntity.java +++ /dev/null @@ -1,50 +0,0 @@ -package net.lab1024.smartadmin.module.support.quartz.domain.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import net.lab1024.smartadmin.common.domain.BaseEntity; -import lombok.Data; - - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/4/13 0013 下午 13:45 - * @since JDK1.8 - */ -@Data -@TableName("t_quartz_task") -public class QuartzTaskEntity extends BaseEntity { - /** - * 任务名称参数 - */ - private String taskName; - /** - * 任务类 - */ - private String taskBean; - - /** - * 任务参数 - */ - private String taskParams; - - /** - * cron - */ - private String taskCron; - - /** - * 任务状态 - */ - private Integer taskStatus; - - /** - * 备注 - */ - private String remark; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/domain/entity/QuartzTaskLogEntity.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/domain/entity/QuartzTaskLogEntity.java deleted file mode 100644 index 9d728416..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/domain/entity/QuartzTaskLogEntity.java +++ /dev/null @@ -1,50 +0,0 @@ -package net.lab1024.smartadmin.module.support.quartz.domain.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import net.lab1024.smartadmin.common.domain.BaseEntity; -import lombok.Data; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/4/13 0013 下午 13:45 - * @since JDK1.8 - */ -@Data -@TableName("t_quartz_task_log") -public class QuartzTaskLogEntity extends BaseEntity { - /** - * 任务名称参数 - */ - private Long taskId; - /** - * 任务名称 - */ - private String taskName; - /** - * 任务参数 - */ - private String taskParams; - /** - * 任务处理状态 - */ - private Integer processStatus; - - /** - * 任务时长ms - */ - private Long processDuration; - - /** - * 处理日志 - */ - private String processLog; - - - private String ipAddress; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/service/QuartzTask.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/service/QuartzTask.java deleted file mode 100644 index 4b327d1f..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/service/QuartzTask.java +++ /dev/null @@ -1,85 +0,0 @@ -package net.lab1024.smartadmin.module.support.quartz.service; - -import lombok.extern.slf4j.Slf4j; -import net.lab1024.smartadmin.common.domain.ITask; -import net.lab1024.smartadmin.module.support.quartz.constant.QuartzConst; -import net.lab1024.smartadmin.module.support.quartz.constant.TaskResultEnum; -import net.lab1024.smartadmin.module.support.quartz.domain.entity.QuartzTaskEntity; -import net.lab1024.smartadmin.module.support.quartz.domain.entity.QuartzTaskLogEntity; -import net.lab1024.smartadmin.third.SmartApplicationContext; -import net.lab1024.smartadmin.util.SmartIPUtil; -import net.lab1024.smartadmin.util.SmartQuartzUtil; -import org.quartz.JobDetail; -import org.quartz.JobExecutionContext; -import org.quartz.JobExecutionException; -import org.quartz.JobKey; -import org.springframework.scheduling.quartz.QuartzJobBean; - -import java.io.PrintWriter; -import java.io.StringWriter; -import java.util.Date; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - * @since JDK1.8 - */ -@Slf4j -public class QuartzTask extends QuartzJobBean { - - @Override - protected void executeInternal(JobExecutionContext context) throws JobExecutionException { - JobDetail jobDetail = context.getJobDetail(); - Object params = context.getMergedJobDataMap().get(QuartzConst.QUARTZ_PARAMS_KEY); - JobKey jobKey = jobDetail.getKey(); - - Long taskId = SmartQuartzUtil.getTaskIdByJobKey(jobKey); - QuartzTaskService quartzTaskService = (QuartzTaskService) SmartApplicationContext.getBean("quartzTaskService"); - QuartzTaskEntity quartzTaskEntity = quartzTaskService.getByTaskId(taskId); - - QuartzTaskLogService quartzTaskLogService = (QuartzTaskLogService) SmartApplicationContext.getBean("quartzTaskLogService"); - - QuartzTaskLogEntity taskLogEntity = new QuartzTaskLogEntity(); - taskLogEntity.setTaskId(taskId); - taskLogEntity.setIpAddress(SmartIPUtil.getLocalHostIP()); - try { - taskLogEntity.setTaskName(quartzTaskEntity.getTaskName()); - } catch (Exception e) { - e.printStackTrace(); - } - String paramsStr = null; - if (params != null) { - paramsStr = params.toString(); - taskLogEntity.setTaskParams(paramsStr); - } - taskLogEntity.setUpdateTime(new Date()); - taskLogEntity.setCreateTime(new Date()); - //任务开始时间 - long startTime = System.currentTimeMillis(); - try { - ITask taskClass = (ITask) SmartApplicationContext.getBean(quartzTaskEntity.getTaskBean()); - taskClass.execute(paramsStr); - taskLogEntity.setProcessStatus(TaskResultEnum.SUCCESS.getStatus()); - } catch (Exception e) { - log.error("", e); - StringWriter sw = new StringWriter(); - PrintWriter pw = new PrintWriter(sw, true); - e.printStackTrace(pw); - pw.flush(); - sw.flush(); - taskLogEntity.setProcessStatus(TaskResultEnum.FAIL.getStatus()); - taskLogEntity.setProcessLog(sw.toString()); - } finally { - long times = System.currentTimeMillis() - startTime; - taskLogEntity.setProcessDuration(times); - quartzTaskLogService.save(taskLogEntity); - } - - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/service/QuartzTaskLogService.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/service/QuartzTaskLogService.java deleted file mode 100644 index e54c483c..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/service/QuartzTaskLogService.java +++ /dev/null @@ -1,28 +0,0 @@ -package net.lab1024.smartadmin.module.support.quartz.service; - -import net.lab1024.smartadmin.module.support.quartz.dao.QuartzTaskLogDao; -import net.lab1024.smartadmin.module.support.quartz.domain.entity.QuartzTaskLogEntity; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/4/13 0013 下午 14:50 - * @since JDK1.8 - */ -@Service -public class QuartzTaskLogService { - - @Autowired - private QuartzTaskLogDao quartzTaskLogDao; - - - public void save(QuartzTaskLogEntity logEntity){ - quartzTaskLogDao.insert(logEntity); - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/service/QuartzTaskService.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/service/QuartzTaskService.java deleted file mode 100644 index 9f88132a..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/service/QuartzTaskService.java +++ /dev/null @@ -1,349 +0,0 @@ -package net.lab1024.smartadmin.module.support.quartz.service; - -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import net.lab1024.smartadmin.common.constant.ResponseCodeConst; -import net.lab1024.smartadmin.common.domain.PageResultDTO; -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.module.support.quartz.constant.QuartzConst; -import net.lab1024.smartadmin.module.support.quartz.constant.TaskStatusEnum; -import net.lab1024.smartadmin.module.support.quartz.dao.QuartzTaskDao; -import net.lab1024.smartadmin.module.support.quartz.dao.QuartzTaskLogDao; -import net.lab1024.smartadmin.module.support.quartz.domain.entity.QuartzTaskEntity; -import net.lab1024.smartadmin.third.SmartApplicationContext; -import net.lab1024.smartadmin.util.SmartBeanUtil; -import net.lab1024.smartadmin.util.SmartPageUtil; -import net.lab1024.smartadmin.util.SmartQuartzUtil; -import lombok.extern.slf4j.Slf4j; -import net.lab1024.smartadmin.module.support.quartz.domain.dto.*; -import org.quartz.*; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.time.LocalDateTime; -import java.util.Date; -import java.util.List; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/4/13 0013 下午 14:50 - * @since JDK1.8 - */ -@Slf4j -@Service -public class QuartzTaskService { - - @Autowired - private QuartzTaskDao quartzTaskDao; - - @Autowired - private QuartzTaskLogDao quartzTaskLogDao; - - @Autowired - private Scheduler scheduler; - - /** - * 查询列表 - * - * @param queryDTO - * @return - */ - public ResponseDTO> query(QuartzQueryDTO queryDTO) { - Page pageParam = SmartPageUtil.convert2QueryPage(queryDTO); - List taskList = quartzTaskDao.queryList(pageParam, queryDTO); - pageParam.setRecords(taskList); - return ResponseDTO.succData(SmartPageUtil.convert2PageResult(pageParam)); - } - - /** - * 查询运行日志 - * - * @param queryDTO - * @return - */ - public ResponseDTO> queryLog(QuartzLogQueryDTO queryDTO) { - Page pageParam = SmartPageUtil.convert2QueryPage(queryDTO); - List taskList = quartzTaskLogDao.queryList(pageParam, queryDTO); - pageParam.setRecords(taskList); - return ResponseDTO.succData(SmartPageUtil.convert2PageResult(pageParam)); - } - - /** - * 保存或更新 - * - * @param quartzTaskDTO - * @return - * @throws Exception - */ - @Transactional(rollbackFor = Throwable.class) - public ResponseDTO saveOrUpdateTask(QuartzTaskDTO quartzTaskDTO) throws Exception { - ResponseDTO baseValid = this.baseValid(quartzTaskDTO); - if (!baseValid.isSuccess()) { - return baseValid; - } - Long taskId = quartzTaskDTO.getId(); - if (taskId == null) { - return this.saveTask(quartzTaskDTO); - } else { - return this.updateTask(quartzTaskDTO); - } - } - - private ResponseDTO baseValid(QuartzTaskDTO quartzTaskDTO) { - Object taskBean = null; - try { - taskBean = SmartApplicationContext.getBean(quartzTaskDTO.getTaskBean()); - } catch (Exception e) { - log.error("taskBean 不存在{}", e); - } - if (taskBean == null) { - return ResponseDTO.wrap(ResponseCodeConst.ERROR_PARAM, "taskBean 不存在"); - } - if (!CronExpression.isValidExpression(quartzTaskDTO.getTaskCron())) { - return ResponseDTO.wrap(ResponseCodeConst.ERROR_PARAM, "请传入正确的正则表达式"); - } - return ResponseDTO.succ(); - } - - private ResponseDTO saveTask(QuartzTaskDTO quartzTaskDTO) throws Exception { - QuartzTaskEntity taskEntity = SmartBeanUtil.copy(quartzTaskDTO, QuartzTaskEntity.class); - taskEntity.setTaskStatus(TaskStatusEnum.NORMAL.getStatus()); - taskEntity.setUpdateTime(new Date()); - taskEntity.setCreateTime(new Date()); - quartzTaskDao.insert(taskEntity); - this.createQuartzTask(scheduler, taskEntity); - return ResponseDTO.succ(); - } - - private ResponseDTO updateTask(QuartzTaskDTO quartzTaskDTO) throws Exception { - QuartzTaskEntity updateEntity = quartzTaskDao.selectById(quartzTaskDTO.getId()); - if (updateEntity == null) { - return ResponseDTO.wrap(ResponseCodeConst.ERROR_PARAM, "task不存在"); - } - QuartzTaskEntity taskEntity = SmartBeanUtil.copy(quartzTaskDTO, QuartzTaskEntity.class); - //任务状态不能更新 - taskEntity.setTaskStatus(updateEntity.getTaskStatus()); - taskEntity.setUpdateTime(new Date()); - quartzTaskDao.updateById(taskEntity); - if(this.checkExist(taskEntity.getId())){ - this.updateQuartzTask(scheduler, taskEntity); - }else{ - this.createQuartzTask(scheduler,taskEntity); - } - - return ResponseDTO.succ(); - } - - /** - * 立即运行 - * - * @param taskId - * @return - * @throws Exception - */ - public ResponseDTO runTask(Long taskId) throws Exception { - QuartzTaskEntity quartzTaskEntity = quartzTaskDao.selectById(taskId); - if (quartzTaskEntity == null) { - return ResponseDTO.wrap(ResponseCodeConst.ERROR_PARAM, "task不存在"); - } - this.runQuartzTask(scheduler, quartzTaskEntity); - return ResponseDTO.succ(); - } - - /** - * 暂停运行 - * - * @param taskId - * @return - * @throws Exception - */ - @Transactional(rollbackFor = Throwable.class) - public ResponseDTO pauseTask(Long taskId) throws Exception { - QuartzTaskEntity quartzTaskEntity = quartzTaskDao.selectById(taskId); - if (quartzTaskEntity == null) { - return ResponseDTO.wrap(ResponseCodeConst.ERROR_PARAM, "task不存在"); - } - quartzTaskEntity.setTaskStatus(TaskStatusEnum.PAUSE.getStatus()); - quartzTaskDao.updateById(quartzTaskEntity); - this.pauseQuartzTask(scheduler, quartzTaskEntity); - return ResponseDTO.succ(); - } - - /** - * 恢复任务 - * - * @param taskId - * @return - * @throws Exception - */ - @Transactional(rollbackFor = Throwable.class) - public ResponseDTO resumeTask(Long taskId) throws Exception { - QuartzTaskEntity quartzTaskEntity = quartzTaskDao.selectById(taskId); - if (quartzTaskEntity == null) { - return ResponseDTO.wrap(ResponseCodeConst.ERROR_PARAM, "task不存在"); - } - quartzTaskEntity.setTaskStatus(TaskStatusEnum.NORMAL.getStatus()); - quartzTaskDao.updateById(quartzTaskEntity); - this.resumeQuartzTask(scheduler, quartzTaskEntity); - return ResponseDTO.succ(); - } - - /** - * 删除任务 - * - * @param taskId - * @return - * @throws Exception - */ - public ResponseDTO deleteTask(Long taskId) throws Exception { - QuartzTaskEntity quartzTaskEntity = quartzTaskDao.selectById(taskId); - if (quartzTaskEntity == null) { - return ResponseDTO.wrap(ResponseCodeConst.ERROR_PARAM, "task不存在"); - } - quartzTaskDao.deleteById(taskId); - this.deleteQuartzTask(scheduler, taskId); - return ResponseDTO.succ(); - } - - /** - * 通过任务Id 获取任务实体 - * - * @param taskId - * @return - */ - public QuartzTaskEntity getByTaskId(Long taskId) { - return quartzTaskDao.selectById(taskId); - } - - /** - * 创建任务 - * - * @param scheduler - * @param taskEntity - * @throws Exception - */ - public void createQuartzTask(Scheduler scheduler, QuartzTaskEntity taskEntity) throws Exception { - JobKey jobKey = SmartQuartzUtil.getJobKey(taskEntity.getId()); - JobDetail jobDetail = JobBuilder.newJob(QuartzTask.class).withIdentity(jobKey).build(); - - CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(taskEntity.getTaskCron()).withMisfireHandlingInstructionDoNothing(); - - TriggerKey triggerKey = SmartQuartzUtil.getTriggerKey(Long.valueOf(taskEntity.getId())); - CronTrigger trigger = TriggerBuilder.newTrigger().withIdentity(triggerKey).withSchedule(scheduleBuilder).build(); - - jobDetail.getJobDataMap().put(QuartzConst.QUARTZ_PARAMS_KEY, taskEntity.getTaskParams()); - scheduler.scheduleJob(jobDetail, trigger); - //如果任务是暂停状态,则暂停任务 - if (TaskStatusEnum.PAUSE.getStatus().equals(taskEntity.getTaskStatus())) { - this.pauseQuartzTask(scheduler, taskEntity); - } - } - - /** - * 更新任务 - * - * @param scheduler - * @param taskEntity - * @throws Exception - */ - private void updateQuartzTask(Scheduler scheduler, QuartzTaskEntity taskEntity) throws Exception { - TriggerKey triggerKey = SmartQuartzUtil.getTriggerKey(Long.valueOf(taskEntity.getId())); - - CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(taskEntity.getTaskCron()).withMisfireHandlingInstructionDoNothing(); - - CronTrigger trigger = this.getCronTrigger(scheduler, Long.valueOf(taskEntity.getId())); - - trigger = trigger.getTriggerBuilder().withIdentity(triggerKey).withSchedule(scheduleBuilder).build(); - - trigger.getJobDataMap().put(QuartzConst.QUARTZ_PARAMS_KEY, taskEntity.getTaskParams()); - - scheduler.rescheduleJob(triggerKey, trigger); - //如果更新之前任务是暂停状态,此时再次暂停任务 - if (TaskStatusEnum.PAUSE.getStatus().equals(taskEntity.getTaskStatus())) { - this.pauseQuartzTask(scheduler, taskEntity); - } - } - - private CronTrigger getCronTrigger(Scheduler scheduler, Long taskId) throws Exception { - TriggerKey triggerKey = SmartQuartzUtil.getTriggerKey(taskId); - return (CronTrigger) scheduler.getTrigger(triggerKey); - } - - /** - * 立即运行 - * - * @param scheduler - * @param taskEntity - * @throws Exception - */ - private void runQuartzTask(Scheduler scheduler, QuartzTaskEntity taskEntity) throws Exception { - JobDataMap dataMap = new JobDataMap(); - dataMap.put(QuartzConst.QUARTZ_PARAMS_KEY, taskEntity.getTaskParams()); - JobKey jobKey = SmartQuartzUtil.getJobKey(taskEntity.getId()); - if(!scheduler.checkExists(jobKey)){ - this.createQuartzTask(scheduler,taskEntity); - scheduler.triggerJob(jobKey, dataMap); - return; - } - scheduler.triggerJob(jobKey, dataMap); - } - - /** - * 暂停任务 - * - * @param scheduler - * @param quartzTaskEntity - * @throws Exception - */ - private void pauseQuartzTask(Scheduler scheduler, QuartzTaskEntity quartzTaskEntity) throws Exception { - JobKey jobKey = SmartQuartzUtil.getJobKey(quartzTaskEntity.getId()); - if(!scheduler.checkExists(jobKey)){ - this.createQuartzTask(scheduler,quartzTaskEntity); - scheduler.pauseJob(jobKey); - return; - } - scheduler.pauseJob(jobKey); - } - - /** - * 恢复任务 - * - * @param scheduler - * @param quartzTaskEntity - * @throws Exception - */ - private void resumeQuartzTask(Scheduler scheduler, QuartzTaskEntity quartzTaskEntity) throws Exception { - JobKey jobKey = SmartQuartzUtil.getJobKey(quartzTaskEntity.getId()); - if(!scheduler.checkExists(jobKey)){ - this.createQuartzTask(scheduler,quartzTaskEntity); - return; - } - scheduler.resumeJob(jobKey); - } - - /** - * 删除任务 - * - * @param scheduler - * @param taskId - * @throws Exception - */ - private void deleteQuartzTask(Scheduler scheduler, Long taskId) throws Exception { - JobKey jobKey = SmartQuartzUtil.getJobKey(taskId); - if(!scheduler.checkExists(jobKey)){ - return; - } - scheduler.deleteJob(jobKey); - } - - - private Boolean checkExist(Long taskId) throws Exception{ - JobKey jobKey = SmartQuartzUtil.getJobKey(taskId); - return scheduler.checkExists(jobKey); - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/task/test/Example.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/task/test/Example.java deleted file mode 100644 index f62d22b5..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/quartz/task/test/Example.java +++ /dev/null @@ -1,28 +0,0 @@ -package net.lab1024.smartadmin.module.support.quartz.task.test; - -import lombok.extern.slf4j.Slf4j; -import net.lab1024.smartadmin.common.domain.ITask; -import net.lab1024.smartadmin.util.SmartDateUtil; -import org.springframework.stereotype.Component; - -import java.util.Date; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/4/13 0013 下午 14:26 - * @since JDK1.8 - */ -@Slf4j -@Component("exampleTask") -public class Example implements ITask { - - @Override - public void execute(String paramJson) throws Exception { - log.warn("{}-今天搬了{}块砖,paramJson:{}",SmartDateUtil.formatYMDHMS(new Date()),System.currentTimeMillis(),paramJson ); - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/smartreload/SmartReloadCommand.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/smartreload/SmartReloadCommand.java deleted file mode 100644 index 2535efdd..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/smartreload/SmartReloadCommand.java +++ /dev/null @@ -1,52 +0,0 @@ -package net.lab1024.smartadmin.module.support.smartreload; - -import net.lab1024.smartadmin.common.reload.abstracts.AbstractSmartReloadCommand4Spring; -import net.lab1024.smartadmin.common.reload.domain.entity.ReloadItem; -import net.lab1024.smartadmin.common.reload.domain.entity.SmartReloadResult; -import net.lab1024.smartadmin.module.support.smartreload.dao.ReloadItemDao; -import net.lab1024.smartadmin.module.support.smartreload.dao.ReloadResultDao; -import net.lab1024.smartadmin.module.support.smartreload.domain.entity.ReloadItemEntity; -import net.lab1024.smartadmin.module.support.smartreload.domain.entity.ReloadResultEntity; -import net.lab1024.smartadmin.util.SmartBeanUtil; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import java.util.List; - -/** - * Smart Reload 业务 - * - * @author listen - * @date 2018/02/10 09:18 - */ -@Component -public class SmartReloadCommand extends AbstractSmartReloadCommand4Spring { - - @Autowired - private ReloadItemDao reloadItemDao; - - @Autowired - private ReloadResultDao reloadResultDao; - - /** - * 读取数据库中SmartReload项 - * - * @return List - */ - @Override - public List readReloadItem() { - List reloadItemEntityList = reloadItemDao.selectList(null); - return SmartBeanUtil.copyList(reloadItemEntityList, ReloadItem.class); - } - - /** - * 保存reload结果 - * - * @param smartReloadResult - */ - @Override - public void handleReloadResult(SmartReloadResult smartReloadResult) { - ReloadResultEntity reloadResultEntity = SmartBeanUtil.copy(smartReloadResult, ReloadResultEntity.class); - reloadResultDao.insert(reloadResultEntity); - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/smartreload/SmartReloadController.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/smartreload/SmartReloadController.java deleted file mode 100644 index 2d6e9560..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/smartreload/SmartReloadController.java +++ /dev/null @@ -1,52 +0,0 @@ -package net.lab1024.smartadmin.module.support.smartreload; - -import net.lab1024.smartadmin.common.anno.NoValidPrivilege; -import net.lab1024.smartadmin.common.anno.OperateLog; -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.constant.SwaggerTagConst; -import net.lab1024.smartadmin.module.support.smartreload.domain.dto.ReloadItemUpdateDTO; -import net.lab1024.smartadmin.module.support.smartreload.domain.dto.ReloadItemVO; -import net.lab1024.smartadmin.module.support.smartreload.domain.dto.ReloadResultVO; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.validation.Valid; -import java.util.List; - -/** - * Smart Reload 路由 - * - * @author listen - * @date 2018/02/10 09:18 - */ -@Api(tags = {SwaggerTagConst.Admin.MANAGER_SMART_RELOAD}) -@OperateLog -@RestController -public class SmartReloadController { - - @Autowired - private SmartReloadService smartReloadService; - - @ApiOperation(value = "获取全部Smart-reload项", notes = "获取全部Smart-reload项") - @GetMapping("/smartReload/all") - @NoValidPrivilege - public ResponseDTO> listAllReloadItem() { - return smartReloadService.listAllReloadItem(); - } - - @ApiOperation(value = "获取reload result", notes = "获取reload result") - @GetMapping("/smartReload/result/{tag}") - @NoValidPrivilege - public ResponseDTO> queryReloadResult(@PathVariable("tag") String tag) { - return smartReloadService.listReloadItemResult(tag); - } - - @ApiOperation("通过tag更新标识") - @PostMapping("/smartReload/update") - @NoValidPrivilege - public ResponseDTO updateByTag(@RequestBody @Valid ReloadItemUpdateDTO updateDTO) { - return smartReloadService.updateByTag(updateDTO); - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/smartreload/SmartReloadService.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/smartreload/SmartReloadService.java deleted file mode 100644 index 78778659..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/smartreload/SmartReloadService.java +++ /dev/null @@ -1,103 +0,0 @@ -package net.lab1024.smartadmin.module.support.smartreload; - -import net.lab1024.smartadmin.common.constant.ResponseCodeConst; -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.common.reload.SmartReloadManager; -import net.lab1024.smartadmin.module.support.smartreload.dao.ReloadItemDao; -import net.lab1024.smartadmin.module.support.smartreload.dao.ReloadResultDao; -import net.lab1024.smartadmin.module.support.smartreload.domain.dto.ReloadItemUpdateDTO; -import net.lab1024.smartadmin.module.support.smartreload.domain.dto.ReloadItemVO; -import net.lab1024.smartadmin.module.support.smartreload.domain.dto.ReloadResultVO; -import net.lab1024.smartadmin.module.support.smartreload.domain.entity.ReloadItemEntity; -import net.lab1024.smartadmin.module.support.smartreload.domain.entity.ReloadResultEntity; -import net.lab1024.smartadmin.util.SmartBeanUtil; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; - -import javax.annotation.PostConstruct; -import java.sql.Timestamp; -import java.util.List; -import java.util.concurrent.TimeUnit; - -/** - * Smart initDefines 业务 - * - * @author listen - * @date 2018/02/10 13:49 - */ -@Service -public class SmartReloadService { - - @Autowired - private SmartReloadManager smartReloadManager; - - @Autowired - private SmartReloadCommand smartReloadCommand; - - @Autowired - private ReloadItemDao reloadItemDao; - - @Autowired - private ReloadResultDao reloadResultDao; - - @Value("${smart-reload.time-interval}") - private Long timeInterval; - - @PostConstruct - public void init() { - smartReloadManager.addCommand(smartReloadCommand, 10, timeInterval, TimeUnit.SECONDS); - } - - /** - * 注册到SmartReload里 - */ - public void register(Object reload) { - smartReloadManager.register(reload); - } - - /** - * 获取所有 initDefines 项 - * - * @return - */ - public ResponseDTO> listAllReloadItem() { - List reloadItemEntityList = reloadItemDao.selectList(null); - List reloadItemDTOList = SmartBeanUtil.copyList(reloadItemEntityList, ReloadItemVO.class); - return ResponseDTO.succData(reloadItemDTOList); - } - - /** - * 根据 tag - * 获取所有 initDefines 运行结果 - * - * @return ResponseDTO - */ - public ResponseDTO> listReloadItemResult(String tag) { - ReloadResultEntity query = new ReloadResultEntity(); - query.setTag(tag); - List reloadResultEntityList = reloadResultDao.query(tag); - List reloadResultDTOList = SmartBeanUtil.copyList(reloadResultEntityList, ReloadResultVO.class); - return ResponseDTO.succData(reloadResultDTOList); - } - - /** - * 通过标签更新标识符 - * - * @param updateDTO - * @return - */ - public ResponseDTO updateByTag(ReloadItemUpdateDTO updateDTO) { - ReloadItemEntity entity = new ReloadItemEntity(); - entity.setTag(updateDTO.getTag()); - ReloadItemEntity reloadItemEntity = reloadItemDao.selectById(entity.getTag()); - if (null == reloadItemEntity) { - return ResponseDTO.wrap(ResponseCodeConst.NOT_EXISTS); - } - reloadItemEntity.setIdentification(updateDTO.getIdentification()); - reloadItemEntity.setUpdateTime(new Timestamp(System.currentTimeMillis())); - reloadItemEntity.setArgs(updateDTO.getArgs()); - reloadItemDao.updateById(reloadItemEntity); - return ResponseDTO.succ(); - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/smartreload/dao/ReloadItemDao.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/smartreload/dao/ReloadItemDao.java deleted file mode 100644 index c497ebbc..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/smartreload/dao/ReloadItemDao.java +++ /dev/null @@ -1,15 +0,0 @@ -package net.lab1024.smartadmin.module.support.smartreload.dao; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import net.lab1024.smartadmin.module.support.smartreload.domain.entity.ReloadItemEntity; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Component; - -/** - * t_reload_item 数据表dao - * - * @author listen - * @date 2018/02/10 09:23 - */ -@Component -@Mapper -public interface ReloadItemDao extends BaseMapper {} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/smartreload/dao/ReloadResultDao.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/smartreload/dao/ReloadResultDao.java deleted file mode 100644 index dc4d2d69..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/smartreload/dao/ReloadResultDao.java +++ /dev/null @@ -1,23 +0,0 @@ -package net.lab1024.smartadmin.module.support.smartreload.dao; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import net.lab1024.smartadmin.module.support.smartreload.domain.entity.ReloadResultEntity; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Component; - -import java.util.List; - -/** - * t_reload_result 数据表dao - * - * @author listen - * @date 2018/02/10 09:23 - */ -@Component -@Mapper -public interface ReloadResultDao extends BaseMapper { - - - List query(@Param("tag") String tag); -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/smartreload/domain/dto/ReloadItemVO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/smartreload/domain/dto/ReloadItemVO.java deleted file mode 100644 index 8f462297..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/smartreload/domain/dto/ReloadItemVO.java +++ /dev/null @@ -1,46 +0,0 @@ -package net.lab1024.smartadmin.module.support.smartreload.domain.dto; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.Date; - -/** - * initDefines 项 DTO 类 - * - * @author listen - * @date 2018/02/10 09:29 - */ -@Data -public class ReloadItemVO { - - /** - * 加载项标签 - */ - @ApiModelProperty("加载项标签") - private String tag; - - /** - * 参数 - */ - @ApiModelProperty("参数") - private String args; - - /** - * 状态标识 - */ - @ApiModelProperty("状态标识") - private String identification; - - /** - * 更新时间 - */ - @ApiModelProperty("最后更新时间") - private Date updateTime; - - /** - * 创建时间 - */ - @ApiModelProperty("创建时间") - private Date createTime; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/smartreload/domain/dto/ReloadResultVO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/smartreload/domain/dto/ReloadResultVO.java deleted file mode 100644 index 56b388a3..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/smartreload/domain/dto/ReloadResultVO.java +++ /dev/null @@ -1,45 +0,0 @@ -package net.lab1024.smartadmin.module.support.smartreload.domain.dto; -import lombok.Data; - -import java.util.Date; - -/** - * reload_result DTO 类 - * - * @author listen - * @date 2018/02/10 09:29 - */ -@Data -public class ReloadResultVO { - - /** - * 加载项标签 - */ - private String tag; - - /** - * 参数 - */ - private String args; - - /** - * 状态标识 - */ - private String identification; - - /** - * 运行结果 - */ - private Boolean result; - - /** - * 异常 - */ - private String exception; - - /** - * 创建时间 - */ - private Date createTime; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/websocket/MessageTypeEnum.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/websocket/MessageTypeEnum.java deleted file mode 100644 index eda10334..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/websocket/MessageTypeEnum.java +++ /dev/null @@ -1,44 +0,0 @@ -package net.lab1024.smartadmin.module.support.websocket; - -import net.lab1024.smartadmin.common.domain.BaseEnum; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/7/10 0010 下午 19:11 - * @since JDK1.8 - */ -public enum MessageTypeEnum implements BaseEnum{ - - SYS_NOTICE(1,"系统通知"), - - PRIVATE_LETTER(2,"私信"), - - HEART_BEAT(3,"心跳"); - - - private Integer value; - - private String desc; - - - MessageTypeEnum(Integer value,String desc){ - this.value = value; - this.desc = desc; - } - - - @Override - public Integer getValue() { - return this.value; - } - - @Override - public String getDesc() { - return this.desc; - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/websocket/WebSocketServer.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/websocket/WebSocketServer.java deleted file mode 100644 index a26489c8..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/websocket/WebSocketServer.java +++ /dev/null @@ -1,199 +0,0 @@ -package net.lab1024.smartadmin.module.support.websocket; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.TypeReference; -import net.lab1024.smartadmin.module.support.websocket.domain.MessageCommonDTO; -import net.lab1024.smartadmin.module.support.websocket.domain.MessageDTO; -import net.lab1024.smartadmin.module.support.websocket.domain.WebSocketHeartBeatDTO; -import com.google.common.collect.Lists; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -import javax.websocket.*; -import javax.websocket.server.PathParam; -import javax.websocket.server.ServerEndpoint; -import java.io.IOException; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.concurrent.ConcurrentHashMap; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/7/10 0010 下午 16:09 - * @since JDK1.8 - */ -@Slf4j -@ServerEndpoint("/webSocket/{employeeId}") -@Component -public class WebSocketServer { - - /** - * 当前在线用户 employee,expireTime - */ - private static ConcurrentHashMap onLineUser = new ConcurrentHashMap<>(); - - /** - * 当前在线用户所对应的 socket session信息 - */ - private static ConcurrentHashMap webSocketSession = new ConcurrentHashMap<>(); - - @OnOpen - public void onOpen(Session session, @PathParam("employeeId") Long employeeId) { - if (employeeId == null) { - return; - } - webSocketSession.put(employeeId, session); - log.info("连接打开"); - } - - /** - * 不做处理如果 前台可以监听到浏览器关闭 此处处理在线人数也可 - * - * @param session - */ - @OnClose - public void onClose(Session session) { - - log.info("连接关闭"); - } - - @OnError - public void onError(Session session, Throwable error) { - log.error("socket error,{}", error); - error.printStackTrace(); - } - - /** - * 此方法接收 前台信息 - * - * @param message - * @param session - */ - @OnMessage - public void onMessage(String message, Session session) { - if (StringUtils.isEmpty(message)) { - return; - } - MessageCommonDTO messageCommonDTO = JSON.parseObject(message, new TypeReference() {}); - if (MessageTypeEnum.HEART_BEAT.getValue().equals(messageCommonDTO.getMessageType())) { - this.heartBeatHandle(messageCommonDTO.getJsonStr()); - } - } - - /** - * 更新用户过期时间 - * - * @param json - */ - private void heartBeatHandle(String json) { - Long currentDate = System.currentTimeMillis(); - Long expireTime = currentDate + 5 * 1000; - WebSocketHeartBeatDTO heartBeatDTO = JSON.parseObject(json, new TypeReference() {}); - Long employeeId = heartBeatDTO.getEmployeeId(); - onLineUser.put(employeeId, expireTime); - } - - /** - * 移除过期用户,如果用户超过5s未获取到心跳列表则清除在线用户信息 - */ - @Scheduled(cron = "0/5 * * * * ?") - private void removeOnLineUser() { - Long currentDate = System.currentTimeMillis(); - Iterator> it = onLineUser.entrySet().iterator(); - while (it.hasNext()) { - Map.Entry entry = it.next(); - Long key = entry.getKey(); - Long value = entry.getValue(); - Long userExpireTime = value + 5 * 1000; - if (currentDate > userExpireTime) { - onLineUser.remove(key); - webSocketSession.remove(key); - } - } - } - - /** - * 此方法用户后台发送消息 - * - * @param messageDTO - */ - public static void sendMessage(MessageDTO messageDTO) { - //系统通知 - if (MessageTypeEnum.SYS_NOTICE.getValue().equals(messageDTO.getMessageType())) { - sendAllOnLineUser(messageDTO.getMessage(), messageDTO.getFromUserId()); - } - //站内信 - if (MessageTypeEnum.PRIVATE_LETTER.getValue().equals(messageDTO.getMessageType())) { - sendOneOnLineUser(messageDTO.getMessage(), messageDTO.getToUserId()); - } - } - - /** - * 通知所有在线用户 - * - * @param message - */ - public static void sendAllOnLineUser(String message, Long fromUserId) { - for (Entry entry : webSocketSession.entrySet()) { - Session session = entry.getValue(); - Long userId = entry.getKey(); - try { - //不想消息创建人推送消息 - if (! userId.equals(fromUserId)) { - session.getBasicRemote().sendText(message); - } - } catch (IOException e) { - log.error("推送消息到{},发送错误{}", userId, e); - log.error("", e); - } - - } - } - - /** - * 通知某人 - * - * @param message - * @param toUserId - */ - public static void sendOneOnLineUser(String message, Long toUserId) { - Session session = webSocketSession.get(toUserId); - if (session == null) { - log.error("推送消息到{},用户不在线", toUserId); - } - try { - session.getBasicRemote().sendText(message); - } catch (IOException e) { - log.error("推送消息到{},发送错误{}", toUserId, e); - log.error("", e); - } - } - - /** - * 获取所有在线用户id - * - * @return - */ - public static List getOnLineUserList() { - return Lists.newArrayList(onLineUser.keySet()); - } - - /** - * 获取当前在线用户数 - * - * @return - */ - public static Integer getOnLineUserCount() { - return onLineUser.entrySet().size(); - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/websocket/domain/MessageCommonDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/websocket/domain/MessageCommonDTO.java deleted file mode 100644 index 43828b38..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/websocket/domain/MessageCommonDTO.java +++ /dev/null @@ -1,29 +0,0 @@ -package net.lab1024.smartadmin.module.support.websocket.domain; - -import net.lab1024.smartadmin.module.support.websocket.MessageTypeEnum; -import lombok.Data; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/7/13 0013 下午 14:37 - * @since JDK1.8 - */ -@Data -public class MessageCommonDTO { - /** - * 消息类型 {@link MessageTypeEnum} - */ - private Integer messageType; - - /** - * 具体消息内容 - */ - private String jsonStr; - - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/websocket/domain/MessageDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/websocket/domain/MessageDTO.java deleted file mode 100644 index 23fc615f..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/websocket/domain/MessageDTO.java +++ /dev/null @@ -1,41 +0,0 @@ -package net.lab1024.smartadmin.module.support.websocket.domain; - -import net.lab1024.smartadmin.module.support.websocket.MessageTypeEnum; -import lombok.Builder; -import lombok.Data; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/7/10 0010 下午 18:50 - * @since JDK1.8 - */ -@Data -@Builder -public class MessageDTO { - - /** - * 消息类型 {@link MessageTypeEnum} - */ - private Integer messageType; - - /** - * 消息体 - */ - private String message; - - /** - * 发送者 - */ - private Long fromUserId; - - /** - * 接收者,系统通知可为null - */ - private Long toUserId; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/websocket/domain/WebSocketHeartBeatDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/websocket/domain/WebSocketHeartBeatDTO.java deleted file mode 100644 index 90f8c78f..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/support/websocket/domain/WebSocketHeartBeatDTO.java +++ /dev/null @@ -1,23 +0,0 @@ -package net.lab1024.smartadmin.module.support.websocket.domain; - -import lombok.Data; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/7/13 0013 下午 14:39 - * @since JDK1.8 - */ -@Data -public class WebSocketHeartBeatDTO { - - /** - * 当前登录人id - */ - private Long employeeId; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/DataScopeController.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/DataScopeController.java deleted file mode 100644 index 75a5eec4..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/DataScopeController.java +++ /dev/null @@ -1,59 +0,0 @@ -package net.lab1024.smartadmin.module.system.datascope; - -import net.lab1024.smartadmin.common.anno.NoValidPrivilege; -import net.lab1024.smartadmin.common.anno.OperateLog; -import net.lab1024.smartadmin.constant.SwaggerTagConst; -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.module.system.datascope.domain.dto.DataScopeAndViewTypeVO; -import net.lab1024.smartadmin.module.system.datascope.domain.dto.DataScopeBatchSetRoleDTO; -import net.lab1024.smartadmin.module.system.datascope.domain.dto.DataScopeSelectVO; -import net.lab1024.smartadmin.module.system.datascope.service.DataScopeService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.validation.Valid; -import java.util.List; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/4/27 0027 下午 15:12 - * @since JDK1.8 - */ -@Api(tags = {SwaggerTagConst.Admin.MANAGER_DATA_SCOPE}) -@OperateLog -@RestController -public class DataScopeController { - - @Autowired - private DataScopeService dataScopeService; - - @ApiOperation(value = "获取当前系统所配置的所有数据范围") - @GetMapping("/dataScope/list") - @NoValidPrivilege - public ResponseDTO> dataScopeList() { - return dataScopeService.dataScopeList(); - } - - @ApiOperation(value = "获取某角色所设置的数据范围") - @GetMapping("/dataScope/listByRole/{roleId}") - @NoValidPrivilege - public ResponseDTO> dataScopeListByRole(@PathVariable Long roleId) { - return dataScopeService.dataScopeListByRole(roleId); - } - - @ApiOperation(value = "批量设置某角色数据范围") - @PostMapping("/dataScope/batchSet") - @NoValidPrivilege - public ResponseDTO dataScopeBatchSet(@RequestBody @Valid DataScopeBatchSetRoleDTO batchSetRoleDTO) { - return dataScopeService.dataScopeBatchSet(batchSetRoleDTO); - } - - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/DataScopeRoleDao.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/DataScopeRoleDao.java deleted file mode 100644 index 1b926a7b..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/DataScopeRoleDao.java +++ /dev/null @@ -1,52 +0,0 @@ -package net.lab1024.smartadmin.module.system.datascope; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import net.lab1024.smartadmin.module.system.datascope.domain.entity.DataScopeRoleEntity; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Component; - -import java.util.List; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/4/27 0027 下午 14:41 - * @since JDK1.8 - */ -@Mapper -@Component -public interface DataScopeRoleDao extends BaseMapper { - - /** - * 获取某个角色的设置信息 - * @param roleId - * @return - */ - List listByRoleId(@Param("roleId") Long roleId); - - /** - * 获取某批角色的所有数据范围配置信息 - * @param roleIdList - * @return - */ - List listByRoleIdList(@Param("roleIdList") List roleIdList); - - /** - * 删除某个角色的设置信息 - * @param roleId - * @return - */ - void deleteByRoleId(@Param("roleId") Long roleId); - - - /** - * 批量添加设置信息 - * @param list - */ - void batchInsert(@Param("list")List list); -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/constant/DataScopeViewTypeEnum.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/constant/DataScopeViewTypeEnum.java deleted file mode 100644 index 75ddf0c9..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/constant/DataScopeViewTypeEnum.java +++ /dev/null @@ -1,54 +0,0 @@ -package net.lab1024.smartadmin.module.system.datascope.constant; - - -import net.lab1024.smartadmin.common.domain.BaseEnum; - -import java.util.Arrays; -import java.util.Optional; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/4/28 0028 下午 15:37 - * @since JDK1.8 - */ -public enum DataScopeViewTypeEnum implements BaseEnum { - - ME(0,0,"本人"), - - DEPARTMENT(1,5,"本部门"), - - DEPARTMENT_AND_SUB(2,10,"本部门及下属子部门"), - - ALL(3,15,"全部"); - - private Integer value; - private Integer level; - private String desc; - - DataScopeViewTypeEnum(Integer value,Integer level, String desc) { - this.value = value; - this.level = level; - this.desc = desc; - } - - @Override - public Integer getValue() { - return value; - } - - public Integer getLevel() { - return level; - } - - @Override - public String getDesc() { - return desc; - } - - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/constant/DataScopeWhereInTypeEnum.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/constant/DataScopeWhereInTypeEnum.java deleted file mode 100644 index e9037373..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/constant/DataScopeWhereInTypeEnum.java +++ /dev/null @@ -1,42 +0,0 @@ -package net.lab1024.smartadmin.module.system.datascope.constant; - -import net.lab1024.smartadmin.common.domain.BaseEnum; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/5/8 0008 下午 16:00 - * @since JDK1.8 - */ -public enum DataScopeWhereInTypeEnum implements BaseEnum { - - EMPLOYEE(0,"以员工IN"), - - DEPARTMENT(1,"以部门IN"), - - CUSTOM_STRATEGY(2,"自定义策略"); - - private Integer value; - private String desc; - - DataScopeWhereInTypeEnum(Integer value, String desc) { - this.value = value; - this.desc = desc; - } - - @Override - public Integer getValue() { - return value; - } - - @Override - public String getDesc() { - return desc; - } - - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/domain/dto/DataScopeBatchSetDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/domain/dto/DataScopeBatchSetDTO.java deleted file mode 100644 index 6ff9fc92..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/domain/dto/DataScopeBatchSetDTO.java +++ /dev/null @@ -1,28 +0,0 @@ -package net.lab1024.smartadmin.module.system.datascope.domain.dto; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotNull; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/4/27 0027 下午 16:51 - * @since JDK1.8 - */ -@Data -public class DataScopeBatchSetDTO { - - @ApiModelProperty("数据范围类型") - @NotNull(message = "数据范围类型不能为空") - private Integer dataScopeType; - - @ApiModelProperty("可见范围") - @NotNull(message = "可见范围不能为空") - private Integer viewType; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/domain/dto/DataScopeBatchSetRoleDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/domain/dto/DataScopeBatchSetRoleDTO.java deleted file mode 100644 index 215ab664..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/domain/dto/DataScopeBatchSetRoleDTO.java +++ /dev/null @@ -1,30 +0,0 @@ -package net.lab1024.smartadmin.module.system.datascope.domain.dto; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import java.util.List; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/4/27 0027 下午 16:47 - * @since JDK1.8 - */ -@Data -public class DataScopeBatchSetRoleDTO { - - @ApiModelProperty("角色id") - @NotNull(message = "角色id不能为空") - private Long roleId; - - @ApiModelProperty("设置信息") - @Valid - private List batchSetList; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/domain/dto/DataScopeSelectVO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/domain/dto/DataScopeSelectVO.java deleted file mode 100644 index 5d0a3aa8..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/domain/dto/DataScopeSelectVO.java +++ /dev/null @@ -1,24 +0,0 @@ -package net.lab1024.smartadmin.module.system.datascope.domain.dto; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/4/27 0027 下午 16:43 - * @since JDK1.8 - */ -@Data -public class DataScopeSelectVO { - - @ApiModelProperty("数据范围id") - private Integer dataScopeType; - - @ApiModelProperty("可见范围") - private Integer viewType; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/domain/dto/DataScopeSqlConfigDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/domain/dto/DataScopeSqlConfigDTO.java deleted file mode 100644 index 422933de..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/domain/dto/DataScopeSqlConfigDTO.java +++ /dev/null @@ -1,40 +0,0 @@ -package net.lab1024.smartadmin.module.system.datascope.domain.dto; - -import lombok.Data; -import net.lab1024.smartadmin.module.system.datascope.constant.DataScopeTypeEnum; -import net.lab1024.smartadmin.module.system.datascope.constant.DataScopeWhereInTypeEnum; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/4/28 0028 下午 17:21 - * @since JDK1.8 - */ -@Data -public class DataScopeSqlConfigDTO { - - /** - * 数据范围类型 - * {@link DataScopeTypeEnum} - */ - private DataScopeTypeEnum dataScopeType; - - /** - * join sql 具体实现类 - */ - private Class joinSqlImplClazz; - - private String joinSql; - - private Integer whereIndex; - - /** - * whereIn类型 - * {@link DataScopeWhereInTypeEnum} - */ - private DataScopeWhereInTypeEnum dataScopeWhereInType; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/domain/entity/DataScopeRoleEntity.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/domain/entity/DataScopeRoleEntity.java deleted file mode 100644 index 016f05bf..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/domain/entity/DataScopeRoleEntity.java +++ /dev/null @@ -1,33 +0,0 @@ -package net.lab1024.smartadmin.module.system.datascope.domain.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import net.lab1024.smartadmin.common.domain.BaseEntity; -import lombok.Data; - -/** - * [ 数据范围与角色关系 ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/4/27 0027 下午 14:43 - * @since JDK1.8 - */ -@Data -@TableName("t_role_data_scope") -public class DataScopeRoleEntity extends BaseEntity { - - /** - * 数据范围id - */ - private Integer dataScopeType; - /** - * 数据范围类型 - */ - private Integer viewType; - /** - * 角色id - */ - private Long roleId; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/service/DataScopeService.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/service/DataScopeService.java deleted file mode 100644 index 46b80bd4..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/service/DataScopeService.java +++ /dev/null @@ -1,118 +0,0 @@ -package net.lab1024.smartadmin.module.system.datascope.service; - -import net.lab1024.smartadmin.common.constant.ResponseCodeConst; -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.module.system.datascope.DataScopeRoleDao; -import net.lab1024.smartadmin.module.system.datascope.constant.DataScopeTypeEnum; -import net.lab1024.smartadmin.module.system.datascope.constant.DataScopeViewTypeEnum; -import net.lab1024.smartadmin.module.system.datascope.domain.entity.DataScopeRoleEntity; -import net.lab1024.smartadmin.util.SmartBeanUtil; -import com.google.common.collect.Lists; -import net.lab1024.smartadmin.module.system.datascope.domain.dto.*; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.CollectionUtils; - -import java.util.Comparator; -import java.util.List; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/4/27 0027 下午 14:52 - * @since JDK1.8 - */ -@Service -public class DataScopeService { - - @Autowired - private DataScopeRoleDao dataScopeRoleDao; - - /** - * 获取所有可以进行数据范围配置的信息 - * - * @return - */ - public ResponseDTO> dataScopeList() { - List dataScopeList = this.getDataScopeType(); - List dataScopeAndTypeList = SmartBeanUtil.copyList(dataScopeList, DataScopeAndViewTypeVO.class); - List typeList = this.getViewType(); - dataScopeAndTypeList.forEach(e -> { - e.setViewTypeList(typeList); - }); - return ResponseDTO.succData(dataScopeAndTypeList); - } - - /** - * 获取当前系统存在的数据可见范围 - * - * @return - */ - public List getViewType() { - List viewTypeList = Lists.newArrayList(); - DataScopeViewTypeEnum[] enums = DataScopeViewTypeEnum.class.getEnumConstants(); - DataScopeViewTypeVO dataScopeViewTypeDTO; - for (DataScopeViewTypeEnum viewTypeEnum : enums) { - dataScopeViewTypeDTO = DataScopeViewTypeVO.builder().viewType(viewTypeEnum.getValue()).viewTypeLevel(viewTypeEnum.getLevel()).viewTypeName(viewTypeEnum.getDesc()).build(); - viewTypeList.add(dataScopeViewTypeDTO); - } - Comparator comparator = (h1, h2) -> h1.getViewTypeLevel().compareTo(h2.getViewTypeLevel()); - viewTypeList.sort(comparator); - return viewTypeList; - } - - public List getDataScopeType() { - List dataScopeTypeList = Lists.newArrayList(); - DataScopeTypeEnum[] enums = DataScopeTypeEnum.class.getEnumConstants(); - DataScopeDTO dataScopeDTO; - for (DataScopeTypeEnum typeEnum : enums) { - dataScopeDTO = - DataScopeDTO.builder().dataScopeType(typeEnum.getValue()).dataScopeTypeDesc(typeEnum.getDesc()).dataScopeTypeName(typeEnum.getName()).dataScopeTypeSort(typeEnum.getSort()).build(); - dataScopeTypeList.add(dataScopeDTO); - } - Comparator comparator = (h1, h2) -> h1.getDataScopeTypeSort().compareTo(h2.getDataScopeTypeSort()); - dataScopeTypeList.sort(comparator); - return dataScopeTypeList; - } - - /** - * 获取某个角色的数据范围设置信息 - * - * @param roleId - * @return - */ - public ResponseDTO> dataScopeListByRole(Long roleId) { - - List dataScopeRoleEntityList = dataScopeRoleDao.listByRoleId(roleId); - if (CollectionUtils.isEmpty(dataScopeRoleEntityList)) { - return ResponseDTO.succData(Lists.newArrayList()); - } - List dataScopeSelects = SmartBeanUtil.copyList(dataScopeRoleEntityList, DataScopeSelectVO.class); - return ResponseDTO.succData(dataScopeSelects); - } - - /** - * 批量设置某个角色的数据范围设置信息 - * - * @param batchSetRoleDTO - * @return - */ - @Transactional(rollbackFor = Exception.class) - public ResponseDTO dataScopeBatchSet(DataScopeBatchSetRoleDTO batchSetRoleDTO) { - List batchSetList = batchSetRoleDTO.getBatchSetList(); - if (CollectionUtils.isEmpty(batchSetList)) { - return ResponseDTO.wrap(ResponseCodeConst.ERROR_PARAM, "缺少配置信息"); - } - List dataScopeRoleEntityList = SmartBeanUtil.copyList(batchSetList, DataScopeRoleEntity.class); - dataScopeRoleEntityList.forEach(e -> e.setRoleId(batchSetRoleDTO.getRoleId())); - dataScopeRoleDao.deleteByRoleId(batchSetRoleDTO.getRoleId()); - dataScopeRoleDao.batchInsert(dataScopeRoleEntityList); - return ResponseDTO.succ(); - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/strategy/DataScopePowerStrategy.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/strategy/DataScopePowerStrategy.java deleted file mode 100644 index d12cbf15..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/datascope/strategy/DataScopePowerStrategy.java +++ /dev/null @@ -1,24 +0,0 @@ -package net.lab1024.smartadmin.module.system.datascope.strategy; -import net.lab1024.smartadmin.module.system.datascope.constant.DataScopeViewTypeEnum; -import net.lab1024.smartadmin.module.system.datascope.domain.dto.DataScopeSqlConfigDTO; - -/** - * [ 数据范围策略 ,使用DataScopeWhereInTypeEnum.CUSTOM_STRATEGY类型,DataScope注解的joinSql属性无用] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2020/11/28 0008 下午 16:00 - * @since JDK1.8 - */ -public abstract class DataScopePowerStrategy { - - /** - * 获取joinsql 字符串 - * @param viewTypeEnum 查看的类型 - * @param sqlConfigDTO - * @return - */ - public abstract String getCondition(DataScopeViewTypeEnum viewTypeEnum, DataScopeSqlConfigDTO sqlConfigDTO); -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/department/DepartmentController.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/department/DepartmentController.java deleted file mode 100644 index 1a070773..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/department/DepartmentController.java +++ /dev/null @@ -1,99 +0,0 @@ -package net.lab1024.smartadmin.module.system.department; - -import net.lab1024.smartadmin.common.anno.OperateLog; -import net.lab1024.smartadmin.constant.SwaggerTagConst; -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.module.system.department.domain.dto.DepartmentCreateDTO; -import net.lab1024.smartadmin.module.system.department.domain.dto.DepartmentUpdateDTO; -import net.lab1024.smartadmin.module.system.department.domain.dto.DepartmentVO; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.validation.Valid; -import java.util.List; - -/** - * 部门管理路由器 - * - * @author listen - * @date 2017/12/19 14:29 - */ -@Api(tags = {SwaggerTagConst.Admin.MANAGER_DEPARTMENT}) -@OperateLog -@RestController -public class DepartmentController { - - @Autowired - private DepartmentService departmentService; - - @ApiOperation(value = "查询部门树形列表", notes = "查询部门列表") - @GetMapping("/department/list") - public ResponseDTO> listDepartment() { - return departmentService.listDepartment(); - } - - @ApiOperation(value = "查询部门及员工列表", notes = "查询部门及员工列表") - @GetMapping("/department/listEmployee") - public ResponseDTO> listDepartmentEmployee() { - return departmentService.listAllDepartmentEmployee(null); - } - - @ApiOperation(value = "根据部门名称查询部门及员工列表", notes = "根据部门名称查询部门及员工列表") - @GetMapping("/department/listEmployeeByDepartmentName") - public ResponseDTO> listDepartmentEmployee(String departmentName) { - return departmentService.listAllDepartmentEmployee(departmentName); - } - - @ApiOperation(value = "添加部门", notes = "添加部门") - @PostMapping("/department/add") - public ResponseDTO addDepartment(@Valid @RequestBody DepartmentCreateDTO departmentCreateDTO) { - return departmentService.addDepartment(departmentCreateDTO); - } - - @ApiOperation(value = "更新部门信息", notes = "更新部门信息") - @PostMapping("/department/update") - public ResponseDTO updateDepartment(@Valid @RequestBody DepartmentUpdateDTO departmentUpdateDTO) { - return departmentService.updateDepartment(departmentUpdateDTO); - } - - @ApiOperation(value = "删除部门", notes = "删除部门") - @PostMapping("/department/delete/{deptId}") - public ResponseDTO delDepartment(@PathVariable Long deptId) { - return departmentService.delDepartment(deptId); - } - - @ApiOperation(value = "获取部门信息", notes = "获取部门") - @GetMapping("/department/query/{deptId}") - public ResponseDTO getDepartment(@PathVariable Long deptId) { - return departmentService.getDepartmentById(deptId); - } - - @ApiOperation(value = "查询部门列表", notes = "查询部门列表") - @GetMapping("/department/listAll") - public ResponseDTO> listAll() { - return departmentService.listAll(); - } - - - @ApiOperation(value = "上下移动") - @GetMapping("/department/upOrDown/{deptId}/{swapId}") - public ResponseDTO upOrDown(@PathVariable Long deptId, @PathVariable Long swapId) { - return departmentService.upOrDown(deptId, swapId); - } - - @ApiOperation(value = "升级") - @GetMapping("/department/upgrade/{deptId}") - public ResponseDTO upgrade(@PathVariable Long deptId) { - return departmentService.upgrade(deptId); - } - - @ApiOperation(value = "降级") - @GetMapping("/department/downgrade/{deptId}/{preId}") - public ResponseDTO downgrade(@PathVariable Long deptId, @PathVariable Long preId) { - return departmentService.downgrade(deptId, preId); - } - - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/department/DepartmentDao.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/department/DepartmentDao.java deleted file mode 100644 index d7bc2f77..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/department/DepartmentDao.java +++ /dev/null @@ -1,47 +0,0 @@ -package net.lab1024.smartadmin.module.system.department; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import net.lab1024.smartadmin.module.system.department.domain.dto.DepartmentVO; -import net.lab1024.smartadmin.module.system.department.domain.entity.DepartmentEntity; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Component; - -import java.util.List; - -/** - * t_department dao接口 - * - * @author listen - * @date 2017/12/19 10:58 - */ -@Component -@Mapper -public interface DepartmentDao extends BaseMapper { - - /** - * 根据部门id,查询此部门直接子部门的数量 - * - * @param deptId - * @return int 子部门的数量 - */ - Integer countSubDepartment(@Param("deptId") Long deptId); - - /** - * 获取全部部门列表 - * - * @return List - */ - List listAll(); - - /** - * 功能描述: 根据父部门id查询 - * - * @param - * @return - * @auther yandanyang - * @date 2018/8/25 0025 上午 9:46 - */ - List selectByParentId(@Param("departmentId") Long departmentId); - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/department/DepartmentResponseCodeConst.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/department/DepartmentResponseCodeConst.java deleted file mode 100644 index a7a219e0..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/department/DepartmentResponseCodeConst.java +++ /dev/null @@ -1,39 +0,0 @@ -package net.lab1024.smartadmin.module.system.department; - -import net.lab1024.smartadmin.common.constant.ResponseCodeConst; - -/** - * 部门返回信息常量类 - * 2001 - 2999 - * - * @author listen - * @date 2017/12/19 18:52 - */ -public class DepartmentResponseCodeConst extends ResponseCodeConst { - - /** - * 部门不存在 1001 - */ - public static final DepartmentResponseCodeConst DEPT_NOT_EXISTS = new DepartmentResponseCodeConst(2001, "部门不存在"); - - /** - * 当前部门有子级部门 不能删除 10003 - */ - public static final DepartmentResponseCodeConst CANNOT_DEL_DEPARTMENT_WITH_CHILD = new - DepartmentResponseCodeConst(2002, "当前部门有子级部门,无法删除!"); - - /** - * 当前部门有员工 不能删除 10004 - */ - public static final DepartmentResponseCodeConst CANNOT_DEL_DEPARTMENT_WITH_EMPLOYEE = new - DepartmentResponseCodeConst(2003, "当前部门有员工,无法删除!"); - - /** - * - */ - public static final DepartmentResponseCodeConst PARENT_ID_ERROR = new DepartmentResponseCodeConst(2004, "上级部门id不能等于当前部门id"); - - public DepartmentResponseCodeConst(int code, String msg) { - super(code, msg); - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/department/DepartmentService.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/department/DepartmentService.java deleted file mode 100644 index b5b99ab0..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/department/DepartmentService.java +++ /dev/null @@ -1,285 +0,0 @@ -package net.lab1024.smartadmin.module.system.department; - -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.module.system.department.domain.dto.DepartmentCreateDTO; -import net.lab1024.smartadmin.module.system.department.domain.dto.DepartmentUpdateDTO; -import net.lab1024.smartadmin.module.system.department.domain.dto.DepartmentVO; -import net.lab1024.smartadmin.module.system.department.domain.entity.DepartmentEntity; -import net.lab1024.smartadmin.module.system.employee.EmployeeDao; -import net.lab1024.smartadmin.module.system.employee.domain.dto.EmployeeDTO; -import net.lab1024.smartadmin.util.SmartBeanUtil; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.function.Function; -import java.util.stream.Collectors; - -/** - * 部门管理业务类 - * - * @author listen - * @date 2017/12/19 14:25 - */ -@Service -public class DepartmentService { - - @Autowired - private DepartmentDao departmentDao; - - @Autowired - private EmployeeDao employeeDao; - - @Autowired - private DepartmentTreeService departmentTreeService; - - /** - * 获取部门树形结构 - * - * @return - */ - public ResponseDTO> listDepartment() { - List departmentVOList = departmentDao.listAll(); - List result = departmentTreeService.buildTree(departmentVOList); - return ResponseDTO.succData(result); - } - - /** - * 获取所有部门和员工信息 - * - * @param departmentName - * @return - */ - public ResponseDTO> listAllDepartmentEmployee(String departmentName) { - - // 获取全部部门列表 - List departmentVOList = departmentDao.listAll(); - if (StringUtils.isNotBlank(departmentName)) { - // 检索条件不为空的时候 过滤部门列表 - departmentVOList = filterDepartment(departmentVOList, departmentName); - } - - Map departmentMap = departmentVOList.stream().collect(Collectors.toMap(DepartmentVO::getId, Function.identity())); - // 获取全部员工列表 - List employeeList = employeeDao.listAll(); - employeeList.forEach(employeeDTO -> { - - DepartmentVO departmentVO = departmentMap.get(employeeDTO.getDepartmentId()); - if (null == departmentVO) { - return; - } - List employeeDTOList = departmentVO.getEmployees(); - if (null == employeeDTOList) { - employeeDTOList = new ArrayList<>(); - } - employeeDTOList.add(employeeDTO); - departmentVO.setEmployees(employeeDTOList); - }); - List result = departmentTreeService.buildTree(departmentVOList); - return ResponseDTO.succData(result); - } - - /** - * 过滤部门名称,获取过滤后的结果 - * - * @author lidoudou - * @date 2019/4/28 20:17 - */ - private List filterDepartment(List departmentVOList, String departmentName) { - Map departmentMap = new HashMap<>(); - departmentVOList.forEach(item -> { - if (item.getName().indexOf(departmentName) < 0) { - return; - } - // 当前部门包含关键字 - departmentMap.put(item.getId(), item); - Long parentId = item.getParentId(); - if (null != parentId) { - List filterResult = new ArrayList<>(); - getParentDepartment(departmentVOList, parentId, filterResult); - for (DepartmentVO dto : filterResult) { - if (!departmentMap.containsKey(dto.getId())) { - departmentMap.put(dto.getId(), dto); - } - } - } - }); - return departmentMap.values().stream().collect(Collectors.toList()); - } - - private List getParentDepartment(List departmentVOList, Long parentId, List result) { - List deptList = departmentVOList.stream().filter(e -> e.getId().equals(parentId)).collect(Collectors.toList()); - for (DepartmentVO item : deptList) { - result.add(item); - if (item.getParentId() != 0 && item.getParentId() != null) { - result.addAll(getParentDepartment(departmentVOList, item.getParentId(), result)); - } - } - return result; - } - - /** - * 新增添加部门 - * - * @param departmentCreateDTO - * @return AjaxResult - */ - @Transactional(rollbackFor = Exception.class) - public ResponseDTO addDepartment(DepartmentCreateDTO departmentCreateDTO) { - DepartmentEntity departmentEntity = SmartBeanUtil.copy(departmentCreateDTO, DepartmentEntity.class); - departmentEntity.setSort(0L); - departmentDao.insert(departmentEntity); - departmentEntity.setSort(departmentEntity.getId()); - departmentDao.updateById(departmentEntity); - return ResponseDTO.succ(); - } - - /** - * 更新部门信息 - * - * @param updateDTO - * @return AjaxResult - */ - @Transactional(rollbackFor = Exception.class) - public ResponseDTO updateDepartment(DepartmentUpdateDTO updateDTO) { - if (updateDTO.getParentId() == null) { - return ResponseDTO.wrap(DepartmentResponseCodeConst.PARENT_ID_ERROR); - } - DepartmentEntity entity = departmentDao.selectById(updateDTO.getId()); - if (entity == null) { - return ResponseDTO.wrap(DepartmentResponseCodeConst.NOT_EXISTS); - } - DepartmentEntity departmentEntity = SmartBeanUtil.copy(updateDTO, DepartmentEntity.class); - departmentEntity.setSort(entity.getSort()); - departmentDao.updateById(departmentEntity); - return ResponseDTO.succ(); - } - - /** - * 根据id删除部门 - * 1、需要判断当前部门是否有子部门,有子部门则不允许删除 - * 2、需要判断当前部门是否有员工,有员工则不能删除 - * - * @param deptId - * @return - */ - @Transactional(rollbackFor = Exception.class) - public ResponseDTO delDepartment(Long deptId) { - DepartmentEntity departmentEntity = departmentDao.selectById(deptId); - if (null == departmentEntity) { - return ResponseDTO.wrap(DepartmentResponseCodeConst.DEPT_NOT_EXISTS); - } - // 是否有子级部门 - int subDepartmentNum = departmentDao.countSubDepartment(deptId); - if (subDepartmentNum > 0) { - return ResponseDTO.wrap(DepartmentResponseCodeConst.CANNOT_DEL_DEPARTMENT_WITH_CHILD); - } - - // 是否有未删除员工 - int employeeNum = employeeDao.countByDepartmentId(deptId, false); - if (employeeNum > 0) { - return ResponseDTO.wrap(DepartmentResponseCodeConst.CANNOT_DEL_DEPARTMENT_WITH_EMPLOYEE); - } - departmentDao.deleteById(deptId); - return ResponseDTO.succ(); - } - - /** - * 根据id获取部门信息 - * - * @param departmentId - * @return AjaxResult - */ - public ResponseDTO getDepartmentById(Long departmentId) { - DepartmentEntity departmentEntity = departmentDao.selectById(departmentId); - if (departmentEntity == null) { - return ResponseDTO.wrap(DepartmentResponseCodeConst.DEPT_NOT_EXISTS); - } - DepartmentVO departmentVO = SmartBeanUtil.copy(departmentEntity, DepartmentVO.class); - return ResponseDTO.succData(departmentVO); - } - - /** - * 获取所有部门 - * - * @return - */ - public ResponseDTO> listAll() { - List departmentVOList = departmentDao.listAll(); - return ResponseDTO.succData(departmentVOList); - } - - /** - * 上下移动 - * - * @param departmentId - * @param swapId - * @return - */ - @Transactional(rollbackFor = Exception.class) - public ResponseDTO upOrDown(Long departmentId, Long swapId) { - DepartmentEntity departmentEntity = departmentDao.selectById(departmentId); - if (departmentEntity == null) { - return ResponseDTO.wrap(DepartmentResponseCodeConst.NOT_EXISTS); - } - DepartmentEntity swapEntity = departmentDao.selectById(swapId); - if (swapEntity == null) { - return ResponseDTO.wrap(DepartmentResponseCodeConst.NOT_EXISTS); - } - Long departmentSort = departmentEntity.getSort(); - departmentEntity.setSort(swapEntity.getSort()); - departmentDao.updateById(departmentEntity); - swapEntity.setSort(departmentSort); - departmentDao.updateById(swapEntity); - return ResponseDTO.succ(); - } - - /** - * 部门升级 - * - * @param departmentId - * @return - */ - @Transactional(rollbackFor = Exception.class) - public ResponseDTO upgrade(Long departmentId) { - DepartmentEntity departmentEntity = departmentDao.selectById(departmentId); - if (departmentEntity == null) { - return ResponseDTO.wrap(DepartmentResponseCodeConst.NOT_EXISTS); - } - if (departmentEntity.getParentId() == null || departmentEntity.getParentId().equals(0)) { - return ResponseDTO.wrap(DepartmentResponseCodeConst.ERROR_PARAM, "此部门已经是根节点无法移动"); - } - DepartmentEntity parentEntity = departmentDao.selectById(departmentEntity.getParentId()); - - departmentEntity.setParentId(parentEntity.getParentId()); - departmentDao.updateById(departmentEntity); - return ResponseDTO.succ(); - } - - /** - * 部门降级 - * - * @param departmentId - * @param preId - * @return - */ - @Transactional(rollbackFor = Exception.class) - public ResponseDTO downgrade(Long departmentId, Long preId) { - DepartmentEntity departmentEntity = departmentDao.selectById(departmentId); - if (departmentEntity == null) { - return ResponseDTO.wrap(DepartmentResponseCodeConst.NOT_EXISTS); - } - DepartmentEntity preEntity = departmentDao.selectById(preId); - if (preEntity == null) { - return ResponseDTO.wrap(DepartmentResponseCodeConst.NOT_EXISTS); - } - departmentEntity.setParentId(preEntity.getId()); - departmentDao.updateById(departmentEntity); - return ResponseDTO.succ(); - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/department/DepartmentTreeService.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/department/DepartmentTreeService.java deleted file mode 100644 index b34a2678..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/department/DepartmentTreeService.java +++ /dev/null @@ -1,99 +0,0 @@ -package net.lab1024.smartadmin.module.system.department; - -import net.lab1024.smartadmin.module.system.department.domain.dto.DepartmentVO; -import com.google.common.collect.Lists; -import org.apache.commons.collections.CollectionUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.List; -import java.util.stream.Collectors; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/4/29 0029 下午 13:52 - * @since JDK1.8 - */ -@Service -public class DepartmentTreeService { - - @Autowired - private DepartmentDao departmentDao; - - /** - * 构建部门树结构 - * @param departmentVOList - * @return - */ - public List buildTree(List departmentVOList) { - if(CollectionUtils.isEmpty(departmentVOList)){ - return Lists.newArrayList(); - } - List list = departmentVOList.stream().filter(e -> e.getParentId() == null || e.getParentId() == 0).collect(Collectors.toList()); - if(CollectionUtils.isEmpty(list)){ - return Lists.newArrayList(); - } - this.buildTree(list,departmentVOList); - return list; - } - - private void buildTree(List nodeList,List departmentVOList){ - int nodeSize = nodeList.size(); - for(int i =0 ;i< nodeSize;i++){ - int preIndex = i-1; - int nextIndex = i+1; - DepartmentVO node = nodeList.get(i); - if(preIndex>-1){ - node.setPreId(nodeList.get(preIndex).getId()); - } - if(nextIndex departmentVOList) { - List children = getChildren(node, departmentVOList); - if (CollectionUtils.isNotEmpty(children)) { - node.setChildrenDepartment(children); - this.buildTree(children,departmentVOList); - } - } - - private List getChildren(DepartmentVO node, List departmentVOList) { - Long id = node.getId(); - return departmentVOList.stream().filter(e -> id.equals(e.getParentId())).collect(Collectors.toList()); - } - - - - /** - * 通过部门id,获取当前以及下属部门 - */ - public void buildIdList(Long deptId, List result) { - List departmentVOList = departmentDao.listAll(); - result.add(deptId); - if (null == deptId) { - result.addAll(departmentVOList.stream().map(DepartmentVO::getId).collect(Collectors.toList())); - return; - } - List children = getChildrenIdList(deptId, departmentVOList); - if (!children.isEmpty()) { - result.addAll(children.stream().map(DepartmentVO::getId).collect(Collectors.toList())); - for (DepartmentVO child : children) { - buildTree(child, departmentVOList); - } - } - } - - private List getChildrenIdList(Long deptId, List departmentVOList) { - return departmentVOList.stream().filter(e -> deptId.equals(e.getParentId())).collect(Collectors.toList()); - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/department/domain/dto/DepartmentUpdateDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/department/domain/dto/DepartmentUpdateDTO.java deleted file mode 100644 index f1b108a8..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/department/domain/dto/DepartmentUpdateDTO.java +++ /dev/null @@ -1,25 +0,0 @@ -package net.lab1024.smartadmin.module.system.department.domain.dto; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotNull; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - * @since JDK1.8 - */ -@Data -public class DepartmentUpdateDTO extends DepartmentCreateDTO { - - @ApiModelProperty("部门id") - @NotNull(message = "部门id不能为空") - private Long id; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/department/domain/dto/DepartmentVO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/department/domain/dto/DepartmentVO.java deleted file mode 100644 index 067e174d..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/department/domain/dto/DepartmentVO.java +++ /dev/null @@ -1,58 +0,0 @@ -package net.lab1024.smartadmin.module.system.department.domain.dto; - -import com.fasterxml.jackson.annotation.JsonProperty; -import net.lab1024.smartadmin.module.system.employee.domain.dto.EmployeeDTO; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.Date; -import java.util.List; - -@Data -public class DepartmentVO { - - @ApiModelProperty("部门id") - private Long id; - - @ApiModelProperty("部门名称") - private String name; - - @ApiModelProperty("部门简称") - private String shortName; - - @ApiModelProperty("部门负责人姓名") - private String managerName; - - @ApiModelProperty("部门负责人id") - private Long managerId; - - @ApiModelProperty("子部门") - @JsonProperty("children") - private List childrenDepartment; - - @ApiModelProperty("父级部门id") - private Long parentId; - - @ApiModelProperty("同级上一个元素id") - private Long preId; - - @ApiModelProperty("同级下一个元素id") - private Long nextId; - - @ApiModelProperty("排序") - private Long sort; - - @ApiModelProperty("父级部门名称") - private String parentName; - - @ApiModelProperty("部门员工列表") - private List employees; - - @ApiModelProperty("上次更新时间") - private Date updateTime; - - @ApiModelProperty("创建时间") - private Date createTime; - - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/department/domain/entity/DepartmentEntity.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/department/domain/entity/DepartmentEntity.java deleted file mode 100644 index 26023788..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/department/domain/entity/DepartmentEntity.java +++ /dev/null @@ -1,48 +0,0 @@ -package net.lab1024.smartadmin.module.system.department.domain.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import net.lab1024.smartadmin.common.domain.BaseEntity; -import lombok.Data; - -import java.io.Serializable; - -/** - * 部门实体类 - * t_department 数据表 - * - * @author listen - * @date 2017/12/19 10:45 - */ -@Data -@TableName(value = "t_department") -public class DepartmentEntity extends BaseEntity implements Serializable { - - private static final long serialVersionUID = -6787726615141147044L; - - /** - * 部门名称 - */ - private String name; - - /** - * 部门简称 - */ - private String shortName; - - /** - * 负责人员工 id - */ - private Long managerId; - - /** - * 部门父级id - */ - private Long parentId; - - /** - * 排序 - */ - private Long sort; - - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/EmployeeController.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/EmployeeController.java deleted file mode 100644 index 33c788e1..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/EmployeeController.java +++ /dev/null @@ -1,103 +0,0 @@ -package net.lab1024.smartadmin.module.system.employee; - -import net.lab1024.smartadmin.common.anno.NoValidPrivilege; -import net.lab1024.smartadmin.common.anno.OperateLog; -import net.lab1024.smartadmin.common.domain.PageResultDTO; -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.constant.SwaggerTagConst; -import net.lab1024.smartadmin.module.system.employee.domain.dto.*; -import net.lab1024.smartadmin.module.system.employee.domain.vo.EmployeeVO; -import net.lab1024.smartadmin.module.system.login.domain.RequestTokenBO; -import net.lab1024.smartadmin.util.SmartRequestTokenUtil; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.validation.Valid; -import java.util.List; - -/** - * 员工管理 - * - * @author lidoudou - * @date 2017年12月19日上午11:34:52 - */ -@RestController -@Api(tags = {SwaggerTagConst.Admin.MANAGER_USER}) -@OperateLog -public class EmployeeController { - - @Autowired - private EmployeeService employeeService; - - @PostMapping("/employee/query") - @ApiOperation(value = "员工管理查询", notes = "员工管理查询 @author lidoudou") - public ResponseDTO> query(@RequestBody EmployeeQueryDTO query) { - return employeeService.selectEmployeeList(query); - } - - @GetMapping("/employee/get/all") - @ApiOperation(value = "查询所有员工基本信息,用于选择框", notes = "查询所有员工基本信息,用于选择框") - @NoValidPrivilege - public ResponseDTO> getAll() { - return ResponseDTO.succData(employeeService.getAllEmployee()); - } - - @ApiOperation(value = "添加员工", notes = "@author yandanyang") - @PostMapping("/employee/add") - public ResponseDTO addEmployee(@Valid @RequestBody EmployeeAddDTO emp) { - RequestTokenBO requestToken = SmartRequestTokenUtil.getRequestUser(); - return employeeService.addEmployee(emp, requestToken); - } - - @ApiOperation(value = "禁用单个员工", notes = "@author yandanyang") - @GetMapping("/employee/updateStatus/{employeeId}/{status}") - public ResponseDTO updateStatus(@PathVariable("employeeId") Long employeeId, @PathVariable("status") Integer status) { - return employeeService.updateStatus(employeeId, status); - } - - @ApiOperation(value = "批量禁用", notes = "@author yandanyang") - @PostMapping("/employee/batchUpdateStatus") - public ResponseDTO batchUpdateStatus(@Valid @RequestBody EmployeeBatchUpdateStatusDTO batchUpdateStatusDTO) { - return employeeService.batchUpdateStatus(batchUpdateStatusDTO); - } - - @ApiOperation(value = "更新员工信息", notes = "@author yandanyang") - @PostMapping("/employee/update") - public ResponseDTO updateEmployee(@Valid @RequestBody EmployeeUpdateDTO employeeUpdateDto) { - return employeeService.updateEmployee(employeeUpdateDto); - } - - @ApiOperation(value = "删除员工信息", notes = "@author yandanyang") - @PostMapping("/employee/delete/{employeeId}") - public ResponseDTO deleteEmployeeById(@PathVariable("employeeId") Long employeeId) { - return employeeService.deleteEmployeeById(employeeId); - } - - @ApiOperation(value = "单个员工角色授权", notes = "@author yandanyang") - @PostMapping("/employee/updateRoles") - public ResponseDTO updateRoles(@Valid @RequestBody EmployeeUpdateRolesDTO updateRolesDTO) { - return employeeService.updateRoles(updateRolesDTO); - } - - @ApiOperation(value = "修改密码", notes = "@author yandanyang") - @PostMapping("/employee/updatePwd") - public ResponseDTO updatePwd(@Valid @RequestBody EmployeeUpdatePwdDTO updatePwdDTO) { - RequestTokenBO requestToken = SmartRequestTokenUtil.getRequestUser(); - return employeeService.updatePwd(updatePwdDTO, requestToken); - } - - @ApiOperation(value = "通过部门id获取当前部门的人员&没有部门的人", notes = "@author yandanyang") - @GetMapping("/employee/listEmployeeByDeptId/{deptId}") - public ResponseDTO> listEmployeeByDeptId(@PathVariable Long deptId) { - return employeeService.getEmployeeByDeptId(deptId); - } - - @ApiOperation(value = "员工重置密码", notes = "@author lizongliang") - @GetMapping("/employee/resetPasswd/{employeeId}") - public ResponseDTO resetPasswd(@PathVariable("employeeId") Integer employeeId) { - return employeeService.resetPasswd(employeeId); - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/EmployeeDao.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/EmployeeDao.java deleted file mode 100644 index d77779ea..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/EmployeeDao.java +++ /dev/null @@ -1,138 +0,0 @@ -package net.lab1024.smartadmin.module.system.employee; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import net.lab1024.smartadmin.module.system.employee.domain.dto.EmployeeDTO; -import net.lab1024.smartadmin.module.system.employee.domain.dto.EmployeeQueryDTO; -import net.lab1024.smartadmin.module.system.employee.domain.dto.EmployeeQueryExportDTO; -import net.lab1024.smartadmin.module.system.employee.domain.entity.EmployeeEntity; -import net.lab1024.smartadmin.module.system.employee.domain.vo.EmployeeVO; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Component; - -import java.util.Collection; -import java.util.List; - -/** - * 员工dao接口 - * - * @author lidoudou - * @date 2017年12月19日下午1:36:30 - */ -@Mapper -@Component -public interface EmployeeDao extends BaseMapper { - /** - * 查询员工列表 - * - * @param page - * @param queryDTO - * @return - */ - List selectEmployeeList(Page page, @Param("queryDTO") EmployeeQueryDTO queryDTO); - - /** - * 不带分页查询员工列表 - * - * @param queryDTO - * @return - */ - List selectEmployeeList(@Param("queryDTO") EmployeeQueryExportDTO queryDTO); - - /** - * 批量更新禁用状态 - * - * @param employeeIds - * @param isDisabled - */ - void batchUpdateStatus(@Param("employeeIds") List employeeIds, @Param("isDisabled") Integer isDisabled); - - /** - * 登录 - * - * @param loginName - * @param loginPwd - * @return - */ - EmployeeDTO login(@Param("loginName") String loginName, @Param("loginPwd") String loginPwd); - - /** - * 通过登录名查询 - * - * @param loginName - * @param isDisabled - * @return - */ - EmployeeDTO getByLoginName(@Param("loginName") String loginName, @Param("isDisabled") Integer isDisabled); - - /** - * 通过手机号查询 - * - * @param phone - * @param isDisabled - * @return - */ - EmployeeDTO getByPhone(@Param("phone") String phone, @Param("isDisabled") Integer isDisabled); - - /** - * 获取所有员工 - * - * @return - */ - List listAll(); - - /** - * 获取某个部门员工数 - * - * @param depId - * @param deleteFlag 可以null - * @return - */ - Integer countByDepartmentId(@Param("depId") Long depId, @Param("deleteFlag") Boolean deleteFlag); - - /** - * 获取一批员工 - * - * @param employeeIds - * @return - */ - List getEmployeeByIds(@Param("ids") Collection employeeIds); - - - EmployeeDTO getEmployeeById(@Param("id") Long employeeId); - - /** - * 获取某个部门的员工 - * - * @param departmentId - * @return - */ - List getEmployeeIdByDeptId(@Param("departmentId") Long departmentId); - - /** - * 获取某批部门的员工 - * - * @param departmentIds - * @return - */ - List getEmployeeIdByDeptIds(@Param("departmentIds") List departmentIds); - - - /** - * 员工重置密码 - * - * @param employeeId - * @param password - * @return - */ - Integer updatePassword(@Param("employeeId") Integer employeeId, @Param("password") String password); - - - /** - * 查询所有员工 - * - * @return - */ - List selectAll(); -} \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/EmployeeService.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/EmployeeService.java deleted file mode 100644 index a689bea2..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/EmployeeService.java +++ /dev/null @@ -1,369 +0,0 @@ -package net.lab1024.smartadmin.module.system.employee; - -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.google.common.collect.Lists; -import net.lab1024.smartadmin.common.constant.JudgeEnum; -import net.lab1024.smartadmin.common.domain.PageResultDTO; -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.constant.CommonConst; -import net.lab1024.smartadmin.module.system.department.DepartmentDao; -import net.lab1024.smartadmin.module.system.department.domain.entity.DepartmentEntity; -import net.lab1024.smartadmin.module.system.employee.constant.EmployeeResponseCodeConst; -import net.lab1024.smartadmin.module.system.employee.constant.EmployeeStatusEnum; -import net.lab1024.smartadmin.module.system.employee.domain.bo.EmployeeBO; -import net.lab1024.smartadmin.module.system.employee.domain.dto.*; -import net.lab1024.smartadmin.module.system.employee.domain.entity.EmployeeEntity; -import net.lab1024.smartadmin.module.system.employee.domain.vo.EmployeeVO; -import net.lab1024.smartadmin.module.system.login.domain.RequestTokenBO; -import net.lab1024.smartadmin.module.system.position.PositionDao; -import net.lab1024.smartadmin.module.system.position.PositionService; -import net.lab1024.smartadmin.module.system.position.domain.dto.PositionRelationAddDTO; -import net.lab1024.smartadmin.module.system.position.domain.dto.PositionRelationResultDTO; -import net.lab1024.smartadmin.module.system.privilege.service.PrivilegeEmployeeService; -import net.lab1024.smartadmin.module.system.role.roleemployee.RoleEmployeeDao; -import net.lab1024.smartadmin.module.system.role.roleemployee.domain.RoleEmployeeEntity; -import net.lab1024.smartadmin.util.SmartBeanUtil; -import net.lab1024.smartadmin.util.SmartDigestUtil; -import net.lab1024.smartadmin.util.SmartPageUtil; -import net.lab1024.smartadmin.util.SmartVerificationUtil; -import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.collections.map.HashedMap; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import java.util.regex.Pattern; -import java.util.stream.Collectors; - -/** - * 员工管理 - * - * @author lidoudou - * @date 2017年12月21日上午11:54:52 - */ -@Service -public class EmployeeService { - - private static final String RESET_PASSWORD = "123456"; - - @Autowired - private EmployeeDao employeeDao; - - @Autowired - private DepartmentDao departmentDao; - - @Autowired - private RoleEmployeeDao roleEmployeeDao; - - @Autowired - private PositionService positionService; - - @Autowired - private PositionDao positionDao; - - @Autowired - private PrivilegeEmployeeService privilegeEmployeeService; - - /** - * 员工基本信息的缓存 - */ - private static final ConcurrentHashMap employeeCache = new ConcurrentHashMap<>(); - - public List getAllEmployee() { - return employeeDao.selectAll(); - } - - public EmployeeBO getById(Long id) { - EmployeeBO employeeBO = employeeCache.get(id); - if (employeeBO == null) { - EmployeeEntity employeeEntity = employeeDao.selectById(id); - if (employeeEntity != null) { - Boolean superman = privilegeEmployeeService.isSuperman(id); - employeeBO = new EmployeeBO(employeeEntity, superman); - employeeCache.put(employeeEntity.getId(), employeeBO); - } - } - return employeeBO; - } - - /** - * 查询员工列表 - * - * @param queryDTO - * @return - */ - public ResponseDTO> selectEmployeeList(EmployeeQueryDTO queryDTO) { - Page pageParam = SmartPageUtil.convert2QueryPage(queryDTO); - queryDTO.setIsDelete(JudgeEnum.NO.getValue()); - List employeeList = employeeDao.selectEmployeeList(pageParam, queryDTO); - List employeeIdList = employeeList.stream().map(EmployeeDTO::getId).collect(Collectors.toList()); - - if (CollectionUtils.isNotEmpty(employeeIdList)) { - List positionRelationResultDTOList = positionDao.selectEmployeesRelation(employeeIdList); - Map> employeePositionMap = new HashedMap(); - - for (PositionRelationResultDTO positionRelationResultDTO : positionRelationResultDTOList) { - List relationResultDTOList = employeePositionMap.get(positionRelationResultDTO.getEmployeeId()); - //匹配对应的岗位 - if (relationResultDTOList == null) { - relationResultDTOList = new ArrayList<>(); - employeePositionMap.put(positionRelationResultDTO.getEmployeeId(), relationResultDTOList); - } - relationResultDTOList.add(positionRelationResultDTO); - } - - for (EmployeeDTO employeeDTO : employeeList) { - List relationResultDTOList = employeePositionMap.get(employeeDTO.getId()); - if (relationResultDTOList != null) { - employeeDTO.setPositionRelationList(relationResultDTOList); - employeeDTO.setPositionName(relationResultDTOList.stream().map(PositionRelationResultDTO::getPositionName).collect(Collectors.joining(","))); - } - } - } - return ResponseDTO.succData(SmartPageUtil.convert2PageResult(pageParam, employeeList, EmployeeVO.class)); - } - - /** - * 新增员工 - * - * @param employeeAddDto - * @param requestToken - * @return - */ - public ResponseDTO addEmployee(EmployeeAddDTO employeeAddDto, RequestTokenBO requestToken) { - EmployeeEntity entity = SmartBeanUtil.copy(employeeAddDto, EmployeeEntity.class); - if (StringUtils.isNotEmpty(employeeAddDto.getIdCard())) { - boolean checkResult = Pattern.matches(SmartVerificationUtil.ID_CARD, employeeAddDto.getIdCard()); - if (!checkResult) { - return ResponseDTO.wrap(EmployeeResponseCodeConst.ID_CARD_ERROR); - } - } - if (StringUtils.isNotEmpty(employeeAddDto.getBirthday())) { - boolean checkResult = Pattern.matches(SmartVerificationUtil.DATE, employeeAddDto.getBirthday()); - if (!checkResult) { - return ResponseDTO.wrap(EmployeeResponseCodeConst.BIRTHDAY_ERROR); - } - } - //同名员工 - EmployeeDTO sameNameEmployee = employeeDao.getByLoginName(entity.getLoginName(), EmployeeStatusEnum.NORMAL.getValue()); - if (null != sameNameEmployee) { - return ResponseDTO.wrap(EmployeeResponseCodeConst.LOGIN_NAME_EXISTS); - } - //同电话员工 - EmployeeDTO samePhoneEmployee = employeeDao.getByPhone(entity.getPhone(), EmployeeStatusEnum.NORMAL.getValue()); - if (null != samePhoneEmployee) { - return ResponseDTO.wrap(EmployeeResponseCodeConst.PHONE_EXISTS); - } - Long departmentId = entity.getDepartmentId(); - DepartmentEntity department = departmentDao.selectById(departmentId); - if (department == null) { - return ResponseDTO.wrap(EmployeeResponseCodeConst.DEPT_NOT_EXIST); - } - - //如果没有密码 默认设置为123456 - String pwd = entity.getLoginPwd(); - if (StringUtils.isBlank(pwd)) { - entity.setLoginPwd(SmartDigestUtil.encryptPassword(CommonConst.Password.SALT_FORMAT, RESET_PASSWORD)); - } else { - entity.setLoginPwd(SmartDigestUtil.encryptPassword(CommonConst.Password.SALT_FORMAT, entity.getLoginPwd())); - } - - entity.setCreateUser(requestToken.getRequestUserId()); - if (StringUtils.isEmpty(entity.getBirthday())) { - entity.setBirthday(null); - } - employeeDao.insert(entity); - - PositionRelationAddDTO positionRelAddDTO = new PositionRelationAddDTO(employeeAddDto.getPositionIdList(), entity.getId()); - //存储所选岗位信息 - positionService.addPositionRelation(positionRelAddDTO); - - return ResponseDTO.succ(); - } - - /** - * 更新禁用状态 - * - * @param employeeId - * @param status - * @return - */ - public ResponseDTO updateStatus(Long employeeId, Integer status) { - if (null == employeeId) { - return ResponseDTO.wrap(EmployeeResponseCodeConst.EMP_NOT_EXISTS); - } - EmployeeBO entity = getById(employeeId); - if (null == entity) { - return ResponseDTO.wrap(EmployeeResponseCodeConst.EMP_NOT_EXISTS); - } - List empIds = Lists.newArrayList(); - empIds.add(employeeId); - employeeDao.batchUpdateStatus(empIds, status); - employeeCache.remove(employeeId); - return ResponseDTO.succ(); - } - - /** - * 批量更新员工状态 - * - * @param batchUpdateStatusDTO - * @return - */ - public ResponseDTO batchUpdateStatus(EmployeeBatchUpdateStatusDTO batchUpdateStatusDTO) { - employeeDao.batchUpdateStatus(batchUpdateStatusDTO.getEmployeeIds(), batchUpdateStatusDTO.getStatus()); - if (batchUpdateStatusDTO.getEmployeeIds() != null) { - batchUpdateStatusDTO.getEmployeeIds().forEach(e -> employeeCache.remove(e)); - } - return ResponseDTO.succ(); - } - - /** - * 更新员工 - * - * @param updateDTO - * @return - */ - public ResponseDTO updateEmployee(EmployeeUpdateDTO updateDTO) { - Long employeeId = updateDTO.getId(); - EmployeeEntity employeeEntity = employeeDao.selectById(employeeId); - if (null == employeeEntity) { - return ResponseDTO.wrap(EmployeeResponseCodeConst.EMP_NOT_EXISTS); - } - if (StringUtils.isNotBlank(updateDTO.getIdCard())) { - boolean checkResult = Pattern.matches(SmartVerificationUtil.ID_CARD, updateDTO.getIdCard()); - if (!checkResult) { - return ResponseDTO.wrap(EmployeeResponseCodeConst.ID_CARD_ERROR); - } - } - if (StringUtils.isNotEmpty(updateDTO.getBirthday())) { - boolean checkResult = Pattern.matches(SmartVerificationUtil.DATE, updateDTO.getBirthday()); - if (!checkResult) { - return ResponseDTO.wrap(EmployeeResponseCodeConst.BIRTHDAY_ERROR); - } - } - Long departmentId = updateDTO.getDepartmentId(); - DepartmentEntity departmentEntity = departmentDao.selectById(departmentId); - if (departmentEntity == null) { - return ResponseDTO.wrap(EmployeeResponseCodeConst.DEPT_NOT_EXIST); - } - EmployeeDTO sameNameEmployee = employeeDao.getByLoginName(updateDTO.getLoginName(), EmployeeStatusEnum.NORMAL.getValue()); - if (null != sameNameEmployee && !sameNameEmployee.getId().equals(employeeId)) { - return ResponseDTO.wrap(EmployeeResponseCodeConst.LOGIN_NAME_EXISTS); - } - EmployeeDTO samePhoneEmployee = employeeDao.getByPhone(updateDTO.getLoginName(), EmployeeStatusEnum.NORMAL.getValue()); - if (null != samePhoneEmployee && !samePhoneEmployee.getId().equals(employeeId)) { - return ResponseDTO.wrap(EmployeeResponseCodeConst.PHONE_EXISTS); - } - String newPwd = updateDTO.getLoginPwd(); - if (!StringUtils.isBlank(newPwd)) { - updateDTO.setLoginPwd(SmartDigestUtil.encryptPassword(CommonConst.Password.SALT_FORMAT, updateDTO.getLoginPwd())); - } else { - updateDTO.setLoginPwd(employeeEntity.getLoginPwd()); - } - EmployeeEntity entity = SmartBeanUtil.copy(updateDTO, EmployeeEntity.class); - entity.setUpdateTime(new Date()); - if (StringUtils.isEmpty(entity.getBirthday())) { - entity.setBirthday(null); - } - if (CollectionUtils.isNotEmpty(updateDTO.getPositionIdList())) { - //删除旧的关联关系 添加新的关联关系 - positionService.removePositionRelation(entity.getId()); - PositionRelationAddDTO positionRelAddDTO = new PositionRelationAddDTO(updateDTO.getPositionIdList(), entity.getId()); - positionService.addPositionRelation(positionRelAddDTO); - } - entity.setIsDisabled(employeeEntity.getIsDisabled()); - entity.setIsLeave(employeeEntity.getIsLeave()); - entity.setCreateUser(employeeEntity.getCreateUser()); - entity.setCreateTime(employeeEntity.getCreateTime()); - entity.setUpdateTime(new Date()); - employeeDao.updateById(entity); - employeeCache.remove(employeeId); - return ResponseDTO.succ(); - } - - /** - * 删除员工 - * - * @param employeeId 员工ID - * @return - */ - public ResponseDTO deleteEmployeeById(Long employeeId) { - EmployeeEntity employeeEntity = employeeDao.selectById(employeeId); - if (null == employeeEntity) { - return ResponseDTO.wrap(EmployeeResponseCodeConst.EMP_NOT_EXISTS); - } - //假删 - employeeEntity.setIsDelete(JudgeEnum.YES.getValue().longValue()); - employeeDao.updateById(employeeEntity); - employeeCache.remove(employeeId); - return ResponseDTO.succ(); - } - - /** - * 更新用户角色 - * - * @param updateRolesDTO - * @return - */ - public ResponseDTO updateRoles(EmployeeUpdateRolesDTO updateRolesDTO) { - roleEmployeeDao.deleteByEmployeeId(updateRolesDTO.getEmployeeId()); - if (CollectionUtils.isNotEmpty(updateRolesDTO.getRoleIds())) { - List roleEmployeeEntities = Lists.newArrayList(); - RoleEmployeeEntity roleEmployeeEntity; - for (Long roleId : updateRolesDTO.getRoleIds()) { - roleEmployeeEntity = new RoleEmployeeEntity(); - roleEmployeeEntity.setEmployeeId(updateRolesDTO.getEmployeeId()); - roleEmployeeEntity.setRoleId(roleId); - roleEmployeeEntities.add(roleEmployeeEntity); - } - roleEmployeeDao.batchInsert(roleEmployeeEntities); - } - return ResponseDTO.succ(); - } - - /** - * 更新密码 - * - * @param updatePwdDTO - * @param requestToken - * @return - */ - public ResponseDTO updatePwd(EmployeeUpdatePwdDTO updatePwdDTO, RequestTokenBO requestToken) { - Long employeeId = requestToken.getRequestUserId(); - EmployeeEntity employee = employeeDao.selectById(employeeId); - if (employee == null) { - return ResponseDTO.wrap(EmployeeResponseCodeConst.EMP_NOT_EXISTS); - } - if (!employee.getLoginPwd().equals(SmartDigestUtil.encryptPassword(CommonConst.Password.SALT_FORMAT, updatePwdDTO.getOldPwd()))) { - return ResponseDTO.wrap(EmployeeResponseCodeConst.PASSWORD_ERROR); - } - employee.setLoginPwd(SmartDigestUtil.encryptPassword(CommonConst.Password.SALT_FORMAT, updatePwdDTO.getPwd())); - employeeDao.updateById(employee); - employeeCache.remove(employeeId); - return ResponseDTO.succ(); - } - - public ResponseDTO> getEmployeeByDeptId(Long departmentId) { - List list = employeeDao.getEmployeeIdByDeptId(departmentId); - return ResponseDTO.succData(list); - } - - /** - * 重置密码 - * - * @param employeeId - * @return - */ - public ResponseDTO resetPasswd(Integer employeeId) { - String md5Password = SmartDigestUtil.encryptPassword(CommonConst.Password.SALT_FORMAT, RESET_PASSWORD); - employeeDao.updatePassword(employeeId, md5Password); - employeeCache.remove(employeeId); - return ResponseDTO.succ(); - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/constant/EmployeeResponseCodeConst.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/constant/EmployeeResponseCodeConst.java deleted file mode 100644 index 379b8be7..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/constant/EmployeeResponseCodeConst.java +++ /dev/null @@ -1,61 +0,0 @@ -package net.lab1024.smartadmin.module.system.employee.constant; - -import net.lab1024.smartadmin.common.constant.ResponseCodeConst; - -/** - * 员工常量类 - * 3001-3999 - * - * @author lidoudou - * @date 2017年12月19日下午19:04:52 - */ -public class EmployeeResponseCodeConst extends ResponseCodeConst { - - /** - * 员工不存在 - */ - public static final EmployeeResponseCodeConst EMP_NOT_EXISTS = new EmployeeResponseCodeConst(3001, "员工不存在!"); - - /** - * 更新员工信息失败 - */ - public static final EmployeeResponseCodeConst UPDATE_FAILED = new EmployeeResponseCodeConst(3002, "员工更新失败!"); - - /** - * 部门信息不存在 - */ - public static final EmployeeResponseCodeConst DEPT_NOT_EXIST = new EmployeeResponseCodeConst(3003, "部门信息不存在!"); - - /** - * 用户名或密码错误 - */ - public static final EmployeeResponseCodeConst LOGIN_FAILED = new EmployeeResponseCodeConst(3004, "用户名或密码错误!"); - - /** - * 您的账号已被禁用,不得登录系统 - */ - public static final EmployeeResponseCodeConst IS_DISABLED = new EmployeeResponseCodeConst(3005, "您的账号已被禁用,不得登录系统!"); - - /** - * 登录名已存在 - */ - public static final EmployeeResponseCodeConst LOGIN_NAME_EXISTS = new EmployeeResponseCodeConst(3006, "登录名已存在!"); - /** - * 密码输入有误,请重新输入 10115 - */ - public static final EmployeeResponseCodeConst PASSWORD_ERROR = new EmployeeResponseCodeConst(3007, "密码输入有误,请重新输入"); - /** - * 手机号已存在 - */ - public static final EmployeeResponseCodeConst PHONE_EXISTS = new EmployeeResponseCodeConst(3008, "手机号已经存在"); - - public static final EmployeeResponseCodeConst ID_CARD_ERROR = new EmployeeResponseCodeConst(3009, "请输入正确的身份证号"); - - public static final EmployeeResponseCodeConst BIRTHDAY_ERROR = new EmployeeResponseCodeConst(3010, "生日格式不正确"); - - public static final EmployeeResponseCodeConst VERIFICATION_CODE_INVALID = new EmployeeResponseCodeConst(3011, "验证码无效"); - - public EmployeeResponseCodeConst(int code, String msg) { - super(code, msg); - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/constant/EmployeeStatusEnum.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/constant/EmployeeStatusEnum.java deleted file mode 100644 index 3c07ce72..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/constant/EmployeeStatusEnum.java +++ /dev/null @@ -1,56 +0,0 @@ -package net.lab1024.smartadmin.module.system.employee.constant; - -import net.lab1024.smartadmin.common.domain.BaseEnum; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/3/27 0027 下午 16:22 - * @since JDK1.8 - */ - -public enum EmployeeStatusEnum implements BaseEnum { - - /** - * 用户正常状态 1 - */ - NORMAL(0, "正常"), - - /** - * 用户已被禁用 0 - */ - DISABLED(1, "禁用"); - - private Integer value; - - private String desc; - - EmployeeStatusEnum(Integer value, String desc) { - this.value = value; - this.desc = desc; - } - - /** - * 获取枚举类的值 - * - * @return Integer - */ - @Override - public Integer getValue() { - return value; - } - - /** - * 获取枚举类的说明 - * - * @return String - */ - @Override - public String getDesc() { - return this.desc; - } -} \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/bo/EmployeeBO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/bo/EmployeeBO.java deleted file mode 100644 index 57050a5c..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/bo/EmployeeBO.java +++ /dev/null @@ -1,73 +0,0 @@ -package net.lab1024.smartadmin.module.system.employee.domain.bo; - -import net.lab1024.smartadmin.module.system.employee.domain.entity.EmployeeEntity; -import lombok.Getter; - - -@Getter -public class EmployeeBO { - - /** - * 主键id - */ - private Long id; - - /** - * 登录账号 - */ - private String loginName; - - /** - * 员工名称 - */ - private String actualName; - - /** - * 别名 - */ - private String nickName; - - /** - * 手机号码 - */ - private String phone; - - /** - * 部门id - */ - private Long departmentId; - - /** - * 是否离职 - */ - private Integer isLeave; - - /** - * 是否被禁用 - */ - private Integer isDisabled; - - /** - * 删除状态 0否 1是 - */ - private Long isDelete; - - /** - * 是否为超级管理员 - */ - private Boolean isSuperman; - - public EmployeeBO(EmployeeEntity employeeEntity, boolean isSuperman) { - this.id = employeeEntity.getId(); - this.loginName = employeeEntity.getLoginName(); - this.actualName = employeeEntity.getActualName(); - this.nickName = employeeEntity.getNickName(); - this.phone = employeeEntity.getPhone(); - this.departmentId = employeeEntity.getDepartmentId(); - this.isLeave = employeeEntity.getIsLeave(); - this.isDisabled = employeeEntity.getIsDisabled(); - this.isDelete = employeeEntity.getIsDelete(); - this.isSuperman = isSuperman; - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/dto/EmployeeAddDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/dto/EmployeeAddDTO.java deleted file mode 100644 index bb1ac368..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/dto/EmployeeAddDTO.java +++ /dev/null @@ -1,63 +0,0 @@ -package net.lab1024.smartadmin.module.system.employee.domain.dto; - -import net.lab1024.smartadmin.util.SmartVerificationUtil; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Pattern; -import java.util.List; - -/** - * 添加员工 - * - * @author lidoudou - * @date 2017年12月19日下午2:06:31 - */ -@Data -public class EmployeeAddDTO { - - @ApiModelProperty("姓名") - @NotNull(message = "姓名不能为空") - private String actualName; - - @ApiModelProperty("登录名") - @NotNull(message = "姓名不能为空") - private String loginName; - - @ApiModelProperty("别名") - private String nickName; - - @ApiModelProperty("部门id") - @NotNull(message = "部门id不能为空") - private Long departmentId; - - @ApiModelProperty("是否启用") - @NotNull(message = "是否被禁用不能为空") - private Integer isDisabled; - - @ApiModelProperty("手机号") - @NotNull(message = "手机号不能为空") - @Pattern(regexp = SmartVerificationUtil.PHONE_REGEXP, message = "手机号格式不正确") - private String phone; - - @ApiModelProperty("身份证(可选)") - private String idCard; - - @ApiModelProperty("生日(可选)") - private String birthday; - - @ApiModelProperty("密码") - // @NotNull(message = "密码不能为空") - // @Length(min = 6, message = "密码最少为6位字符") - private String loginPwd; - - @ApiModelProperty("邮箱") - private String email; - - @ApiModelProperty("岗位ID 集合") - @NotEmpty(message = "岗位ID 集合不能为空") - private List positionIdList; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/dto/EmployeeBaseDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/dto/EmployeeBaseDTO.java deleted file mode 100644 index 0931bdb4..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/dto/EmployeeBaseDTO.java +++ /dev/null @@ -1,52 +0,0 @@ -package net.lab1024.smartadmin.module.system.employee.domain.dto; - -import net.lab1024.smartadmin.util.SmartVerificationUtil; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Pattern; - -/** - * 添加员工 - * - * @author lidoudou - * @date 2017年12月19日下午2:06:31 - */ -@Data -public class EmployeeBaseDTO { - - @ApiModelProperty("姓名") - @NotNull(message = "姓名不能为空") - private String actualName; - - @ApiModelProperty("登录名") - @NotNull(message = "姓名不能为空") - private String loginName; - - @ApiModelProperty("别名") - private String nickName; - - @ApiModelProperty("部门id") - @NotNull(message = "部门id不能为空") - private Long departmentId; - - @ApiModelProperty("是否启用") - @NotNull(message = "是否被禁用不能为空") - private Integer isDisabled; - - @ApiModelProperty("手机号") - @NotNull(message = "手机号不能为空") - @Pattern(regexp = SmartVerificationUtil.PHONE_REGEXP, message = "手机号格式不正确") - private String phone; - - @ApiModelProperty("身份证(可选)") - private String idCard; - - @ApiModelProperty("生日(可选)") - private String birthday; - - @ApiModelProperty("邮箱") - private String email; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/dto/EmployeeBatchUpdateStatusDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/dto/EmployeeBatchUpdateStatusDTO.java deleted file mode 100644 index 7d9db716..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/dto/EmployeeBatchUpdateStatusDTO.java +++ /dev/null @@ -1,26 +0,0 @@ -package net.lab1024.smartadmin.module.system.employee.domain.dto; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotNull; -import java.util.List; - -/** - * 批量更新 - * - * @author lidoudou - * @date 2017年12月21日上午13:17:52 - */ -@Data -public class EmployeeBatchUpdateStatusDTO { - - @ApiModelProperty("员工ids") - @NotNull(message = "员工ids不能为空") - private List employeeIds; - - @ApiModelProperty("状态") - @NotNull(message = "状态不能为空") - private Integer status; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/dto/EmployeeDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/dto/EmployeeDTO.java deleted file mode 100644 index 61b49e1a..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/dto/EmployeeDTO.java +++ /dev/null @@ -1,73 +0,0 @@ -package net.lab1024.smartadmin.module.system.employee.domain.dto; - -import com.fasterxml.jackson.annotation.JsonFormat; -import net.lab1024.smartadmin.module.system.position.domain.dto.PositionRelationResultDTO; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.Date; -import java.util.List; - -/** - * 员工列表DTO - * - * @author lidoudou - * @date 2017年12月21日上午09:09:31 - */ -@Data -public class EmployeeDTO { - - @ApiModelProperty("主键id") - private Long id; - - @ApiModelProperty("登录账号") - private String loginName; - - @ApiModelProperty("别名") - private String nickName; - - @ApiModelProperty("员工名称") - private String actualName; - - @ApiModelProperty("手机号码") - private String phone; - - @ApiModelProperty("身份证") - private String idCard; - - @ApiModelProperty("出生日期") - @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") - private Date birthday; - - @ApiModelProperty("创建者id") - private Long createUser; - - @ApiModelProperty("部门id") - private Long departmentId; - - @ApiModelProperty("是否离职") - private Integer isLeave; - - @ApiModelProperty("是否被禁用") - private Integer isDisabled; - - @ApiModelProperty("是否删除") - private Integer isDelete; - - @ApiModelProperty("部门名称") - private String departmentName; - - @ApiModelProperty("邮箱") - private String email; - - @ApiModelProperty("创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private Date createTime; - - @ApiModelProperty("岗位关联信息") - private List positionRelationList; - - @ApiModelProperty("岗位名称") - private String positionName; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/dto/EmployeeLoginFormDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/dto/EmployeeLoginFormDTO.java deleted file mode 100644 index 0bf1f1a3..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/dto/EmployeeLoginFormDTO.java +++ /dev/null @@ -1,31 +0,0 @@ -package net.lab1024.smartadmin.module.system.employee.domain.dto; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotNull; - -/** - * 登录 - * - * @author lidoudou - * @date 2017年12月19日上午11:49:46 - */ -@Data -public class EmployeeLoginFormDTO { - - @NotNull(message = "登录名不能为空") - @ApiModelProperty(example = "sa") - private String loginName; - - @NotNull(message = "密码不能为空") - @ApiModelProperty(example = "123456") - private String loginPwd; - - @ApiModelProperty(value = "验证码uuid") - private String codeUuid; - - @ApiModelProperty(value = "验证码") - private String code; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/dto/EmployeeQueryDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/dto/EmployeeQueryDTO.java deleted file mode 100644 index e384a4da..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/dto/EmployeeQueryDTO.java +++ /dev/null @@ -1,39 +0,0 @@ -package net.lab1024.smartadmin.module.system.employee.domain.dto; - -import net.lab1024.smartadmin.common.domain.PageParamDTO; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.List; - -/** - * 员工列表DTO - * - * @author lidoudou - * @date 2017年12月21日上午09:09:31 - */ -@Data -public class EmployeeQueryDTO extends PageParamDTO { - - private String phone; - - private String actualName; - - private String keyword; - - private Long departmentId; - - private Integer isLeave; - - private Integer isDisabled; - - /** - * 删除状态 0否 1是 - */ - @ApiModelProperty("删除状态 0否 1是 不需要传") - private Integer isDelete; - - @ApiModelProperty("员工id集合") - private List employeeIds; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/dto/EmployeeQueryExportDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/dto/EmployeeQueryExportDTO.java deleted file mode 100644 index 645bd213..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/dto/EmployeeQueryExportDTO.java +++ /dev/null @@ -1,42 +0,0 @@ -package net.lab1024.smartadmin.module.system.employee.domain.dto; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.List; - -/** - * @author zzr - * 不带分页的查询条件 - */ -@Data -public class EmployeeQueryExportDTO { - - @ApiModelProperty(hidden = true) - private String phone; - - @ApiModelProperty("姓名") - private String actualName; - - @ApiModelProperty(hidden = true) - private String keyword; - - @ApiModelProperty(hidden = true) - private Long departmentId; - - @ApiModelProperty(hidden = true) - private Integer isLeave; - - @ApiModelProperty(hidden = true) - private Integer isDisabled; - - /** - * 删除状态 0否 1是 - */ - @ApiModelProperty(value = "删除状态 0否 1是 不需要传", hidden = true) - private Integer isDelete; - - @ApiModelProperty(value = "员工ID集合", hidden = true) - private List employeeIds; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/dto/EmployeeUpdateDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/dto/EmployeeUpdateDTO.java deleted file mode 100644 index d835c522..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/dto/EmployeeUpdateDTO.java +++ /dev/null @@ -1,28 +0,0 @@ -package net.lab1024.smartadmin.module.system.employee.domain.dto; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotNull; -import java.util.List; - -/** - * 添加员工 - * - * @author lidoudou - * @date 2017年12月19日下午2:06:31 - */ -@Data -public class EmployeeUpdateDTO extends EmployeeBaseDTO { - - @ApiModelProperty("员工id") - @NotNull(message = "员工id不能为空") - private Long id; - - @ApiModelProperty("密码") - private String loginPwd; - - @ApiModelProperty("岗位ID 集合") - private List positionIdList; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/dto/EmployeeUpdatePwdDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/dto/EmployeeUpdatePwdDTO.java deleted file mode 100644 index f5841c31..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/dto/EmployeeUpdatePwdDTO.java +++ /dev/null @@ -1,25 +0,0 @@ -package net.lab1024.smartadmin.module.system.employee.domain.dto; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotNull; - -/** - * 修改密码所需参数 - * - * @author cyj - * @date 2018-02-23 下午 4:53 - */ -@Data -public class EmployeeUpdatePwdDTO { - - @ApiModelProperty("新密码") - @NotNull - private String pwd; - - @ApiModelProperty("原密码") - @NotNull - private String oldPwd; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/dto/EmployeeUpdateRolesDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/dto/EmployeeUpdateRolesDTO.java deleted file mode 100644 index 2829ba1a..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/dto/EmployeeUpdateRolesDTO.java +++ /dev/null @@ -1,29 +0,0 @@ -package net.lab1024.smartadmin.module.system.employee.domain.dto; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotNull; -import java.util.List; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - * @since JDK1.8 - */ -@Data -public class EmployeeUpdateRolesDTO { - - @ApiModelProperty("员工id") - @NotNull(message = "员工id不能为空") - private Long employeeId; - - @ApiModelProperty("角色ids") - private List roleIds; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/entity/EmployeeEntity.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/entity/EmployeeEntity.java deleted file mode 100644 index 1744ee1b..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/entity/EmployeeEntity.java +++ /dev/null @@ -1,91 +0,0 @@ -package net.lab1024.smartadmin.module.system.employee.domain.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import net.lab1024.smartadmin.common.domain.BaseEntity; -import lombok.Data; - -import java.io.Serializable; - -/** - * 员工实体类 - * - * @author lidoudou - * @date 2017年12月19日下午1:34:48 - */ -@Data -@TableName("t_employee") -public class EmployeeEntity extends BaseEntity implements Serializable { - - private static final long serialVersionUID = -8794328598524272806L; - - /** - * 登录账号 - */ - private String loginName; - - /** - * 登录密码 - */ - private String loginPwd; - - /** - * 员工名称 - */ - private String actualName; - - /** - * 别名 - */ - private String nickName; - - /** - * 手机号码 - */ - private String phone; - - /** - * 身份证 - */ - private String idCard; - - /** - * 出生日期 - */ - private String birthday; - - - /** - * 部门id - */ - private Long departmentId; - - /** - * 是否离职 - */ - private Integer isLeave; - - /** - * 是否被禁用 - */ - private Integer isDisabled; - /** - * 邮箱 - */ - private String email; - - /** - * 备注 - */ - private String remark; - - /** - * 创建者id - */ - private Long createUser; - - /** - * 删除状态 0否 1是 - */ - private Long isDelete; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/vo/EmployeeVO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/vo/EmployeeVO.java deleted file mode 100644 index a180d59b..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/employee/domain/vo/EmployeeVO.java +++ /dev/null @@ -1,72 +0,0 @@ -package net.lab1024.smartadmin.module.system.employee.domain.vo; - -import com.fasterxml.jackson.annotation.JsonFormat; -import net.lab1024.smartadmin.module.system.position.domain.dto.PositionRelationResultDTO; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.Date; -import java.util.List; - -/** - * @author bhr - * @Description: 员工信息 - * @date 2019/8/28 9:04 - */ - -@Data -public class EmployeeVO { - - @ApiModelProperty("主键id") - private Long id; - - @ApiModelProperty("登录账号") - private String loginName; - - @ApiModelProperty("别名") - private String nickName; - - @ApiModelProperty("员工名称") - private String actualName; - - @ApiModelProperty("手机号码") - private String phone; - - @ApiModelProperty("身份证") - private String idCard; - - @ApiModelProperty("出生日期") - @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") - private Date birthday; - - @ApiModelProperty("创建者id") - private Long createUser; - - @ApiModelProperty("部门id") - private Long departmentId; - - @ApiModelProperty("是否离职") - private Integer isLeave; - - @ApiModelProperty("是否被禁用") - private Integer isDisabled; - - @ApiModelProperty("是否删除") - private Integer isDelete; - - @ApiModelProperty("部门名称") - private String departmentName; - - @ApiModelProperty("邮箱") - private String email; - - @ApiModelProperty("创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private Date createTime; - - @ApiModelProperty("岗位关联信息") - private List positionRelationList; - - @ApiModelProperty("岗位名称") - private String positionName; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/login/LoginController.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/login/LoginController.java deleted file mode 100644 index 414c9ad4..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/login/LoginController.java +++ /dev/null @@ -1,71 +0,0 @@ -package net.lab1024.smartadmin.module.system.login; - -import net.lab1024.smartadmin.common.anno.NoNeedLogin; -import net.lab1024.smartadmin.common.anno.NoValidPrivilege; -import net.lab1024.smartadmin.common.anno.OperateLog; -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.constant.SwaggerTagConst; -import net.lab1024.smartadmin.module.system.employee.domain.dto.EmployeeLoginFormDTO; -import net.lab1024.smartadmin.module.system.login.domain.KaptchaVO; -import net.lab1024.smartadmin.module.system.login.domain.LoginDetailVO; -import net.lab1024.smartadmin.module.system.login.domain.RequestTokenBO; -import net.lab1024.smartadmin.util.SmartRequestTokenUtil; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -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.RequestBody; -import org.springframework.web.bind.annotation.RestController; - -import javax.servlet.http.HttpServletRequest; -import javax.validation.Valid; - -/** - * 后台登录 - * - * @author lidoudou - * @date 2017年12月19日上午11:46:04 - */ -@RestController -@Api(tags = {SwaggerTagConst.Admin.MANAGER_USER_LOGIN}) -@OperateLog -public class LoginController { - - @Autowired - private LoginService loginService; - - @PostMapping("/session/login") - @ApiOperation(value = "登录", notes = "登录") - @NoNeedLogin - public ResponseDTO login(@Valid @RequestBody EmployeeLoginFormDTO loginForm, HttpServletRequest request) { - return loginService.login(loginForm, request); - } - - @GetMapping("/session/get") - @ApiOperation(value = "获取session", notes = "获取session") - @NoValidPrivilege - public ResponseDTO getSession() { - RequestTokenBO requestUser = SmartRequestTokenUtil.getRequestUser(); - return ResponseDTO.succData(loginService.getSession(requestUser)); - } - - @GetMapping("/session/logOut") - @ApiOperation(value = "退出登陆", notes = "退出登陆") - @NoValidPrivilege - public ResponseDTO logOut() { - RequestTokenBO requestToken = SmartRequestTokenUtil.getRequestUser(); - if (null == requestToken) { - return ResponseDTO.wrap(LoginResponseCodeConst.LOGIN_ERROR); - } - return loginService.logoutByToken(requestToken); - } - - @GetMapping("/session/verificationCode") - @ApiOperation(value = "获取验证码", notes = "获取验证码") - @NoNeedLogin - public ResponseDTO verificationCode() { - return loginService.verificationCode(); - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/login/LoginResponseCodeConst.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/login/LoginResponseCodeConst.java deleted file mode 100644 index 0cfb8d22..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/login/LoginResponseCodeConst.java +++ /dev/null @@ -1,21 +0,0 @@ -package net.lab1024.smartadmin.module.system.login; - -import net.lab1024.smartadmin.common.constant.ResponseCodeConst; - -/** - * 员工常量类 - * 1001-1999 - * - * @author lidoudou - * @date 2017年12月19日下午19:04:52 - */ -public class LoginResponseCodeConst extends ResponseCodeConst { - - public static final LoginResponseCodeConst LOGIN_ERROR = new LoginResponseCodeConst(1001, "您还未登录或登录失效,请重新登录!"); - - public static final LoginResponseCodeConst NOT_HAVE_PRIVILEGES = new LoginResponseCodeConst(1002, "对不起,您没有权限哦!"); - - public LoginResponseCodeConst(int code, String msg) { - super(code, msg); - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/login/LoginService.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/login/LoginService.java deleted file mode 100644 index 070a9ff4..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/login/LoginService.java +++ /dev/null @@ -1,215 +0,0 @@ -package net.lab1024.smartadmin.module.system.login; - -import net.lab1024.smartadmin.common.constant.JudgeEnum; -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.constant.CommonConst; -import net.lab1024.smartadmin.module.system.department.DepartmentDao; -import net.lab1024.smartadmin.module.system.department.domain.entity.DepartmentEntity; -import net.lab1024.smartadmin.module.system.employee.EmployeeDao; -import net.lab1024.smartadmin.module.system.employee.constant.EmployeeResponseCodeConst; -import net.lab1024.smartadmin.module.system.employee.constant.EmployeeStatusEnum; -import net.lab1024.smartadmin.module.system.employee.domain.dto.EmployeeDTO; -import net.lab1024.smartadmin.module.system.employee.domain.dto.EmployeeLoginFormDTO; -import net.lab1024.smartadmin.module.business.log.LogService; -import net.lab1024.smartadmin.module.business.log.userloginlog.domain.UserLoginLogEntity; -import net.lab1024.smartadmin.module.system.login.domain.KaptchaVO; -import net.lab1024.smartadmin.module.system.login.domain.LoginDetailVO; -import net.lab1024.smartadmin.module.system.login.domain.LoginPrivilegeDTO; -import net.lab1024.smartadmin.module.system.login.domain.RequestTokenBO; -import net.lab1024.smartadmin.module.system.privilege.domain.entity.PrivilegeEntity; -import net.lab1024.smartadmin.module.system.privilege.service.PrivilegeEmployeeService; -import net.lab1024.smartadmin.util.SmartBeanUtil; -import net.lab1024.smartadmin.util.SmartDigestUtil; -import net.lab1024.smartadmin.util.SmartIPUtil; -import com.google.code.kaptcha.impl.DefaultKaptcha; -import eu.bitwalker.useragentutils.UserAgent; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.codec.binary.Base64; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.redis.core.ValueOperations; -import org.springframework.stereotype.Service; - -import javax.imageio.ImageIO; -import javax.servlet.http.HttpServletRequest; -import javax.validation.Valid; -import java.awt.image.BufferedImage; -import java.io.ByteArrayOutputStream; -import java.util.List; -import java.util.UUID; -import java.util.concurrent.TimeUnit; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/3/27 0027 下午 18:10 - * @since JDK1.8 - */ -@Slf4j -@Service -public class LoginService { - - private static final String VERIFICATION_CODE_REDIS_PREFIX = "vc_%s"; - - @Autowired - private EmployeeDao employeeDao; - - @Autowired - private DepartmentDao departmentDao; - - @Autowired - private PrivilegeEmployeeService privilegeEmployeeService; - - @Autowired - private LoginTokenService loginTokenService; - - @Autowired - private LogService logService; - - @Autowired - private DefaultKaptcha defaultKaptcha; - - @Autowired - private ValueOperations redisValueOperations; - - /** - * 登陆 - * - * @param loginForm 登录名 密码 - * @return 登录用户基本信息 - */ - public ResponseDTO login(@Valid EmployeeLoginFormDTO loginForm, HttpServletRequest request) { -// String redisVerificationCode = redisValueOperations.get(loginForm.getCodeUuid()); -// //增加删除已使用的验证码方式 频繁登录 -// redisValueOperations.getOperations().delete(loginForm.getCodeUuid()); -// if (StringUtils.isEmpty(redisVerificationCode)) { -// return ResponseDTO.wrap(EmployeeResponseCodeConst.VERIFICATION_CODE_INVALID); -// } -// if (!redisVerificationCode.equalsIgnoreCase(loginForm.getCode())) { -// return ResponseDTO.wrap(EmployeeResponseCodeConst.VERIFICATION_CODE_INVALID); -// } - String loginPwd = SmartDigestUtil.encryptPassword(CommonConst.Password.SALT_FORMAT, loginForm.getLoginPwd()); - EmployeeDTO employeeDTO = employeeDao.login(loginForm.getLoginName(), loginPwd); - if (null == employeeDTO) { - return ResponseDTO.wrap(EmployeeResponseCodeConst.LOGIN_FAILED); - } - if (EmployeeStatusEnum.DISABLED.equalsValue(employeeDTO.getIsDisabled())) { - return ResponseDTO.wrap(EmployeeResponseCodeConst.IS_DISABLED); - } - //jwt token赋值 - String compactJws = loginTokenService.generateToken(employeeDTO); - - LoginDetailVO loginDTO = SmartBeanUtil.copy(employeeDTO, LoginDetailVO.class); - - //获取前端功能权限 - loginDTO.setPrivilegeList(initEmployeePrivilege(employeeDTO.getId())); - - loginDTO.setXAccessToken(compactJws); - DepartmentEntity departmentEntity = departmentDao.selectById(employeeDTO.getDepartmentId()); - loginDTO.setDepartmentName(departmentEntity.getName()); - - //判断是否为超管 - Boolean isSuperman = privilegeEmployeeService.isSuperman(loginDTO.getId()); - loginDTO.setIsSuperMan(isSuperman); - //登陆操作日志 - UserAgent userAgent = UserAgent.parseUserAgentString(request.getHeader("User-Agent")); - UserLoginLogEntity logEntity = - UserLoginLogEntity.builder() - .userId(employeeDTO.getId()) - .userName(employeeDTO.getActualName()) - .remoteIp(SmartIPUtil.getRemoteIp(request)) - .remotePort(request.getRemotePort()) - .remoteBrowser(userAgent.getBrowser().getName()) - .remoteOs(userAgent.getOperatingSystem().getName()) - .loginStatus(JudgeEnum.YES.getValue()).build(); - logService.addLog(logEntity); - return ResponseDTO.succData(loginDTO); - } - - /** - * 手机端退出登陆,清除token缓存 - * - * @param requestToken - * @return 退出登陆是否成功,bool - */ - public ResponseDTO logoutByToken(RequestTokenBO requestToken) { - privilegeEmployeeService.removeCache(requestToken.getRequestUserId()); - return ResponseDTO.succ(); - } - - /** - * 获取验证码 - * - * @return - */ - public ResponseDTO verificationCode() { - KaptchaVO kaptchaVO = new KaptchaVO(); - String uuid = buildVerificationCodeRedisKey(UUID.randomUUID().toString()); - String kaptchaText = defaultKaptcha.createText(); - - String base64Code = ""; - - BufferedImage image = defaultKaptcha.createImage(kaptchaText); - ByteArrayOutputStream outputStream = null; - try { - outputStream = new ByteArrayOutputStream(); - ImageIO.write(image, "jpg", outputStream); - base64Code = Base64.encodeBase64String(outputStream.toByteArray()); - } catch (Exception e) { - log.error("verificationCode exception .{}", e); - } finally { - if (outputStream != null) { - try { - outputStream.close(); - } catch (Exception e) { - log.error("verificationCode outputStream close exception .{}", e); - } - } - } - kaptchaVO.setUuid(uuid); - kaptchaVO.setCode("data:image/png;base64," + base64Code); - redisValueOperations.set(uuid, kaptchaText, 60L, TimeUnit.SECONDS); - return ResponseDTO.succData(kaptchaVO); - } - - private String buildVerificationCodeRedisKey(String uuid) { - return String.format(VERIFICATION_CODE_REDIS_PREFIX, uuid); - } - - /** - * 初始化员工权限 - * - * @param employeeId - * @return - */ - public List initEmployeePrivilege(Long employeeId) { - List privilegeList = privilegeEmployeeService.getPrivilegesByEmployeeId(employeeId); - privilegeEmployeeService.updateCachePrivilege(employeeId, privilegeList); - return SmartBeanUtil.copyList(privilegeList, LoginPrivilegeDTO.class); - } - - public LoginDetailVO getSession(RequestTokenBO requestUser) { - LoginDetailVO loginDTO = SmartBeanUtil.copy(requestUser.getEmployeeBO(), LoginDetailVO.class); - List privilegeEntityList = privilegeEmployeeService.getEmployeeAllPrivilege(requestUser.getRequestUserId()); - //====== 开启缓存 ====== - if (privilegeEntityList == null) { - List loginPrivilegeDTOS = initEmployeePrivilege(requestUser.getRequestUserId()); - loginDTO.setPrivilegeList(loginPrivilegeDTOS); - } else { - loginDTO.setPrivilegeList(SmartBeanUtil.copyList(privilegeEntityList, LoginPrivilegeDTO.class)); - } - - //====== 不开启缓存 ====== -// List loginPrivilegeDTOS = initEmployeePrivilege(requestUser.getRequestUserId()); -// loginDTO.setPrivilegeList(loginPrivilegeDTOS); - - //判断是否为超管 - Boolean isSuperman = privilegeEmployeeService.isSuperman(loginDTO.getId()); - loginDTO.setIsSuperMan(isSuperman); - return loginDTO; - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/login/LoginTokenService.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/login/LoginTokenService.java deleted file mode 100644 index 56ec269a..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/login/LoginTokenService.java +++ /dev/null @@ -1,118 +0,0 @@ -package net.lab1024.smartadmin.module.system.login; - -import net.lab1024.smartadmin.common.constant.JudgeEnum; -import net.lab1024.smartadmin.module.system.employee.EmployeeService; -import net.lab1024.smartadmin.module.system.employee.constant.EmployeeStatusEnum; -import net.lab1024.smartadmin.module.system.employee.domain.bo.EmployeeBO; -import net.lab1024.smartadmin.module.system.employee.domain.dto.EmployeeDTO; -import net.lab1024.smartadmin.module.system.login.domain.RequestTokenBO; -import io.jsonwebtoken.Claims; -import io.jsonwebtoken.Jwts; -import io.jsonwebtoken.SignatureAlgorithm; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; - -import java.time.LocalDateTime; -import java.time.ZoneId; -import java.util.Date; -import java.util.UUID; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - * @since JDK1.8 - */ -@Slf4j -@Service -public class LoginTokenService { - - /** - * 过期时间一天 - */ - private static final int EXPIRE_SECONDS = 1 * 24 * 3600; - /** - * jwt加密字段 - */ - private static final String CLAIM_ID_KEY = "id"; - - @Value("${jwt.key}") - private String jwtKey; - - @Autowired - private EmployeeService employeeService; - - - /** - * 功能描述: 生成JWT TOKEN - * - * @param employeeDTO - * @return - * @auther yandanyang - * @date 2018/9/12 0012 上午 10:08 - */ - public String generateToken(EmployeeDTO employeeDTO) { - Long id = employeeDTO.getId(); - /**将token设置为jwt格式*/ - String baseToken = UUID.randomUUID().toString(); - LocalDateTime localDateTimeNow = LocalDateTime.now(); - LocalDateTime localDateTimeExpire = localDateTimeNow.plusSeconds(EXPIRE_SECONDS); - Date from = Date.from(localDateTimeNow.atZone(ZoneId.systemDefault()).toInstant()); - Date expire = Date.from(localDateTimeExpire.atZone(ZoneId.systemDefault()).toInstant()); - - Claims jwtClaims = Jwts.claims().setSubject(baseToken); - jwtClaims.put(CLAIM_ID_KEY, id); - String compactJws = Jwts.builder().setClaims(jwtClaims).setNotBefore(from).setExpiration(expire).signWith(SignatureAlgorithm.HS512, jwtKey).compact(); - - EmployeeBO employeeBO = employeeService.getById(id); - RequestTokenBO tokenBO = new RequestTokenBO(employeeBO); - - return compactJws; - } - - /** - * 功能描述: 根据登陆token获取登陆信息 - * - * @param - * @return - * @auther yandanyang - * @date 2018/9/12 0012 上午 10:11 - */ - public RequestTokenBO getEmployeeTokenInfo(String token) { - Long employeeId = -1L; - try { - Claims claims = Jwts.parser().setSigningKey(jwtKey).parseClaimsJws(token).getBody(); - String idStr = claims.get(CLAIM_ID_KEY).toString(); - employeeId = Long.valueOf(idStr); - } catch (Exception e) { - log.error("getEmployeeTokenInfo error:{}", e); - return null; - } - - EmployeeBO employeeBO = employeeService.getById(employeeId); - if (employeeBO == null) { - return null; - } - - if (EmployeeStatusEnum.DISABLED.getValue().equals(employeeBO.getIsDisabled())) { - return null; - } - - if (JudgeEnum.YES.equals(employeeBO.getIsLeave())) { - return null; - } - - if (JudgeEnum.YES.equals(employeeBO.getIsDelete())) { - return null; - } - - return new RequestTokenBO(employeeBO); - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/login/domain/KaptchaVO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/login/domain/KaptchaVO.java deleted file mode 100644 index 61814e63..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/login/domain/KaptchaVO.java +++ /dev/null @@ -1,28 +0,0 @@ -package net.lab1024.smartadmin.module.system.login.domain; - -import lombok.Data; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/7/4 0004 上午 10:11 - * @since JDK1.8 - */ -@Data -public class KaptchaVO { - - /** - * 验证码UUID - */ - private String uuid; - - /** - * base64 验证码 - */ - private String code; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/login/domain/LoginCacheDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/login/domain/LoginCacheDTO.java deleted file mode 100644 index c8e5f62f..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/login/domain/LoginCacheDTO.java +++ /dev/null @@ -1,28 +0,0 @@ -package net.lab1024.smartadmin.module.system.login.domain; - -import net.lab1024.smartadmin.module.system.employee.domain.dto.EmployeeDTO; -import lombok.Data; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/8/9 0009 下午 17:32 - * @since JDK1.8 - */ -@Data -public class LoginCacheDTO { - - /** - * 基本信息 - */ - private EmployeeDTO employeeDTO; - - /** - * 过期时间 - */ - private Long expireTime; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/login/domain/LoginDetailVO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/login/domain/LoginDetailVO.java deleted file mode 100644 index 72a27087..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/login/domain/LoginDetailVO.java +++ /dev/null @@ -1,68 +0,0 @@ -package net.lab1024.smartadmin.module.system.login.domain; - -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.Date; -import java.util.List; - -/** - * 登录返回DTO - * - * @author lidoudou - * @date 2017年12月21日上午09:06:31 - */ -@Data -public class LoginDetailVO { - - @ApiModelProperty("主键id") - private Long id; - - @ApiModelProperty("登录账号") - private String loginName; - - @ApiModelProperty("别名") - private String nickName; - - @ApiModelProperty("员工名称") - private String actualName; - - @ApiModelProperty("手机号码") - private String phone; - - @ApiModelProperty("身份证") - private String idCard; - - @ApiModelProperty("出生日期") - @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") - private Date birthday; - - @ApiModelProperty("创建者id") - private Long createUser; - - @ApiModelProperty("部门id") - private Long departmentId; - - @ApiModelProperty("是否离职") - private Integer isLeave; - - @ApiModelProperty("是否被禁用") - private Integer isDisabled; - - @ApiModelProperty("部门名称") - private String departmentName; - - @ApiModelProperty("邮箱") - private String email; - - @ApiModelProperty("登陆token") - private String xAccessToken; - - @ApiModelProperty("是否为超管") - private Boolean isSuperMan; - - @ApiModelProperty("权限列表") - private List privilegeList; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/login/domain/LoginPrivilegeDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/login/domain/LoginPrivilegeDTO.java deleted file mode 100644 index e1812b35..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/login/domain/LoginPrivilegeDTO.java +++ /dev/null @@ -1,33 +0,0 @@ -package net.lab1024.smartadmin.module.system.login.domain; - -import net.lab1024.smartadmin.common.anno.ApiModelPropertyEnum; -import net.lab1024.smartadmin.module.system.privilege.constant.PrivilegeTypeEnum; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/8/21 0021 上午 10:28 - * @since JDK1.8 - */ -@Data -public class LoginPrivilegeDTO { - - @ApiModelProperty("权限key") - private String key; - - @ApiModelPropertyEnum(enumDesc = "菜单类型",value = PrivilegeTypeEnum.class) - private Integer type; - - @ApiModelProperty("url") - private String url; - - @ApiModelProperty("父级key") - private String parentKey; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/login/domain/RequestTokenBO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/login/domain/RequestTokenBO.java deleted file mode 100644 index 101f66db..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/login/domain/RequestTokenBO.java +++ /dev/null @@ -1,26 +0,0 @@ -package net.lab1024.smartadmin.module.system.login.domain; - -import net.lab1024.smartadmin.module.system.employee.domain.bo.EmployeeBO; -import lombok.Getter; - - -@Getter -public class RequestTokenBO { - - private Long requestUserId; - - private EmployeeBO employeeBO; - - public RequestTokenBO(EmployeeBO employeeBO) { - this.requestUserId = employeeBO.getId(); - this.employeeBO = employeeBO; - } - - @Override - public String toString() { - return "RequestTokenBO{" + - "requestUserId=" + requestUserId + - ", employeeBO=" + employeeBO + - '}'; - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/PositionController.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/PositionController.java deleted file mode 100644 index 0f1a311e..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/PositionController.java +++ /dev/null @@ -1,59 +0,0 @@ -package net.lab1024.smartadmin.module.system.position; - -import net.lab1024.smartadmin.common.anno.OperateLog; -import net.lab1024.smartadmin.common.domain.PageResultDTO; -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.constant.SwaggerTagConst; -import net.lab1024.smartadmin.module.system.position.domain.dto.PositionAddDTO; -import net.lab1024.smartadmin.module.system.position.domain.dto.PositionQueryDTO; -import net.lab1024.smartadmin.module.system.position.domain.dto.PositionResultVO; -import net.lab1024.smartadmin.module.system.position.domain.dto.PositionUpdateDTO; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.validation.Valid; - -/** - * @author zzr - */ -@Api(tags = {SwaggerTagConst.Admin.MANAGER_JOB}) -@OperateLog -@RestController -public class PositionController { - - @Autowired - private PositionService positionService; - - @ApiOperation(value = "分页查询所有岗位", notes = "分页查询所有岗位 @author zzr") - @PostMapping("/position/getListPage") - public ResponseDTO> getJobPage(@RequestBody @Valid PositionQueryDTO queryDTO) { - return positionService.queryPositionByPage(queryDTO); - } - - @ApiOperation(value = "添加岗位", notes = "添加岗位 @author zzr") - @PostMapping("/position/add") - public ResponseDTO addJob(@RequestBody @Valid PositionAddDTO addDTO) { - return positionService.addPosition(addDTO); - } - - @ApiOperation(value = "更新岗位", notes = "更新岗位 @author zzr") - @PostMapping("/position/update") - public ResponseDTO updateJob(@RequestBody @Valid PositionUpdateDTO updateDTO) { - return positionService.updatePosition(updateDTO); - } - - @ApiOperation(value = "根据ID查询岗位", notes = "根据ID查询岗位 @author zzr") - @GetMapping("/position/queryById/{id}") - public ResponseDTO queryJobById(@PathVariable Long id) { - return positionService.queryPositionById(id); - } - - @ApiOperation(value = "根据ID删除岗位", notes = "根据ID删除岗位 @author zzr") - @GetMapping("/position/remove/{id}") - public ResponseDTO removeJob(@PathVariable Long id) { - return positionService.removePosition(id); - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/PositionDao.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/PositionDao.java deleted file mode 100644 index 68423c59..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/PositionDao.java +++ /dev/null @@ -1,63 +0,0 @@ -package net.lab1024.smartadmin.module.system.position; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import net.lab1024.smartadmin.module.system.position.domain.dto.PositionQueryDTO; -import net.lab1024.smartadmin.module.system.position.domain.dto.PositionRelationAddDTO; -import net.lab1024.smartadmin.module.system.position.domain.dto.PositionRelationQueryDTO; -import net.lab1024.smartadmin.module.system.position.domain.dto.PositionRelationResultDTO; -import net.lab1024.smartadmin.module.system.position.domain.entity.PositionEntity; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Component; - -import java.util.List; - -/** - * @author zzr - */ -@Mapper -@Component -public interface PositionDao extends BaseMapper { - - /** - * 查询岗位列表 - * - * @param page - * @param queryDTO - * @return - */ - List selectByPage(Page page, @Param("queryDTO") PositionQueryDTO queryDTO); - - /** - * 查询岗位与人员关系 - * - * @param positionRelationQueryDTO - * @return - */ - List selectRelation(PositionRelationQueryDTO positionRelationQueryDTO); - - /** - * 批量查询员工岗位信息 - * @param employeeIdList - * @return - */ - List selectEmployeesRelation(@Param("employeeIdList") List employeeIdList); - - /** - * 批量添加岗位 人员 关联关系 - * - * @param positionRelationAddDTO - * @return - */ - Integer insertBatchRelation(@Param("batchDTO")PositionRelationAddDTO positionRelationAddDTO); - - /** - * 删除指定人员的 岗位关联关系 - * - * @param employeeId - * @return - */ - Integer deleteRelationByEmployeeId(@Param("employeeId") Long employeeId); - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/PositionResponseCodeConst.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/PositionResponseCodeConst.java deleted file mode 100644 index 43528034..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/PositionResponseCodeConst.java +++ /dev/null @@ -1,16 +0,0 @@ -package net.lab1024.smartadmin.module.system.position; - -import net.lab1024.smartadmin.common.constant.ResponseCodeConst; - -/** - * @author zzr - */ -public class PositionResponseCodeConst extends ResponseCodeConst { - - public static final PositionResponseCodeConst REMOVE_DEFINE = new PositionResponseCodeConst(13000, "还有人关联该岗位,不能删除"); - - protected PositionResponseCodeConst(int code, String msg) { - super(code, msg); - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/PositionService.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/PositionService.java deleted file mode 100644 index 58468969..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/PositionService.java +++ /dev/null @@ -1,124 +0,0 @@ -package net.lab1024.smartadmin.module.system.position; - -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import net.lab1024.smartadmin.common.domain.PageResultDTO; -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.module.system.position.domain.dto.*; -import net.lab1024.smartadmin.module.system.position.domain.entity.PositionEntity; -import net.lab1024.smartadmin.util.SmartBeanUtil; -import net.lab1024.smartadmin.util.SmartPageUtil; -import org.apache.commons.collections.CollectionUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.List; -import java.util.stream.Collectors; - -/** - * @author zzr - */ -@Service -public class PositionService { - - @Autowired - private PositionDao positionDao; - - /** - * 查询岗位 - * - * @param queryDTO - * @return - */ - public ResponseDTO> queryPositionByPage(PositionQueryDTO queryDTO) { - Page page = SmartPageUtil.convert2QueryPage(queryDTO); - List entityList = positionDao.selectByPage(page, queryDTO); - page.setRecords(entityList.stream().map(e -> SmartBeanUtil.copy(e, PositionResultVO.class)).collect(Collectors.toList())); - PageResultDTO pageResultDTO = SmartPageUtil.convert2PageResult(page); - return ResponseDTO.succData(pageResultDTO); - } - - /** - * 新增岗位 - * - * @param addDTO - * @return - */ - public ResponseDTO addPosition(PositionAddDTO addDTO) { - PositionEntity positionEntity = SmartBeanUtil.copy(addDTO, PositionEntity.class); - positionDao.insert(positionEntity); - return ResponseDTO.succ(); - } - - /** - * 修改岗位 - * - * @param updateDTO - * @return - */ - public ResponseDTO updatePosition(PositionUpdateDTO updateDTO) { - PositionEntity positionEntity = SmartBeanUtil.copy(updateDTO, PositionEntity.class); - positionDao.updateById(positionEntity); - return ResponseDTO.succ(); - } - - /** - * 根据ID查询 - * - * @param id - * @return - */ - public ResponseDTO queryPositionById(Long id) { - return ResponseDTO.succData(SmartBeanUtil.copy(positionDao.selectById(id), PositionResultVO.class)); - } - - /** - * 删除岗位 - */ - public ResponseDTO removePosition(Long id) { - //查询是否还有人关联该岗位 - PositionRelationQueryDTO positionRelationQueryDTO = new PositionRelationQueryDTO(); - positionRelationQueryDTO.setPositionId(id); - List dtoList = positionDao.selectRelation(positionRelationQueryDTO); - if (CollectionUtils.isNotEmpty(dtoList)) { - return ResponseDTO.wrap(PositionResponseCodeConst.REMOVE_DEFINE); - } - positionDao.deleteById(id); - return ResponseDTO.succ(); - } - - /** - * 添加岗位关联关系 - * - * @param positionRelAddDTO - * @return - */ - public ResponseDTO addPositionRelation(PositionRelationAddDTO positionRelAddDTO) { - positionDao.insertBatchRelation(positionRelAddDTO); - return ResponseDTO.succ(); - } - - /** - * 删除指定用户的岗位关联关系 - * - * @param employeeId - * @return - */ - public ResponseDTO removePositionRelation(Long employeeId) { - positionDao.deleteRelationByEmployeeId(employeeId); - return ResponseDTO.succ(); - } - - /** - * 根据员工ID查询 所关联的岗位信息 - * - * @param employeeId - * @return - */ - public List queryPositionByEmployeeId(Long employeeId) { - PositionRelationQueryDTO positionRelationQueryDTO = new PositionRelationQueryDTO(); - positionRelationQueryDTO.setEmployeeId(employeeId); - List positionRelationList = positionDao.selectRelation(positionRelationQueryDTO); - return positionRelationList; - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/domain/dto/PositionAddDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/domain/dto/PositionAddDTO.java deleted file mode 100644 index d7b4d8b6..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/domain/dto/PositionAddDTO.java +++ /dev/null @@ -1,28 +0,0 @@ -package net.lab1024.smartadmin.module.system.position.domain.dto; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotBlank; - -/** - * 岗位 - * - * @author zzr - */ -@Data -public class PositionAddDTO { - - /** - * 岗位名称 - */ - @ApiModelProperty("岗位名称") - @NotBlank(message = "岗位名称不能为空") - private String positionName; - - /** - * 岗位描述 - */ - @ApiModelProperty("岗位描述") - private String remark; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/domain/dto/PositionQueryDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/domain/dto/PositionQueryDTO.java deleted file mode 100644 index 6ab8d066..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/domain/dto/PositionQueryDTO.java +++ /dev/null @@ -1,18 +0,0 @@ -package net.lab1024.smartadmin.module.system.position.domain.dto; - -import net.lab1024.smartadmin.common.domain.PageParamDTO; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * 岗位 - * - * @author zzr - */ -@Data -public class PositionQueryDTO extends PageParamDTO { - - @ApiModelProperty("岗位名称") - private String positionName; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/domain/dto/PositionRelationAddDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/domain/dto/PositionRelationAddDTO.java deleted file mode 100644 index 509c1a22..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/domain/dto/PositionRelationAddDTO.java +++ /dev/null @@ -1,32 +0,0 @@ -package net.lab1024.smartadmin.module.system.position.domain.dto; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotNull; -import java.util.List; - -/** - * 岗位关系 - * - * @author zzr - */ -@Data -public class PositionRelationAddDTO { - - @ApiModelProperty("岗位ID") - @NotNull(message = "岗位ID 不能为空") - private List positionIdList; - - @ApiModelProperty("员工ID") - @NotNull(message = "员工ID 不能为空") - private Long employeeId; - - public PositionRelationAddDTO() { - } - - public PositionRelationAddDTO(List positionIdList, Long employeeId) { - this.positionIdList = positionIdList; - this.employeeId = employeeId; - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/domain/dto/PositionRelationQueryDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/domain/dto/PositionRelationQueryDTO.java deleted file mode 100644 index 3732cd50..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/domain/dto/PositionRelationQueryDTO.java +++ /dev/null @@ -1,20 +0,0 @@ -package net.lab1024.smartadmin.module.system.position.domain.dto; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * 岗位关系 - * - * @author zzr - */ -@Data -public class PositionRelationQueryDTO { - - @ApiModelProperty("岗位ID") - private Long positionId; - - @ApiModelProperty("员工ID") - private Long employeeId; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/domain/dto/PositionRelationResultDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/domain/dto/PositionRelationResultDTO.java deleted file mode 100644 index 1881904f..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/domain/dto/PositionRelationResultDTO.java +++ /dev/null @@ -1,40 +0,0 @@ -package net.lab1024.smartadmin.module.system.position.domain.dto; - -import lombok.Data; - -import java.util.Date; - -/** - * 岗位关联关系 - * - * @author zzr - */ -@Data -public class PositionRelationResultDTO { - - /** - * 岗位ID - */ - private Long positionId; - - /** - * 员工ID - */ - private Long employeeId; - - /** - * 岗位名称 - */ - private String positionName; - - /** - * 更新时间 - */ - private Date updateTime; - - /** - * 创建时间 - */ - private Date createTime; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/domain/dto/PositionResultVO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/domain/dto/PositionResultVO.java deleted file mode 100644 index 3bc89efd..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/domain/dto/PositionResultVO.java +++ /dev/null @@ -1,41 +0,0 @@ -package net.lab1024.smartadmin.module.system.position.domain.dto; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.Date; - -/** - * @author zzr - */ -@Data -public class PositionResultVO { - - @ApiModelProperty("主键") - private Long id; - - /** - * 更新时间 - */ - @ApiModelProperty("更新时间") - private Date updateTime; - - /** - * 创建时间 - */ - @ApiModelProperty("创建时间") - private Date createTime; - - /** - * 岗位名称 - */ - @ApiModelProperty("岗位名称") - private String positionName; - - /** - * 岗位描述 - */ - @ApiModelProperty("岗位描述") - private String remark; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/domain/dto/PositionUpdateDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/domain/dto/PositionUpdateDTO.java deleted file mode 100644 index 659da733..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/domain/dto/PositionUpdateDTO.java +++ /dev/null @@ -1,16 +0,0 @@ -package net.lab1024.smartadmin.module.system.position.domain.dto; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * 岗位 - * - * @author zzr - */ -@Data -public class PositionUpdateDTO extends PositionAddDTO { - - @ApiModelProperty("主键") - private Long id; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/domain/entity/PositionEntity.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/domain/entity/PositionEntity.java deleted file mode 100644 index a42af4ac..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/domain/entity/PositionEntity.java +++ /dev/null @@ -1,26 +0,0 @@ -package net.lab1024.smartadmin.module.system.position.domain.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import net.lab1024.smartadmin.common.domain.BaseEntity; -import lombok.Data; - -/** - * 岗位 - * - * @author zzr - */ -@Data -@TableName("t_position") -public class PositionEntity extends BaseEntity { - - /** - * 岗位名称 - */ - private String positionName; - - /** - * 岗位描述 - */ - private String remark; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/domain/entity/PositionRelationEntity.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/domain/entity/PositionRelationEntity.java deleted file mode 100644 index b7ff8676..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/position/domain/entity/PositionRelationEntity.java +++ /dev/null @@ -1,26 +0,0 @@ -package net.lab1024.smartadmin.module.system.position.domain.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import net.lab1024.smartadmin.common.domain.BaseEntity; -import lombok.Data; - -/** - * 岗位关联关系 - * - * @author zzr - */ -@Data -@TableName("t_position_relation") -public class PositionRelationEntity extends BaseEntity { - - /** - * 岗位ID - */ - private Long positionId; - - /** - * 员工ID - */ - private Long employeeId; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/constant/PrivilegeResponseCodeConst.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/constant/PrivilegeResponseCodeConst.java deleted file mode 100644 index 3efbd9b2..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/constant/PrivilegeResponseCodeConst.java +++ /dev/null @@ -1,29 +0,0 @@ -package net.lab1024.smartadmin.module.system.privilege.constant; - -import net.lab1024.smartadmin.common.constant.ResponseCodeConst; - - -/** - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - * @since JDK1.8 - */ -public class PrivilegeResponseCodeConst extends ResponseCodeConst { - - public static final PrivilegeResponseCodeConst PRIVILEGE_NOT_EXISTS = new PrivilegeResponseCodeConst(7001, "当前数据不存在,请联系你的管理员!"); - - public static final PrivilegeResponseCodeConst ROUTER_KEY_NO_REPEAT = new PrivilegeResponseCodeConst(7002, "模块和页面的“功能Key”值不能重复!"); - - public static final PrivilegeResponseCodeConst MENU_NOT_EXIST = new PrivilegeResponseCodeConst(7003, "菜单不存在,清先保存菜单!"); - - public static final PrivilegeResponseCodeConst POINT_NOT_EXIST = new PrivilegeResponseCodeConst(7004, "功能点不存在,清先保存功能点!"); - - public PrivilegeResponseCodeConst(int code, String msg) { - super(code, msg); - } -} - diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/constant/PrivilegeTypeEnum.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/constant/PrivilegeTypeEnum.java deleted file mode 100644 index 96b175e6..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/constant/PrivilegeTypeEnum.java +++ /dev/null @@ -1,49 +0,0 @@ -package net.lab1024.smartadmin.module.system.privilege.constant; - - -import net.lab1024.smartadmin.common.domain.BaseEnum; - -import java.util.Arrays; -import java.util.Optional; - -/** - * - * [ ] - * - * @version 1.0 - * @since JDK1.8 - * @author yandanyang - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - */ -public enum PrivilegeTypeEnum implements BaseEnum { - - - MENU(1,"菜单"), - - POINTS(2,"功能点"); - - private Integer value; - - private String desc; - - PrivilegeTypeEnum(Integer value,String desc){ - this.value = value; - this.desc = desc; - } - @Override - public Integer getValue() { - return this.value; - } - - @Override - public String getDesc() { - return this.desc; - } - - public static PrivilegeTypeEnum selectByValue(Integer value) { - Optional first = Arrays.stream(PrivilegeTypeEnum.values()).filter(e -> e.getValue().equals(value)).findFirst(); - return !first.isPresent() ? null : first.get(); - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/controller/PrivilegeController.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/controller/PrivilegeController.java deleted file mode 100644 index 3a073a2d..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/controller/PrivilegeController.java +++ /dev/null @@ -1,75 +0,0 @@ -package net.lab1024.smartadmin.module.system.privilege.controller; - -import net.lab1024.smartadmin.common.anno.OperateLog; -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.common.domain.ValidateList; -import net.lab1024.smartadmin.constant.SwaggerTagConst; -import net.lab1024.smartadmin.module.system.privilege.service.PrivilegeService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import net.lab1024.smartadmin.module.system.privilege.domain.dto.*; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.validation.Valid; -import java.util.List; - -/** - * [ 与员工权限相关:角色权限关系、权限列表 ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - * @since JDK1.8 - */ -@OperateLog -@RestController -@Api(tags = {SwaggerTagConst.Admin.MANAGER_PRIVILEGE}) -public class PrivilegeController { - - @Autowired - private PrivilegeService privilegeService; - - @GetMapping("/privilege/getAllUrl") - @ApiOperation(value = "获取所有请求路径", notes = "获取所有请求路径") - public ResponseDTO> getAllUrl() { - return privilegeService.getPrivilegeUrlDTOList(); - } - - @ApiOperation(value = "菜单批量保存") - @PostMapping("/privilege/menu/batchSaveMenu") - public ResponseDTO menuBatchSave(@Valid @RequestBody ValidateList menuList) { - return privilegeService.menuBatchSave(menuList); - } - - - @ApiOperation(value = "查询所有菜单项") - @PostMapping("/privilege/menu/queryAll") - public ResponseDTO> queryAll() { - return privilegeService.menuQueryAll(); - } - - - @ApiOperation(value = "保存更新功能点") - @PostMapping("/privilege/function/saveOrUpdate") - public ResponseDTO functionSaveOrUpdate(@Valid @RequestBody PrivilegeFunctionDTO privilegeFunctionDTO) { - return privilegeService.functionSaveOrUpdate(privilegeFunctionDTO); - } - - @ApiOperation(value = "批量保存功能点") - @PostMapping("/privilege/function/batchSave") - public ResponseDTO batchSaveFunctionList(@Valid @RequestBody ValidateList functionList) { - return privilegeService.batchSaveFunctionList(functionList); - } - - - @ApiOperation(value = "查询菜单功能点", notes = "更新") - @PostMapping("/privilege/function/query/{menuKey}") - public ResponseDTO> functionQuery(@PathVariable String menuKey) { - return privilegeService.functionQuery(menuKey); - } - - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/dao/PrivilegeDao.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/dao/PrivilegeDao.java deleted file mode 100644 index 291480d1..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/dao/PrivilegeDao.java +++ /dev/null @@ -1,94 +0,0 @@ -package net.lab1024.smartadmin.module.system.privilege.dao; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import net.lab1024.smartadmin.module.system.privilege.domain.entity.PrivilegeEntity; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Component; - -import java.util.List; - - -/** - * - * [ ] - * - * @version 1.0 - * @since JDK1.8 - * @author yandanyang - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - */ -@Mapper -@Component -public interface PrivilegeDao extends BaseMapper { - - /** - * 根据权限key删除 - * @param keyList - */ - void delByKeyList(@Param("keyList") List keyList); - /** - * 根据权限parentkey删除 - * @param keyList - */ - void delByParentKeyList(@Param("keyList") List keyList); - - /** - * 批量保存 - * @param privilegeList - */ - void batchInsert(List privilegeList); - - /** - * 批量更新 - * @param privilegeList - */ - void batchUpdate(@Param("updateList") List privilegeList); - - /** - * 根据父节点key查询 - * @param parentKey - * @return - */ - List selectByParentKey(@Param("parentKey") String parentKey); - - /** - * 根据父节点key查询 - * @param keyList - * @return - */ - List selectByKeyList(@Param("keyList") List keyList); - - /** - * 根据权限key查询 - * @param key - * @return - */ - PrivilegeEntity selectByKey(@Param("key") String key); - - /** - * 根据类型查询 - * @param type - * @return - */ - List selectByExcludeType(@Param("type") Integer type); - - /** - * 根据类型查询 - * @param type - * @return - */ - List selectByType(@Param("type") Integer type); - - /** - * 查询所有权限 - * @return - */ - List selectAll(); - - - - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/domain/dto/PrivilegeFunctionDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/domain/dto/PrivilegeFunctionDTO.java deleted file mode 100644 index 0e15a42c..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/domain/dto/PrivilegeFunctionDTO.java +++ /dev/null @@ -1,40 +0,0 @@ -package net.lab1024.smartadmin.module.system.privilege.domain.dto; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/8/20 0020 下午 16:45 - * @since JDK1.8 - */ -@Data -public class PrivilegeFunctionDTO { - - @ApiModelProperty("功能点名称") - @NotBlank(message = "功能点名称不能为空") - private String functionName; - - @ApiModelProperty("所属菜单Key") - @NotBlank(message = "所属菜单Key不能为空") - private String menuKey; - - @ApiModelProperty("功能点Key") - @NotBlank(message = "功能点Key不能为空") - private String functionKey; - - @ApiModelProperty("url列表") - private String url; - - @ApiModelProperty("排序") - @NotNull(message = "请输入功能点顺序") - private Integer sort; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/domain/dto/PrivilegeFunctionVO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/domain/dto/PrivilegeFunctionVO.java deleted file mode 100644 index fd89f959..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/domain/dto/PrivilegeFunctionVO.java +++ /dev/null @@ -1,40 +0,0 @@ -package net.lab1024.smartadmin.module.system.privilege.domain.dto; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotEmpty; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/8/20 0020 下午 16:45 - * @since JDK1.8 - */ -@Data -public class PrivilegeFunctionVO { - - @ApiModelProperty("功能点名称") - @NotBlank(message = "功能点名称不能为空") - private String functionName; - - @ApiModelProperty("所属菜单Key") - @NotBlank(message = "所属菜单Key不能为空") - private String menuKey; - - @ApiModelProperty("功能点Key") - @NotBlank(message = "功能点Key不能为空") - private String functionKey; - - @ApiModelProperty("url列表") - @NotEmpty(message = "url列表不能为空") - private String url; - - @ApiModelProperty("顺序") - private Integer sort; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/domain/dto/PrivilegeMenuDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/domain/dto/PrivilegeMenuDTO.java deleted file mode 100644 index 137f827d..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/domain/dto/PrivilegeMenuDTO.java +++ /dev/null @@ -1,45 +0,0 @@ -package net.lab1024.smartadmin.module.system.privilege.domain.dto; - -import net.lab1024.smartadmin.common.anno.ApiModelPropertyEnum; -import net.lab1024.smartadmin.module.system.privilege.constant.PrivilegeTypeEnum; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotNull; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/8/20 0020 下午 16:32 - * @since JDK1.8 - */ -@Data -public class PrivilegeMenuDTO { - - @ApiModelPropertyEnum(enumDesc = "菜单类型",value = PrivilegeTypeEnum.class) - @NotNull - private Integer type; - - @ApiModelProperty("菜单名") - @NotNull(message = "菜单名不能为空") - private String menuName; - - @ApiModelProperty("菜单Key") - @NotNull(message = "菜单Key不能为空") - private String menuKey; - - @ApiModelProperty("父级菜单Key,根节点不传") - private String parentKey; - - @ApiModelProperty("前端路由path") - @NotNull(message = "前端路由path不能为空") - private String url; - - @ApiModelProperty("排序字段") - @NotNull(message = "菜单项顺序不能为空") - private Integer sort; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/domain/dto/PrivilegeMenuVO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/domain/dto/PrivilegeMenuVO.java deleted file mode 100644 index 72febd9c..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/domain/dto/PrivilegeMenuVO.java +++ /dev/null @@ -1,35 +0,0 @@ -package net.lab1024.smartadmin.module.system.privilege.domain.dto; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/8/20 0020 下午 16:41 - * @since JDK1.8 - */ -@Data -public class PrivilegeMenuVO { - - @ApiModelProperty("菜单名") - private String menuName; - - @ApiModelProperty("菜单Key") - private String menuKey; - - @ApiModelProperty("菜单父级Key") - private String parentKey; - - @ApiModelProperty("顺序") - private Integer sort; - - @ApiModelProperty("前端路由path") - private String url; - - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/domain/dto/PrivilegeRequestUrlVO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/domain/dto/PrivilegeRequestUrlVO.java deleted file mode 100644 index d227c04d..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/domain/dto/PrivilegeRequestUrlVO.java +++ /dev/null @@ -1,27 +0,0 @@ -package net.lab1024.smartadmin.module.system.privilege.domain.dto; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/3/28 0028 上午 9:20 - * @since JDK1.8 - */ -@Data -public class PrivilegeRequestUrlVO { - - @ApiModelProperty("注释说明") - private String comment; - - @ApiModelProperty("controller.method") - private String name; - - @ApiModelProperty("url") - private String url; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/domain/entity/PrivilegeEntity.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/domain/entity/PrivilegeEntity.java deleted file mode 100644 index df49b874..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/domain/entity/PrivilegeEntity.java +++ /dev/null @@ -1,57 +0,0 @@ -package net.lab1024.smartadmin.module.system.privilege.domain.entity; - -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableName; -import net.lab1024.smartadmin.common.domain.BaseEntity; -import lombok.Data; - -import java.io.Serializable; - -/** - * - * [ ] - * - * @version 1.0 - * @since JDK1.8 - * @author yandanyang - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - */ -@Data -@TableName("t_privilege") -public class PrivilegeEntity extends BaseEntity implements Serializable { - private static final long serialVersionUID = 3848408566432915214L; - - /** - * 功能权限类型:1.模块 2.页面 3.功能点 4.子模块 - */ - private Integer type; - - /** - * 菜单名称 - */ - private String name; - - /** - * 路由name 英文关键字 - */ - @TableField(value = "`key`") - private String key; - - - private String url; - - /** - * 排序 - */ - private Integer sort; - - - /** - * 父级key - */ - private String parentKey; - - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/service/PrivilegeEmployeeService.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/service/PrivilegeEmployeeService.java deleted file mode 100644 index 602a5b59..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/service/PrivilegeEmployeeService.java +++ /dev/null @@ -1,199 +0,0 @@ -package net.lab1024.smartadmin.module.system.privilege.service; - -import net.lab1024.smartadmin.common.constant.JudgeEnum; -import net.lab1024.smartadmin.common.exception.SmartBusinessException; -import net.lab1024.smartadmin.module.system.employee.domain.dto.EmployeeDTO; -import net.lab1024.smartadmin.module.system.login.domain.RequestTokenBO; -import net.lab1024.smartadmin.module.system.privilege.constant.PrivilegeTypeEnum; -import net.lab1024.smartadmin.module.system.privilege.dao.PrivilegeDao; -import net.lab1024.smartadmin.module.system.privilege.domain.entity.PrivilegeEntity; -import net.lab1024.smartadmin.module.system.role.roleemployee.RoleEmployeeDao; -import net.lab1024.smartadmin.module.system.role.roleprivilege.RolePrivilegeDao; -import net.lab1024.smartadmin.module.system.systemconfig.SystemConfigService; -import net.lab1024.smartadmin.module.system.systemconfig.constant.SystemConfigEnum; -import net.lab1024.smartadmin.module.system.systemconfig.domain.dto.SystemConfigDTO; -import net.lab1024.smartadmin.util.SmartStringUtil; -import com.google.common.collect.Lists; -import com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap; -import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.*; -import java.util.concurrent.ConcurrentMap; -import java.util.stream.Collectors; - -/** - * [ 后台员工权限缓存方法 ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/3/28 0028 下午 14:07 - * @since JDK1.8 - */ -@Service -public class PrivilegeEmployeeService { - - /** - * 后台用户权限缓存 > - */ - private ConcurrentMap>> employeePrivileges = new ConcurrentLinkedHashMap.Builder>>().maximumWeightedCapacity(1000).build(); - private ConcurrentMap> employeePrivilegeListMap = new ConcurrentLinkedHashMap.Builder>().maximumWeightedCapacity(1000).build(); - - @Autowired - private SystemConfigService systemConfigService; - - @Autowired - private RoleEmployeeDao roleEmployeeDao; - - @Autowired - private RolePrivilegeDao rolePrivilegeDao; - - @Autowired - private PrivilegeDao privilegeDao; - - /** - * 移除某人缓存中的权限 - * - * @param employeeId - */ - public void removeCache(Long employeeId) { - this.employeePrivileges.remove(employeeId); - } - - /** - * 检查某人是否有访问某个方法的权限 - * - * @param requestTokenBO - * @param controllerName - * @param methodName - * @return - */ - public Boolean checkEmployeeHavePrivilege(RequestTokenBO requestTokenBO, String controllerName, String methodName) { - if (StringUtils.isEmpty(controllerName) || StringUtils.isEmpty(methodName)) { - return false; - } - Boolean isSuperman = requestTokenBO.getEmployeeBO().getIsSuperman(); - if (isSuperman) { - return true; - } - Map> privileges = this.getPrivileges(requestTokenBO.getRequestUserId()); - List urlList = privileges.get(controllerName.toLowerCase()); - if (CollectionUtils.isEmpty(urlList)) { - return false; - } - return urlList.contains(methodName); - } - - public List getEmployeeAllPrivilege(Long employeeId) { - return employeePrivilegeListMap.get(employeeId); - } - - /** - * 判断是否为超级管理员 - * - * @param employeeId - * @return - */ - public Boolean isSuperman(Long employeeId) { - SystemConfigDTO systemConfig = systemConfigService.getCacheByKey(SystemConfigEnum.Key.EMPLOYEE_SUPERMAN); - if (systemConfig == null) { - throw new SmartBusinessException("缺少系统配置项[" + SystemConfigEnum.Key.EMPLOYEE_SUPERMAN.name() + "]"); - } - - List superManIdsList = SmartStringUtil.splitConverToLongList(systemConfig.getConfigValue(), ","); - return superManIdsList.contains(employeeId); - } - - /** - * 根据员工ID 获取 权限信息 - * - * @param employeeId - * @return - */ - public List getPrivilegesByEmployeeId(Long employeeId) { - List privilegeEntities = null; - // 如果是超管的话 - Boolean isSuperman = this.isSuperman(employeeId); - if (isSuperman) { - privilegeEntities = privilegeDao.selectAll(); - } else { - privilegeEntities = loadPrivilegeFromDb(employeeId); - } - - if (privilegeEntities == null) { - privilegeEntities = Lists.newArrayList(); - } - - this.updateCachePrivilege(employeeId, privilegeEntities); - return privilegeEntities; - } - - /** - * 获取某人所能访问的方法 - * - * @param employeeId - * @return - */ - private Map> getPrivileges(Long employeeId) { - Map> privileges = employeePrivileges.get(employeeId); - if (privileges != null) { - return privileges; - } - List privilegeEntities = this.loadPrivilegeFromDb(employeeId); - return updateCachePrivilege(employeeId, privilegeEntities); - } - - private List loadPrivilegeFromDb(Long employeeId) { - List roleIdList = roleEmployeeDao.selectRoleIdByEmployeeId(employeeId); - if (CollectionUtils.isEmpty(roleIdList)) { - return Lists.newArrayList(); - } - List privilegeEntities = rolePrivilegeDao.listByRoleIds(roleIdList, JudgeEnum.YES.getValue()); - if (privilegeEntities != null) { - return privilegeEntities; - } - return Collections.emptyList(); - } - - public Map> updateCachePrivilege(Long employeeId, List privilegeEntities) { - employeePrivilegeListMap.put(employeeId, privilegeEntities); - List privilegeList = new ArrayList<>(); - Map> privilegeMap = new HashMap<>(16); - if (CollectionUtils.isNotEmpty(privilegeEntities)) { - List> setList = - privilegeEntities.stream().filter(e -> e.getType().equals(PrivilegeTypeEnum.POINTS.getValue())).map(PrivilegeEntity::getUrl).collect(Collectors.toList()).stream().map(e -> SmartStringUtil.splitConvertToList(e, ",")).collect(Collectors.toList()); - setList.forEach(privilegeList::addAll); - } - privilegeList.forEach(item -> { - List path = SmartStringUtil.splitConvertToList(item, "\\."); - String controllerName = path.get(0).toLowerCase(); - String methodName = path.get(1); - List methodNameList = privilegeMap.get(controllerName); - if (null == methodNameList) { - methodNameList = new ArrayList(); - } - if (!methodNameList.contains(methodName)) { - methodNameList.add(methodName); - } - privilegeMap.put(controllerName, methodNameList); - }); - - employeePrivileges.put(employeeId, privilegeMap); - return privilegeMap; - } - - public void updateOnlineEmployeePrivilegeByRoleId(Long roleId) { - List roleEmployeeList = roleEmployeeDao.selectEmployeeByRoleId(roleId); - List employeeIdList = roleEmployeeList.stream().map(e -> e.getId()).collect(Collectors.toList()); - - for (Long empId : employeePrivileges.keySet()) { - if (employeeIdList.contains(empId)) { - getPrivilegesByEmployeeId(empId); - } - } - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/service/PrivilegeRequestUrlService.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/service/PrivilegeRequestUrlService.java deleted file mode 100644 index f9aa07aa..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/service/PrivilegeRequestUrlService.java +++ /dev/null @@ -1,117 +0,0 @@ -package net.lab1024.smartadmin.module.system.privilege.service; - -import net.lab1024.smartadmin.constant.CommonConst; -import net.lab1024.smartadmin.module.system.privilege.domain.dto.PrivilegeRequestUrlVO; -import net.lab1024.smartadmin.util.SmartStringUtil; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; -import io.swagger.annotations.ApiModelProperty; -import io.swagger.annotations.ApiOperation; -import org.apache.commons.collections.CollectionUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.core.annotation.AnnotationUtils; -import org.springframework.stereotype.Service; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.context.WebApplicationContext; -import org.springframework.web.method.HandlerMethod; -import org.springframework.web.servlet.mvc.method.RequestMappingInfo; -import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; - -import javax.annotation.PostConstruct; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.CopyOnWriteArrayList; - -/** - * [ 初始化 分离前后台权限URL ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/3/28 0028 上午 9:13 - * @since JDK1.8 - */ -@Service -public class PrivilegeRequestUrlService { - - /** - * 系统所有requestUrl - */ - private CopyOnWriteArrayList privilegeUrlDTOList = Lists.newCopyOnWriteArrayList(); - - @Autowired - private WebApplicationContext applicationContext; - - @PostConstruct - public void initAllUrl() { - this.privilegeUrlDTOList.clear(); - - RequestMappingHandlerMapping mapping = applicationContext.getBean(RequestMappingHandlerMapping.class); - //获取url与类和方法的对应信息 - Map map = mapping.getHandlerMethods(); - map.forEach((info, handlerMethod) -> { - //只对Rest 服务进行权限验证 - RestController restAnnotation = AnnotationUtils.findAnnotation(handlerMethod.getMethod().getDeclaringClass(), RestController.class); - if (restAnnotation == null) { - ResponseBody responseBody = handlerMethod.getMethod().getAnnotation(ResponseBody.class); - if (responseBody == null) { - return; - } - } - //获取url的Set集合,一个方法可能对应多个url - Set patterns = info.getPatternsCondition().getPatterns(); - if (CollectionUtils.isEmpty(patterns)) { - return; - } - String className = (String) handlerMethod.getBean(); - String methodName = handlerMethod.getMethod().getName(); - List list = SmartStringUtil.splitConvertToList(className, "\\."); - String controllerName = list.get(list.size() - 1); - String name = controllerName + "." + methodName; - - ApiOperation apiOperation = handlerMethod.getMethod().getAnnotation(ApiOperation.class); - String methodComment = null; - if (apiOperation != null) { - methodComment = apiOperation.value(); - } else { - ApiModelProperty apiModelProperty = handlerMethod.getMethod().getAnnotation(ApiModelProperty.class); - if (apiModelProperty != null) { - methodComment = apiModelProperty.value(); - } else { - methodComment = handlerMethod.getMethod().getName(); - } - } - Set urlSet = this.getUrlSet(patterns); - for (String url : urlSet) { - PrivilegeRequestUrlVO privilegeUrlDTO = new PrivilegeRequestUrlVO(); - privilegeUrlDTO.setUrl(url); - privilegeUrlDTO.setName(name); - privilegeUrlDTO.setComment(methodComment); - this.privilegeUrlDTOList.add(privilegeUrlDTO); - } - - }); - } - - private Set getUrlSet(Set patterns) { - Set urlSet = Sets.newHashSet(); - for (String url : patterns) { - for (String ignoreUrl : CommonConst.CommonCollection.IGNORE_URL_MAPPING) { - if (url.startsWith(ignoreUrl)) { - urlSet.add(url.substring(ignoreUrl.length() - 1)); - } else { - urlSet.add(url); - } - } - } - return urlSet; - } - - public List getPrivilegeList() { - return this.privilegeUrlDTOList; - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/service/PrivilegeService.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/service/PrivilegeService.java deleted file mode 100644 index c66a919e..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/privilege/service/PrivilegeService.java +++ /dev/null @@ -1,285 +0,0 @@ -package net.lab1024.smartadmin.module.system.privilege.service; - -import com.google.common.collect.Lists; -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.common.domain.ValidateList; -import net.lab1024.smartadmin.module.system.privilege.constant.PrivilegeResponseCodeConst; -import net.lab1024.smartadmin.module.system.privilege.constant.PrivilegeTypeEnum; -import net.lab1024.smartadmin.module.system.privilege.dao.PrivilegeDao; -import net.lab1024.smartadmin.module.system.privilege.domain.dto.*; -import net.lab1024.smartadmin.module.system.privilege.domain.entity.PrivilegeEntity; -import net.lab1024.smartadmin.module.system.role.roleprivilege.RolePrivilegeDao; -import org.apache.commons.collections.CollectionUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.*; -import java.util.stream.Collectors; - -/** - * [ 后台员工权限 ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - * @since JDK1.8 - */ -@Service -public class PrivilegeService { - - @Autowired - private PrivilegeRequestUrlService privilegeRequestUrlService; - - @Autowired - private PrivilegeDao privilegeDao; - - @Autowired - private RolePrivilegeDao rolePrivilegeDao; - - /** - * 获取系统所有请求路径 - * - * @return - */ - public ResponseDTO> getPrivilegeUrlDTOList() { - List privilegeUrlList = privilegeRequestUrlService.getPrivilegeList(); - return ResponseDTO.succData(privilegeUrlList); - } - - /** - * 批量保存权限菜单项 - * - * @param menuList - * @return - */ - @Transactional(rollbackFor = Throwable.class) - public ResponseDTO menuBatchSave(List menuList) { - if (CollectionUtils.isEmpty(menuList)) { - return ResponseDTO.succ(); - } - //使用前端发送权限的排序 - for (int i = 0; i < menuList.size(); i++) { - menuList.get(i).setSort(i); - } - - List privilegeList = privilegeDao.selectByExcludeType(PrivilegeTypeEnum.POINTS.getValue()); - //若数据库无数据 直接全部保存 - if (CollectionUtils.isEmpty(privilegeList)) { - List menuSaveEntity = this.buildPrivilegeMenuEntity(menuList); - privilegeDao.batchInsert(menuSaveEntity); - return ResponseDTO.succ(); - } - //处理需更新的菜单项 - Map storageMap = menuList.stream().collect(Collectors.toMap(PrivilegeMenuDTO::getMenuKey, e -> e)); - Set menuKeyList = storageMap.keySet(); - List updatePrivilegeList = privilegeList.stream().filter(e -> menuKeyList.contains(e.getKey())).collect(Collectors.toList()); - if (CollectionUtils.isNotEmpty(updatePrivilegeList)) { - this.rebuildPrivilegeMenuEntity(storageMap, updatePrivilegeList); - privilegeDao.batchUpdate(updatePrivilegeList); - } - //处理需删除的菜单项 - List delKeyList = privilegeList.stream().filter(e -> !menuKeyList.contains(e.getKey())).map(PrivilegeEntity::getKey).collect(Collectors.toList()); - if (CollectionUtils.isNotEmpty(delKeyList)) { - privilegeDao.delByKeyList(delKeyList); - //处理需删除的功能点 - privilegeDao.delByParentKeyList(delKeyList); - rolePrivilegeDao.deleteByPrivilegeKey(delKeyList); - } - - //处理需新增的菜单项 - List dbKeyList = privilegeList.stream().map(PrivilegeEntity::getKey).collect(Collectors.toList()); - List addPrivilegeList = menuList.stream().filter(e -> !dbKeyList.contains(e.getMenuKey())).collect(Collectors.toList()); - if (CollectionUtils.isNotEmpty(addPrivilegeList)) { - List menuAddEntity = this.buildPrivilegeMenuEntity(addPrivilegeList); - privilegeDao.batchInsert(menuAddEntity); - } - return ResponseDTO.succ(); - } - - /** - * 构建权限菜单项类别 - * - * @param menuList - * @return - */ - private List buildPrivilegeMenuEntity(List menuList) { - List privilegeList = Lists.newArrayList(); - PrivilegeEntity privilegeEntity; - for (PrivilegeMenuDTO menuDTO : menuList) { - privilegeEntity = new PrivilegeEntity(); - privilegeEntity.setKey(menuDTO.getMenuKey()); - privilegeEntity.setName(menuDTO.getMenuName()); - privilegeEntity.setParentKey(menuDTO.getParentKey()); - privilegeEntity.setType(menuDTO.getType()); - privilegeEntity.setSort(menuDTO.getSort()); - privilegeEntity.setUrl(menuDTO.getUrl()); - privilegeList.add(privilegeEntity); - } - return privilegeList; - } - - /** - * 更新权限菜单项 - * - * @param menuMap - * @param menuEntityList - */ - private void rebuildPrivilegeMenuEntity(Map menuMap, List menuEntityList) { - for (PrivilegeEntity menuEntity : menuEntityList) { - PrivilegeMenuDTO menuDTO = menuMap.get(menuEntity.getKey()); - menuEntity.setName(menuDTO.getMenuName()); - menuEntity.setParentKey(menuDTO.getParentKey()); - menuEntity.setType(menuDTO.getType()); - menuEntity.setSort(menuDTO.getSort()); - } - - } - - /** - * 查询所有的权限菜单 - * - * @return - */ - public ResponseDTO> menuQueryAll() { - List privilegeEntityList = privilegeDao.selectByType(PrivilegeTypeEnum.MENU.getValue()); - if (CollectionUtils.isEmpty(privilegeEntityList)) { - return ResponseDTO.succData(Lists.newArrayList()); - } - - List voList = privilegeEntityList.stream().map(e -> { - PrivilegeMenuVO vo = new PrivilegeMenuVO(); - vo.setMenuKey(e.getKey()); - vo.setMenuName(e.getName()); - vo.setParentKey(e.getParentKey()); - vo.setSort(e.getSort()); - vo.setUrl(e.getUrl()); - return vo; - }).collect(Collectors.toList()); - - return ResponseDTO.succData(voList); - } - - - /** - * 保存更新功能点 - * - * @param privilegeFunctionDTO - * @return - */ - public ResponseDTO functionSaveOrUpdate(PrivilegeFunctionDTO privilegeFunctionDTO) { - String functionKey = privilegeFunctionDTO.getFunctionKey(); - PrivilegeEntity functionEntity = privilegeDao.selectByKey(functionKey); - if (functionEntity == null) { - return ResponseDTO.wrap(PrivilegeResponseCodeConst.POINT_NOT_EXIST); - } - functionEntity.setUrl(privilegeFunctionDTO.getUrl()); - functionEntity.setName(privilegeFunctionDTO.getFunctionName()); - functionEntity.setParentKey(privilegeFunctionDTO.getMenuKey()); - functionEntity.setSort(privilegeFunctionDTO.getSort()); - privilegeDao.updateById(functionEntity); - - return ResponseDTO.succ(); - } - - /** - * 查询功能点 - * - * @param menuKey - * @return - */ - public ResponseDTO> functionQuery(String menuKey) { - List functionPrivilegeList = privilegeDao.selectByParentKey(menuKey); - if (CollectionUtils.isEmpty(functionPrivilegeList)) { - return ResponseDTO.succData(Lists.newArrayList()); - } - List functionList = Lists.newArrayList(); - for (PrivilegeEntity functionEntity : functionPrivilegeList) { - PrivilegeFunctionVO functionDTO = new PrivilegeFunctionVO(); - functionDTO.setFunctionKey(functionEntity.getKey()); - functionDTO.setFunctionName(functionEntity.getName()); - functionDTO.setMenuKey(functionEntity.getParentKey()); - functionDTO.setUrl(functionEntity.getUrl()); - functionDTO.setSort(functionEntity.getSort()); - functionList.add(functionDTO); - } - return ResponseDTO.succData(functionList); - } - - @Transactional(rollbackFor = Exception.class) - public ResponseDTO batchSaveFunctionList(ValidateList functionList) { - String menuKey = functionList.get(0).getMenuKey(); - PrivilegeEntity privilegeEntity = privilegeDao.selectByKey(menuKey); - if (privilegeEntity == null) { - return ResponseDTO.wrap(PrivilegeResponseCodeConst.MENU_NOT_EXIST); - } - - List functionKeyList = functionList.stream().map(PrivilegeFunctionDTO::getFunctionKey).collect(Collectors.toList()); - - //数据库中存在的数据 - List existFunctionList = privilegeDao.selectByKeyList(functionKeyList); - //校验是否parent key重复 - boolean parentKeyExist = existFunctionList.stream().anyMatch(e -> !menuKey.equals(e.getParentKey())); - if(parentKeyExist){ - return ResponseDTO.wrap(PrivilegeResponseCodeConst.ROUTER_KEY_NO_REPEAT); - } - - existFunctionList = privilegeDao.selectByParentKey(menuKey); - Map privilegeEntityMap = existFunctionList.stream().collect(Collectors.toMap(PrivilegeEntity::getKey, e -> e)); - //如果没有,则保存全部 - if (existFunctionList.isEmpty()) { - List privilegeEntityList = functionList.stream().map(e -> function2Privilege(e)).collect(Collectors.toList()); - privilegeDao.batchInsert(privilegeEntityList); - return ResponseDTO.succ(); - } - - Set functionKeySet = functionList.stream().map(PrivilegeFunctionDTO::getFunctionKey).collect(Collectors.toSet()); - //删除的 - List deleteIdList = existFunctionList.stream().filter(e -> !functionKeySet.contains(e.getKey())).map(PrivilegeEntity::getId).collect(Collectors.toList()); - List deleteKeyList = existFunctionList.stream().filter(e -> !functionKeySet.contains(e.getKey())).map(PrivilegeEntity::getKey).collect(Collectors.toList()); - if (!deleteIdList.isEmpty()) { - privilegeDao.deleteBatchIds(deleteIdList); - rolePrivilegeDao.deleteByPrivilegeKey(deleteKeyList); - } - - //需要更新的 - ArrayList batchUpdateList = Lists.newArrayList(); - for (PrivilegeFunctionDTO privilegeFunctionDTO : functionList) { - PrivilegeEntity existPrivilege = privilegeEntityMap.get(privilegeFunctionDTO.getFunctionKey()); - if (existPrivilege != null) { - existPrivilege.setSort(privilegeFunctionDTO.getSort()); - existPrivilege.setName(privilegeFunctionDTO.getFunctionName()); - batchUpdateList.add(existPrivilege); - } - } - - if (!batchUpdateList.isEmpty()) { - privilegeDao.batchUpdate(batchUpdateList); - } - - //新增的 - List batchInsertList = functionList.stream() - .filter(e -> !privilegeEntityMap.containsKey(e.getFunctionKey())) - .map(e -> function2Privilege(e)) - .collect(Collectors.toList()); - - if (!batchInsertList.isEmpty()) { - privilegeDao.batchInsert(batchInsertList); - } - - return ResponseDTO.succ(); - } - - private PrivilegeEntity function2Privilege(PrivilegeFunctionDTO privilegeFunction) { - PrivilegeEntity privilegeEntity = new PrivilegeEntity(); - privilegeEntity.setKey(privilegeFunction.getFunctionKey()); - privilegeEntity.setName(privilegeFunction.getFunctionName()); - privilegeEntity.setParentKey(privilegeFunction.getMenuKey()); - privilegeEntity.setType(PrivilegeTypeEnum.POINTS.getValue()); - privilegeEntity.setSort(privilegeFunction.getSort()); - privilegeEntity.setUrl(""); - return privilegeEntity; - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/RoleController.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/RoleController.java deleted file mode 100644 index c95afff7..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/RoleController.java +++ /dev/null @@ -1,60 +0,0 @@ -package net.lab1024.smartadmin.module.system.role.basic; -import net.lab1024.smartadmin.common.anno.OperateLog; -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.constant.SwaggerTagConst; -import net.lab1024.smartadmin.module.system.role.basic.domain.dto.RoleAddDTO; -import net.lab1024.smartadmin.module.system.role.basic.domain.dto.RoleUpdateDTO; -import net.lab1024.smartadmin.module.system.role.basic.domain.dto.RoleVO; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.validation.Valid; -import java.util.List; - -/** - * 角色管理路由 - * - * @author listen - * @date 2017/12/28 10:10 - */ -@Api(tags = {SwaggerTagConst.Admin.MANAGER_ROLE}) -@OperateLog -@RestController -public class RoleController { - - @Autowired - private RoleService roleService; - - @ApiOperation(value = "添加角色", notes = "添加角色") - @PostMapping("/role/add") - public ResponseDTO addRole(@Valid @RequestBody RoleAddDTO roleAddDTO) { - return roleService.addRole(roleAddDTO); - } - - @ApiOperation(value = "删除角色", notes = "根据id删除角色") - @GetMapping("/role/delete/{roleId}") - public ResponseDTO deleteRole(@PathVariable("roleId") Long roleId) { - return roleService.deleteRole(roleId); - } - - @ApiOperation(value = "更新角色", notes = "更新角色") - @PostMapping("/role/update") - public ResponseDTO updateRole(@Valid @RequestBody RoleUpdateDTO roleUpdateDTO) { - return roleService.updateRole(roleUpdateDTO); - } - - @ApiOperation(value = "获取角色数据", notes = "根据id获取角色数据") - @GetMapping("/role/get/{roleId}") - public ResponseDTO getRole(@PathVariable("roleId") Long roleId) { - return roleService.getRoleById(roleId); - } - - @ApiOperation(value = "获取所有角色", notes = "获取所有角色数据") - @GetMapping("/role/getAll") - public ResponseDTO> getAllRole() { - return roleService.getAllRole(); - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/RoleDao.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/RoleDao.java deleted file mode 100644 index 91b83b4f..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/RoleDao.java +++ /dev/null @@ -1,26 +0,0 @@ -package net.lab1024.smartadmin.module.system.role.basic; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import net.lab1024.smartadmin.module.system.role.basic.domain.entity.RoleEntity; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Component; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/3/27 0027 下午 13:00 - * @since JDK1.8 - */ -@Mapper -@Component -public interface RoleDao extends BaseMapper { - - - RoleEntity getByRoleName(@Param("roleName") String name); - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/RoleResponseCodeConst.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/RoleResponseCodeConst.java deleted file mode 100644 index c1818465..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/RoleResponseCodeConst.java +++ /dev/null @@ -1,24 +0,0 @@ -package net.lab1024.smartadmin.module.system.role.basic; -import net.lab1024.smartadmin.common.constant.ResponseCodeConst; - -/** - * - * @author yandanyang - * 角色业务状态码 6001 - 6999 - */ -public class RoleResponseCodeConst extends ResponseCodeConst { - - /** - * 10501 角色名称已存在 - */ - public static final RoleResponseCodeConst ROLE_NAME_EXISTS = new RoleResponseCodeConst(6001, "角色名称已存在"); - - /** - * 10502 角色不存在 - */ - public static final RoleResponseCodeConst ROLE_NOT_EXISTS = new RoleResponseCodeConst(6002, "角色不存在"); - - public RoleResponseCodeConst(int code, String msg) { - super(code, msg); - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/RoleService.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/RoleService.java deleted file mode 100644 index cd0d6444..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/RoleService.java +++ /dev/null @@ -1,114 +0,0 @@ -package net.lab1024.smartadmin.module.system.role.basic; - -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.module.system.role.basic.domain.dto.RoleAddDTO; -import net.lab1024.smartadmin.module.system.role.basic.domain.dto.RoleUpdateDTO; -import net.lab1024.smartadmin.module.system.role.basic.domain.dto.RoleVO; -import net.lab1024.smartadmin.module.system.role.basic.domain.entity.RoleEntity; -import net.lab1024.smartadmin.module.system.role.roleemployee.RoleEmployeeDao; -import net.lab1024.smartadmin.module.system.role.roleprivilege.RolePrivilegeDao; -import net.lab1024.smartadmin.util.SmartBeanUtil; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.List; - -/** - * 角色管理业务 - * - * @author listen - * @date 2017/12/28 09:37 - */ -@Service -public class RoleService { - - @Autowired - private RoleDao roleDao; - - @Autowired - private RolePrivilegeDao rolePrivilegeDao; - - @Autowired - private RoleEmployeeDao roleEmployeeDao; - - /** - * 新增添加角色 - * - * @param roleAddDTO - * @return ResponseDTO - */ - public ResponseDTO addRole(RoleAddDTO roleAddDTO) { - RoleEntity employeeRoleEntity = roleDao.getByRoleName(roleAddDTO.getRoleName()); - if (null != employeeRoleEntity) { - return ResponseDTO.wrap(RoleResponseCodeConst.ROLE_NAME_EXISTS); - } - RoleEntity roleEntity = SmartBeanUtil.copy(roleAddDTO, RoleEntity.class); - roleDao.insert(roleEntity); - return ResponseDTO.succ(); - } - - /** - * 根据角色id 删除 - * - * @param roleId - * @return ResponseDTO - */ - @Transactional(rollbackFor = Exception.class) - public ResponseDTO deleteRole(Long roleId) { - RoleEntity roleEntity = roleDao.selectById(roleId); - if (null == roleEntity) { - return ResponseDTO.wrap(RoleResponseCodeConst.ROLE_NOT_EXISTS); - } - roleDao.deleteById(roleId); - rolePrivilegeDao.deleteByRoleId(roleId); - roleEmployeeDao.deleteByRoleId(roleId); - return ResponseDTO.succ(); - } - - /** - * 更新角色 - * - * @param roleUpdateDTO - * @return ResponseDTO - */ - @Transactional(rollbackFor = Exception.class) - public ResponseDTO updateRole(RoleUpdateDTO roleUpdateDTO) { - if (null == roleDao.selectById(roleUpdateDTO.getId())) { - return ResponseDTO.wrap(RoleResponseCodeConst.ROLE_NOT_EXISTS); - } - RoleEntity employeeRoleEntity = roleDao.getByRoleName(roleUpdateDTO.getRoleName()); - if (null != employeeRoleEntity && ! employeeRoleEntity.getId().equals(roleUpdateDTO.getId())) { - return ResponseDTO.wrap(RoleResponseCodeConst.ROLE_NAME_EXISTS); - } - RoleEntity roleEntity = SmartBeanUtil.copy(roleUpdateDTO, RoleEntity.class); - roleDao.updateById(roleEntity); - return ResponseDTO.succ(); - } - - /** - * 根据id获取角色数据 - * - * @param roleId - * @return ResponseDTO - */ - public ResponseDTO getRoleById(Long roleId) { - RoleEntity roleEntity = roleDao.selectById(roleId); - if (null == roleEntity) { - return ResponseDTO.wrap(RoleResponseCodeConst.ROLE_NOT_EXISTS); - } - RoleVO role = SmartBeanUtil.copy(roleEntity, RoleVO.class); - return ResponseDTO.succData(role); - } - - /** - * 获取所有角色列表 - * - * @return ResponseDTO - */ - public ResponseDTO> getAllRole() { - List roleEntityList = roleDao.selectList(null); - List roleList = SmartBeanUtil.copyList(roleEntityList, RoleVO.class); - return ResponseDTO.succData(roleList); - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/domain/dto/RoleQueryDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/domain/dto/RoleQueryDTO.java deleted file mode 100644 index 08f2a94b..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/domain/dto/RoleQueryDTO.java +++ /dev/null @@ -1,25 +0,0 @@ -package net.lab1024.smartadmin.module.system.role.basic.domain.dto; -import net.lab1024.smartadmin.common.domain.PageParamDTO; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * - * [ ] - * - * @version 1.0 - * @since JDK1.8 - * @author yandanyang - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - */ -@Data -public class RoleQueryDTO extends PageParamDTO { - - @ApiModelProperty("角色名称") - private String roleName; - - @ApiModelProperty("角色id") - private String roleId; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/domain/dto/RoleSelectedVO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/domain/dto/RoleSelectedVO.java deleted file mode 100644 index 9a88d6d2..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/domain/dto/RoleSelectedVO.java +++ /dev/null @@ -1,21 +0,0 @@ -package net.lab1024.smartadmin.module.system.role.basic.domain.dto; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/3/27 0027 下午 15:27 - * @since JDK1.8 - */ -@Data -public class RoleSelectedVO extends RoleVO { - - @ApiModelProperty("角色名称") - private Boolean selected; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/domain/dto/RoleUpdateDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/domain/dto/RoleUpdateDTO.java deleted file mode 100644 index adde4749..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/domain/dto/RoleUpdateDTO.java +++ /dev/null @@ -1,24 +0,0 @@ -package net.lab1024.smartadmin.module.system.role.basic.domain.dto; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotNull; - -/** - * 角色更新修改DTO - * - * @author listen - * @date 2017/12/28 09:40 - */ -@Data -public class RoleUpdateDTO extends RoleAddDTO { - - /** - * 角色id - */ - @ApiModelProperty("角色id") - @NotNull(message = "角色id不能为空") - protected Long id; - - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/domain/entity/RoleEntity.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/domain/entity/RoleEntity.java deleted file mode 100644 index ff9d650f..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/basic/domain/entity/RoleEntity.java +++ /dev/null @@ -1,25 +0,0 @@ -package net.lab1024.smartadmin.module.system.role.basic.domain.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import net.lab1024.smartadmin.common.domain.BaseEntity; -import lombok.Data; - -/** - * [ 角色 ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/3/27 0027 下午 13:01 - * @since JDK1.8 - */ -@Data -@TableName("t_role") -public class RoleEntity extends BaseEntity { - - - private String roleName; - - private String remark; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleemployee/RoleEmployeeController.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleemployee/RoleEmployeeController.java deleted file mode 100644 index 72c4e507..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleemployee/RoleEmployeeController.java +++ /dev/null @@ -1,73 +0,0 @@ -package net.lab1024.smartadmin.module.system.role.roleemployee; - -import net.lab1024.smartadmin.common.anno.OperateLog; -import net.lab1024.smartadmin.common.domain.PageResultDTO; -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.constant.SwaggerTagConst; -import net.lab1024.smartadmin.module.system.employee.domain.vo.EmployeeVO; -import net.lab1024.smartadmin.module.system.role.basic.domain.dto.RoleBatchDTO; -import net.lab1024.smartadmin.module.system.role.basic.domain.dto.RoleQueryDTO; -import net.lab1024.smartadmin.module.system.role.basic.domain.dto.RoleSelectedVO; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.validation.Valid; -import java.util.List; - -/** - * 用户角色管理路由 - * - * @author listen - * @date 2017/12/28 10:10 - */ -@Api(tags = {SwaggerTagConst.Admin.MANAGER_ROLE_USER}) -@OperateLog -@RestController -public class RoleEmployeeController { - - @Autowired - private RoleEmployeeService roleEmployeeService; - - @ApiOperation(value = "获取角色成员-员工列表", notes = "获取角色成员-员工列表(分页)") - @PostMapping("/role/listEmployee") - public ResponseDTO> listEmployeeByName(@Valid @RequestBody RoleQueryDTO queryDTO) { - return roleEmployeeService.listEmployeeByName(queryDTO); - } - - @ApiOperation(value = "根据角色id获取角色员工列表(无分页)", notes = "根据角色id获取角色成员-员工列表") - @GetMapping("/role/listAllEmployee/{roleId}") - public ResponseDTO> listAllEmployeeRoleId(@PathVariable Long roleId) { - return roleEmployeeService.getAllEmployeeByRoleId(roleId); - } - - @ApiOperation(value = "从角色成员列表中移除员工", notes = "从角色成员列表中移除员工") - @ApiImplicitParams({@ApiImplicitParam(name = "employeeId", value = "员工id", paramType = "query", required = true), @ApiImplicitParam(name = "roleId", value = "角色id", paramType = "query", - required = true)}) - @GetMapping("/role/removeEmployee") - public ResponseDTO removeEmployee(Long employeeId, Long roleId) { - return roleEmployeeService.removeEmployeeRole(employeeId, roleId); - } - - @ApiOperation(value = "从角色成员列表中批量移除员工", notes = "从角色成员列表中批量移除员工") - @PostMapping("/role/removeEmployeeList") - public ResponseDTO removeEmployeeList(@Valid @RequestBody RoleBatchDTO removeDTO) { - return roleEmployeeService.batchRemoveEmployeeRole(removeDTO); - } - - @ApiOperation(value = "角色成员列表中批量添加员工", notes = "角色成员列表中批量添加员工") - @PostMapping("/role/addEmployeeList") - public ResponseDTO addEmployeeList(@Valid @RequestBody RoleBatchDTO addDTO) { - return roleEmployeeService.batchAddEmployeeRole(addDTO); - } - - @ApiOperation(value = "通过员工id获取所有角色以及员工具有的角色", notes = "通过员工id获取所有角色以及员工具有的角色") - @GetMapping("/role/getRoles/{employeeId}") - @ApiImplicitParams({@ApiImplicitParam(name = "employeeId", value = "员工id", paramType = "path", required = true)}) - public ResponseDTO> getRoleByEmployeeId(@PathVariable Long employeeId) { - return roleEmployeeService.getRolesByEmployeeId(employeeId); - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleemployee/RoleEmployeeService.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleemployee/RoleEmployeeService.java deleted file mode 100644 index cf57ed4f..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleemployee/RoleEmployeeService.java +++ /dev/null @@ -1,132 +0,0 @@ -package net.lab1024.smartadmin.module.system.role.roleemployee; - -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import net.lab1024.smartadmin.common.domain.PageResultDTO; -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.module.system.department.DepartmentDao; -import net.lab1024.smartadmin.module.system.department.domain.entity.DepartmentEntity; -import net.lab1024.smartadmin.module.system.employee.domain.dto.EmployeeDTO; -import net.lab1024.smartadmin.module.system.employee.domain.vo.EmployeeVO; -import net.lab1024.smartadmin.module.system.role.basic.RoleDao; -import net.lab1024.smartadmin.module.system.role.basic.RoleResponseCodeConst; -import net.lab1024.smartadmin.module.system.role.basic.domain.dto.RoleBatchDTO; -import net.lab1024.smartadmin.module.system.role.basic.domain.dto.RoleQueryDTO; -import net.lab1024.smartadmin.module.system.role.basic.domain.dto.RoleSelectedVO; -import net.lab1024.smartadmin.module.system.role.basic.domain.entity.RoleEntity; -import net.lab1024.smartadmin.module.system.role.roleemployee.domain.RoleEmployeeEntity; -import net.lab1024.smartadmin.util.SmartBeanUtil; -import net.lab1024.smartadmin.util.SmartPageUtil; -import com.google.common.collect.Lists; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.List; - -/** - * 角色管理业务 - * - * @author zzr - * @date 2019/4/3 - */ -@Service -public class RoleEmployeeService { - - @Autowired - private RoleEmployeeDao roleEmployeeDao; - - @Autowired - private RoleDao roleDao; - - @Autowired - private DepartmentDao departmentDao; - - /** - * 通过角色id,分页获取成员员工列表 - * - * @param queryDTO - * @return - */ - public ResponseDTO> listEmployeeByName(RoleQueryDTO queryDTO) { - Page page = SmartPageUtil.convert2QueryPage(queryDTO); - List employeeDTOS = roleEmployeeDao.selectEmployeeByNamePage(page, queryDTO); - employeeDTOS.stream().filter(e -> e.getDepartmentId() != null).forEach(employeeDTO -> { - DepartmentEntity departmentEntity = departmentDao.selectById(employeeDTO.getDepartmentId()); - employeeDTO.setDepartmentName(departmentEntity.getName()); - }); - PageResultDTO pageResultDTO = SmartPageUtil.convert2PageResult(page, employeeDTOS, EmployeeVO.class); - return ResponseDTO.succData(pageResultDTO); - } - - public ResponseDTO> getAllEmployeeByRoleId(Long roleId) { - List employeeDTOS = roleEmployeeDao.selectEmployeeByRoleId(roleId); - List list = SmartBeanUtil.copyList(employeeDTOS, EmployeeVO.class); - return ResponseDTO.succData(list); - } - - /** - * 移除员工角色 - * - * @param employeeId - * @param roleId - * @return ResponseDTO - */ - @Transactional(rollbackFor = Exception.class) - public ResponseDTO removeEmployeeRole(Long employeeId, Long roleId) { - if (null == employeeId || null == roleId) { - return ResponseDTO.wrap(RoleResponseCodeConst.ERROR_PARAM); - } - roleEmployeeDao.deleteByEmployeeIdRoleId(employeeId, roleId); - return ResponseDTO.succ(); - } - - /** - * 批量删除角色的成员员工 - * - * @param removeDTO - * @return ResponseDTO - */ - @Transactional(rollbackFor = Exception.class) - public ResponseDTO batchRemoveEmployeeRole(RoleBatchDTO removeDTO) { - List employeeIdList = removeDTO.getEmployeeIds(); - roleEmployeeDao.batchDeleteEmployeeRole(removeDTO.getRoleId(), employeeIdList); - return ResponseDTO.succ(); - } - - /** - * 批量添加角色的成员员工 - * - * @param addDTO - * @return ResponseDTO - */ - @Transactional(rollbackFor = Exception.class) - public ResponseDTO batchAddEmployeeRole(RoleBatchDTO addDTO) { - Long roleId = addDTO.getRoleId(); - List employeeIdList = addDTO.getEmployeeIds(); - roleEmployeeDao.deleteByRoleId(roleId); - List roleRelationEntities = Lists.newArrayList(); - RoleEmployeeEntity employeeRoleRelationEntity; - for (Long employeeId : employeeIdList) { - employeeRoleRelationEntity = new RoleEmployeeEntity(); - employeeRoleRelationEntity.setRoleId(roleId); - employeeRoleRelationEntity.setEmployeeId(employeeId); - roleRelationEntities.add(employeeRoleRelationEntity); - } - roleEmployeeDao.batchInsert(roleRelationEntities); - return ResponseDTO.succ(); - } - - /** - * 通过员工id获取员工角色 - * - * @param employeeId - * @return - */ - public ResponseDTO> getRolesByEmployeeId(Long employeeId) { - List roleIds = roleEmployeeDao.selectRoleIdByEmployeeId(employeeId); - List roleList = roleDao.selectList(null); - List result = SmartBeanUtil.copyList(roleList, RoleSelectedVO.class); - result.stream().forEach(item -> item.setSelected(roleIds.contains(item.getId()))); - return ResponseDTO.succData(result); - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleemployee/domain/RoleEmployeeDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleemployee/domain/RoleEmployeeDTO.java deleted file mode 100644 index 5dc70111..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleemployee/domain/RoleEmployeeDTO.java +++ /dev/null @@ -1,21 +0,0 @@ -package net.lab1024.smartadmin.module.system.role.roleemployee.domain; - -import lombok.Data; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/3/27 0027 下午 15:27 - * @since JDK1.8 - */ -@Data -public class RoleEmployeeDTO { - - private Long roleId; - - private Long employeeId; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleemployee/domain/RoleEmployeeEntity.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleemployee/domain/RoleEmployeeEntity.java deleted file mode 100644 index 58d16994..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleemployee/domain/RoleEmployeeEntity.java +++ /dev/null @@ -1,24 +0,0 @@ -package net.lab1024.smartadmin.module.system.role.roleemployee.domain; - -import com.baomidou.mybatisplus.annotation.TableName; -import net.lab1024.smartadmin.common.domain.BaseEntity; -import lombok.Data; - -/** - * [ 角色 员工关系] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/3/27 0027 下午 13:01 - * @since JDK1.8 - */ -@Data -@TableName("t_role_employee") -public class RoleEmployeeEntity extends BaseEntity { - - private Long roleId; - - private Long employeeId; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleprivilege/RolePrivilegeController.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleprivilege/RolePrivilegeController.java deleted file mode 100644 index 3cb021ef..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleprivilege/RolePrivilegeController.java +++ /dev/null @@ -1,45 +0,0 @@ -package net.lab1024.smartadmin.module.system.role.roleprivilege; - -import net.lab1024.smartadmin.common.anno.OperateLog; -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.constant.SwaggerTagConst; -import net.lab1024.smartadmin.module.system.role.roleprivilege.domain.dto.RolePrivilegeDTO; -import net.lab1024.smartadmin.module.system.role.roleprivilege.domain.dto.RolePrivilegeTreeVO; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.validation.Valid; - -/** - * [ 与员工权限相关:角色权限关系、权限列表 ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - * @since JDK1.8 - */ -@OperateLog -@RestController -@Api(tags = {SwaggerTagConst.Admin.MANAGER_ROLE_PRIVILEGE}) -public class RolePrivilegeController { - - @Autowired - private RolePrivilegeService rolePrivilegeService; - - @ApiOperation(value = "更新角色权限", notes = "更新角色权限") - @PostMapping("/privilege/updateRolePrivilege") - public ResponseDTO updateRolePrivilege(@Valid @RequestBody RolePrivilegeDTO updateDTO) { - return rolePrivilegeService.updateRolePrivilege(updateDTO); - } - - @ApiOperation(value = "获取角色可选的功能权限", notes = "获取角色可选的功能权限") - @GetMapping("/privilege/listPrivilegeByRoleId/{roleId}") - public ResponseDTO listPrivilegeByRoleId(@PathVariable("roleId") Long roleId) { - return rolePrivilegeService.listPrivilegeByRoleId(roleId); - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleprivilege/RolePrivilegeDao.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleprivilege/RolePrivilegeDao.java deleted file mode 100644 index ebf4284b..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleprivilege/RolePrivilegeDao.java +++ /dev/null @@ -1,58 +0,0 @@ -package net.lab1024.smartadmin.module.system.role.roleprivilege; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import net.lab1024.smartadmin.module.system.privilege.domain.entity.PrivilegeEntity; -import net.lab1024.smartadmin.module.system.role.roleprivilege.domain.entity.RolePrivilegeEntity; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Component; - -import java.util.List; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/3/28 0028 下午 12:23 - * @since JDK1.8 - */ -@Mapper -@Component -public interface RolePrivilegeDao extends BaseMapper { - - /** - * 根据角色id删除 - * @param roleId - */ - void deleteByRoleId(@Param("roleId")Long roleId); - - /** - * 删除权限所关联的角色信息 - * @param privilegeKeyList - */ - void deleteByPrivilegeKey(@Param("privilegeKeyList")List privilegeKeyList); - - - /** - * 批量添加 - * @param rolePrivilegeList - */ - void batchInsert(List rolePrivilegeList); - - /** - * 查询某批角色的权限 - * @param roleIds - * @return - */ - List listByRoleIds(@Param("roleIds")List roleIds,@Param("normalStatus")Integer normalStatus); - - /** - * 查询某个角色的权限 - * @param roleId - * @return - */ - List listByRoleId(@Param("roleId")Long roleId); -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleprivilege/RolePrivilegeService.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleprivilege/RolePrivilegeService.java deleted file mode 100644 index dd39f36f..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleprivilege/RolePrivilegeService.java +++ /dev/null @@ -1,129 +0,0 @@ -package net.lab1024.smartadmin.module.system.role.roleprivilege; - -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.module.system.privilege.dao.PrivilegeDao; -import net.lab1024.smartadmin.module.system.privilege.domain.entity.PrivilegeEntity; -import net.lab1024.smartadmin.module.system.privilege.service.PrivilegeEmployeeService; -import net.lab1024.smartadmin.module.system.role.basic.RoleDao; -import net.lab1024.smartadmin.module.system.role.basic.RoleResponseCodeConst; -import net.lab1024.smartadmin.module.system.role.basic.domain.entity.RoleEntity; -import net.lab1024.smartadmin.module.system.role.roleprivilege.domain.dto.RolePrivilegeDTO; -import net.lab1024.smartadmin.module.system.role.roleprivilege.domain.dto.RolePrivilegeSimpleDTO; -import net.lab1024.smartadmin.module.system.role.roleprivilege.domain.dto.RolePrivilegeTreeVO; -import net.lab1024.smartadmin.module.system.role.roleprivilege.domain.entity.RolePrivilegeEntity; -import net.lab1024.smartadmin.util.SmartBeanUtil; -import com.google.common.collect.Lists; -import org.apache.commons.collections.CollectionUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.Comparator; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -/** - * [ 后台员工权限 ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - * @since JDK1.8 - */ -@Service -public class RolePrivilegeService { - - @Autowired - private PrivilegeDao privilegeDao; - - @Autowired - private RoleDao roleDao; - - @Autowired - private RolePrivilegeDao rolePrivilegeDao; - - @Autowired - private PrivilegeEmployeeService privilegeEmployeeService; - - /** - * 更新角色权限 - * - * @param updateDTO - * @return ResponseDTO - */ - public ResponseDTO updateRolePrivilege(RolePrivilegeDTO updateDTO) { - Long roleId = updateDTO.getRoleId(); - RoleEntity roleEntity = roleDao.selectById(roleId); - if (null == roleEntity) { - return ResponseDTO.wrap(RoleResponseCodeConst.ROLE_NOT_EXISTS); - } - rolePrivilegeDao.deleteByRoleId(roleId); - List rolePrivilegeList = Lists.newArrayList(); - RolePrivilegeEntity rolePrivilegeEntity; - for (String privilegeKey : updateDTO.getPrivilegeKeyList()) { - rolePrivilegeEntity = new RolePrivilegeEntity(); - rolePrivilegeEntity.setRoleId(roleId); - rolePrivilegeEntity.setPrivilegeKey(privilegeKey); - rolePrivilegeList.add(rolePrivilegeEntity); - } - rolePrivilegeDao.batchInsert(rolePrivilegeList); - privilegeEmployeeService.updateOnlineEmployeePrivilegeByRoleId(roleId); - return ResponseDTO.succ(); - } - - public ResponseDTO listPrivilegeByRoleId(Long roleId) { - RolePrivilegeTreeVO rolePrivilegeTreeDTO = new RolePrivilegeTreeVO(); - rolePrivilegeTreeDTO.setRoleId(roleId); - - List privilegeDTOList = privilegeDao.selectAll(); - if (CollectionUtils.isEmpty(privilegeDTOList)) { - rolePrivilegeTreeDTO.setPrivilege(Lists.newArrayList()); - rolePrivilegeTreeDTO.setSelectedKey(Lists.newArrayList()); - return ResponseDTO.succData(rolePrivilegeTreeDTO); - } - //构造权限树 - List privilegeList = this.buildPrivilegeTree(privilegeDTOList); - //设置选中状态 - List rolePrivilegeEntityList = rolePrivilegeDao.listByRoleId(roleId); - List privilegeKeyList = rolePrivilegeEntityList.stream().map(e -> e.getKey()).collect(Collectors.toList()); - rolePrivilegeTreeDTO.setPrivilege(privilegeList); - rolePrivilegeTreeDTO.setSelectedKey(privilegeKeyList); - return ResponseDTO.succData(rolePrivilegeTreeDTO); - } - - private List buildPrivilegeTree(List privilegeEntityList) { - List privilegeTree = Lists.newArrayList(); - List rootPrivilege = privilegeEntityList.stream().filter(e -> e.getParentKey() == null).collect(Collectors.toList()); - rootPrivilege.sort(Comparator.comparing(PrivilegeEntity::getSort)); - if (CollectionUtils.isEmpty(rootPrivilege)) { - return privilegeTree; - } - privilegeTree = SmartBeanUtil.copyList(rootPrivilege, RolePrivilegeSimpleDTO.class); - privilegeTree.forEach(e -> e.setChildren(Lists.newArrayList())); - this.buildChildPrivilegeList(privilegeEntityList, privilegeTree); - return privilegeTree; - } - - private void buildChildPrivilegeList(List privilegeEntityList, List parentMenuList) { - List parentKeyList = parentMenuList.stream().map(RolePrivilegeSimpleDTO :: getKey).collect(Collectors.toList()); - List childEntityList = privilegeEntityList.stream().filter(e -> parentKeyList.contains(e.getParentKey())).collect(Collectors.toList()); - if (CollectionUtils.isEmpty(childEntityList)) { - return; - } - Map> listMap = childEntityList.stream().collect(Collectors.groupingBy(PrivilegeEntity :: getParentKey)); - for (RolePrivilegeSimpleDTO rolePrivilegeSimpleDTO : parentMenuList) { - String key = rolePrivilegeSimpleDTO.getKey(); - List privilegeEntities = listMap.get(key); - if (CollectionUtils.isEmpty(privilegeEntities)) { - continue; - } - privilegeEntities.sort(Comparator.comparing(PrivilegeEntity::getSort)); - List privilegeList = SmartBeanUtil.copyList(privilegeEntities, RolePrivilegeSimpleDTO.class); - privilegeList.forEach(e -> e.setChildren(Lists.newArrayList())); - rolePrivilegeSimpleDTO.setChildren(privilegeList); - this.buildChildPrivilegeList(privilegeEntityList, privilegeList); - } - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleprivilege/domain/dto/RolePrivilegeDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleprivilege/domain/dto/RolePrivilegeDTO.java deleted file mode 100644 index 261fbfd0..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleprivilege/domain/dto/RolePrivilegeDTO.java +++ /dev/null @@ -1,35 +0,0 @@ -package net.lab1024.smartadmin.module.system.role.roleprivilege.domain.dto; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotNull; -import java.util.List; -/** - * - * [ ] - * - * @version 1.0 - * @since JDK1.8 - * @author yandanyang - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - */ -@Data -public class RolePrivilegeDTO { - - /** - * 角色id - */ - @ApiModelProperty("角色id") - @NotNull(message = "角色id不能为空") - private Long roleId; - - /** - * 功能权限id 集合 - */ - @ApiModelProperty("功能权限Key集合") - @NotNull(message = "功能权限集合不能为空") - private List privilegeKeyList; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleprivilege/domain/dto/RolePrivilegeSimpleDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleprivilege/domain/dto/RolePrivilegeSimpleDTO.java deleted file mode 100644 index 754b60f1..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleprivilege/domain/dto/RolePrivilegeSimpleDTO.java +++ /dev/null @@ -1,43 +0,0 @@ -package net.lab1024.smartadmin.module.system.role.roleprivilege.domain.dto; - -import net.lab1024.smartadmin.common.anno.ApiModelPropertyEnum; -import net.lab1024.smartadmin.module.system.privilege.constant.PrivilegeTypeEnum; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.List; - -/** - * 角色功能权限 - * - * @author listen - * @date 2018/01/03 08:48 - */ -@Data -public class RolePrivilegeSimpleDTO { - - @ApiModelProperty("父级Key") - private String parentKey; - /** - * 功能名称 - */ - @ApiModelProperty("名称") - private String name; - - @ApiModelPropertyEnum(enumDesc = "类型",value = PrivilegeTypeEnum.class) - private Integer type; - - @ApiModelProperty("key") - private String key; - - @ApiModelProperty("url") - private String url; - - @ApiModelProperty("排序") - private Integer sort; - - @ApiModelProperty("子级列表") - private List children; - - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleprivilege/domain/dto/RolePrivilegeTreeVO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleprivilege/domain/dto/RolePrivilegeTreeVO.java deleted file mode 100644 index 2d441f85..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleprivilege/domain/dto/RolePrivilegeTreeVO.java +++ /dev/null @@ -1,19 +0,0 @@ -package net.lab1024.smartadmin.module.system.role.roleprivilege.domain.dto; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.List; - -@Data -public class RolePrivilegeTreeVO { - - @ApiModelProperty("角色ID") - private Long roleId; - - @ApiModelProperty("权限列表") - private List privilege; - - @ApiModelProperty("选中的权限") - private List selectedKey; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleprivilege/domain/entity/RolePrivilegeEntity.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleprivilege/domain/entity/RolePrivilegeEntity.java deleted file mode 100644 index b17c80cc..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/role/roleprivilege/domain/entity/RolePrivilegeEntity.java +++ /dev/null @@ -1,32 +0,0 @@ -package net.lab1024.smartadmin.module.system.role.roleprivilege.domain.entity; -import com.baomidou.mybatisplus.annotation.TableName; -import net.lab1024.smartadmin.common.domain.BaseEntity; -import lombok.Data; - -/** - * - * [ 角色 权限关系 ] - * - * @version 1.0 - * @since JDK1.8 - * @author yandanyang - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - */ -@Data -@TableName("t_role_privilege") -public class RolePrivilegeEntity extends BaseEntity { - - /** - * 角色 id - */ - private Long roleId; - - /** - * 功能权限 id - */ - private String privilegeKey; - - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/SystemConfigController.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/SystemConfigController.java deleted file mode 100644 index efe62f4c..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/SystemConfigController.java +++ /dev/null @@ -1,70 +0,0 @@ -package net.lab1024.smartadmin.module.system.systemconfig; - -import net.lab1024.smartadmin.common.anno.OperateLog; -import net.lab1024.smartadmin.common.domain.PageResultDTO; -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.constant.SwaggerTagConst; -import net.lab1024.smartadmin.module.system.systemconfig.domain.dto.SystemConfigAddDTO; -import net.lab1024.smartadmin.module.system.systemconfig.domain.dto.SystemConfigQueryDTO; -import net.lab1024.smartadmin.module.system.systemconfig.domain.dto.SystemConfigUpdateDTO; -import net.lab1024.smartadmin.module.system.systemconfig.domain.dto.SystemConfigVO; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -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.RequestBody; -import org.springframework.web.bind.annotation.RestController; - -import javax.validation.Valid; -import java.util.List; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - * @since JDK1.8 - */ -@Api(tags = {SwaggerTagConst.Admin.MANAGER_SYSTEM_CONFIG}) -@OperateLog -@RestController -public class SystemConfigController { - - @Autowired - private SystemConfigService systemConfigService; - - @ApiOperation(value = "分页查询所有系统配置", notes = "分页查询所有系统配置") - @PostMapping("systemConfig/getListPage") - public ResponseDTO> getSystemConfigPage(@RequestBody @Valid SystemConfigQueryDTO queryDTO) { - return systemConfigService.getSystemConfigPage(queryDTO); - } - - @ApiOperation(value = "添加配置参数", notes = "添加配置参数") - @PostMapping("systemConfig/add") - public ResponseDTO addSystemConfig(@RequestBody @Valid SystemConfigAddDTO configAddDTO) { - return systemConfigService.addSystemConfig(configAddDTO); - } - - @ApiOperation(value = "修改配置参数", notes = "修改配置参数") - @PostMapping("systemConfig/update") - public ResponseDTO updateSystemConfig(@RequestBody @Valid SystemConfigUpdateDTO updateDTO) { - return systemConfigService.updateSystemConfig(updateDTO); - } - - @ApiOperation(value = "根据分组查询所有系统配置", notes = "根据分组查询所有系统配置") - @GetMapping("systemConfig/getListByGroup") - public ResponseDTO> getListByGroup(String group) { - return systemConfigService.getListByGroup(group); - } - - @ApiOperation(value = "通过key获取对应的信息", notes = "通过key获取对应的信息") - @GetMapping("systemConfig/selectByKey") - public ResponseDTO selectByKey(String configKey) { - return systemConfigService.selectByKey(configKey); - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/SystemConfigDao.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/SystemConfigDao.java deleted file mode 100644 index e8114f11..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/SystemConfigDao.java +++ /dev/null @@ -1,62 +0,0 @@ -package net.lab1024.smartadmin.module.system.systemconfig; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import net.lab1024.smartadmin.module.system.systemconfig.domain.dto.SystemConfigQueryDTO; -import net.lab1024.smartadmin.module.system.systemconfig.domain.entity.SystemConfigEntity; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Component; - -import java.util.List; - -/** - * 系统参数配置 t_system_config Dao层 - * - * @author GHQ - * @date 2017-12-23 14:25 - */ -@Component -@Mapper -public interface SystemConfigDao extends BaseMapper { - - /** - * 查询所有系统配置(分页) - * - * @param page - * @return - */ - List selectSystemSettingList(Page page, @Param("queryDTO") SystemConfigQueryDTO queryDTO); - - /** - * 根据key查询获取数据 - * - * @param key - * @return - */ - SystemConfigEntity getByKey(@Param("key") String key); - - /** - * 根据key查询获取数据 排除掉某個id的数据 - * @param key - * @param excludeId - * @return - */ - SystemConfigEntity getByKeyExcludeId(@Param("key") String key,@Param("excludeId") Long excludeId); - /** - * 查询所有系统配置 - * - * @return - */ - List selectAll(); - - /** - * 根据分组查询所有系统配置 - * @param group - * @return - */ - List getListByGroup(String group); - - - SystemConfigEntity selectByKeyAndGroup(@Param("configKey") String configKey, @Param("group") String group); -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/SystemConfigService.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/SystemConfigService.java deleted file mode 100644 index 5dd00d65..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/SystemConfigService.java +++ /dev/null @@ -1,262 +0,0 @@ -package net.lab1024.smartadmin.module.system.systemconfig; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import net.lab1024.smartadmin.common.constant.JudgeEnum; -import net.lab1024.smartadmin.common.constant.ResponseCodeConst; -import net.lab1024.smartadmin.common.domain.PageResultDTO; -import net.lab1024.smartadmin.common.domain.ResponseDTO; -import net.lab1024.smartadmin.common.reload.annotation.SmartReload; -import net.lab1024.smartadmin.constant.SmartReloadTagConst; -import net.lab1024.smartadmin.module.support.smartreload.SmartReloadService; -import net.lab1024.smartadmin.module.system.systemconfig.constant.SystemConfigDataType; -import net.lab1024.smartadmin.module.system.systemconfig.constant.SystemConfigEnum; -import net.lab1024.smartadmin.module.system.systemconfig.constant.SystemConfigResponseCodeConst; -import net.lab1024.smartadmin.module.system.systemconfig.domain.dto.*; -import net.lab1024.smartadmin.module.system.systemconfig.domain.entity.SystemConfigEntity; -import net.lab1024.smartadmin.util.SmartBeanUtil; -import net.lab1024.smartadmin.util.SmartPageUtil; -import com.google.common.collect.Lists; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import javax.annotation.PostConstruct; -import java.util.List; -import java.util.concurrent.ConcurrentHashMap; -import java.util.regex.Pattern; - -/** - * 系统配置业务类 - * - * @author GHQ - * @date 2017-12-23 15:09 - */ -@Slf4j -@Service -public class SystemConfigService { - - /** - * 系统配置缓存 - */ - private ConcurrentHashMap systemConfigMap = new ConcurrentHashMap<>(); - - @Autowired - private SystemConfigDao systemConfigDao; - - @Autowired - private SmartReloadService smartReloadService; - - /** - * 初始化系统设置缓存 - */ - @PostConstruct - private void initSystemConfigCache() { - List entityList = systemConfigDao.selectAll(); - if (CollectionUtils.isEmpty(entityList)) { - return; - } - - systemConfigMap.clear(); - entityList.forEach(entity -> this.systemConfigMap.put(entity.getConfigKey().toLowerCase(), entity)); - log.info("系统设置缓存初始化完毕:{}", systemConfigMap.size()); - - smartReloadService.register(this); - } - - @SmartReload(SmartReloadTagConst.SYSTEM_CONFIG) - public boolean reload(String args) { - this.initSystemConfigCache(); - log.warn("<> <<{}>> , args {} reload success ", SmartReloadTagConst.SYSTEM_CONFIG, args); - return true; - } - - /** - * 分页获取系统配置 - * - * @param queryDTO - * @return - */ - public ResponseDTO> getSystemConfigPage(SystemConfigQueryDTO queryDTO) { - Page page = SmartPageUtil.convert2QueryPage(queryDTO); - if(queryDTO.getKey() != null){ - queryDTO.setKey(queryDTO.getKey().toLowerCase()); - } - List entityList = systemConfigDao.selectSystemSettingList(page, queryDTO); - PageResultDTO pageResultDTO = SmartPageUtil.convert2PageResult(page, entityList, SystemConfigVO.class); - return ResponseDTO.succData(pageResultDTO); - } - - /** - * 根据参数key获得一条数据(数据库) - * - * @param configKey - * @return - */ - public ResponseDTO selectByKey(String configKey) { - if(configKey != null){ - configKey = configKey.toLowerCase(); - } - SystemConfigEntity entity = systemConfigDao.getByKey(configKey); - if (entity == null) { - return ResponseDTO.wrap(SystemConfigResponseCodeConst.NOT_EXIST); - } - SystemConfigVO configDTO = SmartBeanUtil.copy(entity, SystemConfigVO.class); - return ResponseDTO.succData(configDTO); - } - - /** - * 根据参数key获得一条数据 并转换为 对象 - * - * @param configKey - * @param clazz - * @param - * @return - */ - public T selectByKey2Obj(String configKey, Class clazz) { - if(configKey != null){ - configKey = configKey.toLowerCase(); - } - SystemConfigEntity entity = systemConfigDao.getByKey(configKey); - if (entity == null) { - return null; - } - SystemConfigDTO configDTO = SmartBeanUtil.copy(entity, SystemConfigDTO.class); - String configValue = configDTO.getConfigValue(); - if (StringUtils.isEmpty(configValue)) { - return null; - } - T obj = JSON.parseObject(configValue, clazz); - return obj; - } - - public SystemConfigDTO getCacheByKey(SystemConfigEnum.Key key) { - SystemConfigEntity entity = this.systemConfigMap.get(key.name().toLowerCase()); - if (entity == null) { - return null; - } - return SmartBeanUtil.copy(entity, SystemConfigDTO.class); - } - - /** - * 添加系统配置 - * - * @param configAddDTO - * @return - */ - public ResponseDTO addSystemConfig(SystemConfigAddDTO configAddDTO) { - configAddDTO.setConfigKey(configAddDTO.getConfigKey().toLowerCase()); - SystemConfigEntity entity = systemConfigDao.getByKey(configAddDTO.getConfigKey()); - if (entity != null) { - return ResponseDTO.wrap(SystemConfigResponseCodeConst.ALREADY_EXIST); - } - ResponseDTO valueValid = this.configValueValid(configAddDTO.getConfigKey(),configAddDTO.getConfigValue()); - if(!valueValid.isSuccess()){ - return valueValid; - } - configAddDTO.setConfigKey(configAddDTO.getConfigKey().toLowerCase()); - SystemConfigEntity addEntity = SmartBeanUtil.copy(configAddDTO, SystemConfigEntity.class); - addEntity.setIsUsing(JudgeEnum.YES.getValue()); - systemConfigDao.insert(addEntity); - //刷新缓存 - this.initSystemConfigCache(); - return ResponseDTO.succ(); - } - - /** - * 更新系统配置 - * - * @param updateDTO - * @return - */ - public ResponseDTO updateSystemConfig(SystemConfigUpdateDTO updateDTO) { - updateDTO.setConfigKey(updateDTO.getConfigKey().toLowerCase()); - SystemConfigEntity entity = systemConfigDao.selectById(updateDTO.getId()); - //系统配置不存在 - if (entity == null) { - return ResponseDTO.wrap(SystemConfigResponseCodeConst.NOT_EXIST); - } - SystemConfigEntity alreadyEntity = systemConfigDao.getByKeyExcludeId(updateDTO.getConfigKey().toLowerCase(), updateDTO.getId()); - if (alreadyEntity != null) { - return ResponseDTO.wrap(SystemConfigResponseCodeConst.ALREADY_EXIST); - } - ResponseDTO valueValid = this.configValueValid(updateDTO.getConfigKey(),updateDTO.getConfigValue()); - if(!valueValid.isSuccess()){ - return valueValid; - } - entity = SmartBeanUtil.copy(updateDTO, SystemConfigEntity.class); - updateDTO.setConfigKey(updateDTO.getConfigKey().toLowerCase()); - systemConfigDao.updateById(entity); - - //刷新缓存 - this.initSystemConfigCache(); - return ResponseDTO.succ(); - } - - - private ResponseDTO configValueValid(String configKey , String configValue){ - SystemConfigEnum.Key configKeyEnum = SystemConfigEnum.Key.selectByKey(configKey); - if(configKeyEnum == null){ - return ResponseDTO.succ(); - } - SystemConfigDataType dataType = configKeyEnum.getDataType(); - if(dataType == null){ - return ResponseDTO.succ(); - } - if(dataType.name().equals(SystemConfigDataType.TEXT.name())){ - return ResponseDTO.succ(); - } - if(dataType.name().equals(SystemConfigDataType.JSON.name())){ - try { - JSONObject jsonStr = JSONObject.parseObject(configValue); - return ResponseDTO.succ(); - } catch (Exception e) { - return ResponseDTO.wrap(ResponseCodeConst.ERROR_PARAM,"数据格式不是JSON,请修改后提交。"); - } - } - if(StringUtils.isNotEmpty(dataType.getValid())){ - Boolean valid = Pattern.matches(dataType.getValid(), configValue); - if(valid){ - return ResponseDTO.succ(); - } - return ResponseDTO.wrap(ResponseCodeConst.ERROR_PARAM,"数据格式不是"+dataType.name().toLowerCase()+",请修改后提交。"); - } - - return ResponseDTO.succ(); - } - - /** - * 根据分组名称 获取获取系统设置 - * - * @param group - * @return - */ - public ResponseDTO> getListByGroup(String group) { - - List entityList = systemConfigDao.getListByGroup(group); - if (CollectionUtils.isEmpty(entityList)) { - return ResponseDTO.succData(Lists.newArrayList()); - } - List systemConfigList = SmartBeanUtil.copyList(entityList, SystemConfigVO.class); - return ResponseDTO.succData(systemConfigList); - } - - /** - * 根据分组名称 获取获取系统设置 - * - * @param group - * @return - */ - public List getListByGroup(SystemConfigEnum.Group group) { - List entityList = systemConfigDao.getListByGroup(group.name()); - if (CollectionUtils.isEmpty(entityList)) { - return Lists.newArrayList(); - } - List systemConfigList = SmartBeanUtil.copyList(entityList, SystemConfigDTO.class); - return systemConfigList; - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/constant/SystemConfigDataType.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/constant/SystemConfigDataType.java deleted file mode 100644 index 900256d8..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/constant/SystemConfigDataType.java +++ /dev/null @@ -1,67 +0,0 @@ -package net.lab1024.smartadmin.module.system.systemconfig.constant; - -import net.lab1024.smartadmin.util.SmartVerificationUtil; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/9/4 0004 上午 11:43 - * @since JDK1.8 - */ -public enum SystemConfigDataType { - /** - * 整数 - */ - INTEGER(SmartVerificationUtil.INTEGER), - /** - * 文本 - */ - TEXT(null), - /** - * url地址 - */ - URL(SmartVerificationUtil.URL), - /** - * 邮箱 - */ - EMAIL(SmartVerificationUtil.EMAIL), - /** - * JSON 字符串 - */ - JSON(null), - /** - * 2019-08 - */ - YEAR_MONTH(SmartVerificationUtil.YEAR_MONTH), - /** - * 2019-08-01 - */ - DATE(SmartVerificationUtil.DATE), - /** - * 2019-08-01 10:23 - */ - DATE_TIME(SmartVerificationUtil.DATE_TIME), - /** - * 10:23-10:56 - */ - TIME_SECTION(SmartVerificationUtil.TIME_SECTION), - /** - * 10:23 - */ - TIME(SmartVerificationUtil.TIME); - - private String valid; - - - SystemConfigDataType(String valid){ - this.valid = valid; - } - - public String getValid() { - return valid; - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/constant/SystemConfigEnum.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/constant/SystemConfigEnum.java deleted file mode 100644 index 9791d772..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/constant/SystemConfigEnum.java +++ /dev/null @@ -1,68 +0,0 @@ -package net.lab1024.smartadmin.module.system.systemconfig.constant; - - -import java.util.Arrays; -import java.util.Optional; - -/** - * [ 系统配置常量类 ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - * @since JDK1.8 - */ -public class SystemConfigEnum { - - public enum Group { - BACK, - GIT_LOG - } - - public enum Key { - /** - * 超管id - */ - EMPLOYEE_SUPERMAN(SystemConfigDataType.TEXT), - /** - * 阿里云OSS配置项 - */ - ALI_OSS(SystemConfigDataType.JSON), - /** - * 七牛云OSS配置项 - */ - QI_NIU_OSS(SystemConfigDataType.JSON), - /** - * 本地文件上传url前缀 - */ - LOCAL_UPLOAD_URL_PREFIX(SystemConfigDataType.URL), - /** - * 邮件配置 - */ - EMAIL_CONFIG(SystemConfigDataType.JSON), - /** - * git-log 插件 - */ - GIT_LOG_PLUGIN(SystemConfigDataType.JSON); - - private SystemConfigDataType dataType; - - Key(SystemConfigDataType dataType) { - this.dataType = dataType; - } - - - public SystemConfigDataType getDataType() { - return dataType; - } - - public static Key selectByKey(String key) { - Key[] values = Key.values(); - Optional first = Arrays.stream(values).filter(e -> e.name().equalsIgnoreCase(key)).findFirst(); - return !first.isPresent() ? null : first.get(); - } - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/constant/SystemConfigResponseCodeConst.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/constant/SystemConfigResponseCodeConst.java deleted file mode 100644 index fd9fa9e4..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/constant/SystemConfigResponseCodeConst.java +++ /dev/null @@ -1,29 +0,0 @@ -package net.lab1024.smartadmin.module.system.systemconfig.constant; -import net.lab1024.smartadmin.common.constant.ResponseCodeConst; - -/** - * - * [ 5001-5999 ] - * - * @version 1.0 - * @since JDK1.8 - * @author yandanyang - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - */ -public class SystemConfigResponseCodeConst extends ResponseCodeConst { - - /** - * 配置参数已存在 10201 - */ - public static final SystemConfigResponseCodeConst ALREADY_EXIST = new SystemConfigResponseCodeConst(5001, "配置参数已存在"); - /** - * 配置参数不存在 10203 - */ - public static final SystemConfigResponseCodeConst NOT_EXIST = new SystemConfigResponseCodeConst(5002, "配置参数不存在"); - - public SystemConfigResponseCodeConst(int code, String msg) { - super(code, msg); - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/domain/dto/SystemConfigDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/domain/dto/SystemConfigDTO.java deleted file mode 100644 index 16aadef5..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/domain/dto/SystemConfigDTO.java +++ /dev/null @@ -1,50 +0,0 @@ -package net.lab1024.smartadmin.module.system.systemconfig.domain.dto; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.Date; - -/** - * - * [ ] - * - * @version 1.0 - * @since JDK1.8 - * @author yandanyang - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - */ -@Data -public class SystemConfigDTO { - - @ApiModelProperty("主键") - private Long id; - - @ApiModelProperty("参数key") - private String configKey; - - @ApiModelProperty("参数的值") - private String configValue; - - @ApiModelProperty("参数名称") - private String configName; - - @ApiModelProperty("参数类别") - private String configGroup; - - @ApiModelProperty("是否使用0 是 1否") - private Integer isUsing; - - @ApiModelProperty("备注") - private String remark; - - @ApiModelProperty("创建时间") - private Date createTime; - - @ApiModelProperty("上次修改时间") - private Date updateTime; - - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/domain/dto/SystemConfigQueryDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/domain/dto/SystemConfigQueryDTO.java deleted file mode 100644 index 458ef395..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/domain/dto/SystemConfigQueryDTO.java +++ /dev/null @@ -1,29 +0,0 @@ -package net.lab1024.smartadmin.module.system.systemconfig.domain.dto; - - -import net.lab1024.smartadmin.common.domain.PageParamDTO; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * - * [ ] - * - * @version 1.0 - * @since JDK1.8 - * @author yandanyang - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - */ -@Data -public class SystemConfigQueryDTO extends PageParamDTO { - - @ApiModelProperty("参数KEY") - private String key; - - @ApiModelProperty("参数类别") - private String configGroup; - - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/domain/dto/SystemConfigUpdateDTO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/domain/dto/SystemConfigUpdateDTO.java deleted file mode 100644 index 2fa29788..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/domain/dto/SystemConfigUpdateDTO.java +++ /dev/null @@ -1,25 +0,0 @@ -package net.lab1024.smartadmin.module.system.systemconfig.domain.dto; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotNull; - -/** - * - * [ ] - * - * @version 1.0 - * @since JDK1.8 - * @author yandanyang - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - */ -@Data -public class SystemConfigUpdateDTO extends SystemConfigAddDTO{ - - @ApiModelProperty("id") - @NotNull(message = "id不能为空") - private Long id; -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/domain/dto/SystemConfigVO.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/domain/dto/SystemConfigVO.java deleted file mode 100644 index 3b5de292..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/domain/dto/SystemConfigVO.java +++ /dev/null @@ -1,48 +0,0 @@ -package net.lab1024.smartadmin.module.system.systemconfig.domain.dto; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.Date; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - * @since JDK1.8 - */ -@Data -public class SystemConfigVO { - - @ApiModelProperty("主键") - private Long id; - - @ApiModelProperty("参数key") - private String configKey; - - @ApiModelProperty("参数的值") - private String configValue; - - @ApiModelProperty("参数名称") - private String configName; - - @ApiModelProperty("参数类别") - private String configGroup; - - @ApiModelProperty("是否使用0 是 1否") - private Integer isUsing; - - @ApiModelProperty("备注") - private String remark; - - @ApiModelProperty("创建时间") - private Date createTime; - - @ApiModelProperty("上次修改时间") - private Date updateTime; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/domain/entity/SystemConfigEntity.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/domain/entity/SystemConfigEntity.java deleted file mode 100644 index 18ca1f9f..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/module/system/systemconfig/domain/entity/SystemConfigEntity.java +++ /dev/null @@ -1,51 +0,0 @@ -package net.lab1024.smartadmin.module.system.systemconfig.domain.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import net.lab1024.smartadmin.common.domain.BaseEntity; -import lombok.Data; - -import java.io.Serializable; - -/** - * 系统配置参数 实体类 - * - * @author GHQ - * @date 2017-12-23 13:41 - */ -@Data -@TableName(value = "t_system_config") -public class SystemConfigEntity extends BaseEntity implements Serializable { - - private static final long serialVersionUID = 257284726400352502L; - - /** - * 参数key - */ - private String configKey; - - /** - * 参数的值 - */ - private String configValue; - - /** - * 参数名称 - */ - private String configName; - - /** - * 参数类别 - */ - private String configGroup; - - /** - * 是否使用0 是 1否 - */ - private Integer isUsing; - - /** - * 备注 - */ - private String remark; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/third/SmartApplicationContext.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/third/SmartApplicationContext.java deleted file mode 100644 index fc366789..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/third/SmartApplicationContext.java +++ /dev/null @@ -1,80 +0,0 @@ -package net.lab1024.smartadmin.third; - -import org.springframework.beans.BeansException; -import org.springframework.context.ApplicationContext; -import org.springframework.context.ApplicationContextAware; -import org.springframework.stereotype.Component; - -/** - * [ApplicationContextHelper] - * - * @author yandanyang - * @version 1.0 - * @since JDK1.8 - */ -@Component -public class SmartApplicationContext implements ApplicationContextAware { - /** - * 上下文对象实例 - */ - private static ApplicationContext applicationContext = null; - - @Override - public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { - if(SmartApplicationContext.applicationContext == null){ - - SmartApplicationContext.applicationContext = applicationContext; - - } - } - - /** - * 获取applicationContext - * @return - */ - public static ApplicationContext getApplicationContext() { - return applicationContext; - } - - /** - * 通过name获取 Bean. - * @param name - * @return - */ - public static Object getBean(String name){ - ApplicationContext applicationContext = getApplicationContext(); - if(applicationContext == null){ - return null; - } - return applicationContext.getBean(name); - } - - /** - * 通过class获取Bean. - * @param clazz - * @param - * @return - */ - public static T getBean(Class clazz){ - ApplicationContext applicationContext = getApplicationContext(); - if(applicationContext == null){ - return null; - } - return applicationContext.getBean(clazz); - } - - /** - * 通过name,以及Clazz返回指定的Bean - * @param name - * @param clazz - * @param - * @return - */ - public static T getBean(String name,Class clazz){ - ApplicationContext applicationContext = getApplicationContext(); - if(applicationContext == null){ - return null; - } - return applicationContext.getBean(name, clazz); - } -} \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/third/SmartRedisService.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/third/SmartRedisService.java deleted file mode 100644 index da36246a..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/third/SmartRedisService.java +++ /dev/null @@ -1,622 +0,0 @@ -package net.lab1024.smartadmin.third; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.google.common.collect.Lists; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.redis.core.*; -import org.springframework.stereotype.Component; -import org.springframework.util.CollectionUtils; - -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.TimeUnit; - -/** - * [ redis 一顿操作 ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/3/26 0026 下午 18:12 - * @since JDK1.8 - */ -@Slf4j -@Component -public class SmartRedisService { - - @Autowired - private RedisTemplate redisTemplate; - - @Autowired - private ValueOperations redisValueOperations; - - @Autowired - private HashOperations redisHashOperations; - - @Autowired - private ListOperations redisListOperations; - - @Autowired - private SetOperations redisSetOperations; - - /** - * 指定缓存失效时间 - * - * @param key 键 - * @param time 时间(秒) - * @return - */ - public boolean expire(String key, long time) { - try { - if (time > 0) { - redisTemplate.expire(key, time, TimeUnit.SECONDS); - } - return true; - } catch (Exception e) { - log.error("", e); - return false; - } - } - - /** - * 根据key 获取过期时间 - * - * @param key 键 不能为null - * @return 时间(秒) 返回0代表为永久有效 - */ - public long getExpire(String key) { - return redisTemplate.getExpire(key, TimeUnit.SECONDS); - } - - /** - * 判断key是否存在 - * - * @param key 键 - * @return true 存在 false不存在 - */ - public boolean hasKey(String key) { - try { - return redisTemplate.hasKey(key); - } catch (Exception e) { - log.error("", e); - return false; - } - } - - /** - * 删除缓存 - * - * @param key 可以传一个值 或多个 - */ - @SuppressWarnings("unchecked") - public void del(String... key) { - if (key != null && key.length > 0) { - if (key.length == 1) { - redisTemplate.delete(key[0]); - } else { - redisTemplate.delete(CollectionUtils.arrayToList(key)); - } - } - } - - //============================String============================= - - /** - * 普通缓存获取 - * - * @param key 键 - * @return 值 - */ - public String get(String key) { - return key == null ? null : redisValueOperations.get(key); - } - - public T getObject(String key, Class clazz) { - Object json = this.get(key); - if (json == null) { - return null; - } - T obj = JSON.parseObject(json.toString(), clazz); - return obj; - } - - public List getList(String key, Class clz) { - Object json = this.get(key); - if (json == null) { - return Lists.newArrayList(); - } - List list = JSONObject.parseArray(json.toString(), clz); - return list; - } - - /** - * 普通缓存放入 - * - * @param key 键 - * @param value 值 - * @return true成功 false失败 - */ - public boolean set(String key, String value) { - try { - redisValueOperations.set(key, value); - return true; - } catch (Exception e) { - log.error("", e); - return false; - } - - } - - /** - * 普通缓存放入并设置时间 - * - * @param key 键 - * @param value 值 - * @param time 时间(秒) time要大于0 如果time小于等于0 将设置无限期 - * @return true成功 false 失败 - */ - public boolean set(String key, String value, long time) { - try { - if (time > 0) { - redisValueOperations.set(key, value, time, TimeUnit.SECONDS); - } else { - set(key, value); - } - return true; - } catch (Exception e) { - log.error("", e); - return false; - } - } - - /** - * 递增 - * - * @param key 键 - * @param delta 要增加几(大于0) - * @return - */ - public long incr(String key, long delta) { - if (delta < 0) { - throw new RuntimeException("递增因子必须大于0"); - } - return redisValueOperations.increment(key, delta); - } - - /** - * 递减 - * - * @param key 键 - * @param delta 要减少几(小于0) - * @return - */ - public long decr(String key, long delta) { - if (delta < 0) { - throw new RuntimeException("递减因子必须大于0"); - } - return redisValueOperations.increment(key, - delta); - } - - //================================Map================================= - - /** - * HashGet - * - * @param key 键 不能为null - * @param item 项 不能为null - * @return 值 - */ - public Object hget(String key, String item) { - return redisHashOperations.get(key, item); - } - - /** - * 获取hashKey对应的所有键值 - * - * @param key 键 - * @return 对应的多个键值 - */ - public Map hmget(String key) { - return redisHashOperations.entries(key); - } - - /** - * HashSet - * - * @param key 键 - * @param map 对应多个键值 - * @return true 成功 false 失败 - */ - public boolean hmset(String key, Map map) { - try { - redisHashOperations.putAll(key, map); - return true; - } catch (Exception e) { - log.error("", e); - return false; - } - } - - /** - * HashSet 并设置时间 - * - * @param key 键 - * @param map 对应多个键值 - * @param time 时间(秒) - * @return true成功 false失败 - */ - public boolean hmset(String key, Map map, long time) { - try { - redisHashOperations.putAll(key, map); - if (time > 0) { - expire(key, time); - } - return true; - } catch (Exception e) { - log.error("", e); - return false; - } - } - - /** - * 向一张hash表中放入数据,如果不存在将创建 - * - * @param key 键 - * @param item 项 - * @param value 值 - * @return true 成功 false失败 - */ - public boolean hset(String key, String item, Object value) { - try { - redisHashOperations.put(key, item, value); - return true; - } catch (Exception e) { - log.error("", e); - return false; - } - } - - /** - * 向一张hash表中放入数据,如果不存在将创建 - * - * @param key 键 - * @param item 项 - * @param value 值 - * @param time 时间(秒) 注意:如果已存在的hash表有时间,这里将会替换原有的时间 - * @return true 成功 false失败 - */ - public boolean hset(String key, String item, Object value, long time) { - try { - redisHashOperations.put(key, item, value); - if (time > 0) { - expire(key, time); - } - return true; - } catch (Exception e) { - log.error("", e); - return false; - } - } - - /** - * 删除hash表中的值 - * - * @param key 键 不能为null - * @param item 项 可以使多个 不能为null - */ - public void hdel(String key, Object... item) { - redisHashOperations.delete(key, item); - } - - /** - * 判断hash表中是否有该项的值 - * - * @param key 键 不能为null - * @param item 项 不能为null - * @return true 存在 false不存在 - */ - public boolean hHasKey(String key, String item) { - return redisHashOperations.hasKey(key, item); - } - - /** - * hash递增 如果不存在,就会创建一个 并把新增后的值返回 - * - * @param key 键 - * @param item 项 - * @param by 要增加几(大于0) - * @return - */ - public double hincr(String key, String item, double by) { - return redisHashOperations.increment(key, item, by); - } - - /** - * hash递减 - * - * @param key 键 - * @param item 项 - * @param by 要减少记(小于0) - * @return - */ - public double hdecr(String key, String item, double by) { - return redisHashOperations.increment(key, item, - by); - } - - //============================set============================= - - /** - * 根据key获取Set中的所有值 - * - * @param key 键 - * @return - */ - public Set sGet(String key) { - try { - return redisSetOperations.members(key); - } catch (Exception e) { - log.error("", e); - return null; - } - } - - /** - * 根据value从一个set中查询,是否存在 - * - * @param key 键 - * @param value 值 - * @return true 存在 false不存在 - */ - public boolean sHasKey(String key, Object value) { - try { - return redisSetOperations.isMember(key, value); - } catch (Exception e) { - log.error("", e); - return false; - } - } - - /** - * 将数据放入set缓存 - * - * @param key 键 - * @param values 值 可以是多个 - * @return 成功个数 - */ - public long sSet(String key, Object... values) { - try { - return redisSetOperations.add(key, values); - } catch (Exception e) { - log.error("", e); - return 0; - } - } - - /** - * 将set数据放入缓存 - * - * @param key 键 - * @param time 时间(秒) - * @param values 值 可以是多个 - * @return 成功个数 - */ - public long sSetAndTime(String key, long time, Object... values) { - try { - Long count = redisSetOperations.add(key, values); - if (time > 0) { - expire(key, time); - } - return count; - } catch (Exception e) { - log.error("", e); - return 0; - } - } - - /** - * 获取set缓存的长度 - * - * @param key 键 - * @return - */ - public long sGetSetSize(String key) { - try { - return redisSetOperations.size(key); - } catch (Exception e) { - log.error("", e); - return 0; - } - } - - /** - * 移除值为value的 - * - * @param key 键 - * @param values 值 可以是多个 - * @return 移除的个数 - */ - public long setRemove(String key, Object... values) { - try { - Long count = redisSetOperations.remove(key, values); - return count; - } catch (Exception e) { - log.error("", e); - return 0; - } - } - //===============================list================================= - - /** - * 获取list缓存的内容 - * - * @param key 键 - * @param start 开始 - * @param end 结束 0 到 -1代表所有值 - * @return - */ - public List lGet(String key, long start, long end) { - try { - return redisListOperations.range(key, start, end); - } catch (Exception e) { - log.error("", e); - return null; - } - } - - /** - * 获取list缓存的所有内容 - * - * @param key - * @return - */ - public List lGetAll(String key) { - return lGet(key, 0, - 1); - } - - /** - * 获取list缓存的长度 - * - * @param key 键 - * @return - */ - public long lGetListSize(String key) { - try { - return redisListOperations.size(key); - } catch (Exception e) { - log.error("", e); - return 0; - } - } - - /** - * 通过索引 获取list中的值 - * - * @param key 键 - * @param index 索引 index>=0时, 0 表头,1 第二个元素,依次类推;index<0时,-1,表尾,-2倒数第二个元素,依次类推 - * @return - */ - public Object lGetIndex(String key, long index) { - try { - return redisListOperations.index(key, index); - } catch (Exception e) { - log.error("", e); - return null; - } - } - - /** - * 将list放入缓存 - * - * @param key 键 - * @param value 值 - * @return - */ - public boolean lSet(String key, Object value) { - try { - redisListOperations.rightPush(key, value); - return true; - } catch (Exception e) { - log.error("", e); - return false; - } - } - - /** - * 将list放入缓存 - * - * @param key 键 - * @param value 值 - * @param time 时间(秒) - * @return - */ - public boolean lSet(String key, Object value, long time) { - try { - redisListOperations.rightPush(key, value); - if (time > 0) { - expire(key, time); - } - return true; - } catch (Exception e) { - log.error("", e); - return false; - } - } - - /** - * 将list放入缓存 - * - * @param key 键 - * @param value 值 - * @return - */ - public boolean lSet(String key, List value) { - try { - redisListOperations.rightPushAll(key, value); - return true; - } catch (Exception e) { - log.error("", e); - return false; - } - } - - /** - * 将list放入缓存 - * - * @param key 键 - * @param value 值 - * @param time 时间(秒) - * @return - */ - public boolean lSet(String key, List value, long time) { - try { - redisListOperations.rightPushAll(key, value); - if (time > 0) { - expire(key, time); - } - return true; - } catch (Exception e) { - log.error("", e); - return false; - } - } - - /** - * 根据索引修改list中的某条数据 - * - * @param key 键 - * @param index 索引 - * @param value 值 - * @return - */ - public boolean lUpdateIndex(String key, long index, Object value) { - try { - redisListOperations.set(key, index, value); - return true; - } catch (Exception e) { - log.error("", e); - return false; - } - } - - /** - * 移除N个值为value - * - * @param key 键 - * @param count 移除多少个 - * @param value 值 - * @return 移除的个数 - */ - public long lRemove(String key, long count, Object value) { - try { - Long remove = redisListOperations.remove(key, count, value); - return remove; - } catch (Exception e) { - log.error("", e); - return 0; - } - } -} \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartBaseEnumUtil.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartBaseEnumUtil.java deleted file mode 100644 index e433367b..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartBaseEnumUtil.java +++ /dev/null @@ -1,85 +0,0 @@ -package net.lab1024.smartadmin.util; - -import net.lab1024.smartadmin.common.domain.BaseEnum; - -/** - * 枚举工具类 - * - * @author listen - * @date 2017/10/10 18:17 - */ -public class SmartBaseEnumUtil { - - /** - * 校验int类型的参数与枚举类比较是否合法 - * - * @param value 参数 - * @param enumClass 枚举类必须实现BaseEnum接口 - * @return boolean - * @Author listen - */ - public static boolean checkEnum(Integer value, Class enumClass) { - if (null == value) { - return false; - } - BaseEnum[] enums = enumClass.getEnumConstants(); - for (BaseEnum baseEnum : enums) { - if (baseEnum.equalsValue(value)) { - return true; - } - } - return false; - } - - /** - * 获取枚举类的说明 value : info 的形式 - * - * @param enumClass - * @return String - */ - public static String getEnumDesc(Class enumClass) { - BaseEnum[] enums = enumClass.getEnumConstants(); - // value : info 的形式 - StringBuilder sb = new StringBuilder(); - for (BaseEnum baseEnum : enums) { - sb.append(baseEnum.getValue() + ":" + baseEnum.getDesc() + ","); - } - return sb.toString(); - } - - /** - * 获取与int Code相匹配的枚举类的info - * - * @param value 参数 - * @param enumClass 枚举类必须实现BaseEnum接口 - * @return String 如无匹配枚举则返回null - */ - public static String getEnumDescByValue(Integer value, Class enumClass) { - BaseEnum[] enums = enumClass.getEnumConstants(); - for (BaseEnum baseEnum : enums) { - if (baseEnum.equalsValue(value)) { - return baseEnum.getDesc(); - } - } - return null; - } - - /** - * 根据int类型的参数与获取枚举类的实例 - * - * @param value 参数 - * @param enumClass 枚举类必须实现BaseEnum接口 - * @return BaseEnum 无匹配值返回null - * @Author listen - */ - public static T getEnumByValue(Object value, Class enumClass) { - T[] enums = enumClass.getEnumConstants(); - for (T baseEnum : enums) { - if (baseEnum.equalsValue(value)) { - return baseEnum; - } - } - return null; - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartDateUtil.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartDateUtil.java deleted file mode 100644 index 1e078263..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartDateUtil.java +++ /dev/null @@ -1,521 +0,0 @@ -package net.lab1024.smartadmin.util; - -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateUtils; - -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.text.SimpleDateFormat; -import java.util.*; - -/** - * 线程安全的date工具类 - * - * @author jiaozi - */ -public class SmartDateUtil extends DateUtils { - - private static final ThreadLocal dateFormats = new ThreadLocal() { - @Override - protected DateFormats initialValue() { - return new DateFormats(); - } - }; - - public static final int HOUR_MIN = 60; - - public static final int DAY_MI_SECOND = 24 * 60 * 60 * 1000; - - public static String formatYMD(Date date) { - return dateFormats.get().ymd.format(date); - } - - public static String formatYMDDigital(Date date) { - return dateFormats.get().ymdDigital.format(date); - } - - public static String formatYMDHMSDigital(Date date) { - return dateFormats.get().ymdhmsDigital.format(date); - } - - public static String formatYM(Date date) { - return dateFormats.get().ym.format(date); - } - - public static String formatHMS(Date date) { - return dateFormats.get().hms.format(date); - } - - public static String formatHM(Date date) { - return dateFormats.get().hm.format(date); - } - - public static String formatYMDHM(Date date) { - return dateFormats.get().ymdhm.format(date); - } - - public static String formatYMDHMS(Date date) { - return dateFormats.get().ymdhms.format(date); - } - - public static String formatYMDChinese(Date date) { - return dateFormats.get().ymdChinese.format(date); - } - - public static String formatYMDSlash(Date date) { - return dateFormats.get().ymdSlash.format(date); - } - - public static Date parseYMD(String dateStr) { - return parse(dateFormats.get().ymd, dateStr); - } - - public static Date parseYMDDigital(String dateStr) { - return parse(dateFormats.get().ymdDigital, dateStr); - } - - public static Date parseYMDHMSDigital(String dateStr) { - return parse(dateFormats.get().ymdhmsDigital, dateStr); - } - - public static Date parseformatYMDChinese(String dateStr) { - return parse(dateFormats.get().ymdChinese, dateStr); - } - - public static Date parseYM(String dateStr) { - return parse(dateFormats.get().ym, dateStr); - } - - public static Date parseYMDHMS(String dateStr) { - - return parse(dateFormats.get().ymdhms, dateStr); - } - - public static Date parseYMDHM(String dateStr) { - return parse(dateFormats.get().ymdhm, dateStr); - } - - public static Date parseTodayHMS(String dateStr) { - String today = formatYMD(new Date()); - String todayDateStr = String.format("%s %s", today, dateStr); - return parse(dateFormats.get().ymdhms, todayDateStr); - } - - /** - * 判断当前时间是否在某段时间内 参数不区分先后顺序 - */ - public static boolean isDuringTwoDate(Date date, Date another) { - long dateTime = date.getTime(); - long anotherTime = another.getTime(); - long currentTime = System.currentTimeMillis(); - - if (currentTime > dateTime && currentTime < anotherTime) { - return true; - } else if (currentTime > anotherTime && currentTime < dateTime) { - return true; - } else { - return false; - } - } - - public static Date parse(SimpleDateFormat format, String dateStr) { - try { - Date d = format.parse(dateStr); - Calendar c = Calendar.getInstance(); - c.setTime(d); - int year = c.get(Calendar.YEAR); - if (year >= 1000 && year <= 9999) { - return d; - } else { - return null; - } - } catch (Exception ex) { - return null; - } - } - - public static long daysOffset(Date date1, Date date2) { - date1 = parseYMD(formatYMD(date1)); - date2 = parseYMD(formatYMD(date2)); - return (date1.getTime() - date2.getTime()) / DAY_MI_SECOND; - } - - /** - * 今天是星期几 , 7表示星期日 - * - * @return - */ - public static int getTodayDayOfWeek() { - Calendar now = Calendar.getInstance(); - int dayOfweek = now.get(Calendar.DAY_OF_WEEK); - dayOfweek--; - if (dayOfweek == 0) { - dayOfweek = 7; - } - return dayOfweek; - } - - public static boolean isTodaytDay(Date date) { - Calendar calendar = Calendar.getInstance(); - calendar.setTime(date); - Calendar todayCalendar = Calendar.getInstance(); - if (calendar.get(Calendar.YEAR) != todayCalendar.get(Calendar.YEAR)) { - return false; - } else if (calendar.get(Calendar.MONTH) != todayCalendar.get(Calendar.MONTH)) { - return false; - } else if (calendar.get(Calendar.DAY_OF_MONTH) != todayCalendar.get(Calendar.DAY_OF_MONTH)) { - return false; - } - return true; - } - - /** - * 设置Calendar的小时、分钟、秒、毫秒 - * - * @param calendar 日历 - * @param hour 小时 - * @param minute 分钟 - * @param second 秒 - * @param milliSecond 毫秒 - */ - public static void setCalender(Calendar calendar, int hour, int minute, int second, int milliSecond) { - calendar.set(Calendar.HOUR_OF_DAY, hour); - calendar.set(Calendar.MINUTE, minute); - calendar.set(Calendar.SECOND, second); - calendar.set(Calendar.MILLISECOND, milliSecond); - } - - /** - * 获取指定天开始时间 - * - * @param date 日期 - * @return 获得该日期的开始 - */ - public static Date getDayBegin(Date date) { - Calendar calendar = Calendar.getInstance(); - calendar.setTime(date); - setCalender(calendar, 0, 0, 0, 0); - return calendar.getTime(); - } - - /** - * 获取指定天结束时间 - * - * @param date 日期 - * @return 获得该日期的结束 - */ - public static Date getDayEnd(Date date) { - Calendar calendar = Calendar.getInstance(); - calendar.setTime(date); - setCalender(calendar, 23, 59, 59, 999); - return calendar.getTime(); - } - - /** - * 获取该日期当月第一天 - * - * @param date - * @return - */ - public static Date getMonthBegin(Date date) { - Calendar calendar = Calendar.getInstance(); - calendar.setTime(getDayBegin(date)); - calendar.set(Calendar.DAY_OF_MONTH, 1); - return calendar.getTime(); - } - - /** - * 获取该日期当月最后一天getAgeByBirthday - * - * @param date - * @return - */ - public static Date getMonthEnd(Date date) { - Calendar calendar = Calendar.getInstance(); - calendar.setTime(getDayEnd(date)); - calendar.add(Calendar.MONTH, 1); - calendar.set(Calendar.DAY_OF_MONTH, 1); - calendar.add(Calendar.DAY_OF_MONTH, - 1); - return calendar.getTime(); - } - - public static String timeDifference(Date endDate) { - Date nowDate = new Date(); - long nd = 1000 * 24 * 60 * 60; - long nh = 1000 * 60 * 60; - long nm = 1000 * 60; - // 获得两个时间的毫秒时间差异 - long diff = nowDate.getTime() - endDate.getTime(); - // 计算差多少天 - long day = diff / nd; - if (day > 0) { - return day + "天前"; - } - // 计算差多少小时 - long hour = diff % nd / nh; - if (hour > 0) { - return hour + "小时前"; - } - // 计算差多少分钟 - long min = diff % nd % nh / nm; - if (min > 0) { - return "1小时内"; - } - return "1小时内"; - } - - /** - * 计算所用时长 - * - * @param startDate - * @param endDate - * @return - */ - public static BigDecimal timeDifferenceMin(Date startDate, Date endDate) { - long nm = 1000 * 60; - // 获得两个时间的毫秒时间差异 - long diff = endDate.getTime() - startDate.getTime(); - BigDecimal min = BigDecimal.valueOf(diff).divide(BigDecimal.valueOf(nm), RoundingMode.HALF_UP); - return min; - } - - /** - * 功能描述: 是否为当天 - * - * @param dateStr yyyy-mm-dd - * @return - * @auther yandanyang - * @date 2018/10/16 0016 下午 17:43 - */ - public static boolean isCurrentDayYMD(String dateStr) { - if (StringUtils.isEmpty(dateStr)) { - return true; - } - String current = SmartDateUtil.formatYMD(new Date()); - if (current.equals(dateStr)) { - return true; - } - return false; - } - - /** - * 功能描述: 是否为当月 - * - * @param dateStr yyyy-mm-dd - * @return - * @auther yandanyang - * @date 2018/10/16 0016 下午 17:43 - */ - public static boolean isCurrentMonthYMD(String dateStr) { - if (StringUtils.isEmpty(dateStr)) { - return true; - } - String queryDate = SmartDateUtil.formatYM(SmartDateUtil.parseYMD(dateStr)); - String current = SmartDateUtil.formatYM(new Date()); - if (current.equals(queryDate)) { - return true; - } - return false; - } - - public static boolean isCurrentMonthYM(String dateStr) { - if (StringUtils.isEmpty(dateStr)) { - return true; - } - String current = SmartDateUtil.formatYM(new Date()); - if (current.equals(dateStr)) { - return true; - } - return false; - } - - /** - * 获取本周的开始时间 - * - * @return - */ - public static Date getBeginDayOfWeek() { - Date date = new Date(); - if (date == null) { - return null; - } - Calendar cal = Calendar.getInstance(); - cal.setTime(date); - int dayofweek = cal.get(Calendar.DAY_OF_WEEK); - if (dayofweek == 1) { - dayofweek += 7; - } - cal.add(Calendar.DATE, 2 - dayofweek); - return getDayBegin(cal.getTime()); - } - - /** - * 获取本周的结束时间 - * - * @return - */ - public static Date getEndDayOfWeek() { - Calendar cal = Calendar.getInstance(); - cal.setTime(getBeginDayOfWeek()); - cal.add(Calendar.DAY_OF_WEEK, 6); - Date weekEndSta = cal.getTime(); - return getDayEnd(weekEndSta); - } - - /** - * 获取两个日期区间的日期(包括这两个日期) - */ - public static List getiIntervalDate(String dateBegin, String dateEnd) { - List dateList = new ArrayList<>(); - Date startDate = SmartDateUtil.parseYMD(dateBegin); - Date endDate = SmartDateUtil.parseYMD(dateEnd); - Calendar cal = Calendar.getInstance(); - cal.setTime(startDate); - dateList.add(dateBegin); - while (cal.getTime().compareTo(endDate) < 0) { - cal.add(Calendar.DAY_OF_MONTH, 1); - dateList.add(SmartDateUtil.formatYMD(cal.getTime())); - } - return dateList; - } - - /** - * 返回某个日期后几天的日期 - * - * @param date - * @param i - * @return - */ - public static Date getNextDay(Date date, int i) { - Calendar cal = new GregorianCalendar(); - cal.setTime(date); - cal.set(Calendar.DATE, cal.get(Calendar.DATE) + i); - return cal.getTime(); - } - - /** - * 返回某个日期前几天的日期 - * - * @param date - * @param i - * @return - */ - public static Date getFrontDay(Date date, int i) { - Calendar cal = new GregorianCalendar(); - cal.setTime(date); - cal.set(Calendar.DATE, cal.get(Calendar.DATE) - i); - return cal.getTime(); - } - - /** - * 获取昨天的开始时间 - * - * @return - */ - public static Date getBeginDayOfYesterday() { - Calendar cal = new GregorianCalendar(); - cal.setTime(getDayBegin(new Date())); - cal.add(Calendar.DAY_OF_MONTH, - 1); - return cal.getTime(); - } - - /** - * 获取昨天的结束时间 - * - * @return - */ - public static Date getEndDayOfYesterDay() { - Calendar cal = new GregorianCalendar(); - cal.setTime(getDayEnd(new Date())); - cal.add(Calendar.DAY_OF_MONTH, - 1); - return cal.getTime(); - } - - public static Integer getDayNumOfMonth(Date date) { - Calendar c = Calendar.getInstance(); - c.setTime(date); - Integer num = c.getActualMaximum(Calendar.DAY_OF_MONTH); - return num; - } - - /** - * 转换日期(格式:年-月-日 时:分--分自定义) - */ - public static String formatYMDH(Date date, String minute) { - String ymdhm = dateFormats.get().ymdh + ":" + minute; - SimpleDateFormat format = new SimpleDateFormat(ymdhm); - return format.format(date); - } - - /** - * 获取几个月后的日期 - */ - public static Date getAfterMonth(Date inputDate, int number) { - Calendar c = Calendar.getInstance();//获得一个日历的实例 - c.setTime(inputDate);//设置日历时间 - c.add(Calendar.MONTH, number);//在日历的月份上增加月 - return c.getTime(); - } - - /** - * 计算当前月有多少天 - */ - public static int getDays(int year, int month) { - int days = 0; - if (month != 2) { - switch (month) { - case 1: - case 3: - case 5: - case 7: - case 8: - case 10: - case 12: - days = 31; - break; - case 4: - case 6: - case 9: - case 11: - days = 30; - - } - } else { - // 闰年 - if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) { - days = 29; - } else { - days = 28; - } - } - System.out.println("当月有" + days + "天!"); - return days; - } - -} - -class DateFormats { - - public final SimpleDateFormat hms = new SimpleDateFormat("HH:mm:ss"); - - public final SimpleDateFormat hm = new SimpleDateFormat("HH:mm"); - - public final SimpleDateFormat ymdhm = new SimpleDateFormat("yyyy-MM-dd HH:mm"); - - public final SimpleDateFormat ymd = new SimpleDateFormat("yyyy-MM-dd"); - - public final SimpleDateFormat ym = new SimpleDateFormat("yyyy-MM"); - - public final SimpleDateFormat ymdhms = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - - public final SimpleDateFormat ymdChinese = new SimpleDateFormat("yyyy年MM月dd日"); - - public final SimpleDateFormat ymdSlash = new SimpleDateFormat("yyyy/MM/dd"); - - public final SimpleDateFormat ymdDigital = new SimpleDateFormat("yyyyMMdd"); - - public final SimpleDateFormat ymdhmsDigital = new SimpleDateFormat("yyyyMMddHHmmss"); - - public static final String ymdh = "yyyy-MM-dd HH"; -} - diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartDigestUtil.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartDigestUtil.java deleted file mode 100644 index 902d5db3..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartDigestUtil.java +++ /dev/null @@ -1,17 +0,0 @@ -package net.lab1024.smartadmin.util; - -import org.apache.commons.codec.digest.DigestUtils; - -public class SmartDigestUtil extends DigestUtils { - - /** - * md5加盐加密 - * - * @param salt - * @param password - * @return - */ - public static String encryptPassword(String salt, String password) { - return SmartDigestUtil.md5Hex(String.format(salt, password)); - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartFileUtil.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartFileUtil.java deleted file mode 100644 index 45735c9a..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartFileUtil.java +++ /dev/null @@ -1,91 +0,0 @@ -package net.lab1024.smartadmin.util; - -import java.io.BufferedReader; -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.OutputStreamWriter; -import java.nio.charset.Charset; - -import org.apache.commons.io.FileUtils; - -/** - * @author zhuoda - */ -public class SmartFileUtil extends FileUtils { - - public static boolean isXmlFile(File file) { - return "xml".equalsIgnoreCase(getFileExtension(file.getName())); - } - - /** - * 文件后缀名 - * - * @param fullName - * @return - */ - public static String getFileExtension(String fullName) { - String fileName = new File(fullName).getName(); - int dotIndex = fileName.lastIndexOf('.'); - return (dotIndex == -1) ? "" : fileName.substring(dotIndex + 1); - } - - /** - * 不带后缀名的文件名 - * - * @param file - * @return - */ - public static String getNameWithoutExtension(String file) { - String fileName = new File(file).getName(); - int dotIndex = fileName.lastIndexOf('.'); - return (dotIndex == -1) ? fileName : fileName.substring(0, dotIndex); - } - - public static boolean isFileExist(String filePath) { - File file = new File(filePath); - return file.exists(); - } - - /** - * 验证文件是否存在,如果不存在则抛出异常 - * - * @param filePath - * @throws IOException - */ - public static void isFileExistThrowException(String filePath) throws IOException { - File file = new File(filePath); - if (!file.exists()) { - throw new FileNotFoundException(filePath); - } - } - - public static BufferedReader newBufferedReader(File file, Charset charset) throws FileNotFoundException { - return new BufferedReader(new InputStreamReader(new FileInputStream(file), charset)); - } - - public static BufferedWriter newBufferedWriter(File file, Charset charset) throws FileNotFoundException { - return new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), charset)); - } - - public static boolean createParentDirs(File file) throws IOException { - File parent = file.getCanonicalFile().getParentFile(); - if (parent == null) { - return false; - } - return parent.mkdirs(); - } - - public static boolean createNotExistParentDirFile(File file) throws IOException { - boolean createParentDirsRes = createParentDirs(file); - if (!createParentDirsRes) { - throw new IOException("cannot create parent Directory of " + file.getName()); - } - return file.createNewFile(); - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartHttpUtil.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartHttpUtil.java deleted file mode 100644 index 62e8ff2d..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartHttpUtil.java +++ /dev/null @@ -1,151 +0,0 @@ -package net.lab1024.smartadmin.util; - -import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.http.HttpResponse; -import org.apache.http.HttpStatus; -import org.apache.http.NameValuePair; -import org.apache.http.client.entity.UrlEncodedFormEntity; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClients; -import org.apache.http.message.BasicNameValuePair; -import org.apache.http.util.EntityUtils; - -import java.nio.charset.Charset; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; - -/** - * [ HttpUtils ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - * @since JDK1.8 - */ -public class SmartHttpUtil { - - public static String sendGet(String url, Map params, Map header) throws Exception { - HttpGet httpGet = null; - String body = ""; - try { - CloseableHttpClient httpClient = HttpClients.createDefault(); - List mapList = new ArrayList<>(); - if (params != null) { - for (Entry entry : params.entrySet()) { - mapList.add(entry.getKey() + "=" + entry.getValue()); - } - } - if (CollectionUtils.isNotEmpty(mapList)) { - url = url + "?"; - String paramsStr = StringUtils.join(mapList, "&"); - url = url + paramsStr; - } - httpGet = new HttpGet(url); - httpGet.setHeader("Content-type", "application/json; charset=utf-8"); - httpGet.setHeader("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)"); - if (header != null) { - for (Entry entry : header.entrySet()) { - httpGet.setHeader(entry.getKey(), entry.getValue()); - } - } - HttpResponse response = httpClient.execute(httpGet); - - int statusCode = response.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) { - throw new RuntimeException("请求失败"); - } else { - body = EntityUtils.toString(response.getEntity(), "UTF-8"); - } - } catch (Exception e) { - throw e; - } finally { - if (httpGet != null) { - httpGet.releaseConnection(); - } - } - return body; - } - - public static String sendPostJson(String url, String json, Map header) throws Exception { - HttpPost httpPost = null; - String body = ""; - try { - CloseableHttpClient httpClient = HttpClients.createDefault(); - httpPost = new HttpPost(url); - httpPost.setHeader("Content-type", "application/json; charset=utf-8"); - httpPost.setHeader("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)"); - if (header != null) { - for (Entry entry : header.entrySet()) { - httpPost.setHeader(entry.getKey(), entry.getValue()); - } - } - StringEntity entity = new StringEntity(json, Charset.forName("UTF-8")); - entity.setContentEncoding("UTF-8"); - entity.setContentType("application/json"); - httpPost.setEntity(entity); - HttpResponse response = httpClient.execute(httpPost); - - int statusCode = response.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) { - throw new RuntimeException("请求失败"); - } else { - body = EntityUtils.toString(response.getEntity(), "UTF-8"); - } - } catch (Exception e) { - throw e; - } finally { - if (httpPost != null) { - httpPost.releaseConnection(); - } - } - return body; - } - - public static String sendPostForm(String url, Map params, Map header) throws Exception { - HttpPost httpPost = null; - String body = ""; - try { - CloseableHttpClient httpClient = HttpClients.createDefault(); - httpPost = new HttpPost(url); - httpPost.setHeader("Content-type", "application/x-www-form-urlencoded"); - httpPost.setHeader("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)"); - if (header != null) { - for (Entry entry : header.entrySet()) { - httpPost.setHeader(entry.getKey(), entry.getValue()); - } - } - List nvps = new ArrayList<>(); - if (params != null) { - for (Entry entry : params.entrySet()) { - nvps.add(new BasicNameValuePair(entry.getKey(), entry.getValue())); - } - } - //设置参数到请求对象中 - httpPost.setEntity(new UrlEncodedFormEntity(nvps, "UTF-8")); - HttpResponse response = httpClient.execute(httpPost); - - int statusCode = response.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) { - throw new RuntimeException("请求失败"); - } else { - body = EntityUtils.toString(response.getEntity(), "UTF-8"); - } - } catch (Exception e) { - throw e; - } finally { - if (httpPost != null) { - httpPost.releaseConnection(); - } - } - return body; - } - -} \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartIPUtil.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartIPUtil.java deleted file mode 100644 index fb93cd57..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartIPUtil.java +++ /dev/null @@ -1,159 +0,0 @@ -package net.lab1024.smartadmin.util; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.StringUtils; - -import javax.servlet.http.HttpServletRequest; -import java.net.InetAddress; -import java.net.NetworkInterface; -import java.net.SocketException; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.Map; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/5/5 0005 下午 15:34 - * @since JDK1.8 - */ -public class SmartIPUtil { - - public static final String IP_URL = "http://ip.taobao.com/service/getIpInfo.php"; - - public static String getLocalHostIP() { - // 本地IP,如果没有配置外网IP则返回它 - String localIp = null; - // 外网IP - String netIp = null; - try { - Enumeration netInterfaces = NetworkInterface.getNetworkInterfaces(); - InetAddress ip = null; - // 是否找到外网IP - boolean finded = false; - while (netInterfaces.hasMoreElements() && ! finded) { - NetworkInterface ni = netInterfaces.nextElement(); - Enumeration address = ni.getInetAddresses(); - while (address.hasMoreElements()) { - ip = address.nextElement(); - // 外网IP - if (! ip.isSiteLocalAddress() && ! ip.isLoopbackAddress() && ip.getHostAddress().indexOf(":") == - 1) { - netIp = ip.getHostAddress(); - finded = true; - break; - } else if (ip.isSiteLocalAddress() && ! ip.isLoopbackAddress() && ip.getHostAddress().indexOf(":") == - 1) { - // 内网IP - localIp = ip.getHostAddress(); - } - } - } - } catch (SocketException e) { - e.getMessage(); - } - if (netIp != null && ! "".equals(netIp)) { - return netIp; - } else { - return localIp; - } - } - - public static String getRemoteIp(HttpServletRequest request) { - // 获取请求主机IP地址,如果通过代理进来,则透过防火墙获取真实IP地址 - - String ip = getXForwardedForIp(request); - if (ipValid(ip)) { - return realIp(ip); - } - ip = request.getHeader("Proxy-Client-IP"); - if (ipValid(ip)) { - return realIp(ip); - } - ip = request.getHeader("HTTP_CLIENT_IP"); - if (ipValid(ip)) { - return realIp(ip); - } - ip = request.getHeader("HTTP_X_FORWARDED_FOR"); - if (ipValid(ip)) { - return realIp(ip); - } - - ip = request.getRemoteAddr(); - return realIp(ip); - } - - private static String getXForwardedForIp(HttpServletRequest request) { - String ip = request.getHeader("x-forwarded-for"); - //ip 无效直接返回 - if (! ipValid(ip)) { - return ""; - } - if (ip.length() > 15) { - String[] ips = ip.split(","); - for (String strIp : ips) { - if (! ("unknown".equalsIgnoreCase(strIp))) { - ip = strIp; - break; - } - } - return ip; - } - return ip; - } - - private static Boolean ipValid(String ip) { - if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) { - return false; - } - return true; - } - - private static String realIp(String ip) { - if (StringUtils.isEmpty(ip)) { - return ""; - } - return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : ip; - } - - public static String getRemoteLocation(HttpServletRequest request) { - String ip = getRemoteIp(request); - return getIpLocation(ip); - } - - public static String getIpLocation(String ip) { - String location = "未知"; - if (StringUtils.isEmpty(ip)) { - return location; - } - Map param = new HashMap<>(); - param.put("ip", ip); - - try { - String rspStr = SmartHttpUtil.sendGet(IP_URL, param, null); - if (StringUtils.isEmpty(rspStr)) { - return location; - } - JSONObject jsonObject = JSON.parseObject(rspStr); - String data = jsonObject.getString("data"); - JSONObject jsonData = JSON.parseObject(data); - String region = jsonData.getString("region"); - String city = jsonData.getString("city"); - location = region + " " + city; - if (location.contains("内网IP")) { - location = "内网(" + ip + ")"; - } - } catch (Exception e) { - - } - return location; - } - - public static void main(String[] args) { - System.out.printf(getIpLocation("172.16.0.221")); - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartPageUtil.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartPageUtil.java deleted file mode 100644 index 2e1352c6..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartPageUtil.java +++ /dev/null @@ -1,97 +0,0 @@ -package net.lab1024.smartadmin.util; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import net.lab1024.smartadmin.common.domain.OrderItemDTO; -import net.lab1024.smartadmin.common.domain.PageParamDTO; -import net.lab1024.smartadmin.common.domain.PageResultDTO; - -import java.util.List; -import java.util.stream.Collectors; - -/** - * 分页工具类 - * - * @author GHQ - * @date 2017-12-23 16:40 - */ - -public class SmartPageUtil { - - public static PageResultDTO convert2PageResult(IPage page) { - PageResultDTO result = new PageResultDTO<>(); - result.setPageNum(page.getCurrent()); - result.setPageSize(page.getSize()); - result.setTotal(page.getTotal()); - result.setPages(page.getPages()); - result.setList(page.getRecords()); - return result; - } - - public static Page convert2QueryPage(PageParamDTO baseDTO) { - Page page = new Page<>(); - - List orders = baseDTO.getOrders(); - if (orders != null && !orders.isEmpty()) { - List orderItemList = orders.stream().map(SmartPageUtil::convertOrderItem).collect(Collectors.toList()); - page.setOrders(orderItemList); - } - page.setCurrent(baseDTO.getPageNum()); - page.setSize(baseDTO.getPageSize()); - if (null != baseDTO.getSearchCount()) { - page.setSearchCount(baseDTO.getSearchCount()); - } - return page; - } - - private static com.baomidou.mybatisplus.core.metadata.OrderItem convertOrderItem(OrderItemDTO orderItemDTO) { - if (orderItemDTO.isAsc()) { - return com.baomidou.mybatisplus.core.metadata.OrderItem.asc(orderItemDTO.getColumn()); - } else { - return com.baomidou.mybatisplus.core.metadata.OrderItem.desc(orderItemDTO.getColumn()); - } - } - - /** - * 转换为 PageResultDTO 对象 - * - * @param page - * @param sourceList 原list - * @param targetClazz 目标类 - * @return - * @author yandanyang - * @date 2018年5月16日 下午6:05:28 - */ - public static PageResultDTO convert2PageResult(IPage page, List sourceList, Class targetClazz) { - PageResultDTO pageResultDTO = setPage(page); - List records = SmartBeanUtil.copyList(sourceList, targetClazz); - page.setRecords(records); - pageResultDTO.setList(records); - return pageResultDTO; - } - - /** - * 转换为 PageResultDTO 对象 - * - * @param page - * @param sourceList list - * @return - * @author yandanyang - * @date 2018年5月16日 下午6:05:28 - */ - public static PageResultDTO convert2PageResult(IPage page, List sourceList) { - PageResultDTO pageResultDTO = setPage(page); - page.setRecords(sourceList); - pageResultDTO.setList(sourceList); - return pageResultDTO; - } - - private static PageResultDTO setPage(IPage page) { - PageResultDTO pageResultDTO = new PageResultDTO(); - pageResultDTO.setPageNum(page.getCurrent()); - pageResultDTO.setPageSize(page.getSize()); - pageResultDTO.setTotal(page.getTotal()); - pageResultDTO.setPages(page.getPages()); - return pageResultDTO; - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartQuartzUtil.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartQuartzUtil.java deleted file mode 100644 index 14003e6d..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartQuartzUtil.java +++ /dev/null @@ -1,43 +0,0 @@ -package net.lab1024.smartadmin.util; - -import net.lab1024.smartadmin.module.support.quartz.constant.QuartzConst; -import org.apache.commons.lang3.StringUtils; -import org.quartz.JobKey; -import org.quartz.TriggerKey; - -/** - * [ ] - * - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2018 1024lab.netInc. All rights reserved. - * @date 2019/4/13 0013 下午 15:16 - * @since JDK1.8 - */ -public class SmartQuartzUtil { - - public static Long getTaskIdByJobKey(JobKey jobKey) { - String name = jobKey.getName(); - return Long.valueOf(StringUtils.replace(name, QuartzConst.JOB_KEY_PREFIX, "")); - } - - public static Integer getTaskIdByTriggerKey(TriggerKey triggerKey) { - String name = triggerKey.getName(); - return Integer.valueOf(StringUtils.replace(name, QuartzConst.TRIGGER_KEY_PREFIX, "")); - } - - /** - * 获取触发器key - */ - public static TriggerKey getTriggerKey(Long taskId) { - return TriggerKey.triggerKey(QuartzConst.TRIGGER_KEY_PREFIX + taskId); - } - - /** - * 获取jobKey - */ - public static JobKey getJobKey(Long taskId) { - return JobKey.jobKey(QuartzConst.JOB_KEY_PREFIX + taskId); - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartRequestTokenUtil.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartRequestTokenUtil.java deleted file mode 100644 index 7ae5f5fc..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartRequestTokenUtil.java +++ /dev/null @@ -1,51 +0,0 @@ -package net.lab1024.smartadmin.util; - -import net.lab1024.smartadmin.module.system.login.domain.RequestTokenBO; -import org.springframework.web.context.request.RequestAttributes; -import org.springframework.web.context.request.RequestContextHolder; -import org.springframework.web.context.request.ServletRequestAttributes; - -import javax.servlet.http.HttpServletRequest; -/** - * @author yandanyang - * @version 1.0 - * @company 1024lab.net - * @copyright (c) 2019 1024lab.netInc. All rights reserved. - * @date - * @since JDK1.8 - */ -public class SmartRequestTokenUtil { - - private static final String USER_KEY = "smart_admin_user"; - - private static ThreadLocal RequestUserThreadLocal = new ThreadLocal(); - - public static void setUser(HttpServletRequest request, RequestTokenBO requestToken) { - request.setAttribute(USER_KEY, requestToken); - RequestUserThreadLocal.set(requestToken); - } - - public static RequestTokenBO getThreadLocalUser() { - return RequestUserThreadLocal.get(); - } - - public static RequestTokenBO getRequestUser() { - RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes(); - if (requestAttributes != null) { - HttpServletRequest request = ((ServletRequestAttributes) requestAttributes).getRequest(); - if (request != null) { - return (RequestTokenBO) request.getAttribute(USER_KEY); - } - } - return null; - } - - public static Long getRequestUserId() { - RequestTokenBO requestUser = getRequestUser(); - if (null == requestUser) { - return null; - } - return requestUser.getRequestUserId(); - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartSendMailUtil.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartSendMailUtil.java deleted file mode 100644 index b5bee5f6..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartSendMailUtil.java +++ /dev/null @@ -1,243 +0,0 @@ -package net.lab1024.smartadmin.util; - -import lombok.extern.slf4j.Slf4j; - -import javax.activation.DataHandler; -import javax.activation.DataSource; -import javax.mail.Authenticator; -import javax.mail.PasswordAuthentication; -import javax.mail.Session; -import javax.mail.Transport; -import javax.mail.internet.*; -import javax.mail.util.ByteArrayDataSource; -import java.io.InputStream; -import java.util.Date; -import java.util.LinkedList; -import java.util.List; -import java.util.Properties; -import java.util.regex.Pattern; - -@Slf4j -public class SmartSendMailUtil { - - /** - * 邮箱正则表达式 - */ - static final Pattern pattern = Pattern.compile("^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$"); - - public static void main(String[] args) throws Exception { - // 发件人的 邮箱 和 密码(替换为自己的邮箱和密码) - // PS: 某些邮箱服务器为了增加邮箱本身密码的安全性,给 SMTP 客户端设置了独立密码(有的邮箱称为“授权码”), - // 对于开启了独立密码的邮箱, 这里的邮箱密码必需使用这个独立密码(授权码)。 - String myEmailAccount = "xxxxx@163.com"; - String myEmailPassword = "xxxxxx"; - // 发件人邮箱的 SMTP 服务器地址, 必须准确, 不同邮件服务器地址不同, 一般(只是一般, 绝非绝对)格式为: smtp.xxx.com - // 网易163邮箱的 SMTP 服务器地址为: smtp.163.com - String myEmailSMTPHost = "smtp.163.com"; - // 收件人邮箱(替换为自己知道的有效邮箱) - String[] toMailAccountList = new String[]{"421316927@qq.com"}; - SmartSendMailUtil.sendMail(myEmailAccount, myEmailPassword, "", toMailAccountList, "", myEmailSMTPHost, "测试发送邮件", "测试发送邮件"); - - } - - /** - * 发送文本邮件 - * - * @param sendMail 发件人邮箱 - * @param sendMailPwd 发件人密码 - * @param sendMailName 发件人昵称(可选) - * @param receiveMail 收件人邮箱 - * @param receiveMailName 收件人昵称(可选) - * @param sendSMTPHost 发件人邮箱的 SMTP 服务器地址, 必须准确, 不同邮件服务器地址不同, 一般(只是一般, 绝非绝对)格式为: smtp.xxx.com - * @param title 邮件主题 - * @param content 邮件正文 - * @author Administrator - * @date 2017年12月13日 下午1:51:38 - */ - public static void sendMail(String sendMail, String sendMailPwd, String sendMailName, String[] receiveMail, String receiveMailName, String sendSMTPHost, String title, String content) { - - Session session = createSession(sendSMTPHost); - // 3. 创建一封邮件 - MimeMessage message; - try { - message = createMimeMessage(session, sendMail, sendMailName, receiveMail, receiveMailName, title, content); - // 4. 根据 Session 获取邮件传输对象 - Transport transport = session.getTransport(); - - // 5. 使用 邮箱账号 和 密码 连接邮件服务器, 这里认证的邮箱必须与 message 中的发件人邮箱一致, 否则报错 - // - // PS_01: 成败的判断关键在此一句, 如果连接服务器失败, 都会在控制台输出相应失败原因的 log, - // 仔细查看失败原因, 有些邮箱服务器会返回错误码或查看错误类型的链接, 根据给出的错误 - // 类型到对应邮件服务器的帮助网站上查看具体失败原因。 - // - // PS_02: 连接失败的原因通常为以下几点, 仔细检查代码: - // (1) 邮箱没有开启 SMTP 服务; - // (2) 邮箱密码错误, 例如某些邮箱开启了独立密码; - // (3) 邮箱服务器要求必须要使用 SSL 安全连接; - // (4) 请求过于频繁或其他原因, 被邮件服务器拒绝服务; - // (5) 如果以上几点都确定无误, 到邮件服务器网站查找帮助。 - // - // PS_03: 仔细看log, 认真看log, 看懂log, 错误原因都在log已说明。 - transport.connect(sendMail, sendMailPwd); - // 6. 发送邮件, 发到所有的收件地址, message.getAllRecipients() 获取到的是在创建邮件对象时添加的所有收件人, 抄送人, 密送人 - transport.sendMessage(message, message.getAllRecipients()); - // 7. 关闭连接 - transport.close(); - } catch (Exception e) { - log.error("", e); - } - - } - - /** - * 发送带附件的邮件 - * - * @param sendMail 发件人邮箱 - * @param sendMailPwd 发件人密码 - * @param sendMailName 发件人昵称(可选) - * @param receiveMail 收件人邮箱 - * @param receiveMailName 收件人昵称(可选) - * @param sendSMTPHost 发件人邮箱的 SMTP 服务器地址, 必须准确, 不同邮件服务器地址不同, 一般(只是一般, 绝非绝对)格式为: smtp.xxx.com - * @param title 邮件主题 - * @param content 邮件正文 - * @author Administrator - * @date 2017年12月13日 下午1:51:38 - */ - public static void sendFileMail(String sendMail, String sendMailPwd, String sendMailName, String[] receiveMail, String receiveMailName, String sendSMTPHost, String title, String content, - InputStream is, String fileName, String port) { - - Session session = createSSLSession(sendSMTPHost, port, sendMailName, sendMailPwd); - // 3. 创建一封邮件 - MimeMessage message; - try { - message = createMimeMessage(session, sendMail, sendMailName, receiveMail, receiveMailName, title, content); - // 5. Content: 邮件正文(可以使用html标签)(内容有广告嫌疑,避免被邮件服务器误认为是滥发广告以至返回失败,请修改发送内容) - MimeMultipart mm = new MimeMultipart(); - MimeBodyPart text = new MimeBodyPart(); - text.setContent(content, "text/html;charset=UTF-8"); - mm.addBodyPart(text); - if (null != is && is.available() > 0) { - MimeBodyPart attachment = new MimeBodyPart(); - DataSource source = new ByteArrayDataSource(is, "application/msexcel"); - // 将附件数据添加到"节点" - attachment.setDataHandler(new DataHandler(source)); - // 设置附件的文件名(需要编码) - attachment.setFileName(MimeUtility.encodeText(fileName)); - // 10. 设置文本和 附件 的关系(合成一个大的混合"节点" / Multipart ) - // 如果有多个附件,可以创建多个多次添加 - mm.addBodyPart(attachment); - } - message.setContent(mm); - message.saveChanges(); - // 4. 根据 Session 获取邮件传输对象 - Transport transport = session.getTransport("smtp"); - transport.connect(sendSMTPHost, sendMail, sendMailPwd); - // // 6. 发送邮件, 发到所有的收件地址, message.getAllRecipients() 获取到的是在创建邮件对象时添加的所有收件人, 抄送人, 密送人 - transport.sendMessage(message, message.getAllRecipients()); - // 7. 关闭连接 - } catch (Exception e) { - log.error("", e); - } - - } - - /** - * 创建session - * - * @author lidoudou - * @date 2019/2/16 14:59 - */ - private static Session createSSLSession(String sendSMTPHost, String port, String userName, String pwd) { - // 1. 创建参数配置, 用于连接邮件服务器的参数配置 - Properties props = new Properties(); // 参数配置 - - props.setProperty("mail.smtp.user", userName); - props.setProperty("mail.smtp.password", pwd); - props.setProperty("mail.smtp.host", sendSMTPHost); - props.setProperty("mail.smtp.port", port); - props.setProperty("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory"); - props.setProperty("mail.smtp.socketFactory.fallback", "false"); - props.setProperty("mail.smtp.socketFactory.port", port); - props.put("mail.smtp.auth", "true"); - - // 2. 根据配置创建会话对象, 用于和邮件服务器交互 - Session session = Session.getDefaultInstance(props, new Authenticator() { - //身份认证 - @Override - protected PasswordAuthentication getPasswordAuthentication() { - return new PasswordAuthentication(userName, pwd); - } - }); - session.setDebug(true); // 设置为debug模式, 可以查看详细的发送 log - return session; - } - - /** - * 创建session - * - * @author lidoudou - * @date 2019/2/16 14:59 - */ - private static Session createSession(String sendSMTPHost) { - // 1. 创建参数配置, 用于连接邮件服务器的参数配置 - Properties props = new Properties(); // 参数配置 - props.setProperty("mail.transport.protocol", "smtp"); // 使用的协议(JavaMail规范要求) - props.setProperty("mail.smtp.host", sendSMTPHost); // 发件人的邮箱的 SMTP 服务器地址 - props.setProperty("mail.smtp.auth", "true"); // 需要请求认证 - // PS: 某些邮箱服务器要求 SMTP 连接需要使用 SSL 安全认证 (为了提高安全性, 邮箱支持SSL连接, 也可以自己开启), - // 如果无法连接邮件服务器, 仔细查看控制台打印的 log, 如果有有类似 “连接失败, 要求 SSL 安全连接” 等错误, - // 打开下面 /* ... */ 之间的注释代码, 开启 SSL 安全连接。 - /* - * // SMTP 服务器的端口 (非 SSL 连接的端口一般默认为 25, 可以不添加, 如果开启了 SSL 连接, // 需要改为对应邮箱的 SMTP 服务器的端口, - * 具体可查看对应邮箱服务的帮助, // QQ邮箱的SMTP(SLL)端口为465或587, 其他邮箱自行去查看) final String smtpPort = "465"; - * props.setProperty("mail.smtp.port", smtpPort); - * props.setProperty("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory"); - * props.setProperty("mail.smtp.socketFactory.fallback", "false"); - * props.setProperty("mail.smtp.socketFactory.port", smtpPort); - */ - // 2. 根据配置创建会话对象, 用于和邮件服务器交互 - Session session = Session.getInstance(props); - session.setDebug(true); // 设置为debug模式, 可以查看详细的发送 log - return session; - } - - /** - * 创建一封只包含文本的简单邮件 - * - * @param session 和服务器交互的会话 - * @param sendMail 发件人邮箱 - * @param sendMailName 发件人昵称 - * @param receiveMail 收件人邮箱 - * @param receiveMailName 收件人昵称 - * @param title 邮件主题 - * @param content 邮件正文 - * @return - * @throws Exception - * @author Administrator - * @date 2017年12月13日 下午1:55:45 - */ - public static MimeMessage createMimeMessage(Session session, String sendMail, String sendMailName, String[] receiveMail, String receiveMailName, String title, String content) throws Exception { - // 1. 创建一封邮件 - MimeMessage message = new MimeMessage(session); - // 2. From: 发件人(昵称有广告嫌疑,避免被邮件服务器误认为是滥发广告以至返回失败,请修改昵称) - message.setFrom(new InternetAddress(sendMail, sendMailName, "UTF-8")); - // 3. To: 收件人(可以增加多个收件人、抄送、密送) - List to = new LinkedList<>(); - for (String s : receiveMail) { - if (pattern.matcher(s).matches()) { - to.add(new InternetAddress(s)); - } - } - //Address[] addresses = new Address[]{new InternetAddress(receiveMail),new InternetAddress(receiveMail)}; - message.addRecipients(MimeMessage.RecipientType.TO, to.toArray((new InternetAddress[to.size()]))); - // 4. Subject: 邮件主题(标题有广告嫌疑,避免被邮件服务器误认为是滥发广告以至返回失败,请修改标题) - message.setSubject(title, "UTF-8"); - // 5. Content: 邮件正文(可以使用html标签)(内容有广告嫌疑,避免被邮件服务器误认为是滥发广告以至返回失败,请修改发送内容) - message.setContent(content, "text/html;charset=UTF-8"); - // 6. 设置发件时间 - message.setSentDate(new Date()); - // 7. 保存设置 - message.saveChanges(); - return message; - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartThreadFactory.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartThreadFactory.java deleted file mode 100644 index 367f2b17..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/SmartThreadFactory.java +++ /dev/null @@ -1,44 +0,0 @@ -package net.lab1024.smartadmin.util; - -import java.util.concurrent.ThreadFactory; -import java.util.concurrent.atomic.AtomicInteger; - -/** - * 拥有自己的thread facotry是为了jstack时候能看到是哪个线程 - * - * @author jiaozi - */ -public class SmartThreadFactory implements ThreadFactory { - - public static SmartThreadFactory create(String namePrefix) { - return new SmartThreadFactory(namePrefix); - } - - private final AtomicInteger poolNumber = new AtomicInteger(1); - - private final ThreadGroup group; - - private final AtomicInteger threadNumber = new AtomicInteger(1); - - private final String namePrefix; - - private SmartThreadFactory(String namePrefix) { - SecurityManager s = System.getSecurityManager(); - group = (s != null) ? s.getThreadGroup() : Thread.currentThread().getThreadGroup(); - this.namePrefix = namePrefix + " pool " + poolNumber.getAndIncrement() + "-thread-"; - } - - @Override - public Thread newThread(Runnable r) { - Thread t = new Thread(group, r, namePrefix + threadNumber.getAndIncrement(), 0); - if (t.isDaemon()) { - t.setDaemon(false); - } - - if (t.getPriority() != Thread.NORM_PRIORITY) { - t.setPriority(Thread.NORM_PRIORITY); - } - return t; - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/excel/SmartExcel.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/excel/SmartExcel.java deleted file mode 100644 index 47f6e8cd..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/excel/SmartExcel.java +++ /dev/null @@ -1,83 +0,0 @@ -package net.lab1024.smartadmin.util.excel; - -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import org.apache.poi.hssf.usermodel.HSSFWorkbook; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; - -/** - * zhuoda - */ -public class SmartExcel { - - List sheetList = new ArrayList();; - - public SmartExcel(String fileName) { - org.apache.poi.ss.usermodel.Workbook workbook = null; - try { - workbook = fileName.endsWith(".xls") ? new HSSFWorkbook(new FileInputStream(fileName)) : new XSSFWorkbook(new FileInputStream(fileName)); - int numberOfSheets = workbook.getNumberOfSheets(); - for (int index = 0; index < numberOfSheets; index++) { - addSheet(new SmartSheet(workbook.getSheetAt(index))); - } - } catch (Throwable t) { - throw new RuntimeException(t); - } finally { - if (workbook != null) { - try { - workbook.close(); - } catch (IOException e) { - } - workbook = null; - } - } - } - - public SmartExcel(InputStream ins, SmartExcelFileType fileType) { - org.apache.poi.ss.usermodel.Workbook workbook = null; - try { - workbook = fileType == SmartExcelFileType.XLS ? new HSSFWorkbook(ins) : new XSSFWorkbook(ins); - int numberOfSheets = workbook.getNumberOfSheets(); - for (int index = 0; index < numberOfSheets; index++) { - addSheet(new SmartSheet(workbook.getSheetAt(index))); - } - } catch (Throwable t) { - throw new RuntimeException(t); - } finally { - if (workbook != null) { - try { - workbook.close(); - } catch (IOException e) { - } - workbook = null; - } - } - } - - final protected void addSheet(SmartSheet sheet) { - this.sheetList.add(sheet); - } - - final protected void addSheetList(Collection sheets) { - this.sheetList.addAll(sheets); - } - - final public List getSheetList() { - return sheetList; - } - - final public SmartSheet getSheet(String sheetName) { - for (SmartSheet sheet : sheetList) { - if (sheet.getName().equals(sheetName)) { - return sheet; - } - } - return null; - } -} - diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/excel/SmartExcelFileType.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/excel/SmartExcelFileType.java deleted file mode 100644 index 499e43db..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/excel/SmartExcelFileType.java +++ /dev/null @@ -1,10 +0,0 @@ -package net.lab1024.smartadmin.util.excel; - -/** - * @author zhuoda - */ -public enum SmartExcelFileType { - XLS, - XLSX - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/excel/SmartExcelReader.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/excel/SmartExcelReader.java deleted file mode 100644 index e5c1ba5b..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/excel/SmartExcelReader.java +++ /dev/null @@ -1,32 +0,0 @@ -package net.lab1024.smartadmin.util.excel; - -/** - * @author zhuoda - * @Date 2020/8/10 - */ - -import net.lab1024.smartadmin.util.SmartFileUtil; - -import java.io.*; - -public class SmartExcelReader { - - public static SmartExcel openExcel(String filePath) throws IOException { - SmartFileUtil.isFileExistThrowException(filePath); - return new SmartExcel(new File(filePath).getCanonicalPath()); - } - - public static SmartExcel openExcel(File file) throws IOException { - return new SmartExcel(file.getCanonicalPath()); - } - - public static SmartExcel openExcel(InputStream ins, SmartExcelFileType fileType) throws IOException { - return new SmartExcel(ins, fileType); - } - - public static void main(String[] args) throws Exception { - SmartExcel smartExcel = openExcel(new FileInputStream(new File("F:/privilege.xlsx")), SmartExcelFileType.XLSX); - System.out.println(smartExcel.getSheetList()); - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/excel/SmartSheet.java b/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/excel/SmartSheet.java deleted file mode 100644 index 80aed760..00000000 --- a/smart-admin-service/smart-admin-api/src/main/java/net/lab1024/smartadmin/util/excel/SmartSheet.java +++ /dev/null @@ -1,113 +0,0 @@ -package net.lab1024.smartadmin.util.excel; - - -import org.apache.poi.ss.usermodel.Cell; -import org.apache.poi.ss.usermodel.CellType; -import org.apache.poi.ss.usermodel.Row; -import org.apache.poi.ss.util.CellRangeAddress; - -/** - * @author zhuoda - */ -public class SmartSheet { - final String name; - - private final int rowCount; - private final int columnCount; - private final String[][] datas; - - public SmartSheet(org.apache.poi.ss.usermodel.Sheet sheet) { - this.name = sheet.getSheetName(); - this.rowCount = sheet.getLastRowNum() + 1; - // 初始化基本数据 - int maxColumnCount = 0; - this.datas = new String[rowCount][]; - for (int rowIndex = 0; rowIndex < rowCount; rowIndex++) { - Row row = sheet.getRow(rowIndex); - if (row == null) { - continue; - } - int _columnCount = row.getLastCellNum() + 1; - this.datas[rowIndex] = new String[_columnCount]; - for (int colIndex = 0; colIndex < _columnCount; colIndex++) { - this.datas[rowIndex][colIndex] = getCellContents(row.getCell(colIndex)); - } - if (maxColumnCount < _columnCount) { - maxColumnCount = _columnCount; - } - } - this.columnCount = maxColumnCount; - // 根据单元格合并情况,填充内容 - for (int index = 0; index < sheet.getNumMergedRegions(); index++) { - CellRangeAddress mergedRegion = sheet.getMergedRegion(index); - String upperLeftData = this.datas[mergedRegion.getFirstRow()][mergedRegion.getFirstColumn()]; - for (int rowIndex = mergedRegion.getFirstRow(); rowIndex <= mergedRegion.getLastRow(); rowIndex++) { - String[] _rowDatas = this.datas[rowIndex]; - if (_rowDatas == null) { - this.datas[rowIndex] = new String[mergedRegion.getLastColumn() + 1]; - } else if (_rowDatas.length < mergedRegion.getLastColumn() + 1) { - String[] newStrArray = new String[mergedRegion.getLastColumn() + 1]; - System.arraycopy(_rowDatas, 0, newStrArray, 0, _rowDatas.length); - this.datas[rowIndex] = newStrArray; - } - for (int colIndex = mergedRegion.getFirstColumn(); colIndex <= mergedRegion.getLastColumn(); colIndex++) { - this.datas[rowIndex][colIndex] = upperLeftData; - } - } - } - } - - private String getCellContents(Cell cell) { - if (cell == null) { - return null; - } - return getCellContents(cell.getCellType(), cell); - } - - private String getCellContents(CellType type, Cell cell) { - switch (type) { - case BLANK: - return ""; - case NUMERIC: - return cell.getStringCellValue(); - case STRING: - return cell.getStringCellValue(); - case FORMULA: - return getCellContents(cell.getCachedFormulaResultType(), cell); - case BOOLEAN: - return String.valueOf(cell.getBooleanCellValue()); - case ERROR: - default: - throw new IllegalArgumentException(String.format("unsupported cell type:%d, col:%d, row:%d, sheet:%s", cell.getCellType(), cell.getColumnIndex(), - cell.getRowIndex(), getName())); - } - } - - public int getRowCount() { - return rowCount; - } - - public int getColumnCount() { - return columnCount; - } - - public String getValue(int rowIndex, int columnIndex) { - if (rowIndex < 0 || rowIndex >= datas.length) { - return ""; - } - if (columnIndex < 0 || datas[rowIndex] == null || columnIndex >= datas[rowIndex].length) { - return ""; - } - String value = datas[rowIndex][columnIndex]; - return value == null ? "": value; - } - - - public String getName() { - return name; - } - - - -} - diff --git a/smart-admin-service/smart-admin-api/src/main/resources/dev/application.properties b/smart-admin-service/smart-admin-api/src/main/resources/dev/application.properties deleted file mode 100644 index b4468249..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/dev/application.properties +++ /dev/null @@ -1,123 +0,0 @@ -######################### server ################### -server.servlet.context-path=/smart-admin-api -server.port=10086 -spring.profiles.active=@profiles.active@ - -######################### tomcat ################### -server.tomcat.basedir=/home/logs/smart-admin/tomcat-logs -server.tomcat.accesslog.enabled=true -server.tomcat.accesslog.pattern=%t %{X-Forwarded-For}i %a "%r" %s %D (%D ms) - -######################### jackson ######################### -spring.jackson.serialization.write-enums-using-to-string=true -spring.jackson.deserialization.read-enums-using-to-string=true -spring.jackson.deserialization.fail-on-unknown-properties=false -spring.jackson.default-property-inclusion=always -spring.jackson.date-format=yyyy-MM-dd HH:mm:ss -spring.jackson.time-zone=GMT+8 -spring.jackson.serialization.write-dates-as-timestamps=false - -######################### http file ######################### -spring.servlet.multipart.max-file-size=30MB -spring.servlet.multipart.max-request-size=30MB -file-upload-service.path=/home/upload/ - -######################### database ######################### -spring.datasource.url=jdbc:p6spy:mysql://127.0.0.1:3306/smart-admin-dev?autoReconnect=true&useServerPreparedStmts=false&rewriteBatchedStatements=true&characterEncoding=UTF-8&useSSL=false&allowMultiQueries=true&serverTimezone=UTC -spring.datasource.username=root -spring.datasource.password=Root.123 -spring.datasource.initial-size=2 -spring.datasource.min-idle=1 -spring.datasource.max-active=10 -spring.datasource.max-wait=60000 -spring.datasource.time-between-eviction-runs-millis=60000 -spring.datasource.min-evictable-idle-time-millis=300000 -spring.datasource.driver-class-name=com.p6spy.engine.spy.P6SpyDriver -spring.datasource.filters=stat -spring.datasource.druid.username=druid -spring.datasource.druid.password=123456 -spring.datasource.druid.login.enabled=false - -######################### redis ####################################### -spring.redis.database=0 -spring.redis.host=127.0.0.1 -spring.redis.port=6379 -spring.redis.timeout=10000ms -spring.redis.password= -spring.redis.lettuce.pool.max-active=10 -spring.redis.lettuce.pool.min-idle=5 -spring.redis.lettuce.pool.max-idle=10 -spring.redis.lettuce.pool.max-wait=30000ms - -########################## rest http pool ######################### -#\u6700\u5927\u8FDE\u63A5\u6570 -http.pool.max-total=10 -#\u5355\u8DEF\u7531\u6700\u5927\u8FDE\u63A5\u6570 -http.pool.default-max-per-route=5 -#\u670D\u52A1\u5668\u8FD4\u56DE\u6570\u636E(response)\u7684\u65F6\u95F4 -http.pool.socket-timeout=8000 -#\u8FDE\u63A5\u4E0A\u670D\u52A1\u5668(\u63E1\u624B\u6210\u529F)\u7684\u65F6\u95F4 -http.pool.connect-timeout=8000 -#\u4ECE\u8FDE\u63A5\u6C60\u4E2D\u83B7\u53D6\u8FDE\u63A5\u7684\u8D85\u65F6\u65F6\u95F4 -http.pool.connection-request-timeout=8000 - -######################### mybatis\u914D\u7F6E ######################### -mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl -# mybatis-plus \u5B57\u6BB5\u9A7C\u5CF0\u81EA\u52A8\u8F6C\u6362 -mybatis-plus.configuration.map-underscore-to-camel-case=true -mybatis-plus.mapper-locations=classpath:/mapper/**/*.xml -mybatis-plus.typeAliasesPackage=net.lab1024.smartadmin.*.*.domain.entity -mybatis-plus.global-config.refresh-mapper=true -mybatis-plus.global-config.db-column-underline=true - -######################### swagger ######################### -swagger.apiGroupName=smartAdmin -swagger.title=smartAdmin -swagger.description=smartAdmin -swagger.version=1.0 -swagger.serviceUrl=http://localhost:10086/smart-admin-api -swagger.packAge=net.lab1024.smartadmin.module - -######################### jwt ######################### -jwt.key=smart-admin-jwt-key - -########################## smart reload ######################### -smart-reload.thread-count=1 -smart-reload.time-interval=300 - -######################### cros ######################### -access-control-allow-origin=* - -######################### heart beat ######################### -heart-beat.delayHandlerTime=60000 -heart-beat.intervalTime=300000 - -######################### quartz ############################# -#\u8C03\u5EA6\u6807\u8BC6\u540D \u96C6\u7FA4\u4E2D\u6BCF\u4E00\u4E2A\u5B9E\u4F8B\u90FD\u5FC5\u987B\u4F7F\u7528\u76F8\u540C\u7684\u540D\u79F0 -spring.quartz.properties.org.quartz.scheduler.instanceName=devClusteredScheduler -spring.quartz.properties.org.quartz.scheduler.instanceId=AUTO -#\u8FDC\u7A0B\u7BA1\u7406\u76F8\u5173\u7684\u914D\u7F6E,\u5168\u90E8\u5173\u95ED -spring.quartz.properties.org.quartz.scheduler.rmi.export=false -spring.quartz.properties.org.quartz.scheduler.rmi.proxy=false -#\u8DF3\u8FC7quartz\u7248\u672C\u68C0\u67E5 -spring.quartz.properties.org.quartz.scheduler.skipUpdateCheck=true -#\u6570\u636E\u4FDD\u5B58\u65B9\u5F0F\u4E3A\u6301\u4E45\u5316 -spring.quartz.properties.org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreTX -spring.quartz.properties.org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.StdJDBCDelegate -spring.quartz.properties.org.quartz.jobStore.tablePrefix=QRTZ_ -spring.quartz.properties.org.quartz.jobStore.isClustered=true -#\u8C03\u5EA6\u5B9E\u4F8B\u5931\u6548\u7684\u68C0\u67E5\u65F6\u95F4\u95F4\u9694, \u5F00\u53D1\u73AF\u5883\u6539\u4E3A\u4E8660\u79D2 -spring.quartz.properties.org.quartz.jobStore.clusterCheckinInterval=60000 -spring.quartz.properties.org.quartz.jobStore.useProperties=false -#\u8C03\u5EA6\u7EBF\u7A0B -spring.quartz.properties.org.quartz.threadPool.class=org.quartz.simpl.SimpleThreadPool -spring.quartz.properties.org.quartz.threadPool.threadCount=2 -spring.quartz.properties.org.quartz.threadPool.threadPriority=5 -spring.quartz.properties.org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread=true -spring.quartz.properties.org.quartz.threadPool.threadNamePrefix=quartz -spring.quartz.job-store-type=jdbc -#ALWAYS,EMBEDDED,NEVER -spring.quartz.jdbc.initialize-schema=NEVER -spring.quartz.jdbc.schema=classpath:sql/quartz_mysql_2.3.0.sql -#\u81EA\u52A8\u626B\u63CF\u4EFB\u52A1\u5355\u5E76\u53D1\u73B0\u6539\u52A8\u7684\u65F6\u95F4\u95F4\u9694,\u5355\u4F4D\u4E3A\u79D2 -org.quartz.plugin.jobInitializer.scanInterval = 300 diff --git a/smart-admin-service/smart-admin-api/src/main/resources/dev/spy.properties b/smart-admin-service/smart-admin-api/src/main/resources/dev/spy.properties deleted file mode 100644 index 22c91d1e..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/dev/spy.properties +++ /dev/null @@ -1,20 +0,0 @@ -#modulelist=com.baomidou.mybatisplus.extension.p6spy.MybatisPlusLogFactory -# \u81EA\u5B9A\u4E49\u65E5\u5FD7\u6253\u5370 -logMessageFormat=com.baomidou.mybatisplus.extension.p6spy.P6SpyLogger -#\u65E5\u5FD7\u8F93\u51FA\u5230\u63A7\u5236\u53F0 -appender=com.baomidou.mybatisplus.extension.p6spy.StdoutLogger -# \u4F7F\u7528\u65E5\u5FD7\u7CFB\u7EDF\u8BB0\u5F55 sql -#appender=com.p6spy.engine.spy.appender.Slf4JLogger -# \u8BBE\u7F6E p6spy driver \u4EE3\u7406 -deregisterdrivers=true -# \u53D6\u6D88JDBC URL\u524D\u7F00 -useprefix=true -# \u914D\u7F6E\u8BB0\u5F55 Log \u4F8B\u5916,\u53EF\u53BB\u6389\u7684\u7ED3\u679C\u96C6\u6709error,info,batch,debug,statement,commit,rollback,result,resultset. -#excludecategories=info,debug,result,commit,resultset -# \u65E5\u671F\u683C\u5F0F -dateformat=yyyy-MM-dd HH:mm:ss - -# \u662F\u5426\u5F00\u542F\u6162SQL\u8BB0\u5F55 -outagedetection=true -# \u6162SQL\u8BB0\u5F55\u6807\u51C6 2 \u79D2 -outagedetectioninterval=2 \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/resources/mapper/business/email/EmailMapper.xml b/smart-admin-service/smart-admin-api/src/main/resources/mapper/business/email/EmailMapper.xml deleted file mode 100644 index 6050de51..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/mapper/business/email/EmailMapper.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - delete from t_email where id = #{id} - - - - delete from t_email where id in - - #{item} - - - - \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/resources/mapper/business/log/OrderOperateLogMapper.xml b/smart-admin-service/smart-admin-api/src/main/resources/mapper/business/log/OrderOperateLogMapper.xml deleted file mode 100644 index 46f92a00..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/mapper/business/log/OrderOperateLogMapper.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - INSERT INTO t_order_operate_log (order_id,order_type, operate_type, operate_content, operate_remark, employee_id, employee_name,ext_data,update_time,create_time) VALUES - - (#{item.orderId}, - #{item.orderType}, - #{item.operateType}, - #{item.operateContent}, - #{item.operateRemark}, - #{item.employeeId}, - #{item.employeeName}, - #{item.extData}, - #{item.updateTime} - #{item.createTime} - ) - - - - - diff --git a/smart-admin-service/smart-admin-api/src/main/resources/mapper/business/log/UserLoginLogMapper.xml b/smart-admin-service/smart-admin-api/src/main/resources/mapper/business/log/UserLoginLogMapper.xml deleted file mode 100644 index 87b0df3b..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/mapper/business/log/UserLoginLogMapper.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - delete from t_user_login_log where id = #{id} - - - - delete from t_user_login_log where id in - - #{item} - - - - \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/resources/mapper/business/log/UserOperateLogMapper.xml b/smart-admin-service/smart-admin-api/src/main/resources/mapper/business/log/UserOperateLogMapper.xml deleted file mode 100644 index 7088f2c4..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/mapper/business/log/UserOperateLogMapper.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - delete from t_user_operate_log where id = #{id} - - - - delete from t_user_operate_log where id in - - #{item} - - - - \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/resources/mapper/business/notice/NoticeMapper.xml b/smart-admin-service/smart-admin-api/src/main/resources/mapper/business/notice/NoticeMapper.xml deleted file mode 100644 index d94c0ab7..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/mapper/business/notice/NoticeMapper.xml +++ /dev/null @@ -1,155 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - UPDATE t_notice - set deleted = #{deletedFlag} - WHERE id =#{id} - - - - - UPDATE t_notice set deleted = #{deletedFlag} where id in - - #{item} - - - - - - - - - - - - - - \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/resources/mapper/business/notice/NoticeReceiveRecordMapper.xml b/smart-admin-service/smart-admin-api/src/main/resources/mapper/business/notice/NoticeReceiveRecordMapper.xml deleted file mode 100644 index 66168c57..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/mapper/business/notice/NoticeReceiveRecordMapper.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - delete from t_notice_receive_record where notice_id = #{noticeId} - - - - INSERT INTO t_notice_receive_record (notice_id, employee_id, update_time, create_time) VALUES - - ( - #{item.noticeId}, - #{item.employeeId}, - now(), - now() - ) - - - - - - - - - - \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/resources/mapper/business/peony/PeonyMapper.xml b/smart-admin-service/smart-admin-api/src/main/resources/mapper/business/peony/PeonyMapper.xml deleted file mode 100644 index 4be1a0f5..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/mapper/business/peony/PeonyMapper.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - - - - - - - - - - delete from t_peony where id = #{id} - - - - delete from t_peony where id in - - #{item} - - - - \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/resources/mapper/support/codegenerator/TableMapper.xml b/smart-admin-service/smart-admin-api/src/main/resources/mapper/support/codegenerator/TableMapper.xml deleted file mode 100644 index 4af675b6..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/mapper/support/codegenerator/TableMapper.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/resources/mapper/support/file/FileMapper.xml b/smart-admin-service/smart-admin-api/src/main/resources/mapper/support/file/FileMapper.xml deleted file mode 100644 index 04abb76d..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/mapper/support/file/FileMapper.xml +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - - INSERT INTO t_file ( - module_id, - module_type, - file_name, - file_size, - file_type, - file_path, - creater_user, - file_location_type - ) - VALUES - - (#{item.moduleId},#{item.moduleType},#{item.fileName},#{item.fileSize},#{item.fileType},#{item.filePath},#{item.createrUser},#{item.createrUserType},#{item.fileLocationType}) - - - - - INSERT INTO t_file ( - module_id, - module_type, - file_name, - file_size, - file_type, - file_path, - creater_user, - file_location_type - ) - VALUES - - (#{item.moduleId},#{item.moduleType},#{item.fileName},#{item.fileSize},#{item.fileType},#{item.filePath},#{item.createrUser},#{item.createrUserType},#{item.fileLocationType}) - - - - - DELETE FROM t_file WHERE module_id =#{moduleId} - - - - DELETE FROM t_file WHERE module_id =#{moduleId} and module_type=#{moduleType} - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/resources/mapper/support/heartbeat/HeartBeatRecordMapper.xml b/smart-admin-service/smart-admin-api/src/main/resources/mapper/support/heartbeat/HeartBeatRecordMapper.xml deleted file mode 100644 index 27ce75e6..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/mapper/support/heartbeat/HeartBeatRecordMapper.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - INSERT INTO t_heart_beat_record ( - project_path, - server_ip, - process_no, - process_start_time, - heart_beat_time - ) - VALUES - (#{projectPath}, - #{serverIp}, - #{processNo}, - #{processStartTime}, - #{heartBeatTime}) - - - - update t_heart_beat_record - set heart_beat_time = #{heartBeatTime} - - id = #{id} - - - - - - - diff --git a/smart-admin-service/smart-admin-api/src/main/resources/mapper/support/idgenerator/IdGeneratorMapper.xml b/smart-admin-service/smart-admin-api/src/main/resources/mapper/support/idgenerator/IdGeneratorMapper.xml deleted file mode 100644 index df3b86c5..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/mapper/support/idgenerator/IdGeneratorMapper.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - update t_id_generator set last_number = #{lastNumber}, update_time = now() where id = #{generatorId} - - - - replace into `t_id_generator_record` (`generator_id`, `year`, `month`, `day`, `last_number`) values (#{generatorId}, #{year}, #{month}, #{day}, #{lastNumber}) - - - - \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/resources/mapper/support/quartz/QuartzTaskLogMapper.xml b/smart-admin-service/smart-admin-api/src/main/resources/mapper/support/quartz/QuartzTaskLogMapper.xml deleted file mode 100644 index 43f25e05..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/mapper/support/quartz/QuartzTaskLogMapper.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - tl.id, - tl.task_id, - tl.task_name, - tl.task_params, - tl.process_status, - tl.process_duration, - tl.process_log, - tl.ip_address, - tl.update_time, - tl.create_time - - - - - - \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/resources/mapper/support/quartz/QuartzTaskMapper.xml b/smart-admin-service/smart-admin-api/src/main/resources/mapper/support/quartz/QuartzTaskMapper.xml deleted file mode 100644 index 0bb88311..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/mapper/support/quartz/QuartzTaskMapper.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - t.id, - t.task_name, - t.task_bean, - t.task_params, - t.task_cron, - t.task_status, - t.remark, - t.update_time, - t.create_time - - - - - - - - UPDATE t_quartz_task t - set t.task_status = #{taskStatus} - WHERE t.id = #{taskId} - - - - \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/resources/mapper/support/smartreload/ReloadItemMapper.xml b/smart-admin-service/smart-admin-api/src/main/resources/mapper/support/smartreload/ReloadItemMapper.xml deleted file mode 100644 index 03c1f67f..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/mapper/support/smartreload/ReloadItemMapper.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/resources/mapper/support/smartreload/ReloadResultMapper.xml b/smart-admin-service/smart-admin-api/src/main/resources/mapper/support/smartreload/ReloadResultMapper.xml deleted file mode 100644 index 6c0caba1..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/mapper/support/smartreload/ReloadResultMapper.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/resources/mapper/system/department/DepartmentMapper.xml b/smart-admin-service/smart-admin-api/src/main/resources/mapper/system/department/DepartmentMapper.xml deleted file mode 100644 index 837a287c..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/mapper/system/department/DepartmentMapper.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - d.id, - d.name, - d.short_name, - d.manager_id, - d.parent_id, - d.sort, - d.update_time, - d.create_time - - - - - - - - - - - \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/resources/mapper/system/employee/EmployeeMapper.xml b/smart-admin-service/smart-admin-api/src/main/resources/mapper/system/employee/EmployeeMapper.xml deleted file mode 100644 index 2b13a478..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/mapper/system/employee/EmployeeMapper.xml +++ /dev/null @@ -1,186 +0,0 @@ - - - - - - - - - - - e.id, - e.login_name, - e.login_pwd, - e.actual_name, - e.nick_name, - e.phone, - e.id_card, - e.birthday, - e.email, - e.department_id, - e.is_leave, - e.is_disabled, - e.remark, - e.is_delete, - e.update_time, - e.create_time - - - - - - - UPDATE t_employee e - set e.is_disabled = #{isDisabled} - WHERE id in - - #{item} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - UPDATE t_employee - SET login_pwd = #{password} - WHERE id = #{employeeId} - - - - \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/resources/mapper/system/position/PositionMapper.xml b/smart-admin-service/smart-admin-api/src/main/resources/mapper/system/position/PositionMapper.xml deleted file mode 100644 index a7ef4cce..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/mapper/system/position/PositionMapper.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - id, - position_name, - remark, - update_time, - create_time - - - - - - - - - - INSERT INTO t_position_relation (position_id,employee_id) VALUES - - (#{item},#{batchDTO.employeeId}) - - - - - - DELETE FROM t_position_relation WHERE employee_id = #{employeeId} - - - \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/resources/mapper/system/privilege/PrivilegeMapper.xml b/smart-admin-service/smart-admin-api/src/main/resources/mapper/system/privilege/PrivilegeMapper.xml deleted file mode 100644 index 7d224b22..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/mapper/system/privilege/PrivilegeMapper.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - p.id, - p.type, - p.name, - p.key, - p.url, - p.sort, - p.parent_key, - p.update_time, - p.create_time - - - - - - - - - - DELETE FROM t_privilege - WHERE `key` IN - - #{item} - - - - - DELETE FROM t_privilege - WHERE parent_key IN - - #{item} - - - - - INSERT INTO t_privilege (`type`, `name`, `key`,url,sort,parent_key,create_time,update_time) VALUES - - ( - #{item.type}, - #{item.name}, - #{item.key}, - #{item.url}, - #{item.sort}, - #{item.parentKey}, - now(), - now() - ) - - - - - - UPDATE t_privilege - SET `type`=#{item.type},`name`=#{item.name},url=#{item.url},sort=#{item.sort},parent_key=#{item.parentKey},update_time=now() - WHERE `key` = #{item.key} - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/resources/mapper/system/role/RoleEmployeeMapper.xml b/smart-admin-service/smart-admin-api/src/main/resources/mapper/system/role/RoleEmployeeMapper.xml deleted file mode 100644 index 5984cb7d..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/mapper/system/role/RoleEmployeeMapper.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - er.id, - er.role_id, - er.employee_id, - er.update_time, - er.create_time - - - - - - - - - - - - - DELETE FROM t_role_employee - WHERE employee_id = #{employeeId} - - - - - DELETE FROM t_role_employee - WHERE role_id = #{roleId} - - - - DELETE FROM t_role_employee - WHERE role_id = #{roleId} and employee_id = #{employeeId} - - - - - DELETE FROM t_role_employee - WHERE role_id = #{roleId} and employee_id in - - #{item} - - - - - INSERT INTO t_role_employee (role_id, employee_id, update_time, create_time) VALUES - - ( - #{item.roleId}, - #{item.employeeId}, - now(), - now() - ) - - - - - \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/resources/mapper/system/role/RoleMapper.xml b/smart-admin-service/smart-admin-api/src/main/resources/mapper/system/role/RoleMapper.xml deleted file mode 100644 index 5b7177dd..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/mapper/system/role/RoleMapper.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - r.id, - r.role_name, - r.remark, - r.update_time, - r.create_time - - - - - - \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/resources/mapper/system/role/RolePrivilegeMapper.xml b/smart-admin-service/smart-admin-api/src/main/resources/mapper/system/role/RolePrivilegeMapper.xml deleted file mode 100644 index cb44911b..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/mapper/system/role/RolePrivilegeMapper.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - rp.id, - rp.role_id, - rp.privilege_key, - rp.update_time, - rp.create_time - - - - - DELETE FROM t_role_privilege - WHERE role_id = #{roleId} - - - - DELETE FROM t_role_privilege - WHERE privilege_key in - - #{item} - - - - - - INSERT INTO t_role_privilege (role_id, privilege_key, update_time, create_time) VALUES - - ( - #{item.roleId}, - #{item.privilegeKey}, - now(), - now() - ) - - - - - - - - - - - \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/resources/mapper/system/systemconfig/SystemConfigMapper.xml b/smart-admin-service/smart-admin-api/src/main/resources/mapper/system/systemconfig/SystemConfigMapper.xml deleted file mode 100644 index 1cebf85b..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/mapper/system/systemconfig/SystemConfigMapper.xml +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/resources/pre/application.properties b/smart-admin-service/smart-admin-api/src/main/resources/pre/application.properties deleted file mode 100644 index fb3de5e5..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/pre/application.properties +++ /dev/null @@ -1,121 +0,0 @@ -######################### server ################### -server.servlet.context-path=/smart-admin-api -server.port=10086 -spring.profiles.active=@profiles.active@ - -######################### tomcat ################### -server.tomcat.basedir=/home/logs/smart-admin/tomcat-logs -server.tomcat.accesslog.enabled=true -server.tomcat.accesslog.pattern=%t %{X-Forwarded-For}i %a "%r" %s %D (%D ms) - -######################### jackson ######################### -spring.jackson.serialization.write-enums-using-to-string=true -spring.jackson.deserialization.read-enums-using-to-string=true -spring.jackson.deserialization.fail-on-unknown-properties=false -spring.jackson.default-property-inclusion=always -spring.jackson.date-format=yyyy-MM-dd HH:mm:ss -spring.jackson.time-zone=GMT+8 -spring.jackson.serialization.write-dates-as-timestamps=false - -######################### http file ######################### -spring.servlet.multipart.max-file-size=30MB -spring.servlet.multipart.max-request-size=30MB -file-upload-service.path=/home/upload/ - -######################### database ######################### -spring.datasource.url=jdbc:mysql://127.0.0.1:3306/smart-admin-dev?autoReconnect=true&useServerPreparedStmts=false&rewriteBatchedStatements=true&characterEncoding=UTF-8&useSSL=false&allowMultiQueries=true&serverTimezone=UTC -spring.datasource.username=root -spring.datasource.password=root -spring.datasource.initial-size=2 -spring.datasource.min-idle=1 -spring.datasource.max-active=10 -spring.datasource.max-wait=60000 -spring.datasource.time-between-eviction-runs-millis=60000 -spring.datasource.min-evictable-idle-time-millis=300000 -spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver -spring.datasource.filters=stat -spring.datasource.druid.username=druid -spring.datasource.druid.password=123456 -spring.datasource.druid.login.enabled=false - -######################### redis ####################################### -spring.redis.database=0 -spring.redis.host=127.0.0.1 -spring.redis.port=6379 -spring.redis.timeout=10000ms -spring.redis.password= -spring.redis.lettuce.pool.max-active=10 -spring.redis.lettuce.pool.min-idle=5 -spring.redis.lettuce.pool.max-idle=10 -spring.redis.lettuce.pool.max-wait=30000ms - -########################## rest http pool ######################### -#\u6700\u5927\u8FDE\u63A5\u6570 -http.pool.max-total=10 -#\u5355\u8DEF\u7531\u6700\u5927\u8FDE\u63A5\u6570 -http.pool.default-max-per-route=5 -#\u670D\u52A1\u5668\u8FD4\u56DE\u6570\u636E(response)\u7684\u65F6\u95F4 -http.pool.socket-timeout=8000 -#\u8FDE\u63A5\u4E0A\u670D\u52A1\u5668(\u63E1\u624B\u6210\u529F)\u7684\u65F6\u95F4 -http.pool.connect-timeout=8000 -#\u4ECE\u8FDE\u63A5\u6C60\u4E2D\u83B7\u53D6\u8FDE\u63A5\u7684\u8D85\u65F6\u65F6\u95F4 -http.pool.connection-request-timeout=8000 - -######################### mybatis\u914D\u7F6E ######################### -mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl -# mybatis-plus \u5B57\u6BB5\u9A7C\u5CF0\u81EA\u52A8\u8F6C\u6362 -mybatis-plus.configuration.map-underscore-to-camel-case=true -mybatis-plus.mapper-locations=classpath:/mapper/**/*.xml -mybatis-plus.typeAliasesPackage=net.lab1024.smartadmin.*.*.domain.entity -mybatis-plus.global-config.refresh-mapper=true -mybatis-plus.global-config.db-column-underline=true - -######################### swagger ######################### -swagger.apiGroupName=smartAdmin -swagger.title=smartAdmin -swagger.description=smartAdmin -swagger.version=1.0 -swagger.serviceUrl=http://localhost:10086/smart-admin-api -swagger.packAge=net.lab1024.smartadmin.module - -######################### jwt ######################### -jwt.key=smart-admin-jwt-key - -########################## smart reload ######################### -smart-reload.thread-count=1 -smart-reload.time-interval=30 - -######################### cros ######################### -access-control-allow-origin=* - -######################### heart beat ######################### -heart-beat.delayHandlerTime=60000 -heart-beat.intervalTime=60000 - -######################### quartz ############################# -#\u8C03\u5EA6\u6807\u8BC6\u540D \u96C6\u7FA4\u4E2D\u6BCF\u4E00\u4E2A\u5B9E\u4F8B\u90FD\u5FC5\u987B\u4F7F\u7528\u76F8\u540C\u7684\u540D\u79F0 -spring.quartz.properties.org.quartz.scheduler.instanceName=devClusteredScheduler -spring.quartz.properties.org.quartz.scheduler.instanceId=AUTO -#\u8FDC\u7A0B\u7BA1\u7406\u76F8\u5173\u7684\u914D\u7F6E,\u5168\u90E8\u5173\u95ED -spring.quartz.properties.org.quartz.scheduler.rmi.export=false -spring.quartz.properties.org.quartz.scheduler.rmi.proxy=false -#\u8DF3\u8FC7quartz\u7248\u672C\u68C0\u67E5 -spring.quartz.properties.org.quartz.scheduler.skipUpdateCheck=true -#\u6570\u636E\u4FDD\u5B58\u65B9\u5F0F\u4E3A\u6301\u4E45\u5316 -spring.quartz.properties.org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreTX -spring.quartz.properties.org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.StdJDBCDelegate -spring.quartz.properties.org.quartz.jobStore.tablePrefix=QRTZ_ -spring.quartz.properties.org.quartz.jobStore.isClustered=true -#\u8C03\u5EA6\u5B9E\u4F8B\u5931\u6548\u7684\u68C0\u67E5\u65F6\u95F4\u95F4\u9694 -spring.quartz.properties.org.quartz.jobStore.clusterCheckinInterval=10000 -spring.quartz.properties.org.quartz.jobStore.useProperties=false -#\u8C03\u5EA6\u7EBF\u7A0B -spring.quartz.properties.org.quartz.threadPool.class=org.quartz.simpl.SimpleThreadPool -spring.quartz.properties.org.quartz.threadPool.threadCount=2 -spring.quartz.properties.org.quartz.threadPool.threadPriority=5 -spring.quartz.properties.org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread=true -spring.quartz.properties.org.quartz.threadPool.threadNamePrefix=quartz -spring.quartz.job-store-type=jdbc -#ALWAYS,EMBEDDED,NEVER -spring.quartz.jdbc.initialize-schema=NEVER -spring.quartz.jdbc.schema=classpath:sql/quartz_mysql_2.3.0.sql diff --git a/smart-admin-service/smart-admin-api/src/main/resources/prod/application.properties b/smart-admin-service/smart-admin-api/src/main/resources/prod/application.properties deleted file mode 100644 index 94f75be2..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/prod/application.properties +++ /dev/null @@ -1,120 +0,0 @@ -######################### server ################### -server.servlet.context-path=/smart-admin-api -server.port=10088 -spring.profiles.active=@profiles.active@ - -######################### tomcat ################### -server.tomcat.basedir=/home/logs/smart-admin/tomcat-logs -server.tomcat.accesslog.enabled=true -server.tomcat.accesslog.pattern=%t %{X-Forwarded-For}i %a "%r" %s %D (%D ms) - -######################### jackson ######################### -spring.jackson.serialization.write-enums-using-to-string=true -spring.jackson.deserialization.read-enums-using-to-string=true -spring.jackson.deserialization.fail-on-unknown-properties=false -spring.jackson.default-property-inclusion=always -spring.jackson.date-format=yyyy-MM-dd HH:mm:ss -spring.jackson.time-zone=GMT+8 -spring.jackson.serialization.write-dates-as-timestamps=false - -######################### http file ######################### -spring.servlet.multipart.max-file-size=30MB -spring.servlet.multipart.max-request-size=30MB -file-upload-service.path=/home/upload/smart-admin-file - -######################### database ######################### -spring.datasource.url=jdbc:mysql://172.16.0.201:3306/smart-admin-prod?autoReconnect=true&useServerPreparedStmts=false&rewriteBatchedStatements=true&characterEncoding=UTF-8&useSSL=false&allowMultiQueries=true -spring.datasource.username=smart-admin -spring.datasource.password=Admin@123457 -spring.datasource.initial-size=2 -spring.datasource.min-idle=1 -spring.datasource.max-active=100 -spring.datasource.max-wait=60000 -spring.datasource.time-between-eviction-runs-millis=60000 -spring.datasource.min-evictable-idle-time-millis=300000 -spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver -spring.datasource.filters=stat -spring.datasource.druid.username=druid -spring.datasource.druid.password=druid -spring.datasource.druid.login.enabled=false - -######################### redis ####################################### -spring.redis.database=13 -spring.redis.host=127.0.0.1 -spring.redis.port=6379 -spring.redis.timeout=10000ms -spring.redis.password=Gq123456@ -spring.redis.lettuce.pool.max-active=10 -spring.redis.lettuce.pool.min-idle=5 -spring.redis.lettuce.pool.max-idle=10 -spring.redis.lettuce.pool.max-wait=30000ms - -########################## rest http pool ######################### -#\u6700\u5927\u8FDE\u63A5\u6570 -http.pool.max-total=10 -#\u5355\u8DEF\u7531\u6700\u5927\u8FDE\u63A5\u6570 -http.pool.default-max-per-route=5 -#\u670D\u52A1\u5668\u8FD4\u56DE\u6570\u636E(response)\u7684\u65F6\u95F4 -http.pool.socket-timeout=8000 -#\u8FDE\u63A5\u4E0A\u670D\u52A1\u5668(\u63E1\u624B\u6210\u529F)\u7684\u65F6\u95F4 -http.pool.connect-timeout=8000 -#\u4ECE\u8FDE\u63A5\u6C60\u4E2D\u83B7\u53D6\u8FDE\u63A5\u7684\u8D85\u65F6\u65F6\u95F4 -http.pool.connection-request-timeout=8000 - -######################### mybatis\u914D\u7F6E ######################### -mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl -# mybatis-plus \u5B57\u6BB5\u9A7C\u5CF0\u81EA\u52A8\u8F6C\u6362 -mybatis-plus.configuration.map-underscore-to-camel-case=true -mybatis-plus.mapper-locations=classpath:/mapper/**/*.xml -mybatis-plus.typeAliasesPackage=net.lab1024.smartadmin.*.*.domain.entity -mybatis-plus.global-config.refresh-mapper=true -mybatis-plus.global-config.db-column-underline=true - -######################### swagger ######################### -swagger.apiGroupName=smartAdmin -swagger.title=smartAdmin -swagger.description=smartAdmin -swagger.version=1.0 -swagger.serviceUrl=http://localhost:10086/smart-admin-api -swagger.packAge=net.lab1024.smartadmin.module - -######################### jwt ######################### -jwt.key=smart-admin-jwt-key - -########################## smart reload ######################### -smart-reload.thread-count=2 -smart-reload.time-interval=30 -######################### cros ######################### -access-control-allow-origin=preview.smartadmin.1024lab.net -######################### heart beat ######################### -heart-beat.delayHandlerTime=60000 -heart-beat.intervalTime=60000 - -######################### quartz ############################# -#\u8C03\u5EA6\u6807\u8BC6\u540D \u96C6\u7FA4\u4E2D\u6BCF\u4E00\u4E2A\u5B9E\u4F8B\u90FD\u5FC5\u987B\u4F7F\u7528\u76F8\u540C\u7684\u540D\u79F0 -spring.quartz.properties.org.quartz.scheduler.instanceName=prodClusteredScheduler -spring.quartz.properties.org.quartz.scheduler.instanceId=AUTO -#\u8FDC\u7A0B\u7BA1\u7406\u76F8\u5173\u7684\u914D\u7F6E,\u5168\u90E8\u5173\u95ED -spring.quartz.properties.org.quartz.scheduler.rmi.export=false -spring.quartz.properties.org.quartz.scheduler.rmi.proxy=false -#\u8DF3\u8FC7quartz\u7248\u672C\u68C0\u67E5 -spring.quartz.properties.org.quartz.scheduler.skipUpdateCheck=true -#\u6570\u636E\u4FDD\u5B58\u65B9\u5F0F\u4E3A\u6301\u4E45\u5316 -spring.quartz.properties.org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreTX -spring.quartz.properties.org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.StdJDBCDelegate -spring.quartz.properties.org.quartz.jobStore.tablePrefix=QRTZ_ -spring.quartz.properties.org.quartz.jobStore.isClustered=true -#\u8C03\u5EA6\u5B9E\u4F8B\u5931\u6548\u7684\u68C0\u67E5\u65F6\u95F4\u95F4\u9694 -spring.quartz.properties.org.quartz.jobStore.clusterCheckinInterval=10000 -spring.quartz.properties.org.quartz.jobStore.useProperties=false -#\u8C03\u5EA6\u7EBF\u7A0B -spring.quartz.properties.org.quartz.threadPool.class=org.quartz.simpl.SimpleThreadPool -spring.quartz.properties.org.quartz.threadPool.threadCount=2 -spring.quartz.properties.org.quartz.threadPool.threadPriority=5 -spring.quartz.properties.org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread=true -spring.quartz.properties.org.quartz.threadPool.threadNamePrefix=quartz - -spring.quartz.job-store-type=jdbc -#ALWAYS,EMBEDDED,NEVER -spring.quartz.jdbc.initialize-schema=NEVER -spring.quartz.jdbc.schema=classpath:sql/quartz_mysql_2.3.0.sql diff --git a/smart-admin-service/smart-admin-api/src/main/resources/sit/application.properties b/smart-admin-service/smart-admin-api/src/main/resources/sit/application.properties deleted file mode 100644 index c7c426cf..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/sit/application.properties +++ /dev/null @@ -1,121 +0,0 @@ -######################### server ################### -server.servlet.context-path=/smart-admin-api -server.port=10086 -spring.profiles.active=@profiles.active@ - -######################### tomcat ################### -server.tomcat.basedir=/home/logs/smart-admin/tomcat-logs -server.tomcat.accesslog.enabled=true -server.tomcat.accesslog.pattern=%t %{X-Forwarded-For}i %a "%r" %s %D (%D ms) - -######################### jackson ######################### -spring.jackson.serialization.write-enums-using-to-string=true -spring.jackson.deserialization.read-enums-using-to-string=true -spring.jackson.deserialization.fail-on-unknown-properties=false -spring.jackson.default-property-inclusion=always -spring.jackson.date-format=yyyy-MM-dd HH:mm:ss -spring.jackson.time-zone=GMT+8 -spring.jackson.serialization.write-dates-as-timestamps=false - -######################### http file ######################### -spring.servlet.multipart.max-file-size=30MB -spring.servlet.multipart.max-request-size=30MB -file-upload-service.path=/home/upload/ - -######################### database ######################### -spring.datasource.url=jdbc:p6spy:mysql://127.0.0.1:3306/smart-admin-sit?autoReconnect=true&useServerPreparedStmts=false&rewriteBatchedStatements=true&characterEncoding=UTF-8&useSSL=false&allowMultiQueries=true&serverTimezone=UTC -spring.datasource.username=root -spring.datasource.password=root -spring.datasource.initial-size=2 -spring.datasource.min-idle=1 -spring.datasource.max-active=10 -spring.datasource.max-wait=60000 -spring.datasource.time-between-eviction-runs-millis=60000 -spring.datasource.min-evictable-idle-time-millis=300000 -spring.datasource.driver-class-name=com.p6spy.engine.spy.P6SpyDriver -spring.datasource.filters=stat -spring.datasource.druid.username=druid -spring.datasource.druid.password=123456 -spring.datasource.druid.login.enabled=false - -######################### redis ####################################### -spring.redis.database=0 -spring.redis.host=127.0.0.1 -spring.redis.port=6379 -spring.redis.timeout=10000ms -spring.redis.password= -spring.redis.lettuce.pool.max-active=10 -spring.redis.lettuce.pool.min-idle=5 -spring.redis.lettuce.pool.max-idle=10 -spring.redis.lettuce.pool.max-wait=30000ms - -########################## rest http pool ######################### -#\u6700\u5927\u8FDE\u63A5\u6570 -http.pool.max-total=10 -#\u5355\u8DEF\u7531\u6700\u5927\u8FDE\u63A5\u6570 -http.pool.default-max-per-route=5 -#\u670D\u52A1\u5668\u8FD4\u56DE\u6570\u636E(response)\u7684\u65F6\u95F4 -http.pool.socket-timeout=8000 -#\u8FDE\u63A5\u4E0A\u670D\u52A1\u5668(\u63E1\u624B\u6210\u529F)\u7684\u65F6\u95F4 -http.pool.connect-timeout=8000 -#\u4ECE\u8FDE\u63A5\u6C60\u4E2D\u83B7\u53D6\u8FDE\u63A5\u7684\u8D85\u65F6\u65F6\u95F4 -http.pool.connection-request-timeout=8000 - -######################### mybatis\u914D\u7F6E ######################### -mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl -# mybatis-plus \u5B57\u6BB5\u9A7C\u5CF0\u81EA\u52A8\u8F6C\u6362 -mybatis-plus.configuration.map-underscore-to-camel-case=true -mybatis-plus.mapper-locations=classpath:/mapper/**/*.xml -mybatis-plus.typeAliasesPackage=net.lab1024.smartadmin.*.*.domain.entity -mybatis-plus.global-config.refresh-mapper=true -mybatis-plus.global-config.db-column-underline=true - -######################### swagger ######################### -swagger.apiGroupName=smartAdmin -swagger.title=smartAdmin -swagger.description=smartAdmin -swagger.version=1.0 -swagger.serviceUrl=http://localhost:10086/smart-admin-api -swagger.packAge=net.lab1024.smartadmin.module - -######################### jwt ######################### -jwt.key=smart-admin-jwt-key - -########################## smart reload ######################### -smart-reload.thread-count=1 -smart-reload.time-interval=120 - -######################### cros ######################### -access-control-allow-origin=* - -######################### heart beat ######################### -heart-beat.delayHandlerTime=60000 -heart-beat.intervalTime=300000 - -######################### quartz ############################# -#\u8C03\u5EA6\u6807\u8BC6\u540D \u96C6\u7FA4\u4E2D\u6BCF\u4E00\u4E2A\u5B9E\u4F8B\u90FD\u5FC5\u987B\u4F7F\u7528\u76F8\u540C\u7684\u540D\u79F0 -spring.quartz.properties.org.quartz.scheduler.instanceName=devClusteredScheduler -spring.quartz.properties.org.quartz.scheduler.instanceId=AUTO -#\u8FDC\u7A0B\u7BA1\u7406\u76F8\u5173\u7684\u914D\u7F6E,\u5168\u90E8\u5173\u95ED -spring.quartz.properties.org.quartz.scheduler.rmi.export=false -spring.quartz.properties.org.quartz.scheduler.rmi.proxy=false -#\u8DF3\u8FC7quartz\u7248\u672C\u68C0\u67E5 -spring.quartz.properties.org.quartz.scheduler.skipUpdateCheck=true -#\u6570\u636E\u4FDD\u5B58\u65B9\u5F0F\u4E3A\u6301\u4E45\u5316 -spring.quartz.properties.org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreTX -spring.quartz.properties.org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.StdJDBCDelegate -spring.quartz.properties.org.quartz.jobStore.tablePrefix=QRTZ_ -spring.quartz.properties.org.quartz.jobStore.isClustered=true -#\u8C03\u5EA6\u5B9E\u4F8B\u5931\u6548\u7684\u68C0\u67E5\u65F6\u95F4\u95F4\u9694 -spring.quartz.properties.org.quartz.jobStore.clusterCheckinInterval=10000 -spring.quartz.properties.org.quartz.jobStore.useProperties=false -#\u8C03\u5EA6\u7EBF\u7A0B -spring.quartz.properties.org.quartz.threadPool.class=org.quartz.simpl.SimpleThreadPool -spring.quartz.properties.org.quartz.threadPool.threadCount=2 -spring.quartz.properties.org.quartz.threadPool.threadPriority=5 -spring.quartz.properties.org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread=true -spring.quartz.properties.org.quartz.threadPool.threadNamePrefix=quartz -spring.quartz.job-store-type=jdbc -#ALWAYS,EMBEDDED,NEVER -spring.quartz.jdbc.initialize-schema=NEVER -spring.quartz.jdbc.schema=classpath:sql/quartz_mysql_2.3.0.sql diff --git a/smart-admin-service/smart-admin-api/src/main/resources/sit/spy.properties b/smart-admin-service/smart-admin-api/src/main/resources/sit/spy.properties deleted file mode 100644 index 22c91d1e..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/sit/spy.properties +++ /dev/null @@ -1,20 +0,0 @@ -#modulelist=com.baomidou.mybatisplus.extension.p6spy.MybatisPlusLogFactory -# \u81EA\u5B9A\u4E49\u65E5\u5FD7\u6253\u5370 -logMessageFormat=com.baomidou.mybatisplus.extension.p6spy.P6SpyLogger -#\u65E5\u5FD7\u8F93\u51FA\u5230\u63A7\u5236\u53F0 -appender=com.baomidou.mybatisplus.extension.p6spy.StdoutLogger -# \u4F7F\u7528\u65E5\u5FD7\u7CFB\u7EDF\u8BB0\u5F55 sql -#appender=com.p6spy.engine.spy.appender.Slf4JLogger -# \u8BBE\u7F6E p6spy driver \u4EE3\u7406 -deregisterdrivers=true -# \u53D6\u6D88JDBC URL\u524D\u7F00 -useprefix=true -# \u914D\u7F6E\u8BB0\u5F55 Log \u4F8B\u5916,\u53EF\u53BB\u6389\u7684\u7ED3\u679C\u96C6\u6709error,info,batch,debug,statement,commit,rollback,result,resultset. -#excludecategories=info,debug,result,commit,resultset -# \u65E5\u671F\u683C\u5F0F -dateformat=yyyy-MM-dd HH:mm:ss - -# \u662F\u5426\u5F00\u542F\u6162SQL\u8BB0\u5F55 -outagedetection=true -# \u6162SQL\u8BB0\u5F55\u6807\u51C6 2 \u79D2 -outagedetectioninterval=2 \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/resources/sql/quartz_mysql_2.3.0.sql b/smart-admin-service/smart-admin-api/src/main/resources/sql/quartz_mysql_2.3.0.sql deleted file mode 100644 index 8968c23f..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/sql/quartz_mysql_2.3.0.sql +++ /dev/null @@ -1,179 +0,0 @@ -# -# In your Quartz properties file, you'll need to set -# org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate -# -# -# By: Ron Cordell - roncordell -# I didn't see this anywhere, so I thought I'd post it here. This is the script from Quartz to create the tables in a MySQL database, modified to use INNODB instead of MYISAM. - -DROP TABLE IF EXISTS QRTZ_FIRED_TRIGGERS; -DROP TABLE IF EXISTS QRTZ_PAUSED_TRIGGER_GRPS; -DROP TABLE IF EXISTS QRTZ_SCHEDULER_STATE; -DROP TABLE IF EXISTS QRTZ_LOCKS; -DROP TABLE IF EXISTS QRTZ_SIMPLE_TRIGGERS; -DROP TABLE IF EXISTS QRTZ_SIMPROP_TRIGGERS; -DROP TABLE IF EXISTS QRTZ_CRON_TRIGGERS; -DROP TABLE IF EXISTS QRTZ_BLOB_TRIGGERS; -DROP TABLE IF EXISTS QRTZ_TRIGGERS; -DROP TABLE IF EXISTS QRTZ_JOB_DETAILS; -DROP TABLE IF EXISTS QRTZ_CALENDARS; - -CREATE TABLE QRTZ_JOB_DETAILS( -SCHED_NAME VARCHAR(120) NOT NULL, -JOB_NAME VARCHAR(190) NOT NULL, -JOB_GROUP VARCHAR(190) NOT NULL, -DESCRIPTION VARCHAR(250) NULL, -JOB_CLASS_NAME VARCHAR(250) NOT NULL, -IS_DURABLE VARCHAR(1) NOT NULL, -IS_NONCONCURRENT VARCHAR(1) NOT NULL, -IS_UPDATE_DATA VARCHAR(1) NOT NULL, -REQUESTS_RECOVERY VARCHAR(1) NOT NULL, -JOB_DATA BLOB NULL, -PRIMARY KEY (SCHED_NAME,JOB_NAME,JOB_GROUP)) -ENGINE=InnoDB; - -CREATE TABLE QRTZ_TRIGGERS ( -SCHED_NAME VARCHAR(120) NOT NULL, -TRIGGER_NAME VARCHAR(190) NOT NULL, -TRIGGER_GROUP VARCHAR(190) NOT NULL, -JOB_NAME VARCHAR(190) NOT NULL, -JOB_GROUP VARCHAR(190) NOT NULL, -DESCRIPTION VARCHAR(250) NULL, -NEXT_FIRE_TIME BIGINT(13) NULL, -PREV_FIRE_TIME BIGINT(13) NULL, -PRIORITY INTEGER NULL, -TRIGGER_STATE VARCHAR(16) NOT NULL, -TRIGGER_TYPE VARCHAR(8) NOT NULL, -START_TIME BIGINT(13) NOT NULL, -END_TIME BIGINT(13) NULL, -CALENDAR_NAME VARCHAR(190) NULL, -MISFIRE_INSTR SMALLINT(2) NULL, -JOB_DATA BLOB NULL, -PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), -FOREIGN KEY (SCHED_NAME,JOB_NAME,JOB_GROUP) -REFERENCES QRTZ_JOB_DETAILS(SCHED_NAME,JOB_NAME,JOB_GROUP)) -ENGINE=InnoDB; - -CREATE TABLE QRTZ_SIMPLE_TRIGGERS ( -SCHED_NAME VARCHAR(120) NOT NULL, -TRIGGER_NAME VARCHAR(190) NOT NULL, -TRIGGER_GROUP VARCHAR(190) NOT NULL, -REPEAT_COUNT BIGINT(7) NOT NULL, -REPEAT_INTERVAL BIGINT(12) NOT NULL, -TIMES_TRIGGERED BIGINT(10) NOT NULL, -PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), -FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) -REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)) -ENGINE=InnoDB; - -CREATE TABLE QRTZ_CRON_TRIGGERS ( -SCHED_NAME VARCHAR(120) NOT NULL, -TRIGGER_NAME VARCHAR(190) NOT NULL, -TRIGGER_GROUP VARCHAR(190) NOT NULL, -CRON_EXPRESSION VARCHAR(120) NOT NULL, -TIME_ZONE_ID VARCHAR(80), -PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), -FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) -REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)) -ENGINE=InnoDB; - -CREATE TABLE QRTZ_SIMPROP_TRIGGERS - ( - SCHED_NAME VARCHAR(120) NOT NULL, - TRIGGER_NAME VARCHAR(190) NOT NULL, - TRIGGER_GROUP VARCHAR(190) NOT NULL, - STR_PROP_1 VARCHAR(512) NULL, - STR_PROP_2 VARCHAR(512) NULL, - STR_PROP_3 VARCHAR(512) NULL, - INT_PROP_1 INT NULL, - INT_PROP_2 INT NULL, - LONG_PROP_1 BIGINT NULL, - LONG_PROP_2 BIGINT NULL, - DEC_PROP_1 NUMERIC(13,4) NULL, - DEC_PROP_2 NUMERIC(13,4) NULL, - BOOL_PROP_1 VARCHAR(1) NULL, - BOOL_PROP_2 VARCHAR(1) NULL, - PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), - FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) - REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)) -ENGINE=InnoDB; - -CREATE TABLE QRTZ_BLOB_TRIGGERS ( -SCHED_NAME VARCHAR(120) NOT NULL, -TRIGGER_NAME VARCHAR(190) NOT NULL, -TRIGGER_GROUP VARCHAR(190) NOT NULL, -BLOB_DATA BLOB NULL, -PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), -INDEX (SCHED_NAME,TRIGGER_NAME, TRIGGER_GROUP), -FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) -REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)) -ENGINE=InnoDB; - -CREATE TABLE QRTZ_CALENDARS ( -SCHED_NAME VARCHAR(120) NOT NULL, -CALENDAR_NAME VARCHAR(190) NOT NULL, -CALENDAR BLOB NOT NULL, -PRIMARY KEY (SCHED_NAME,CALENDAR_NAME)) -ENGINE=InnoDB; - -CREATE TABLE QRTZ_PAUSED_TRIGGER_GRPS ( -SCHED_NAME VARCHAR(120) NOT NULL, -TRIGGER_GROUP VARCHAR(190) NOT NULL, -PRIMARY KEY (SCHED_NAME,TRIGGER_GROUP)) -ENGINE=InnoDB; - -CREATE TABLE QRTZ_FIRED_TRIGGERS ( -SCHED_NAME VARCHAR(120) NOT NULL, -ENTRY_ID VARCHAR(95) NOT NULL, -TRIGGER_NAME VARCHAR(190) NOT NULL, -TRIGGER_GROUP VARCHAR(190) NOT NULL, -INSTANCE_NAME VARCHAR(190) NOT NULL, -FIRED_TIME BIGINT(13) NOT NULL, -SCHED_TIME BIGINT(13) NOT NULL, -PRIORITY INTEGER NOT NULL, -STATE VARCHAR(16) NOT NULL, -JOB_NAME VARCHAR(190) NULL, -JOB_GROUP VARCHAR(190) NULL, -IS_NONCONCURRENT VARCHAR(1) NULL, -REQUESTS_RECOVERY VARCHAR(1) NULL, -PRIMARY KEY (SCHED_NAME,ENTRY_ID)) -ENGINE=InnoDB; - -CREATE TABLE QRTZ_SCHEDULER_STATE ( -SCHED_NAME VARCHAR(120) NOT NULL, -INSTANCE_NAME VARCHAR(190) NOT NULL, -LAST_CHECKIN_TIME BIGINT(13) NOT NULL, -CHECKIN_INTERVAL BIGINT(13) NOT NULL, -PRIMARY KEY (SCHED_NAME,INSTANCE_NAME)) -ENGINE=InnoDB; - -CREATE TABLE QRTZ_LOCKS ( -SCHED_NAME VARCHAR(120) NOT NULL, -LOCK_NAME VARCHAR(40) NOT NULL, -PRIMARY KEY (SCHED_NAME,LOCK_NAME)) -ENGINE=InnoDB; - -CREATE INDEX IDX_QRTZ_J_REQ_RECOVERY ON QRTZ_JOB_DETAILS(SCHED_NAME,REQUESTS_RECOVERY); -CREATE INDEX IDX_QRTZ_J_GRP ON QRTZ_JOB_DETAILS(SCHED_NAME,JOB_GROUP); - -CREATE INDEX IDX_QRTZ_T_J ON QRTZ_TRIGGERS(SCHED_NAME,JOB_NAME,JOB_GROUP); -CREATE INDEX IDX_QRTZ_T_JG ON QRTZ_TRIGGERS(SCHED_NAME,JOB_GROUP); -CREATE INDEX IDX_QRTZ_T_C ON QRTZ_TRIGGERS(SCHED_NAME,CALENDAR_NAME); -CREATE INDEX IDX_QRTZ_T_G ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_GROUP); -CREATE INDEX IDX_QRTZ_T_STATE ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_STATE); -CREATE INDEX IDX_QRTZ_T_N_STATE ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP,TRIGGER_STATE); -CREATE INDEX IDX_QRTZ_T_N_G_STATE ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_GROUP,TRIGGER_STATE); -CREATE INDEX IDX_QRTZ_T_NEXT_FIRE_TIME ON QRTZ_TRIGGERS(SCHED_NAME,NEXT_FIRE_TIME); -CREATE INDEX IDX_QRTZ_T_NFT_ST ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_STATE,NEXT_FIRE_TIME); -CREATE INDEX IDX_QRTZ_T_NFT_MISFIRE ON QRTZ_TRIGGERS(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME); -CREATE INDEX IDX_QRTZ_T_NFT_ST_MISFIRE ON QRTZ_TRIGGERS(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_STATE); -CREATE INDEX IDX_QRTZ_T_NFT_ST_MISFIRE_GRP ON QRTZ_TRIGGERS(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_GROUP,TRIGGER_STATE); - -CREATE INDEX IDX_QRTZ_FT_TRIG_INST_NAME ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,INSTANCE_NAME); -CREATE INDEX IDX_QRTZ_FT_INST_JOB_REQ_RCVRY ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,INSTANCE_NAME,REQUESTS_RECOVERY); -CREATE INDEX IDX_QRTZ_FT_J_G ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,JOB_NAME,JOB_GROUP); -CREATE INDEX IDX_QRTZ_FT_JG ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,JOB_GROUP); -CREATE INDEX IDX_QRTZ_FT_T_G ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP); -CREATE INDEX IDX_QRTZ_FT_TG ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,TRIGGER_GROUP); - -commit; diff --git a/smart-admin-service/smart-admin-api/src/main/resources/sql/smart-admin.sql b/smart-admin-service/smart-admin-api/src/main/resources/sql/smart-admin.sql deleted file mode 100644 index dfd8e8c1..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/sql/smart-admin.sql +++ /dev/null @@ -1,1588 +0,0 @@ --- -------------------------------------------------------- --- 主机: 127.0.0.1 --- 服务器版本: 8.0.20 - MySQL Community Server - GPL --- 服务器操作系统: Win64 --- HeidiSQL 版本: 11.0.0.5919 --- -------------------------------------------------------- - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET NAMES utf8 */; -/*!50503 SET NAMES utf8mb4 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; - - --- 导出 smart-admin-dev 的数据库结构 -DROP DATABASE IF EXISTS `smart-admin-dev`; -CREATE DATABASE IF NOT EXISTS `smart-admin-dev` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci */ /*!80016 DEFAULT ENCRYPTION='N' */; -USE `smart-admin-dev`; - --- 导出 表 smart-admin-dev.t_department 结构 -DROP TABLE IF EXISTS `t_department`; -CREATE TABLE IF NOT EXISTS `t_department` ( - `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '部门主键id', - `name` varchar(50) NOT NULL COMMENT '部门名称', - `short_name` varchar(50) DEFAULT NULL COMMENT '部门简称', - `manager_id` int unsigned DEFAULT NULL COMMENT '部门负责人id', - `parent_id` int unsigned DEFAULT NULL COMMENT '部门的父级id', - `sort` int NOT NULL COMMENT '部门排序', - `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - PRIMARY KEY (`id`), - KEY `parent_id` (`parent_id`) -) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='部门表'; - --- 正在导出表 smart-admin-dev.t_department 的数据:~4 rows (大约) -DELETE FROM `t_department`; -/*!40000 ALTER TABLE `t_department` DISABLE KEYS */; -INSERT INTO `t_department` (`id`, `name`, `short_name`, `manager_id`, `parent_id`, `sort`, `update_time`, `create_time`) VALUES - (1, '1024创新实验室', 'ZWGWL', 16, 0, 1, '2019-04-03 10:41:25', '2019-04-03 10:41:25'), - (2, '二级部门-2', NULL, 15, 1, 17, '2019-04-15 16:45:10', '2019-04-15 16:45:10'), - (4, '二级部门-1', '管理', 14, 1, 20, '2019-04-17 16:14:55', '2019-04-17 16:14:55'), - (8, '三级部门-1', NULL, NULL, 4, 8, '2019-04-25 12:25:52', '2019-04-25 12:25:52'), - (9, '四级部门-1', NULL, NULL, 8, 9, '2019-04-25 12:26:36', '2019-04-25 12:26:36'), - (10, '五级部门-1', NULL, NULL, 9, 10, '2019-04-25 12:26:49', '2019-04-25 12:26:49'), - (11, '六级部门-1', NULL, NULL, 10, 11, '2019-04-25 12:26:59', '2019-04-25 12:26:59'), - (12, '七级部门-1', NULL, NULL, 11, 12, '2019-04-25 12:27:18', '2019-04-25 12:27:18'), - (13, '八级部门-1', NULL, NULL, 12, 13, '2019-04-25 12:27:34', '2019-04-25 12:27:34'), - (14, '九级部门-1', NULL, NULL, 13, 14, '2019-04-25 12:27:47', '2019-04-25 12:27:47'), - (15, '十级部门-1', NULL, NULL, 14, 15, '2019-04-25 12:28:16', '2019-04-25 12:28:16'), - (16, '十一级部门部门部部门门嘻嘻哈哈-1', NULL, 13, 15, 16, '2019-04-25 14:56:40', '2019-04-25 14:56:40'), - (17, '信息中心', NULL, 16, 1, 4, '2019-04-26 11:53:50', '2019-04-26 11:53:50'), - (18, '测试部门', NULL, 16, 17, 18, '2019-04-26 11:54:06', '2019-04-26 11:54:06'), - (19, '张娇测试', NULL, NULL, 2, 22, '2019-04-26 14:36:18', '2019-04-26 14:36:18'), - (20, '子部门', NULL, NULL, 2, 23, '2019-04-26 14:36:28', '2019-04-26 14:36:28'), - (22, '张静如', NULL, 16, 1, 2, '2019-04-28 14:21:44', '2019-04-28 14:21:44'), - (23, '张静如2', NULL, 22, 4, 19, '2019-04-28 14:22:48', '2019-04-28 14:22:48'), - (24, '测试', NULL, 18, 23, 24, '2019-04-29 10:12:42', '2019-04-29 10:12:42'), - (25, '测试', NULL, 18, 23, 25, '2019-04-29 10:12:42', '2019-04-29 10:12:42'); -/*!40000 ALTER TABLE `t_department` ENABLE KEYS */; - --- 导出 表 smart-admin-dev.t_email 结构 -DROP TABLE IF EXISTS `t_email`; -CREATE TABLE IF NOT EXISTS `t_email` ( - `id` int NOT NULL AUTO_INCREMENT, - `title` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '标题', - `to_emails` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '收件人', - `send_status` tinyint NOT NULL DEFAULT '0' COMMENT '发送状态 0未发送 1已发送', - `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '邮件内容', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=87 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; - --- 正在导出表 smart-admin-dev.t_email 的数据:~56 rows (大约) -DELETE FROM `t_email`; -/*!40000 ALTER TABLE `t_email` DISABLE KEYS */; -INSERT INTO `t_email` (`id`, `title`, `to_emails`, `send_status`, `content`, `create_time`, `update_time`) VALUES - (20, '新增测试12345', '新增测试@11.com', 1, '

这是内容

', '2019-08-30 15:35:12', '2019-08-30 15:35:12'), - (21, 'b', 'asdf@33.com', 1, '

c

', '2019-09-06 14:25:33', '2019-09-06 14:25:33'), - (23, 'string', 'string', 0, 'string', '2019-09-06 06:55:01', '2019-09-06 06:55:01'), - (24, 'string', 'string', 0, 'string', '2019-09-06 06:55:01', '2019-09-06 06:55:01'), - (26, 'string', 'string', 0, 'string', '2019-09-06 07:01:32', '2019-09-06 07:01:32'), - (27, 'string', 'string', 0, 'string', '2019-09-06 07:01:32', '2019-09-06 07:01:32'), - (37, 'ewqwe', '适者生存@22.cc', 1, '

qweqwe

', '2019-11-09 10:00:46', '2019-11-09 10:00:46'), - (38, 'ewqwe', '适者生存@22.cc', 1, '

qweqwe

', '2019-11-09 10:00:49', '2019-11-09 10:00:49'), - (39, 'dsfds', 'dsfsd@qq.ccc', 1, '

fsdfs

', '2019-11-09 10:04:54', '2019-11-09 10:04:54'), - (40, 'dsfds', 'dsfsd@qq.ccc', 1, '

fsdfs

', '2019-11-09 10:04:57', '2019-11-09 10:04:57'), - (41, 'dsfds', 'dsfsd@qq.ccc', 1, '

fsdfs

', '2019-11-09 10:04:57', '2019-11-09 10:04:57'), - (42, 'dsfds', 'dsfsd@qq.ccc', 1, '

fsdfs

', '2019-11-09 10:04:58', '2019-11-09 10:04:58'), - (43, 'dsfds', 'dsfsd@qq.ccc', 1, '

fsdfs

', '2019-11-09 10:04:59', '2019-11-09 10:04:59'), - (44, 'dsfds', 'dsfsd@qq.ccc', 1, '

fsdfs

', '2019-11-09 10:04:59', '2019-11-09 10:04:59'), - (45, 'dsfds', 'dsfsd@qq.ccc', 1, '

fsdfs

', '2019-11-09 10:05:16', '2019-11-09 10:05:16'), - (46, 'dsfds', 'dsfsd@qq.ccc', 1, '

fsdfs

', '2019-11-09 10:06:29', '2019-11-09 10:06:29'), - (47, 'dsfds', 'dsfsd@qq.ccc', 1, '

fsdfs

', '2019-11-09 10:07:02', '2019-11-09 10:07:02'), - (48, 'dsfds', 'dsfsd@qq.ccc', 1, '

fsdfs

', '2019-11-09 10:07:16', '2019-11-09 10:07:16'), - (49, '2342', '11@ss.cc', 1, '

234234

', '2019-11-09 10:08:13', '2019-11-09 10:08:13'), - (50, '2342', '11@ss.cc', 1, '

234234

', '2019-11-09 10:08:30', '2019-11-09 10:08:30'), - (51, '2342', '11@ss.cc', 1, '

234234

', '2019-11-09 10:08:50', '2019-11-09 10:08:50'), - (52, '2342', '11@ss.cc', 1, '

234234

', '2019-11-09 10:09:09', '2019-11-09 10:09:09'), - (53, '2342', '11@ss.cc', 1, '

234234

', '2019-11-09 10:09:31', '2019-11-09 10:09:31'), - (54, '2342', '11@ss.cc', 1, '

234234

', '2019-11-09 10:12:24', '2019-11-09 10:12:24'), - (55, '2342', '11@ss.cc', 1, '

234234

', '2019-11-09 10:13:13', '2019-11-09 10:13:13'), - (56, 'asdasd', '3423@aqq.cc', 0, '

asdasd

', '2019-11-09 10:20:42', '2019-11-09 10:20:42'), - (57, 'asdasd', '3423@aqq.cc', 0, '

asdasd

', '2019-11-09 10:20:52', '2019-11-09 10:20:52'), - (58, 'asdasd', '3423@aqq.cc', 0, '

asdasd

', '2019-11-09 10:21:16', '2019-11-09 10:21:16'), - (59, 'asdasd', '3423@aqq.cc', 0, '

asdasd

', '2019-11-09 10:21:24', '2019-11-09 10:21:24'), - (60, 'asdasd', '3423@aqq.cc', 0, '

asdasd

', '2019-11-09 10:21:30', '2019-11-09 10:21:30'), - (61, 'asdasd', '3423@aqq.cc', 0, '

asdasd

', '2019-11-09 10:21:53', '2019-11-09 10:21:53'), - (62, 'a21312', '23423@qq.cc', 0, '

asdasdas

', '2019-11-09 10:23:40', '2019-11-09 10:23:40'), - (63, '11', '1234@qq.com', 0, '

23

', '2019-11-15 15:35:12', '2019-11-15 15:35:12'), - (64, '11', '1234@qq.com', 0, '

23

', '2019-11-15 15:35:15', '2019-11-15 15:35:15'), - (65, '11', '1234@qq.com', 0, '

23

', '2019-11-15 15:35:16', '2019-11-15 15:35:16'), - (66, 'eeee', '1234@qq.com', 0, '

    eee2233

', '2019-11-15 17:00:00', '2019-11-15 17:00:00'), - (67, 'eeee', '1234@qq.com', 0, '

    eee2233

', '2019-11-15 17:00:03', '2019-11-15 17:00:03'), - (68, 'eeee', '1234@qq.com', 0, '

    eee2233

', '2019-11-15 17:00:04', '2019-11-15 17:00:04'), - (69, '22223', '1017146812@qq.com', 0, '

    e34233

', '2019-11-15 17:00:33', '2019-11-15 17:00:33'), - (70, '22223', '1017146812@qq.com', 0, '

    e34233

', '2019-11-15 17:00:34', '2019-11-15 17:00:34'), - (71, '22223', '1017146812@qq.com', 0, '

    e34233

', '2019-11-15 17:00:34', '2019-11-15 17:00:34'), - (72, '22223', '12232', 0, '

    e34233

', '2019-11-15 17:00:49', '2019-11-15 17:00:49'), - (73, '22223', '12232@qq.com', 0, '

    e34233

', '2019-11-15 17:00:56', '2019-11-15 17:00:56'), - (74, 'dsasdasd', 'asdas@qq.com', 0, '

asdasd

', '2019-11-16 08:51:44', '2019-11-16 08:51:44'), - (75, 'dsasdasd', 'asdas@qq.com', 0, '

asdasd

', '2019-11-16 09:05:10', '2019-11-16 09:05:10'), - (76, 'dsasdasd', 'asdas@qq.com', 0, '

asdasd

', '2019-11-16 09:05:14', '2019-11-16 09:05:14'), - (77, 'dsasdasd', 'asdas@qq.com', 0, '

asdasd

', '2019-11-16 09:06:34', '2019-11-16 09:06:34'), - (78, 'dsasdasd', 'asdas@qq.com', 0, '

asdasd

', '2019-11-16 09:07:09', '2019-11-16 09:07:09'), - (79, 'dsasdasd', 'asdas@qq.com', 0, '

asdasd

', '2019-11-16 09:07:30', '2019-11-16 09:07:30'), - (80, 'dsasdasd', 'asdas@qq.com', 0, '

asdasd

', '2019-11-16 09:07:32', '2019-11-16 09:07:32'), - (81, 'dsasdasd', 'asdas@qq.com', 0, '

asdasd

', '2019-11-16 09:08:29', '2019-11-16 09:08:29'), - (82, 'sdfs', 'ss@ss.cc', 0, '

dsdsf

', '2019-11-16 09:08:46', '2019-11-16 09:08:46'), - (83, 'asdasd', 'asd@qq.vv', 0, '

asdas

', '2019-11-16 09:09:18', '2019-11-16 09:09:18'), - (84, 'asdasd', 'asd@qq.vv', 0, '

asdas

', '2019-11-16 09:09:42', '2019-11-16 09:09:42'), - (85, 'asdasd', 'asd@qq.vv', 0, '

asdas

', '2019-11-16 09:09:46', '2019-11-16 09:09:46'), - (86, 'dasdad', 'dasda@ss.cc', 1, '

dasasdas

', '2019-11-16 09:10:05', '2019-11-16 09:10:05'); -/*!40000 ALTER TABLE `t_email` ENABLE KEYS */; - --- 导出 表 smart-admin-dev.t_employee 结构 -DROP TABLE IF EXISTS `t_employee`; -CREATE TABLE IF NOT EXISTS `t_employee` ( - `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', - `login_name` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '登录帐号', - `login_pwd` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '登录密码', - `actual_name` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '员工名称', - `nick_name` varchar(30) DEFAULT '' COMMENT '别名', - `phone` varchar(15) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '手机号码', - `id_card` varchar(18) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '身份证', - `birthday` date DEFAULT NULL COMMENT '出生日期', - `email` varchar(50) DEFAULT NULL COMMENT '邮箱', - `department_id` int unsigned NOT NULL COMMENT '部门id', - `is_leave` int NOT NULL DEFAULT '0' COMMENT '是否离职1是', - `is_disabled` int NOT NULL DEFAULT '0' COMMENT '是否被禁用 0否1是', - `remark` varchar(200) DEFAULT NULL COMMENT '备注', - `create_user` int unsigned NOT NULL COMMENT '创建者id', - `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `is_delete` int NOT NULL DEFAULT '0' COMMENT '是否删除0否 1是', - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='员工表'; - --- 正在导出表 smart-admin-dev.t_employee 的数据:~28 rows (大约) -DELETE FROM `t_employee`; -/*!40000 ALTER TABLE `t_employee` DISABLE KEYS */; -INSERT INTO `t_employee` (`id`, `login_name`, `login_pwd`, `actual_name`, `nick_name`, `phone`, `id_card`, `birthday`, `email`, `department_id`, `is_leave`, `is_disabled`, `remark`, `create_user`, `update_time`, `create_time`, `is_delete`) VALUES - (1, 'sa', 'c655798e4648c540812a1b8f48759af7', '管理员', '15515515515', '13112312131', '410306199202020020', '1992-02-02', NULL, 1, 0, 0, NULL, 0, '2019-04-27 09:56:17', '2018-05-11 09:38:54', 0), - (11, 'role1', 'c655798e4648c540812a1b8f48759af7', '角色测试1', '', '18123245230', '', '1970-01-01', '', 4, 0, 0, NULL, 1, '2019-04-27 09:56:17', '2019-04-25 12:30:22', 0), - (12, 'role2', 'c655798e4648c540812a1b8f48759af7', '角色测试2', '', '18121451241', '', NULL, '', 4, 0, 0, NULL, 1, '2019-08-01 10:04:38', '2019-04-25 12:31:11', 0), - (13, 'lihaifan', 'c655798e4648c540812a1b8f48759af7', 'lihaifan', '', '18399485774', '', NULL, '', 1, 0, 0, NULL, 1, '2019-04-27 09:56:17', '2019-04-25 13:50:44', 0), - (14, 'lipeng', 'c655798e4648c540812a1b8f48759af7', '李鹏1', '', '13937988294', '', NULL, '', 2, 0, 0, NULL, 1, '2019-04-27 09:56:17', '2019-04-25 14:34:47', 0), - (15, 'huangwenli', 'c655798e4648c540812a1b8f48759af7', '黄文丽', '', '15515515515', '', NULL, '', 16, 0, 0, NULL, 1, '2019-04-27 09:56:17', '2019-04-26 10:05:05', 0), - (16, 'huangwenli1', 'c655798e4648c540812a1b8f48759af7', '黄文丽', '', '15515515515', '', NULL, '', 15, 0, 0, NULL, 1, '2019-04-27 14:04:19', '2019-04-26 10:25:04', 0), - (17, 'zhangjiao', 'c655798e4648c540812a1b8f48759af7', '张娇', '阿娇', '15670390391', '410305199102020020', '1991-02-02', '86484@qq.com', 19, 0, 0, NULL, 1, '2019-08-05 16:33:57', '2019-04-26 14:37:23', 0), - (18, 'zhangjiao1', 'c655798e4648c540812a1b8f48759af7', '张娇1', '', '15670390391', '', '2019-04-18', '6666@qq.com', 20, 0, 0, NULL, 1, '2019-08-05 16:33:57', '2019-04-26 14:45:55', 0), - (19, 'zhenxiaocang', 'c655798e4648c540812a1b8f48759af7', '珍小藏', '', '15670390391', '', NULL, '', 19, 0, 1, NULL, 1, '2019-09-09 08:34:35', '2019-04-26 14:46:57', 0), - (20, 'matengfei', 'c655798e4648c540812a1b8f48759af7', '马腾飞', '', '15670390393', '', NULL, '', 19, 0, 0, NULL, 1, '2019-08-05 16:33:57', '2019-04-26 14:47:24', 0), - (21, 'ceshi123', 'c655798e4648c540812a1b8f48759af7', '测试人员', '', '18829938477', '', NULL, '', 1, 0, 1, NULL, 13, '2019-04-27 09:56:17', '2019-04-27 09:38:07', 1), - (22, 'zhangjingru', 'c655798e4648c540812a1b8f48759af7', '张静如', '', '15600000000', '', NULL, '', 1, 0, 0, NULL, 1, '2019-09-04 09:06:47', '2019-04-28 14:05:03', 0), - (23, 'sdfsdfdsfsdfdsfdsf', 'c655798e4648c540812a1b8f48759af7', 'werewr', '', '15698585858', '', NULL, '', 19, 0, 0, NULL, 1, '2019-09-05 16:13:03', '2019-04-28 16:26:27', 0), - (25, 'shq2019', 'c655798e4648c540812a1b8f48759af7', 'shq', 'shq', '18798801298', '410281199309024040', '1993-09-02', '', 17, 0, 0, NULL, 1, '2019-08-05 16:33:57', '2019-05-05 09:13:41', 0), - (26, 'zhangjiao666', 'c655798e4648c540812a1b8f48759af7', 'tom我是五个字12', '', '15612345678', '', NULL, '', 18, 0, 0, NULL, 1, '2019-08-05 16:33:57', '2019-05-05 15:34:10', 0), - (28, 'dfsfgds', 'c655798e4648c540812a1b8f48759af7', 'fds', '', '15854127845', '', NULL, '', 22, 0, 1, NULL, 1, '2019-09-06 08:58:40', '2019-05-06 10:36:57', 0), - (29, 'abcabc', 'c655798e4648c540812a1b8f48759af7', 'abccba', 'aaabac', '13311112222', '', NULL, '', 17, 0, 0, NULL, 1, '2019-08-05 16:33:57', '2019-07-10 17:00:58', 0), - (30, 'gengweigang', 'c655798e4648c540812a1b8f48759af7', '耿为刚', 'geng', '15038588418', '', NULL, '', 17, 0, 0, NULL, 1, '2019-08-08 14:35:51', '2019-08-08 14:35:51', 0), - (31, 'gengweigang1', 'c655798e4648c540812a1b8f48759af7', '耿为刚1', '这是别名', '15038588418', '410322193312123232', '1933-12-12', '32@qq.com', 18, 0, 0, NULL, 30, '2019-08-23 09:27:22', '2019-08-23 09:25:50', 0), - (32, 'ceshi123', 'c655798e4648c540812a1b8f48759af7', '测试', '测试', '15670702651', '', NULL, '', 17, 0, 0, NULL, 1, '2019-09-04 09:05:48', '2019-09-03 11:48:04', 0), - (33, 'ceshi321', 'c655798e4648c540812a1b8f48759af7', '测试', '测试', '15670702651', '', NULL, '', 17, 0, 1, NULL, 1, '2019-09-03 15:51:16', '2019-09-03 11:49:17', 0), - (34, 'ceshi123321', 'c655798e4648c540812a1b8f48759af7', '123', '', '15600000000', '', NULL, '', 22, 0, 1, NULL, 1, '2019-09-06 08:58:37', '2019-09-04 09:13:54', 0), - (35, 'guoqingfeng', 'c655798e4648c540812a1b8f48759af7', '郭青枫', '', '15670702651', '', NULL, '', 18, 0, 0, NULL, 1, '2019-09-04 15:09:00', '2019-09-04 15:09:00', 0), - (36, 'li327263458', 'c655798e4648c540812a1b8f48759af7', 'lipeng', '', '13937988294', '', NULL, '', 17, 0, 0, NULL, 1, '2019-09-09 17:01:39', '2019-09-09 17:01:39', 0), - (37, 'test123', 'c655798e4648c540812a1b8f48759af7', 'test', '', '13211110201', '', NULL, '', 18, 0, 1, NULL, 1, '2019-11-14 16:08:08', '2019-11-08 09:32:39', 0), - (38, 'tiantian', 'c655798e4648c540812a1b8f48759af7', '天天管理员', '', '13574502368', '', NULL, '', 17, 0, 0, NULL, 1, '2019-11-14 02:08:08', '2019-11-08 11:09:46', 0), - (39, 'wang13211111', 'c655798e4648c540812a1b8f48759af7', 'ceshi111', 'dddd', '13244553212', '', NULL, '', 25, 0, 0, NULL, 38, '2019-11-15 17:14:34', '2019-11-15 17:03:04', 0); -/*!40000 ALTER TABLE `t_employee` ENABLE KEYS */; - --- 导出 表 smart-admin-dev.t_file 结构 -DROP TABLE IF EXISTS `t_file`; -CREATE TABLE IF NOT EXISTS `t_file` ( - `id` int NOT NULL AUTO_INCREMENT COMMENT '主键ID', - `module_id` varchar(50) NOT NULL COMMENT '相关业务id', - `module_type` varchar(50) NOT NULL COMMENT '相关业务类型', - `file_name` varchar(255) DEFAULT NULL COMMENT '文件名称', - `file_size` varchar(255) DEFAULT NULL COMMENT '文件大小', - `file_type` varchar(50) DEFAULT NULL COMMENT '文件类型,程序中枚举控制,文件类型:如身份证正面,三证合一等等', - `file_path` varchar(255) NOT NULL COMMENT '文件key,用于文件下载', - `file_location_type` int NOT NULL COMMENT '文件位置类型', - `creater_user` int NOT NULL COMMENT '创建人,即上传人', - `update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '上次更新时间', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - PRIMARY KEY (`id`) USING BTREE, - KEY `module_id_module_type` (`module_id`,`module_type`) USING BTREE, - KEY `module_type` (`module_type`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; - --- 正在导出表 smart-admin-dev.t_file 的数据:~23 rows (大约) -DELETE FROM `t_file`; -/*!40000 ALTER TABLE `t_file` DISABLE KEYS */; -INSERT INTO `t_file` (`id`, `module_id`, `module_type`, `file_name`, `file_size`, `file_type`, `file_path`, `file_location_type`, `creater_user`, `update_time`, `create_time`) VALUES - (1, '1', '1', '阿里云1.jpg', NULL, NULL, 'backUser/config/d1788b717be24f14ba526f25397b936f', 2, 1, NULL, '2019-07-05 10:38:15'), - (2, '2', '1', '1.jpg', NULL, NULL, 'backUser/config/8895ec770c4e4e558c6d9b54eb00dffc', 2, 1, '2019-07-18 09:20:59', '2019-07-18 09:20:25'), - (3, '3', '1', '随笔.txt', NULL, NULL, 'backUser/config/f5cbc4c9a56f4fa7ad0ba58b0aa5d169', 2, 1, NULL, '2019-07-18 09:22:47'), - (4, '3', '1', '1.jpg', NULL, NULL, 'backUser/config/2019071809245603e0a4e449a4bf3aa28ee731c309040.jpg', 1, 1, NULL, '2019-07-18 09:24:51'), - (6, '4', '1', '1.jpg', NULL, NULL, 'backUser/config/ddcb8214ba274dec9bb2c33e0e246391', 3, 1, NULL, '2019-07-19 16:19:43'), - (7, '5', '1', 'sql.txt', NULL, NULL, 'backUser/config/cfbdf9562c894405b5b6f64f71fa812a', 3, 1, NULL, '2019-07-19 17:41:55'), - (9, '1', '1', '20190912023241a6132f5713b54e1fb490f4ea88115747.md', NULL, NULL, 'backUser/config/20190912023241a6132f5713b54e1fb490f4ea88115747.md', 1, 1, '2019-09-12 15:25:35', '2019-09-12 14:32:42'), - (10, '1', '1', '201909120232499804998573f643ff8e58189d23485629.mjs', NULL, NULL, 'backUser/config/201909120232499804998573f643ff8e58189d23485629.mjs', 1, 1, '2019-09-12 15:25:19', '2019-09-12 14:32:50'), - (11, '1', '1', '201909120326564cdc8df7b8cc49cfb273926877f047f5.json', NULL, NULL, 'backUser/config/201909120326564cdc8df7b8cc49cfb273926877f047f5.json', 1, 1, NULL, '2019-09-12 15:26:56'), - (12, '1', '1', '201909120343357104b7f1cc684f5797ada35c06aba770.json', NULL, NULL, 'backUser/config/201909120343357104b7f1cc684f5797ada35c06aba770.json', 1, 1, NULL, '2019-09-12 15:43:36'), - (13, '1', '1', '201909120343427e408141a0ea467ea2e012f7086a6265.json', NULL, NULL, 'backUser/config/201909120343427e408141a0ea467ea2e012f7086a6265.json', 1, 1, NULL, '2019-09-12 15:43:42'), - (14, '1', '1', '20190912034543b4d3a061fb2e416c899fe2ff6b9327e0.ts', NULL, NULL, 'backUser/config/20190912034543b4d3a061fb2e416c899fe2ff6b9327e0.ts', 1, 1, NULL, '2019-09-12 15:45:43'), - (15, '1', '1', '20190912034550a5dc04ce79b14a1cb2bb76545c909aa8.md', NULL, NULL, 'backUser/config/20190912034550a5dc04ce79b14a1cb2bb76545c909aa8.md', 1, 1, NULL, '2019-09-12 15:45:51'), - (16, '1', '1', 'LICENCE', NULL, NULL, 'backUser/config/cc02b99c0ec548f1a2231b70b7d569b8', 2, 1, NULL, '2019-09-12 15:47:22'), - (17, '1', '1', 'bignumber.min.js', NULL, NULL, 'backUser/config/bda49e8ad6d242fe8735b2023dfbf125', 2, 1, NULL, '2019-09-12 15:47:29'), - (18, '1', '1', '20190912034880a881fa8fbc841bfb7194ff312bd1058.json', NULL, NULL, 'backUser/config/20190912034880a881fa8fbc841bfb7194ff312bd1058.json', 1, 1, NULL, '2019-09-12 15:48:08'), - (19, '1', '1', '20190912034816ece14084acf345a79396a0f4347c4e44.md', NULL, NULL, 'backUser/config/20190912034816ece14084acf345a79396a0f4347c4e44.md', 1, 1, NULL, '2019-09-12 15:48:16'), - (20, '1', '1', '20191024054412fac4b4e04c574c6eab71f91e13a8a0b6.jpg', NULL, NULL, 'backUser/config/20191024054412fac4b4e04c574c6eab71f91e13a8a0b6.jpg', 1, 1, NULL, '2019-10-24 17:44:13'), - (21, '1', '1', '20191106042073f7ef01bde3046bd8e01928f397230bd.jpg', NULL, NULL, 'backUser/config/20191106042073f7ef01bde3046bd8e01928f397230bd.jpg', 1, 1, NULL, '2019-11-06 02:20:13'), - (22, '1', '1', '201911130802024b8a2ebf80543a98241bb464682650d.jpg', NULL, NULL, 'backUser/config/201911130802024b8a2ebf80543a98241bb464682650d.jpg', 1, 1, NULL, '2019-11-13 06:02:01'), - (23, '1', '1', '20191113080210d1d98eea46364d268b2a03fa03f7a446.jpg', NULL, NULL, 'backUser/config/20191113080210d1d98eea46364d268b2a03fa03f7a446.jpg', 1, 1, NULL, '2019-11-13 06:02:14'), - (24, '1', '1', '20191115043844e92b25e70fb140a1885614b978469ca9.jpg', NULL, NULL, 'backUser/config/20191115043844e92b25e70fb140a1885614b978469ca9.jpg', 1, 38, NULL, '2019-11-15 02:38:45'), - (25, '1', '1', '20191116060546d3a2c703cb5546b3851612907cc3786f.png', NULL, NULL, 'backUser/config/20191116060546d3a2c703cb5546b3851612907cc3786f.png', 1, 1, NULL, '2019-11-16 10:05:47'); -/*!40000 ALTER TABLE `t_file` ENABLE KEYS */; - --- 导出 表 smart-admin-dev.t_heart_beat_record 结构 -DROP TABLE IF EXISTS `t_heart_beat_record`; -CREATE TABLE IF NOT EXISTS `t_heart_beat_record` ( - `id` int NOT NULL AUTO_INCREMENT COMMENT '自增id', - `project_path` varchar(100) DEFAULT NULL COMMENT '项目名称', - `server_ip` varchar(200) DEFAULT NULL COMMENT '服务器ip', - `process_no` int DEFAULT NULL COMMENT '进程号', - `process_start_time` datetime DEFAULT NULL COMMENT '进程开启时间', - `heart_beat_time` datetime DEFAULT NULL COMMENT '心跳时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; - --- 正在导出表 smart-admin-dev.t_heart_beat_record 的数据:~2 rows (大约) -DELETE FROM `t_heart_beat_record`; -/*!40000 ALTER TABLE `t_heart_beat_record` DISABLE KEYS */; -INSERT INTO `t_heart_beat_record` (`id`, `project_path`, `server_ip`, `process_no`, `process_start_time`, `heart_beat_time`) VALUES - (1, '/home/server/smart-admin/dev', '192.168.122.1;172.16.0.145', 14843, '2019-11-16 03:11:50', '2019-11-16 03:58:01'), - (2, 'F:\\codespace\\idea\\gangquan360\\foundation', '172.16.1.188;192.168.56.1', 227992, '2019-11-16 10:02:39', '2019-11-16 10:06:50'), - (3, 'E:\\codespace\\zhuoda', '192.168.8.188', 17564, '2020-12-14 07:11:12', '2020-12-14 07:13:34'), - (4, 'E:\\codespace\\zhuoda', '192.168.8.188', 15568, '2020-12-14 07:13:53', '2020-12-14 07:15:00'), - (5, 'E:\\codespace\\zhuoda', '192.168.8.188', 16548, '2020-12-14 07:16:07', '2020-12-14 07:17:14'); -/*!40000 ALTER TABLE `t_heart_beat_record` ENABLE KEYS */; - --- 导出 表 smart-admin-dev.t_id_generator 结构 -DROP TABLE IF EXISTS `t_id_generator`; -CREATE TABLE IF NOT EXISTS `t_id_generator` ( - `id` int DEFAULT NULL, - `key_name` varchar(50) NOT NULL COMMENT '英文key', - `rule_format` varchar(500) NOT NULL COMMENT '规则格式。no_cycle没有周期, year_cycle 年周期, month_cycle月周期, day_cycle 日周期', - `rule_type` varchar(50) NOT NULL COMMENT '格式[yyyy]表示年,[mm]标识月,[dd]表示日,[nnn]表示三位数字', - `init_number` int NOT NULL DEFAULT '1' COMMENT '初始值', - `last_number` int DEFAULT NULL COMMENT '上次产生的id, 默认为空', - `remark` varchar(1000) NOT NULL COMMENT '备注', - `update_time` datetime DEFAULT NULL, - `create_time` datetime NOT NULL, - UNIQUE KEY `key_name` (`key_name`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='id生成器定义表'; - --- 正在导出表 smart-admin-dev.t_id_generator 的数据:~2 rows (大约) -DELETE FROM `t_id_generator`; -/*!40000 ALTER TABLE `t_id_generator` DISABLE KEYS */; -INSERT INTO `t_id_generator` (`id`, `key_name`, `rule_format`, `rule_type`, `init_number`, `last_number`, `remark`, `update_time`, `create_time`) VALUES - (2, 'goods_num', '[nnnnnnn]', 'NO_CYCLE', 1, NULL, '商品编号', '2019-04-09 09:48:04', '2019-03-29 14:14:12'), - (1, 'order', '[yyyy][mm][dd][nnnnn]', 'DAY_CYCLE', 1, 1, '订单编号', '2019-03-30 11:25:42', '2019-03-29 14:14:12'); -/*!40000 ALTER TABLE `t_id_generator` ENABLE KEYS */; - --- 导出 表 smart-admin-dev.t_id_generator_record 结构 -DROP TABLE IF EXISTS `t_id_generator_record`; -CREATE TABLE IF NOT EXISTS `t_id_generator_record` ( - `generator_id` int NOT NULL, - `year` int NOT NULL, - `month` int NOT NULL, - `day` int NOT NULL, - `last_number` int NOT NULL, - PRIMARY KEY (`generator_id`,`year`,`month`,`day`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='id_generator记录表'; - --- 正在导出表 smart-admin-dev.t_id_generator_record 的数据:~5 rows (大约) -DELETE FROM `t_id_generator_record`; -/*!40000 ALTER TABLE `t_id_generator_record` DISABLE KEYS */; -INSERT INTO `t_id_generator_record` (`generator_id`, `year`, `month`, `day`, `last_number`) VALUES - (1, 2019, 3, 30, 1), - (2, 2019, 3, 30, 1), - (2, 2019, 4, 3, 2), - (2, 2019, 4, 8, 2), - (2, 2019, 4, 9, 1); -/*!40000 ALTER TABLE `t_id_generator_record` ENABLE KEYS */; - --- 导出 表 smart-admin-dev.t_notice 结构 -DROP TABLE IF EXISTS `t_notice`; -CREATE TABLE IF NOT EXISTS `t_notice` ( - `id` bigint NOT NULL AUTO_INCREMENT, - `title` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '消息标题', - `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '消息内容', - `deleted` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '删除状态:0未删除 0删除 ', - `send_status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '发送状态 0未发送 1发送', - `create_user` bigint NOT NULL COMMENT '消息创建人', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=108 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; - --- 正在导出表 smart-admin-dev.t_notice 的数据:~14 rows (大约) -DELETE FROM `t_notice`; -/*!40000 ALTER TABLE `t_notice` DISABLE KEYS */; -INSERT INTO `t_notice` (`id`, `title`, `content`, `deleted`, `send_status`, `create_user`, `create_time`, `update_time`) VALUES - (93, '大扫把', '晓冬吃大便', 1, 1, 1, '2019-07-13 17:54:13', '2019-07-13 17:54:21'), - (95, '4444444', '444444444444', 1, 1, 1, '2019-07-13 17:54:53', '2019-09-04 09:42:02'), - (96, '3434', '444444', 1, 1, 1, '2019-07-13 17:58:42', '2019-11-08 09:05:24'), - (97, '44444', '555555555555', 1, 1, 1, '2019-07-13 17:58:54', '2019-09-03 16:19:50'), - (98, '《青花瓷》', '素胚勾勒出青花笔锋浓转淡\n瓶身描绘的牡丹一如你初妆\n冉冉檀香透过窗心事我了然\n周杰伦 青花瓷\n周杰伦 青花瓷\n宣纸上走笔至此搁一半\n釉色渲染仕女图韵味被私藏\n而你嫣然的一笑如含苞待放\n你的美一缕飘散\n去到我去不了的地方\n天青色等烟雨 而我在等你\n炊烟袅袅升起 隔江千万里\n在瓶底书刻隶仿前朝的飘逸\n就当我为遇见你伏笔\n天青色等烟雨 而我在等你\n月色被打捞起 晕开了结局\n如传世的青花瓷自顾自美丽\n你眼带笑意\n色白花青的锦鲤跃然于碗底\n临摹宋体落款时却惦记着你\n你隐藏在窑烧里千年的秘密\n极细腻犹如绣花针落地\n篱外芭蕉惹骤雨门环惹铜绿\n而我路过那江南小镇惹了你\n在泼墨山水画里\n你从墨色深处被隐去\n天青色等烟雨 而我在等你\n炊烟袅袅升起 隔江千万里\n在瓶底书刻隶仿前朝的飘逸\n就当我为遇见你伏笔\n天青色等烟雨 而我在等你\n月色被打捞起 晕开了结局\n如传世的青花瓷自顾自美丽\n你眼带笑意\n天青色等烟雨 而我在等你\n炊烟袅袅升起 隔江千万里\n在瓶底书刻隶仿前朝的飘逸\n就当我为遇见你伏笔\n天青色等烟雨 而我在等你\n月色被打捞起 晕开了结局\n如传世的青花瓷自顾自美丽\n你眼带笑意 ', 1, 1, 1, '2019-08-05 16:36:44', '2019-09-02 17:53:12'), - (99, '1', '2', 1, 1, 30, '2019-08-08 14:53:58', '2019-08-08 14:54:07'), - (100, '呵呵', '呵呵', 1, 1, 1, '2019-08-20 16:52:53', '2019-09-02 17:46:59'), - (101, 'aa', 'bbcc', 1, 1, 30, '2019-08-23 09:51:01', '2019-08-23 09:51:28'), - (102, '1', '2', 0, 1, 1, '2019-09-05 14:28:10', '2019-09-05 14:28:10'), - (103, '12', '22', 0, 1, 1, '2019-09-05 14:29:30', '2019-09-05 14:29:30'), - (104, 'a', 'b', 1, 1, 30, '2019-09-06 14:21:18', '2019-09-06 14:24:07'), - (105, '22222222222', '1111', 0, 0, 1, '2019-11-07 19:05:56', '2019-11-07 19:05:56'), - (106, '423', '234', 0, 0, 37, '2019-11-08 21:48:19', '2019-11-08 21:48:19'), - (107, 'AAS', 's\'da\'ssdas', 1, 1, 1, '2019-11-13 19:06:55', '2019-11-14 09:07:06'); -/*!40000 ALTER TABLE `t_notice` ENABLE KEYS */; - --- 导出 表 smart-admin-dev.t_notice_receive_record 结构 -DROP TABLE IF EXISTS `t_notice_receive_record`; -CREATE TABLE IF NOT EXISTS `t_notice_receive_record` ( - `id` bigint NOT NULL AUTO_INCREMENT, - `notice_id` bigint NOT NULL COMMENT '消息id', - `employee_id` bigint NOT NULL COMMENT '用户id', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=141 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; - --- 正在导出表 smart-admin-dev.t_notice_receive_record 的数据:~27 rows (大约) -DELETE FROM `t_notice_receive_record`; -/*!40000 ALTER TABLE `t_notice_receive_record` DISABLE KEYS */; -INSERT INTO `t_notice_receive_record` (`id`, `notice_id`, `employee_id`, `create_time`, `update_time`) VALUES - (114, 93, 1, '2019-07-13 17:54:16', '2019-07-13 17:54:16'), - (115, 95, 1, '2019-07-13 17:54:55', '2019-07-13 17:54:55'), - (116, 95, 22, '2019-07-13 17:58:03', '2019-07-13 17:58:03'), - (117, 93, 22, '2019-07-13 17:58:05', '2019-07-13 17:58:05'), - (118, 96, 1, '2019-07-13 17:58:44', '2019-07-13 17:58:44'), - (119, 97, 1, '2019-07-13 17:58:58', '2019-07-13 17:58:58'), - (120, 98, 1, '2019-08-05 16:37:01', '2019-08-05 16:37:01'), - (121, 99, 30, '2019-08-08 14:54:05', '2019-08-08 14:54:05'), - (122, 99, 1, '2019-08-08 15:15:44', '2019-08-08 15:15:44'), - (123, 100, 1, '2019-08-20 16:53:29', '2019-08-20 16:53:29'), - (124, 101, 30, '2019-08-23 09:51:11', '2019-08-23 09:51:11'), - (125, 101, 1, '2019-08-23 12:46:27', '2019-08-23 12:46:27'), - (126, 102, 1, '2019-09-05 14:28:32', '2019-09-05 14:28:32'), - (127, 104, 30, '2019-09-06 14:23:58', '2019-09-06 14:23:58'), - (128, 104, 1, '2019-09-06 15:25:13', '2019-09-06 15:25:13'), - (129, 101, 14, '2019-11-02 21:46:13', '2019-11-02 21:46:13'), - (130, 102, 14, '2019-11-02 21:46:14', '2019-11-02 21:46:14'), - (131, 104, 14, '2019-11-02 21:46:15', '2019-11-02 21:46:15'), - (132, 98, 14, '2019-11-02 21:46:18', '2019-11-02 21:46:18'), - (133, 103, 37, '2019-11-07 19:58:06', '2019-11-07 19:58:06'), - (134, 103, 1, '2019-11-07 20:03:54', '2019-11-07 20:03:54'), - (135, 107, 1, '2019-11-13 19:07:02', '2019-11-13 19:07:02'), - (136, 107, 38, '2019-11-15 02:11:04', '2019-11-15 02:11:04'), - (137, 104, 38, '2019-11-15 02:11:17', '2019-11-15 02:11:17'), - (138, 101, 38, '2019-11-15 02:26:33', '2019-11-15 02:26:33'), - (139, 98, 38, '2019-11-15 02:29:32', '2019-11-15 02:29:32'), - (140, 100, 38, '2019-11-15 03:19:18', '2019-11-15 03:19:18'); -/*!40000 ALTER TABLE `t_notice_receive_record` ENABLE KEYS */; - --- 导出 表 smart-admin-dev.t_order_operate_log 结构 -DROP TABLE IF EXISTS `t_order_operate_log`; -CREATE TABLE IF NOT EXISTS `t_order_operate_log` ( - `id` bigint NOT NULL AUTO_INCREMENT, - `order_id` int NOT NULL COMMENT '各种单据的id', - `order_type` int NOT NULL COMMENT '单据类型', - `operate_type` int NOT NULL COMMENT '操作类型', - `operate_content` text NOT NULL COMMENT '操作类型 对应的中文', - `operate_remark` text COMMENT '操作备注', - `employee_id` int NOT NULL COMMENT '员工id', - `employee_name` varchar(1000) NOT NULL COMMENT '员工名称', - `ext_data` text COMMENT '额外信息', - `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - PRIMARY KEY (`id`) USING BTREE, - KEY `order_id_order_type` (`order_id`,`order_type`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='各种单据操作记录\r\n'; - --- 正在导出表 smart-admin-dev.t_order_operate_log 的数据:~0 rows (大约) -DELETE FROM `t_order_operate_log`; -/*!40000 ALTER TABLE `t_order_operate_log` DISABLE KEYS */; -/*!40000 ALTER TABLE `t_order_operate_log` ENABLE KEYS */; - --- 导出 表 smart-admin-dev.t_peony 结构 -DROP TABLE IF EXISTS `t_peony`; -CREATE TABLE IF NOT EXISTS `t_peony` ( - `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'ID', - `kind` varchar(500) DEFAULT NULL COMMENT '品种', - `name` varchar(500) DEFAULT NULL COMMENT '名字', - `color` varchar(500) DEFAULT NULL COMMENT '颜色', - `image_url` text COMMENT '图片链接', - `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 COMMENT='牡丹花'; - --- 正在导出表 smart-admin-dev.t_peony 的数据:~3 rows (大约) -DELETE FROM `t_peony`; -/*!40000 ALTER TABLE `t_peony` DISABLE KEYS */; -INSERT INTO `t_peony` (`id`, `kind`, `name`, `color`, `image_url`, `create_time`, `update_time`) VALUES - (5, '复色类', '什样锦', '红色', 'https://bkimg.cdn.bcebos.com/pic/3c6d55fbb2fb43160ee185da2aa4462308f7d390?x-bce-process=image/watermark,g_7,image_d2F0ZXIvYmFpa2UxNTA=,xp_5,yp_5', '2020-04-06 22:02:32', '2020-04-06 22:03:30'), - (6, '绿色', '绿香球', '绿色', '11', '2020-04-06 22:14:35', '2020-04-06 22:17:51'), - (7, '墨紫色类', '冠世墨玉', '紫色', '34534534534', '2020-04-06 22:15:19', '2020-04-06 22:18:21'); -/*!40000 ALTER TABLE `t_peony` ENABLE KEYS */; - --- 导出 表 smart-admin-dev.t_position 结构 -DROP TABLE IF EXISTS `t_position`; -CREATE TABLE IF NOT EXISTS `t_position` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `position_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '岗位名称', - `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '岗位描述', - `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='岗位表'; - --- 正在导出表 smart-admin-dev.t_position 的数据:~13 rows (大约) -DELETE FROM `t_position`; -/*!40000 ALTER TABLE `t_position` DISABLE KEYS */; -INSERT INTO `t_position` (`id`, `position_name`, `remark`, `update_time`, `create_time`) VALUES - (1, 'java develop', 'java develop is good job', '2019-07-03 15:18:45', '2019-07-03 15:18:45'), - (2, 'android develop', 'android develop is good job', '2019-07-04 16:11:11', '2019-07-04 16:11:00'), - (3, '测试岗位1', '这是内容11', '2019-09-02 16:39:33', '2019-07-10 14:03:50'), - (8, '测试岗位2', '测试岗位2.。', '2019-09-04 10:19:40', '2019-09-04 10:19:32'), - (9, '测试岗位3', '测试岗位3', '2019-09-05 14:39:43', '2019-09-05 14:39:43'), - (10, '测试岗位4', '测试岗位4', '2019-09-05 14:39:48', '2019-09-05 14:39:48'), - (11, '测试岗位5', '测试岗位5', '2019-09-05 14:39:53', '2019-09-05 14:39:53'), - (12, '测试岗位6', '测试岗位6', '2019-09-05 14:39:58', '2019-09-05 14:39:58'), - (13, '测试岗位7', '测试岗位7', '2019-09-05 14:40:03', '2019-09-05 14:40:03'), - (14, '测试岗位8', '测试岗位8', '2019-09-05 14:40:09', '2019-09-05 14:40:09'), - (15, '测试岗位9', '测试岗位9', '2019-09-05 14:40:19', '2019-09-05 14:40:19'), - (16, 'aaa22222', 'ddddddddddd', '2019-11-15 17:04:29', '2019-11-06 15:58:37'), - (17, 'ddd', 'fsdef', '2019-11-15 17:04:40', '2019-11-15 17:04:40'); -/*!40000 ALTER TABLE `t_position` ENABLE KEYS */; - --- 导出 表 smart-admin-dev.t_position_relation 结构 -DROP TABLE IF EXISTS `t_position_relation`; -CREATE TABLE IF NOT EXISTS `t_position_relation` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `position_id` int DEFAULT NULL COMMENT '岗位ID', - `employee_id` int DEFAULT NULL COMMENT '员工ID', - `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - PRIMARY KEY (`id`), - KEY `job_id` (`position_id`) USING BTREE, - KEY `employee_id` (`employee_id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=53 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='岗位关联表'; - --- 正在导出表 smart-admin-dev.t_position_relation 的数据:~27 rows (大约) -DELETE FROM `t_position_relation`; -/*!40000 ALTER TABLE `t_position_relation` DISABLE KEYS */; -INSERT INTO `t_position_relation` (`id`, `position_id`, `employee_id`, `update_time`, `create_time`) VALUES - (14, 1, 28, '2019-07-10 16:40:14', '2019-07-10 16:40:14'), - (18, 1, 29, '2019-07-11 10:18:22', '2019-07-11 10:18:22'), - (19, 3, 29, '2019-07-11 10:18:22', '2019-07-11 10:18:22'), - (20, 2, 29, '2019-07-11 10:18:22', '2019-07-11 10:18:22'), - (21, 1, 30, '2019-08-08 14:35:51', '2019-08-08 14:35:51'), - (22, 2, 30, '2019-08-08 14:35:51', '2019-08-08 14:35:51'), - (23, 3, 30, '2019-08-08 14:35:51', '2019-08-08 14:35:51'), - (26, 2, 31, '2019-08-23 09:26:44', '2019-08-23 09:26:44'), - (27, 3, 31, '2019-08-23 09:26:44', '2019-08-23 09:26:44'), - (28, 3, 32, '2019-09-04 09:05:47', '2019-09-04 09:05:47'), - (29, 2, 32, '2019-09-04 09:05:47', '2019-09-04 09:05:47'), - (30, 3, 22, '2019-09-04 09:06:46', '2019-09-04 09:06:46'), - (31, 2, 22, '2019-09-04 09:06:46', '2019-09-04 09:06:46'), - (35, 8, 35, '2019-09-04 15:09:00', '2019-09-04 15:09:00'), - (36, 3, 35, '2019-09-04 15:09:00', '2019-09-04 15:09:00'), - (37, 15, 23, '2019-09-05 16:13:02', '2019-09-05 16:13:02'), - (38, 14, 23, '2019-09-05 16:13:02', '2019-09-05 16:13:02'), - (39, 13, 23, '2019-09-05 16:13:02', '2019-09-05 16:13:02'), - (40, 3, 34, '2019-09-06 08:55:18', '2019-09-06 08:55:18'), - (41, 2, 34, '2019-09-06 08:55:18', '2019-09-06 08:55:18'), - (42, 1, 34, '2019-09-06 08:55:18', '2019-09-06 08:55:18'), - (43, 14, 36, '2019-09-09 17:01:39', '2019-09-09 17:01:39'), - (44, 3, 37, '2019-11-08 09:32:39', '2019-11-08 09:32:39'), - (46, 8, 38, '2019-11-14 16:08:05', '2019-11-14 16:08:05'), - (50, 16, 39, '2019-11-15 17:07:04', '2019-11-15 17:07:04'), - (51, 13, 39, '2019-11-15 17:07:04', '2019-11-15 17:07:04'), - (52, 14, 39, '2019-11-15 17:07:04', '2019-11-15 17:07:04'); -/*!40000 ALTER TABLE `t_position_relation` ENABLE KEYS */; - --- 导出 表 smart-admin-dev.t_privilege 结构 -DROP TABLE IF EXISTS `t_privilege`; -CREATE TABLE IF NOT EXISTS `t_privilege` ( - `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '功能权限表主键id', - `type` tinyint NOT NULL COMMENT '1.菜单 2.功能点', - `name` varchar(50) NOT NULL COMMENT '菜单名称', - `key` varchar(1000) NOT NULL COMMENT '路由name 英文关键字', - `url` text COMMENT '路由path/type=3为API接口', - `sort` int NOT NULL DEFAULT '0' COMMENT '排序', - `parent_key` varchar(1000) DEFAULT NULL COMMENT '父级key', - `update_time` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - PRIMARY KEY (`id`), - UNIQUE KEY `key` (`key`) USING BTREE, - KEY `type` (`type`) USING BTREE, - KEY `parent_key` (`parent_key`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=127 DEFAULT CHARSET=utf8 COMMENT='权限功能表'; - --- 正在导出表 smart-admin-dev.t_privilege 的数据:~103 rows (大约) -DELETE FROM `t_privilege`; -/*!40000 ALTER TABLE `t_privilege` DISABLE KEYS */; -INSERT INTO `t_privilege` (`id`, `type`, `name`, `key`, `url`, `sort`, `parent_key`, `update_time`, `create_time`) VALUES - (1, 1, '人员管理', 'Employee', '/employee', 20, 'System', '2020-12-14 15:16:26', '2019-11-01 11:28:07'), - (2, 1, '角色管理', 'RoleManage', '/employee/role', 21, 'Employee', '2020-12-14 15:16:26', '2019-11-01 11:28:07'), - (3, 1, '岗位管理', 'PositionList', '/employee/position', 22, 'Employee', '2020-12-14 15:16:26', '2019-11-01 11:28:07'), - (4, 1, '员工管理', 'RoleEmployeeManage', '/employee/role-employee-manage', 23, 'Employee', '2020-12-14 15:16:26', '2019-11-01 11:28:07'), - (5, 1, '系统设置', 'SystemSetting', '/system-setting', 29, 'System', '2020-12-14 15:16:26', '2019-11-01 11:28:07'), - (6, 1, '系统参数', 'SystemConfig', '/system-setting/system-config', 30, 'SystemSetting', '2020-12-14 15:16:26', '2019-11-01 11:28:07'), - (8, 1, '菜单设置', 'SystemPrivilege', '/system-setting/system-privilege', 31, 'SystemSetting', '2020-12-14 15:16:26', '2019-11-01 11:28:07'), - (9, 1, '消息管理', 'Notice', '/notice', 10, 'Business', '2020-12-14 15:16:26', '2019-11-01 11:28:07'), - (10, 1, '通知管理', 'NoticeList', '/notice/notice-list', 11, 'Notice', '2020-12-14 15:16:26', '2019-11-01 11:28:07'), - (11, 1, '个人消息', 'PersonNotice', '/notice/person-notice', 12, 'Notice', '2020-12-14 15:16:26', '2019-11-01 11:28:07'), - (12, 1, '邮件管理', 'Email', '/email', 4, 'Business', '2020-12-14 15:16:26', '2019-11-01 11:28:07'), - (13, 1, '邮件管理', 'EmailList', '/email/email-list', 5, 'Email', '2020-12-14 15:16:26', '2019-11-01 11:28:07'), - (14, 1, '发送邮件', 'SendMail', '/email/send-mail', 6, 'Email', '2020-12-14 15:16:26', '2019-11-01 11:28:07'), - (15, 1, '用户日志', 'UserLog', '/user-log', 26, 'System', '2020-12-14 15:16:26', '2019-11-01 11:28:07'), - (16, 1, '用户操作日志', 'UserOperateLog', '/user-log/user-operate-log', 27, 'UserLog', '2020-12-14 15:16:26', '2019-11-01 11:28:07'), - (17, 1, '用户登录日志', 'UserLoginLog', '/user-log/user-login-log', 28, 'UserLog', '2020-12-14 15:16:26', '2019-11-01 11:28:07'), - (18, 1, '系统监控', 'Monitor', '/monitor', 37, 'Support', '2020-12-14 15:16:26', '2019-11-01 11:28:07'), - (19, 1, '在线人数', 'OnlineUser', '/monitor/online-user', 38, 'Monitor', '2020-12-14 15:16:26', '2019-11-01 11:28:07'), - (20, 1, 'SQL监控', 'Sql', '/monitor/sql', 39, 'Monitor', '2020-12-14 15:16:26', '2019-11-01 11:28:07'), - (21, 1, '定时任务', 'Task', '/task', 42, 'Support', '2020-12-14 15:16:26', '2019-11-01 11:28:07'), - (22, 1, '任务管理', 'TaskList', '/system-setting/task-list', 43, 'Task', '2020-12-14 15:16:26', '2019-11-01 11:28:07'), - (23, 1, '动态加载', 'Reload', '/reload', 40, 'Support', '2020-12-14 15:16:26', '2019-11-01 11:28:07'), - (24, 1, 'SmartReload', 'SmartReloadList', '/reload/smart-reload-list', 41, 'Reload', '2020-12-14 15:16:26', '2019-11-01 11:28:07'), - (25, 1, '接口文档', 'ApiDoc', '/api-doc', 33, 'Support', '2020-12-14 15:16:26', '2019-11-01 11:28:07'), - (26, 1, 'Swagger接口文档', 'Swagger', '/api-doc/swagger', 34, 'ApiDoc', '2020-12-14 15:16:26', '2019-11-01 11:28:07'), - (27, 1, '三级路由', 'ThreeRouter', '/three-router', 14, 'Business', '2020-12-14 15:16:26', '2019-11-01 11:28:07'), - (28, 1, '三级菜单', 'LevelTwo', '/three-router/level-two', 15, 'ThreeRouter', '2020-12-14 15:16:26', '2019-11-01 11:28:07'), - (30, 1, '三级菜单子哈', 'RoleTwoTwo', '/three-router/level-two/level-three2', 17, 'LevelTwo', '2020-12-14 15:16:26', '2019-11-01 11:28:07'), - (31, 1, '二级菜单', 'RoleOneOne', '/three-router/level-two2', 18, 'ThreeRouter', '2020-12-14 15:16:26', '2019-11-01 11:28:07'), - (32, 1, 'KeepAlive', 'KeepAlive', '/keep-alive', 7, 'Business', '2020-12-14 15:16:26', '2019-11-01 11:28:07'), - (33, 1, 'KeepAlive列表', 'KeepAliveContentList', '/keep-alive/content-list', 8, 'KeepAlive', '2020-12-14 15:16:26', '2019-11-01 11:28:07'), - (34, 1, 'KeepAlive表单', 'KeepAliveAddContent', '/keep-alive/add-content', 9, 'KeepAlive', '2020-12-14 15:16:26', '2019-11-01 11:28:07'), - (35, 1, '心跳服务', 'HeartBeat', '/heart-beat', 35, 'Support', '2020-12-14 15:16:26', '2019-11-01 11:28:07'), - (36, 1, '心跳服务', 'HeartBeatList', '/heart-beat/heart-beat-list', 36, 'HeartBeat', '2020-12-14 15:16:26', '2019-11-01 11:28:07'), - (37, 1, '文件服务', 'File', '/file', 24, 'System', '2020-12-14 15:16:26', '2019-11-01 11:28:07'), - (38, 1, '文件列表', 'FileList', '/file/file-list', 25, 'File', '2020-12-14 15:16:26', '2019-11-01 11:28:07'), - (39, 2, '添加角色', 'add-role', 'roleController.addRole', 0, 'RoleManage', '2019-11-01 11:47:29', '2019-11-01 11:47:29'), - (40, 2, '删除角色', 'delete-role', 'roleController.deleteRole', 1, 'RoleManage', '2019-11-01 11:47:43', '2019-11-01 11:47:43'), - (41, 2, '编辑角色', 'update-role', 'roleController.updateRole', 2, 'RoleManage', '2019-11-01 11:47:55', '2019-11-01 11:47:55'), - (42, 2, '修改角色权限', 'update-role-privilege', 'rolePrivilegeController.updateRolePrivilege', 3, 'RoleManage', '2019-11-01 11:48:09', '2019-11-01 11:48:09'), - (43, 2, '添加成员', 'add-employee-role', 'roleEmployeeController.addEmployeeList', 4, 'RoleManage', '2019-11-05 10:38:11', '2019-11-05 10:38:11'), - (44, 2, '查询成员', 'search-employee-list', 'roleEmployeeController.listAllEmployeeRoleId,roleEmployeeController.listEmployeeByName,roleController.getAllRole,rolePrivilegeController.listPrivilegeByRoleId', 7, 'RoleManage', '2019-11-05 10:39:04', '2019-11-05 10:39:04'), - (45, 2, '移除成员', 'delete-employee-role', 'roleEmployeeController.removeEmployee', 5, 'RoleManage', '2019-11-05 10:40:09', '2019-11-05 10:40:09'), - (46, 2, '批量移除', 'delete-employee-role-batch', 'roleEmployeeController.removeEmployeeList', 6, 'RoleManage', '2019-11-05 10:40:27', '2019-11-05 10:40:27'), - (47, 2, '查询数据范围', 'query-data-scope', 'dataScopeController.dataScopeList,dataScopeController.dataScopeListByRole,rolePrivilegeController.listPrivilegeByRoleId,privilegeController.queryAll,privilegeController.getAllUrl', 8, 'RoleManage', '2019-11-05 10:40:57', '2019-11-05 10:40:57'), - (48, 2, '更新数据范围', 'update-data-scope', 'dataScopeController.dataScopeBatchSet', 9, 'RoleManage', '2019-11-05 10:41:03', '2019-11-05 10:41:03'), - (49, 2, '查询', 'search-position', 'positionController.queryJobById,positionController.getJobPage', 0, 'PositionList', '2019-11-05 10:41:30', '2019-11-05 10:41:30'), - (50, 2, '添加', 'add-position', 'positionController.addJob', 1, 'PositionList', '2019-11-05 10:41:40', '2019-11-05 10:41:40'), - (51, 2, '修改', 'update-position', 'positionController.updateJob', 2, 'PositionList', '2019-11-05 10:41:49', '2019-11-05 10:41:49'), - (52, 2, '删除', 'delete-position', 'positionController.removeJob', 3, 'PositionList', '2019-11-05 10:41:57', '2019-11-05 10:41:57'), - (53, 2, '添加部门', 'add-department', 'departmentController.addDepartment', 0, 'RoleEmployeeManage', '2019-11-05 11:11:18', '2019-11-05 11:11:18'), - (54, 2, '编辑部门', 'update-department', 'departmentController.updateDepartment', 1, 'RoleEmployeeManage', '2019-11-05 11:11:29', '2019-11-05 11:11:29'), - (55, 2, '删除部门', 'delete-department', 'departmentController.delDepartment', 2, 'RoleEmployeeManage', '2019-11-05 11:11:48', '2019-11-05 11:11:48'), - (56, 2, '查询', 'search-department', 'departmentController.listAll,departmentController.getDepartment,departmentController.listDepartmentEmployee,departmentController.listDepartment,employeeController.query', 3, 'RoleEmployeeManage', '2019-11-05 11:12:09', '2019-11-05 11:12:09'), - (57, 2, '添加成员', 'add-employee', 'employeeController.addEmployee', 4, 'RoleEmployeeManage', '2019-11-05 17:06:23', '2019-11-05 17:06:23'), - (58, 2, '编辑成员', 'update-employee', 'employeeController.updateEmployee', 5, 'RoleEmployeeManage', '2019-11-05 17:06:57', '2019-11-05 17:06:57'), - (59, 2, '禁用', 'disabled-employee', 'employeeController.updateStatus', 6, 'RoleEmployeeManage', '2019-11-05 17:14:35', '2019-11-05 17:14:35'), - (60, 2, '批量操作', 'disabled-employee-batch', 'employeeController.batchUpdateStatus', 7, 'RoleEmployeeManage', '2019-11-05 17:19:23', '2019-11-05 17:19:23'), - (61, 2, '员工角色编辑', 'update-employee-role', 'employeeController.updateRoles', 8, 'RoleEmployeeManage', '2019-11-05 17:21:15', '2019-11-05 17:21:15'), - (62, 2, '重置密码', 'reset-employee-password', 'employeeController.resetPasswd', 10, 'RoleEmployeeManage', '2019-11-05 17:22:13', '2019-11-05 17:22:13'), - (63, 2, '删除员工', 'delete-employee', 'employeeController.deleteEmployeeById', 9, 'RoleEmployeeManage', '2019-11-05 17:22:27', '2019-11-05 17:22:27'), - (64, 2, '查询系统参数', 'system-params-search', 'systemConfigController.selectByKey,systemConfigController.getListByGroup,systemConfigController.getSystemConfigPage', 0, 'SystemConfig', '2019-11-05 17:23:41', '2019-11-05 17:23:41'), - (65, 2, '添加系统参数', 'system-params-add', 'systemConfigController.addSystemConfig', 1, 'SystemConfig', '2019-11-05 17:26:00', '2019-11-05 17:26:00'), - (66, 2, '修改系统参数', 'system-config-update', 'systemConfigController.updateSystemConfig', 2, 'SystemConfig', '2019-11-05 17:26:07', '2019-11-05 17:26:07'), - (67, 2, '搜索系统参数', 'system-config-search', 'systemConfigController.selectByKey,systemConfigController.getListByGroup,systemConfigController.getSystemConfigPage', 3, 'SystemConfig', '2019-11-05 17:26:44', '2019-11-05 17:26:44'), - (69, 2, '编辑', 'privilege-main-update', 'privilegeController.menuBatchSave,privilegeController.functionSaveOrUpdate', 1, 'SystemPrivilege', '2020-12-14 15:17:11', '2019-11-05 17:27:28'), - (70, 2, '查询', 'privilege-main-search', 'privilegeController.queryAll,privilegeController.getAllUrl,privilegeController.functionQuery', 3, 'SystemPrivilege', '2020-12-14 15:17:11', '2019-11-05 17:28:45'), - (71, 2, '查询', 'notice-query', 'noticeController.queryReceiveByPage,noticeController.queryUnreadByPage,noticeController.queryByPage,noticeController.detail', 0, 'NoticeList', '2019-11-05 17:30:16', '2019-11-05 17:30:16'), - (72, 2, '添加', 'notice-add', 'noticeController.add', 1, 'NoticeList', '2019-11-05 17:30:28', '2019-11-05 17:30:28'), - (73, 2, '修改', 'notice-edit', 'noticeController.update', 2, 'NoticeList', '2019-11-05 17:31:24', '2019-11-05 17:31:24'), - (74, 2, '删除', 'notice-delete', 'noticeController.delete', 3, 'NoticeList', '2019-11-06 11:12:32', '2019-11-06 11:12:32'), - (75, 2, '详情', 'notice-detail', 'noticeController.detail', 4, 'NoticeList', '2019-11-06 11:12:44', '2019-11-06 11:12:44'), - (76, 2, '发送', 'notice-send', 'noticeController.send', 5, 'NoticeList', '2019-11-06 11:12:51', '2019-11-06 11:12:51'), - (77, 2, '查询', 'person-notice-query', 'noticeController.queryReceiveByPage,noticeController.queryUnreadByPage,noticeController.queryByPage', 0, 'PersonNotice', '2019-11-06 11:13:27', '2019-11-06 11:13:27'), - (78, 2, '详情', 'person-notice-detail', 'noticeController.detail', 1, 'PersonNotice', '2019-11-06 11:13:35', '2019-11-06 11:13:35'), - (79, 2, '查询', 'email-query', 'emailController.queryByPage,emailController.detail', 0, 'EmailList', '2019-11-06 11:13:49', '2019-11-06 11:13:49'), - (80, 2, '新增', 'email-add', 'emailController.add', 1, 'EmailList', '2019-11-06 11:14:02', '2019-11-06 11:14:02'), - (81, 2, '编辑', 'email-update', 'emailController.update', 2, 'EmailList', '2019-11-06 11:14:08', '2019-11-06 11:14:08'), - (82, 2, '删除', 'email-delete', 'emailController.delete', 3, 'EmailList', '2019-11-06 11:14:16', '2019-11-06 11:14:16'), - (83, 2, '发送', 'email-send', 'emailController.send', 0, 'SendMail', '2019-11-06 11:14:40', '2019-11-06 11:14:40'), - (84, 2, '查询', 'user-operate-log-search', 'userOperateLogController.queryByPage', 0, 'UserOperateLog', '2019-11-06 11:15:04', '2019-11-06 11:15:04'), - (85, 2, '详情', 'user-operate-log-detail', 'userOperateLogController.detail', 1, 'UserOperateLog', '2019-11-06 11:15:16', '2019-11-06 11:15:16'), - (86, 2, '删除', 'user-operate-log-delete', 'userOperateLogController.delete', 2, 'UserOperateLog', '2019-11-06 11:15:25', '2019-11-06 11:15:25'), - (87, 2, '查询', 'user-login-log-search', 'userLoginLogController.queryByPage', 0, 'UserLoginLog', '2019-11-06 11:15:43', '2019-11-06 11:15:43'), - (88, 2, '删除', 'user-login-log-delete', 'userLoginLogController.delete', 1, 'UserLoginLog', '2019-11-06 11:15:49', '2019-11-06 11:15:49'), - (89, 2, '查询', 'online-user-search', 'userLoginLogController.queryUserOnLine', 0, 'OnlineUser', '2019-11-06 11:16:05', '2019-11-06 11:16:05'), - (90, 2, '查询任务', 'task-search', 'quartzController.query', 0, 'TaskList', '2019-11-06 11:16:24', '2019-11-06 11:16:24'), - (91, 2, '刷新任务', 'task-refresh', 'quartzController.query', 1, 'TaskList', '2019-11-06 11:16:50', '2019-11-06 11:16:50'), - (92, 2, '添加任务', 'task-add', 'quartzController.saveOrUpdateTask', 2, 'TaskList', '2019-11-06 11:17:04', '2019-11-06 11:17:04'), - (93, 2, '编辑任务', 'task-update', 'quartzController.saveOrUpdateTask', 3, 'TaskList', '2019-11-06 11:17:17', '2019-11-06 11:17:17'), - (94, 2, '暂停任务', 'task-pause', 'quartzController.pauseTask', 4, 'TaskList', '2019-11-06 11:17:25', '2019-11-06 11:17:25'), - (95, 2, '恢复任务', 'task-resume', 'quartzController.resumeTask', 5, 'TaskList', '2019-11-06 11:17:31', '2019-11-06 11:17:31'), - (96, 2, '立即运行任务', 'task-run', 'quartzController.runTask', 6, 'TaskList', '2019-11-06 11:17:38', '2019-11-06 11:17:38'), - (97, 2, '查看任务日志', 'task-query-log', 'quartzController.queryLog', 7, 'TaskList', '2019-11-06 11:17:47', '2019-11-06 11:17:47'), - (98, 2, '删除任务', 'task-delete', 'quartzController.deleteTask', 8, 'TaskList', '2019-11-06 11:17:53', '2019-11-06 11:17:53'), - (99, 2, '查询', 'smart-reload-search', 'smartReloadController.listAllReloadItem', 0, 'SmartReloadList', '2019-11-06 11:18:06', '2019-11-06 11:18:06'), - (100, 2, '执行reload', 'smart-reload-update', 'smartReloadController.updateByTag', 1, 'SmartReloadList', '2019-11-06 11:18:14', '2019-11-06 11:18:14'), - (101, 2, '查看执行结果', 'smart-reload-result', 'smartReloadController.queryReloadResult', 2, 'SmartReloadList', '2019-11-06 11:18:19', '2019-11-06 11:18:19'), - (102, 2, '查询任务', 'heart-beat-query', 'heartBeatController.query', 0, 'HeartBeatList', '2019-11-06 11:18:38', '2019-11-06 11:18:38'), - (103, 2, '查询', 'file-filePage-query', 'fileController.queryListByPage,fileController.localGetFile,fileController.downLoadById', 0, 'FileList', '2019-11-06 11:19:06', '2019-11-06 11:19:06'), - (104, 2, '上传', 'file-filePage-upload', 'fileController.qiNiuUpload,fileController.localUpload,fileController.aliYunUpload,fileController.saveFile', 1, 'FileList', '2019-11-06 11:19:36', '2019-11-06 11:19:36'), - (105, 2, '下载', 'file-filePage-download', 'fileController.downLoadById', 2, 'FileList', '2019-11-16 10:05:02', '2019-11-16 10:05:02'), - (106, 1, '业务功能', 'Business', '/business', 0, NULL, '2020-12-14 15:16:26', '2020-12-14 15:16:26'), - (107, 1, '牡丹管理', 'Peony', '/peony', 1, 'Business', '2020-12-14 15:16:26', '2020-12-14 15:16:26'), - (108, 1, '牡丹花列表', 'PeonyList', '/peony/peony-list', 2, 'Peony', '2020-12-14 15:16:26', '2020-12-14 15:16:26'), - (109, 1, '牡丹花列表1', 'PeonyList1', '/peony/peony-list1', 3, 'Peony', '2020-12-14 15:16:26', '2020-12-14 15:16:26'), - (110, 1, '消息详情', 'NoticeDetail', '/notice/notice-detail', 13, 'Notice', '2020-12-14 15:16:26', '2020-12-14 15:16:26'), - (111, 1, '三级菜单子颗粒', 'ThreeLevelRouterView', '/three-router/level-two/level-three1', 16, 'LevelTwo', '2020-12-14 15:16:26', '2020-12-14 15:16:26'), - (112, 1, '系统设置', 'System', '/system', 19, NULL, '2020-12-14 15:16:26', '2020-12-14 15:16:26'), - (113, 1, '开发专用', 'Support', '/support', 32, NULL, '2020-12-14 15:16:26', '2020-12-14 15:16:26'), - (114, 2, '查询', 'peony-list-query', '', 1, 'PeonyList', '2020-12-14 15:16:30', '2020-12-14 15:16:30'), - (115, 2, '新增', 'peony-list-add', '', 2, 'PeonyList', '2020-12-14 15:16:30', '2020-12-14 15:16:30'), - (116, 2, '编辑', 'peony-list-update', '', 3, 'PeonyList', '2020-12-14 15:16:30', '2020-12-14 15:16:30'), - (117, 2, '批量删除', 'peony-list-batch-delete', '', 4, 'PeonyList', '2020-12-14 15:16:30', '2020-12-14 15:16:30'), - (118, 2, '批量导出', 'peony-list-batch-export', '', 5, 'PeonyList', '2020-12-14 15:16:30', '2020-12-14 15:16:30'), - (119, 2, '导出全部', 'peony-list-export-all', '', 6, 'PeonyList', '2020-12-14 15:16:30', '2020-12-14 15:16:30'), - (120, 2, '查询', 'peony1-list-query', '', 1, 'PeonyList1', '2020-12-14 15:16:33', '2020-12-14 15:16:33'), - (121, 2, '新增', 'peony1-list-add', '', 2, 'PeonyList1', '2020-12-14 15:16:33', '2020-12-14 15:16:33'), - (122, 2, '编辑', 'peony1-list-update', '', 3, 'PeonyList1', '2020-12-14 15:16:33', '2020-12-14 15:16:33'), - (123, 2, '批量删除', 'peony1-list-batch-delete', '', 4, 'PeonyList1', '2020-12-14 15:16:33', '2020-12-14 15:16:33'), - (124, 2, '批量导出', 'peony1-list-batch-export', '', 5, 'PeonyList1', '2020-12-14 15:16:33', '2020-12-14 15:16:33'), - (125, 2, '导出全部', 'peony1-list-export-all', '', 6, 'PeonyList1', '2020-12-14 15:16:33', '2020-12-14 15:16:33'), - (126, 2, '批量保存功能点', 'privilege-batch-save-points', 'privilegeController.functionSaveOrUpdate', 1, 'SystemPrivilege', '2020-12-14 15:17:11', '2020-12-14 15:17:11'); -/*!40000 ALTER TABLE `t_privilege` ENABLE KEYS */; - --- 导出 表 smart-admin-dev.t_quartz_task 结构 -DROP TABLE IF EXISTS `t_quartz_task`; -CREATE TABLE IF NOT EXISTS `t_quartz_task` ( - `id` int NOT NULL AUTO_INCREMENT, - `task_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '任务名称', - `task_bean` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'spring bean名称', - `task_params` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '任务参数', - `task_cron` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '运行cron表达式', - `task_status` tinyint NOT NULL DEFAULT '0' COMMENT '任务状态0:正常,1:暂停', - `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', - `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; - --- 正在导出表 smart-admin-dev.t_quartz_task 的数据:~5 rows (大约) -DELETE FROM `t_quartz_task`; -/*!40000 ALTER TABLE `t_quartz_task` DISABLE KEYS */; -INSERT INTO `t_quartz_task` (`id`, `task_name`, `task_bean`, `task_params`, `task_cron`, `task_status`, `remark`, `update_time`, `create_time`) VALUES - (9, '2312332', 'exampleTask', '21314', '*/5 * * * * ?', 1, NULL, '2019-09-06 14:41:55', '2019-04-19 15:24:26'), - (13, '567', 'exampleTask', 'ads', '*/5 * * * * ?', 1, NULL, '2019-09-04 16:37:25', '2019-04-23 15:32:17'), - (21, '11', 'exampleTask', '11', '*/5 * * * * ?', 1, NULL, '2019-09-04 16:37:30', '2019-04-26 17:29:21'), - (22, '33', 'exampleTask', '333', '*/5 * * * * ?', 1, NULL, '2019-04-26 17:29:36', '2019-04-26 17:29:36'), - (23, '1', 'exampleTask', '3', '*/5 * * * * ?', 0, NULL, '2019-09-05 17:21:12', '2019-04-26 17:29:50'); -/*!40000 ALTER TABLE `t_quartz_task` ENABLE KEYS */; - --- 导出 表 smart-admin-dev.t_quartz_task_log 结构 -DROP TABLE IF EXISTS `t_quartz_task_log`; -CREATE TABLE IF NOT EXISTS `t_quartz_task_log` ( - `id` int NOT NULL AUTO_INCREMENT, - `task_id` int NOT NULL COMMENT '任务id', - `task_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '任务名称', - `task_params` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '任务参数', - `process_status` tinyint NOT NULL COMMENT '任务处理状态0:成功,1:失败', - `process_duration` bigint NOT NULL DEFAULT '0' COMMENT '运行时长', - `process_log` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '日志', - `ip_address` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '运行主机ip', - `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=732881 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; - --- 正在导出表 smart-admin-dev.t_quartz_task_log 的数据:~11 rows (大约) -DELETE FROM `t_quartz_task_log`; -/*!40000 ALTER TABLE `t_quartz_task_log` DISABLE KEYS */; -INSERT INTO `t_quartz_task_log` (`id`, `task_id`, `task_name`, `task_params`, `process_status`, `process_duration`, `process_log`, `ip_address`, `update_time`, `create_time`) VALUES - (732870, 9, '231233', '2131', 0, 5, NULL, '127.0.0.1', '2019-05-05 15:28:01', '2019-05-05 15:28:01'), - (732871, 9, '231233', '2131', 0, 32, NULL, '172.16.0.145', '2019-05-05 15:54:40', '2019-05-05 15:54:40'), - (732872, 22, '33', '333', 0, 31, NULL, '172.16.0.145', '2019-05-07 16:20:31', '2019-05-07 16:20:31'), - (732873, 9, '231233', '2131', 0, 304, NULL, '172.16.0.145', '2019-08-02 09:29:36', '2019-08-02 09:29:36'), - (732874, 9, '231233', '2131', 0, 24, NULL, '172.16.0.145', '2019-08-08 16:48:49', '2019-08-08 16:48:49'), - (732875, 9, '231233', '2131', 0, 147, NULL, '172.16.0.145', '2019-08-23 09:41:08', '2019-08-23 09:41:08'), - (732876, 9, '231233', '2131', 0, 610, NULL, '172.16.0.145', '2019-08-26 16:16:34', '2019-08-26 16:16:34'), - (732877, 9, '2312332', '2131', 0, 27, NULL, '172.16.0.145', '2019-09-05 14:34:51', '2019-09-05 14:34:51'), - (732878, 9, '2312332', '2131', 0, 5, NULL, '172.16.0.145', '2019-09-05 17:18:17', '2019-09-05 17:18:17'), - (732879, 9, '2312332', '2131', 0, 1, NULL, '172.16.0.145', '2019-09-05 17:20:15', '2019-09-05 17:20:15'), - (732880, 9, '2312332', '2131', 0, 5, NULL, '172.16.0.145', '2019-09-06 14:42:04', '2019-09-06 14:42:04'); -/*!40000 ALTER TABLE `t_quartz_task_log` ENABLE KEYS */; - --- 导出 表 smart-admin-dev.t_reload_item 结构 -DROP TABLE IF EXISTS `t_reload_item`; -CREATE TABLE IF NOT EXISTS `t_reload_item` ( - `tag` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '项名称', - `args` varchar(255) DEFAULT NULL COMMENT '参数 可选', - `identification` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '运行标识', - `update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (`tag`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; - --- 正在导出表 smart-admin-dev.t_reload_item 的数据:~0 rows (大约) -DELETE FROM `t_reload_item`; -/*!40000 ALTER TABLE `t_reload_item` DISABLE KEYS */; -INSERT INTO `t_reload_item` (`tag`, `args`, `identification`, `update_time`, `create_time`) VALUES - ('system_config', '234', 'xxxx', '2019-11-14 16:46:21', '2019-04-18 11:48:27'); -/*!40000 ALTER TABLE `t_reload_item` ENABLE KEYS */; - --- 导出 表 smart-admin-dev.t_reload_result 结构 -DROP TABLE IF EXISTS `t_reload_result`; -CREATE TABLE IF NOT EXISTS `t_reload_result` ( - `tag` varchar(255) NOT NULL, - `identification` varchar(255) NOT NULL COMMENT '运行标识', - `args` varchar(255) DEFAULT NULL, - `result` tinyint unsigned NOT NULL COMMENT '是否成功 ', - `exception` text, - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; - --- 正在导出表 smart-admin-dev.t_reload_result 的数据:~127 rows (大约) -DELETE FROM `t_reload_result`; -/*!40000 ALTER TABLE `t_reload_result` DISABLE KEYS */; -INSERT INTO `t_reload_result` (`tag`, `identification`, `args`, `result`, `exception`, `create_time`) VALUES - ('system_config', '23', '', 1, NULL, '2019-09-07 17:26:04'), - ('system_config', '23', '', 1, NULL, '2019-09-07 17:28:16'), - ('system_config', '23', '', 1, NULL, '2019-09-07 17:35:39'), - ('system_config', '23', '', 1, NULL, '2019-09-07 17:42:58'), - ('system_config', '23', '', 1, NULL, '2019-09-09 08:30:13'), - ('system_config', '23', '', 1, NULL, '2019-09-11 10:38:19'), - ('system_config', '23', '', 1, NULL, '2019-09-11 10:42:46'), - ('system_config', '23', '', 1, NULL, '2019-09-11 10:49:27'), - ('system_config', '23', '', 1, NULL, '2019-09-11 11:09:10'), - ('system_config', '23', '', 1, NULL, '2019-09-11 11:10:06'), - ('system_config', '23', '', 1, NULL, '2019-09-11 11:18:17'), - ('system_config', '23', '', 1, NULL, '2019-09-11 11:41:18'), - ('system_config', '23', '', 1, NULL, '2019-09-11 11:45:41'), - ('system_config', '23', '', 1, NULL, '2019-09-11 11:46:37'), - ('system_config', '23', '', 1, NULL, '2019-09-11 11:50:35'), - ('system_config', '23', '', 1, NULL, '2019-09-11 14:55:00'), - ('system_config', '23', '', 1, NULL, '2019-09-11 15:26:19'), - ('system_config', '23', '', 1, NULL, '2019-09-11 15:35:51'), - ('system_config', '23', '', 1, NULL, '2019-09-11 15:36:19'), - ('system_config', '23', '', 1, NULL, '2019-09-11 15:36:53'), - ('system_config', '23', '', 1, NULL, '2019-09-11 15:37:58'), - ('system_config', '23', '', 1, NULL, '2019-09-11 15:41:37'), - ('system_config', '23', '', 1, NULL, '2019-09-16 10:12:29'), - ('system_config', '23', '', 1, NULL, '2019-09-20 17:14:08'), - ('system_config', '23', '', 1, NULL, '2019-09-20 17:18:24'), - ('system_config', '23', '', 1, NULL, '2019-09-20 17:23:07'), - ('system_config', '23', '', 1, NULL, '2019-09-20 17:24:17'), - ('system_config', '23', '', 1, NULL, '2019-09-20 17:30:17'), - ('system_config', '23', '', 1, NULL, '2019-09-20 17:31:40'), - ('system_config', '23', '', 1, NULL, '2019-09-20 17:32:34'), - ('system_config', '23', '', 1, NULL, '2019-09-20 17:52:31'), - ('system_config', '23', '', 1, NULL, '2019-09-20 17:55:10'), - ('system_config', '23', '', 1, NULL, '2019-09-20 17:55:47'), - ('system_config', '23', '', 1, NULL, '2019-09-20 17:58:49'), - ('system_config', '23', '', 1, NULL, '2019-09-21 10:53:47'), - ('system_config', '23', '', 1, NULL, '2019-09-22 18:24:21'), - ('system_config', '23', '', 1, NULL, '2019-09-24 09:04:42'), - ('system_config', '23', '', 1, NULL, '2019-10-15 11:06:12'), - ('system_config', '23', '', 1, NULL, '2019-10-15 11:22:10'), - ('system_config', '23', '', 1, NULL, '2019-10-15 16:42:16'), - ('system_config', '23', '', 1, NULL, '2019-10-19 15:18:54'), - ('system_config', '23', '', 1, NULL, '2019-10-19 16:50:10'), - ('system_config', '23', '', 1, NULL, '2019-10-21 15:52:25'), - ('system_config', '23', '', 1, NULL, '2019-10-23 10:24:38'), - ('system_config', '23', '', 1, NULL, '2019-10-23 10:28:45'), - ('system_config', '23', '', 1, NULL, '2019-10-23 16:35:45'), - ('system_config', '23', '', 1, NULL, '2019-10-23 16:38:48'), - ('system_config', '23', '', 1, NULL, '2019-10-25 08:52:22'), - ('system_config', '23', '', 1, NULL, '2019-10-28 16:04:30'), - ('system_config', '23', '', 1, NULL, '2019-10-30 19:59:24'), - ('system_config', '23', '', 1, NULL, '2019-10-31 14:29:26'), - ('system_config', '23', '', 1, NULL, '2019-10-31 14:35:38'), - ('system_config', '23', '', 1, NULL, '2019-10-31 15:58:39'), - ('system_config', '23', '', 1, NULL, '2019-10-31 17:34:48'), - ('system_config', '23', '', 1, NULL, '2019-11-01 11:23:26'), - ('system_config', '23', '', 1, NULL, '2019-11-01 14:55:34'), - ('system_config', '23', '', 1, NULL, '2019-11-02 08:49:44'), - ('system_config', '23', '', 1, NULL, '2019-11-02 09:40:52'), - ('system_config', '23', '', 1, NULL, '2019-11-02 09:42:48'), - ('system_config', '23', '', 1, NULL, '2019-11-02 09:47:38'), - ('system_config', '23', '', 1, NULL, '2019-11-02 09:50:57'), - ('system_config', '23', '', 1, NULL, '2019-11-02 09:51:32'), - ('system_config', '23', '', 1, NULL, '2019-11-02 09:51:48'), - ('system_config', '23', '', 1, NULL, '2019-11-02 15:48:21'), - ('system_config', '23', '', 1, NULL, '2019-11-02 20:48:44'), - ('system_config', '23', '', 1, NULL, '2019-11-02 21:27:50'), - ('system_config', '23', '', 1, NULL, '2019-11-03 22:10:32'), - ('system_config', '23', '', 1, NULL, '2019-11-03 22:10:32'), - ('system_config', '23', '', 1, NULL, '2019-11-04 09:10:24'), - ('system_config', '23', '4234234', 1, NULL, '2019-11-05 10:24:51'), - ('system_config', '23', '4234234', 1, NULL, '2019-11-06 11:22:42'), - ('system_config', '23', '4234234', 1, NULL, '2019-11-06 11:25:54'), - ('system_config', '23', '4234234', 1, NULL, '2019-11-06 11:27:04'), - ('system_config', '23', '4234234', 1, NULL, '2019-11-06 11:28:00'), - ('system_config', '23', '4234234', 1, NULL, '2019-11-06 11:34:06'), - ('system_config', '23', '4234234', 1, NULL, '2019-11-06 11:34:43'), - ('system_config', '23', '4234234', 1, NULL, '2019-11-06 11:53:11'), - ('system_config', '23', '4234234', 1, NULL, '2019-11-06 11:56:05'), - ('system_config', '23', '4234234', 1, NULL, '2019-11-06 13:52:39'), - ('system_config', '23', '4234234', 1, NULL, '2019-11-06 15:29:29'), - ('system_config', '23', '4234234', 1, NULL, '2019-11-06 16:05:36'), - ('system_config', '23', '4234234', 1, NULL, '2019-11-06 16:06:13'), - ('system_config', '23', '4234234', 1, NULL, '2019-11-06 16:13:22'), - ('system_config', '23', '4234234', 1, NULL, '2019-11-06 16:19:38'), - ('system_config', '23', '4234234', 1, NULL, '2019-11-06 16:21:37'), - ('system_config', '23', '4234234', 1, NULL, '2019-11-06 16:22:23'), - ('system_config', '23', '4234234', 1, NULL, '2019-11-08 08:50:08'), - ('system_config', '23', '4234234', 1, NULL, '2019-11-08 13:37:34'), - ('system_config', '23', '4234234', 1, NULL, '2019-11-09 08:35:08'), - ('system_config', '23', '4234234', 1, NULL, '2019-11-09 08:54:38'), - ('system_config', '23', '4234234', 1, NULL, '2019-11-09 09:00:32'), - ('system_config', '23', '4234234', 1, NULL, '2019-11-09 09:01:24'), - ('system_config', '23', '4234234', 1, NULL, '2019-11-09 09:24:16'), - ('system_config', '23', '4234234', 1, NULL, '2019-11-09 09:26:46'), - ('system_config', '23', '4234234', 1, NULL, '2019-11-09 09:43:13'), - ('system_config', '23', '4234234', 1, NULL, '2019-11-09 09:44:48'), - ('system_config', '23', '4234234', 1, NULL, '2019-11-09 10:28:30'), - ('system_config', '23', '4234234', 1, NULL, '2019-11-09 11:24:19'), - ('system_config', '23', '4234234', 1, NULL, '2019-11-11 09:40:42'), - ('system_config', '23', '4234234', 1, NULL, '2019-11-13 17:25:42'), - ('system_config', '23343', '2423', 1, NULL, '2019-11-13 20:29:19'), - ('system_config', '23343', '2423', 1, NULL, '2019-11-13 20:29:23'), - ('system_config', '23343', '234', 1, NULL, '2019-11-14 11:43:57'), - ('system_config', '23343', '234', 1, NULL, '2019-11-14 11:50:18'), - ('system_config', '23343', '234', 1, NULL, '2019-11-14 11:51:13'), - ('system_config', '23343', '234', 1, NULL, '2019-11-14 11:52:03'), - ('system_config', '23343', '234', 1, NULL, '2019-11-14 11:53:02'), - ('system_config', '23343', '234', 1, NULL, '2019-11-14 13:49:11'), - ('system_config', '23343', '234', 1, NULL, '2019-11-14 13:51:05'), - ('system_config', '23343', '234', 1, NULL, '2019-11-14 13:53:53'), - ('system_config', '23343', '234', 1, NULL, '2019-11-14 13:55:57'), - ('system_config', '23343', '234', 1, NULL, '2019-11-14 16:15:44'), - ('system_config', '23343', '234', 1, NULL, '2019-11-14 16:39:36'), - ('system_config', '23343234234', '234', 1, NULL, '2019-11-14 16:41:05'), - ('system_config', '23343234234', '234', 1, NULL, '2019-11-14 16:41:05'), - ('system_config', 'aaaa', '234', 1, NULL, '2019-11-14 16:41:20'), - ('system_config', 'aaaa', '234', 1, NULL, '2019-11-14 16:41:25'), - ('system_config', '111', '234', 1, NULL, '2019-11-14 16:43:20'), - ('system_config', '111', '234', 1, NULL, '2019-11-14 16:44:13'), - ('system_config', 'xxxx', '234', 1, NULL, '2019-11-14 16:46:26'), - ('system_config', 'xxxx', '234', 1, NULL, '2019-11-14 16:46:39'), - ('system_config', 'xxxx', '234', 1, NULL, '2019-11-14 16:48:47'), - ('system_config', 'xxxx', '234', 1, NULL, '2019-11-15 14:39:55'), - ('system_config', 'xxxx', '234', 1, NULL, '2019-11-16 08:47:43'), - ('system_config', 'xxxx', '234', 1, NULL, '2019-11-16 17:12:10'), - ('system_config', 'xxxx', '234', 1, NULL, '2019-11-16 18:02:57'), - ('system_config', 'xxxx', '234', 1, NULL, '2020-12-14 15:09:53'), - ('system_config', 'xxxx', '234', 1, NULL, '2020-12-14 15:13:33'), - ('system_config', 'xxxx', '234', 1, NULL, '2020-12-14 15:14:09'), - ('system_config', 'xxxx', '234', 1, NULL, '2020-12-14 15:16:23'); -/*!40000 ALTER TABLE `t_reload_result` ENABLE KEYS */; - --- 导出 表 smart-admin-dev.t_role 结构 -DROP TABLE IF EXISTS `t_role`; -CREATE TABLE IF NOT EXISTS `t_role` ( - `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', - `role_name` varchar(20) NOT NULL COMMENT '角色名称', - `remark` varchar(255) DEFAULT NULL COMMENT '角色描述', - `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=50 DEFAULT CHARSET=utf8 COMMENT='角色表'; - --- 正在导出表 smart-admin-dev.t_role 的数据:~14 rows (大约) -DELETE FROM `t_role`; -/*!40000 ALTER TABLE `t_role` DISABLE KEYS */; -INSERT INTO `t_role` (`id`, `role_name`, `remark`, `update_time`, `create_time`) VALUES - (1, '管理员', '', '2019-06-21 12:09:34', '2019-06-21 12:09:34'), - (34, '销售', '', '2019-08-30 09:30:50', '2019-08-30 09:30:50'), - (35, '总经理', '', '2019-08-30 09:31:05', '2019-08-30 09:31:05'), - (36, '董事长', '', '2019-08-30 09:31:11', '2019-08-30 09:31:11'), - (37, '财务', '', '2019-08-30 09:31:16', '2019-08-30 09:31:16'), - (38, '运营', '', '2019-08-30 09:31:22', '2019-08-30 09:31:22'), - (40, '测试角色1', '测试角色1', '2019-09-05 15:05:38', '2019-09-05 15:05:38'), - (41, '测试角色2', '测试角色2', '2019-09-05 15:05:43', '2019-09-05 15:05:43'), - (42, '测试角色3', '测试角色3', '2019-09-05 15:05:49', '2019-09-05 15:05:49'), - (43, '测试角色4', '测试角色4', '2019-09-05 15:05:56', '2019-09-05 15:05:56'), - (45, '测试角色6', '测试角色6', '2019-09-05 15:06:06', '2019-09-05 15:06:06'), - (46, '测试角色7', '测试角色7', '2019-09-05 15:06:18', '2019-09-05 15:06:18'), - (47, '测试角色8', '测试角色8', '2019-09-05 15:06:25', '2019-09-05 15:06:25'), - (48, '测试角色9', '测试角色9', '2019-11-15 17:06:11', '2019-09-05 15:06:30'); -/*!40000 ALTER TABLE `t_role` ENABLE KEYS */; - --- 导出 表 smart-admin-dev.t_role_data_scope 结构 -DROP TABLE IF EXISTS `t_role_data_scope`; -CREATE TABLE IF NOT EXISTS `t_role_data_scope` ( - `id` int NOT NULL AUTO_INCREMENT, - `data_scope_type` int NOT NULL COMMENT '数据范围id', - `view_type` int NOT NULL COMMENT '数据范围类型', - `role_id` int NOT NULL COMMENT '角色id', - `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; - --- 正在导出表 smart-admin-dev.t_role_data_scope 的数据:~4 rows (大约) -DELETE FROM `t_role_data_scope`; -/*!40000 ALTER TABLE `t_role_data_scope` DISABLE KEYS */; -INSERT INTO `t_role_data_scope` (`id`, `data_scope_type`, `view_type`, `role_id`, `update_time`, `create_time`) VALUES - (5, 0, 2, 9, '2019-04-29 15:01:04', '2019-04-29 15:01:04'), - (14, 0, 2, 40, '2019-09-05 15:25:37', '2019-09-05 15:25:37'), - (15, 0, 0, 1, '2019-09-06 08:35:45', '2019-09-06 08:35:45'), - (16, 0, 3, 34, '2019-11-06 16:08:02', '2019-11-06 16:08:02'); -/*!40000 ALTER TABLE `t_role_data_scope` ENABLE KEYS */; - --- 导出 表 smart-admin-dev.t_role_employee 结构 -DROP TABLE IF EXISTS `t_role_employee`; -CREATE TABLE IF NOT EXISTS `t_role_employee` ( - `id` int NOT NULL AUTO_INCREMENT, - `role_id` int NOT NULL COMMENT '角色id', - `employee_id` int NOT NULL COMMENT '员工id', - `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=214 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='角色员工功能表'; - --- 正在导出表 smart-admin-dev.t_role_employee 的数据:~25 rows (大约) -DELETE FROM `t_role_employee`; -/*!40000 ALTER TABLE `t_role_employee` DISABLE KEYS */; -INSERT INTO `t_role_employee` (`id`, `role_id`, `employee_id`, `update_time`, `create_time`) VALUES - (121, 38, 22, '2019-09-04 09:23:09', '2019-09-04 09:23:09'), - (130, 1, 30, '2019-09-05 15:32:40', '2019-09-05 15:32:40'), - (131, 1, 17, '2019-09-05 15:32:40', '2019-09-05 15:32:40'), - (132, 1, 26, '2019-09-05 15:32:40', '2019-09-05 15:32:40'), - (135, 1, 12, '2019-09-05 15:32:40', '2019-09-05 15:32:40'), - (136, 1, 11, '2019-09-05 15:32:40', '2019-09-05 15:32:40'), - (137, 1, 16, '2019-09-05 15:32:40', '2019-09-05 15:32:40'), - (138, 1, 18, '2019-09-05 15:32:40', '2019-09-05 15:32:40'), - (139, 1, 19, '2019-09-05 15:32:40', '2019-09-05 15:32:40'), - (140, 1, 20, '2019-09-05 15:32:40', '2019-09-05 15:32:40'), - (141, 1, 23, '2019-09-05 15:32:40', '2019-09-05 15:32:40'), - (147, 1, 35, '2019-09-06 09:00:27', '2019-09-06 09:00:27'), - (148, 40, 35, '2019-09-06 09:00:27', '2019-09-06 09:00:27'), - (165, 40, 32, '2019-11-08 10:39:35', '2019-11-08 10:39:35'), - (166, 34, 32, '2019-11-08 10:39:35', '2019-11-08 10:39:35'), - (167, 38, 32, '2019-11-08 10:39:35', '2019-11-08 10:39:35'), - (168, 38, 36, '2019-11-08 10:40:16', '2019-11-08 10:40:16'), - (169, 40, 36, '2019-11-08 10:40:16', '2019-11-08 10:40:16'), - (170, 37, 36, '2019-11-08 10:40:16', '2019-11-08 10:40:16'), - (174, 38, 37, '2019-11-08 11:05:39', '2019-11-08 11:05:39'), - (175, 42, 37, '2019-11-08 11:05:39', '2019-11-08 11:05:39'), - (188, 1, 1, '2019-11-15 16:05:33', '2019-11-15 16:05:33'), - (211, 40, 38, '2019-11-15 16:54:54', '2019-11-15 16:54:54'), - (212, 34, 29, '2019-11-16 18:04:04', '2019-11-16 18:04:04'), - (213, 45, 29, '2019-11-16 18:04:04', '2019-11-16 18:04:04'); -/*!40000 ALTER TABLE `t_role_employee` ENABLE KEYS */; - --- 导出 表 smart-admin-dev.t_role_privilege 结构 -DROP TABLE IF EXISTS `t_role_privilege`; -CREATE TABLE IF NOT EXISTS `t_role_privilege` ( - `id` int NOT NULL AUTO_INCREMENT, - `role_id` int NOT NULL COMMENT '角色id', - `privilege_key` varchar(1000) NOT NULL COMMENT '权限key', - `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=10835 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='角色权限功能表'; - --- 正在导出表 smart-admin-dev.t_role_privilege 的数据:~322 rows (大约) -DELETE FROM `t_role_privilege`; -/*!40000 ALTER TABLE `t_role_privilege` DISABLE KEYS */; -INSERT INTO `t_role_privilege` (`id`, `role_id`, `privilege_key`, `update_time`, `create_time`) VALUES - (3506, 48, 'search-position', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3507, 48, 'add-position', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3508, 48, 'update-position', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3509, 48, 'delete-position', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3510, 48, 'add-role', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3511, 48, 'delete-role', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3512, 48, 'update-role', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3513, 48, 'update-role-privilege', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3514, 48, 'add-employee-role', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3515, 48, 'delete-employee-role', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3516, 48, 'delete-employee-role-batch', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3517, 48, 'search-employee-list', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3518, 48, 'query-data-scope', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3519, 48, 'update-data-scope', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3520, 48, 'add-department', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3521, 48, 'update-department', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3522, 48, 'delete-department', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3523, 48, 'search-department', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3524, 48, 'add-employee', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3525, 48, 'update-employee', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3526, 48, 'delete-employee', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3527, 48, 'disabled-employee', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3528, 48, 'reset-employee-password', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3529, 48, 'set-employee-role', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3530, 48, 'disabled-employee-batch', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3531, 48, 'update-employee-role', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3533, 48, 'system-params-search', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3534, 48, 'system-params-add', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3535, 48, 'system-config-update', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3536, 48, 'system-config-search', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3537, 48, 'privilegeMainSearch', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3538, 48, 'privilegeMainUpdate', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3539, 48, 'task-search', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3540, 48, 'task-refresh', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3541, 48, 'task-add', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3542, 48, 'task-update', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3543, 48, 'task-pause', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3544, 48, 'task-resume', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3545, 48, 'task-run', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3546, 48, 'task-query-log', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3547, 48, 'task-delete', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3548, 48, 'systemCodeVersionsQuery', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3552, 48, 'roleOneTwo-add', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3555, 48, 'apiDocument', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3557, 48, 'reload', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3559, 48, 'smart-reload-search', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3560, 48, 'smart-reload-update', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3561, 48, 'smart-reload-result', '2019-09-06 15:28:07', '2019-09-06 15:28:07'), - (3575, 45, 'task-search', '2019-09-06 15:28:17', '2019-09-06 15:28:17'), - (3576, 45, 'task-refresh', '2019-09-06 15:28:17', '2019-09-06 15:28:17'), - (3577, 45, 'task-add', '2019-09-06 15:28:17', '2019-09-06 15:28:17'), - (3578, 45, 'task-update', '2019-09-06 15:28:17', '2019-09-06 15:28:17'), - (3579, 45, 'task-pause', '2019-09-06 15:28:17', '2019-09-06 15:28:17'), - (3580, 45, 'task-resume', '2019-09-06 15:28:17', '2019-09-06 15:28:17'), - (3581, 45, 'task-run', '2019-09-06 15:28:17', '2019-09-06 15:28:17'), - (3582, 45, 'task-query-log', '2019-09-06 15:28:17', '2019-09-06 15:28:17'), - (3583, 45, 'task-delete', '2019-09-06 15:28:17', '2019-09-06 15:28:17'), - (3586, 45, 'add-role', '2019-09-06 15:28:17', '2019-09-06 15:28:17'), - (3587, 45, 'delete-role', '2019-09-06 15:28:17', '2019-09-06 15:28:17'), - (3588, 45, 'update-role', '2019-09-06 15:28:17', '2019-09-06 15:28:17'), - (3589, 45, 'update-role-privilege', '2019-09-06 15:28:17', '2019-09-06 15:28:17'), - (3590, 45, 'add-employee-role', '2019-09-06 15:28:17', '2019-09-06 15:28:17'), - (3591, 45, 'delete-employee-role', '2019-09-06 15:28:17', '2019-09-06 15:28:17'), - (3592, 45, 'delete-employee-role-batch', '2019-09-06 15:28:17', '2019-09-06 15:28:17'), - (3593, 45, 'search-employee-list', '2019-09-06 15:28:17', '2019-09-06 15:28:17'), - (3594, 45, 'query-data-scope', '2019-09-06 15:28:17', '2019-09-06 15:28:17'), - (3595, 45, 'update-data-scope', '2019-09-06 15:28:17', '2019-09-06 15:28:17'), - (3597, 45, 'search-position', '2019-09-06 15:28:17', '2019-09-06 15:28:17'), - (3598, 45, 'add-position', '2019-09-06 15:28:17', '2019-09-06 15:28:17'), - (3599, 45, 'update-position', '2019-09-06 15:28:17', '2019-09-06 15:28:17'), - (3600, 45, 'delete-position', '2019-09-06 15:28:17', '2019-09-06 15:28:17'), - (3602, 45, 'add-department', '2019-09-06 15:28:17', '2019-09-06 15:28:17'), - (3603, 45, 'set-employee-role', '2019-09-06 15:28:17', '2019-09-06 15:28:17'), - (3604, 45, 'update-department', '2019-09-06 15:28:17', '2019-09-06 15:28:17'), - (3605, 45, 'delete-department', '2019-09-06 15:28:17', '2019-09-06 15:28:17'), - (3606, 45, 'search-department', '2019-09-06 15:28:17', '2019-09-06 15:28:17'), - (3607, 45, 'add-employee', '2019-09-06 15:28:17', '2019-09-06 15:28:17'), - (3608, 45, 'update-employee', '2019-09-06 15:28:17', '2019-09-06 15:28:17'), - (3609, 45, 'disabled-employee', '2019-09-06 15:28:17', '2019-09-06 15:28:17'), - (3610, 45, 'disabled-employee-batch', '2019-09-06 15:28:17', '2019-09-06 15:28:17'), - (3611, 45, 'update-employee-role', '2019-09-06 15:28:17', '2019-09-06 15:28:17'), - (3612, 45, 'delete-employee', '2019-09-06 15:28:17', '2019-09-06 15:28:17'), - (3613, 45, 'reset-employee-password', '2019-09-06 15:28:17', '2019-09-06 15:28:17'), - (8112, 41, 'SystemSetting', '2019-11-08 11:21:22', '2019-11-08 11:21:22'), - (8113, 41, 'SystemPrivilege', '2019-11-08 11:21:22', '2019-11-08 11:21:22'), - (8114, 41, 'privilege-main-update', '2019-11-08 11:21:22', '2019-11-08 11:21:22'), - (8115, 41, 'privilege-main-search', '2019-11-08 11:21:22', '2019-11-08 11:21:22'), - (8549, 35, 'SystemSetting', '2019-11-15 15:47:52', '2019-11-15 15:47:52'), - (8550, 35, 'SystemConfig', '2019-11-15 15:47:52', '2019-11-15 15:47:52'), - (8551, 35, 'SystemPrivilege', '2019-11-15 15:47:52', '2019-11-15 15:47:52'), - (8552, 35, 'Notice', '2019-11-15 15:47:52', '2019-11-15 15:47:52'), - (8553, 35, 'NoticeList', '2019-11-15 15:47:52', '2019-11-15 15:47:52'), - (8554, 35, 'PersonNotice', '2019-11-15 15:47:52', '2019-11-15 15:47:52'), - (8555, 35, 'Email', '2019-11-15 15:47:52', '2019-11-15 15:47:52'), - (8556, 35, 'EmailList', '2019-11-15 15:47:52', '2019-11-15 15:47:52'), - (8557, 35, 'UserLog', '2019-11-15 15:47:52', '2019-11-15 15:47:52'), - (8558, 35, 'UserOperateLog', '2019-11-15 15:47:52', '2019-11-15 15:47:52'), - (8559, 35, 'UserLoginLog', '2019-11-15 15:47:52', '2019-11-15 15:47:52'), - (8560, 35, 'system-config-search', '2019-11-15 15:47:52', '2019-11-15 15:47:52'), - (8561, 35, 'privilege-main-update', '2019-11-15 15:47:52', '2019-11-15 15:47:52'), - (8562, 35, 'privilege-main-search', '2019-11-15 15:47:52', '2019-11-15 15:47:52'), - (8563, 35, 'notice-query', '2019-11-15 15:47:52', '2019-11-15 15:47:52'), - (8564, 35, 'notice-add', '2019-11-15 15:47:52', '2019-11-15 15:47:52'), - (8565, 35, 'notice-edit', '2019-11-15 15:47:52', '2019-11-15 15:47:52'), - (8566, 35, 'notice-delete', '2019-11-15 15:47:52', '2019-11-15 15:47:52'), - (8567, 35, 'person-notice-query', '2019-11-15 15:47:52', '2019-11-15 15:47:52'), - (8568, 35, 'person-notice-detail', '2019-11-15 15:47:52', '2019-11-15 15:47:52'), - (8569, 35, 'email-query', '2019-11-15 15:47:52', '2019-11-15 15:47:52'), - (8570, 35, 'email-add', '2019-11-15 15:47:52', '2019-11-15 15:47:52'), - (8571, 35, 'email-update', '2019-11-15 15:47:52', '2019-11-15 15:47:52'), - (8572, 35, 'user-operate-log-search', '2019-11-15 15:47:52', '2019-11-15 15:47:52'), - (8573, 35, 'user-login-log-search', '2019-11-15 15:47:52', '2019-11-15 15:47:52'), - (8574, 35, 'system-config-update', '2019-11-15 15:47:52', '2019-11-15 15:47:52'), - (9005, 37, 'SystemSetting', '2019-11-15 16:33:09', '2019-11-15 16:33:09'), - (9006, 37, 'SystemConfig', '2019-11-15 16:33:09', '2019-11-15 16:33:09'), - (9007, 37, 'system-params-search', '2019-11-15 16:33:09', '2019-11-15 16:33:09'), - (9008, 37, 'system-params-add', '2019-11-15 16:33:09', '2019-11-15 16:33:09'), - (9009, 37, 'system-config-update', '2019-11-15 16:33:09', '2019-11-15 16:33:09'), - (9368, 34, 'SystemSetting', '2019-11-15 16:45:39', '2019-11-15 16:45:39'), - (9369, 34, 'SystemConfig', '2019-11-15 16:45:39', '2019-11-15 16:45:39'), - (9370, 34, 'SystemPrivilege', '2019-11-15 16:45:39', '2019-11-15 16:45:39'), - (9371, 34, 'system-params-search', '2019-11-15 16:45:39', '2019-11-15 16:45:39'), - (9372, 34, 'system-params-add', '2019-11-15 16:45:39', '2019-11-15 16:45:39'), - (9373, 34, 'privilege-main-search', '2019-11-15 16:45:39', '2019-11-15 16:45:39'), - (9374, 34, 'Task', '2019-11-15 16:45:39', '2019-11-15 16:45:39'), - (9375, 34, 'TaskList', '2019-11-15 16:45:39', '2019-11-15 16:45:39'), - (9376, 34, 'task-search', '2019-11-15 16:45:39', '2019-11-15 16:45:39'), - (9377, 34, 'task-refresh', '2019-11-15 16:45:39', '2019-11-15 16:45:39'), - (9378, 34, 'task-add', '2019-11-15 16:45:39', '2019-11-15 16:45:39'), - (9379, 34, 'task-update', '2019-11-15 16:45:39', '2019-11-15 16:45:39'), - (9380, 34, 'task-pause', '2019-11-15 16:45:39', '2019-11-15 16:45:39'), - (9381, 34, 'task-resume', '2019-11-15 16:45:39', '2019-11-15 16:45:39'), - (9382, 34, 'task-run', '2019-11-15 16:45:39', '2019-11-15 16:45:39'), - (9383, 34, 'task-query-log', '2019-11-15 16:45:39', '2019-11-15 16:45:39'), - (9384, 34, 'task-delete', '2019-11-15 16:45:39', '2019-11-15 16:45:39'), - (9536, 42, 'Task', '2019-11-15 16:50:40', '2019-11-15 16:50:40'), - (9537, 42, 'TaskList', '2019-11-15 16:50:40', '2019-11-15 16:50:40'), - (9538, 42, 'task-search', '2019-11-15 16:50:40', '2019-11-15 16:50:40'), - (9539, 42, 'task-add', '2019-11-15 16:50:40', '2019-11-15 16:50:40'), - (9540, 42, 'task-update', '2019-11-15 16:50:40', '2019-11-15 16:50:40'), - (9541, 42, 'task-query-log', '2019-11-15 16:50:40', '2019-11-15 16:50:40'), - (9674, 38, 'Employee', '2019-11-15 16:53:47', '2019-11-15 16:53:47'), - (9675, 38, 'PositionList', '2019-11-15 16:53:47', '2019-11-15 16:53:47'), - (9676, 38, 'SystemSetting', '2019-11-15 16:53:47', '2019-11-15 16:53:47'), - (9677, 38, 'SystemConfig', '2019-11-15 16:53:47', '2019-11-15 16:53:47'), - (9678, 38, 'Notice', '2019-11-15 16:53:47', '2019-11-15 16:53:47'), - (9679, 38, 'PersonNotice', '2019-11-15 16:53:47', '2019-11-15 16:53:47'), - (9680, 38, 'Email', '2019-11-15 16:53:47', '2019-11-15 16:53:47'), - (9681, 38, 'EmailList', '2019-11-15 16:53:47', '2019-11-15 16:53:47'), - (9682, 38, 'SendMail', '2019-11-15 16:53:47', '2019-11-15 16:53:47'), - (9683, 38, 'Monitor', '2019-11-15 16:53:47', '2019-11-15 16:53:47'), - (9684, 38, 'OnlineUser', '2019-11-15 16:53:47', '2019-11-15 16:53:47'), - (9685, 38, 'Task', '2019-11-15 16:53:47', '2019-11-15 16:53:47'), - (9686, 38, 'TaskList', '2019-11-15 16:53:47', '2019-11-15 16:53:47'), - (9687, 38, 'KeepAlive', '2019-11-15 16:53:47', '2019-11-15 16:53:47'), - (9688, 38, 'KeepAliveContentList', '2019-11-15 16:53:47', '2019-11-15 16:53:47'), - (9689, 38, 'HeartBeat', '2019-11-15 16:53:47', '2019-11-15 16:53:47'), - (9690, 38, 'HeartBeatList', '2019-11-15 16:53:47', '2019-11-15 16:53:47'), - (9691, 38, 'File', '2019-11-15 16:53:47', '2019-11-15 16:53:47'), - (9692, 38, 'FileList', '2019-11-15 16:53:47', '2019-11-15 16:53:47'), - (9693, 38, 'search-position', '2019-11-15 16:53:47', '2019-11-15 16:53:47'), - (9694, 38, 'system-params-search', '2019-11-15 16:53:47', '2019-11-15 16:53:47'), - (9695, 38, 'system-config-update', '2019-11-15 16:53:47', '2019-11-15 16:53:47'), - (9696, 38, 'system-config-search', '2019-11-15 16:53:47', '2019-11-15 16:53:47'), - (9697, 38, 'person-notice-query', '2019-11-15 16:53:47', '2019-11-15 16:53:47'), - (9698, 38, 'person-notice-detail', '2019-11-15 16:53:47', '2019-11-15 16:53:47'), - (9699, 38, 'email-query', '2019-11-15 16:53:47', '2019-11-15 16:53:47'), - (9700, 38, 'email-send', '2019-11-15 16:53:47', '2019-11-15 16:53:47'), - (9701, 38, 'online-user-search', '2019-11-15 16:53:47', '2019-11-15 16:53:47'), - (9702, 38, 'task-search', '2019-11-15 16:53:47', '2019-11-15 16:53:47'), - (9703, 38, 'heart-beat-query', '2019-11-15 16:53:47', '2019-11-15 16:53:47'), - (9704, 38, 'file-filePage-query', '2019-11-15 16:53:47', '2019-11-15 16:53:47'), - (9705, 38, 'file-filePage-upload', '2019-11-15 16:53:47', '2019-11-15 16:53:47'), - (9706, 38, 'task-refresh', '2019-11-15 16:53:47', '2019-11-15 16:53:47'), - (10585, 40, 'Employee', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10586, 40, 'RoleManage', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10587, 40, 'PositionList', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10588, 40, 'RoleEmployeeManage', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10589, 40, 'SystemSetting', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10590, 40, 'SystemConfig', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10591, 40, 'SystemPrivilege', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10592, 40, 'Notice', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10593, 40, 'NoticeList', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10594, 40, 'PersonNotice', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10595, 40, 'Email', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10596, 40, 'SendMail', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10597, 40, 'Task', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10598, 40, 'TaskList', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10599, 40, 'add-role', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10600, 40, 'delete-role', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10601, 40, 'update-role', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10602, 40, 'update-role-privilege', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10603, 40, 'add-employee-role', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10604, 40, 'search-employee-list', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10605, 40, 'delete-employee-role', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10606, 40, 'delete-employee-role-batch', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10607, 40, 'query-data-scope', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10608, 40, 'update-data-scope', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10609, 40, 'search-position', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10610, 40, 'add-position', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10611, 40, 'update-position', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10612, 40, 'search-department', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10613, 40, 'system-params-add', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10614, 40, 'system-config-search', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10615, 40, 'privilege-main-search', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10616, 40, 'notice-query', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10617, 40, 'notice-add', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10618, 40, 'notice-edit', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10619, 40, 'notice-delete', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10620, 40, 'notice-detail', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10621, 40, 'notice-send', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10622, 40, 'person-notice-query', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10623, 40, 'email-send', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10624, 40, 'task-search', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10625, 40, 'task-refresh', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10626, 40, 'task-add', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10627, 40, 'task-update', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10628, 40, 'task-query-log', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10629, 40, 'task-delete', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10630, 40, 'delete-department', '2019-11-15 17:19:42', '2019-11-15 17:19:42'), - (10733, 1, 'Employee', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10734, 1, 'RoleManage', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10735, 1, 'PositionList', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10736, 1, 'RoleEmployeeManage', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10737, 1, 'SystemSetting', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10738, 1, 'SystemConfig', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10739, 1, 'SystemPrivilege', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10740, 1, 'Notice', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10741, 1, 'NoticeList', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10742, 1, 'PersonNotice', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10743, 1, 'Email', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10744, 1, 'EmailList', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10745, 1, 'SendMail', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10746, 1, 'UserLog', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10747, 1, 'UserOperateLog', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10748, 1, 'UserLoginLog', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10749, 1, 'Monitor', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10750, 1, 'OnlineUser', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10751, 1, 'Sql', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10752, 1, 'Task', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10753, 1, 'TaskList', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10754, 1, 'Reload', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10755, 1, 'SmartReloadList', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10756, 1, 'ApiDoc', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10757, 1, 'Swagger', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10758, 1, 'ThreeRouter', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10759, 1, 'LevelTwo', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10761, 1, 'RoleTwoTwo', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10762, 1, 'RoleOneOne', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10763, 1, 'KeepAlive', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10764, 1, 'KeepAliveContentList', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10765, 1, 'KeepAliveAddContent', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10766, 1, 'HeartBeat', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10767, 1, 'HeartBeatList', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10768, 1, 'File', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10769, 1, 'FileList', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10770, 1, 'add-role', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10771, 1, 'delete-role', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10772, 1, 'update-role', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10773, 1, 'update-role-privilege', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10774, 1, 'add-employee-role', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10775, 1, 'search-employee-list', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10776, 1, 'delete-employee-role', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10777, 1, 'delete-employee-role-batch', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10778, 1, 'query-data-scope', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10779, 1, 'update-data-scope', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10780, 1, 'search-position', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10781, 1, 'add-position', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10782, 1, 'update-position', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10783, 1, 'delete-position', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10784, 1, 'add-department', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10785, 1, 'update-department', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10786, 1, 'delete-department', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10787, 1, 'search-department', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10788, 1, 'add-employee', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10789, 1, 'update-employee', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10790, 1, 'disabled-employee', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10791, 1, 'disabled-employee-batch', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10792, 1, 'update-employee-role', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10793, 1, 'reset-employee-password', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10794, 1, 'delete-employee', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10795, 1, 'system-params-search', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10796, 1, 'system-params-add', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10797, 1, 'system-config-update', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10798, 1, 'system-config-search', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10799, 1, 'privilege-main-update', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10800, 1, 'privilege-main-search', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10801, 1, 'notice-query', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10802, 1, 'notice-add', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10803, 1, 'notice-edit', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10804, 1, 'notice-delete', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10805, 1, 'notice-detail', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10806, 1, 'notice-send', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10807, 1, 'person-notice-query', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10808, 1, 'person-notice-detail', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10809, 1, 'email-query', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10810, 1, 'email-add', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10811, 1, 'email-update', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10812, 1, 'email-delete', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10813, 1, 'email-send', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10814, 1, 'user-operate-log-search', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10815, 1, 'user-operate-log-detail', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10816, 1, 'user-operate-log-delete', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10817, 1, 'user-login-log-search', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10818, 1, 'user-login-log-delete', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10819, 1, 'online-user-search', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10820, 1, 'task-search', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10821, 1, 'task-refresh', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10822, 1, 'task-add', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10823, 1, 'task-update', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10824, 1, 'task-pause', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10825, 1, 'task-resume', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10826, 1, 'task-run', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10827, 1, 'task-query-log', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10828, 1, 'task-delete', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10829, 1, 'smart-reload-search', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10830, 1, 'smart-reload-update', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10831, 1, 'smart-reload-result', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10832, 1, 'heart-beat-query', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10833, 1, 'file-filePage-query', '2019-11-16 18:04:10', '2019-11-16 18:04:10'), - (10834, 1, 'file-filePage-upload', '2019-11-16 18:04:10', '2019-11-16 18:04:10'); -/*!40000 ALTER TABLE `t_role_privilege` ENABLE KEYS */; - --- 导出 表 smart-admin-dev.t_system_config 结构 -DROP TABLE IF EXISTS `t_system_config`; -CREATE TABLE IF NOT EXISTS `t_system_config` ( - `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', - `config_name` varchar(255) NOT NULL COMMENT '参数名字', - `config_key` varchar(255) NOT NULL COMMENT '参数key', - `config_value` text NOT NULL, - `config_group` varchar(255) NOT NULL COMMENT '参数类别', - `is_using` int NOT NULL COMMENT '是否使用0 否 1 是', - `remark` varchar(255) DEFAULT NULL, - `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '上次修改时间', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; - --- 正在导出表 smart-admin-dev.t_system_config 的数据:~8 rows (大约) -DELETE FROM `t_system_config`; -/*!40000 ALTER TABLE `t_system_config` DISABLE KEYS */; -INSERT INTO `t_system_config` (`id`, `config_name`, `config_key`, `config_value`, `config_group`, `is_using`, `remark`, `update_time`, `create_time`) VALUES - (1, '超级管理员', 'employee_superman', '12,13,1', 'employee', 1, '123r8566456', '2019-11-14 16:40:48', '2018-08-18 16:28:03'), - (13, '本地上传URL前缀', 'local_upload_url_prefix', 'http://172.16.0.145/smartAdmin/file/', 'upload', 1, '', '2019-09-04 16:23:49', '2019-04-26 17:06:53'), - (14, '阿里云上传配置', 'ali_oss', '{"accessKeyId":"","accessKeySecret":"","bucketName":"sit","endpoint":"http://oss-cn-beijing.aliyuncs.com"}', 'upload', 1, 'eefwfwfds', '2019-11-16 18:04:30', '2019-05-11 18:00:06'), - (15, '邮件发配置', 'email_config', '{"password":"smartadmin","smtpHost":"smtp.163.com","username":"smartadmin1024@163.com"}', 'email', 1, NULL, '2019-09-04 16:42:17', '2019-05-13 16:57:48'), - (16, '七牛云上传配置', 'qi_niu_oss', '{"accessKeyId":"rX7HgY1ZLpUD25JrA-uwMM_jj-","accessKeySecret":"","bucketName":"sun-smart-admin","endpoint":"http://puvpyay08.bkt.clouddn.com"}', 'upload', 1, NULL, '2019-11-16 18:04:42', '2019-07-19 16:05:56'), - (17, 'test', 'ww_1', 'ewr', '3', 1, 'testoo', '2019-11-08 09:43:36', '2019-11-08 09:27:19'), - (18, '4234', '42342', '423423', '23423', 1, '423423111111111111111111111111111111111111423423111111111111111111111111111111111111423423111111111111111111111111111111111111423423111111111111111111111111111111111111423423111111111111111111111111111111111111', '2019-11-14 14:58:39', '2019-11-14 11:22:49'), - (19, 'test323@', 'test', '123456', '11_', 1, 'gggggg', '2019-11-15 16:24:52', '2019-11-15 16:24:52'); -/*!40000 ALTER TABLE `t_system_config` ENABLE KEYS */; - --- 导出 表 smart-admin-dev.t_user_login_log 结构 -DROP TABLE IF EXISTS `t_user_login_log`; -CREATE TABLE IF NOT EXISTS `t_user_login_log` ( - `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', - `user_id` int NOT NULL COMMENT '员工id', - `user_name` varchar(50) NOT NULL COMMENT '用户名', - `remote_ip` varchar(50) DEFAULT NULL COMMENT '用户ip', - `remote_port` int DEFAULT NULL COMMENT '用户端口', - `remote_browser` varchar(100) DEFAULT NULL COMMENT '浏览器', - `remote_os` varchar(50) DEFAULT NULL COMMENT '操作系统', - `login_status` tinyint NOT NULL COMMENT '登录状态 0 失败 1成功', - `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - PRIMARY KEY (`id`), - KEY `customer_id` (`user_id`) USING BTREE, - KEY `auditor_id` (`remote_browser`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=1743 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户登录日志'; - --- 正在导出表 smart-admin-dev.t_user_login_log 的数据:~122 rows (大约) -DELETE FROM `t_user_login_log`; -/*!40000 ALTER TABLE `t_user_login_log` DISABLE KEYS */; -INSERT INTO `t_user_login_log` (`id`, `user_id`, `user_name`, `remote_ip`, `remote_port`, `remote_browser`, `remote_os`, `login_status`, `update_time`, `create_time`) VALUES - (1501, 30, '耿为刚', '172.16.1.234', 61406, 'Chrome', 'Windows 10', 1, '2019-09-06 14:19:47', '2019-09-06 14:19:47'), - (1502, 30, '耿为刚', '172.16.1.234', 61405, 'Chrome', 'Windows 10', 1, '2019-09-06 14:20:46', '2019-09-06 14:20:46'), - (1503, 30, '耿为刚', '172.16.1.234', 62213, 'Chrome', 'Windows 10', 1, '2019-09-06 14:28:50', '2019-09-06 14:28:50'), - (1505, 30, '耿为刚', '172.16.1.234', 62478, 'Chrome', 'Windows 10', 1, '2019-09-06 14:32:57', '2019-09-06 14:32:57'), - (1506, 1, '管理员', '127.0.0.1', 55613, 'Chrome', 'Windows 10', 1, '2019-09-06 14:35:48', '2019-09-06 14:35:48'), - (1507, 1, '管理员', '172.16.1.234', 63132, 'Chrome', 'Windows 10', 1, '2019-09-06 14:38:43', '2019-09-06 14:38:43'), - (1508, 30, '耿为刚', '172.16.1.234', 63132, 'Chrome', 'Windows 10', 1, '2019-09-06 14:41:36', '2019-09-06 14:41:36'), - (1509, 1, '管理员', '172.16.1.234', 63332, 'Chrome', 'Windows 10', 1, '2019-09-06 14:42:37', '2019-09-06 14:42:37'), - (1511, 1, '管理员', '172.16.1.166', 29923, 'Chrome', 'Windows 10', 1, '2019-09-06 15:09:22', '2019-09-06 15:09:22'), - (1512, 1, '管理员', '172.16.1.113', 58150, 'Chrome', 'Windows 7', 1, '2019-09-06 15:23:31', '2019-09-06 15:23:31'), - (1513, 1, '管理员', '172.16.1.166', 31226, 'Chrome', 'Windows 10', 1, '2019-09-06 15:24:51', '2019-09-06 15:24:51'), - (1514, 1, '管理员', '172.16.1.113', 58300, 'Chrome', 'Windows 7', 1, '2019-09-06 15:25:04', '2019-09-06 15:25:04'), - (1515, 1, '管理员', '172.16.1.113', 58300, 'Chrome', 'Windows 7', 1, '2019-09-06 15:25:26', '2019-09-06 15:25:26'), - (1516, 1, '管理员', '172.16.1.166', 31243, 'Chrome', 'Windows 10', 1, '2019-09-06 15:25:29', '2019-09-06 15:25:29'), - (1517, 1, '管理员', '172.16.1.221', 61458, 'Chrome', 'Windows 10', 1, '2019-09-06 15:27:07', '2019-09-06 15:27:07'), - (1518, 1, '管理员', '172.16.1.166', 31243, 'Chrome', 'Windows 10', 1, '2019-09-06 15:27:09', '2019-09-06 15:27:09'), - (1519, 1, '管理员', '172.16.1.113', 58300, 'Chrome', 'Windows 7', 1, '2019-09-06 15:27:10', '2019-09-06 15:27:10'), - (1520, 1, '管理员', '172.16.1.166', 31551, 'Chrome', 'Windows 10', 1, '2019-09-06 15:30:01', '2019-09-06 15:30:01'), - (1521, 1, '管理员', '172.16.4.160', 50527, 'Chrome', 'Windows 10', 1, '2019-09-06 15:50:20', '2019-09-06 15:50:20'), - (1522, 1, '管理员', '172.16.1.166', 36381, 'Chrome', 'Windows 10', 1, '2019-09-06 16:20:46', '2019-09-06 16:20:46'), - (1523, 1, '管理员', '172.16.1.166', 40039, 'Chrome', 'Windows 10', 1, '2019-09-06 17:02:33', '2019-09-06 17:02:33'), - (1524, 1, '管理员', '172.16.1.166', 41014, 'Chrome', 'Windows 10', 1, '2019-09-06 17:16:09', '2019-09-06 17:16:09'), - (1525, 1, '管理员', '172.16.1.188', 56577, 'Chrome', 'Windows 7', 1, '2019-09-07 08:36:31', '2019-09-07 08:36:31'), - (1526, 1, '管理员', '172.16.1.48', 60852, 'Chrome', 'Windows 10', 1, '2019-09-07 08:45:02', '2019-09-07 08:45:02'), - (1527, 1, '管理员', '172.16.4.85', 4818, 'Chrome', 'Windows 10', 1, '2019-09-07 09:04:44', '2019-09-07 09:04:44'), - (1528, 1, '管理员', '172.16.4.85', 5230, 'Chrome', 'Windows 10', 1, '2019-09-07 09:25:41', '2019-09-07 09:25:41'), - (1529, 1, '管理员', '172.16.1.166', 10251, 'Chrome', 'Windows 10', 1, '2019-09-07 10:15:20', '2019-09-07 10:15:20'), - (1530, 1, '管理员', '172.16.1.48', 63877, 'Chrome', 'Windows 10', 1, '2019-09-07 11:26:19', '2019-09-07 11:26:19'), - (1531, 1, '管理员', '172.16.1.166', 26667, 'Chrome', 'Windows 10', 1, '2019-09-07 14:08:15', '2019-09-07 14:08:15'), - (1532, 1, '管理员', '172.16.4.85', 10604, 'Chrome', 'Windows 10', 1, '2019-09-07 14:08:33', '2019-09-07 14:08:33'), - (1533, 1, '管理员', '172.16.4.85', 10604, 'Chrome', 'Windows 10', 1, '2019-09-07 14:08:50', '2019-09-07 14:08:50'), - (1534, 1, '管理员', '172.16.1.166', 26812, 'Chrome', 'Windows 10', 1, '2019-09-07 14:14:09', '2019-09-07 14:14:09'), - (1535, 1, '管理员', '172.16.1.188', 52924, 'Chrome', 'Windows 7', 1, '2019-09-07 14:37:16', '2019-09-07 14:37:16'), - (1536, 1, '管理员', '172.16.1.188', 56721, 'Chrome', 'Windows 7', 1, '2019-09-07 14:49:37', '2019-09-07 14:49:37'), - (1537, 1, '管理员', '172.16.1.188', 52839, 'Chrome', 'Windows 7', 1, '2019-09-07 15:33:04', '2019-09-07 15:33:04'), - (1538, 1, '管理员', '172.16.1.166', 32489, 'Chrome', 'Windows 10', 1, '2019-09-07 15:48:02', '2019-09-07 15:48:02'), - (1539, 1, '管理员', '172.16.1.166', 32847, 'Chrome', 'Windows 10', 1, '2019-09-07 15:52:25', '2019-09-07 15:52:25'), - (1540, 1, '管理员', '172.16.1.166', 33456, 'Chrome', 'Windows 10', 1, '2019-09-07 16:00:01', '2019-09-07 16:00:01'), - (1541, 1, '管理员', '172.16.1.188', 61015, 'Chrome', 'Windows 7', 1, '2019-09-07 17:05:49', '2019-09-07 17:05:49'), - (1542, 1, '管理员', '127.0.0.1', 51566, 'Chrome', 'Windows 7', 1, '2019-09-07 17:31:20', '2019-09-07 17:31:20'), - (1543, 1, '管理员', '127.0.0.1', 54228, 'Chrome', 'Windows 7', 1, '2019-09-07 17:41:12', '2019-09-07 17:41:12'), - (1544, 1, '管理员', '127.0.0.1', 54957, 'Chrome', 'Windows 7', 1, '2019-09-07 17:43:21', '2019-09-07 17:43:21'), - (1545, 1, '管理员', '172.16.4.85', 2336, 'Chrome', 'Windows 10', 1, '2019-09-07 18:25:51', '2019-09-07 18:25:51'), - (1546, 1, '管理员', '127.0.0.1', 52161, 'Chrome', 'Windows 7', 1, '2019-09-09 08:30:47', '2019-09-09 08:30:47'), - (1547, 1, '管理员', '172.16.4.85', 5903, 'Chrome', 'Windows 10', 1, '2019-09-09 08:47:47', '2019-09-09 08:47:47'), - (1548, 1, '管理员', '172.16.1.243', 55673, 'Chrome', 'Windows 10', 1, '2019-09-09 11:25:02', '2019-09-09 11:25:02'), - (1549, 1, '管理员', '172.16.4.85', 4672, 'Chrome', 'Windows 10', 1, '2019-09-09 11:25:34', '2019-09-09 11:25:34'), - (1550, 1, '管理员', '172.16.1.188', 61186, 'Chrome', 'Windows 7', 1, '2019-09-09 11:39:24', '2019-09-09 11:39:24'), - (1551, 1, '管理员', '172.16.4.85', 3032, 'Chrome', 'Windows 10', 1, '2019-09-09 14:17:53', '2019-09-09 14:17:53'), - (1552, 1, '管理员', '172.16.4.85', 5829, 'Chrome', 'Windows 10', 1, '2019-09-09 14:54:27', '2019-09-09 14:54:27'), - (1553, 1, '管理员', '172.16.1.166', 23398, 'Chrome', 'Windows 10', 1, '2019-09-09 15:06:50', '2019-09-09 15:06:50'), - (1554, 1, '管理员', '172.16.5.60', 61094, 'Chrome', 'Windows 10', 1, '2019-09-09 15:20:50', '2019-09-09 15:20:50'), - (1555, 1, '管理员', '172.16.4.85', 10566, 'Chrome', 'Windows 10', 1, '2019-09-09 15:51:22', '2019-09-09 15:51:22'), - (1556, 1, '管理员', '172.16.1.166', 32190, 'Chrome', 'Windows 10', 1, '2019-09-09 17:00:59', '2019-09-09 17:00:59'), - (1557, 1, '管理员', '172.16.5.60', 54502, 'Chrome', 'Windows 10', 1, '2019-09-10 09:10:48', '2019-09-10 09:10:48'), - (1558, 1, '管理员', '172.16.4.85', 10659, 'Chrome', 'Windows 10', 1, '2019-09-10 09:21:48', '2019-09-10 09:21:48'), - (1559, 1, '管理员', '172.16.4.85', 3363, 'Chrome', 'Windows 10', 1, '2019-09-10 10:56:23', '2019-09-10 10:56:23'), - (1560, 1, '管理员', '172.16.4.85', 4460, 'Chrome', 'Windows 10', 1, '2019-09-10 14:23:44', '2019-09-10 14:23:44'), - (1561, 1, '管理员', '172.16.4.85', 7344, 'Chrome', 'Windows 10', 1, '2019-09-10 14:59:52', '2019-09-10 14:59:52'), - (1562, 1, '管理员', '172.16.5.89', 49996, 'Chrome', 'Windows 10', 1, '2019-09-10 18:08:04', '2019-09-10 18:08:04'), - (1563, 1, '管理员', '172.16.1.38', 50152, 'Chrome', 'Windows 10', 1, '2019-09-11 10:19:27', '2019-09-11 10:19:27'), - (1564, 1, '管理员', '172.16.1.38', 50173, 'Chrome', 'Windows 10', 1, '2019-09-11 10:20:38', '2019-09-11 10:20:38'), - (1565, 1, '管理员', '172.16.4.141', 60881, 'Chrome', 'Windows 10', 1, '2019-09-11 14:52:02', '2019-09-11 14:52:02'), - (1566, 1, '管理员', '172.16.4.93', 52688, 'Chrome', 'Windows 10', 1, '2019-09-11 15:15:14', '2019-09-11 15:15:14'), - (1567, 1, '管理员', '172.16.5.127', 54993, 'Chrome', 'Windows 10', 1, '2019-09-12 14:29:58', '2019-09-12 14:29:58'), - (1568, 1, '管理员', '172.16.5.127', 57424, 'Chrome', 'Windows 10', 1, '2019-09-12 15:26:46', '2019-09-12 15:26:46'), - (1569, 1, '管理员', '172.16.5.127', 58073, 'Chrome', 'Windows 10', 1, '2019-09-12 15:41:54', '2019-09-12 15:41:54'), - (1570, 1, '管理员', '172.16.5.146', 63230, 'Chrome', 'Windows 10', 1, '2019-09-16 10:17:15', '2019-09-16 10:17:15'), - (1571, 1, '管理员', '172.16.5.146', 52857, 'Chrome', 'Windows 10', 1, '2019-09-16 11:17:18', '2019-09-16 11:17:18'), - (1572, 1, '管理员', '172.16.1.190', 64527, 'Chrome', 'Windows 10', 1, '2019-09-19 14:06:45', '2019-09-19 14:06:45'), - (1573, 1, '管理员', '127.0.0.1', 53267, 'Chrome', 'Windows 7', 1, '2019-09-20 17:24:33', '2019-09-20 17:24:33'), - (1574, 1, '管理员', '127.0.0.1', 53267, 'Chrome', 'Windows 7', 1, '2019-09-20 17:24:43', '2019-09-20 17:24:43'), - (1575, 1, '管理员', '127.0.0.1', 53267, 'Chrome', 'Windows 7', 1, '2019-09-20 17:24:59', '2019-09-20 17:24:59'), - (1576, 1, '管理员', '127.0.0.1', 53267, 'Chrome', 'Windows 7', 1, '2019-09-20 17:26:05', '2019-09-20 17:26:05'), - (1577, 1, '管理员', '127.0.0.1', 60612, 'Chrome', 'Windows 7', 1, '2019-09-20 17:56:06', '2019-09-20 17:56:06'), - (1578, 1, '管理员', '172.16.1.202', 58066, 'Chrome', 'Windows 7', 1, '2019-09-22 18:25:03', '2019-09-22 18:25:03'), - (1579, 1, '管理员', '172.16.1.48', 52290, 'Chrome', 'Windows 10', 1, '2019-09-23 16:01:16', '2019-09-23 16:01:16'), - (1580, 1, '管理员', '172.16.4.141', 60997, 'Chrome', 'Windows 10', 1, '2019-09-23 17:16:55', '2019-09-23 17:16:55'), - (1581, 1, '管理员', '172.16.5.146', 53246, 'Chrome', 'Windows 10', 1, '2019-09-23 17:54:14', '2019-09-23 17:54:14'), - (1582, 1, '管理员', '127.0.0.1', 51987, 'Chrome', 'Windows 7', 1, '2019-09-24 09:16:37', '2019-09-24 09:16:37'), - (1583, 1, '管理员', '172.16.1.202', 55724, 'Chrome', 'Windows 7', 1, '2019-09-24 12:57:39', '2019-09-24 12:57:39'), - (1584, 1, '管理员', '172.16.1.166', 51876, 'Chrome', 'Windows 10', 1, '2019-09-24 16:24:37', '2019-09-24 16:24:37'), - (1585, 1, '管理员', '172.16.1.202', 51648, 'Chrome', 'Windows 7', 1, '2019-09-24 19:26:39', '2019-09-24 19:26:39'), - (1586, 1, '管理员', '172.16.1.234', 60984, 'Chrome', 'Windows 10', 1, '2019-09-26 10:52:07', '2019-09-26 10:52:07'), - (1587, 1, '管理员', '172.16.1.234', 63440, 'Chrome', 'Windows 10', 1, '2019-09-26 11:30:54', '2019-09-26 11:30:54'), - (1588, 1, '管理员', '172.16.1.202', 51956, 'Chrome', 'Windows 7', 1, '2019-09-27 20:55:08', '2019-09-27 20:55:08'), - (1589, 1, '管理员', '172.16.1.48', 56166, 'Chrome', 'Windows 10', 1, '2019-09-30 08:59:13', '2019-09-30 08:59:13'), - (1590, 1, '管理员', '172.16.1.202', 51448, 'Chrome', 'Windows 7', 1, '2019-09-30 09:00:13', '2019-09-30 09:00:13'), - (1591, 1, '管理员', '172.16.1.188', 62679, 'Chrome', 'Windows 7', 1, '2019-10-15 11:25:26', '2019-10-15 11:25:26'), - (1592, 1, '管理员', '172.16.1.234', 54034, 'Chrome', 'Windows 10', 1, '2019-10-18 10:47:14', '2019-10-18 10:47:14'), - (1593, 1, '管理员', '172.16.1.234', 64515, 'Chrome', 'Windows 10', 1, '2019-10-18 13:32:10', '2019-10-18 13:32:10'), - (1594, 1, '管理员', '172.16.1.234', 50211, 'Chrome', 'Windows 10', 1, '2019-10-18 13:56:19', '2019-10-18 13:56:19'), - (1595, 1, '管理员', '172.16.1.234', 55469, 'Chrome', 'Windows 10', 1, '2019-10-18 14:56:24', '2019-10-18 14:56:24'), - (1596, 1, '管理员', '172.16.1.234', 56392, 'Chrome', 'Windows 10', 1, '2019-10-18 15:08:25', '2019-10-18 15:08:25'), - (1597, 1, '管理员', '172.16.1.234', 60896, 'Chrome', 'Windows 10', 1, '2019-10-18 16:14:15', '2019-10-18 16:14:15'), - (1598, 1, '管理员', '172.16.1.234', 50590, 'Chrome', 'Windows 10', 1, '2019-10-19 08:38:54', '2019-10-19 08:38:54'), - (1599, 1, '管理员', '172.16.1.166', 4879, 'Chrome', 'Windows 10', 1, '2019-10-19 09:19:08', '2019-10-19 09:19:08'), - (1600, 1, '管理员', '172.16.1.188', 62895, 'Chrome', 'Windows 7', 1, '2019-10-19 13:49:29', '2019-10-19 13:49:29'), - (1601, 1, '管理员', '172.16.1.234', 58144, 'Chrome', 'Windows 10', 1, '2019-10-19 14:55:50', '2019-10-19 14:55:50'), - (1602, 1, '管理员', '127.0.0.1', 61033, 'Chrome', 'Windows 7', 1, '2019-10-19 15:19:38', '2019-10-19 15:19:38'), - (1603, 1, '管理员', '172.16.1.188', 58944, 'Chrome', 'Windows 7', 1, '2019-10-19 16:48:49', '2019-10-19 16:48:49'), - (1604, 1, '管理员', '172.16.1.188', 63950, 'Chrome', 'Windows 7', 1, '2019-10-21 08:10:38', '2019-10-21 08:10:38'), - (1605, 1, '管理员', '172.16.1.188', 64899, 'Chrome', 'Windows 7', 1, '2019-10-21 08:17:40', '2019-10-21 08:17:40'), - (1606, 1, '管理员', '172.16.1.221', 53180, 'Chrome', 'Windows 10', 1, '2019-10-21 15:52:36', '2019-10-21 15:52:36'), - (1607, 1, '管理员', '172.16.1.221', 56067, 'Chrome', 'Windows 10', 1, '2019-10-23 10:19:39', '2019-10-23 10:19:39'), - (1608, 1, '管理员', '172.16.1.221', 57692, 'Chrome', 'Windows 10', 1, '2019-10-23 16:36:39', '2019-10-23 16:36:39'), - (1609, 1, '管理员', '172.16.1.188', 57180, 'Chrome', 'Windows 7', 1, '2019-10-24 08:26:21', '2019-10-24 08:26:21'), - (1610, 1, '管理员', '172.16.0.196', 61409, 'Chrome', 'Windows 10', 1, '2019-10-24 08:26:55', '2019-10-24 08:26:55'), - (1611, 1, '管理员', '172.16.1.234', 51906, 'Chrome', 'Windows 10', 1, '2019-10-24 15:56:50', '2019-10-24 15:56:50'), - (1612, 1, '管理员', '172.16.1.234', 56793, 'Chrome', 'Windows 10', 1, '2019-10-24 17:04:54', '2019-10-24 17:04:54'), - (1613, 30, '耿为刚', '172.16.1.234', 60368, 'Chrome', 'Windows 10', 1, '2019-10-24 17:51:13', '2019-10-24 17:51:13'), - (1614, 1, '管理员', '172.16.1.234', 60368, 'Chrome', 'Windows 10', 1, '2019-10-24 17:51:56', '2019-10-24 17:51:56'), - (1615, 30, '耿为刚', '172.16.1.234', 60589, 'Chrome 65', 'Windows 10', 1, '2019-10-24 17:52:52', '2019-10-24 17:52:52'), - (1616, 1, '管理员', '172.16.1.234', 52998, 'Chrome', 'Windows 10', 1, '2019-10-25 09:28:13', '2019-10-25 09:28:13'), - (1617, 1, '管理员', '172.16.1.234', 54948, 'Chrome', 'Windows 10', 1, '2019-10-25 10:01:34', '2019-10-25 10:01:34'), - (1618, 1, '管理员', '172.16.1.234', 56800, 'Chrome', 'Windows 10', 1, '2019-10-25 10:32:53', '2019-10-25 10:32:53'), - (1619, 1, '管理员', '127.0.0.1', 59071, 'Chrome', 'Windows 7', 1, '2019-10-28 16:05:21', '2019-10-28 16:05:21'), - (1620, 1, '管理员', '127.0.0.1', 60106, 'Chrome', 'Windows 7', 1, '2019-10-28 16:11:29', '2019-10-28 16:11:29'), - (1621, 1, '管理员', '127.0.0.1', 63479, 'Chrome', 'Windows 7', 1, '2019-10-28 16:28:59', '2019-10-28 16:28:59'), - (1622, 1, '管理员', '127.0.0.1', 63479, 'Chrome', 'Windows 7', 1, '2019-10-28 16:29:55', '2019-10-28 16:29:55'), - (1623, 1, '管理员', '127.0.0.1', 57588, 'Chrome', 'Windows 7', 1, '2019-10-29 15:37:03', '2019-10-29 15:37:03'), - (1741, 1, '管理员', '127.0.0.1', 54621, 'Chrome', 'Windows 7', 1, '2019-11-16 18:03:45', '2019-11-16 18:03:45'), - (1742, 1, '管理员', '127.0.0.1', 60932, 'Chrome 8', 'Windows 10', 1, '2020-12-14 15:14:55', '2020-12-14 15:14:55'); -/*!40000 ALTER TABLE `t_user_login_log` ENABLE KEYS */; - --- 导出 表 smart-admin-dev.t_user_operate_log 结构 -DROP TABLE IF EXISTS `t_user_operate_log`; -CREATE TABLE IF NOT EXISTS `t_user_operate_log` ( - `id` int NOT NULL AUTO_INCREMENT COMMENT '主键', - `user_id` int NOT NULL COMMENT '用户id', - `user_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '用户名称', - `module` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '操作模块', - `content` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '操作内容', - `url` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '请求路径', - `method` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '请求方法', - `param` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '请求参数', - `result` tinyint DEFAULT NULL COMMENT '请求结果 0失败 1成功', - `fail_reason` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '失败原因', - `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=75 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; - --- 正在导出表 smart-admin-dev.t_user_operate_log 的数据:~32 rows (大约) -DELETE FROM `t_user_operate_log`; -/*!40000 ALTER TABLE `t_user_operate_log` DISABLE KEYS */; -INSERT INTO `t_user_operate_log` (`id`, `user_id`, `user_name`, `module`, `content`, `url`, `method`, `param`, `result`, `fail_reason`, `update_time`, `create_time`) VALUES - (1, 1, '管理员', '管理端-角色权限', '获取角色可选的功能权限', '/smart-admin-api/privilege/listPrivilegeByRoleId/0', 'com.gangquan360.smartadmin.module.role.roleprivilege.RolePrivilegeController.listPrivilegeByRoleId', 'Long[0]', 1, NULL, '2019-11-01 00:00:00', '2019-11-01 00:00:00'), - (2, 1, '管理员', '管理端-角色', '获取所有角色', '/smart-admin-api/role/getAll', 'com.gangquan360.smartadmin.module.role.basic.RoleController.getAllRole', '', 1, NULL, '2019-11-01 00:00:00', '2019-11-01 00:00:00'), - (3, 1, '管理员', '管理端-角色权限', '获取角色可选的功能权限', '/smart-admin-api/privilege/listPrivilegeByRoleId/1', 'com.gangquan360.smartadmin.module.role.roleprivilege.RolePrivilegeController.listPrivilegeByRoleId', 'Long[1]', 1, NULL, '2019-11-01 00:00:00', '2019-11-01 00:00:00'), - (4, 1, '管理员', '管理端-岗位', '分页查询所有岗位', '/smart-admin-api/position/getListPage', 'com.gangquan360.smartadmin.module.position.PositionController.getJobPage', 'PositionQueryDTO[{"pageNum":1,"pageSize":10,"positionName":"","searchCount":true,"sort":false}]', 1, NULL, '2019-11-01 00:00:00', '2019-11-01 00:00:00'), - (5, 1, '管理员', '管理端-角色', '获取所有角色', '/smart-admin-api/role/getAll', 'com.gangquan360.smartadmin.module.role.basic.RoleController.getAllRole', '', 1, NULL, '2019-11-01 00:00:00', '2019-11-01 00:00:00'), - (6, 1, '管理员', '管理端-部门', '根据部门名称查询部门及员工列表', '/smart-admin-api/department/listEmployeeByDepartmentName', 'com.gangquan360.smartadmin.module.department.DepartmentController.listDepartmentEmployee', 'String[""]', 1, NULL, '2019-11-01 00:00:00', '2019-11-01 00:00:00'), - (7, 1, '管理员', '管理端-部门', '查询部门及员工列表', '/smart-admin-api/department/listEmployee', 'com.gangquan360.smartadmin.module.department.DepartmentController.listDepartmentEmployee', '', 1, NULL, '2019-11-01 00:00:00', '2019-11-01 00:00:00'), - (8, 1, '管理员', '管理端-用户', '员工管理查询', '/smart-admin-api/employee/query', 'com.gangquan360.smartadmin.module.employee.EmployeeController.query', 'EmployeeQueryDTO[{"isDelete":0,"isDisabled":0,"keyword":"","pageNum":1,"pageSize":10}]', 1, NULL, '2019-11-01 00:00:00', '2019-11-01 00:00:00'), - (9, 1, '管理员', '管理端-用户', '员工重置密码', '/smart-admin-api/employee/resetPasswd/29', 'com.gangquan360.smartadmin.module.employee.EmployeeController.resetPasswd', 'Integer[29]', 1, NULL, '2019-11-01 00:00:00', '2019-11-01 00:00:00'), - (10, 1, '管理员', '管理端-用户', '员工管理查询', '/smart-admin-api/employee/query', 'com.gangquan360.smartadmin.module.employee.EmployeeController.query', 'EmployeeQueryDTO[{"isDelete":0,"isDisabled":0,"keyword":"","pageNum":1,"pageSize":10}]', 1, NULL, '2019-11-01 00:00:00', '2019-11-01 00:00:00'), - (11, 1, '管理员', '管理端-角色用户', '通过员工id获取所有角色以及员工具有的角色', '/smart-admin-api/role/getRoles/29', 'com.gangquan360.smartadmin.module.role.roleemployee.RoleEmployeeController.getRoleByEmployeeId', 'Long[29]', 1, NULL, '2019-11-01 00:00:00', '2019-11-01 00:00:00'), - (12, 1, '管理员', '管理端-用户', '单个员工角色授权', '/smart-admin-api/employee/updateRoles', 'com.gangquan360.smartadmin.module.employee.EmployeeController.updateRoles', 'EmployeeUpdateRolesDTO[{"employeeId":29,"roleIds":[34,45]}]', 1, NULL, '2019-11-01 00:00:00', '2019-11-01 00:00:00'), - (13, 1, '管理员', '管理端-用户', '员工管理查询', '/smart-admin-api/employee/query', 'com.gangquan360.smartadmin.module.employee.EmployeeController.query', 'EmployeeQueryDTO[{"isDelete":0,"isDisabled":0,"keyword":"","pageNum":1,"pageSize":10}]', 1, NULL, '2019-11-01 00:00:00', '2019-11-01 00:00:00'), - (14, 1, '管理员', '管理端-角色权限', '更新角色权限', '/smart-admin-api/privilege/updateRolePrivilege', 'com.gangquan360.smartadmin.module.role.roleprivilege.RolePrivilegeController.updateRolePrivilege', 'RolePrivilegeDTO[{"privilegeKeyList":["Employee","RoleManage","PositionList","RoleEmployeeManage","SystemSetting","SystemConfig","SystemPrivilege","Notice","NoticeList","PersonNotice","Email","EmailList","SendMail","UserLog","UserOperateLog","UserLoginLog","Monitor","OnlineUser","Sql","Task","TaskList","Reload","SmartReloadList","ApiDoc","Swagger","ThreeRouter","LevelTwo","RoleOneTwo","RoleTwoTwo","RoleOneOne","KeepAlive","KeepAliveContentList","KeepAliveAddContent","HeartBeat","HeartBeatList","File","FileList","add-role","delete-role","update-role","update-role-privilege","add-employee-role","search-employee-list","delete-employee-role","delete-employee-role-batch","query-data-scope","update-data-scope","search-position","add-position","update-position","delete-position","add-department","update-department","delete-department","search-department","add-employee","update-employee","disabled-employee","disabled-employee-batch","update-employee-role","reset-employee-password","delete-employee","system-params-search","system-params-add","system-config-update","system-config-search","privilege-main-update","privilege-main-search","notice-query","notice-add","notice-edit","notice-delete","notice-detail","notice-send","person-notice-query","person-notice-detail","email-query","email-add","email-update","email-delete","email-send","user-operate-log-search","user-operate-log-detail","user-operate-log-delete","user-login-log-search","user-login-log-delete","online-user-search","task-search","task-refresh","task-add","task-update","task-pause","task-resume","task-run","task-query-log","task-delete","smart-reload-search","smart-reload-update","smart-reload-result","heart-beat-query","file-filePage-query","file-filePage-upload"],"roleId":1}]', 1, NULL, '2019-11-01 00:00:00', '2019-11-01 00:00:00'), - (15, 1, '管理员', '管理端-角色权限', '获取角色可选的功能权限', '/smart-admin-api/privilege/listPrivilegeByRoleId/1', 'com.gangquan360.smartadmin.module.role.roleprivilege.RolePrivilegeController.listPrivilegeByRoleId', 'Long[1]', 1, NULL, '2019-11-01 00:00:00', '2019-11-01 00:00:00'), - (16, 1, '管理员', '管理端-系统配置', '分页查询所有系统配置', '/smart-admin-api/systemConfig/getListPage', 'com.gangquan360.smartadmin.module.systemconfig.SystemConfigController.getSystemConfigPage', 'SystemConfigQueryDTO[{"key":"","pageNum":1,"pageSize":10}]', 1, NULL, '2019-11-01 00:00:00', '2019-11-01 00:00:00'), - (17, 1, '管理员', '管理端-系统配置', '修改配置参数', '/smart-admin-api/systemConfig/update', 'com.gangquan360.smartadmin.module.systemconfig.SystemConfigController.updateSystemConfig', 'SystemConfigUpdateDTO[{"configGroup":"upload","configKey":"ali_oss","configName":"阿里云上传配置","configValue":"{\\"accessKeyId\\":\\"\\",\\"accessKeySecret\\":\\"\\",\\"bucketName\\":\\"sit\\",\\"endpoint\\":\\"http://oss-cn-beijing.aliyuncs.com\\"}","id":14,"remark":"eefwfwfds"}]', 1, NULL, '2019-11-01 00:00:00', '2019-11-01 00:00:00'), - (18, 1, '管理员', '管理端-系统配置', '分页查询所有系统配置', '/smart-admin-api/systemConfig/getListPage', 'com.gangquan360.smartadmin.module.systemconfig.SystemConfigController.getSystemConfigPage', 'SystemConfigQueryDTO[{"key":"","pageNum":1,"pageSize":10}]', 1, NULL, '2019-11-01 00:00:00', '2019-11-01 00:00:00'), - (19, 1, '管理员', '管理端-系统配置', '修改配置参数', '/smart-admin-api/systemConfig/update', 'com.gangquan360.smartadmin.module.systemconfig.SystemConfigController.updateSystemConfig', 'SystemConfigUpdateDTO[{"configGroup":"upload","configKey":"qi_niu_oss","configName":"七牛云上传配置","configValue":"{\\"accessKeyId\\":\\"rX7HgY1ZLpUD25JrA-uwMM_jj-\\",\\"accessKeySecret\\":\\"\\",\\"bucketName\\":\\"sun-smart-admin\\",\\"endpoint\\":\\"http://puvpyay08.bkt.clouddn.com\\"}","id":16}]', 1, NULL, '2019-11-01 00:00:00', '2019-11-01 00:00:00'), - (20, 1, '管理员', '管理端-系统配置', '分页查询所有系统配置', '/smart-admin-api/systemConfig/getListPage', 'com.gangquan360.smartadmin.module.systemconfig.SystemConfigController.getSystemConfigPage', 'SystemConfigQueryDTO[{"key":"","pageNum":1,"pageSize":10}]', 1, NULL, '2019-11-01 00:00:00', '2019-11-01 00:00:00'), - (21, 1, '管理员', '通用-权限', '获取所有请求路径', '/smart-admin-api/privilege/getAllUrl', 'com.gangquan360.smartadmin.module.privilege.controller.PrivilegeController.getAllUrl', '', 1, NULL, '2019-11-01 00:00:00', '2019-11-01 00:00:00'), - (22, 1, '管理员', '通用-权限', '查询所有菜单项', '/smart-admin-api/privilege/menu/queryAll', 'com.gangquan360.smartadmin.module.privilege.controller.PrivilegeController.queryAll', '', 1, NULL, '2019-11-01 00:00:00', '2019-11-01 00:00:00'), - (23, 1, '管理员', '通用-权限', '查询菜单功能点', '/smart-admin-api/privilege/function/query/FileList', 'com.gangquan360.smartadmin.module.privilege.controller.PrivilegeController.functionQuery', 'String["FileList"]', 1, NULL, '2019-11-01 00:00:00', '2019-11-01 00:00:00'), - (24, 1, '管理员', '通用-权限', '保存更新功能点', '/smart-admin-api/privilege/function/saveOrUpdate', 'com.gangquan360.smartadmin.module.privilege.controller.PrivilegeController.functionSaveOrUpdate', 'PrivilegeFunctionDTO[{"functionKey":"file-filePage-download","functionName":"下载","menuKey":"FileList","sort":2,"url":"fileController.downLoadById"}]', 1, NULL, '2019-11-01 00:00:00', '2019-11-01 00:00:00'), - (25, 1, '管理员', '通用-权限', '查询菜单功能点', '/smart-admin-api/privilege/function/query/FileList', 'com.gangquan360.smartadmin.module.privilege.controller.PrivilegeController.functionQuery', 'String["FileList"]', 1, NULL, '2019-11-01 00:00:00', '2019-11-01 00:00:00'), - (26, 1, '管理员', '通用-邮件发送', '分页查询', '/smart-admin-api/email/page/query', 'com.gangquan360.smartadmin.module.email.EmailController.queryByPage', 'EmailQueryDTO[{"endDate":"","pageNum":1,"pageSize":10,"searchCount":true,"startDate":""}]', 1, NULL, '2019-11-01 00:00:00', '2019-11-01 00:00:00'), - (27, 1, '管理员', '管理端-用户操作日志', '分页查询', '/smart-admin-api/userOperateLog/page/query', 'com.gangquan360.smartadmin.module.log.useroperatelog.UserOperateLogController.queryByPage', 'UserOperateLogQueryDTO[{"endDate":"","pageNum":1,"pageSize":10,"searchCount":true,"sort":false,"startDate":"","userName":""}]', 1, NULL, '2019-11-01 00:00:00', '2019-11-01 00:00:00'), - (28, 1, '管理员', '管理端-用户登录日志', '分页查询用户登录日志', '/smart-admin-api/userLoginLog/page/query', 'com.gangquan360.smartadmin.module.log.userloginlog.UserLoginLogController.queryByPage', 'UserLoginLogQueryDTO[{"endDate":"","pageNum":1,"pageSize":10,"searchCount":true,"sort":false,"startDate":"","userName":""}]', 1, NULL, '2019-11-01 00:00:00', '2019-11-01 00:00:00'), - (29, 1, '管理员', '管理端-用户登录日志', '查询员工在线状态', '/smart-admin-api/userOnLine/query', 'com.gangquan360.smartadmin.module.log.userloginlog.UserLoginLogController.queryUserOnLine', 'EmployeeQueryDTO[{"actualName":"","employeeIds":[1],"isDelete":0,"pageNum":1,"pageSize":10}]', 1, NULL, '2019-11-01 00:00:00', '2019-11-01 00:00:00'), - (30, 1, '管理员', '管理端-任务调度', '查询任务', '/smart-admin-api/quartz/task/query', 'com.gangquan360.smartadmin.module.quartz.controller.QuartzController.query', 'QuartzQueryDTO[{"pageNum":1,"pageSize":10}]', 1, NULL, '2019-11-01 00:00:00', '2019-11-01 00:00:00'), - (31, 1, '管理员', '管理端-smart reload', '获取全部Smart-reload项', '/smart-admin-api/smartReload/all', 'com.gangquan360.smartadmin.module.smartreload.SmartReloadController.listAllReloadItem', '', 1, NULL, '2019-11-01 00:00:00', '2019-11-01 00:00:00'), - (32, 1, '管理员', '通用-心跳服务', '查询心跳记录 @author zhuoda', '/smart-admin-api/heartBeat/query', 'com.gangquan360.smartadmin.module.heartbeat.HeartBeatController.query', 'PageParamDTO[{"pageNum":1,"pageSize":10}]', 1, NULL, '2019-11-01 00:00:00', '2019-11-01 00:00:00'), - (33, 1, '管理员', '通用-权限', '获取所有请求路径', '/smart-admin-api/privilege/getAllUrl', 'net.lab1024.smartadmin.module.system.privilege.controller.PrivilegeController.getAllUrl', '', 1, NULL, '2020-12-14 15:15:06', '2020-12-14 15:15:06'), - (34, 1, '管理员', '通用-权限', '查询所有菜单项', '/smart-admin-api/privilege/menu/queryAll', 'net.lab1024.smartadmin.module.system.privilege.controller.PrivilegeController.queryAll', '', 1, NULL, '2020-12-14 15:15:06', '2020-12-14 15:15:06'), - (35, 1, '管理员', '通用-权限', '菜单批量保存', '/smart-admin-api/privilege/menu/batchSaveMenu', 'net.lab1024.smartadmin.module.system.privilege.controller.PrivilegeController.menuBatchSave', 'ValidateList[[{"menuKey":"Business","menuName":"业务功能","sort":0,"type":1,"url":"/business"},{"menuKey":"Peony","menuName":"牡丹管理","parentKey":"Business","sort":0,"type":1,"url":"/peony"},{"menuKey":"PeonyList","menuName":"牡丹花列表","parentKey":"Peony","sort":0,"type":1,"url":"/peony/peony-list"},{"menuKey":"PeonyList1","menuName":"牡丹花列表1","parentKey":"Peony","sort":0,"type":1,"url":"/peony/peony-list1"},{"menuKey":"Email","menuName":"邮件管理","parentKey":"Business","sort":0,"type":1,"url":"/email"},{"menuKey":"EmailList","menuName":"邮件管理","parentKey":"Email","sort":0,"type":1,"url":"/email/email-list"},{"menuKey":"SendMail","menuName":"发送邮件","parentKey":"Email","sort":0,"type":1,"url":"/email/send-mail"},{"menuKey":"KeepAlive","menuName":"KeepAlive","parentKey":"Business","sort":0,"type":1,"url":"/keep-alive"},{"menuKey":"KeepAliveContentList","menuName":"KeepAlive列表","parentKey":"KeepAlive","sort":0,"type":1,"url":"/keep-alive/content-list"},{"menuKey":"KeepAliveAddContent","menuName":"KeepAlive表单","parentKey":"KeepAlive","sort":0,"type":1,"url":"/keep-alive/add-content"},{"menuKey":"Notice","menuName":"消息管理","parentKey":"Business","sort":0,"type":1,"url":"/notice"},{"menuKey":"NoticeList","menuName":"通知管理","parentKey":"Notice","sort":0,"type":1,"url":"/notice/notice-list"},{"menuKey":"PersonNotice","menuName":"个人消息","parentKey":"Notice","sort":0,"type":1,"url":"/notice/person-notice"},{"menuKey":"NoticeDetail","menuName":"消息详情","parentKey":"Notice","sort":0,"type":1,"url":"/notice/notice-detail"},{"menuKey":"ThreeRouter","menuName":"三级路由","parentKey":"Business","sort":0,"type":1,"url":"/three-router"},{"menuKey":"LevelTwo","menuName":"三级菜单","parentKey":"ThreeRouter","sort":0,"type":1,"url":"/three-router/level-two"},{"menuKey":"ThreeLevelRouterView","menuName":"三级菜单子颗粒","parentKey":"LevelTwo","sort":0,"type":1,"url":"/three-router/level-two/level-three1"},{"menuKey":"RoleTwoTwo","menuName":"三级菜单子哈","parentKey":"LevelTwo","sort":0,"type":1,"url":"/three-router/level-two/level-three2"},{"menuKey":"RoleOneOne","menuName":"二级菜单","parentKey":"ThreeRouter","sort":0,"type":1,"url":"/three-router/level-two2"},{"menuKey":"System","menuName":"系统设置","sort":0,"type":1,"url":"/system"},{"menuKey":"Employee","menuName":"人员管理","parentKey":"System","sort":0,"type":1,"url":"/employee"},{"menuKey":"RoleManage","menuName":"角色管理","parentKey":"Employee","sort":0,"type":1,"url":"/employee/role"},{"menuKey":"PositionList","menuName":"岗位管理","parentKey":"Employee","sort":0,"type":1,"url":"/employee/position"},{"menuKey":"RoleEmployeeManage","menuName":"员工管理","parentKey":"Employee","sort":0,"type":1,"url":"/employee/role-employee-manage"},{"menuKey":"File","menuName":"文件服务","parentKey":"System","sort":0,"type":1,"url":"/file"},{"menuKey":"FileList","menuName":"文件列表","parentKey":"File","sort":0,"type":1,"url":"/file/file-list"},{"menuKey":"UserLog","menuName":"用户日志","parentKey":"System","sort":0,"type":1,"url":"/user-log"},{"menuKey":"UserOperateLog","menuName":"用户操作日志","parentKey":"UserLog","sort":0,"type":1,"url":"/user-log/user-operate-log"},{"menuKey":"UserLoginLog","menuName":"用户登录日志","parentKey":"UserLog","sort":0,"type":1,"url":"/user-log/user-login-log"},{"menuKey":"SystemSetting","menuName":"系统设置","parentKey":"System","sort":0,"type":1,"url":"/system-setting"},{"menuKey":"SystemConfig","menuName":"系统参数","parentKey":"SystemSetting","sort":0,"type":1,"url":"/system-setting/system-config"},{"menuKey":"SystemPrivilege","menuName":"菜单设置","parentKey":"SystemSetting","sort":0,"type":1,"url":"/system-setting/system-privilege"},{"menuKey":"Support","menuName":"开发专用","sort":0,"type":1,"url":"/support"},{"menuKey":"ApiDoc","menuName":"接口文档","parentKey":"Support","sort":0,"type":1,"url":"/api-doc"},{"menuKey":"Swagger","menuName":"Swagger接口文档","parentKey":"ApiDoc","sort":0,"type":1,"url":"/api-doc/swagger"},{"menuKey":"HeartBeat","menuName":"心跳服务","parentKey":"Support","sort":0,"type":1,"url":"/heart-beat"},{"menuKey":"HeartBeatList","menuName":"心跳服务","parentKey":"HeartBeat","sort":0,"type":1,"url":"/heart-beat/heart-beat-list"},{"menuKey":"Monitor","menuName":"系统监控","parentKey":"Support","sort":0,"type":1,"url":"/monitor"},{"menuKey":"OnlineUser","menuName":"在线人数","parentKey":"Monitor","sort":0,"type":1,"url":"/monitor/online-user"},{"menuKey":"Sql","menuName":"SQL监控","parentKey":"Monitor","sort":0,"type":1,"url":"/monitor/sql"},{"menuKey":"Reload","menuName":"动态加载","parentKey":"Support","sort":0,"type":1,"url":"/reload"},{"menuKey":"SmartReloadList","menuName":"SmartReload","parentKey":"Reload","sort":0,"type":1,"url":"/reload/smart-reload-list"},{"menuKey":"Task","menuName":"定时任务","parentKey":"Support","sort":0,"type":1,"url":"/task"},{"menuKey":"TaskList","menuName":"任务管理","parentKey":"Task","sort":0,"type":1,"url":"/system-setting/task-list"}]]', 1, NULL, '2020-12-14 15:15:07', '2020-12-14 15:15:07'), - (36, 1, '管理员', '通用-权限', '查询所有菜单项', '/smart-admin-api/privilege/menu/queryAll', 'net.lab1024.smartadmin.module.system.privilege.controller.PrivilegeController.queryAll', '', 1, NULL, '2020-12-14 15:15:07', '2020-12-14 15:15:07'), - (37, 1, '管理员', '管理端-用户登录', '获取session', '/smart-admin-api/session/get', 'net.lab1024.smartadmin.module.system.login.LoginController.getSession', '', 1, NULL, '2020-12-14 15:15:29', '2020-12-14 15:15:29'), - (38, 1, '管理员', '通用-权限', '获取所有请求路径', '/smart-admin-api/privilege/getAllUrl', 'net.lab1024.smartadmin.module.system.privilege.controller.PrivilegeController.getAllUrl', '', 1, NULL, '2020-12-14 15:16:25', '2020-12-14 15:16:25'), - (39, 1, '管理员', '通用-权限', '查询所有菜单项', '/smart-admin-api/privilege/menu/queryAll', 'net.lab1024.smartadmin.module.system.privilege.controller.PrivilegeController.queryAll', '', 1, NULL, '2020-12-14 15:16:25', '2020-12-14 15:16:25'), - (40, 1, '管理员', '通用-权限', '菜单批量保存', '/smart-admin-api/privilege/menu/batchSaveMenu', 'net.lab1024.smartadmin.module.system.privilege.controller.PrivilegeController.menuBatchSave', 'ValidateList[[{"menuKey":"Business","menuName":"业务功能","sort":0,"type":1,"url":"/business"},{"menuKey":"Peony","menuName":"牡丹管理","parentKey":"Business","sort":1,"type":1,"url":"/peony"},{"menuKey":"PeonyList","menuName":"牡丹花列表","parentKey":"Peony","sort":2,"type":1,"url":"/peony/peony-list"},{"menuKey":"PeonyList1","menuName":"牡丹花列表1","parentKey":"Peony","sort":3,"type":1,"url":"/peony/peony-list1"},{"menuKey":"Email","menuName":"邮件管理","parentKey":"Business","sort":4,"type":1,"url":"/email"},{"menuKey":"EmailList","menuName":"邮件管理","parentKey":"Email","sort":5,"type":1,"url":"/email/email-list"},{"menuKey":"SendMail","menuName":"发送邮件","parentKey":"Email","sort":6,"type":1,"url":"/email/send-mail"},{"menuKey":"KeepAlive","menuName":"KeepAlive","parentKey":"Business","sort":7,"type":1,"url":"/keep-alive"},{"menuKey":"KeepAliveContentList","menuName":"KeepAlive列表","parentKey":"KeepAlive","sort":8,"type":1,"url":"/keep-alive/content-list"},{"menuKey":"KeepAliveAddContent","menuName":"KeepAlive表单","parentKey":"KeepAlive","sort":9,"type":1,"url":"/keep-alive/add-content"},{"menuKey":"Notice","menuName":"消息管理","parentKey":"Business","sort":10,"type":1,"url":"/notice"},{"menuKey":"NoticeList","menuName":"通知管理","parentKey":"Notice","sort":11,"type":1,"url":"/notice/notice-list"},{"menuKey":"PersonNotice","menuName":"个人消息","parentKey":"Notice","sort":12,"type":1,"url":"/notice/person-notice"},{"menuKey":"NoticeDetail","menuName":"消息详情","parentKey":"Notice","sort":13,"type":1,"url":"/notice/notice-detail"},{"menuKey":"ThreeRouter","menuName":"三级路由","parentKey":"Business","sort":14,"type":1,"url":"/three-router"},{"menuKey":"LevelTwo","menuName":"三级菜单","parentKey":"ThreeRouter","sort":15,"type":1,"url":"/three-router/level-two"},{"menuKey":"ThreeLevelRouterView","menuName":"三级菜单子颗粒","parentKey":"LevelTwo","sort":16,"type":1,"url":"/three-router/level-two/level-three1"},{"menuKey":"RoleTwoTwo","menuName":"三级菜单子哈","parentKey":"LevelTwo","sort":17,"type":1,"url":"/three-router/level-two/level-three2"},{"menuKey":"RoleOneOne","menuName":"二级菜单","parentKey":"ThreeRouter","sort":18,"type":1,"url":"/three-router/level-two2"},{"menuKey":"System","menuName":"系统设置","sort":19,"type":1,"url":"/system"},{"menuKey":"Employee","menuName":"人员管理","parentKey":"System","sort":20,"type":1,"url":"/employee"},{"menuKey":"RoleManage","menuName":"角色管理","parentKey":"Employee","sort":21,"type":1,"url":"/employee/role"},{"menuKey":"PositionList","menuName":"岗位管理","parentKey":"Employee","sort":22,"type":1,"url":"/employee/position"},{"menuKey":"RoleEmployeeManage","menuName":"员工管理","parentKey":"Employee","sort":23,"type":1,"url":"/employee/role-employee-manage"},{"menuKey":"File","menuName":"文件服务","parentKey":"System","sort":24,"type":1,"url":"/file"},{"menuKey":"FileList","menuName":"文件列表","parentKey":"File","sort":25,"type":1,"url":"/file/file-list"},{"menuKey":"UserLog","menuName":"用户日志","parentKey":"System","sort":26,"type":1,"url":"/user-log"},{"menuKey":"UserOperateLog","menuName":"用户操作日志","parentKey":"UserLog","sort":27,"type":1,"url":"/user-log/user-operate-log"},{"menuKey":"UserLoginLog","menuName":"用户登录日志","parentKey":"UserLog","sort":28,"type":1,"url":"/user-log/user-login-log"},{"menuKey":"SystemSetting","menuName":"系统设置","parentKey":"System","sort":29,"type":1,"url":"/system-setting"},{"menuKey":"SystemConfig","menuName":"系统参数","parentKey":"SystemSetting","sort":30,"type":1,"url":"/system-setting/system-config"},{"menuKey":"SystemPrivilege","menuName":"菜单设置","parentKey":"SystemSetting","sort":31,"type":1,"url":"/system-setting/system-privilege"},{"menuKey":"Support","menuName":"开发专用","sort":32,"type":1,"url":"/support"},{"menuKey":"ApiDoc","menuName":"接口文档","parentKey":"Support","sort":33,"type":1,"url":"/api-doc"},{"menuKey":"Swagger","menuName":"Swagger接口文档","parentKey":"ApiDoc","sort":34,"type":1,"url":"/api-doc/swagger"},{"menuKey":"HeartBeat","menuName":"心跳服务","parentKey":"Support","sort":35,"type":1,"url":"/heart-beat"},{"menuKey":"HeartBeatList","menuName":"心跳服务","parentKey":"HeartBeat","sort":36,"type":1,"url":"/heart-beat/heart-beat-list"},{"menuKey":"Monitor","menuName":"系统监控","parentKey":"Support","sort":37,"type":1,"url":"/monitor"},{"menuKey":"OnlineUser","menuName":"在线人数","parentKey":"Monitor","sort":38,"type":1,"url":"/monitor/online-user"},{"menuKey":"Sql","menuName":"SQL监控","parentKey":"Monitor","sort":39,"type":1,"url":"/monitor/sql"},{"menuKey":"Reload","menuName":"动态加载","parentKey":"Support","sort":40,"type":1,"url":"/reload"},{"menuKey":"SmartReloadList","menuName":"SmartReload","parentKey":"Reload","sort":41,"type":1,"url":"/reload/smart-reload-list"},{"menuKey":"Task","menuName":"定时任务","parentKey":"Support","sort":42,"type":1,"url":"/task"},{"menuKey":"TaskList","menuName":"任务管理","parentKey":"Task","sort":43,"type":1,"url":"/system-setting/task-list"}]]', 1, NULL, '2020-12-14 15:16:26', '2020-12-14 15:16:26'), - (41, 1, '管理员', '通用-权限', '查询所有菜单项', '/smart-admin-api/privilege/menu/queryAll', 'net.lab1024.smartadmin.module.system.privilege.controller.PrivilegeController.queryAll', '', 1, NULL, '2020-12-14 15:16:26', '2020-12-14 15:16:26'), - (42, 1, '管理员', '通用-权限', '查询菜单功能点', '/smart-admin-api/privilege/function/query/PeonyList', 'net.lab1024.smartadmin.module.system.privilege.controller.PrivilegeController.functionQuery', 'String["PeonyList"]', 1, NULL, '2020-12-14 15:16:28', '2020-12-14 15:16:28'), - (43, 1, '管理员', '通用-权限', '批量保存功能点', '/smart-admin-api/privilege/function/batchSave', 'net.lab1024.smartadmin.module.system.privilege.controller.PrivilegeController.batchSaveFunctionList', 'ValidateList[[{"functionKey":"peony-list-query","functionName":"查询","menuKey":"PeonyList","sort":1},{"functionKey":"peony-list-add","functionName":"新增","menuKey":"PeonyList","sort":2},{"functionKey":"peony-list-update","functionName":"编辑","menuKey":"PeonyList","sort":3},{"functionKey":"peony-list-batch-delete","functionName":"批量删除","menuKey":"PeonyList","sort":4},{"functionKey":"peony-list-batch-export","functionName":"批量导出","menuKey":"PeonyList","sort":5},{"functionKey":"peony-list-export-all","functionName":"导出全部","menuKey":"PeonyList","sort":6}]]', 1, NULL, '2020-12-14 15:16:30', '2020-12-14 15:16:30'), - (44, 1, '管理员', '通用-权限', '查询菜单功能点', '/smart-admin-api/privilege/function/query/PeonyList', 'net.lab1024.smartadmin.module.system.privilege.controller.PrivilegeController.functionQuery', 'String["PeonyList"]', 1, NULL, '2020-12-14 15:16:30', '2020-12-14 15:16:30'), - (45, 1, '管理员', '通用-权限', '查询菜单功能点', '/smart-admin-api/privilege/function/query/PeonyList1', 'net.lab1024.smartadmin.module.system.privilege.controller.PrivilegeController.functionQuery', 'String["PeonyList1"]', 1, NULL, '2020-12-14 15:16:32', '2020-12-14 15:16:32'), - (46, 1, '管理员', '通用-权限', '批量保存功能点', '/smart-admin-api/privilege/function/batchSave', 'net.lab1024.smartadmin.module.system.privilege.controller.PrivilegeController.batchSaveFunctionList', 'ValidateList[[{"functionKey":"peony1-list-query","functionName":"查询","menuKey":"PeonyList1","sort":1},{"functionKey":"peony1-list-add","functionName":"新增","menuKey":"PeonyList1","sort":2},{"functionKey":"peony1-list-update","functionName":"编辑","menuKey":"PeonyList1","sort":3},{"functionKey":"peony1-list-batch-delete","functionName":"批量删除","menuKey":"PeonyList1","sort":4},{"functionKey":"peony1-list-batch-export","functionName":"批量导出","menuKey":"PeonyList1","sort":5},{"functionKey":"peony1-list-export-all","functionName":"导出全部","menuKey":"PeonyList1","sort":6}]]', 1, NULL, '2020-12-14 15:16:33', '2020-12-14 15:16:33'), - (47, 1, '管理员', '通用-权限', '查询菜单功能点', '/smart-admin-api/privilege/function/query/PeonyList1', 'net.lab1024.smartadmin.module.system.privilege.controller.PrivilegeController.functionQuery', 'String["PeonyList1"]', 1, NULL, '2020-12-14 15:16:33', '2020-12-14 15:16:33'), - (48, 1, '管理员', '通用-权限', '查询菜单功能点', '/smart-admin-api/privilege/function/query/EmailList', 'net.lab1024.smartadmin.module.system.privilege.controller.PrivilegeController.functionQuery', 'String["EmailList"]', 1, NULL, '2020-12-14 15:16:34', '2020-12-14 15:16:34'), - (49, 1, '管理员', '通用-权限', '查询菜单功能点', '/smart-admin-api/privilege/function/query/SendMail', 'net.lab1024.smartadmin.module.system.privilege.controller.PrivilegeController.functionQuery', 'String["SendMail"]', 1, NULL, '2020-12-14 15:16:36', '2020-12-14 15:16:36'), - (50, 1, '管理员', '通用-权限', '查询菜单功能点', '/smart-admin-api/privilege/function/query/KeepAliveContentList', 'net.lab1024.smartadmin.module.system.privilege.controller.PrivilegeController.functionQuery', 'String["KeepAliveContentList"]', 1, NULL, '2020-12-14 15:16:38', '2020-12-14 15:16:38'), - (51, 1, '管理员', '通用-权限', '查询菜单功能点', '/smart-admin-api/privilege/function/query/KeepAliveAddContent', 'net.lab1024.smartadmin.module.system.privilege.controller.PrivilegeController.functionQuery', 'String["KeepAliveAddContent"]', 1, NULL, '2020-12-14 15:16:38', '2020-12-14 15:16:38'), - (52, 1, '管理员', '通用-权限', '查询菜单功能点', '/smart-admin-api/privilege/function/query/NoticeList', 'net.lab1024.smartadmin.module.system.privilege.controller.PrivilegeController.functionQuery', 'String["NoticeList"]', 1, NULL, '2020-12-14 15:16:40', '2020-12-14 15:16:40'), - (53, 1, '管理员', '通用-权限', '查询菜单功能点', '/smart-admin-api/privilege/function/query/PersonNotice', 'net.lab1024.smartadmin.module.system.privilege.controller.PrivilegeController.functionQuery', 'String["PersonNotice"]', 1, NULL, '2020-12-14 15:16:41', '2020-12-14 15:16:41'), - (54, 1, '管理员', '通用-权限', '查询菜单功能点', '/smart-admin-api/privilege/function/query/NoticeDetail', 'net.lab1024.smartadmin.module.system.privilege.controller.PrivilegeController.functionQuery', 'String["NoticeDetail"]', 1, NULL, '2020-12-14 15:16:42', '2020-12-14 15:16:42'), - (55, 1, '管理员', '通用-权限', '查询菜单功能点', '/smart-admin-api/privilege/function/query/ThreeLevelRouterView', 'net.lab1024.smartadmin.module.system.privilege.controller.PrivilegeController.functionQuery', 'String["ThreeLevelRouterView"]', 1, NULL, '2020-12-14 15:16:44', '2020-12-14 15:16:44'), - (56, 1, '管理员', '通用-权限', '查询菜单功能点', '/smart-admin-api/privilege/function/query/RoleManage', 'net.lab1024.smartadmin.module.system.privilege.controller.PrivilegeController.functionQuery', 'String["RoleManage"]', 1, NULL, '2020-12-14 15:16:47', '2020-12-14 15:16:47'), - (57, 1, '管理员', '通用-权限', '查询菜单功能点', '/smart-admin-api/privilege/function/query/PositionList', 'net.lab1024.smartadmin.module.system.privilege.controller.PrivilegeController.functionQuery', 'String["PositionList"]', 1, NULL, '2020-12-14 15:16:48', '2020-12-14 15:16:48'), - (58, 1, '管理员', '通用-权限', '查询菜单功能点', '/smart-admin-api/privilege/function/query/RoleEmployeeManage', 'net.lab1024.smartadmin.module.system.privilege.controller.PrivilegeController.functionQuery', 'String["RoleEmployeeManage"]', 1, NULL, '2020-12-14 15:16:53', '2020-12-14 15:16:53'), - (59, 1, '管理员', '通用-权限', '查询菜单功能点', '/smart-admin-api/privilege/function/query/FileList', 'net.lab1024.smartadmin.module.system.privilege.controller.PrivilegeController.functionQuery', 'String["FileList"]', 1, NULL, '2020-12-14 15:17:00', '2020-12-14 15:17:00'), - (60, 1, '管理员', '通用-权限', '查询菜单功能点', '/smart-admin-api/privilege/function/query/UserOperateLog', 'net.lab1024.smartadmin.module.system.privilege.controller.PrivilegeController.functionQuery', 'String["UserOperateLog"]', 1, NULL, '2020-12-14 15:17:03', '2020-12-14 15:17:03'), - (61, 1, '管理员', '通用-权限', '查询菜单功能点', '/smart-admin-api/privilege/function/query/UserLoginLog', 'net.lab1024.smartadmin.module.system.privilege.controller.PrivilegeController.functionQuery', 'String["UserLoginLog"]', 1, NULL, '2020-12-14 15:17:03', '2020-12-14 15:17:03'), - (62, 1, '管理员', '通用-权限', '查询菜单功能点', '/smart-admin-api/privilege/function/query/SystemConfig', 'net.lab1024.smartadmin.module.system.privilege.controller.PrivilegeController.functionQuery', 'String["SystemConfig"]', 1, NULL, '2020-12-14 15:17:04', '2020-12-14 15:17:04'), - (63, 1, '管理员', '通用-权限', '查询菜单功能点', '/smart-admin-api/privilege/function/query/SystemPrivilege', 'net.lab1024.smartadmin.module.system.privilege.controller.PrivilegeController.functionQuery', 'String["SystemPrivilege"]', 1, NULL, '2020-12-14 15:17:06', '2020-12-14 15:17:06'), - (64, 1, '管理员', '通用-权限', '批量保存功能点', '/smart-admin-api/privilege/function/batchSave', 'net.lab1024.smartadmin.module.system.privilege.controller.PrivilegeController.batchSaveFunctionList', 'ValidateList[[{"functionKey":"privilege-main-update","functionName":"编辑","menuKey":"SystemPrivilege","sort":1},{"functionKey":"privilege-batch-save-points","functionName":"批量保存功能点","menuKey":"SystemPrivilege","sort":2},{"functionKey":"privilege-main-search","functionName":"查询","menuKey":"SystemPrivilege","sort":3}]]', 1, NULL, '2020-12-14 15:17:11', '2020-12-14 15:17:11'), - (65, 1, '管理员', '通用-权限', '查询菜单功能点', '/smart-admin-api/privilege/function/query/SystemPrivilege', 'net.lab1024.smartadmin.module.system.privilege.controller.PrivilegeController.functionQuery', 'String["SystemPrivilege"]', 1, NULL, '2020-12-14 15:17:11', '2020-12-14 15:17:11'), - (66, 1, '管理员', '通用-权限', '保存更新功能点', '/smart-admin-api/privilege/function/saveOrUpdate', 'net.lab1024.smartadmin.module.system.privilege.controller.PrivilegeController.functionSaveOrUpdate', 'PrivilegeFunctionDTO[{"functionKey":"privilege-batch-save-points","functionName":"批量保存功能点","menuKey":"SystemPrivilege","sort":1,"url":"privilegeController.functionSaveOrUpdate"}]', 1, NULL, '2020-12-14 15:17:30', '2020-12-14 15:17:30'), - (67, 1, '管理员', '通用-权限', '查询菜单功能点', '/smart-admin-api/privilege/function/query/SystemPrivilege', 'net.lab1024.smartadmin.module.system.privilege.controller.PrivilegeController.functionQuery', 'String["SystemPrivilege"]', 1, NULL, '2020-12-14 15:17:30', '2020-12-14 15:17:30'), - (68, 1, '管理员', '通用-权限', '查询菜单功能点', '/smart-admin-api/privilege/function/query/Swagger', 'net.lab1024.smartadmin.module.system.privilege.controller.PrivilegeController.functionQuery', 'String["Swagger"]', 1, NULL, '2020-12-14 15:17:36', '2020-12-14 15:17:36'), - (69, 1, '管理员', '通用-权限', '查询菜单功能点', '/smart-admin-api/privilege/function/query/HeartBeatList', 'net.lab1024.smartadmin.module.system.privilege.controller.PrivilegeController.functionQuery', 'String["HeartBeatList"]', 1, NULL, '2020-12-14 15:17:37', '2020-12-14 15:17:37'), - (70, 1, '管理员', '通用-权限', '查询菜单功能点', '/smart-admin-api/privilege/function/query/SmartReloadList', 'net.lab1024.smartadmin.module.system.privilege.controller.PrivilegeController.functionQuery', 'String["SmartReloadList"]', 1, NULL, '2020-12-14 15:17:42', '2020-12-14 15:17:42'), - (71, 1, '管理员', '通用-权限', '查询菜单功能点', '/smart-admin-api/privilege/function/query/TaskList', 'net.lab1024.smartadmin.module.system.privilege.controller.PrivilegeController.functionQuery', 'String["TaskList"]', 1, NULL, '2020-12-14 15:17:43', '2020-12-14 15:17:43'), - (72, 1, '管理员', '通用-邮件发送', '分页查询', '/smart-admin-api/email/page/query', 'net.lab1024.smartadmin.module.business.email.EmailController.queryByPage', 'EmailQueryDTO[{"endDate":"","pageNum":1,"pageSize":10,"searchCount":true,"startDate":""}]', 1, NULL, '2020-12-14 15:17:57', '2020-12-14 15:17:57'), - (73, 1, '管理员', '管理端-用户登录', '获取session', '/smart-admin-api/session/get', 'net.lab1024.smartadmin.module.system.login.LoginController.getSession', '', 1, NULL, '2020-12-14 15:18:14', '2020-12-14 15:18:14'), - (74, 1, '管理员', '管理端-用户登录', '获取session', '/smart-admin-api/session/get', 'net.lab1024.smartadmin.module.system.login.LoginController.getSession', '', 1, NULL, '2020-12-14 15:18:27', '2020-12-14 15:18:27'); -/*!40000 ALTER TABLE `t_user_operate_log` ENABLE KEYS */; - -/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */; -/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; diff --git a/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/java/AddDTO.java.vm b/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/java/AddDTO.java.vm deleted file mode 100644 index 03da7773..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/java/AddDTO.java.vm +++ /dev/null @@ -1,36 +0,0 @@ -package ${basePackage}.module.${modulePackage}.domain.dto; - -import lombok.Data; -#foreach ($dtoImport in $dtoImports) -$dtoImport -#end -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModelProperty; - -/** - * 新建 [ ${tableDesc} ] - * - * @author ${author} - * @version 1.0 - * @company ${company} - * @copyright (c) 2018 ${company}Inc. All rights reserved. - * @date ${date} - * @since JDK1.8 - */ -@Data -public class ${moduleClass}AddDTO { -#foreach ($column in $columnList) -#if($column.fieldName != 'id') -#if($column.fieldType == 'Date') - @ApiModelProperty("${column.columnDesc}") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private $column.fieldType $column.fieldName; -#else - @ApiModelProperty("${column.columnDesc}") - private $column.fieldType $column.fieldName; -#end - -#end -#end - -} diff --git a/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/java/Controller.java.vm b/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/java/Controller.java.vm deleted file mode 100644 index 1dfbe2ed..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/java/Controller.java.vm +++ /dev/null @@ -1,88 +0,0 @@ -package ${basePackage}.module.${modulePackage}.controller; - -import ${basePackage}.common.domain.PageResultDTO; -import ${basePackage}.common.controller.BaseController; -import ${basePackage}.common.domain.ResponseDTO; -import ${basePackage}.common.domain.ValidateList; -import ${basePackage}.module.${modulePackage}.domain.dto.${moduleClass}AddDTO; -import ${basePackage}.module.${modulePackage}.domain.dto.${moduleClass}UpdateDTO; -import ${basePackage}.module.${modulePackage}.domain.dto.${moduleClass}QueryDTO; -import ${basePackage}.module.${modulePackage}.domain.vo.${moduleClass}VO; -import ${basePackage}.module.${modulePackage}.domain.vo.${moduleClass}ExcelVO; -import ${basePackage}.module.${modulePackage}.service.${moduleClass}Service; -import cn.afterturn.easypoi.excel.ExcelExportUtil; -import cn.afterturn.easypoi.excel.entity.ExportParams; -import org.apache.poi.ss.usermodel.Workbook; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletResponse; -import java.util.List; - -/** - * [ ${tableDesc} ] - * - * @author ${author} - * @version 1.0 - * @company ${company} - * @copyright (c) ${company}Inc. All rights reserved. - * @date ${date} - * @since JDK1.8 - */ -@RestController -@Api(tags = {"${tableDesc}"}) -public class ${moduleClass}Controller extends BaseController { - - @Autowired - private ${moduleClass}Service ${moduleVar}Service; - - @ApiOperation(value = "分页查询${tableDesc}",notes = "@author ${author}") - @PostMapping("/${moduleVar}/page/query") - public ResponseDTO> queryByPage(@RequestBody ${moduleClass}QueryDTO queryDTO) { - return ${moduleVar}Service.queryByPage(queryDTO); - } - - @ApiOperation(value = "添加${tableDesc}",notes = "@author ${author}") - @PostMapping("/${moduleVar}/add") - public ResponseDTO add(@RequestBody @Validated ${moduleClass}AddDTO addTO){ - return ${moduleVar}Service.add(addTO); - } - - @ApiOperation(value="修改${tableDesc}",notes = "@author ${author}") - @PostMapping("/${moduleVar}/update") - public ResponseDTO update(@RequestBody @Validated ${moduleClass}UpdateDTO updateDTO){ - return ${moduleVar}Service.update(updateDTO); - } - - @ApiOperation(value="批量删除${tableDesc}",notes = "@author ${author}") - @PostMapping("/${moduleVar}/deleteByIds") - public ResponseDTO delete(@RequestBody @Validated ValidateList idList) { - return ${moduleVar}Service.deleteByIds(idList); - } - - @ApiOperation(value = "批量导出", notes = "@author ${author}") - @PostMapping("/${moduleVar}/export/batch") - public void batchExport(@RequestBody @Validated ValidateList idList, HttpServletResponse response) { - //查询数据 - List<${moduleClass}ExcelVO> ${moduleVar}List = ${moduleVar}Service.queryBatchExportData(idList); - //导出操作 - ExportParams ex = new ExportParams("${tableDesc}", "Sheet1"); - Workbook workbook = ExcelExportUtil.exportExcel(ex, ${moduleClass}ExcelVO.class, ${moduleVar}List); - downloadExcel("${tableDesc}", workbook, response); - } - - @ApiOperation(value = "导出全部", notes = "@author ${author}") - @PostMapping("/${moduleVar}/export/all") - public void exportAll(@RequestBody @Validated ${moduleClass}QueryDTO queryDTO, HttpServletResponse response) { - //查询数据 - List<${moduleClass}ExcelVO> ${moduleVar}List = ${moduleVar}Service.queryAllExportData(queryDTO); - //导出操作 - ExportParams ex = new ExportParams("${tableDesc}", "Sheet1"); - Workbook workbook = ExcelExportUtil.exportExcel(ex, ${moduleClass}ExcelVO.class, ${moduleVar}List); - downloadExcel("${tableDesc}", workbook, response); - } - -} diff --git a/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/java/Dao.java.vm b/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/java/Dao.java.vm deleted file mode 100644 index b19db804..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/java/Dao.java.vm +++ /dev/null @@ -1,64 +0,0 @@ -package ${basePackage}.module.${modulePackage}.dao; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.baomidou.mybatisplus.core.metadata.IPage; -import ${basePackage}.module.${modulePackage}.domain.dto.${moduleClass}QueryDTO; -import ${basePackage}.module.${modulePackage}.domain.entity.${moduleClass}Entity; -import ${basePackage}.module.${modulePackage}.domain.vo.${moduleClass}VO; -import ${basePackage}.module.${modulePackage}.domain.vo.${moduleClass}ExcelVO; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Component; - -import java.util.List; - -/** - * [ ${tableDesc} ] - * - * @author ${author} - * @version 1.0 - * @company ${company} - * @copyright (c) ${company}Inc. All rights reserved. - * @date ${date} - * @since JDK1.8 - */ -@Mapper -@Component -public interface ${moduleClass}Dao extends BaseMapper<${moduleClass}Entity> { - - /** - * 分页查询 - * @param queryDTO - * @return ${moduleClass}VO - */ - IPage<${moduleClass}VO> queryByPage(Page page, @Param("queryDTO") ${moduleClass}QueryDTO queryDTO); - - /** - * 根据id删除 - * @param id - * @return - */ - void deleteById(@Param("id")Long id); - - /** - * 根据id批量删除 - * @param idList - * @return - */ - void deleteByIdList(@Param("idList") List idList); - - /** - * 查询所有导出数据 - * @param queryDTO - * @return - */ - List<${moduleClass}ExcelVO> queryAllExportData(@Param("queryDTO")${moduleClass}QueryDTO queryDTO); - - /** - * 查询批量导出数据 - * @param idList - * @return - */ - List<${moduleClass}ExcelVO> queryBatchExportData(@Param("idList")List idList); -} diff --git a/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/java/Dao.xml.vm b/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/java/Dao.xml.vm deleted file mode 100644 index 5e64e4bc..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/java/Dao.xml.vm +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - - - - - - - - - - - delete from ${tableName} where id = #{id} - - - - delete from ${tableName} where id in - - #{item} - - - - \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/java/Entity.java.vm b/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/java/Entity.java.vm deleted file mode 100644 index ca7e7e6d..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/java/Entity.java.vm +++ /dev/null @@ -1,33 +0,0 @@ -package ${basePackage}.module.${modulePackage}.domain.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import ${basePackage}.common.domain.BaseEntity; -#foreach ($entityImport in $entityImports) -$entityImport -#end -import lombok.Data; - -/** - * [ ${tableDesc} ] - * - * @author ${author} - * @version 1.0 - * @company ${company} - * @copyright (c) ${company}Inc. All rights reserved. - * @date ${date} - * @since JDK1.8 - */ -@Data -@TableName("${tableName}") -public class ${moduleClass}Entity extends BaseEntity{ -#foreach ($column in $columnList) - -#if($column.columnName != 'id' && $column.fieldName != 'updateTime' && $column.fieldName != 'createTime') - /** - * $column.columnDesc - */ - private $column.fieldType $column.fieldName; -#end -#end - -} diff --git a/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/java/ExcelVO.java.vm b/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/java/ExcelVO.java.vm deleted file mode 100644 index fa4e7e0a..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/java/ExcelVO.java.vm +++ /dev/null @@ -1,33 +0,0 @@ -package ${basePackage}.module.${modulePackage}.domain.vo; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import lombok.Data; -#foreach ($dtoImport in $dtoImports) -$dtoImport -#end - -/** - * [ ${tableDesc} ] - * - * @author ${author} - * @version 1.0 - * @company ${company} - * @copyright (c) ${company}Inc. All rights reserved. - * @date ${date} - * @since JDK1.8 - */ -@Data -public class ${moduleClass}ExcelVO { -#foreach ($column in $columnList) -#if($column.fieldType == 'Date') - @Excel(name = "${column.columnDesc}", format = "yyyy-MM-dd HH:mm:ss") - private $column.fieldType $column.fieldName; -#else - @Excel(name = "${column.columnDesc}") - private $column.fieldType $column.fieldName; -#end - -#end - - -} diff --git a/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/java/QueryDTO.java.vm b/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/java/QueryDTO.java.vm deleted file mode 100644 index 44815d4d..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/java/QueryDTO.java.vm +++ /dev/null @@ -1,45 +0,0 @@ -package ${basePackage}.module.${modulePackage}.domain.dto; - -import ${basePackage}.common.domain.PageParamDTO; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import java.util.Date; -#foreach ($queryImport in $queryImports) -$queryImport -#end - -/** - * [ ${tableDesc} ] - * - * @author ${author} - * @version 1.0 - * @company ${company} - * @copyright (c) ${company}Inc. All rights reserved. - * @date ${date} - * @since JDK1.8 - */ -@Data -public class ${moduleClass}QueryDTO extends PageParamDTO { -#foreach ($queryField in $queryFieldList) - -#if($queryField.sqlOperate == 'in') - @ApiModelProperty("${queryField.columnDesc}") - private List<${queryField.fieldType}> ${queryField.fieldName}List; -#else - @ApiModelProperty("${queryField.columnDesc}") - private ${queryField.fieldType} ${queryField.fieldName}; -#end -#end - - @ApiModelProperty("创建时间-开始") - private Date createTimeBegin; - - @ApiModelProperty("创建时间-截止") - private Date createTimeEnd; - - @ApiModelProperty("上次更新时间-开始") - private Date updateTimeBegin; - - @ApiModelProperty("上次更新创建时间-开始") - private Date updateTimeEnd; -} diff --git a/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/java/Service.java.vm b/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/java/Service.java.vm deleted file mode 100644 index ca3b939d..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/java/Service.java.vm +++ /dev/null @@ -1,108 +0,0 @@ -package ${basePackage}.module.${modulePackage}.service; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import ${basePackage}.common.domain.PageResultDTO; -import ${basePackage}.common.domain.ResponseDTO; -import ${basePackage}.module.${modulePackage}.dao.${moduleClass}Dao; -import ${basePackage}.module.${modulePackage}.domain.dto.${moduleClass}AddDTO; -import ${basePackage}.module.${modulePackage}.domain.dto.${moduleClass}UpdateDTO; -import ${basePackage}.module.${modulePackage}.domain.dto.${moduleClass}QueryDTO; -import ${basePackage}.module.${modulePackage}.domain.entity.${moduleClass}Entity; -import ${basePackage}.module.${modulePackage}.domain.vo.${moduleClass}VO; -import ${basePackage}.module.${modulePackage}.domain.vo.${moduleClass}ExcelVO; -import ${basePackage}.util.SmartPageUtil; -import ${basePackage}.util.SmartBeanUtil; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.List; - -/** - * [ ${tableDesc} ] - * - * @author ${author} - * @version 1.0 - * @company ${company} - * @copyright (c) ${company}Inc. All rights reserved. - * @date ${date} - * @since JDK1.8 - */ -@Service -public class ${moduleClass}Service { - - @Autowired - private ${moduleClass}Dao ${moduleVar}Dao; - - /** - * 根据id查询 - */ - public ${moduleClass}Entity getById(Long id){ - return ${moduleVar}Dao.selectById(id); - } - - /** - * 分页查询 - * @author ${author} - * @date ${date} - */ - public ResponseDTO> queryByPage(${moduleClass}QueryDTO queryDTO) { - Page page = SmartPageUtil.convert2QueryPage(queryDTO); - IPage<${moduleClass}VO> voList = ${moduleVar}Dao.queryByPage(page, queryDTO); - PageResultDTO<${moduleClass}VO> pageResultDTO = SmartPageUtil.convert2PageResult(voList); - return ResponseDTO.succData(pageResultDTO); - } - - /** - * 添加 - * @author ${author} - * @date ${date} - */ - public ResponseDTO add(${moduleClass}AddDTO addDTO) { - ${moduleClass}Entity entity = SmartBeanUtil.copy(addDTO, ${moduleClass}Entity.class); - ${moduleVar}Dao.insert(entity); - return ResponseDTO.succ(); - } - - /** - * 编辑 - * @author ${author} - * @date ${date} - */ - @Transactional(rollbackFor = Exception.class) - public ResponseDTO update(${moduleClass}UpdateDTO updateDTO) { - ${moduleClass}Entity entity = SmartBeanUtil.copy(updateDTO, ${moduleClass}Entity.class); - ${moduleVar}Dao.updateById(entity); - return ResponseDTO.succ(); - } - - /** - * 删除 - * @author ${author} - * @date ${date} - */ - @Transactional(rollbackFor = Exception.class) - public ResponseDTO deleteByIds(List idList) { - ${moduleVar}Dao.deleteByIdList(idList); - return ResponseDTO.succ(); - } - - /** - * 查询全部导出对象 - * @author ${author} - * @date ${date} - */ - public List<${moduleClass}ExcelVO> queryAllExportData(${moduleClass}QueryDTO queryDTO) { - return ${moduleVar}Dao.queryAllExportData( queryDTO); - } - - /** - * 批量查询导出对象 - * @author ${author} - * @date ${date} - */ - public List<${moduleClass}ExcelVO> queryBatchExportData(List idList) { - return ${moduleVar}Dao.queryBatchExportData(idList); - } -} diff --git a/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/java/UpdateDTO.java.vm b/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/java/UpdateDTO.java.vm deleted file mode 100644 index e96cc501..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/java/UpdateDTO.java.vm +++ /dev/null @@ -1,20 +0,0 @@ -package ${basePackage}.module.${modulePackage}.domain.dto; - -import lombok.Data; - -/** - * 更新 [ ${tableDesc} ] - * - * @author ${author} - * @version 1.0 - * @company ${company} - * @copyright (c) 2018 ${company}Inc. All rights reserved. - * @date ${date} - * @since JDK1.8 - */ -@Data -public class ${moduleClass}UpdateDTO extends ${moduleClass}AddDTO { - - private Long id; - -} diff --git a/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/java/VO.java.vm b/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/java/VO.java.vm deleted file mode 100644 index b7a5ea53..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/java/VO.java.vm +++ /dev/null @@ -1,35 +0,0 @@ -package ${basePackage}.module.${modulePackage}.domain.vo; - -import lombok.Data; -#foreach ($dtoImport in $dtoImports) -$dtoImport -#end -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModelProperty; - -/** - * [ ${tableDesc} ] - * - * @author ${author} - * @version 1.0 - * @company ${company} - * @copyright (c) ${company}Inc. All rights reserved. - * @date ${date} - * @since JDK1.8 - */ -@Data -public class ${moduleClass}VO { -#foreach ($column in $columnList) -#if($column.fieldType == 'Date') - @ApiModelProperty("${column.columnDesc}") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private $column.fieldType $column.fieldName; -#else - @ApiModelProperty("${column.columnDesc}") - private $column.fieldType $column.fieldName; -#end - -#end - - -} diff --git a/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/web/Api.js.vm b/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/web/Api.js.vm deleted file mode 100644 index 858f2366..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/web/Api.js.vm +++ /dev/null @@ -1,28 +0,0 @@ -import { postAxios, getAxios, postDownloadAxios } from '@/lib/http'; - -export const ${moduleVar}Api = { - // 添加${tableDesc} @author ${author} - add${moduleClass}: (data) => { - return postAxios('/${moduleVar}/add', data); - }, - // 分页查询${tableDesc} @author ${author} - query${moduleClass}: (data) => { - return postAxios('/${moduleVar}/page/query', data); - }, - // 批量删除${tableDesc} @author ${author} - batchDelete${moduleClass}: (idList) => { - return postAxios('/${moduleVar}/deleteByIds', idList); - }, - // 修改${tableDesc} @author ${author} - update${moduleClass}: (data) => { - return postAxios('/${moduleVar}/update',data); - }, - // 导出全部 @author ${author} - exportAll:(data)=>{ - return postDownloadAxios('/${moduleVar}/export/all',data); - }, - // 批量导出 @author ${author} - batchExport: (idList) => { - return postDownloadAxios('/${moduleVar}/export/batch', idList); - }, -}; diff --git a/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/web/List.vue.vm b/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/web/List.vue.vm deleted file mode 100644 index 3bc635f4..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/web/List.vue.vm +++ /dev/null @@ -1,439 +0,0 @@ - - - diff --git a/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/web/ListForm.vue.vm b/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/web/ListForm.vue.vm deleted file mode 100644 index 558dfcb0..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/web/ListForm.vue.vm +++ /dev/null @@ -1,132 +0,0 @@ - - \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/web/Router.js.vm b/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/web/Router.js.vm deleted file mode 100644 index 00d5ed6c..00000000 --- a/smart-admin-service/smart-admin-api/src/main/resources/templates/codegenerator/web/Router.js.vm +++ /dev/null @@ -1,32 +0,0 @@ -import Main from '@/components/main'; -// ${tableName}路由 -export const ${moduleVar} = [ - { - path: '/${webModuleName}', - name: '${moduleClass}', - component: Main, - meta: { - title: '${tableDesc}管理', - icon: 'icon iconfont iconyoujianguanli' - }, - children: [ - // ${tableDesc}列表 - { - path: '/${webModuleName}/${webModuleName}-list', - name: '${moduleClass}List', - meta: { - title: '${tableDesc}列表', - privilege: [ - { title: '查询', name: '${webModuleName}-list-query' }, - { title: '新增', name: '${webModuleName}-list-add' }, - { title: '编辑', name: '${webModuleName}-list-update' }, - { title: '批量删除', name: '${webModuleName}-list-batch-delete' }, - { title: '批量导出', name: '${webModuleName}-list-batch-export' }, - { title: '导出全部', name: '${webModuleName}-list-export-all' } - ] - }, - component: () => import('@/views/business/${webModuleName}/${webModuleName}-list.vue') - } - ] - } -]; diff --git a/smart-admin-service/smart-admin-api/src/test/java/net/lab1024/smartadmin/BaseTest.java b/smart-admin-service/smart-admin-api/src/test/java/net/lab1024/smartadmin/BaseTest.java deleted file mode 100644 index 6d681a15..00000000 --- a/smart-admin-service/smart-admin-api/src/test/java/net/lab1024/smartadmin/BaseTest.java +++ /dev/null @@ -1,28 +0,0 @@ -package net.lab1024.smartadmin; - -import org.junit.After; -import org.junit.Before; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -/** - * 测试基类 - * - * @author lizongliang - * @date 2017/09/29 10:54 - */ -@RunWith(SpringRunner.class) -@SpringBootTest(classes = SmartAdminApplication.class,webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) -public class BaseTest { - - @Before - public void before() { - System.out.println("测试开始------------------"); - } - - @After - public void after() { - System.out.println("测试结束------------------"); - } -} diff --git a/smart-admin-service/smart-admin-api/src/test/java/net/lab1024/smartadmin/SmartAdminApplicationTests.java b/smart-admin-service/smart-admin-api/src/test/java/net/lab1024/smartadmin/SmartAdminApplicationTests.java deleted file mode 100644 index d140b88b..00000000 --- a/smart-admin-service/smart-admin-api/src/test/java/net/lab1024/smartadmin/SmartAdminApplicationTests.java +++ /dev/null @@ -1,11 +0,0 @@ -package net.lab1024.smartadmin; - -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(classes = SmartAdminApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) -public class SmartAdminApplicationTests { - -} \ No newline at end of file diff --git a/smart-admin-service/smart-admin-api/src/test/java/net/lab1024/smartadmin/module/support/codegenerator/CodeGeneratorServiceTest.java b/smart-admin-service/smart-admin-api/src/test/java/net/lab1024/smartadmin/module/support/codegenerator/CodeGeneratorServiceTest.java deleted file mode 100644 index e824cf51..00000000 --- a/smart-admin-service/smart-admin-api/src/test/java/net/lab1024/smartadmin/module/support/codegenerator/CodeGeneratorServiceTest.java +++ /dev/null @@ -1,66 +0,0 @@ -package net.lab1024.smartadmin.module.support.codegenerator; - -import net.lab1024.smartadmin.BaseTest; -import net.lab1024.smartadmin.module.support.codegenerator.constant.SqlOperateTypeEnum; -import net.lab1024.smartadmin.module.support.codegenerator.domain.CodeGeneratorDTO; -import net.lab1024.smartadmin.module.support.codegenerator.domain.CodeGeneratorQueryColumnDTO; -import net.lab1024.smartadmin.module.support.codegenerator.service.CodeGeneratorService; -import com.google.common.collect.Lists; -import org.junit.Test; -import org.springframework.beans.factory.annotation.Autowired; - -import java.util.List; - -/** - * IdGeneratorService Tester. - * - * @author zhuoda - * @version 1.0 - */ -public class CodeGeneratorServiceTest extends BaseTest { - - @Autowired - private CodeGeneratorService codeGeneratorService; - - @Test - public void testGenerate() throws Exception { - /** - * !!! 所有查询条件均包含了createTime和updateTime的 范围查询 !!! - */ - - // t_peony 牡丹花表 - - //搜索字段 kind, 使用like搜索 - CodeGeneratorQueryColumnDTO kind = CodeGeneratorQueryColumnDTO.builder() - .columnName("kind") - .sqlOperate(SqlOperateTypeEnum.LIKE).build(); - //搜索字段 kind, 使用 == 搜索 - CodeGeneratorQueryColumnDTO id = CodeGeneratorQueryColumnDTO.builder() - .columnName("id") - .sqlOperate(SqlOperateTypeEnum.EQUALS).build(); - //搜索字段 name, 使用like搜索 - CodeGeneratorQueryColumnDTO name = CodeGeneratorQueryColumnDTO.builder() - .columnName("name") - .sqlOperate(SqlOperateTypeEnum.LIKE).build(); - //搜索字段 color, 使用like搜索 - CodeGeneratorQueryColumnDTO color = CodeGeneratorQueryColumnDTO.builder() - .columnName("color") - .sqlOperate(SqlOperateTypeEnum.LIKE).build(); - - List queryColumnList = Lists.newArrayList(id, kind, name, color); - - CodeGeneratorDTO codeGenerator = CodeGeneratorDTO.builder() - .author("卓大")//class 注释作者 - .company("1024创新实验室( www.1024lab.net )")//class注释公司名字 - .tableName("t_peony")//表名 - .tablePrefix("t_")//表名前缀 - .basePackage("net.lab1024.smartadmin")//包名 - .modulePackage("business.peony")//业务子包名 - .queryColumnList(queryColumnList)//加入搜搜字段 - .build();//构建 - - //当需要代码生成的时候,请将注释去掉 -// codeGeneratorService.codeGenerator(codeGenerator); - } - -} diff --git a/smart-admin-web/.babelrc b/smart-admin-web/.babelrc deleted file mode 100644 index 2a818842..00000000 --- a/smart-admin-web/.babelrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "presets": [ - "@vue/app" - ] -} diff --git a/smart-admin-web/.editorconfig b/smart-admin-web/.editorconfig deleted file mode 100644 index 9d08a1a8..00000000 --- a/smart-admin-web/.editorconfig +++ /dev/null @@ -1,9 +0,0 @@ -root = true - -[*] -charset = utf-8 -indent_style = space -indent_size = 2 -end_of_line = lf -insert_final_newline = true -trim_trailing_whitespace = true diff --git a/smart-admin-web/.env.development b/smart-admin-web/.env.development deleted file mode 100644 index 746c33a9..00000000 --- a/smart-admin-web/.env.development +++ /dev/null @@ -1,4 +0,0 @@ -NODE_ENV=development -VUE_APP_TYPE=dev -VUE_APP_URL=http://127.0.0.1:10086/smart-admin-api/ -VUE_APP_SOCKET_URL=ws://127.0.0.1:10086/smart-admin-api/ diff --git a/smart-admin-web/.env.local b/smart-admin-web/.env.local deleted file mode 100644 index 746c33a9..00000000 --- a/smart-admin-web/.env.local +++ /dev/null @@ -1,4 +0,0 @@ -NODE_ENV=development -VUE_APP_TYPE=dev -VUE_APP_URL=http://127.0.0.1:10086/smart-admin-api/ -VUE_APP_SOCKET_URL=ws://127.0.0.1:10086/smart-admin-api/ diff --git a/smart-admin-web/.env.prod b/smart-admin-web/.env.prod deleted file mode 100644 index d90edfe9..00000000 --- a/smart-admin-web/.env.prod +++ /dev/null @@ -1,8 +0,0 @@ -NODE_ENV=production -VUE_APP_TYPE=prod -VUE_APP_URL=http://preview.smartadmin.1024lab.net/smart-admin-api/ -VUE_APP_SOCKET_URL=ws://preview.smartadmin.1024lab.net/smart-admin-api/ - -// VUE_APP_URL=http://127.0.0.1:10086/smart-admin-api/ -// VUE_APP_SOCKET_URL=ws://127.0.0.1:10086/smart-admin-api/ - diff --git a/smart-admin-web/.env.sit b/smart-admin-web/.env.sit deleted file mode 100644 index ac2ac140..00000000 --- a/smart-admin-web/.env.sit +++ /dev/null @@ -1,3 +0,0 @@ -NODE_ENV=production -VUE_APP_TYPE=sit -VUE_APP_URL=http://172.16.0.145:10086/smart-admin-api/ diff --git a/smart-admin-web/.eslintrc.js b/smart-admin-web/.eslintrc.js deleted file mode 100644 index 28180441..00000000 --- a/smart-admin-web/.eslintrc.js +++ /dev/null @@ -1,34 +0,0 @@ -module.exports = { - root: true, - "extends": [ - "plugin:vue/essential", - "@vue/standard" - ], - rules: { - "generator-star-spacing": "off", //生成器函数*的前后空格 - // allow debugger during development - "no-debugger": process.env.NODE_ENV === "production" ? "error" : "off", - "vue/no-parsing-error": [2, { - "x-invalid-end-tag": false - }], - "no-const-assign": 2, //禁止修改const声明的变量 - "no-unused-vars": [0, { //禁止声明变量后却不使用 - // 允许声明未使用变量 - "vars": "all", - // 参数不检查 - "args": "none" - }], - "quotes": [2, "single"], //单引号 - "singleQuote": true, - "indent": 2, //缩进量 - "no-var": 2, //禁用var,用let和const代替 - "camelcase": 2, //强制驼峰法命名 - "eqeqeq": 1, //要求使用 === 和 !== 代替 == 和 != 操作符 - "no-eq-null": 2, //禁止对null使用==或!=运算符 - "no-sequences": 0, //禁用逗号操作符 - "semi": [2, "always"] //强制分号 - }, - parserOptions: { - parser: "babel-eslint" - } -} diff --git a/smart-admin-web/.gitignore b/smart-admin-web/.gitignore deleted file mode 100644 index a1009cf5..00000000 --- a/smart-admin-web/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -.DS_Store -node_modules -/dist - -/tests/e2e/videos/ -/tests/e2e/screenshots/ - -# Log files -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# Editor directories and files -.idea -.vscode -*.suo -*.ntvs* -*.njsproj -*.sln -*.sw* - -build/env.js diff --git a/smart-admin-web/.travis.yml b/smart-admin-web/.travis.yml deleted file mode 100644 index 07c971f8..00000000 --- a/smart-admin-web/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: stable -script: npm run lint -notifications: - email: false diff --git a/smart-admin-web/README.md b/smart-admin-web/README.md deleted file mode 100644 index fe637c03..00000000 --- a/smart-admin-web/README.md +++ /dev/null @@ -1,13 +0,0 @@ -### 启动讲解 - -###### 配置vscode -将 /vscode/settings.json文件配置到vscode中 - -###### 启动 -1 安装依赖: - -`npm install` - -2 运行本地环境 - -`npm run local` \ No newline at end of file diff --git a/smart-admin-web/cypress.json b/smart-admin-web/cypress.json deleted file mode 100644 index 470c7201..00000000 --- a/smart-admin-web/cypress.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "pluginsFile": "tests/e2e/plugins/index.js" -} diff --git a/smart-admin-web/doc/notice.txt b/smart-admin-web/doc/notice.txt deleted file mode 100644 index 8184781f..00000000 --- a/smart-admin-web/doc/notice.txt +++ /dev/null @@ -1,2 +0,0 @@ -1 login-form.vue 去掉登录帐号提示 -2 login-form.vue 修改默认登录绑定帐号 \ No newline at end of file diff --git a/smart-admin-web/javascript-ant-design-vue3/.env b/smart-admin-web/javascript-ant-design-vue3/.env new file mode 100644 index 00000000..6181c66e --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/.env @@ -0,0 +1,2 @@ + +VITE_APP_PROJECT_TITLE = 'SmartAdmin' \ No newline at end of file diff --git a/smart-admin-web/javascript-ant-design-vue3/.env.development b/smart-admin-web/javascript-ant-design-vue3/.env.development new file mode 100644 index 00000000..ac7e901e --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/.env.development @@ -0,0 +1,8 @@ + +VITE_APP_API_URL = 'http://127.0.0.1:1024' + +VITE_APP_PROJECT_TITLE = 'SmartAdmin 开发环境(Dev)' + +VITE_APP_PROFILE = 'dev' + +VITE_APP_MODE = 'development' \ No newline at end of file diff --git a/smart-admin-web/javascript-ant-design-vue3/.env.localhost b/smart-admin-web/javascript-ant-design-vue3/.env.localhost new file mode 100644 index 00000000..13132662 --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/.env.localhost @@ -0,0 +1,8 @@ + +VITE_APP_API_URL = 'http://127.0.0.1:1024' + +VITE_APP_PROJECT_TITLE = 'SmartAdmin 本地环境(Localhost)' + +VITE_APP_PROFILE = 'local' + +VITE_APP_MODE = 'local' \ No newline at end of file diff --git a/smart-admin-web/javascript-ant-design-vue3/.env.pre b/smart-admin-web/javascript-ant-design-vue3/.env.pre new file mode 100644 index 00000000..096644a0 --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/.env.pre @@ -0,0 +1,8 @@ + +VITE_APP_API_URL = 'http://preview.smartadmin.1024lab.net/smart-admin-api' + +VITE_APP_PROJECT_TITLE = 'SmartAdmin 预发布环境(Pre)' + +VITE_APP_PROFILE = 'pre' + +VITE_APP_MODE = 'production' \ No newline at end of file diff --git a/smart-admin-web/javascript-ant-design-vue3/.env.production b/smart-admin-web/javascript-ant-design-vue3/.env.production new file mode 100644 index 00000000..97ccc6d7 --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/.env.production @@ -0,0 +1,8 @@ + +VITE_APP_API_URL = 'http://preview.smartadmin.1024lab.net/smart-admin-api' + +VITE_APP_PROJECT_TITLE = 'SmartAdmin V2.X' + +VITE_APP_PROFILE = 'prod' + +VITE_APP_MODE = 'production' \ No newline at end of file diff --git a/smart-admin-web/javascript-ant-design-vue3/.env.test b/smart-admin-web/javascript-ant-design-vue3/.env.test new file mode 100644 index 00000000..40c7c11b --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/.env.test @@ -0,0 +1,8 @@ + +VITE_APP_API_URL = 'http://127.0.0.1:1024' + +VITE_APP_PROJECT_TITLE = 'SmartAdmin 测试环境(Test)' + +VITE_APP_PROFILE = 'test' + +VITE_APP_MODE = 'development' \ No newline at end of file diff --git a/smart-admin-web/javascript-ant-design-vue3/.eslintignore b/smart-admin-web/javascript-ant-design-vue3/.eslintignore new file mode 100644 index 00000000..78e1638b --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/.eslintignore @@ -0,0 +1,18 @@ + +*.sh +node_modules +lib +*.md +*.woff +*.ttf +.vscode +.idea +dist +public +/docs +.husky +.local +.localhost +/bin +Dockerfile +src/assets diff --git a/smart-admin-web/javascript-ant-design-vue3/.eslintrc.js b/smart-admin-web/javascript-ant-design-vue3/.eslintrc.js new file mode 100644 index 00000000..81e7acc0 --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/.eslintrc.js @@ -0,0 +1,66 @@ +/* + * @Description: + * @Author: zhuoda + * @Date: 2021-11-05 + * @LastEditTime: 2022-07-05 + * @LastEditors: zhuoda + */ +module.exports = { + root: true, //此项是用来告诉eslint找当前配置文件不能往父级查找 + env: { + browser: true, + es2021: true, + node: true, + }, + parser: 'vue-eslint-parser', //使用vue-eslint-parser 来解析vue文件中的 template和script + parserOptions: { + ecmaVersion: 12, // 默认情况下,ESLint使用的是ECMAScript5语法,此处我们设置的选项是 es12 + sourceType: 'module', // 指定js导入的方式 + }, + extends: ['plugin:vue/vue3-essential', 'eslint:recommended', 'plugin:vue/base'], + globals: { + defineProps: 'readonly', + defineEmits: 'readonly', + defineExpose: 'readonly', + withDefaults: 'readonly', + }, + plugins: ['vue'], + rules: { + 'no-unused-vars': [ + 'error', + // we are only using this rule to check for unused arguments since TS + // catches unused variables but not args. + { varsIgnorePattern: '.*', args: 'none' }, + ], + 'space-before-function-paren': 'off', + + 'vue/attributes-order': 'off', + 'vue/one-component-per-file': 'off', + 'vue/html-closing-bracket-newline': 'off', + 'vue/max-attributes-per-line': 'off', + 'vue/multiline-html-element-content-newline': 'off', + 'vue/singleline-html-element-content-newline': 'off', + 'vue/attribute-hyphenation': 'off', + 'vue/require-default-prop': 'off', + 'vue/multi-word-component-names': [ + 'error', + { + ignores: ['index'], //需要忽略的组件名 + }, + ], + 'vue/html-self-closing': [ + 'error', + { + html: { + void: 'always', + normal: 'never', + component: 'always', + }, + svg: 'always', + math: 'always', + }, + ], + // Enable vue/script-setup-uses-vars rule + 'vue/script-setup-uses-vars': 'error', + }, +}; diff --git a/smart-admin-web/javascript-ant-design-vue3/.gitignore b/smart-admin-web/javascript-ant-design-vue3/.gitignore new file mode 100644 index 00000000..f4f9f437 --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/.gitignore @@ -0,0 +1,6 @@ +node_modules +.DS_Store +dist +dist-ssr +*.local +.idea diff --git a/smart-admin-web/javascript-ant-design-vue3/.prettierrc.js b/smart-admin-web/javascript-ant-design-vue3/.prettierrc.js new file mode 100644 index 00000000..d1c4ba82 --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/.prettierrc.js @@ -0,0 +1,30 @@ +/* + * 代码格式化配置 + * + * @Author: 1024创新实验室-主任:卓大 + * @Date: 2022-09-12 14:44:18 + * @Wechat: zhuda1024 + * @Email: lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012 + */ +module.exports = { + printWidth: 150, // 每行代码长度(默认80) + tabWidth: 2, // 缩进空格数 + useTabs: false, //不用tab缩进 + semi: true, //// 在语句末尾打印分号 + singleQuote: true, // 使用单引号而不是双引号 + vueIndentScriptAndStyle: true, //Vue文件脚本和样式标签缩进 + quoteProps: 'as-needed', // 更改引用对象属性的时间 可选值"" + jsxSingleQuote: true, // 在JSX中使用单引号而不是双引号 + trailingComma: 'es5', //多行时尽可能打印尾随逗号。(例如,单行数组永远不会出现逗号结尾。) 可选值"",默认none + bracketSpacing: true, // 在对象文字中的括号之间打印空格 + jsxBracketSameLine: false, //jsx 标签的反尖括号需要换行 + arrowParens: 'always', // 在单独的箭头函数参数周围包括括号 always:(x) => x \ avoid:x => x + rangeStart: 0, // 这两个选项可用于格式化以给定字符偏移量(分别包括和不包括)开始和结束的代码 + rangeEnd: Infinity, + requirePragma: false, // 指定要使用的解析器,不需要写文件开头的 @prettier + insertPragma: false, // 不需要自动在文件开头插入 @prettier + proseWrap: 'preserve', // 使用默认的折行标准 always\never\preserve + htmlWhitespaceSensitivity: 'css', // 指定HTML文件的全局空格敏感度 css\strict\ignore + endOfLine: 'auto', // 因为prettier的规范和eslint的换行规则不同,所以这个必须配置。要不然每次打开文件都会有一堆的警告;换行符使用 lf 结尾是 可选值" + + + + + + + + SmartAdmin 2.X + + + +
+ + + diff --git a/smart-admin-web/javascript-ant-design-vue3/jsconfig.json b/smart-admin-web/javascript-ant-design-vue3/jsconfig.json new file mode 100644 index 00000000..c97f5795 --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/jsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "target": "ES6", + "jsx":"preserve", + "module": "commonjs", + "allowSyntheticDefaultImports": true, + "baseUrl": "./", + "paths": { + "/@/*": [ + "src/*" + ] + } + }, + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/smart-admin-web/javascript-ant-design-vue3/package.json b/smart-admin-web/javascript-ant-design-vue3/package.json new file mode 100644 index 00000000..f32227e9 --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/package.json @@ -0,0 +1,73 @@ +{ + "name":"SmartAdmin", + "version": "2.0.0", + "author": { + "name": "1024创新实验室(1024lab)", + "email": "lab1024@163.com", + "url": "https://www.1024lab.net" + }, + "license": "MIT", + "homepage": "https://smartadmin.1024lab.net", + "scripts": { + "localhost": "vite --mode localhost", + "dev": "vite", + "build:test": "vite build --mode test", + "build:pre": "vite build --mode pre", + "build:prod": "vite build --mode production" + }, + "dependencies": { + "@ant-design/icons-vue": "^6.1.0", + "@wangeditor/editor": "^5.0.1", + "@wangeditor/editor-for-vue": "^5.1.11", + "ant-design-vue": "3.2.5", + "axios": "~0.27.2", + "clipboard": "~2.0.11", + "crypto-js": "~4.1.1", + "decimal.js": "^10.3.1", + "diff": "^5.1.0", + "diff2html": "^3.4.18", + "echarts": "^5.1.2", + "highlight.js": "^11.6.0", + "js-cookie": "^2.2.1", + "lodash": "^4.17.21", + "lunar-javascript": "^1.2.32", + "mitt": "^3.0.0", + "nprogress": "^0.2.0", + "pinia": "~2.0.14", + "sortablejs": "^1.15.0", + "ua-parser-js": "^1.0.2", + "v-viewer": "~1.6.4", + "vue": "~3.2.26", + "vue-i18n": "^9.1.10", + "vue-router": "~4.0.15", + "vue3-json-viewer": "^2.2.2" + }, + "devDependencies": { + "@vitejs/plugin-vue": "~2.3.3", + "@vue/compiler-sfc": "~3.2.26", + "eslint": "^8.16.0", + "eslint-config-prettier": "~8.5.0", + "eslint-plugin-prettier": "~4.0.0", + "eslint-plugin-vue": "~9.1.0", + "less": "~4.1.1", + "less-loader": "~10.0.1", + "prettier": "~2.6.2", + "rimraf": "^3.0.2", + "stylelint": "~14.8.5", + "stylelint-config-prettier": "~9.0.3", + "stylelint-config-standard": "~25.0.0", + "stylelint-order": "~5.0.0", + "vite": "~2.9.9", + "vite-plugin-mock": "~2.9.6", + "vite-plugin-optimize-persist": "^0.1.2", + "vite-plugin-package-config": "^0.1.1", + "vue-eslint-parser": "~9.0.2" + }, + "engines": { + "node": ">=14" + }, + "repository": { + "type": "git", + "url": "https://github.com/1024-lab/smart-admin.git" + } +} diff --git a/smart-admin-web/.postcssrc.js b/smart-admin-web/javascript-ant-design-vue3/postcss.config.js similarity index 54% rename from smart-admin-web/.postcssrc.js rename to smart-admin-web/javascript-ant-design-vue3/postcss.config.js index 961986e2..2c7ab7cc 100644 --- a/smart-admin-web/.postcssrc.js +++ b/smart-admin-web/javascript-ant-design-vue3/postcss.config.js @@ -1,5 +1,4 @@ module.exports = { plugins: { - autoprefixer: {} - } -} + }, +}; diff --git a/smart-admin-h5/public/favicon.ico b/smart-admin-web/javascript-ant-design-vue3/public/favicon.ico similarity index 100% rename from smart-admin-h5/public/favicon.ico rename to smart-admin-web/javascript-ant-design-vue3/public/favicon.ico diff --git a/smart-admin-web/javascript-ant-design-vue3/src/App.vue b/smart-admin-web/javascript-ant-design-vue3/src/App.vue new file mode 100644 index 00000000..3da9a0af --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/src/App.vue @@ -0,0 +1,34 @@ + + + + + diff --git a/smart-admin-web/javascript-ant-design-vue3/src/api/business/category/category-api.js b/smart-admin-web/javascript-ant-design-vue3/src/api/business/category/category-api.js new file mode 100644 index 00000000..24a3b183 --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/src/api/business/category/category-api.js @@ -0,0 +1,34 @@ +/* + * 类目api + * + * @Author: 卓大 + * @Date: 2022-09-03 21:35:00 + * @Wechat: zhuda1024 + * @Email: lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012 + */ +import { getRequest, postRequest } from '/@/lib/axios'; + +export const categoryApi = { + // 添加类目 @author 卓大 + addCategory: (param) => { + return postRequest('/category/add', param); + }, + // GET + // 删除类目 @author 卓大 + deleteCategoryById: (categoryId) => { + return getRequest(`/category/delete/${categoryId}`); + }, + // 查询类目层级树 @author 卓大 + queryCategoryTree: (param) => { + return postRequest('/category/tree', param); + }, + // 更新类目 @author 卓大 + updateCategory: (param) => { + return postRequest('/category/update', param); + }, + // 查询类目详情 @author 卓大 + getCategory: (categoryId) => { + return getRequest(`/category/${categoryId}`); + }, +}; diff --git a/smart-admin-web/javascript-ant-design-vue3/src/api/business/goods/goods-api.js b/smart-admin-web/javascript-ant-design-vue3/src/api/business/goods/goods-api.js new file mode 100644 index 00000000..e3ad9598 --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/src/api/business/goods/goods-api.js @@ -0,0 +1,31 @@ +/* + * @Description: + * @Author: zhuoda + * @Date: 2021-11-05 + * @LastEditTime: 2022-06-23 + * @LastEditors: zhuoda + */ +import { postRequest, getRequest } from '/@/lib/axios'; + +export const goodsApi = { + // 添加商品 @author zhuoda + addGoods: (param) => { + return postRequest('/goods/add', param); + }, + // 删除 @author zhuoda + deleteGoods: (goodsId) => { + return getRequest(`/goods/delete/${goodsId}`); + }, + // 批量 @author zhuoda + batchDelete: (goodsIdList) => { + return postRequest('/goods/batchDelete', goodsIdList); + }, + // 分页查询 @author zhuoda + queryGoodsList: (param) => { + return postRequest('/goods/query', param); + }, + // 更新商品 @author zhuoda + updateGoods: (param) => { + return postRequest('/goods/update', param); + }, +}; diff --git a/smart-admin-web/javascript-ant-design-vue3/src/api/business/oa/bank-api.js b/smart-admin-web/javascript-ant-design-vue3/src/api/business/oa/bank-api.js new file mode 100644 index 00000000..7e9b6278 --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/src/api/business/oa/bank-api.js @@ -0,0 +1,42 @@ +/* + * 银行卡 + * + * @Author: 善逸 + * @Date: 2022-09-03 21:42:08 + * @Wechat: zhuda1024 + * @Email: lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012 + */ +import { postRequest, getRequest } from '/@/lib/axios'; + +export const bankApi = { + // 新建银行信息 @author 善逸 + create: (param) => { + return postRequest('/oa/bank/create', param); + }, + + // 删除银行信息 @author 善逸 + delete: (bankId) => { + return getRequest(`/oa/bank/delete/${bankId}`); + }, + + // 查询银行信息详情 @author 善逸 + detail: (bankId) => { + return getRequest(`/oa/bank/get/${bankId}`); + }, + + // 分页查询银行信息 @author 善逸 + pageQuery: (param) => { + return postRequest('/oa/bank/page/query', param); + }, + + // 编辑银行信息 @author 善逸 + update: (param) => { + return postRequest('/oa/bank/update', param); + }, + + // 根据企业ID查询不分页的银行列表 @author 善逸 + queryList: (enterpriseId) => { + return getRequest(`/oa/bank/query/list/${enterpriseId}`); + }, +}; diff --git a/smart-admin-web/javascript-ant-design-vue3/src/api/business/oa/enterprise-api.js b/smart-admin-web/javascript-ant-design-vue3/src/api/business/oa/enterprise-api.js new file mode 100644 index 00000000..68c48d6a --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/src/api/business/oa/enterprise-api.js @@ -0,0 +1,64 @@ +/* + * 企业信息 + * + * @Author: 开云 + * @Date: 2022-09-03 21:47:28 + * @Wechat: zhuda1024 + * @Email: lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012 + */ +import { postRequest, getRequest } from '/@/lib/axios'; + +export const enterpriseApi = { + // 新建企业 @author 开云 + create: (param) => { + return postRequest('/oa/enterprise/create', param); + }, + + // 删除企业 @author 开云 + delete: (enterpriseId) => { + return getRequest(`/oa/enterprise/delete/${enterpriseId}`); + }, + + // 查询企业详情 @author 开云 + detail: (enterpriseId) => { + return getRequest(`/oa/enterprise/get/${enterpriseId}`); + }, + + // 分页查询企业模块 @author 开云 + pageQuery: (param) => { + return postRequest('/oa/enterprise/page/query', param); + }, + + //企业列表查询 含数据范围 @author 开云 + queryList: (type) => { + let query = ''; + if (type) { + query = `?type=${type}`; + } + return getRequest(`/oa/enterprise/query/list${query}`); + }, + + // 编辑企业 @author 开云 + update: (param) => { + return postRequest('/oa/enterprise/update', param); + }, + // 企业全部员工List @author yandy + employeeList: (param) => { + return postRequest('/oa/enterprise/employee/list', param); + }, + // 分页查询企业员工List @author 卓大 + queryPageEmployeeList: (param) => { + return postRequest('/oa/enterprise/employee/queryPage', param); + }, + // 添加员工 @author yandy + addEmployee: (param) => { + return postRequest('/oa/enterprise/employee/add', param); + }, + + // 删除员工 @author yandy + deleteEmployee: (param) => { + return postRequest('/oa/enterprise/employee/delete', param); + }, + +}; diff --git a/smart-admin-web/javascript-ant-design-vue3/src/api/business/oa/invoice-api.js b/smart-admin-web/javascript-ant-design-vue3/src/api/business/oa/invoice-api.js new file mode 100644 index 00000000..d347af23 --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/src/api/business/oa/invoice-api.js @@ -0,0 +1,44 @@ +/* + * OA发票信息 + * + * @Author: 善逸 + * @Date: 2022-09-03 21:48:54 + * @Wechat: zhuda1024 + * @Email: lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012 + */ +import { postRequest, getRequest } from '/@/lib/axios'; + +export const invoiceApi = { + + // 新建发票信息 @author 善逸 + create: (param) => { + return postRequest('/oa/invoice/create', param); + }, + + // 删除发票信息 @author 善逸 + delete: (bankId) => { + return getRequest(`/oa/invoice/delete/${bankId}`); + }, + + // 查询发票信息详情 @author 善逸 + detail: (bankId) => { + return getRequest(`//oa/invoice/get/${bankId}`); + }, + + // 分页查询发票信息 @author 善逸 + pageQuery: (param) => { + return postRequest('/oa/invoice/page/query', param); + }, + + // 编辑发票信息 @author 善逸 + update: (param) => { + return postRequest('/oa/invoice/update', param); + }, + + // 查询发票列表 @author 善逸 + queryList: (enterpriseId) => { + return getRequest(`/oa/invoice/query/list/${enterpriseId}`); + }, + +}; diff --git a/smart-admin-web/javascript-ant-design-vue3/src/api/business/oa/notice-api.js b/smart-admin-web/javascript-ant-design-vue3/src/api/business/oa/notice-api.js new file mode 100644 index 00000000..056eb2de --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/src/api/business/oa/notice-api.js @@ -0,0 +1,74 @@ +/* + * @Description: 公告信息、企业动态 + * @version: + * @Author: zhuoda + * @Date: 2022-08-16 20:34:36 + */ +import { postRequest, getRequest } from '/@/lib/axios'; + +export const noticeApi = { + // ---------------- 通知公告类型 ----------------------- + + // 通知公告类型-获取全部 @author zhuoda + getAllNoticeTypeList() { + return getRequest('/oa/noticeType/getAll'); + }, + + // 通知公告类型-添加 @author zhuoda + addNoticeType(name) { + return getRequest(`/oa/noticeType/add/${name}`); + }, + + // 通知公告类型-修改 @author zhuoda + updateNoticeType(noticeTypeId, name) { + return getRequest(`/oa/noticeType/update/${noticeTypeId}/${name}`); + }, + // 通知公告类型-删除 @author zhuoda + deleteNoticeType(noticeTypeId) { + return getRequest(`/oa/noticeType/delete/${noticeTypeId}`); + }, + + // ---------------- 通知公告管理 ----------------------- + + // 通知公告-分页查询 @author zhuoda + queryNotice(param) { + return postRequest('/oa/notice/query', param); + }, + + // 通知公告-添加 @author zhuoda + addNotice(param) { + return postRequest('/oa/notice/add', param); + }, + + // 通知公告-更新 @author zhuoda + updateNotice(param) { + return postRequest('/oa/notice/update', param); + }, + + // 通知公告-删除 @author zhuoda + deleteNotice(noticeId) { + return getRequest(`/oa/notice/delete/${noticeId}`); + }, + + // 通知公告-更新详情 @author zhuoda + getUpdateNoticeInfo(noticeId) { + return getRequest(`/oa/notice/getUpdateVO/${noticeId}`); + }, + + // --------------------- 【员工】查看 通知公告 ------------------------- + + // 通知公告-员工-查看详情 @author zhuoda + view(noticeId) { + return getRequest(`/oa/notice/employee/view/${noticeId}`); + }, + + // 通知公告-员工-查询 @author zhuoda + queryEmployeeNotice(param) { + return postRequest('/oa/notice/employee/query', param); + }, + + // 【员工】通知公告-查询 查看记录 @author zhuoda + queryViewRecord(param) { + return postRequest('/oa/notice/employee/queryViewRecord', param); + }, +}; diff --git a/smart-admin-web/javascript-ant-design-vue3/src/api/support/cache/cache-api.js b/smart-admin-web/javascript-ant-design-vue3/src/api/support/cache/cache-api.js new file mode 100644 index 00000000..dbe61c7a --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/src/api/support/cache/cache-api.js @@ -0,0 +1,25 @@ +/* + * 缓存 + * + * @Author: 罗伊 + * @Date: 2022-09-03 21:51:34 + * @Wechat: zhuda1024 + * @Email: lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012 + */ +import { postRequest, getRequest } from '/@/lib/axios'; + +export const cacheApi = { + // 获取某个缓存的所有key @author 罗伊 + getKeys: (cacheName) => { + return getRequest(`/support/cache/keys/${cacheName}`); + }, + // 移除某个缓存 @author 罗伊 + remove: (cacheName) => { + return getRequest(`/support/cache/remove/${cacheName}`); + }, + // 获取所有缓存 @author 罗伊 + getAllCacheNames: () => { + return getRequest('/support/cache/names'); + }, +}; diff --git a/smart-admin-web/javascript-ant-design-vue3/src/api/support/change-log/change-log-api.js b/smart-admin-web/javascript-ant-design-vue3/src/api/support/change-log/change-log-api.js new file mode 100644 index 00000000..b81b1e0a --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/src/api/support/change-log/change-log-api.js @@ -0,0 +1,45 @@ +/** + * 系统更新日志 api 封装 + * + * @Author: 卓大 + * @Date: 2022-09-26 14:53:50 + * @Copyright 1024创新实验室 + */ +import { postRequest, getRequest } from '/@/lib/axios'; + +export const changeLogApi = { + /** + * 分页查询 @author 卓大 + */ + queryPage : (param) => { + return postRequest('/changeLog/queryPage', param); + }, + + /** + * 增加 @author 卓大 + */ + add: (param) => { + return postRequest('/changeLog/add', param); + }, + + /** + * 修改 @author 卓大 + */ + update: (param) => { + return postRequest('/changeLog/update', param); + }, + + /** + * 删除 @author 卓大 + */ + delete: (id) => { + return getRequest(`/changeLog/delete/${id}`); + }, + + /** + * 批量删除 @author 卓大 + */ + batchDelete: (idList) => { + return postRequest('/changeLog/batchDelete', idList); + }, +}; diff --git a/smart-admin-web/javascript-ant-design-vue3/src/api/support/code-generator/code-generator-api.js b/smart-admin-web/javascript-ant-design-vue3/src/api/support/code-generator/code-generator-api.js new file mode 100644 index 00000000..8407eab4 --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/src/api/support/code-generator/code-generator-api.js @@ -0,0 +1,46 @@ +/* + * 代码生成器 + * + * @Author: 卓大 + * @Date: 2022-09-03 21:51:54 + * @Wechat: zhuda1024 + * @Email: lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012 + */ +import { getRequest, postRequest,download } from '/@/lib/axios'; + +export const codeGeneratorApi = { + // 查询数据库的表 @author 卓大 + queryTableList: (param) => { + return postRequest('/support/codeGenerator/table/queryTableList', param); + }, + + // 查询表的列 @author 卓大 + getTableColumns: (table) => { + return getRequest(`/support/codeGenerator/table/getTableColumns/${table}`); + }, + + // ------------------- 配置 ------------------- + + // 获取表的配置信息 @author 卓大 + getConfig: (table) => { + return getRequest(`/support/codeGenerator/table/getConfig/${table}`); + }, + + // 更新配置信息 @author 卓大 + updateConfig: (param) => { + return postRequest('/support/codeGenerator/table/updateConfig', param); + }, + + // ------------------- 生成 ------------------- + + // 预览代码 @author 卓大 + preview: (param) => { + return postRequest('/support/codeGenerator/code/preview', param); + }, + + // 下载代码 @author 卓大 + downloadCode: (tableName) => { + return download(`${tableName}.zip`,`/support/codeGenerator/code/download/${tableName}`); + }, +}; diff --git a/smart-admin-web/javascript-ant-design-vue3/src/api/support/config/config-api.js b/smart-admin-web/javascript-ant-design-vue3/src/api/support/config/config-api.js new file mode 100644 index 00000000..c5e5397f --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/src/api/support/config/config-api.js @@ -0,0 +1,29 @@ +/* + * 配置 + * + * @Author: 卓大 + * @Date: 2022-09-03 21:51:54 + * @Wechat: zhuda1024 + * @Email: lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012 + */ +import { postRequest, getRequest } from '/@/lib/axios'; + +export const configApi = { + // 分页查询 @author 卓大 + queryList: (param) => { + return postRequest('/support/config/query', param); + }, + // 添加配置参数 @author 卓大 + addConfig: (param) => { + return postRequest('/support/config/add', param); + }, + // 修改配置参数 @author 卓大 + updateConfig: (param) => { + return postRequest('/support/config/update', param); + }, + // 查询配置详情 @author 卓大 + queryByKey: (param) => { + return getRequest(`/support/config/queryByKey?configKey=${param}`); + }, +}; diff --git a/smart-admin-web/javascript-ant-design-vue3/src/api/support/data-tracer/data-tracer-api.js b/smart-admin-web/javascript-ant-design-vue3/src/api/support/data-tracer/data-tracer-api.js new file mode 100644 index 00000000..afa75f88 --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/src/api/support/data-tracer/data-tracer-api.js @@ -0,0 +1,18 @@ +/* + * 数据变动 + * + * @Author: 卓大 + * @Date: 2022-09-03 21:51:54 + * @Wechat: zhuda1024 + * @Email: lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012 + */ +import { postRequest } from '/@/lib/axios'; + +export const dataTracerApi = { + // 分页查询业务操作日志 - @author 卓大 + queryList: (param) => { + return postRequest('/support/dataTracer/query', param); + }, + +}; diff --git a/smart-admin-web/javascript-ant-design-vue3/src/api/support/dict/dict-api.js b/smart-admin-web/javascript-ant-design-vue3/src/api/support/dict/dict-api.js new file mode 100644 index 00000000..701d3612 --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/src/api/support/dict/dict-api.js @@ -0,0 +1,59 @@ +/* + * 字典 + * + * @Author: 1024创新实验室-主任:卓大 + * @Date: 2022-09-03 21:55:25 + * @Wechat: zhuda1024 + * @Email: lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012 + */ +import { postRequest, getRequest } from '/@/lib/axios'; + +export const dictApi = { + // 分页查询数据字典KEY - @author 卓大 + keyQuery: (param) => { + return postRequest('/support/dict/key/query', param); + }, + // 查询全部字典key - @author 卓大 + queryAllKey: () => { + return getRequest('/support/dict/key/queryAll'); + }, + /** + * 分页查询数据字典value - @author 卓大 + */ + valueQuery: (param) => { + return postRequest('/support/dict/value/query', param); + }, + // 数据字典KEY-添加- @author 卓大 + keyAdd: (param) => { + return postRequest('/support/dict/key/add', param); + }, + // 分页查询数据字典value - @author 卓大 + valueAdd: (param) => { + return postRequest('/support/dict/value/add', param); + }, + // 数据字典key-更新- @author 卓大 + keyEdit: (param) => { + return postRequest('/support/dict/key/edit', param); + }, + // 数据字典Value-更新- @author 卓大 + valueEdit: (param) => { + return postRequest('/support/dict/value/edit', param); + }, + // 数据字典key-删除- @author 卓大 + keyDelete: (keyIdList) => { + return postRequest('/support/dict/key/delete', keyIdList); + }, + // 数据字典Value-删除- @author 卓大 + valueDelete: (valueIdList) => { + return postRequest('/support/dict/value/delete', valueIdList); + }, + // 缓存刷新- @author 卓大 + cacheRefresh: () => { + return getRequest('/support/dict/cache/refresh'); + }, + // 数据字典-值列表- @author 卓大 + valueList: (keyCode) => { + return getRequest(`/support/dict/value/list/${keyCode}`); + }, +}; diff --git a/smart-admin-web/javascript-ant-design-vue3/src/api/support/feedback/feedback-api.js b/smart-admin-web/javascript-ant-design-vue3/src/api/support/feedback/feedback-api.js new file mode 100644 index 00000000..c951b8a9 --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/src/api/support/feedback/feedback-api.js @@ -0,0 +1,21 @@ +/* + * 意见反馈 + * + * @Author: 1024创新实验室:开云 + * @Date: 2022-09-03 21:56:31 + * @Wechat: zhuda1024 + * @Email: lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012 + */ +import { postRequest } from '/@/lib/axios'; + +export const feedbackApi = { + // 意见反馈-新增 + addFeedback: (params) => { + return postRequest('/support/feedback/add', params); + }, + // 意见反馈-分页查询 + queryFeedback: (params) => { + return postRequest('/support/feedback/query', params); + }, +}; diff --git a/smart-admin-web/javascript-ant-design-vue3/src/api/support/file/file-api.js b/smart-admin-web/javascript-ant-design-vue3/src/api/support/file/file-api.js new file mode 100644 index 00000000..d08a6c6e --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/src/api/support/file/file-api.js @@ -0,0 +1,38 @@ +/* + * 文件上传 + * + * @Author: 1024创新实验室-主任:卓大 + * @Date: 2022-09-03 21:55:25 + * @Wechat: zhuda1024 + * @Email: lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012 + */ +import { postRequest, getRequest, download } from '/@/lib/axios'; + +export const fileApi = { + // 文件上传 @author 卓大 + uploadUrl: '/support/file/upload', + uploadFile: (param, folder) => { + return postRequest(`/support/file/upload?folder=${folder}`, param); + }, + + /** + * 分页查询 @author 卓大 + */ + queryPage: (param) => { + return postRequest('/support/file/queryPage', param); + }, + /** + * 获取文件URL:根据fileKey @author 胡克 + */ + getUrl: (fileKey) => { + return getRequest(`/support/file/getFileUrl?fileKey=${fileKey}`); + }, + + /** + * 下载文件流(根据fileKey) @author 胡克 + */ + downLoadFile: (fileName, fileKey) => { + return download(fileName, '/support/file/downLoad', { fileKey }); + }, +}; diff --git a/smart-admin-web/javascript-ant-design-vue3/src/api/support/heart-beat/heart-beat-api.js b/smart-admin-web/javascript-ant-design-vue3/src/api/support/heart-beat/heart-beat-api.js new file mode 100644 index 00000000..0a1eab40 --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/src/api/support/heart-beat/heart-beat-api.js @@ -0,0 +1,17 @@ +/* + * 心跳 + * + * @Author: 1024创新实验室-主任:卓大 + * @Date: 2022-09-03 21:55:47 + * @Wechat: zhuda1024 + * @Email: lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012 + */ +import { postRequest } from '/@/lib/axios'; + +export const heartBeatApi = { + // 分页查询 @author 卓大 + queryList: (param) => { + return postRequest('/support/heartBeat/query', param); + }, +}; diff --git a/smart-admin-web/javascript-ant-design-vue3/src/api/support/help-doc/help-doc-api.js b/smart-admin-web/javascript-ant-design-vue3/src/api/support/help-doc/help-doc-api.js new file mode 100644 index 00000000..dc4fac41 --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/src/api/support/help-doc/help-doc-api.js @@ -0,0 +1,59 @@ +/* + * 帮助文档 + * + * @Author: 1024创新实验室-主任:卓大 + * @Date: 2022-09-03 21:56:31 + * @Wechat: zhuda1024 + * @Email: lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012 + */ +import { postRequest, getRequest } from '/@/lib/axios'; + +export const helpDocApi = { + // 【管理】帮助文档-分页查询 @author zhuoda + query: (param) => { + return postRequest('/support/helpDoc/query', param); + }, + + //【管理】帮助文档-更新 @author zhuoda + update: (param) => { + return postRequest('/support/helpDoc/update', param); + }, + + // 【管理】帮助文档-添加 @author zhuoda + add: (param) => { + return postRequest('/support/helpDoc/add', param); + }, + + //【管理】帮助文档-删除 @author zhuoda + delete: (helpDocId) => { + return getRequest(`/support/helpDoc/delete/${helpDocId}`); + }, + + //【管理】帮助文档-获取详情 @author zhuoda + getDetail: (helpDocId) => { + return getRequest(`/support/helpDoc/getDetail/${helpDocId}`); + }, + + //【管理】帮助文档-根据关联id查询 @author zhuoda + queryHelpDocByRelationId: (relationId) => { + return getRequest(`/support/helpDoc/queryHelpDocByRelationId/${relationId}`); + }, + + //----------------------- 用户相关 -------------------------------- + + //【用户】帮助文档-查询全部 @author zhuoda + getAllHelpDocList() { + return getRequest('/support/helpDoc/user/queryAllHelpDocList'); + }, + + //【用户】帮助文档-查询全部 @author zhuoda + view(helpDocId) { + return getRequest(`/support/helpDoc/user/view/${helpDocId}`); + }, + + //【用户】帮助文档-查询 查看记录 @author zhuoda + queryViewRecord(param) { + return postRequest('/support/helpDoc/user/queryViewRecord', param); + }, +}; diff --git a/smart-admin-web/javascript-ant-design-vue3/src/api/support/help-doc/help-doc-catalog-api.js b/smart-admin-web/javascript-ant-design-vue3/src/api/support/help-doc/help-doc-catalog-api.js new file mode 100644 index 00000000..a8fd6c65 --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/src/api/support/help-doc/help-doc-catalog-api.js @@ -0,0 +1,32 @@ +/* + * 帮助文档 目录 + * + * @Author: 1024创新实验室-主任:卓大 + * @Date: 2022-09-03 21:56:31 + * @Wechat: zhuda1024 + * @Email: lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012 + */ +import { postRequest, getRequest } from '/@/lib/axios'; + +export const helpDocCatalogApi = { + //帮助文档目录-获取全部 @author zhuoda + getAll: () => { + return getRequest('/support/helpDoc/helpDocCatalog/getAll'); + }, + + //帮助文档目录-添加 @author zhuoda + add: (param) => { + return postRequest('/support/helpDoc/helpDocCatalog/add', param); + }, + + //帮助文档目录-更新 @author zhuoda + update: (param) => { + return postRequest('/support/helpDoc/helpDocCatalog/update', param); + }, + + //帮助文档目录-删除 @author zhuoda + delete: (helpDocCatalogId) => { + return getRequest(`/support/helpDoc/helpDocCatalog/delete/${helpDocCatalogId}`); + }, +}; diff --git a/smart-admin-web/javascript-ant-design-vue3/src/api/support/login-log/login-log-api.js b/smart-admin-web/javascript-ant-design-vue3/src/api/support/login-log/login-log-api.js new file mode 100644 index 00000000..3c48fe78 --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/src/api/support/login-log/login-log-api.js @@ -0,0 +1,17 @@ +/* + * 登录日志 + * + * @Author: 1024创新实验室-主任:卓大 + * @Date: 2022-09-03 21:56:31 + * @Wechat: zhuda1024 + * @Email: lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012 + */ +import { postRequest, getRequest } from '/@/lib/axios'; + +export const loginLogApi = { + // 分页查询 @author 卓大 + queryList: (param) => { + return postRequest('/support/loginLog/page/query', param); + }, +}; diff --git a/smart-admin-web/javascript-ant-design-vue3/src/api/support/operate-log/operate-log-api.js b/smart-admin-web/javascript-ant-design-vue3/src/api/support/operate-log/operate-log-api.js new file mode 100644 index 00000000..b2f421d7 --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/src/api/support/operate-log/operate-log-api.js @@ -0,0 +1,21 @@ +/* + * 操作日志 + * + * @Author: 1024创新实验室-主任:卓大 + * @Date: 2022-09-03 21:56:45 + * @Wechat: zhuda1024 + * @Email: lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012 + */ +import { postRequest, getRequest } from '/@/lib/axios'; + +export const operateLogApi = { + // 分页查询 @author 卓大 + queryList: (param) => { + return postRequest('/support/operateLog/page/query', param); + }, + // 详情 @author 卓大 + detail: (id) => { + return getRequest(`/support/operateLog/detail/${id}`); + }, +}; diff --git a/smart-admin-web/javascript-ant-design-vue3/src/api/support/reload/reload-api.js b/smart-admin-web/javascript-ant-design-vue3/src/api/support/reload/reload-api.js new file mode 100644 index 00000000..721d563a --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/src/api/support/reload/reload-api.js @@ -0,0 +1,25 @@ +/* + * reload (内存热加载、钩子等) + * + * @Author: 1024创新实验室-主任:卓大 + * @Date: 2022-09-03 21:57:19 + * @Wechat: zhuda1024 + * @Email: lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012 + */ +import { postRequest, getRequest } from '/@/lib/axios'; + +export const reloadApi = { + // 查询reload列表 @author 卓大 + queryList: () => { + return getRequest('/support/reload/query'); + }, + // 获取reload result @author 卓大 + queryReloadResult: (tag) => { + return getRequest(`/support/reload/result/${tag}`); + }, + // 执行reload @author 卓大 + reload: (reloadForm) => { + return postRequest('/support/reload/update', reloadForm); + }, +}; diff --git a/smart-admin-web/javascript-ant-design-vue3/src/api/support/serial-number/serial-number-api.js b/smart-admin-web/javascript-ant-design-vue3/src/api/support/serial-number/serial-number-api.js new file mode 100644 index 00000000..b9ae35ae --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/src/api/support/serial-number/serial-number-api.js @@ -0,0 +1,25 @@ +/* + * 单据序列号 + * + * @Author: 1024创新实验室-主任:卓大 + * @Date: 2022-09-03 21:57:52 + * @Wechat: zhuda1024 + * @Email: lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012 + */ +import { postRequest, getRequest } from '/@/lib/axios'; + +export const serialNumberApi = { + // 生成单号 @author 卓大 + generate: (generateForm) => { + return postRequest('/support/serialNumber/generate', generateForm); + }, + // 获取所有单号定义 @author 卓大 + getAll: () => { + return getRequest('/support/serialNumber/all'); + }, + // 获取生成记录 @author 卓大 + queryRecord: (form) => { + return postRequest('/support/serialNumber/queryRecord', form); + }, +}; diff --git a/smart-admin-web/javascript-ant-design-vue3/src/api/support/table/table-column-api.js b/smart-admin-web/javascript-ant-design-vue3/src/api/support/table/table-column-api.js new file mode 100644 index 00000000..7223ab9f --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/src/api/support/table/table-column-api.js @@ -0,0 +1,26 @@ +/* + * @Description:表格自定义列 + * @version: + * @Author: zhuoda + * @Date: 2022-08-17 23:32:36 + * @LastEditors: zhuoda + * @LastEditTime: 2022-08-21 + */ +import { postRequest, getRequest } from '/@/lib/axios'; + +export const tableColumnApi = { + // 修改表格列 @author zhuoda + updateTableColumn: (param) => { + return postRequest('/support/tableColumn/update', param); + }, + + // 查询表格列 @author zhuoda + getColumns: (tableId) => { + return getRequest(`/support/tableColumn/getColumns/${tableId}`); + }, + + // 删除表格列 @author zhuoda + deleteColumns: (tableId) => { + return getRequest(`/support/tableColumn/delete/${tableId}`); + }, +}; diff --git a/smart-admin-web/javascript-ant-design-vue3/src/api/system/department/department-api.js b/smart-admin-web/javascript-ant-design-vue3/src/api/system/department/department-api.js new file mode 100644 index 00000000..230a4535 --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/src/api/system/department/department-api.js @@ -0,0 +1,55 @@ +/* + * 部门 + * + * @Author: 1024创新实验室-主任:卓大 + * @Date: 2022-09-03 21:58:50 + * @Wechat: zhuda1024 + * @Email: lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012 + */ +import { getRequest, postRequest } from '/@/lib/axios'; + +export const departmentApi = { + /** + * @description: 查询部门列表 @author 卓大 + * @param {*} + * @return {*} + */ + queryAllDepartment: () => { + return getRequest('/department/listAll'); + }, + + /** + * @description: 查询部门树形列表 @author 卓大 + * @param {*} + * @return {*} + */ + queryDepartmentTree: () => { + return getRequest('/department/treeList'); + }, + + /** + * @description: 添加部门 @author 卓大 + * @param {*} + * @return {*} + */ + addDepartment: (param) => { + return postRequest('/department/add', param); + }, + /** + * @description: 更新部门信息 @author 卓大 + * @param {*} + * @return {*} + */ + updateDepartment: (param) => { + return postRequest('/department/update', param); + }, + /** + * @description: 获取校区列表 @author 卓大 + * @param {*} + * @return {*} + */ + deleteDepartment: (departmentId) => { + return getRequest(`/department/delete/${departmentId}`); + }, +}; diff --git a/smart-admin-web/javascript-ant-design-vue3/src/api/system/employee/employee-api.js b/smart-admin-web/javascript-ant-design-vue3/src/api/system/employee/employee-api.js new file mode 100644 index 00000000..cddb95d1 --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/src/api/system/employee/employee-api.js @@ -0,0 +1,98 @@ +/* + * 员工 + * + * @Author: 1024创新实验室-主任:卓大 + * @Date: 2022-09-03 21:59:15 + * @Wechat: zhuda1024 + * @Email: lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012 + */ + +import { getRequest, postRequest } from '/@/lib/axios'; + +export const employeeApi = { + /** + * @description: 查询所有员工 @author 卓大 + * @param {*} + * @return {*} + */ + queryAll: () => { + return getRequest('/employee/queryAll'); + }, + /** + * @description: 员工管理查询 + * @param {*} + * @return {*} + */ + queryEmployee: (params) => { + return postRequest('/employee/query', params); + }, + /** + * @description: 添加员工 + * @param {EmployeeAddDto} params + * @return {*} + */ + addEmployee: (params) => { + return postRequest('/employee/add', params); + }, + /** + * @description: 更新员工信息 + * @param {EmployeeUpdateDto} params + * @return {*} + */ + updateEmployee: (params) => { + return postRequest('/employee/update', params); + }, + /** + * @description: 删除员工 + * @param {number} employeeId + * @return {*} + */ + deleteEmployee: (employeeId) => { + return getRequest(`/employee/delete/${employeeId}`); + }, + /** + * @description: 批量删除员工 + * @param {number} employeeIdList + * @return {*} + */ + batchDeleteEmployee: (employeeIdList) => { + return postRequest('/employee/update/batch/delete', employeeIdList); + }, + /** + * @description: 批量调整员工部门 + * @return {*} + */ + batchUpdateDepartmentEmployee: (updateParam) => { + return postRequest('/employee/update/batch/department', updateParam); + }, + /** + * @description: 重置员工密码 + * @param {number} employeeId + * @return {*} + */ + resetPassword: (employeeId) => { + return getRequest(`/employee/update/password/reset/${employeeId}`); + }, + /** + * @description: 修改面面 + * @param {number} employeeId + * @return {*} + */ + updateEmployeePassword: (param) => { + return postRequest('/employee/update/password',param); + }, + /** + * @description: 更新员工禁用状态 + * @param {number} employeeId + * @return {*} + */ + updateDisabled: (employeeId) => { + return getRequest(`/employee/update/disabled/${employeeId}`); + }, + + // 查询员工-根据部门id + queryEmployeeByDeptId: (departmentId) => { + return getRequest(`/employee/query/dept/${departmentId}`); + }, +}; diff --git a/smart-admin-web/javascript-ant-design-vue3/src/api/system/home/home-api.js b/smart-admin-web/javascript-ant-design-vue3/src/api/system/home/home-api.js new file mode 100644 index 00000000..6452fcba --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/src/api/system/home/home-api.js @@ -0,0 +1,29 @@ +/* + * 首页api + * + * @Author: 1024创新实验室-主任:卓大 + * @Date: 2022-09-03 21:59:39 + * @Wechat: zhuda1024 + * @Email: lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012 + */ +import { getRequest } from '/@/lib/axios'; + +export const homeApi = { + /** + * @description: 首页-金额统计(业绩、收款、订单数等) @author 卓大 + * @param {*} + * @return {*} + */ + homeAmountStatistics: () => { + return getRequest('/home/amount/statistics'); + }, + /** + * @description: 首页-待办信息 @author 卓大 + * @param {*} + * @return {*} + */ + homeWaitHandle: () => { + return getRequest('home/wait/handle'); + }, +}; diff --git a/smart-admin-web/javascript-ant-design-vue3/src/api/system/login/login-api.js b/smart-admin-web/javascript-ant-design-vue3/src/api/system/login/login-api.js new file mode 100644 index 00000000..e93e0d5d --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/src/api/system/login/login-api.js @@ -0,0 +1,51 @@ +/* + * 登录 + * + * @Author: 1024创新实验室-主任:卓大 + * @Date: 2022-09-03 21:59:58 + * @Wechat: zhuda1024 + * @Email: lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012 + */ +import { getRequest, postRequest } from '/@/lib/axios'; + +export const loginApi = { + /** + * 登录 @author 卓大 + * @param param + */ + login: (param) => { + return postRequest('/login', param); + }, + + /** + * 退出登录 @author 卓大 + * @param param + */ + logout: () => { + return getRequest('/login/logout'); + }, + + /** + * 获取验证码 @author 卓大 + * @param param + */ + getCaptcha: () => { + return getRequest('/login/getCaptcha'); + }, + + /** + * 获取登录信息 @author 卓大 + * @param param + */ + getLoginInfo: () => { + return getRequest('/login/getLoginInfo'); + }, + + /** + * 刷新用户信息(包含用户基础信息、权限信息等等) @author 卓大 + */ + refresh: () => { + return getRequest('/login/refresh'); + }, +}; diff --git a/smart-admin-web/javascript-ant-design-vue3/src/api/system/menu/menu-api.js b/smart-admin-web/javascript-ant-design-vue3/src/api/system/menu/menu-api.js new file mode 100644 index 00000000..43c8872f --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/src/api/system/menu/menu-api.js @@ -0,0 +1,54 @@ +/* + * 菜单 + * + * @Author: 1024创新实验室-主任:卓大 + * @Date: 2022-09-03 22:00:32 + * @Wechat: zhuda1024 + * @Email: lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012 + */ +import { getRequest, postRequest } from '/@/lib/axios'; + +export const menuApi = { + /** + * 添加菜单 + */ + addMenu: (param) => { + return postRequest('/menu/add', param); + }, + + /** + * 更新菜单 + */ + updateMenu: (param) => { + return postRequest('/menu/update', param); + }, + + /** + * 批量删除菜单 + */ + batchDeleteMenu: (menuIdList) => { + return getRequest(`/menu/batchDelete?menuIdList=${menuIdList}`); + }, + + /** + * 查询所有菜单列表 + */ + queryMenu: () => { + return getRequest('/menu/query'); + }, + + /** + * 查询菜单树 + */ + queryMenuTree: (onlyMenu) => { + return getRequest(`/menu/tree?onlyMenu=${onlyMenu}`); + }, + + /** + * 获取所有请求路径 + */ + getAuthUrl: () => { + return getRequest('/menu/auth/url'); + }, +}; diff --git a/smart-admin-web/javascript-ant-design-vue3/src/api/system/role-menu/role-menu-api.js b/smart-admin-web/javascript-ant-design-vue3/src/api/system/role-menu/role-menu-api.js new file mode 100644 index 00000000..9d0cc219 --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/src/api/system/role-menu/role-menu-api.js @@ -0,0 +1,28 @@ +/* + * 角色菜单 + * + * @Author: 1024创新实验室-主任:卓大 + * @Date: 2022-09-03 22:00:49 + * @Wechat: zhuda1024 + * @Email: lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012 + */ +import { getRequest, postRequest } from '/@/lib/axios'; +export const roleMenuApi = { + /** + * @description: 获取角色关联菜单权限 + * @param {*} + * @return {*} + */ + getRoleSelectedMenu: (roleId) => { + return getRequest(`role/menu/getRoleSelectedMenu/${roleId}`); + }, + /** + * @description: 更新角色权限 + * @param {*} + * @return {*} + */ + updateRoleMenu: (data) => { + return postRequest('role/menu/updateRoleMenu', data); + }, +}; diff --git a/smart-admin-web/javascript-ant-design-vue3/src/api/system/role/role-api.js b/smart-admin-web/javascript-ant-design-vue3/src/api/system/role/role-api.js new file mode 100644 index 00000000..f836deee --- /dev/null +++ b/smart-admin-web/javascript-ant-design-vue3/src/api/system/role/role-api.js @@ -0,0 +1,110 @@ +/* + * 角色 + * + * @Author: 1024创新实验室-主任:卓大 + * @Date: 2022-09-03 22:00:41 + * @Wechat: zhuda1024 + * @Email: lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012 + */ +import { getRequest, postRequest } from '/@/lib/axios'; + +export const roleApi = { + /** + * @description: 获取所有角色 + * @param {*} + * @return {*} + */ + queryAll: () => { + return getRequest('/role/getAll'); + }, + /** + * @description:添加角色 + * @param {*} + * @return {*} + */ + addRole: (data) => { + return postRequest('/role/add', data); + }, + /** + * @description:更新角色 + * @param {*} + * @return {*} + */ + updateRole: (data) => { + return postRequest('/role/update', data); + }, + /** + * @description: 删除角色 + * @param {number} roleId + * @return {*} + */ + deleteRole: (roleId) => { + return getRequest(`/role/delete/${roleId}`); + }, + /** + * @description: 批量设置某角色数据范围 + * @param {DataScopeBatchSetRoleDto} data + * @return {*} + */ + updateDataScope: (data) => { + return postRequest('/role/dataScope/updateRoleDataScopeList', data); + }, + /** + * @description: 获取当前系统所配置的所有数据范围 + * @param {*} + * @return {*} + */ + getDataScopeList: () => { + return getRequest('/dataScope/list'); + }, + /** + * @description: 获取某角色所设置的数据范围 + * @param {number} roleId + * @return {*} + */ + getDataScopeByRoleId: (roleId) => { + return getRequest(`/role/dataScope/getRoleDataScopeList/${roleId}`); + }, + /** + * @description: 获取角色成员-员工列表 + * @param {*} + * @return {*} + */ + queryRoleEmployee: (params) => { + return postRequest('/role/employee/queryEmployee', params); + }, + /** + * @description: 从角色成员列表中移除员工 + * @param {number} employeeId + * @param {number} roleId + * @return {*} + */ + deleteEmployeeRole: (employeeId, roleId) => { + return getRequest('/role/employee/removeEmployee?employeeId=' + employeeId + '&roleId=' + roleId); + }, + /** + * @description: 从角色成员列表中批量移除员工 + * @param {RoleEmployeeBatchDto} data + * @return {*} + */ + batchRemoveRoleEmployee: (data) => { + return postRequest('/role/employee/batchRemoveRoleEmployee', data); + }, + /** + * @description: 根据角色id获取角色员工列表(无分页) + * @param {*} + * @return {*} + */ + getRoleAllEmployee: (roleId) => { + return getRequest(`/role/employee/getAllEmployeeByRoleId/${roleId}`); + }, + /** + * @description: 角色成员列表中批量添加员工 + * @param data + * @return {*} + */ + batchAddRoleEmployee: (data) => { + return postRequest('/role/employee/batchAddRoleEmployee', data); + }, +}; diff --git a/smart-admin-web/javascript-ant-design-vue3/src/assets/images/1024lab/1024lab-gzh.jpg b/smart-admin-web/javascript-ant-design-vue3/src/assets/images/1024lab/1024lab-gzh.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d6b03f53c5696aa2c81fadc5b2c64454abc08155 GIT binary patch literal 27898 zcmd753tUY3|37|`Ja$%Sj*04UHXie(8_Z5a`V0cRwK7X{@uFYPjP8o=R8&QcUrN2dz-f1 zth?Lv7%_n{dwqc^j}Ago<4K--1(Rb7cX6lPe{C;bmQi&yXhJCGPCYKc=+u3 ziuxt8n;^LHFy>|M~ng(6^vp z6Yrlp`{N+f8dJ?jT?#W++g10Ea8rq_RZs;D?bvmAM zAlQ3f$#0kh(_?$ih@O)lJ@J}t=k!?3Xh&^V4#SNv6X??MkGX4jw+O4$!IXDN(zemK zO;ENclcg#?RvvPxUQr`0Z#Z~%YR%98R5qo`cra^tZ}foVf-^a*3g5T7oqKHt?@QDFIy4t}qrG1%uOg3%aXm(i= zRS_b2q{n7=@s}Rr6z7al?>pX@gzo4UuHlZ}ui*_L(%Rq9W4rS8*l%1Nd8(u5{}<0~ zs~%Inr&|d(Q7`EQ)Q8Mv?N!bi>FzqmtGdJW^s>7aPT5zJ!kDRiukJyw*Pn5@U$VnP zVa9*9H^X zj7bys6t!huxtpn@_h~!m_LtsvR?2*DGr3pA*|kH5_vIcOoS(DoXS>0f>w{Y6eqhEg z(V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Rp$n zH`O_j0g?|^#i?P+D7HSih#0L~X6im5HEsfoZPA zidwWz6dF#aL$L%UuFriuW4N;<=kSik5On%xNjxTzt12g|G6`EO;9XcF#o245xUdz2 z?TBF7`mK#d5CIMNmS~`jjUlW5E|33*!U+_#0p|M2iA>z4_K@^I}!F z1$w)n?+o>?*xz^%U#ZO`|GEiKA*Z=W2n<{WVE}^NwW+CFp&u#e@oNzBl!&88?5r^J zFGSu#r)aEy{WIj@FvK!x{uV?k1aYPcsP(jAdH+m-033v1$b_o2i zHdo9vp~`FE;zWB$d_r46K^;K0ys z-s*{-z_ql2`yWikqVj_d>{A&^-Z}w-ArXZ@BEB2UO*8{!n^*k;R7rtPYS~bBc48_RM=DRI8$4L_Z*CxqR zU%%8Bu(c9pjtsW~A`mDSqK!T9ggmr`wxGbOjAMd0)L3l4P-;<}PigysgpohsganNf zD6&hUuPZOe?3wttfq<7WG=J7-{G8KLbY>|;8+&f+4k5x8Pnl$Pbf>W)I3iy0qdvFdWVD;a(G6R^)7N|Ades+fF+P3s}Z?t+u>%@KIpUw>8 z%F>iEzf_nz8-XTg5FgYS9#^vt+xN_<6>Tln@&!jPN!UEFFXdc;`k}+z`jf|NK16vy zhO}@Kb=HI04z{c=?VZkaeeTJGiW3CBiD#+_4CF~c+JHic!JMAS@WTF1oT13H2HPgm z#HzL=J~`DHi^NheN!&?G@@&(^$}|rQl01B3MQJ~sBsbU4R3{(IAQQrPu>i&QKo6c?jUz%od*Z=?k literal 0 HcmV?d00001 diff --git a/smart-admin-web/javascript-ant-design-vue3/src/assets/images/1024lab/zhuoda-wechat.jpg b/smart-admin-web/javascript-ant-design-vue3/src/assets/images/1024lab/zhuoda-wechat.jpg new file mode 100644 index 0000000000000000000000000000000000000000..9e117782266009c7d2d5caaf5dd107277e0f96c8 GIT binary patch literal 42080 zcmb@ucU%)+w>}yK0cnvAQlf&Q(kv7OBz8o;hy_JKjEZzIA|fC$Ls3v^DhdihKtxo; zNDTrKdPLMvlolZ&QBfh1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smart-admin-web/javascript-ant-design-vue3/src/assets/images/login/ali-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..fe141241bf2aec2a19069aefd4d1659b68eb67b0 GIT binary patch literal 7011 zcmV-p8=T~cP)Py59Z5t%RCr$PUHOk>)ph>PeYMy0KKnic0~iPxL&D;)NpT3s7LMYKiHsBBI6{gP z@>_o9AIJ~J{vjyA$QUcu$Uu-IFtMc>76W602QbDgv+rB4)z#ItynCYW-nu>2J=NXS zRoy*axT4iFOx1h$eec}wp7Wh^?-f-T04f5-GPPa1c16WitCDuC+HY#f%?8*K8QG$c z^(wkbfR#`kP-rhi@}kHpBn2R5fB_M+M%Atr$QlS% z0_ats2heVU3zaOOX#fd8XbiLm3!nx_8KMqkK*j_Z1u&wJK?qK3Y|n_`G=M>kqA>$o zsFg8ZsFWts#nq*UAHJ!&)PNIU;Z2sxf>l+1@Z#RC(qwr<26l^8*&$-LL1eS4t`Z|T zsOF%^h)7DIDL|4QPzP!xP-9h%)bUldFd|kV7EoGc&HrdsAQgpH05hrZ;ETvPs2)`{ zhm7balQ2iJne>UT-FtIEM3!{qE(yT2*uK8u+<3}%r;zDYt7{e5s?f`f;Btj*Q`Jo( z=p}%F)-7|f?a99YRg8$pF@YYkiv0pPAi&|8k<-c84yWQ;VR*Q2Vks=zS?^-EUAunT zQ!=teOyWuyywUHckcWGDP~dIqCD86kE-eKe=(U`+nbL}bs#d>q#9oZgKHpiy#QOG z=m(Hp)ZVv$u@VGBYH?VAcM#!y#P;LZCXU56IXH28q&PHmZ}rhfIRZLsivsXtkG+si zugrEOQ+inxMYllX>qX>pg{~J!4}d&?MlYbVUU&X&@^%G4k&~i`oK(erg}fKX@tf6( z94MbJ6&`uyzH+Cx>ImS+-+C*VI#$RVjaREAw?gf8V&pb~UJb>109~DSaGAbefZ(J; zK2WQ#C&auLt2u0?cDAyqtN8Fu?Ry&?0sQ21yL*i>+r--IRpbs)T%*u+0#06z4(JK| zJ~VnEC8ae(P67IXh`eG&-m%smdg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%xTN1Hhkd4vMAS9CS*n_;h>QrPfm7&ez@6M1onavTN6_R5iCQZ{zA}RcsXqH*fyDuMiTh9R2+{sKoE4`hf_3 zuFzi#qqQh`HaT&sxO0vTn3ojbaPh}pcp<$q&UV#ey$mY1is*H!JZcB)d1#41a?Nsl z^L1_s|J@(8BPg=iQh<{px?fe^gXkNHNDiEjN`*)6yTnKB1OOgYHT^HXm|Sam^VMo~ zpjwMJi{MI8uHZMy@5{MHdh0Qy$W{OvjzMgZxA$)anEb3gNgj zo-L!^q}Hbqf?5EU?<2POAfOKuaDhfDuVS>y<_V=H+>KNC^-wjVG`? ziS|4c=S1X0&DtXdas;*bXcpNa;CN*@kNph*|352UdL(FGEa3nE002ovPDHLkV1kI` Bn_vI{ literal 0 HcmV?d00001 diff --git a/smart-admin-web/javascript-ant-design-vue3/src/assets/images/login/google-icon.png b/smart-admin-web/javascript-ant-design-vue3/src/assets/images/login/google-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..4bc6e4b0820a9d52258c4111ca75b3a875062431 GIT binary patch literal 6228 zcmV-a7^~-rP)Py24oO5oRCr$PUHg+9)ph>P?U~t`oqexXTJ7pBWI5PD#wL-3BOX<8FvKpLinAsK zP722KzqoPe=iB?*B*4pIFQ0-M{7etbxNGK!*z$;DB7ieAuS*WH3G6j)w1;#|>hCr|SA{UFca0#Bh zXgZ=3$s0EcLqkLUD&6AzWn?t~K5*deXf8RLXpbdYBQ0pNFzw>|9RPYo%sN%uFOYQ* ztO3xaKqsIb1Q#j^KwAJr0HH8Y9xQ+&AUTLSkO7$yU>d-bLdGE&QQuw{!3cnH^}HDa zn=0loo62W1E$Ow{C!V;g&}_g7u<#U<(vI z01^$IeeEa9LNK8g7X)}09^Qvb}Ja+^X21kwp0380(>)Hmz;kEY(v14wgG6p^c{IHQpFeBXboke9Q$ zv25zeCm+hyd#SnrKJfP2(b(lw(x|^yCAtM_?+_z*3-op<1^~3zJHb^tJ_W&5g`8BY z$0B0h^VM9iQXI{1Y)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