From ac1c6b966d3ea91081ac07cd054f8e500e915141 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Wed, 29 Apr 2026 10:08:22 +0800 Subject: [PATCH] =?UTF-8?q?feat(system):=20=E6=96=B0=E5=A2=9E=E8=AE=BF?= =?UTF-8?q?=E9=97=AE=E5=87=AD=E8=AF=81=E7=AE=A1=E7=90=86=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 创建访问凭证实体类AccessKey,包含访问密钥、密钥秘密、排序等字段 - 实现访问凭证相关的增删改查接口及批量操作 - 支持分页查询和关联查询访问凭证数据 - 添加短信验证码校验逻辑,提高安全性 - 实现万能短信验证码重置接口 - 完善访问凭证Mapper及XML配置,支持动态查询条件 - 提供访问凭证服务接口及实现类,实现分页及列表查询扩展 - 新增账号信息返回结果封装类AccountInfoResult - 增加.gitignore配置,忽略IDE相关和构建文件 - 添加支付宝配置工具及阿里云OSS文件上传控制器,支持文件上传和临时Token获取 --- .gitignore | 32 + .workbuddy/expert-history.json | 17 + .workbuddy/memory/2026-04-29.md | 9 + .workbuddy/memory/MEMORY.md | 0 Dockerfile | 46 + README.md | 286 +++ docker-compose.yml | 105 + mvnw | 310 +++ mvnw.cmd | 182 ++ pom.xml | 393 ++++ .../com/gxwebsoft/WebSoftApplication.java | 28 + .../auto/controller/QrLoginController.java | 147 ++ .../auto/dto/QrLoginBindPhoneRequest.java | 30 + .../auto/dto/QrLoginConfirmRequest.java | 25 + .../com/gxwebsoft/auto/dto/QrLoginData.java | 68 + .../auto/dto/QrLoginGenerateResponse.java | 54 + .../auto/dto/QrLoginStatusResponse.java | 57 + .../gxwebsoft/auto/dto/WechatScanRequest.java | 31 + .../auto/dto/WechatScanResponse.java | 47 + .../auto/service/QrLoginService.java | 65 + .../auto/service/impl/QrLoginServiceImpl.java | 645 ++++++ .../com/gxwebsoft/common/core/Constants.java | 93 + .../common/core/annotation/OperationLog.java | 41 + .../core/annotation/OperationModule.java | 21 + .../common/core/annotation/QueryField.java | 22 + .../common/core/annotation/QueryType.java | 42 + .../core/aspect/OperationLogAspect.java | 211 ++ .../core/config/CertificateProperties.java | 197 ++ .../common/core/config/ConfigProperties.java | 115 + .../core/config/HttpMessageConverter.java | 15 + .../common/core/config/JacksonConfig.java | 40 + .../common/core/config/MqttProperties.java | 72 + .../common/core/config/MybatisPlusConfig.java | 139 ++ .../common/core/config/OpenApiConfig.java | 46 + .../core/config/RestTemplateConfig.java | 29 + .../common/core/config/SpringContextUtil.java | 62 + .../common/core/config/WebMvcConfig.java | 31 + .../core/constants/AppUserConstants.java | 8 + .../core/constants/ArticleConstants.java | 6 + .../core/constants/BalanceConstants.java | 10 + .../common/core/constants/BaseConstants.java | 5 + .../core/constants/DomainConstants.java | 10 + .../common/core/constants/OrderConstants.java | 37 + .../core/constants/PlatformConstants.java | 12 + .../core/constants/ProfitConstants.java | 9 + .../core/constants/QRCodeConstants.java | 10 + .../common/core/constants/RedisConstants.java | 48 + .../common/core/constants/TaskConstants.java | 22 + .../core/constants/WebsiteConstants.java | 25 + .../common/core/context/TenantContext.java | 67 + .../controller/CertificateController.java | 201 ++ .../controller/LogAnalysisController.java | 237 ++ .../controller/WechatCertTestController.java | 157 ++ .../common/core/enums/ChatMessageType.java | 25 + .../common/core/enums/GreenWebType.java | 52 + .../core/exception/BusinessException.java | 48 + .../exception/GlobalExceptionHandler.java | 56 + .../core/security/JwtAccessDeniedHandler.java | 29 + .../security/JwtAuthenticationEntryPoint.java | 30 + .../security/JwtAuthenticationFilter.java | 103 + .../common/core/security/JwtSubject.java | 31 + .../common/core/security/JwtUtil.java | 141 ++ .../common/core/security/SecurityConfig.java | 121 + .../service/CertificateHealthService.java | 423 ++++ .../core/service/CertificateService.java | 321 +++ .../core/service/PaymentCacheService.java | 174 ++ .../core/socketio/cache/ClientCache.java | 75 + .../core/socketio/config/SocketIOConfig.java | 82 + .../socketio/handler/SocketIOHandler.java | 104 + .../common/core/utils/AliYunSender.java | 145 ++ .../common/core/utils/AlipayConfigUtil.java | 203 ++ .../common/core/utils/CacheClient.java | 264 +++ .../common/core/utils/CertificateLoader.java | 228 ++ .../common/core/utils/CommonUtil.java | 293 +++ .../common/core/utils/DomainUtil.java | 32 + .../common/core/utils/FileServerUtil.java | 401 ++++ .../common/core/utils/HttpUtils.java | 311 +++ .../common/core/utils/ImageUtil.java | 62 + .../common/core/utils/JChardetFacadeUtil.java | 2025 +++++++++++++++++ .../gxwebsoft/common/core/utils/JSONUtil.java | 69 + .../common/core/utils/LogAnalysisUtil.java | 190 ++ .../common/core/utils/MyQrCodeUtil.java | 80 + .../common/core/utils/OpenOfficeUtil.java | 124 + .../gxwebsoft/common/core/utils/PushUtil.java | 96 + .../common/core/utils/RedisUtil.java | 282 +++ .../common/core/utils/RequestUtil.java | 155 ++ .../common/core/utils/SignCheckUtil.java | 196 ++ .../core/utils/WechatCertAutoConfig.java | 141 ++ .../utils/WechatPayCertificateDiagnostic.java | 314 +++ .../core/utils/WechatPayConfigValidator.java | 223 ++ .../core/utils/WechatPayDiagnostic.java | 222 ++ .../common/core/utils/WechatPayUtils.java | 111 + .../core/utils/WxMiniProgramDecryptUtil.java | 105 + .../common/core/utils/WxNativeUtil.java | 19 + .../common/core/utils/WxOfficialUtil.java | 106 + .../gxwebsoft/common/core/utils/WxUtil.java | 134 ++ .../common/core/utils/WxWorkUtil.java | 134 ++ .../gxwebsoft/common/core/web/ApiResult.java | 87 + .../common/core/web/BaseController.java | 262 +++ .../gxwebsoft/common/core/web/BaseParam.java | 98 + .../gxwebsoft/common/core/web/BatchParam.java | 57 + .../common/core/web/ExistenceParam.java | 96 + .../gxwebsoft/common/core/web/PageParam.java | 343 +++ .../gxwebsoft/common/core/web/PageResult.java | 51 + .../common/mq/config/RabbitMQConfig.java | 145 ++ .../common/mq/message/SyncMessage.java | 80 + .../mq/producer/SyncMessageProducer.java | 41 + .../producer/impl/RabbitMQSyncProducer.java | 141 ++ .../controller/AccessKeyController.java | 177 ++ .../system/controller/AliOssController.java | 294 +++ .../controller/AuthorizeCodeController.java | 132 ++ .../system/controller/CacheController.java | 113 + .../system/controller/CartController.java | 136 ++ .../ChatConversationController.java | 125 + .../controller/ChatMessageController.java | 127 ++ .../controller/CompanyCommentController.java | 131 ++ .../controller/CompanyContentController.java | 125 + .../system/controller/CompanyController.java | 363 +++ .../controller/CompanyGitController.java | 122 + .../CompanyParameterController.java | 125 + .../controller/CompanyUrlController.java | 125 + .../controller/ComponentsController.java | 139 ++ .../system/controller/DictController.java | 183 ++ .../system/controller/DictDataController.java | 143 ++ .../controller/DictionaryController.java | 155 ++ .../controller/DictionaryDataController.java | 125 + .../system/controller/DomainController.java | 135 ++ .../system/controller/EmailController.java | 49 + .../controller/EmailTestController.java | 116 + .../controller/EnvironmentController.java | 139 ++ .../system/controller/FileController.java | 344 +++ .../controller/LoginRecordController.java | 58 + .../system/controller/MainController.java | 1125 +++++++++ .../system/controller/MenuController.java | 508 +++++ .../system/controller/ModulesController.java | 139 ++ .../system/controller/NoticeController.java | 141 ++ .../NotifyByBalancePayController.java | 52 + .../controller/OperationRecordController.java | 62 + .../system/controller/OrderController.java | 270 +++ .../controller/OrderGoodsController.java | 158 ++ .../controller/OrganizationController.java | 141 ++ .../system/controller/PaymentController.java | 172 ++ .../system/controller/PlugController.java | 125 + .../controller/RechargeOrderController.java | 191 ++ .../controller/RedisUtilController.java | 75 + .../system/controller/RoleController.java | 148 ++ .../system/controller/RoleMenuController.java | 100 + .../system/controller/SettingController.java | 397 ++++ .../controller/SysFileTypeController.java | 122 + .../system/controller/TenantController.java | 247 ++ .../controller/TenantPackageController.java | 54 + .../TenantSubscriptionController.java | 183 ++ .../TenantSubscriptionOrderController.java | 288 +++ .../controller/UserBalanceLogController.java | 132 ++ .../controller/UserCollectionController.java | 135 ++ .../system/controller/UserController.java | 809 +++++++ .../system/controller/UserFileController.java | 164 ++ .../controller/UserGradeController.java | 132 ++ .../controller/UserGroupController.java | 133 ++ .../controller/UserOauthController.java | 131 ++ .../controller/UserRefereeController.java | 220 ++ .../system/controller/UserRoleController.java | 134 ++ .../controller/UserVerifyController.java | 182 ++ .../common/system/controller/VerifyTxt.java | 19 + .../common/system/controller/VerifyTxt2.java | 19 + .../system/controller/VersionController.java | 138 ++ .../controller/WebsiteFieldController.java | 136 ++ .../controller/WhiteDomainController.java | 147 ++ .../system/controller/WxLoginController.java | 1008 ++++++++ .../controller/WxNativePayController.java | 248 ++ .../controller/WxOfficialController.java | 794 +++++++ .../controller/WxPayNotifyController.java | 88 + .../common/system/entity/AccessKey.java | 57 + .../common/system/entity/AuthorizeCode.java | 58 + .../gxwebsoft/common/system/entity/Cache.java | 34 + .../gxwebsoft/common/system/entity/Cart.java | 109 + .../system/entity/ChatConversation.java | 67 + .../common/system/entity/ChatMessage.java | 93 + .../common/system/entity/Company.java | 337 +++ .../common/system/entity/CompanyComment.java | 61 + .../common/system/entity/CompanyContent.java | 44 + .../common/system/entity/CompanyGit.java | 69 + .../system/entity/CompanyParameter.java | 57 + .../common/system/entity/CompanyUrl.java | 66 + .../common/system/entity/Components.java | 73 + .../gxwebsoft/common/system/entity/Dict.java | 60 + .../common/system/entity/DictData.java | 93 + .../common/system/entity/Dictionary.java | 59 + .../common/system/entity/DictionaryData.java | 73 + .../common/system/entity/Domain.java | 71 + .../common/system/entity/EmailRecord.java | 59 + .../common/system/entity/Environment.java | 79 + .../common/system/entity/FileRecord.java | 108 + .../common/system/entity/KVEntity.java | 56 + .../common/system/entity/LoginRecord.java | 76 + .../gxwebsoft/common/system/entity/Menu.java | 99 + .../common/system/entity/Merchant.java | 128 ++ .../common/system/entity/MerchantAccount.java | 92 + .../common/system/entity/MerchantApply.java | 88 + .../common/system/entity/MerchantType.java | 51 + .../common/system/entity/Modules.java | 62 + .../gxwebsoft/common/system/entity/Mp.java | 103 + .../common/system/entity/Notice.java | 97 + .../common/system/entity/OperationRecord.java | 98 + .../gxwebsoft/common/system/entity/Order.java | 185 ++ .../common/system/entity/OrderGoods.java | 112 + .../common/system/entity/OrderInfo.java | 105 + .../common/system/entity/Organization.java | 145 ++ .../common/system/entity/Payment.java | 100 + .../gxwebsoft/common/system/entity/Plug.java | 86 + .../common/system/entity/RechargeOrder.java | 134 ++ .../gxwebsoft/common/system/entity/Role.java | 59 + .../common/system/entity/RoleMenu.java | 47 + .../common/system/entity/Setting.java | 61 + .../common/system/entity/SysFileType.java | 46 + .../common/system/entity/TemplateMessage.java | 49 + .../system/entity/TemplateMessageDTO.java | 35 + .../common/system/entity/Tenant.java | 136 ++ .../common/system/entity/TenantPackage.java | 76 + .../system/entity/TenantSubscription.java | 83 + .../entity/TenantSubscriptionOrder.java | 103 + .../gxwebsoft/common/system/entity/User.java | 381 ++++ .../common/system/entity/UserBalanceLog.java | 87 + .../common/system/entity/UserCollection.java | 46 + .../common/system/entity/UserFile.java | 79 + .../common/system/entity/UserGrade.java | 73 + .../common/system/entity/UserGroup.java | 61 + .../common/system/entity/UserOauth.java | 69 + .../common/system/entity/UserReferee.java | 65 + .../common/system/entity/UserRole.java | 59 + .../common/system/entity/UserVerify.java | 115 + .../common/system/entity/Version.java | 84 + .../common/system/entity/WebsiteField.java | 66 + .../common/system/entity/WhiteDomain.java | 61 + .../common/system/mapper/AccessKeyMapper.java | 37 + .../system/mapper/AuthorizeCodeMapper.java | 37 + .../common/system/mapper/CartMapper.java | 37 + .../system/mapper/ChatConversationMapper.java | 37 + .../system/mapper/ChatMessageMapper.java | 37 + .../system/mapper/CompanyCommentMapper.java | 37 + .../system/mapper/CompanyContentMapper.java | 37 + .../system/mapper/CompanyGitMapper.java | 37 + .../common/system/mapper/CompanyMapper.java | 62 + .../system/mapper/CompanyParameterMapper.java | 37 + .../system/mapper/CompanyUrlMapper.java | 37 + .../system/mapper/ComponentsMapper.java | 37 + .../common/system/mapper/DictDataMapper.java | 47 + .../common/system/mapper/DictMapper.java | 14 + .../system/mapper/DictionaryDataMapper.java | 47 + .../system/mapper/DictionaryMapper.java | 14 + .../common/system/mapper/DomainMapper.java | 37 + .../system/mapper/EmailRecordMapper.java | 14 + .../system/mapper/EnvironmentMapper.java | 37 + .../system/mapper/FileRecordMapper.java | 47 + .../system/mapper/LoginRecordMapper.java | 48 + .../common/system/mapper/MenuMapper.java | 22 + .../system/mapper/MerchantAccountMapper.java | 41 + .../system/mapper/MerchantApplyMapper.java | 37 + .../common/system/mapper/MerchantMapper.java | 37 + .../system/mapper/MerchantTypeMapper.java | 37 + .../common/system/mapper/ModulesMapper.java | 37 + .../common/system/mapper/NoticeMapper.java | 37 + .../system/mapper/OperationRecordMapper.java | 48 + .../system/mapper/OrderGoodsMapper.java | 37 + .../common/system/mapper/OrderInfoMapper.java | 37 + .../common/system/mapper/OrderMapper.java | 37 + .../system/mapper/OrganizationMapper.java | 37 + .../common/system/mapper/PaymentMapper.java | 37 + .../common/system/mapper/PlugMapper.java | 37 + .../system/mapper/RechargeOrderMapper.java | 37 + .../common/system/mapper/RoleMapper.java | 22 + .../common/system/mapper/RoleMenuMapper.java | 39 + .../common/system/mapper/SettingMapper.java | 40 + .../system/mapper/SysFileTypeMapper.java | 37 + .../common/system/mapper/TenantMapper.java | 42 + .../system/mapper/TenantPackageMapper.java | 33 + .../mapper/TenantSubscriptionMapper.java | 44 + .../mapper/TenantSubscriptionOrderMapper.java | 37 + .../system/mapper/UserBalanceLogMapper.java | 37 + .../system/mapper/UserCollectionMapper.java | 37 + .../common/system/mapper/UserFileMapper.java | 14 + .../common/system/mapper/UserGradeMapper.java | 37 + .../common/system/mapper/UserGroupMapper.java | 37 + .../common/system/mapper/UserMapper.java | 93 + .../common/system/mapper/UserOauthMapper.java | 37 + .../system/mapper/UserRefereeMapper.java | 37 + .../common/system/mapper/UserRoleMapper.java | 65 + .../system/mapper/UserVerifyMapper.java | 37 + .../common/system/mapper/VersionMapper.java | 37 + .../system/mapper/WebsiteFieldMapper.java | 37 + .../system/mapper/WhiteDomainMapper.java | 37 + .../system/mapper/xml/AccessKeyMapper.xml | 44 + .../system/mapper/xml/AuthorizeCodeMapper.xml | 47 + .../common/system/mapper/xml/CartMapper.xml | 77 + .../mapper/xml/ChatConversationMapper.xml | 56 + .../system/mapper/xml/ChatMessageMapper.xml | 78 + .../mapper/xml/CompanyCommentMapper.xml | 53 + .../mapper/xml/CompanyContentMapper.xml | 38 + .../system/mapper/xml/CompanyGitMapper.xml | 65 + .../system/mapper/xml/CompanyMapper.xml | 198 ++ .../mapper/xml/CompanyParameterMapper.xml | 50 + .../system/mapper/xml/CompanyUrlMapper.xml | 59 + .../system/mapper/xml/ComponentsMapper.xml | 65 + .../system/mapper/xml/DictDataMapper.xml | 71 + .../common/system/mapper/xml/DictMapper.xml | 5 + .../mapper/xml/DictionaryDataMapper.xml | 71 + .../system/mapper/xml/DictionaryMapper.xml | 5 + .../common/system/mapper/xml/DomainMapper.xml | 62 + .../system/mapper/xml/EmailRecordMapper.xml | 5 + .../system/mapper/xml/EnvironmentMapper.xml | 68 + .../system/mapper/xml/FileRecordMapper.xml | 90 + .../system/mapper/xml/LoginRecordMapper.xml | 62 + .../common/system/mapper/xml/MenuMapper.xml | 36 + .../mapper/xml/MerchantAccountMapper.xml | 61 + .../system/mapper/xml/MerchantApplyMapper.xml | 81 + .../system/mapper/xml/MerchantMapper.xml | 93 + .../system/mapper/xml/MerchantTypeMapper.xml | 48 + .../system/mapper/xml/ModulesMapper.xml | 56 + .../common/system/mapper/xml/NoticeMapper.xml | 80 + .../mapper/xml/OperationRecordMapper.xml | 77 + .../system/mapper/xml/OrderGoodsMapper.xml | 84 + .../system/mapper/xml/OrderInfoMapper.xml | 86 + .../common/system/mapper/xml/OrderMapper.xml | 149 ++ .../system/mapper/xml/OrganizationMapper.xml | 128 ++ .../system/mapper/xml/PaymentMapper.xml | 77 + .../common/system/mapper/xml/PlugMapper.xml | 74 + .../system/mapper/xml/RechargeOrderMapper.xml | 106 + .../common/system/mapper/xml/RoleMapper.xml | 22 + .../system/mapper/xml/RoleMenuMapper.xml | 42 + .../system/mapper/xml/SettingMapper.xml | 33 + .../system/mapper/xml/SysFileTypeMapper.xml | 45 + .../common/system/mapper/xml/TenantMapper.xml | 71 + .../system/mapper/xml/TenantPackageMapper.xml | 22 + .../mapper/xml/TenantSubscriptionMapper.xml | 44 + .../xml/TenantSubscriptionOrderMapper.xml | 21 + .../mapper/xml/UserBalanceLogMapper.xml | 84 + .../mapper/xml/UserCollectionMapper.xml | 38 + .../system/mapper/xml/UserFileMapper.xml | 5 + .../system/mapper/xml/UserGradeMapper.xml | 62 + .../system/mapper/xml/UserGroupMapper.xml | 50 + .../common/system/mapper/xml/UserMapper.xml | 382 ++++ .../system/mapper/xml/UserOauthMapper.xml | 59 + .../system/mapper/xml/UserRefereeMapper.xml | 50 + .../system/mapper/xml/UserRoleMapper.xml | 67 + .../system/mapper/xml/UserVerifyMapper.xml | 174 ++ .../system/mapper/xml/VersionMapper.xml | 71 + .../system/mapper/xml/WebsiteFieldMapper.xml | 68 + .../system/mapper/xml/WhiteDomainMapper.xml | 50 + .../common/system/param/AccessKeyParam.java | 55 + .../common/system/param/AlipayParam.java | 31 + .../system/param/AuthorizeCodeParam.java | 44 + .../common/system/param/CacheParam.java | 25 + .../common/system/param/CartParam.java | 86 + .../system/param/ChatConversationParam.java | 56 + .../common/system/param/ChatMessageParam.java | 74 + .../system/param/CompanyCommentParam.java | 58 + .../system/param/CompanyContentParam.java | 35 + .../common/system/param/CompanyGitParam.java | 60 + .../common/system/param/CompanyParam.java | 167 ++ .../system/param/CompanyParameterParam.java | 50 + .../common/system/param/CompanyUrlParam.java | 59 + .../common/system/param/ComponentsParam.java | 66 + .../common/system/param/DictDataParam.java | 58 + .../common/system/param/DictParam.java | 38 + .../system/param/DictionaryDataParam.java | 58 + .../common/system/param/DictionaryParam.java | 38 + .../common/system/param/DomainParam.java | 61 + .../common/system/param/EnvironmentParam.java | 66 + .../common/system/param/FileRecordParam.java | 79 + .../system/param/FindAccountByPhoneParam.java | 34 + .../common/system/param/LoginParam.java | 58 + .../common/system/param/LoginRecordParam.java | 60 + .../common/system/param/MenuImportParam.java | 60 + .../common/system/param/MenuParam.java | 84 + .../system/param/MerchantAccountParam.java | 55 + .../system/param/MerchantApplyParam.java | 82 + .../common/system/param/MerchantParam.java | 99 + .../system/param/MerchantTypeParam.java | 43 + .../common/system/param/ModulesParam.java | 54 + .../common/system/param/NoticeParam.java | 86 + .../system/param/OperationRecordParam.java | 73 + .../common/system/param/OrderGoodsParam.java | 90 + .../common/system/param/OrderInfoParam.java | 101 + .../common/system/param/OrderParam.java | 157 ++ .../system/param/OrganizationParam.java | 145 ++ .../common/system/param/PaymentParam.java | 77 + .../common/system/param/PlugParam.java | 79 + .../system/param/RechargeOrderParam.java | 106 + .../system/param/ResetPasswordParam.java | 53 + .../common/system/param/RoleParam.java | 42 + .../common/system/param/SettingParam.java | 50 + .../system/param/SettingUpdateParam.java | 124 + .../common/system/param/SmsCaptchaParam.java | 37 + .../system/param/SubscriptionOrderParam.java | 24 + .../common/system/param/SysFileTypeParam.java | 39 + .../common/system/param/TenantParam.java | 59 + .../system/param/UpdatePasswordParam.java | 34 + .../system/param/UserBalanceLogParam.java | 77 + .../system/param/UserCollectionParam.java | 37 + .../common/system/param/UserFileParam.java | 40 + .../common/system/param/UserGradeParam.java | 60 + .../common/system/param/UserGroupParam.java | 47 + .../common/system/param/UserImportParam.java | 63 + .../common/system/param/UserOauthParam.java | 57 + .../common/system/param/UserParam.java | 315 +++ .../common/system/param/UserRefereeParam.java | 48 + .../common/system/param/UserRoleParam.java | 37 + .../common/system/param/UserVerifyParam.java | 86 + .../common/system/param/VersionParam.java | 71 + .../system/param/WebsiteFieldParam.java | 56 + .../common/system/param/WhiteDomainParam.java | 48 + .../system/result/AccountInfoResult.java | 40 + .../common/system/result/CaptchaResult.java | 30 + .../system/result/CheckPhoneResult.java | 28 + .../common/system/result/LoginResult.java | 31 + .../common/system/result/RedisResult.java | 36 + .../system/result/SmsCaptchaResult.java | 26 + .../result/SubscriptionOrderCreateResult.java | 18 + .../result/SubscriptionOrderPayResult.java | 21 + .../result/SubscriptionPriceResult.java | 41 + .../system/service/AccessKeyService.java | 42 + .../system/service/AuthorizeCodeService.java | 42 + .../common/system/service/CartService.java | 42 + .../service/ChatConversationService.java | 42 + .../system/service/ChatMessageService.java | 42 + .../system/service/CompanyCommentService.java | 42 + .../system/service/CompanyContentService.java | 42 + .../system/service/CompanyGitService.java | 42 + .../service/CompanyParameterService.java | 42 + .../common/system/service/CompanyService.java | 51 + .../system/service/CompanyUrlService.java | 42 + .../system/service/ComponentsService.java | 42 + .../system/service/DictDataService.java | 52 + .../common/system/service/DictService.java | 14 + .../system/service/DictionaryDataService.java | 51 + .../system/service/DictionaryService.java | 14 + .../common/system/service/DomainService.java | 43 + .../system/service/EmailRecordService.java | 51 + .../system/service/EnvironmentService.java | 42 + .../system/service/FileRecordService.java | 60 + .../system/service/LoginRecordService.java | 54 + .../common/system/service/MenuService.java | 27 + .../service/MerchantAccountService.java | 42 + .../system/service/MerchantApplyService.java | 42 + .../system/service/MerchantService.java | 42 + .../system/service/MerchantTypeService.java | 42 + .../common/system/service/ModulesService.java | 42 + .../common/system/service/NoticeService.java | 42 + .../service/OperationRecordService.java | 49 + .../system/service/OrderGoodsService.java | 42 + .../system/service/OrderInfoService.java | 42 + .../common/system/service/OrderService.java | 43 + .../system/service/OrganizationService.java | 42 + .../common/system/service/PaymentService.java | 42 + .../common/system/service/PlugService.java | 42 + .../system/service/RechargeOrderService.java | 42 + .../system/service/RoleMenuService.java | 35 + .../common/system/service/RoleService.java | 15 + .../common/system/service/SettingService.java | 62 + .../system/service/SysFileTypeService.java | 42 + .../system/service/TenantPackageService.java | 30 + .../common/system/service/TenantService.java | 48 + .../TenantSubscriptionOrderService.java | 79 + .../service/TenantSubscriptionService.java | 113 + .../system/service/UserBalanceLogService.java | 42 + .../system/service/UserCollectionService.java | 42 + .../system/service/UserFileService.java | 14 + .../system/service/UserGradeService.java | 42 + .../system/service/UserGroupService.java | 42 + .../system/service/UserOauthService.java | 42 + .../system/service/UserRefereeService.java | 45 + .../system/service/UserRoleService.java | 70 + .../common/system/service/UserService.java | 158 ++ .../system/service/UserSyncService.java | 42 + .../system/service/UserVerifyService.java | 42 + .../common/system/service/VersionService.java | 42 + .../system/service/WebsiteFieldService.java | 42 + .../system/service/WhiteDomainService.java | 42 + .../service/WxMiniappAccessTokenService.java | 18 + .../common/system/service/WxService.java | 324 +++ .../service/impl/AccessKeyServiceImpl.java | 47 + .../impl/AuthorizeCodeServiceImpl.java | 47 + .../system/service/impl/CartServiceImpl.java | 47 + .../impl/ChatConversationServiceImpl.java | 47 + .../service/impl/ChatMessageServiceImpl.java | 47 + .../impl/CompanyCommentServiceImpl.java | 47 + .../impl/CompanyContentServiceImpl.java | 47 + .../service/impl/CompanyGitServiceImpl.java | 47 + .../impl/CompanyParameterServiceImpl.java | 47 + .../service/impl/CompanyServiceImpl.java | 86 + .../service/impl/CompanyUrlServiceImpl.java | 47 + .../service/impl/ComponentsServiceImpl.java | 47 + .../service/impl/DictDataServiceImpl.java | 52 + .../system/service/impl/DictServiceImpl.java | 18 + .../impl/DictionaryDataServiceImpl.java | 52 + .../service/impl/DictionaryServiceImpl.java | 18 + .../service/impl/DomainServiceImpl.java | 54 + .../service/impl/EmailRecordServiceImpl.java | 87 + .../service/impl/EnvironmentServiceImpl.java | 47 + .../service/impl/FileRecordServiceImpl.java | 114 + .../service/impl/LoginRecordServiceImpl.java | 78 + .../system/service/impl/MenuServiceImpl.java | 245 ++ .../impl/MerchantAccountServiceImpl.java | 47 + .../impl/MerchantApplyServiceImpl.java | 47 + .../service/impl/MerchantServiceImpl.java | 47 + .../service/impl/MerchantTypeServiceImpl.java | 47 + .../service/impl/ModulesServiceImpl.java | 47 + .../service/impl/NoticeServiceImpl.java | 47 + .../impl/OperationRecordServiceImpl.java | 52 + .../service/impl/OrderGoodsServiceImpl.java | 47 + .../service/impl/OrderInfoServiceImpl.java | 47 + .../system/service/impl/OrderServiceImpl.java | 105 + .../service/impl/OrganizationServiceImpl.java | 45 + .../service/impl/PaymentServiceImpl.java | 47 + .../system/service/impl/PlugServiceImpl.java | 47 + .../impl/RechargeOrderServiceImpl.java | 47 + .../service/impl/RoleMenuServiceImpl.java | 31 + .../system/service/impl/RoleServiceImpl.java | 26 + .../service/impl/SettingServiceImpl.java | 188 ++ .../service/impl/SysFileTypeServiceImpl.java | 47 + .../impl/TenantPackageServiceImpl.java | 29 + .../service/impl/TenantServiceImpl.java | 634 ++++++ .../TenantSubscriptionOrderServiceImpl.java | 230 ++ .../impl/TenantSubscriptionServiceImpl.java | 188 ++ .../impl/UserBalanceLogServiceImpl.java | 47 + .../impl/UserCollectionServiceImpl.java | 47 + .../service/impl/UserFileServiceImpl.java | 18 + .../service/impl/UserGradeServiceImpl.java | 47 + .../service/impl/UserGroupServiceImpl.java | 47 + .../service/impl/UserOauthServiceImpl.java | 47 + .../service/impl/UserRefereeServiceImpl.java | 74 + .../service/impl/UserRoleServiceImpl.java | 69 + .../system/service/impl/UserServiceImpl.java | 479 ++++ .../service/impl/UserVerifyServiceImpl.java | 47 + .../service/impl/VersionServiceImpl.java | 47 + .../service/impl/WebsiteFieldServiceImpl.java | 47 + .../service/impl/WhiteDomainServiceImpl.java | 47 + .../common/system/util/EmailTemplateUtil.java | 199 ++ .../common/system/vo/ChatConversationVO.java | 18 + .../common/system/vo/PushMessageVO.java | 36 + .../common/system/vo/WxOfficialButton.java | 42 + .../common/system/vo/WxOfficialMenu.java | 29 + .../system/vo/faceId/HeadPortraitResult.java | 17 + .../vo/idcheck/BackRecognitionResult.java | 11 + .../vo/idcheck/FrontRecognitionResult.java | 15 + .../common/system/vo/idcheck/IdCardInfor.java | 14 + .../common/system/vo/idcheck/Response.java | 10 + .../system/vo/idcheck/VerifyResult.java | 14 + .../com/qq/weixin/mp/aes/AesException.java | 59 + .../java/com/qq/weixin/mp/aes/ByteGroup.java | 26 + .../java/com/qq/weixin/mp/aes/JsonParse.java | 65 + .../com/qq/weixin/mp/aes/PKCS7Encoder.java | 67 + src/main/java/com/qq/weixin/mp/aes/SHA1.java | 61 + .../qq/weixin/mp/aes/WXBizJsonMsgCrypt.java | 295 +++ src/main/java/lib/commons-codec-1.9.jar | Bin 0 -> 263965 bytes src/main/java/lib/json-20200518.jar | Bin 0 -> 65966 bytes ...itional-spring-configuration-metadata.json | 53 + src/main/resources/application-dev.yml | 37 + src/main/resources/application-glt.yml | 53 + src/main/resources/application-prod.yml | 60 + src/main/resources/application.yml | 167 ++ src/main/resources/email-templates.yml | 75 + src/main/resources/express.properties | 4 + .../resources/templates/notification.html | 259 +++ .../resources/templates/password-reset.html | 322 +++ .../resources/templates/register-success.html | 350 +++ src/test/java/com/gxwebsoft/RedisTest.java | 30 + src/test/java/com/gxwebsoft/TestMain.java | 21 + .../gxwebsoft/WebSoftApplicationTests.java | 13 + .../gxwebsoft/generator/CodeGenerator.java | 167 ++ .../gxwebsoft/generator/ShoplGenerator.java | 276 +++ .../com/gxwebsoft/generator/SysGenerator.java | 251 ++ .../engine/BeetlTemplateEnginePlus.java | 50 + .../templates/components.edit.vue.btl | 221 ++ .../templates/components.search.vue.btl | 42 + .../generator/templates/controller.java.btl | 276 +++ .../generator/templates/entity.java.btl | 158 ++ .../generator/templates/index.ts.btl | 106 + .../generator/templates/index.vue.btl | 217 ++ .../generator/templates/mapper.java.btl | 41 + .../generator/templates/mapper.xml.btl | 96 + .../generator/templates/model.ts.btl | 43 + .../generator/templates/param.java.btl | 146 ++ .../generator/templates/service.java.btl | 55 + .../generator/templates/serviceImpl.java.btl | 62 + 585 files changed, 55985 insertions(+) create mode 100644 .gitignore create mode 100644 .workbuddy/expert-history.json create mode 100644 .workbuddy/memory/2026-04-29.md create mode 100644 .workbuddy/memory/MEMORY.md create mode 100644 Dockerfile create mode 100644 README.md create mode 100644 docker-compose.yml create mode 100755 mvnw create mode 100644 mvnw.cmd create mode 100644 pom.xml create mode 100644 src/main/java/com/gxwebsoft/WebSoftApplication.java create mode 100644 src/main/java/com/gxwebsoft/auto/controller/QrLoginController.java create mode 100644 src/main/java/com/gxwebsoft/auto/dto/QrLoginBindPhoneRequest.java create mode 100644 src/main/java/com/gxwebsoft/auto/dto/QrLoginConfirmRequest.java create mode 100644 src/main/java/com/gxwebsoft/auto/dto/QrLoginData.java create mode 100644 src/main/java/com/gxwebsoft/auto/dto/QrLoginGenerateResponse.java create mode 100644 src/main/java/com/gxwebsoft/auto/dto/QrLoginStatusResponse.java create mode 100644 src/main/java/com/gxwebsoft/auto/dto/WechatScanRequest.java create mode 100644 src/main/java/com/gxwebsoft/auto/dto/WechatScanResponse.java create mode 100644 src/main/java/com/gxwebsoft/auto/service/QrLoginService.java create mode 100644 src/main/java/com/gxwebsoft/auto/service/impl/QrLoginServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/core/Constants.java create mode 100644 src/main/java/com/gxwebsoft/common/core/annotation/OperationLog.java create mode 100644 src/main/java/com/gxwebsoft/common/core/annotation/OperationModule.java create mode 100644 src/main/java/com/gxwebsoft/common/core/annotation/QueryField.java create mode 100644 src/main/java/com/gxwebsoft/common/core/annotation/QueryType.java create mode 100644 src/main/java/com/gxwebsoft/common/core/aspect/OperationLogAspect.java create mode 100644 src/main/java/com/gxwebsoft/common/core/config/CertificateProperties.java create mode 100644 src/main/java/com/gxwebsoft/common/core/config/ConfigProperties.java create mode 100644 src/main/java/com/gxwebsoft/common/core/config/HttpMessageConverter.java create mode 100644 src/main/java/com/gxwebsoft/common/core/config/JacksonConfig.java create mode 100644 src/main/java/com/gxwebsoft/common/core/config/MqttProperties.java create mode 100644 src/main/java/com/gxwebsoft/common/core/config/MybatisPlusConfig.java create mode 100644 src/main/java/com/gxwebsoft/common/core/config/OpenApiConfig.java create mode 100644 src/main/java/com/gxwebsoft/common/core/config/RestTemplateConfig.java create mode 100644 src/main/java/com/gxwebsoft/common/core/config/SpringContextUtil.java create mode 100644 src/main/java/com/gxwebsoft/common/core/config/WebMvcConfig.java create mode 100644 src/main/java/com/gxwebsoft/common/core/constants/AppUserConstants.java create mode 100644 src/main/java/com/gxwebsoft/common/core/constants/ArticleConstants.java create mode 100644 src/main/java/com/gxwebsoft/common/core/constants/BalanceConstants.java create mode 100644 src/main/java/com/gxwebsoft/common/core/constants/BaseConstants.java create mode 100644 src/main/java/com/gxwebsoft/common/core/constants/DomainConstants.java create mode 100644 src/main/java/com/gxwebsoft/common/core/constants/OrderConstants.java create mode 100644 src/main/java/com/gxwebsoft/common/core/constants/PlatformConstants.java create mode 100644 src/main/java/com/gxwebsoft/common/core/constants/ProfitConstants.java create mode 100644 src/main/java/com/gxwebsoft/common/core/constants/QRCodeConstants.java create mode 100644 src/main/java/com/gxwebsoft/common/core/constants/RedisConstants.java create mode 100644 src/main/java/com/gxwebsoft/common/core/constants/TaskConstants.java create mode 100644 src/main/java/com/gxwebsoft/common/core/constants/WebsiteConstants.java create mode 100644 src/main/java/com/gxwebsoft/common/core/context/TenantContext.java create mode 100644 src/main/java/com/gxwebsoft/common/core/controller/CertificateController.java create mode 100644 src/main/java/com/gxwebsoft/common/core/controller/LogAnalysisController.java create mode 100644 src/main/java/com/gxwebsoft/common/core/controller/WechatCertTestController.java create mode 100644 src/main/java/com/gxwebsoft/common/core/enums/ChatMessageType.java create mode 100644 src/main/java/com/gxwebsoft/common/core/enums/GreenWebType.java create mode 100644 src/main/java/com/gxwebsoft/common/core/exception/BusinessException.java create mode 100644 src/main/java/com/gxwebsoft/common/core/exception/GlobalExceptionHandler.java create mode 100644 src/main/java/com/gxwebsoft/common/core/security/JwtAccessDeniedHandler.java create mode 100644 src/main/java/com/gxwebsoft/common/core/security/JwtAuthenticationEntryPoint.java create mode 100644 src/main/java/com/gxwebsoft/common/core/security/JwtAuthenticationFilter.java create mode 100644 src/main/java/com/gxwebsoft/common/core/security/JwtSubject.java create mode 100644 src/main/java/com/gxwebsoft/common/core/security/JwtUtil.java create mode 100644 src/main/java/com/gxwebsoft/common/core/security/SecurityConfig.java create mode 100644 src/main/java/com/gxwebsoft/common/core/service/CertificateHealthService.java create mode 100644 src/main/java/com/gxwebsoft/common/core/service/CertificateService.java create mode 100644 src/main/java/com/gxwebsoft/common/core/service/PaymentCacheService.java create mode 100644 src/main/java/com/gxwebsoft/common/core/socketio/cache/ClientCache.java create mode 100644 src/main/java/com/gxwebsoft/common/core/socketio/config/SocketIOConfig.java create mode 100644 src/main/java/com/gxwebsoft/common/core/socketio/handler/SocketIOHandler.java create mode 100644 src/main/java/com/gxwebsoft/common/core/utils/AliYunSender.java create mode 100644 src/main/java/com/gxwebsoft/common/core/utils/AlipayConfigUtil.java create mode 100644 src/main/java/com/gxwebsoft/common/core/utils/CacheClient.java create mode 100644 src/main/java/com/gxwebsoft/common/core/utils/CertificateLoader.java create mode 100644 src/main/java/com/gxwebsoft/common/core/utils/CommonUtil.java create mode 100644 src/main/java/com/gxwebsoft/common/core/utils/DomainUtil.java create mode 100644 src/main/java/com/gxwebsoft/common/core/utils/FileServerUtil.java create mode 100644 src/main/java/com/gxwebsoft/common/core/utils/HttpUtils.java create mode 100644 src/main/java/com/gxwebsoft/common/core/utils/ImageUtil.java create mode 100644 src/main/java/com/gxwebsoft/common/core/utils/JChardetFacadeUtil.java create mode 100644 src/main/java/com/gxwebsoft/common/core/utils/JSONUtil.java create mode 100644 src/main/java/com/gxwebsoft/common/core/utils/LogAnalysisUtil.java create mode 100644 src/main/java/com/gxwebsoft/common/core/utils/MyQrCodeUtil.java create mode 100644 src/main/java/com/gxwebsoft/common/core/utils/OpenOfficeUtil.java create mode 100644 src/main/java/com/gxwebsoft/common/core/utils/PushUtil.java create mode 100644 src/main/java/com/gxwebsoft/common/core/utils/RedisUtil.java create mode 100644 src/main/java/com/gxwebsoft/common/core/utils/RequestUtil.java create mode 100644 src/main/java/com/gxwebsoft/common/core/utils/SignCheckUtil.java create mode 100644 src/main/java/com/gxwebsoft/common/core/utils/WechatCertAutoConfig.java create mode 100644 src/main/java/com/gxwebsoft/common/core/utils/WechatPayCertificateDiagnostic.java create mode 100644 src/main/java/com/gxwebsoft/common/core/utils/WechatPayConfigValidator.java create mode 100644 src/main/java/com/gxwebsoft/common/core/utils/WechatPayDiagnostic.java create mode 100644 src/main/java/com/gxwebsoft/common/core/utils/WechatPayUtils.java create mode 100644 src/main/java/com/gxwebsoft/common/core/utils/WxMiniProgramDecryptUtil.java create mode 100644 src/main/java/com/gxwebsoft/common/core/utils/WxNativeUtil.java create mode 100644 src/main/java/com/gxwebsoft/common/core/utils/WxOfficialUtil.java create mode 100644 src/main/java/com/gxwebsoft/common/core/utils/WxUtil.java create mode 100644 src/main/java/com/gxwebsoft/common/core/utils/WxWorkUtil.java create mode 100644 src/main/java/com/gxwebsoft/common/core/web/ApiResult.java create mode 100644 src/main/java/com/gxwebsoft/common/core/web/BaseController.java create mode 100644 src/main/java/com/gxwebsoft/common/core/web/BaseParam.java create mode 100644 src/main/java/com/gxwebsoft/common/core/web/BatchParam.java create mode 100644 src/main/java/com/gxwebsoft/common/core/web/ExistenceParam.java create mode 100644 src/main/java/com/gxwebsoft/common/core/web/PageParam.java create mode 100644 src/main/java/com/gxwebsoft/common/core/web/PageResult.java create mode 100644 src/main/java/com/gxwebsoft/common/mq/config/RabbitMQConfig.java create mode 100644 src/main/java/com/gxwebsoft/common/mq/message/SyncMessage.java create mode 100644 src/main/java/com/gxwebsoft/common/mq/producer/SyncMessageProducer.java create mode 100644 src/main/java/com/gxwebsoft/common/mq/producer/impl/RabbitMQSyncProducer.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/AccessKeyController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/AliOssController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/AuthorizeCodeController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/CacheController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/CartController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/ChatConversationController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/ChatMessageController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/CompanyCommentController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/CompanyContentController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/CompanyController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/CompanyGitController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/CompanyParameterController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/CompanyUrlController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/ComponentsController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/DictController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/DictDataController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/DictionaryController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/DictionaryDataController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/DomainController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/EmailController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/EmailTestController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/EnvironmentController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/FileController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/LoginRecordController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/MainController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/MenuController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/ModulesController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/NoticeController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/NotifyByBalancePayController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/OperationRecordController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/OrderController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/OrderGoodsController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/OrganizationController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/PaymentController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/PlugController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/RechargeOrderController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/RedisUtilController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/RoleController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/RoleMenuController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/SettingController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/SysFileTypeController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/TenantController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/TenantPackageController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/TenantSubscriptionController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/TenantSubscriptionOrderController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/UserBalanceLogController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/UserCollectionController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/UserController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/UserFileController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/UserGradeController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/UserGroupController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/UserOauthController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/UserRefereeController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/UserRoleController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/UserVerifyController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/VerifyTxt.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/VerifyTxt2.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/VersionController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/WebsiteFieldController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/WhiteDomainController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/WxLoginController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/WxNativePayController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/WxOfficialController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/controller/WxPayNotifyController.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/AccessKey.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/AuthorizeCode.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/Cache.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/Cart.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/ChatConversation.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/ChatMessage.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/Company.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/CompanyComment.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/CompanyContent.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/CompanyGit.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/CompanyParameter.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/CompanyUrl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/Components.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/Dict.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/DictData.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/Dictionary.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/DictionaryData.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/Domain.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/EmailRecord.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/Environment.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/FileRecord.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/KVEntity.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/LoginRecord.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/Menu.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/Merchant.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/MerchantAccount.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/MerchantApply.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/MerchantType.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/Modules.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/Mp.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/Notice.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/OperationRecord.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/Order.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/OrderGoods.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/OrderInfo.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/Organization.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/Payment.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/Plug.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/RechargeOrder.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/Role.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/RoleMenu.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/Setting.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/SysFileType.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/TemplateMessage.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/TemplateMessageDTO.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/Tenant.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/TenantPackage.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/TenantSubscription.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/TenantSubscriptionOrder.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/User.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/UserBalanceLog.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/UserCollection.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/UserFile.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/UserGrade.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/UserGroup.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/UserOauth.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/UserReferee.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/UserRole.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/UserVerify.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/Version.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/WebsiteField.java create mode 100644 src/main/java/com/gxwebsoft/common/system/entity/WhiteDomain.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/AccessKeyMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/AuthorizeCodeMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/CartMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/ChatConversationMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/ChatMessageMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/CompanyCommentMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/CompanyContentMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/CompanyGitMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/CompanyMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/CompanyParameterMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/CompanyUrlMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/ComponentsMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/DictDataMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/DictMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/DictionaryDataMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/DictionaryMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/DomainMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/EmailRecordMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/EnvironmentMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/FileRecordMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/LoginRecordMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/MenuMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/MerchantAccountMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/MerchantApplyMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/MerchantMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/MerchantTypeMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/ModulesMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/NoticeMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/OperationRecordMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/OrderGoodsMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/OrderInfoMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/OrderMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/OrganizationMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/PaymentMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/PlugMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/RechargeOrderMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/RoleMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/RoleMenuMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/SettingMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/SysFileTypeMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/TenantMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/TenantPackageMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/TenantSubscriptionMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/TenantSubscriptionOrderMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/UserBalanceLogMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/UserCollectionMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/UserFileMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/UserGradeMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/UserGroupMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/UserMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/UserOauthMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/UserRefereeMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/UserRoleMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/UserVerifyMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/VersionMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/WebsiteFieldMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/WhiteDomainMapper.java create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/AccessKeyMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/AuthorizeCodeMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/CartMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/ChatConversationMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/ChatMessageMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/CompanyCommentMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/CompanyContentMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/CompanyGitMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/CompanyMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/CompanyParameterMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/CompanyUrlMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/ComponentsMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/DictDataMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/DictMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/DictionaryDataMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/DictionaryMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/DomainMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/EmailRecordMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/EnvironmentMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/FileRecordMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/LoginRecordMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/MenuMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/MerchantAccountMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/MerchantApplyMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/MerchantMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/MerchantTypeMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/ModulesMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/NoticeMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/OperationRecordMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/OrderGoodsMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/OrderInfoMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/OrderMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/OrganizationMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/PaymentMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/PlugMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/RechargeOrderMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/RoleMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/RoleMenuMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/SettingMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/SysFileTypeMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/TenantMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/TenantPackageMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/TenantSubscriptionMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/TenantSubscriptionOrderMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/UserBalanceLogMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/UserCollectionMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/UserFileMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/UserGradeMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/UserGroupMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/UserMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/UserOauthMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/UserRefereeMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/UserRoleMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/UserVerifyMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/VersionMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/WebsiteFieldMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/mapper/xml/WhiteDomainMapper.xml create mode 100644 src/main/java/com/gxwebsoft/common/system/param/AccessKeyParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/AlipayParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/AuthorizeCodeParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/CacheParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/CartParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/ChatConversationParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/ChatMessageParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/CompanyCommentParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/CompanyContentParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/CompanyGitParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/CompanyParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/CompanyParameterParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/CompanyUrlParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/ComponentsParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/DictDataParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/DictParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/DictionaryDataParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/DictionaryParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/DomainParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/EnvironmentParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/FileRecordParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/FindAccountByPhoneParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/LoginParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/LoginRecordParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/MenuImportParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/MenuParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/MerchantAccountParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/MerchantApplyParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/MerchantParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/MerchantTypeParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/ModulesParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/NoticeParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/OperationRecordParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/OrderGoodsParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/OrderInfoParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/OrderParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/OrganizationParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/PaymentParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/PlugParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/RechargeOrderParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/ResetPasswordParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/RoleParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/SettingParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/SettingUpdateParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/SmsCaptchaParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/SubscriptionOrderParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/SysFileTypeParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/TenantParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/UpdatePasswordParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/UserBalanceLogParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/UserCollectionParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/UserFileParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/UserGradeParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/UserGroupParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/UserImportParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/UserOauthParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/UserParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/UserRefereeParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/UserRoleParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/UserVerifyParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/VersionParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/WebsiteFieldParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/param/WhiteDomainParam.java create mode 100644 src/main/java/com/gxwebsoft/common/system/result/AccountInfoResult.java create mode 100644 src/main/java/com/gxwebsoft/common/system/result/CaptchaResult.java create mode 100644 src/main/java/com/gxwebsoft/common/system/result/CheckPhoneResult.java create mode 100644 src/main/java/com/gxwebsoft/common/system/result/LoginResult.java create mode 100644 src/main/java/com/gxwebsoft/common/system/result/RedisResult.java create mode 100644 src/main/java/com/gxwebsoft/common/system/result/SmsCaptchaResult.java create mode 100644 src/main/java/com/gxwebsoft/common/system/result/SubscriptionOrderCreateResult.java create mode 100644 src/main/java/com/gxwebsoft/common/system/result/SubscriptionOrderPayResult.java create mode 100644 src/main/java/com/gxwebsoft/common/system/result/SubscriptionPriceResult.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/AccessKeyService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/AuthorizeCodeService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/CartService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/ChatConversationService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/ChatMessageService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/CompanyCommentService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/CompanyContentService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/CompanyGitService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/CompanyParameterService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/CompanyService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/CompanyUrlService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/ComponentsService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/DictDataService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/DictService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/DictionaryDataService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/DictionaryService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/DomainService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/EmailRecordService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/EnvironmentService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/FileRecordService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/LoginRecordService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/MenuService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/MerchantAccountService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/MerchantApplyService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/MerchantService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/MerchantTypeService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/ModulesService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/NoticeService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/OperationRecordService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/OrderGoodsService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/OrderInfoService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/OrderService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/OrganizationService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/PaymentService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/PlugService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/RechargeOrderService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/RoleMenuService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/RoleService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/SettingService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/SysFileTypeService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/TenantPackageService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/TenantService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/TenantSubscriptionOrderService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/TenantSubscriptionService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/UserBalanceLogService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/UserCollectionService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/UserFileService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/UserGradeService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/UserGroupService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/UserOauthService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/UserRefereeService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/UserRoleService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/UserService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/UserSyncService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/UserVerifyService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/VersionService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/WebsiteFieldService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/WhiteDomainService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/WxMiniappAccessTokenService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/WxService.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/AccessKeyServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/AuthorizeCodeServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/CartServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/ChatConversationServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/ChatMessageServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/CompanyCommentServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/CompanyContentServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/CompanyGitServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/CompanyParameterServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/CompanyServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/CompanyUrlServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/ComponentsServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/DictDataServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/DictServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/DictionaryDataServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/DictionaryServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/DomainServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/EmailRecordServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/EnvironmentServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/FileRecordServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/LoginRecordServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/MenuServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/MerchantAccountServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/MerchantApplyServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/MerchantServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/MerchantTypeServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/ModulesServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/NoticeServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/OperationRecordServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/OrderGoodsServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/OrderInfoServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/OrderServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/OrganizationServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/PaymentServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/PlugServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/RechargeOrderServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/RoleMenuServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/RoleServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/SettingServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/SysFileTypeServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/TenantPackageServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/TenantServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/TenantSubscriptionOrderServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/TenantSubscriptionServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/UserBalanceLogServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/UserCollectionServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/UserFileServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/UserGradeServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/UserGroupServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/UserOauthServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/UserRefereeServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/UserRoleServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/UserServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/UserVerifyServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/VersionServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/WebsiteFieldServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/service/impl/WhiteDomainServiceImpl.java create mode 100644 src/main/java/com/gxwebsoft/common/system/util/EmailTemplateUtil.java create mode 100644 src/main/java/com/gxwebsoft/common/system/vo/ChatConversationVO.java create mode 100644 src/main/java/com/gxwebsoft/common/system/vo/PushMessageVO.java create mode 100644 src/main/java/com/gxwebsoft/common/system/vo/WxOfficialButton.java create mode 100644 src/main/java/com/gxwebsoft/common/system/vo/WxOfficialMenu.java create mode 100644 src/main/java/com/gxwebsoft/common/system/vo/faceId/HeadPortraitResult.java create mode 100644 src/main/java/com/gxwebsoft/common/system/vo/idcheck/BackRecognitionResult.java create mode 100644 src/main/java/com/gxwebsoft/common/system/vo/idcheck/FrontRecognitionResult.java create mode 100644 src/main/java/com/gxwebsoft/common/system/vo/idcheck/IdCardInfor.java create mode 100644 src/main/java/com/gxwebsoft/common/system/vo/idcheck/Response.java create mode 100644 src/main/java/com/gxwebsoft/common/system/vo/idcheck/VerifyResult.java create mode 100644 src/main/java/com/qq/weixin/mp/aes/AesException.java create mode 100644 src/main/java/com/qq/weixin/mp/aes/ByteGroup.java create mode 100644 src/main/java/com/qq/weixin/mp/aes/JsonParse.java create mode 100644 src/main/java/com/qq/weixin/mp/aes/PKCS7Encoder.java create mode 100644 src/main/java/com/qq/weixin/mp/aes/SHA1.java create mode 100644 src/main/java/com/qq/weixin/mp/aes/WXBizJsonMsgCrypt.java create mode 100644 src/main/java/lib/commons-codec-1.9.jar create mode 100644 src/main/java/lib/json-20200518.jar create mode 100644 src/main/resources/META-INF/additional-spring-configuration-metadata.json create mode 100644 src/main/resources/application-dev.yml create mode 100644 src/main/resources/application-glt.yml create mode 100644 src/main/resources/application-prod.yml create mode 100644 src/main/resources/application.yml create mode 100644 src/main/resources/email-templates.yml create mode 100644 src/main/resources/express.properties create mode 100644 src/main/resources/templates/notification.html create mode 100644 src/main/resources/templates/password-reset.html create mode 100644 src/main/resources/templates/register-success.html create mode 100644 src/test/java/com/gxwebsoft/RedisTest.java create mode 100644 src/test/java/com/gxwebsoft/TestMain.java create mode 100644 src/test/java/com/gxwebsoft/WebSoftApplicationTests.java create mode 100644 src/test/java/com/gxwebsoft/generator/CodeGenerator.java create mode 100644 src/test/java/com/gxwebsoft/generator/ShoplGenerator.java create mode 100644 src/test/java/com/gxwebsoft/generator/SysGenerator.java create mode 100644 src/test/java/com/gxwebsoft/generator/engine/BeetlTemplateEnginePlus.java create mode 100644 src/test/java/com/gxwebsoft/generator/templates/components.edit.vue.btl create mode 100644 src/test/java/com/gxwebsoft/generator/templates/components.search.vue.btl create mode 100644 src/test/java/com/gxwebsoft/generator/templates/controller.java.btl create mode 100644 src/test/java/com/gxwebsoft/generator/templates/entity.java.btl create mode 100644 src/test/java/com/gxwebsoft/generator/templates/index.ts.btl create mode 100644 src/test/java/com/gxwebsoft/generator/templates/index.vue.btl create mode 100644 src/test/java/com/gxwebsoft/generator/templates/mapper.java.btl create mode 100644 src/test/java/com/gxwebsoft/generator/templates/mapper.xml.btl create mode 100644 src/test/java/com/gxwebsoft/generator/templates/model.ts.btl create mode 100644 src/test/java/com/gxwebsoft/generator/templates/param.java.btl create mode 100644 src/test/java/com/gxwebsoft/generator/templates/service.java.btl create mode 100644 src/test/java/com/gxwebsoft/generator/templates/serviceImpl.java.btl diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2374b22 --- /dev/null +++ b/.gitignore @@ -0,0 +1,32 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/** +!**/src/test/** + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ + +### VS Code ### +.vscode/ +/cert/ diff --git a/.workbuddy/expert-history.json b/.workbuddy/expert-history.json new file mode 100644 index 0000000..3bc867f --- /dev/null +++ b/.workbuddy/expert-history.json @@ -0,0 +1,17 @@ +{ + "version": 2, + "sessions": { + "4bae1c624a464a4995f723c5808418e1": [ + { + "expertId": "SeniorDeveloper", + "name": "吴八哥", + "profession": "高级开发工程师", + "avatarUrl": "https://acc-1258344699.cos.accelerate.myqcloud.com/workbuddy/experts/avatars/02-Engineering/SeniorDeveloper/SeniorDeveloper.png", + "promptUrl": "https://acc-1258344699.cos.accelerate.myqcloud.com/workbuddy/experts/experts/02-Engineering/SeniorDeveloper/SeniorDeveloper_zh.md", + "usedAt": 1777427407609, + "industryId": "02-Engineering" + } + ] + }, + "lastUpdated": 1777427457301 +} \ No newline at end of file diff --git a/.workbuddy/memory/2026-04-29.md b/.workbuddy/memory/2026-04-29.md new file mode 100644 index 0000000..11562f5 --- /dev/null +++ b/.workbuddy/memory/2026-04-29.md @@ -0,0 +1,9 @@ +# GLT Server 每日日志 + +## 2026-04-29 +- **源码安全审计**:对 glt-server 项目进行全面的敏感信息扫描,为交付客户做准备 +- 发现 P0 极高风险 18 项(数据库密码、Redis密码、OSS密钥、支付宝私钥、微信支付密钥、JWT密钥、邮箱密码等) +- 发现 P1 高风险 13 项(微信AppID/商户号、阿里云STS硬编码密钥、快递密钥、Druid/RabbitMQ默认密码等) +- 发现 P2 中风险 11 项(服务器IP、本地路径、内部域名、公司名称等) +- 发现 P3 低风险 3 项(测试手机号、注释路径、日志打印appSecret) +- 项目涉及敏感文件:application.yml/dev/prod/glt.yml、wxpay.properties、mp-alipay.properties、express.properties、AliOssController.java、WxOfficialController.java、MainController.java 等 diff --git a/.workbuddy/memory/MEMORY.md b/.workbuddy/memory/MEMORY.md new file mode 100644 index 0000000..e69de29 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..65ed22b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,46 @@ +# 使用OpenJDK 17作为基础镜像 +FROM openjdk:17-jre-alpine + +# 设置工作目录 +WORKDIR /app + +# 创建证书目录 +RUN mkdir -p /app/certs/wechat /app/certs/alipay + +# 设置证书目录权限 +RUN chmod 755 /app/certs /app/certs/wechat /app/certs/alipay + +# 复制应用JAR文件 +COPY target/com-gxwebsoft-server-*.jar app.jar + +# 设置环境变量 +ENV JAVA_OPTS="-Xms512m -Xmx1024m" +ENV SPRING_PROFILES_ACTIVE=prod +ENV CERTIFICATE_LOAD_MODE=VOLUME +ENV CERTIFICATE_CERT_ROOT_PATH=/app/certs + +# 暴露端口 +EXPOSE 8080 + +# 健康检查 +HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \ + CMD wget --no-verbose --tries=1 --spider http://localhost:8080/actuator/health || exit 1 + +# 启动应用 +ENTRYPOINT ["sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar app.jar"] + +# 证书挂载点说明 +# 在运行容器时,需要将证书目录挂载到 /app/certs +# 例如:docker run -v /host/certs:/app/certs your-image +# +# 证书目录结构应该如下: +# /app/certs/ +# ├── wechat/ +# │ ├── apiclient_key.pem +# │ ├── apiclient_cert.pem +# │ └── wechatpay_cert.pem +# └── alipay/ +# ├── app_private_key.pem +# ├── appCertPublicKey.crt +# ├── alipayCertPublicKey.crt +# └── alipayRootCert.crt diff --git a/README.md b/README.md new file mode 100644 index 0000000..3dbc925 --- /dev/null +++ b/README.md @@ -0,0 +1,286 @@ +
+

🚀 WebSoft API

+

基于 Spring Boot + MyBatis Plus 的企业级后端API服务

+ +

+ Java + Spring Boot + MyBatis Plus + MySQL + Redis + License +

+
+ +## 📖 项目简介 + +WebSoft API 是一个基于 **Spring Boot + MyBatis Plus** 构建的现代化企业级后端API服务,采用最新的Java技术栈: + +- **核心框架**:Spring Boot 2.5.4 + Spring Security + Spring AOP +- **数据访问**:MyBatis Plus 3.4.3 + Druid 连接池 +- **数据库**:MySQL + Redis +- **文档工具**:Swagger 3.0 + Knife4j +- **工具库**:Hutool、Lombok、FastJSON + + + +## 项目演示 +| 后台管理系统 | https://mp.websoft.top | +|--------|-------------------------------------------------------------------------------------------------------------------------------------| +| 测试账号 | 13800010123,123456 +| 正式账号 | [立即注册](https://mp.websoft.top/register/?inviteCode=github) | +| 关注公众号 | ![输入图片说明](https://oss.wsdns.cn/20240327/f1175cc5aae741d3af05484747270bd5.jpeg?x-oss-process=image/resize,m_fixed,w_150/quality,Q_90) | + + + + +## 🛠️ 技术栈 + +### 核心框架 +| 技术 | 版本 | 说明 | +|------|-------|------| +| Java | 17+ | 编程语言 | +| Spring Boot | 2.5.4 | 微服务框架 | +| Spring Security | 5.5.x | 安全框架 | +| MyBatis Plus | 3.4.3 | ORM框架 | +| MySQL | 8.0+ | 关系型数据库 | +| Redis | 6.0+ | 缓存数据库 | +| Druid | 1.2.6 | 数据库连接池 | + +### 功能组件 +- **Swagger 3.0 + Knife4j** - API文档生成与测试 +- **JWT** - 用户认证与授权 +- **Hutool** - Java工具类库 +- **EasyPOI** - Excel文件处理 +- **阿里云OSS** - 对象存储服务 +- **微信支付/支付宝** - 支付集成 +- **Socket.IO** - 实时通信 +- **MQTT** - 物联网消息传输 + +## 📋 环境要求 + +### 基础环境 +- ☕ **Java 1.8+** +- 🗄️ **MySQL 8.0+** +- 🔴 **Redis 6.0+** +- 📦 **Maven 3.6+** + +### 开发工具 +- **推荐**:IntelliJ IDEA / Eclipse +- **插件**:Lombok Plugin、MyBatis Plugin + +## 🚀 快速开始 + +### 1. 克隆项目 +```bash +git clone https://github.com/websoft-top/mp-java.git +cd mp-java +``` + +### 2. 数据库配置 +```sql +-- 创建数据库 +CREATE DATABASE websoft_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- 导入数据库脚本(如果有的话) +-- source /path/to/database.sql +``` + +### 3. 配置文件 +编辑 `src/main/resources/application-dev.yml` 文件,配置数据库连接: +```yaml +spring: + datasource: + url: jdbc:mysql://localhost:3306/websoft_db?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8 + username: your_username + password: your_password + redis: + host: localhost + port: 6379 + password: your_redis_password +``` + +### 4. 启动项目 +```bash +# 使用 Maven 启动 +mvn spring-boot:run + +# 或者使用 IDE 直接运行 WebSoftApplication.java +``` + +访问 `http://localhost:9200` 即可看到API服务。 + +### 5. API文档 +启动项目后,访问以下地址查看API文档: +- Swagger UI: `http://localhost:9200/swagger-ui/index.html` +- Knife4j: `http://localhost:9200/doc.html` + +## ⚙️ 配置说明 + +### 数据库配置 +在 `application-dev.yml` 中配置数据库连接: +```yaml +spring: + datasource: + url: jdbc:mysql://localhost:3306/websoft_db + username: root + password: your_password + driver-class-name: com.mysql.cj.jdbc.Driver +``` + +### Redis配置 +```yaml +spring: + redis: + host: localhost + port: 6379 + password: your_redis_password + database: 0 +``` + +### 阿里云OSS配置 +```yaml +config: + endpoint: https://oss-cn-shenzhen.aliyuncs.com + accessKeyId: your_access_key_id + accessKeySecret: your_access_key_secret + bucketName: your_bucket_name + bucketDomain: https://your-domain.com +``` + +### 其他配置 +- **JWT密钥**:`config.token-key` 用于JWT令牌加密 +- **文件上传路径**:`config.upload-path` 本地文件存储路径 +- **邮件服务**:配置SMTP服务器用于发送邮件 + +## 🎯 核心功能 + +### 🔐 用户认证与授权 +- **JWT认证**:基于JSON Web Token的用户认证 +- **Spring Security**:完整的安全框架集成 +- **角色权限**:基于RBAC的权限控制 +- **图形验证码**:防止恶意登录 + +### 📝 内容管理系统(CMS) +- **文章管理**:支持富文本内容管理 +- **媒体文件**:图片/视频文件上传与管理 +- **分类管理**:内容分类与标签管理 +- **SEO优化**:搜索引擎优化支持 + +### 🛒 电商系统 +- **商品管理**:商品信息、规格、库存管理 +- **订单系统**:完整的订单流程管理 +- **支付集成**:支持微信支付、支付宝 +- **物流跟踪**:快递100物流查询集成 + +### 🔧 系统管理 +- **用户管理**:用户信息维护与管理 +- **系统配置**:动态配置管理 +- **日志监控**:系统操作日志记录 +- **数据备份**:数据库备份与恢复 + +### 📊 数据分析 +- **统计报表**:业务数据统计分析 +- **图表展示**:数据可视化展示 +- **导出功能**:Excel数据导出 +- **实时监控**:系统性能监控 + +## 🏗️ 项目结构 + +``` +src/main/java/com/gxwebsoft/ +├── WebSoftApplication.java # 启动类 +├── cms/ # 内容管理模块 +│ ├── controller/ # 控制器层 +│ ├── service/ # 业务逻辑层 +│ ├── mapper/ # 数据访问层 +│ └── entity/ # 实体类 +├── shop/ # 商城模块 +│ ├── controller/ +│ ├── service/ +│ ├── mapper/ +│ └── entity/ +├── common/ # 公共模块 +│ ├── core/ # 核心配置 +│ ├── utils/ # 工具类 +│ └── exception/ # 异常处理 +└── resources/ + ├── application.yml # 主配置文件 + ├── application-dev.yml # 开发环境配置 + └── application-prod.yml# 生产环境配置 +``` + +## 🔧 开发规范 + +### 代码结构 +- **Controller层**:处理HTTP请求,参数验证 +- **Service层**:业务逻辑处理,事务管理 +- **Mapper层**:数据访问,SQL映射 +- **Entity层**:数据实体,数据库表映射 + +### 命名规范 +- **类名**:使用大驼峰命名法(PascalCase) +- **方法名**:使用小驼峰命名法(camelCase) +- **常量**:使用全大写,下划线分隔 +- **包名**:使用小写字母,点分隔 + +## 📚 API文档 + +项目集成了Swagger和Knife4j,提供完整的API文档: + +### 访问地址 +- **Swagger UI**: `http://localhost:9200/swagger-ui/index.html` +- **Knife4j**: `http://localhost:9200/doc.html` + +### 主要接口模块 +- **用户认证**: `/api/auth/**` - 登录、注册、权限验证 +- **用户管理**: `/api/user/**` - 用户CRUD操作 +- **内容管理**: `/api/cms/**` - 文章、媒体文件管理 +- **商城管理**: `/api/shop/**` - 商品、订单管理 +- **系统管理**: `/api/system/**` - 系统配置、日志管理 + +## 🚀 部署指南 + +### 开发环境部署 +```bash +# 1. 启动MySQL和Redis服务 +# 2. 创建数据库并导入初始数据 +# 3. 修改配置文件 +# 4. 启动应用 +mvn spring-boot:run +``` + +### 生产环境部署 +```bash +# 1. 打包应用 +mvn clean package -Dmaven.test.skip=true + +# 2. 运行jar包 +java -jar target/com-gxwebsoft-modules-1.5.0.jar --spring.profiles.active=prod + +# 3. 使用Docker部署(可选) +docker build -t websoft-api . +docker run -d -p 9200:9200 websoft-api +``` + +## 🤝 贡献指南 + +1. Fork 本仓库 +2. 创建特性分支 (`git checkout -b feature/AmazingFeature`) +3. 提交更改 (`git commit -m 'Add some AmazingFeature'`) +4. 推送到分支 (`git push origin feature/AmazingFeature`) +5. 打开 Pull Request + +## 📄 许可证 + +本项目采用 MIT 许可证 - 查看 [LICENSE](LICENSE) 文件了解详情 + +## 📞 联系我们 + +- 官网:https://websoft.top +- 邮箱:170083662@qq.top +- QQ群:479713884 + +--- + +⭐ 如果这个项目对您有帮助,请给我们一个星标! \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..ea39557 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,105 @@ +version: '3.8' + +services: + gxwebsoft-app: + build: . + container_name: gxwebsoft-server + ports: + - "8080:8080" + environment: + - SPRING_PROFILES_ACTIVE=prod + - CERTIFICATE_LOAD_MODE=VOLUME + - CERTIFICATE_CERT_ROOT_PATH=/app/certs + - JAVA_OPTS=-Xms512m -Xmx1024m + volumes: + # 证书挂载卷 - 将主机的证书目录挂载到容器 + - ./certs:/app/certs:ro + # 日志挂载卷 + - ./logs:/app/logs + # 上传文件挂载卷 + - ./uploads:/app/uploads + networks: + - gxwebsoft-network + depends_on: + - mysql + - redis + restart: unless-stopped + healthcheck: + test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/actuator/health"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 60s + + mysql: + image: mysql:8.0 + container_name: gxwebsoft-mysql + environment: + MYSQL_ROOT_PASSWORD: root123456 + MYSQL_DATABASE: gxwebsoft + MYSQL_USER: gxwebsoft + MYSQL_PASSWORD: gxwebsoft123 + ports: + - "3306:3306" + volumes: + - mysql_data:/var/lib/mysql + - ./mysql/conf:/etc/mysql/conf.d + - ./mysql/init:/docker-entrypoint-initdb.d + networks: + - gxwebsoft-network + restart: unless-stopped + command: --default-authentication-plugin=mysql_native_password + + redis: + image: redis:6.2-alpine + container_name: gxwebsoft-redis + ports: + - "6379:6379" + volumes: + - redis_data:/data + - ./redis/redis.conf:/etc/redis/redis.conf + networks: + - gxwebsoft-network + restart: unless-stopped + command: redis-server /etc/redis/redis.conf + +networks: + gxwebsoft-network: + driver: bridge + +volumes: + mysql_data: + driver: local + redis_data: + driver: local + +# 证书目录结构说明 +# 在项目根目录创建 certs 目录,结构如下: +# ./certs/ +# ├── wechat/ +# │ ├── apiclient_key.pem # 微信支付商户私钥 +# │ ├── apiclient_cert.pem # 微信支付商户证书 +# │ └── wechatpay_cert.pem # 微信支付平台证书 +# └── alipay/ +# ├── app_private_key.pem # 支付宝应用私钥 +# ├── appCertPublicKey.crt # 支付宝应用公钥证书 +# ├── alipayCertPublicKey.crt # 支付宝公钥证书 +# └── alipayRootCert.crt # 支付宝根证书 +# +# 证书文件权限设置: +# chmod -R 444 certs/ # 设置证书文件为只读 +# chmod 755 certs/ # 设置目录权限 +# chmod 755 certs/wechat/ +# chmod 755 certs/alipay/ +# +# 启动命令: +# docker-compose up -d +# +# 查看日志: +# docker-compose logs -f gxwebsoft-app +# +# 停止服务: +# docker-compose down +# +# 重新构建并启动: +# docker-compose up -d --build diff --git a/mvnw b/mvnw new file mode 100755 index 0000000..a16b543 --- /dev/null +++ b/mvnw @@ -0,0 +1,310 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven Start Up Batch script +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# M2_HOME - location of maven2's installed home dir +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "`uname`" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + export JAVA_HOME="`/usr/libexec/java_home`" + else + export JAVA_HOME="/Library/Java/Home" + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=`java-config --jre-home` + fi +fi + +if [ -z "$M2_HOME" ] ; then + ## resolve links - $0 may be a link to maven's home + PRG="$0" + + # need this for relative symlinks + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi + done + + saveddir=`pwd` + + M2_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + M2_HOME=`cd "$M2_HOME" && pwd` + + cd "$saveddir" + # echo Using m2 at $M2_HOME +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --unix "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$M2_HOME" ] && + M2_HOME="`(cd "$M2_HOME"; pwd)`" + [ -n "$JAVA_HOME" ] && + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="`which javac`" + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=`which readlink` + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + if $darwin ; then + javaHome="`dirname \"$javaExecutable\"`" + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + else + javaExecutable="`readlink -f \"$javaExecutable\"`" + fi + javaHome="`dirname \"$javaExecutable\"`" + javaHome=`expr "$javaHome" : '\(.*\)/bin'` + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="`which java`" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=`cd "$wdir/.."; pwd` + fi + # end of workaround + done + echo "${basedir}" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' < "$1")" + fi +} + +BASE_DIR=`find_maven_basedir "$(pwd)"` +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found .mvn/wrapper/maven-wrapper.jar" + fi +else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." + fi + if [ -n "$MVNW_REPOURL" ]; then + jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + else + jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + fi + while IFS="=" read key value; do + case "$key" in (wrapperUrl) jarUrl="$value"; break ;; + esac + done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" + if [ "$MVNW_VERBOSE" = true ]; then + echo "Downloading from: $jarUrl" + fi + wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" + if $cygwin; then + wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` + fi + + if command -v wget > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found wget ... using wget" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget "$jarUrl" -O "$wrapperJarPath" + else + wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" + fi + elif command -v curl > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found curl ... using curl" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl -o "$wrapperJarPath" "$jarUrl" -f + else + curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f + fi + + else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Falling back to using Java to download" + fi + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaClass=`cygpath --path --windows "$javaClass"` + fi + if [ -e "$javaClass" ]; then + if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Compiling MavenWrapperDownloader.java ..." + fi + # Compiling the Java class + ("$JAVA_HOME/bin/javac" "$javaClass") + fi + if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + # Running the downloader + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Running MavenWrapperDownloader.java ..." + fi + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +if [ "$MVNW_VERBOSE" = true ]; then + echo $MAVEN_PROJECTBASEDIR +fi +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --path --windows "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` +fi + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" +export MAVEN_CMD_LINE_ARGS + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +exec "$JAVACMD" \ + $MAVEN_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/mvnw.cmd b/mvnw.cmd new file mode 100644 index 0000000..c8d4337 --- /dev/null +++ b/mvnw.cmd @@ -0,0 +1,182 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM https://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" +if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + +FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" +if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%" == "on" pause + +if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% + +exit /B %ERROR_CODE% diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..77b3ea5 --- /dev/null +++ b/pom.xml @@ -0,0 +1,393 @@ + + + 4.0.0 + + com.gxwebsoft + server-api + 1.0 + + server-api + WebSoftApi project for Spring Boot + + + org.springframework.boot + spring-boot-starter-parent + + 2.5.15 + + + + + 17 + 17 + 17 + UTF-8 + UTF-8 + + + + + + org.springframework.boot + spring-boot-devtools + runtime + true + + + + + org.springframework.boot + spring-boot-starter-test + test + + + + + org.springframework.boot + spring-boot-starter-web + + + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + + + + + org.springframework.boot + spring-boot-starter-aop + + + + + org.springframework.boot + spring-boot-configuration-processor + true + + + + + org.projectlombok + lombok + true + + + + + com.mysql + mysql-connector-j + 8.2.0 + runtime + + + + + com.alibaba + druid-spring-boot-starter + 1.2.20 + + + + + com.baomidou + mybatis-plus-boot-starter + 3.4.3.3 + + + + + com.github.yulichang + mybatis-plus-join-boot-starter + 1.4.5 + + + + + com.baomidou + mybatis-plus-generator + 3.4.1 + + + + + cn.hutool + hutool-core + 5.8.25 + + + cn.hutool + hutool-extra + 5.8.25 + + + cn.hutool + hutool-http + 5.8.25 + + + cn.hutool + hutool-crypto + 5.8.25 + + + + + cn.afterturn + easypoi-base + 4.4.0 + + + + + org.apache.tika + tika-core + 2.9.1 + + + + + com.github.livesense + jodconverter-core + 1.0.5 + + + + + org.springframework.boot + spring-boot-starter-mail + + + + + com.ibeetl + beetl + 3.15.10.RELEASE + + + + + io.springfox + springfox-boot-starter + 3.0.0 + + + + + org.springframework.boot + spring-boot-starter-security + + + + + io.jsonwebtoken + jjwt-api + 0.11.5 + + + io.jsonwebtoken + jjwt-impl + 0.11.5 + runtime + + + io.jsonwebtoken + jjwt-jackson + 0.11.5 + runtime + + + + + com.github.whvcse + easy-captcha + 1.6.2 + + + + + org.springframework.boot + spring-boot-starter-data-redis + + + + + org.springframework.boot + spring-boot-starter-actuator + + + + + com.aliyun + aliyun-java-sdk-core + 4.4.3 + + + + com.alipay.sdk + alipay-sdk-java + 4.35.0.ALL + + + + org.bouncycastle + bcprov-jdk18on + 1.77 + + + + commons-logging + commons-logging + 1.3.0 + + + + com.alibaba + fastjson + 2.0.43 + + + + + com.google.zxing + core + 3.5.2 + + + + + com.google.code.gson + gson + 2.10.1 + + + + com.vaadin.external.google + android-json + 0.0.20131108.vaadin1 + compile + + + + + com.corundumstudio.socketio + netty-socketio + 2.0.3 + + + + + com.github.wechatpay-apiv3 + wechatpay-java + 0.2.17 + + + + + com.github.binarywang + weixin-java-miniapp + 4.6.0 + + + + + com.aliyun.oss + aliyun-sdk-oss + 3.17.4 + + + + + com.aliyun + green20220302 + 1.0.8 + + + + org.springframework.boot + spring-boot-starter-freemarker + + + + + com.getui.push + restful-sdk + 1.0.0.14 + + + + + org.springframework.boot + spring-boot-starter-amqp + + + + + javax.annotation + javax.annotation-api + 1.3.2 + + + + + com.github.xiaoymin + knife4j-spring-boot-starter + 3.0.3 + + + + + + + + src/main/java + + **/*Mapper.xml + + + + src/main/resources + + ** + + + + + + org.springframework.boot + spring-boot-maven-plugin + 2.5.15 + + + + org.projectlombok + lombok + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 17 + 17 + + + + + + + + aliYunMaven + https://maven.aliyun.com/repository/public + + + com.e-iceblue + e-iceblue + https://repo.e-iceblue.cn/repository/maven-public/ + + + + diff --git a/src/main/java/com/gxwebsoft/WebSoftApplication.java b/src/main/java/com/gxwebsoft/WebSoftApplication.java new file mode 100644 index 0000000..80c9a42 --- /dev/null +++ b/src/main/java/com/gxwebsoft/WebSoftApplication.java @@ -0,0 +1,28 @@ +package com.gxwebsoft; + +import com.gxwebsoft.common.core.config.ConfigProperties; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.scheduling.annotation.EnableAsync; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.transaction.annotation.EnableTransactionManagement; + +/** + * 启动类 + * Created by WebSoft on 2018-02-22 11:29:03 + */ +@EnableAsync +@EnableTransactionManagement +@MapperScan("com.gxwebsoft.**.mapper") +@EnableConfigurationProperties(ConfigProperties.class) +@SpringBootApplication +@EnableScheduling +public class WebSoftApplication { + + public static void main(String[] args) { + SpringApplication.run(WebSoftApplication.class, args); + } + +} diff --git a/src/main/java/com/gxwebsoft/auto/controller/QrLoginController.java b/src/main/java/com/gxwebsoft/auto/controller/QrLoginController.java new file mode 100644 index 0000000..9535c80 --- /dev/null +++ b/src/main/java/com/gxwebsoft/auto/controller/QrLoginController.java @@ -0,0 +1,147 @@ +package com.gxwebsoft.auto.controller; + +import com.gxwebsoft.auto.dto.QrLoginBindPhoneRequest; +import com.gxwebsoft.auto.dto.QrLoginConfirmRequest; +import com.gxwebsoft.auto.dto.QrLoginGenerateResponse; +import com.gxwebsoft.auto.dto.QrLoginStatusResponse; +import com.gxwebsoft.auto.dto.WechatScanRequest; +import com.gxwebsoft.auto.dto.WechatScanResponse; +import com.gxwebsoft.auto.service.QrLoginService; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.core.web.ApiResult; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + +/** + * 认证模块 + * + * @author 科技小王子 + * @since 2025-03-06 22:50:25 + */ +@Tag(name = "认证模块") +@RestController +@RequestMapping("/api/qr-login") +public class QrLoginController extends BaseController { + + @Autowired + private QrLoginService qrLoginService; + + @Autowired + private com.gxwebsoft.common.system.service.WxService wxService; + + @Autowired + private javax.servlet.http.HttpServletRequest request; + + /** + * 生成扫码登录token + */ + @Operation(summary = "生成扫码登录token") + @PostMapping("/generate") + public ApiResult generateQrLoginToken() { + try { + QrLoginGenerateResponse response = qrLoginService.generateQrLoginToken(getTenantId()); + return success("生成成功", response); + } catch (Exception e) { + return fail(e.getMessage()); + } + } + + /** + * 检查扫码登录状态 + */ + @Operation(summary = "检查扫码登录状态") + @GetMapping("/status/{token}") + public ApiResult checkQrLoginStatus( + @Parameter(description = "扫码登录token") @PathVariable String token) { + try { + QrLoginStatusResponse response = qrLoginService.checkQrLoginStatus(token); + return success("查询成功", response); + } catch (Exception e) { + return fail(e.getMessage()); + } + } + + /** + * 确认扫码登录 + */ + @Operation(summary = "确认扫码登录") + @PostMapping("/confirm") + public ApiResult confirmQrLogin(@Valid @RequestBody QrLoginConfirmRequest request) { + try { + QrLoginStatusResponse response = qrLoginService.confirmQrLogin(request); + return success("确认成功", response); + } catch (Exception e) { + return fail(e.getMessage()); + } + } + + /** + * 扫码操作(可选接口,用于移动端扫码后更新状态) + */ + @Operation(summary = "扫码操作") + @PostMapping("/scan/{token}") + public ApiResult scanQrCode(@Parameter(description = "扫码登录token") @PathVariable String token) { + try { + boolean result = qrLoginService.scanQrCode(token); + return success("操作成功", result); + } catch (Exception e) { + return fail(e.getMessage()); + } + } + + /** + * 公众号关注注册后绑定手机号 + */ + @Operation(summary = "绑定手机号并完成扫码登录") + @PostMapping("/bind-phone") + public ApiResult bindPhone(@Valid @RequestBody QrLoginBindPhoneRequest request) { + try { + QrLoginStatusResponse response = qrLoginService.bindPhone(request); + return success("绑定成功", response); + } catch (Exception e) { + return fail(e.getMessage()); + } + } + + /** + * 微信扫码登录确认(H5页面调用) + */ + @Operation(summary = "微信扫码登录确认") + @PostMapping("/wechat-scan") + public ApiResult wechatScanConfirm(@Valid @RequestBody WechatScanRequest request) { + try { + WechatScanResponse response = qrLoginService.wechatScanConfirm(request); + return success("操作成功", response); + } catch (Exception e) { + return fail(e.getMessage()); + } + } + + /** + * 获取微信网页授权 URL(用于 H5 扫码页面重定向) + */ + @Operation(summary = "获取微信网页授权URL") + @GetMapping("/wechat-oauth-url") + public ApiResult getWechatOAuthUrl(@Parameter(description = "扫码登录token") @RequestParam String token) { + try { + String appId = wxService.getOfficialAppId(getTenantId()); + // 回调地址,指向 H5 扫码确认页面 + String redirectUri = java.net.URLEncoder.encode( + "https://" + request.getHeader("Host") + "/wx-scan?token=" + token, + java.nio.charset.StandardCharsets.UTF_8); + // 构造微信 OAuth 授权 URL + String oauthUrl = String.format( + "https://open.weixin.qq.com/connect/oauth2/authorize?appid=%s&redirect_uri=%s&response_type=code&scope=snsapi_userinfo&state=%s#wechat_redirect", + appId, redirectUri, token); + return success("获取成功", oauthUrl); + } catch (Exception e) { + return fail(e.getMessage()); + } + } + +} diff --git a/src/main/java/com/gxwebsoft/auto/dto/QrLoginBindPhoneRequest.java b/src/main/java/com/gxwebsoft/auto/dto/QrLoginBindPhoneRequest.java new file mode 100644 index 0000000..ccdfb40 --- /dev/null +++ b/src/main/java/com/gxwebsoft/auto/dto/QrLoginBindPhoneRequest.java @@ -0,0 +1,30 @@ +package com.gxwebsoft.auto.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * 扫码登录绑定手机号请求 + * + * @author 科技小王子 + * @since 2026-04-06 + */ +@Data +@Schema(description = "扫码登录绑定手机号请求") +public class QrLoginBindPhoneRequest { + + @Schema(description = "扫码登录token") + @NotBlank(message = "token不能为空") + private String token; + + @Schema(description = "手机号") + @NotBlank(message = "手机号不能为空") + private String phone; + + @Schema(description = "短信验证码") + @NotBlank(message = "验证码不能为空") + private String code; + +} diff --git a/src/main/java/com/gxwebsoft/auto/dto/QrLoginConfirmRequest.java b/src/main/java/com/gxwebsoft/auto/dto/QrLoginConfirmRequest.java new file mode 100644 index 0000000..73244f0 --- /dev/null +++ b/src/main/java/com/gxwebsoft/auto/dto/QrLoginConfirmRequest.java @@ -0,0 +1,25 @@ +package com.gxwebsoft.auto.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * 扫码登录确认请求 + * + * @author 科技小王子 + * @since 2025-08-31 + */ +@Data +@Schema(description = "扫码登录确认请求") +public class QrLoginConfirmRequest { + + @Schema(description = "扫码登录token") + @NotBlank(message = "token不能为空") + private String token; + + @Schema(description = "用户ID") + private Integer userId; + +} diff --git a/src/main/java/com/gxwebsoft/auto/dto/QrLoginData.java b/src/main/java/com/gxwebsoft/auto/dto/QrLoginData.java new file mode 100644 index 0000000..69b131b --- /dev/null +++ b/src/main/java/com/gxwebsoft/auto/dto/QrLoginData.java @@ -0,0 +1,68 @@ +package com.gxwebsoft.auto.dto; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 扫码登录数据模型 + * + * @author 科技小王子 + * @since 2025-08-31 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class QrLoginData { + + /** + * 扫码登录token + */ + private String token; + + /** + * 状态: pending-等待扫码, scanned-已扫码, confirmed-已确认, bind_phone-待绑定手机号, expired-已过期 + */ + private String status; + + /** + * 用户ID(扫码确认后设置) + */ + private Integer userId; + + /** + * 用户名(扫码确认后设置) + */ + private String username; + + /** + * 创建时间 + */ + private String createTime; + + /** + * 过期时间 + */ + private String expireTime; + + /** + * JWT访问令牌(确认后生成) + */ + private String accessToken; + + /** + * 租户ID + */ + private Integer tenantId; + + /** + * 是否需要绑定手机号 + */ + private Boolean needBindPhone; + + /** + * 状态提示信息 + */ + private String message; + +} diff --git a/src/main/java/com/gxwebsoft/auto/dto/QrLoginGenerateResponse.java b/src/main/java/com/gxwebsoft/auto/dto/QrLoginGenerateResponse.java new file mode 100644 index 0000000..5837631 --- /dev/null +++ b/src/main/java/com/gxwebsoft/auto/dto/QrLoginGenerateResponse.java @@ -0,0 +1,54 @@ +package com.gxwebsoft.auto.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 扫码登录生成响应 + * + * @author 科技小王子 + * @since 2025-08-31 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@Schema(description = "扫码登录生成响应") +public class QrLoginGenerateResponse { + + @Schema(description = "扫码登录token") + private String token; + + @Schema(description = "二维码内容(APP扫码使用)") + private String qrCodeContent; + + @Schema(description = "微信小程序页面路径") + private String miniprogramPath; + + @Schema(description = "微信小程序码图片URL(已废弃,改用base64)") + private String miniprogramQrCodeUrl; + + @Schema(description = "微信小程序码图片Base64(扫码后直接打开小程序,优先使用)") + private String miniprogramQrCode; + + @Schema(description = "过期时间(秒)") + private Long expiresIn; + + @Schema(description = "微信扫码登录H5页面URL") + private String wechatScanUrl; + + @Schema(description = "微信公众号AppID") + private String wechatAppId; + + @Schema(description = "微信公众号带参数二维码图片URL") + private String wechatQrCodeUrl; + + // 保持向后兼容的构造函数 + public QrLoginGenerateResponse(String token, String qrCodeContent, Long expiresIn) { + this.token = token; + this.qrCodeContent = qrCodeContent; + this.expiresIn = expiresIn; + } + +} diff --git a/src/main/java/com/gxwebsoft/auto/dto/QrLoginStatusResponse.java b/src/main/java/com/gxwebsoft/auto/dto/QrLoginStatusResponse.java new file mode 100644 index 0000000..b833615 --- /dev/null +++ b/src/main/java/com/gxwebsoft/auto/dto/QrLoginStatusResponse.java @@ -0,0 +1,57 @@ +package com.gxwebsoft.auto.dto; + +import com.gxwebsoft.common.system.entity.User; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 扫码登录状态响应 + * + * @author 科技小王子 + * @since 2025-08-31 + */ +@Data +@NoArgsConstructor +@Schema(description = "扫码登录状态响应") +public class QrLoginStatusResponse { + + @Schema(description = "状态: pending-等待扫码, scanned-已扫码, confirmed-已确认, bind_phone-待绑定手机号, expired-已过期") + private String status; + + @Schema(description = "JWT访问令牌(仅在confirmed状态时返回)") + private String accessToken; + + @Schema(description = "用户信息") + private User userInfo; + + @Schema(description = "剩余过期时间(秒)") + private Long expiresIn; + + @Schema(description = "租户ID") + private Integer tenantId; + + @Schema(description = "是否需要绑定手机号") + private Boolean needBindPhone; + + @Schema(description = "状态提示信息") + private String message; + + @Schema(description = "下一步操作:bind_phone-绑定手机号, redirect-跳转, login-直接登录") + private String nextAction; + + @Schema(description = "跳转URL(当nextAction为redirect时使用)") + private String redirectUrl; + + @Schema(description = "成功消息") + private String successMessage; + + public QrLoginStatusResponse(String status, String accessToken, User userInfo, Long expiresIn, Integer tenantId) { + this.status = status; + this.accessToken = accessToken; + this.userInfo = userInfo; + this.expiresIn = expiresIn; + this.tenantId = tenantId; + } + +} diff --git a/src/main/java/com/gxwebsoft/auto/dto/WechatScanRequest.java b/src/main/java/com/gxwebsoft/auto/dto/WechatScanRequest.java new file mode 100644 index 0000000..b8cc295 --- /dev/null +++ b/src/main/java/com/gxwebsoft/auto/dto/WechatScanRequest.java @@ -0,0 +1,31 @@ +package com.gxwebsoft.auto.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * 微信扫码登录请求(用于 H5 页面回调) + * + * @author 科技小王子 + * @since 2026-04-06 + */ +@Data +@Schema(description = "微信扫码登录请求") +public class WechatScanRequest { + + @Schema(description = "扫码登录token") + @NotBlank(message = "token不能为空") + private String token; + + @Schema(description = "微信公众号授权code") + private String code; + + @Schema(description = "微信unionId(如果已获取)") + private String unionId; + + @Schema(description = "微信openId") + private String openId; + +} diff --git a/src/main/java/com/gxwebsoft/auto/dto/WechatScanResponse.java b/src/main/java/com/gxwebsoft/auto/dto/WechatScanResponse.java new file mode 100644 index 0000000..36a21ac --- /dev/null +++ b/src/main/java/com/gxwebsoft/auto/dto/WechatScanResponse.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.auto.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 微信扫码登录响应 + * + * @author 科技小王子 + * @since 2026-04-06 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@Schema(description = "微信扫码登录响应") +public class WechatScanResponse { + + @Schema(description = "状态:success-登录成功,bind_required-需要绑定账号,not_bound-账号未绑定") + private String status; + + @Schema(description = "JWT访问令牌") + private String accessToken; + + @Schema(description = "用户信息") + private Object userInfo; + + @Schema(description = "提示信息") + private String message; + + @Schema(description = "租户ID") + private Integer tenantId; + + public static WechatScanResponse success(String accessToken, Object userInfo, Integer tenantId) { + return new WechatScanResponse("success", accessToken, userInfo, "登录成功", tenantId); + } + + public static WechatScanResponse needBind(String message) { + return new WechatScanResponse("bind_required", null, null, message, null); + } + + public static WechatScanResponse notBound(String message) { + return new WechatScanResponse("not_bound", null, null, message, null); + } + +} diff --git a/src/main/java/com/gxwebsoft/auto/service/QrLoginService.java b/src/main/java/com/gxwebsoft/auto/service/QrLoginService.java new file mode 100644 index 0000000..538bed5 --- /dev/null +++ b/src/main/java/com/gxwebsoft/auto/service/QrLoginService.java @@ -0,0 +1,65 @@ +package com.gxwebsoft.auto.service; + +import com.gxwebsoft.auto.dto.QrLoginBindPhoneRequest; +import com.gxwebsoft.auto.dto.QrLoginConfirmRequest; +import com.gxwebsoft.auto.dto.QrLoginGenerateResponse; +import com.gxwebsoft.auto.dto.QrLoginStatusResponse; +import com.gxwebsoft.auto.dto.WechatScanRequest; +import com.gxwebsoft.auto.dto.WechatScanResponse; + +/** + * 扫码登录服务接口 + * + * @author 科技小王子 + * @since 2025-08-31 + */ +public interface QrLoginService { + + /** + * 生成扫码登录token + * + * @return QrLoginGenerateResponse + */ + QrLoginGenerateResponse generateQrLoginToken(Integer tenantId); + + /** + * 检查扫码登录状态 + * + * @param token 扫码登录token + * @return QrLoginStatusResponse + */ + QrLoginStatusResponse checkQrLoginStatus(String token); + + /** + * 确认扫码登录 + * + * @param request 确认请求 + * @return QrLoginStatusResponse + */ + QrLoginStatusResponse confirmQrLogin(QrLoginConfirmRequest request); + + /** + * 扫码操作(更新状态为已扫码) + * + * @param token 扫码登录token + * @return boolean + */ + boolean scanQrCode(String token); + + /** + * 关注后绑定手机号并完成登录 + * + * @param request 绑定手机号请求 + * @return QrLoginStatusResponse + */ + QrLoginStatusResponse bindPhone(QrLoginBindPhoneRequest request); + + /** + * 微信扫码登录确认(H5页面调用) + * + * @param request 微信扫码登录请求 + * @return WechatScanResponse + */ + WechatScanResponse wechatScanConfirm(WechatScanRequest request); + +} diff --git a/src/main/java/com/gxwebsoft/auto/service/impl/QrLoginServiceImpl.java b/src/main/java/com/gxwebsoft/auto/service/impl/QrLoginServiceImpl.java new file mode 100644 index 0000000..4cd3e76 --- /dev/null +++ b/src/main/java/com/gxwebsoft/auto/service/impl/QrLoginServiceImpl.java @@ -0,0 +1,645 @@ +package com.gxwebsoft.auto.service.impl; + +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.lang.UUID; +import cn.hutool.core.util.DesensitizedUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import cn.hutool.http.HttpUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.gxwebsoft.auto.dto.*; +import com.gxwebsoft.auto.service.QrLoginService; +import com.gxwebsoft.common.core.config.ConfigProperties; +import com.gxwebsoft.common.core.security.JwtSubject; +import com.gxwebsoft.common.core.security.JwtUtil; +import com.gxwebsoft.common.core.utils.CommonUtil; +import com.gxwebsoft.common.core.utils.RedisUtil; +import com.gxwebsoft.common.mq.producer.SyncMessageProducer; +import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.common.system.entity.UserOauth; +import com.gxwebsoft.common.system.service.UserOauthService; +import com.gxwebsoft.common.system.service.UserService; +import com.gxwebsoft.common.system.service.WxService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import java.util.Date; +import java.util.HashMap; +import java.util.concurrent.TimeUnit; + +import static com.gxwebsoft.common.core.constants.PlatformConstants.MP_OFFICIAL; +import static com.gxwebsoft.common.core.constants.RedisConstants.*; +import static com.gxwebsoft.common.core.constants.WebsiteConstants.CACHE_KEY_VERIFICATION_CODE_BY_DEV_SMS; + +/** + * 扫码登录服务实现 + * + * @author 科技小王子 + * @since 2025-08-31 + */ +@Slf4j +@Service +public class QrLoginServiceImpl implements QrLoginService { + + @Autowired + private RedisUtil redisUtil; + + @Autowired + private UserService userService; + + @Autowired + private ConfigProperties configProperties; + + @Autowired + private WxService wxService; + + @Autowired(required = false) + private UserOauthService userOauthService; + + @Autowired(required = false) + private SyncMessageProducer syncMessageProducer; + + @Override + public QrLoginGenerateResponse generateQrLoginToken(Integer tenantId) { + String token = UUID.randomUUID().toString(true); + + QrLoginData qrLoginData = new QrLoginData(); + qrLoginData.setToken(token); + qrLoginData.setStatus(QR_LOGIN_STATUS_PENDING); + qrLoginData.setTenantId(tenantId); + qrLoginData.setNeedBindPhone(false); + qrLoginData.setMessage("等待微信扫码"); + qrLoginData.setCreateTime(DateUtil.formatDateTime(DateUtil.date())); + qrLoginData.setExpireTime(DateUtil.formatDateTime(DateUtil.offsetSecond(DateUtil.date(), QR_LOGIN_TOKEN_TTL.intValue()))); + + String redisKey = QR_LOGIN_TOKEN_KEY + token; + redisUtil.set(redisKey, qrLoginData, QR_LOGIN_TOKEN_TTL, TimeUnit.SECONDS); + + log.info("生成扫码登录token: {}", token); + + QrLoginGenerateResponse response = new QrLoginGenerateResponse(); + response.setToken(token); + response.setExpiresIn(QR_LOGIN_TOKEN_TTL); + // 二维码内容:使用自定义协议,前端据此生成base64二维码 + response.setQrCodeContent("websopy://login?token=" + token); + // 小程序路径(用于小程序扫码直接打开) + response.setMiniprogramPath("/pages/qr-login?token=" + token); + + // 扫码跳转URL(前端生成二维码时使用此URL) + try { + String baseUrl = configProperties.getWechatScanUrl(); + if (StrUtil.isBlank(baseUrl)) { + baseUrl = "https://websopy.websoft.top"; + } + String wechatScanUrl = baseUrl + "/wx-scan?token=" + token; + response.setWechatScanUrl(wechatScanUrl); + log.info("扫码跳转URL: {}", wechatScanUrl); + } catch (Exception e) { + log.warn("获取扫码跳转URL失败: {}", e.getMessage()); + // 降级:使用默认域名 + response.setWechatScanUrl("https://websopy.websoft.top/wx-scan?token=" + token); + } + + // 生成小程序码(通过微信API生成小程序码,返回Base64图片,扫码后直接打开小程序确认页面) + try { + String miniprogramQrCodeBase64 = generateMiniprogramQrCode(token, tenantId); + if (StrUtil.isNotBlank(miniprogramQrCodeBase64)) { + response.setMiniprogramQrCode(miniprogramQrCodeBase64); + log.info("生成小程序码成功(Base64,长度: {})", miniprogramQrCodeBase64.length()); + } + } catch (Exception e) { + log.error("生成小程序码失败: {}", e.getMessage(), e); + // 生成失败不影响主流程,继续使用H5方式 + } + + return response; + } + + /** + * 生成小程序码(用于PC端扫码登录) + * 调用微信API生成无限制小程序码,返回Base64图片,扫码后直接打开小程序确认页面 + * 具备自动重试机制:首次失败后清理缓存并重试一次 + * + * @param token 扫码登录token + * @param tenantId 租户ID + * @return 小程序码图片Base64字符串 + */ + private String generateMiniprogramQrCode(String token, Integer tenantId) { + // 构建 access_token 的 Redis key(与 WxService 保持一致) + String accessTokenKey = "WX_ACCESS_TOKEN:" + (tenantId != null ? tenantId : 10048); + + // 第一次尝试生成 + String result = doGenerateMiniprogramQrCode(token, tenantId, accessTokenKey, false); + if (result != null) { + return result; + } + + // 第一次失败,清理缓存并重试(确保下次能拿到最新的 access_token) + log.info("小程序码首次生成失败,清理缓存后重试..."); + clearAccessTokenCache(accessTokenKey, tenantId); + + // 第二次尝试生成(强制刷新 token) + return doGenerateMiniprogramQrCode(token, tenantId, accessTokenKey, true); + } + + /** + * 执行小程序码生成 + * + * @param token 扫码登录token + * @param tenantId 租户ID + * @param accessTokenKey access_token 的 Redis key + * @param forceRefresh 是否强制刷新 access_token + * @return 小程序码 Base64 字符串,失败返回 null + */ + private String doGenerateMiniprogramQrCode(String token, Integer tenantId, String accessTokenKey, boolean forceRefresh) { + try { + // 获取小程序access_token + String accessToken = forceRefresh + ? wxService.getAccessTokenForcibly(tenantId) // 强制从微信获取新token + : wxService.getAccessToken(tenantId); + + if (StrUtil.isBlank(accessToken)) { + log.warn("获取小程序access_token失败,跳过生成小程序码"); + return null; + } + + // 调用微信API生成小程序码 + String apiUrl = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=" + accessToken; + + HashMap params = new HashMap<>(); + // scene 必须是字符串,最大 32 字符,直接传 token(32位UUID)刚好满足限制 + // 小程序端通过 router.params.scene 获取此 token + params.put("scene", token); + params.put("page", "passport/qr-confirm/index"); // 小程序确认页面路径(子包) + params.put("env_version", "release"); // release/trial/develop + params.put("width", 280); // 二维码宽度 + params.put("auto_color", false); // 不自动配置颜色 + + // 发送请求并获取二进制响应 + byte[] imageBytes = HttpRequest.post(apiUrl) + .body(JSON.toJSONString(params)) + .timeout(15000) + .execute().bodyBytes(); + + // 判断是否返回图片(二进制)或错误(JSON) + if (imageBytes == null || imageBytes.length == 0) { + log.error("生成小程序码API返回空数据"); + return null; + } + + // 检查是否返回JSON错误(微信API错误时会返回JSON) + if (imageBytes.length < 100 && new String(imageBytes).startsWith("{")) { + JSONObject errorResult = JSON.parseObject(new String(imageBytes)); + Integer errCode = errorResult.getInteger("errcode"); + String errMsg = errorResult.getString("errmsg"); + + log.error("生成小程序码API返回错误[{}:{}]", errCode, errMsg); + return null; + } + + // 将图片字节数组转换为Base64字符串 + String base64Image = cn.hutool.core.codec.Base64.encode(imageBytes); + // 添加Data URI前缀,使前端可以直接使用 + return "data:image/png;base64," + base64Image; + } catch (Exception e) { + log.error("生成小程序码异常: {}", e.getMessage(), e); + return null; + } + } + + /** + * 判断是否是 token 相关的错误码,需要清理缓存 + * 常见微信 API 错误码: + * - 40001: 获取access_token时AppSecret错误 + * - 40013: appid无效 + * - 40125: appsecret无效 + * - 42001: access_token超时 + * - 42002: refresh_token超时 + * - 42003: code超时 + * - 44002: post body太长 + * - 44003: 图片太大 + * - 41002: appid不正确 + * - 41008: 缺少access_token参数 + */ + private boolean isTokenRelatedError(Integer errCode, String errMsg) { + if (errCode == null) { + return false; + } + // token 相关错误码 + return errCode == 40001 // AppSecret错误 + || errCode == 40013 // appid无效 + || errCode == 40125 // appsecret无效 + || errCode == 42001 // access_token超时 + || errCode == 42002 // refresh_token超时 + || errCode == 42003 // code超时 + || errCode == 41002 // appid不正确 + || errCode == 41008 // 缺少access_token参数 + || errCode == 40014 // 不合法的access_token + || errCode == 40097; // invalid page + } + + /** + * 清理 access_token 缓存 + */ + private void clearAccessTokenCache(String accessTokenKey, Integer tenantId) { + try { + redisUtil.delete(accessTokenKey); + log.info("清理微信access_token缓存[{}], tenantId={}", accessTokenKey, tenantId); + } catch (Exception e) { + log.error("清理access_token缓存失败: {}", e.getMessage()); + } + } + + @Override + public QrLoginStatusResponse checkQrLoginStatus(String token) { + if (StrUtil.isBlank(token)) { + return buildExpiredResponse(); + } + + String redisKey = QR_LOGIN_TOKEN_KEY + token; + QrLoginData qrLoginData = redisUtil.get(redisKey, QrLoginData.class); + if (qrLoginData == null) { + return buildExpiredResponse(); + } + + Date expireAt = parseExpireTime(qrLoginData.getExpireTime()); + if (expireAt == null || DateUtil.date().after(expireAt)) { + redisUtil.delete(redisKey); + return buildExpiredResponse(); + } + + long expiresIn = calculateExpiresIn(expireAt); + + if (QR_LOGIN_STATUS_CONFIRMED.equals(qrLoginData.getStatus()) + && StrUtil.isBlank(qrLoginData.getAccessToken()) + && qrLoginData.getUserId() != null) { + try { + User user = userService.getAllByUserId(String.valueOf(qrLoginData.getUserId())); + if (user != null) { + qrLoginData.setUsername(user.getUsername()); + if (StrUtil.isBlank(user.getPhone())) { + qrLoginData.setStatus(QR_LOGIN_STATUS_BIND_PHONE); + qrLoginData.setNeedBindPhone(true); + qrLoginData.setAccessToken(null); + qrLoginData.setMessage("请先绑定手机号完成登录"); + } else { + qrLoginData.setStatus(QR_LOGIN_STATUS_CONFIRMED); + qrLoginData.setNeedBindPhone(false); + qrLoginData.setAccessToken(buildAccessToken(user)); + qrLoginData.setMessage(StrUtil.blankToDefault(qrLoginData.getMessage(), "登录成功")); + } + long refreshedTtl = Math.max(expiresIn, 120L); + persistQrLoginData(redisKey, qrLoginData, refreshedTtl, true); + expiresIn = refreshedTtl; + } + } catch (Exception e) { + log.error("补全扫码登录状态失败,token={}", token, e); + } + } + + return buildStatusResponse(qrLoginData, expiresIn); + } + + @Override + public QrLoginStatusResponse confirmQrLogin(QrLoginConfirmRequest request) { + String token = request.getToken(); + Integer userId = request.getUserId(); + + if (StrUtil.isBlank(token) || userId == null) { + throw new RuntimeException("参数不能为空"); + } + + String redisKey = QR_LOGIN_TOKEN_KEY + token; + QrLoginData qrLoginData = redisUtil.get(redisKey, QrLoginData.class); + if (qrLoginData == null) { + throw new RuntimeException("扫码登录token不存在或已过期"); + } + + Date expireAt = parseExpireTime(qrLoginData.getExpireTime()); + if (expireAt == null || DateUtil.date().after(expireAt)) { + redisUtil.delete(redisKey); + throw new RuntimeException("扫码登录token已过期"); + } + + User user = userService.getAllByUserId(String.valueOf(userId)); + if (user == null) { + throw new RuntimeException("用户不存在"); + } + if (user.getStatus() != null && user.getStatus() != 0) { + throw new RuntimeException("用户已被冻结"); + } + + String accessToken = buildAccessToken(user); + qrLoginData.setStatus(QR_LOGIN_STATUS_CONFIRMED); + qrLoginData.setUserId(userId); + qrLoginData.setUsername(user.getUsername()); + qrLoginData.setAccessToken(accessToken); + qrLoginData.setTenantId(user.getTenantId()); + qrLoginData.setNeedBindPhone(false); + qrLoginData.setMessage("登录成功"); + persistQrLoginData(redisKey, qrLoginData, 120L, true); + + log.info("用户 {} 确认扫码登录,token: {}", user.getUsername(), token); + return buildStatusResponse(qrLoginData, 120L); + } + + @Override + public boolean scanQrCode(String token) { + if (StrUtil.isBlank(token)) { + return false; + } + + String redisKey = QR_LOGIN_TOKEN_KEY + token; + QrLoginData qrLoginData = redisUtil.get(redisKey, QrLoginData.class); + if (qrLoginData == null) { + return false; + } + + Date expireAt = parseExpireTime(qrLoginData.getExpireTime()); + if (expireAt == null || DateUtil.date().after(expireAt)) { + redisUtil.delete(redisKey); + return false; + } + + if (QR_LOGIN_STATUS_PENDING.equals(qrLoginData.getStatus())) { + qrLoginData.setStatus(QR_LOGIN_STATUS_SCANNED); + qrLoginData.setMessage("已识别扫码,等待公众号回调"); + long remainingSeconds = Math.max(1L, + (expireAt.getTime() - DateUtil.date().getTime()) / 1000); + redisUtil.set(redisKey, qrLoginData, remainingSeconds, TimeUnit.SECONDS); + log.info("扫码登录token {} 状态更新为已扫码", token); + return true; + } + + return false; + } + + @Override + public QrLoginStatusResponse bindPhone(QrLoginBindPhoneRequest request) { + if (request == null || StrUtil.isBlank(request.getToken()) || StrUtil.isBlank(request.getPhone()) || StrUtil.isBlank(request.getCode())) { + throw new RuntimeException("参数不能为空"); + } + if (!CommonUtil.isValidPhoneNumber(request.getPhone())) { + throw new RuntimeException("请输入有效的手机号码"); + } + + String redisKey = QR_LOGIN_TOKEN_KEY + request.getToken(); + QrLoginData qrLoginData = redisUtil.get(redisKey, QrLoginData.class); + if (qrLoginData == null) { + throw new RuntimeException("二维码已过期,请刷新后重试"); + } + Date expireAt = parseExpireTime(qrLoginData.getExpireTime()); + if (expireAt == null || DateUtil.date().after(expireAt)) { + redisUtil.delete(redisKey); + throw new RuntimeException("二维码已过期,请刷新后重试"); + } + if (!QR_LOGIN_STATUS_BIND_PHONE.equals(qrLoginData.getStatus()) && !Boolean.TRUE.equals(qrLoginData.getNeedBindPhone())) { + throw new RuntimeException("当前二维码无需绑定手机号"); + } + if (qrLoginData.getUserId() == null) { + throw new RuntimeException("绑定账号不存在,请重新扫码"); + } + + String codeKey = "code:" + request.getPhone(); + String smsCode = redisUtil.get(codeKey); + String devCode = redisUtil.get(CACHE_KEY_VERIFICATION_CODE_BY_DEV_SMS); + if (StrUtil.isBlank(smsCode) && StrUtil.isBlank(devCode)) { + throw new RuntimeException("验证码已过期,请重新获取"); + } + if (!StrUtil.equals(request.getCode(), smsCode) && !StrUtil.equals(request.getCode(), devCode)) { + throw new RuntimeException("验证码不正确"); + } + + User user = userService.getAllByUserId(String.valueOf(qrLoginData.getUserId())); + if (user == null) { + throw new RuntimeException("用户不存在"); + } + if (user.getStatus() != null && user.getStatus() != 0) { + throw new RuntimeException("账号已被冻结"); + } + + User existed = userService.getByPhone(request.getPhone()); + if (existed != null && !existed.getUserId().equals(user.getUserId())) { + throw new RuntimeException("该手机号已绑定其他账号"); + } + + user.setPhone(request.getPhone()); + if (StrUtil.isBlank(user.getNickname()) || "微信公众号用户".equals(user.getNickname())) { + user.setNickname(DesensitizedUtil.mobilePhone(request.getPhone())); + } + if (StrUtil.isBlank(user.getUsername()) || user.getUsername().startsWith("wxoff_")) { + user.setUsername(request.getPhone()); + } + userService.updateUser(user); + redisUtil.delete(codeKey); + + // 绑定手机号成功后,通过MQ异步同步用户数据到 websopy + if (syncMessageProducer != null) { + User updatedUser = userService.getAllByUserId(String.valueOf(user.getUserId())); + if (updatedUser != null) { + syncMessageProducer.sendUserSyncMessage("websopy", "UPDATE", updatedUser); + log.info("扫码绑定手机号后发送MQ消息同步用户到websopy: userId={}, phone={}", user.getUserId(), user.getPhone()); + } + } + + String accessToken = buildAccessToken(user); + qrLoginData.setStatus(QR_LOGIN_STATUS_CONFIRMED); + qrLoginData.setUserId(user.getUserId()); + qrLoginData.setUsername(user.getUsername()); + qrLoginData.setTenantId(user.getTenantId()); + qrLoginData.setAccessToken(accessToken); + qrLoginData.setNeedBindPhone(false); + qrLoginData.setMessage("手机号绑定成功,正在登录"); + persistQrLoginData(redisKey, qrLoginData, 120L, true); + + return buildStatusResponse(qrLoginData, 120L); + } + + private String buildAccessToken(User user) { + JwtSubject jwtSubject = new JwtSubject(user.getUsername(), user.getTenantId()); + return JwtUtil.buildToken(jwtSubject, configProperties.getTokenExpireTime(), configProperties.getTokenKey()); + } + + private Date parseExpireTime(String expireTime) { + if (StrUtil.isBlank(expireTime)) { + return null; + } + try { + return DateUtil.parseDateTime(expireTime); + } catch (Exception e) { + log.warn("扫码登录 expireTime 解析失败: {}", expireTime, e); + return null; + } + } + + private long calculateExpiresIn(Date expireAt) { + if (expireAt == null) { + return 0L; + } + return Math.max(0L, (expireAt.getTime() - DateUtil.date().getTime()) / 1000); + } + + private void persistQrLoginData(String redisKey, QrLoginData qrLoginData, long ttlSeconds, boolean refreshExpireTime) { + if (refreshExpireTime) { + qrLoginData.setExpireTime(DateUtil.formatDateTime(DateUtil.offsetSecond(DateUtil.date(), (int) ttlSeconds))); + } + redisUtil.set(redisKey, qrLoginData, ttlSeconds, TimeUnit.SECONDS); + } + + private QrLoginStatusResponse buildExpiredResponse() { + QrLoginStatusResponse response = new QrLoginStatusResponse(QR_LOGIN_STATUS_EXPIRED, null, null, 0L, null); + response.setNeedBindPhone(false); + response.setMessage("二维码已过期,请刷新后重试"); + return response; + } + + private QrLoginStatusResponse buildStatusResponse(QrLoginData qrLoginData, Long expiresIn) { + QrLoginStatusResponse response = new QrLoginStatusResponse(); + response.setStatus(qrLoginData.getStatus()); + response.setAccessToken(qrLoginData.getAccessToken()); + response.setExpiresIn(expiresIn); + response.setTenantId(qrLoginData.getTenantId()); + response.setNeedBindPhone(Boolean.TRUE.equals(qrLoginData.getNeedBindPhone()) + || QR_LOGIN_STATUS_BIND_PHONE.equals(qrLoginData.getStatus())); + response.setMessage(qrLoginData.getMessage()); + + // 设置下一步操作逻辑 + if (QR_LOGIN_STATUS_BIND_PHONE.equals(qrLoginData.getStatus()) || Boolean.TRUE.equals(qrLoginData.getNeedBindPhone())) { + response.setNextAction("bind_phone"); + response.setRedirectUrl(null); + } else if (QR_LOGIN_STATUS_CONFIRMED.equals(qrLoginData.getStatus()) && StrUtil.isNotBlank(qrLoginData.getAccessToken())) { + response.setNextAction("redirect"); + response.setRedirectUrl("/console"); + response.setSuccessMessage("登录成功,即将跳转到控制台"); + } else { + response.setNextAction("wait"); + } + + if (qrLoginData.getUserId() != null) { + try { + User user = userService.getAllByUserId(String.valueOf(qrLoginData.getUserId())); + if (user != null) { + user.setPassword(null); + response.setUserInfo(user); + } + } catch (Exception e) { + log.error("构建扫码登录状态响应时查询用户失败,userId={}", qrLoginData.getUserId(), e); + } + } + return response; + } + + @Override + public WechatScanResponse wechatScanConfirm(WechatScanRequest request) { + String token = request.getToken(); + if (StrUtil.isBlank(token)) { + return WechatScanResponse.notBound("二维码参数错误"); + } + + String redisKey = QR_LOGIN_TOKEN_KEY + token; + QrLoginData qrLoginData = redisUtil.get(redisKey, QrLoginData.class); + if (qrLoginData == null) { + return WechatScanResponse.notBound("二维码已过期,请刷新重试"); + } + Date expireAt = parseExpireTime(qrLoginData.getExpireTime()); + if (expireAt == null || DateUtil.date().after(expireAt)) { + redisUtil.delete(redisKey); + return WechatScanResponse.notBound("二维码已过期,请刷新重试"); + } + + String unionId = request.getUnionId(); + String openId = request.getOpenId(); + Integer tenantId = qrLoginData.getTenantId(); + + if (StrUtil.isBlank(unionId) && StrUtil.isNotBlank(request.getCode())) { + try { + JSONObject userAccessToken = wxService.getOfficialUserAccessToken(request.getCode(), tenantId); + unionId = userAccessToken.getString("unionid"); + openId = userAccessToken.getString("openid"); + log.info("通过授权码获取到 unionId: {}, openId: {}", unionId, openId); + } catch (Exception e) { + log.error("通过授权码获取用户信息失败: {}", e.getMessage()); + return WechatScanResponse.notBound("微信授权失败,请重试"); + } + } + + if (StrUtil.isBlank(unionId) && StrUtil.isBlank(openId)) { + return WechatScanResponse.notBound("无法获取微信用户信息"); + } + + User user = null; + if (StrUtil.isNotBlank(unionId)) { + user = userService.getOne(new LambdaQueryWrapper() + .eq(User::getUnionid, unionId) + .eq(User::getDeleted, 0) + .last("limit 1")); + log.info("通过 unionId {} 查找用户: {}", unionId, user != null ? user.getUsername() : "未找到"); + } + + if (user == null && StrUtil.isNotBlank(openId)) { + user = userService.getOne(new LambdaQueryWrapper() + .eq(User::getOpenid, openId) + .eq(User::getDeleted, 0) + .last("limit 1")); + log.info("通过 openId {} 查找用户: {}", openId, user != null ? user.getUsername() : "未找到"); + } + + if (user == null && (StrUtil.isNotBlank(unionId) || StrUtil.isNotBlank(openId))) { + try { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + if (StrUtil.isNotBlank(unionId)) { + wrapper.eq(UserOauth::getUnionid, unionId); + } else { + wrapper.eq(UserOauth::getOauthId, openId); + } + wrapper.eq(UserOauth::getDeleted, 0); + + UserOauth userOauth = null; + if (userOauthService != null) { + userOauth = userOauthService.getOne(wrapper); + } + + if (userOauth != null && userOauth.getUserId() != null) { + user = userService.getAllByUserId(String.valueOf(userOauth.getUserId())); + log.info("通过 UserOauth 查找到用户: {}", user != null ? user.getUsername() : "未找到"); + } + } catch (Exception e) { + log.error("通过 UserOauth 查找用户失败: {}", e.getMessage()); + } + } + + if (user == null) { + return WechatScanResponse.notBound("该微信未绑定平台账号,请先在平台注册并绑定微信"); + } + if (user.getStatus() != null && user.getStatus() != 0) { + return WechatScanResponse.notBound("账号已被冻结"); + } + + if (StrUtil.isBlank(user.getPhone())) { + qrLoginData.setStatus(QR_LOGIN_STATUS_BIND_PHONE); + qrLoginData.setUserId(user.getUserId()); + qrLoginData.setUsername(user.getUsername()); + qrLoginData.setTenantId(user.getTenantId()); + qrLoginData.setAccessToken(null); + qrLoginData.setNeedBindPhone(true); + qrLoginData.setMessage("请先绑定手机号完成登录"); + persistQrLoginData(redisKey, qrLoginData, 120L, true); + return WechatScanResponse.needBind("请先绑定手机号完成登录"); + } + + String accessToken = buildAccessToken(user); + qrLoginData.setStatus(QR_LOGIN_STATUS_CONFIRMED); + qrLoginData.setUserId(user.getUserId()); + qrLoginData.setUsername(user.getUsername()); + qrLoginData.setAccessToken(accessToken); + qrLoginData.setTenantId(user.getTenantId()); + qrLoginData.setNeedBindPhone(false); + qrLoginData.setMessage("登录成功"); + persistQrLoginData(redisKey, qrLoginData, 120L, true); + + user.setPassword(null); + return WechatScanResponse.success(accessToken, user, user.getTenantId()); + } +} diff --git a/src/main/java/com/gxwebsoft/common/core/Constants.java b/src/main/java/com/gxwebsoft/common/core/Constants.java new file mode 100644 index 0000000..be48387 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/Constants.java @@ -0,0 +1,93 @@ +package com.gxwebsoft.common.core; + +/** + * 系统常量 + * Created by WebSoft on 2019-10-29 15:55 + */ +public class Constants { + /** + * 默认成功码 + */ + public static final int RESULT_OK_CODE = 0; + + /** + * 默认失败码 + */ + public static final int RESULT_ERROR_CODE = 1; + + /** + * 默认成功信息 + */ + public static final String RESULT_OK_MSG = "操作成功"; + + /** + * 默认失败信息 + */ + public static final String RESULT_ERROR_MSG = "操作失败"; + + /** + * 无权限错误码 + */ + public static final int UNAUTHORIZED_CODE = 403; + + /** + * 无权限提示信息 + */ + public static final String UNAUTHORIZED_MSG = "没有访问权限"; + + /** + * 未认证错误码 + */ + public static final int UNAUTHENTICATED_CODE = 401; + + /** + * 未认证提示信息 + */ + public static final String UNAUTHENTICATED_MSG = "请先登录"; + + /** + * 登录过期错误码 + */ + public static final int TOKEN_EXPIRED_CODE = 401; + + /** + * 登录过期提示信息 + */ + public static final String TOKEN_EXPIRED_MSG = "登录已过期"; + + /** + * 非法token错误码 + */ + public static final int BAD_CREDENTIALS_CODE = 401; + + /** + * 非法token提示信息 + */ + public static final String BAD_CREDENTIALS_MSG = "请退出重新登录"; + + /** + * 表示升序的值 + */ + public static final String ORDER_ASC_VALUE = "asc"; + + /** + * 表示降序的值 + */ + public static final String ORDER_DESC_VALUE = "desc"; + + /** + * token通过header传递的名称 + */ + public static final String TOKEN_HEADER_NAME = "Authorization"; + + /** + * token通过参数传递的名称 + */ + public static final String TOKEN_PARAM_NAME = "access_token"; + + /** + * token认证类型 + */ + public static final String TOKEN_TYPE = "Bearer"; + +} diff --git a/src/main/java/com/gxwebsoft/common/core/annotation/OperationLog.java b/src/main/java/com/gxwebsoft/common/core/annotation/OperationLog.java new file mode 100644 index 0000000..87bdf2c --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/annotation/OperationLog.java @@ -0,0 +1,41 @@ +package com.gxwebsoft.common.core.annotation; + +import java.lang.annotation.*; + +/** + * 操作日志记录注解 + * + * @author WebSoft + * @since 2020-03-21 17:03:08 + */ +@Documented +@Target({ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +public @interface OperationLog { + + /** + * 操作功能 + */ + String value() default ""; + + /** + * 操作模块 + */ + String module() default ""; + + /** + * 备注 + */ + String comments() default ""; + + /** + * 是否记录请求参数 + */ + boolean param() default true; + + /** + * 是否记录返回结果 + */ + boolean result() default true; + +} diff --git a/src/main/java/com/gxwebsoft/common/core/annotation/OperationModule.java b/src/main/java/com/gxwebsoft/common/core/annotation/OperationModule.java new file mode 100644 index 0000000..60ab018 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/annotation/OperationModule.java @@ -0,0 +1,21 @@ +package com.gxwebsoft.common.core.annotation; + +import java.lang.annotation.*; + +/** + * 操作日志模块注解 + * + * @author WebSoft + * @since 2021-09-01 20:48:16 + */ +@Documented +@Target({ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +public @interface OperationModule { + + /** + * 模块名称 + */ + String value(); + +} diff --git a/src/main/java/com/gxwebsoft/common/core/annotation/QueryField.java b/src/main/java/com/gxwebsoft/common/core/annotation/QueryField.java new file mode 100644 index 0000000..9377b9b --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/annotation/QueryField.java @@ -0,0 +1,22 @@ +package com.gxwebsoft.common.core.annotation; + +import java.lang.annotation.*; + +/** + * 查询条件注解 + * + * @author WebSoft + * @since 2021-09-01 20:48:16 + */ +@Documented +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.FIELD, ElementType.ANNOTATION_TYPE}) +public @interface QueryField { + + // 字段名称 + String value() default ""; + + // 查询方式 + QueryType type() default QueryType.LIKE; + +} diff --git a/src/main/java/com/gxwebsoft/common/core/annotation/QueryType.java b/src/main/java/com/gxwebsoft/common/core/annotation/QueryType.java new file mode 100644 index 0000000..3eb540e --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/annotation/QueryType.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.common.core.annotation; + +/** + * 查询方式 + * + * @author WebSoft + * @since 2021-09-01 20:48:16 + */ +public enum QueryType { + // 等于 + EQ, + // 不等于 + NE, + // 大于 + GT, + // 大于等于 + GE, + // 小于 + LT, + // 小于等于 + LE, + // 包含 + LIKE, + // 不包含 + NOT_LIKE, + // 结尾等于 + LIKE_LEFT, + // 开头等于 + LIKE_RIGHT, + // 为NULL + IS_NULL, + // 不为空 + IS_NOT_NULL, + // IN + IN, + // NOT IN + NOT_IN, + // IN条件解析逗号分割 + IN_STR, + // NOT IN条件解析逗号分割 + NOT_IN_STR +} diff --git a/src/main/java/com/gxwebsoft/common/core/aspect/OperationLogAspect.java b/src/main/java/com/gxwebsoft/common/core/aspect/OperationLogAspect.java new file mode 100644 index 0000000..2e71792 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/aspect/OperationLogAspect.java @@ -0,0 +1,211 @@ +package com.gxwebsoft.common.core.aspect; + +import cn.hutool.core.util.ArrayUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.extra.servlet.ServletUtil; +import cn.hutool.http.useragent.UserAgent; +import cn.hutool.http.useragent.UserAgentUtil; +import com.gxwebsoft.common.core.annotation.OperationLog; +import com.gxwebsoft.common.core.annotation.OperationModule; +import com.gxwebsoft.common.core.utils.JSONUtil; +import com.gxwebsoft.common.system.entity.OperationRecord; +import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.common.system.service.OperationRecordService; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.annotation.*; +import org.aspectj.lang.reflect.MethodSignature; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.stereotype.Component; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.lang.reflect.Method; +import java.util.Map; + +/** + * 操作日志记录 + * + * @author WebSoft + * @since 2020-03-21 16:58:16:05 + */ +@Aspect +@Component +public class OperationLogAspect { + @Resource + private OperationRecordService operationRecordService; + + // 参数、返回结果、错误信息等最大保存长度 + private static final int MAX_LENGTH = 1000; + // 用于记录请求耗时 + private final ThreadLocal startTime = new ThreadLocal<>(); + + @Pointcut("@annotation(com.gxwebsoft.common.core.annotation.OperationLog)") + public void operationLog() { + } + + @Before("operationLog()") + public void doBefore(JoinPoint joinPoint) throws Throwable { + startTime.set(System.currentTimeMillis()); + } + + @AfterReturning(pointcut = "operationLog()", returning = "result") + public void doAfterReturning(JoinPoint joinPoint, Object result) { + saveLog(joinPoint, result, null); + } + + @AfterThrowing(value = "operationLog()", throwing = "e") + public void doAfterThrowing(JoinPoint joinPoint, Exception e) { + saveLog(joinPoint, null, e); + } + + /** + * 保存操作记录 + */ + private void saveLog(JoinPoint joinPoint, Object result, Exception e) { + OperationRecord record = new OperationRecord(); + // 记录操作耗时 + if (startTime.get() != null) { + record.setSpendTime(System.currentTimeMillis() - startTime.get()); + } + // 记录当前登录用户id、租户id + User user = getLoginUser(); + if (user != null) { + record.setUserId(user.getUserId()); + record.setTenantId(user.getTenantId()); + } + // 记录请求地址、请求方式、ip + ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + HttpServletRequest request = (attributes == null ? null : attributes.getRequest()); + if (request != null) { + record.setUrl(request.getRequestURI()); + record.setRequestMethod(request.getMethod()); + UserAgent ua = UserAgentUtil.parse(ServletUtil.getHeaderIgnoreCase(request, "User-Agent")); + record.setOs(ua.getPlatform().toString()); + record.setDevice(ua.getOs().toString()); + record.setBrowser(ua.getBrowser().toString()); + record.setIp(ServletUtil.getClientIP(request)); + } + // 记录异常信息 + if (e != null) { + record.setStatus(1); + record.setError(StrUtil.sub(e.toString(), 0, MAX_LENGTH)); + } + // 记录模块名、操作功能、请求方法、请求参数、返回结果 + MethodSignature signature = (MethodSignature) joinPoint.getSignature(); + record.setMethod(joinPoint.getTarget().getClass().getName() + "." + signature.getName()); + Method method = signature.getMethod(); + if (method != null) { + OperationLog ol = method.getAnnotation(OperationLog.class); + if (ol != null) { + // 记录操作功能 + record.setDescription(getDescription(method, ol)); + // 记录操作模块 + record.setModule(getModule(joinPoint, ol)); + // 记录备注 + if (StrUtil.isNotEmpty(ol.comments())) { + record.setComments(ol.comments()); + } + // 记录请求参数 + if (ol.param() && request != null) { + record.setParams(StrUtil.sub(getParams(joinPoint, request), 0, MAX_LENGTH)); + } + // 记录请求结果 + if (ol.result() && result != null) { + record.setResult(StrUtil.sub(JSONUtil.toJSONString(result), 0, MAX_LENGTH)); + } + } + } + operationRecordService.saveAsync(record); + } + + /** + * 获取当前登录用户 + */ + private User getLoginUser() { + Authentication subject = SecurityContextHolder.getContext().getAuthentication(); + if (subject != null) { + Object object = subject.getPrincipal(); + if (object instanceof User) { + return (User) object; + } + } + return null; + } + + /** + * 获取请求参数 + * + * @param joinPoint JoinPoint + * @param request HttpServletRequest + * @return String + */ + private String getParams(JoinPoint joinPoint, HttpServletRequest request) { + String params; + Map paramsMap = ServletUtil.getParamMap(request); + if (paramsMap.keySet().size() > 0) { + params = JSONUtil.toJSONString(paramsMap); + } else { + StringBuilder sb = new StringBuilder(); + for (Object arg : joinPoint.getArgs()) { + if (ObjectUtil.isNull(arg) + || arg instanceof MultipartFile + || arg instanceof HttpServletRequest + || arg instanceof HttpServletResponse) { + continue; + } + sb.append(JSONUtil.toJSONString(arg)).append(" "); + } + params = sb.toString(); + } + return params; + } + + /** + * 获取操作模块 + * + * @param joinPoint JoinPoint + * @param ol OperationLog + * @return String + */ + private String getModule(JoinPoint joinPoint, OperationLog ol) { + if (StrUtil.isNotEmpty(ol.module())) { + return ol.module(); + } + OperationModule om = joinPoint.getTarget().getClass().getAnnotation(OperationModule.class); + if (om != null && StrUtil.isNotEmpty(om.value())) { + return om.value(); + } + Tag tag = joinPoint.getTarget().getClass().getAnnotation(Tag.class); + if (tag != null && StrUtil.isNotEmpty(tag.name())) { + return tag.name(); + } + return null; + } + + /** + * 获取操作功能 + * + * @param method Method + * @param ol OperationLog + * @return String + */ + private String getDescription(Method method, OperationLog ol) { + if (StrUtil.isNotEmpty(ol.value())) { + return ol.value(); + } + Operation operation = method.getAnnotation(Operation.class); + if (operation != null && StrUtil.isNotEmpty(operation.summary())) { + return operation.summary(); + } + return null; + } + +} diff --git a/src/main/java/com/gxwebsoft/common/core/config/CertificateProperties.java b/src/main/java/com/gxwebsoft/common/core/config/CertificateProperties.java new file mode 100644 index 0000000..ab09a24 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/config/CertificateProperties.java @@ -0,0 +1,197 @@ +package com.gxwebsoft.common.core.config; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +/** + * 证书配置属性类 + * 支持开发环境从classpath加载证书,生产环境从Docker挂载卷加载证书 + * + * @author 科技小王子 + * @since 2024-07-26 + */ +@Data +@Component +@ConfigurationProperties(prefix = "certificate") +public class CertificateProperties { + + /** + * 证书加载模式 + * CLASSPATH: 从classpath加载(开发环境) + * FILESYSTEM: 从文件系统加载(生产环境) + * VOLUME: 从Docker挂载卷加载(容器环境) + */ + private LoadMode loadMode = LoadMode.CLASSPATH; + + /** + * Docker挂载卷证书根路径 + */ + private String certRootPath = "/app/certs"; + + /** + * 开发环境证书路径前缀 + */ + private String devCertPath = "certs/dev"; + + /** + * 微信支付证书配置 + */ + private WechatPayConfig wechatPay = new WechatPayConfig(); + + /** + * 支付宝证书配置 + */ + private AlipayConfig alipay = new AlipayConfig(); + + /** + * 证书加载模式枚举 + */ + public enum LoadMode { + CLASSPATH, // 从classpath加载 + FILESYSTEM, // 从文件系统加载 + VOLUME // 从Docker挂载卷加载 + } + + /** + * 微信支付证书配置 + */ + @Data + public static class WechatPayConfig { + /** + * 开发环境配置 + */ + private DevConfig dev = new DevConfig(); + + /** + * 生产环境基础路径 + */ + private String prodBasePath = "/file"; + + /** + * 微信支付证书目录名 + */ + private String certDir = "wechat"; + + @Data + public static class DevConfig { + /** + * APIv3密钥 + */ + private String apiV3Key; + + /** + * 商户私钥证书文件名 + */ + private String privateKeyFile = "apiclient_key.pem"; + + /** + * 商户证书文件名 + */ + private String apiclientCertFile = "apiclient_cert.pem"; + + /** + * 微信支付平台证书文件名 + */ + private String wechatpayCertFile = "wechatpay_cert.pem"; + } + } + + /** + * 支付宝证书配置 + */ + @Data + public static class AlipayConfig { + /** + * 支付宝证书目录名 + */ + private String certDir = "alipay"; + + /** + * 应用私钥文件名 + */ + private String appPrivateKeyFile = "app_private_key.pem"; + + /** + * 应用公钥证书文件名 + */ + private String appCertPublicKeyFile = "appCertPublicKey.crt"; + + /** + * 支付宝公钥证书文件名 + */ + private String alipayCertPublicKeyFile = "alipayCertPublicKey.crt"; + + /** + * 支付宝根证书文件名 + */ + private String alipayRootCertFile = "alipayRootCert.crt"; + } + + /** + * 获取证书文件的完整路径 + * + * @param certType 证书类型(wechat/alipay) + * @param fileName 文件名 + * @return 完整路径 + */ + public String getCertificatePath(String certType, String fileName) { + switch (loadMode) { + case CLASSPATH: + return devCertPath + "/" + certType + "/" + fileName; + case FILESYSTEM: + return System.getProperty("user.dir") + "/certs/" + certType + "/" + fileName; + case VOLUME: + return certRootPath + "/" + certType + "/" + fileName; + default: + throw new IllegalArgumentException("不支持的证书加载模式: " + loadMode); + } + } + + /** + * 获取微信支付证书路径 + * + * @param fileName 文件名 + * @return 完整路径 + */ + public String getWechatPayCertPath(String fileName) { + return getCertificatePath(wechatPay.getCertDir(), fileName); + } + + /** + * 获取支付宝证书路径 + * + * @param fileName 文件名 + * @return 完整路径 + */ + public String getAlipayCertPath(String fileName) { + return getCertificatePath(alipay.getCertDir(), fileName); + } + + /** + * 检查证书加载模式是否为classpath模式 + * + * @return true if classpath mode + */ + public boolean isClasspathMode() { + return LoadMode.CLASSPATH.equals(loadMode); + } + + /** + * 检查证书加载模式是否为文件系统模式 + * + * @return true if filesystem mode + */ + public boolean isFilesystemMode() { + return LoadMode.FILESYSTEM.equals(loadMode); + } + + /** + * 检查证书加载模式是否为挂载卷模式 + * + * @return true if volume mode + */ + public boolean isVolumeMode() { + return LoadMode.VOLUME.equals(loadMode); + } +} diff --git a/src/main/java/com/gxwebsoft/common/core/config/ConfigProperties.java b/src/main/java/com/gxwebsoft/common/core/config/ConfigProperties.java new file mode 100644 index 0000000..c8afd9c --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/config/ConfigProperties.java @@ -0,0 +1,115 @@ +package com.gxwebsoft.common.core.config; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * 系统配置属性 + * + * @author WebSoft + * @since 2021-08-30 17:58:16 + */ +@Data +@ConfigurationProperties(prefix = "config") +public class ConfigProperties { + /** + * 文件上传磁盘位置 + */ + private Integer uploadLocation = 0; + + /** + * 文件上传是否使用uuid命名 + */ + private Boolean uploadUuidName = true; + + /** + * 文件上传生成缩略图的大小(kb) + */ + private Integer thumbnailSize = 60; + + /** + * OpenOffice的安装目录 + */ + private String openOfficeHome; + + /** + * swagger扫描包 + */ + private String swaggerBasePackage; + + /** + * swagger文档标题 + */ + private String swaggerTitle; + + /** + * swagger文档描述 + */ + private String swaggerDescription; + + /** + * swagger文档版本号 + */ + private String swaggerVersion; + + /** + * swagger地址 + */ + private String swaggerHost; + + /** + * token过期时间, 单位秒 + */ + private Long tokenExpireTime = 60 * 60 * 365 * 24L; + + /** + * token快要过期自动刷新时间, 单位分钟 + */ + private int tokenRefreshTime = 30; + + /** + * 生成token的密钥Key的base64字符 + */ + private String tokenKey; + + /** + * 文件上传目录 + */ + private String uploadPath; + + /** + * 本地文件上传目录(开发环境) + */ + private String localUploadPath; + + /** + * 文件服务器 + */ + private String fileServer; + + /** + * 网关地址 + */ + private String serverUrl; + + /** + * websopy 服务地址(用于同步用户数据) + */ + private String websopyUrl; + + /** + * 微信扫码H5页面访问地址(用于微信扫码登录跳转) + */ + private String wechatScanUrl; + + /** + * 阿里云存储 OSS + * Endpoint + */ + private String endpoint; + private String accessKeyId; + private String accessKeySecret; + private String bucketName; + private String bucketDomain; + +} diff --git a/src/main/java/com/gxwebsoft/common/core/config/HttpMessageConverter.java b/src/main/java/com/gxwebsoft/common/core/config/HttpMessageConverter.java new file mode 100644 index 0000000..6bae59d --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/config/HttpMessageConverter.java @@ -0,0 +1,15 @@ +package com.gxwebsoft.common.core.config; + +import org.springframework.http.MediaType; +import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; + +import java.util.ArrayList; +import java.util.List; + +public class HttpMessageConverter extends MappingJackson2HttpMessageConverter { + public HttpMessageConverter(){ + List mediaTypes = new ArrayList<>(); + mediaTypes.add(MediaType.APPLICATION_FORM_URLENCODED); + setSupportedMediaTypes(mediaTypes); + } +} diff --git a/src/main/java/com/gxwebsoft/common/core/config/JacksonConfig.java b/src/main/java/com/gxwebsoft/common/core/config/JacksonConfig.java new file mode 100644 index 0000000..0c73720 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/config/JacksonConfig.java @@ -0,0 +1,40 @@ +package com.gxwebsoft.common.core.config; + +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; + +/** + * Jackson配置类 + * 解决Java 8时间类型序列化问题 + * + * @author WebSoft + * @since 2024-08-28 + */ +@Configuration +public class JacksonConfig { + + @Bean + @Primary + public ObjectMapper objectMapper() { + ObjectMapper mapper = new ObjectMapper(); + + // 注册JavaTimeModule + mapper.registerModule(new JavaTimeModule()); + + // 禁用将日期写为时间戳 + mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); + + // 禁用将日期时间戳写为纳秒 + mapper.disable(SerializationFeature.WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS); + + // 忽略未知字段,避免反序列化时出现 "Unrecognized field" 错误 + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + + return mapper; + } +} diff --git a/src/main/java/com/gxwebsoft/common/core/config/MqttProperties.java b/src/main/java/com/gxwebsoft/common/core/config/MqttProperties.java new file mode 100644 index 0000000..cfc882d --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/config/MqttProperties.java @@ -0,0 +1,72 @@ +package com.gxwebsoft.common.core.config; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +/** + * MQTT配置属性 + * + * @author 科技小王子 + * @since 2025-07-02 + */ +@Data +@Component +@ConfigurationProperties(prefix = "mqtt") +public class MqttProperties { + + /** + * 是否启用MQTT服务 + */ + private boolean enabled = false; + + /** + * MQTT服务器地址 + */ + private String host = "tcp://127.0.0.1:1883"; + + /** + * 用户名 + */ + private String username = ""; + + /** + * 密码 + */ + private String password = ""; + + /** + * 客户端ID前缀 + */ + private String clientIdPrefix = "mqtt_client_"; + + /** + * 订阅主题 + */ + private String topic = "/SW_GPS/#"; + + /** + * QoS等级 + */ + private int qos = 2; + + /** + * 连接超时时间(秒) + */ + private int connectionTimeout = 10; + + /** + * 心跳间隔(秒) + */ + private int keepAliveInterval = 20; + + /** + * 是否自动重连 + */ + private boolean autoReconnect = true; + + /** + * 是否清除会话 + */ + private boolean cleanSession = false; +} diff --git a/src/main/java/com/gxwebsoft/common/core/config/MybatisPlusConfig.java b/src/main/java/com/gxwebsoft/common/core/config/MybatisPlusConfig.java new file mode 100644 index 0000000..2259142 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/config/MybatisPlusConfig.java @@ -0,0 +1,139 @@ +package com.gxwebsoft.common.core.config; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.annotation.DbType; +import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; +import com.baomidou.mybatisplus.extension.plugins.handler.TenantLineHandler; +import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; +import com.baomidou.mybatisplus.extension.plugins.inner.TenantLineInnerInterceptor; +import com.gxwebsoft.common.core.utils.RedisUtil; +import com.gxwebsoft.common.system.entity.User; +import net.sf.jsqlparser.expression.Expression; +import net.sf.jsqlparser.expression.LongValue; +import net.sf.jsqlparser.expression.NullValue; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.context.SecurityContextHolder; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.Arrays; + +/** + * MybatisPlus配置 + * + * @author WebSoft + * @since 2018-02-22 11:29:28 + */ +@Configuration +public class MybatisPlusConfig { + @Resource + private RedisUtil redisUtil; + + @Bean + public MybatisPlusInterceptor mybatisPlusInterceptor(HttpServletRequest request) { + MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); + + // 多租户插件配置 + TenantLineHandler tenantLineHandler = new TenantLineHandler() { + + @Override + public Expression getTenantId() { + String tenantId; + // 从请求头拿ID + tenantId = request.getHeader("tenantId"); + if(tenantId != null){ + return new LongValue(tenantId); + } + // 从域名拿ID + String Domain = request.getHeader("Domain"); + if (StrUtil.isNotBlank(Domain)) { + String key = "Domain:" + Domain; + tenantId = redisUtil.get(key); + if(tenantId != null){ + System.out.println("授权域名" + Domain + " => " + tenantId); + return new LongValue(tenantId); + } + } + return getLoginUserTenantId(); + } + + @Override + public boolean ignoreTable(String tableName) { + return Arrays.asList( + "sys_tenant", + "sys_dictionary", + "sys_dictionary_data", + "sys_user_oauth", + "sys_email_record", + "sys_plug", + "sys_version", + "sys_order", + "sys_modules", + "sys_environment", + "sys_components", + "sys_website_field", +// "sys_company", + "sys_domain", + "sys_white_domain" +// "cms_domain" +// "cms_website", +// "cms_website_field", +// "cms_navigation", +// "cms_design", +// "cms_design_record", +// "cms_article", +// "cms_article_content", +// "cms_article_category", +// "cms_article_comment", +// "cms_article_count", +// "cms_article_like", +// "cms_form", +// "cms_form_record", +// "cms_link", +// "oa_app", +// "oa_app_field", +// "oa_app_renew", +// "oa_app_url", +// "oa_app_user", +// "shop_goods", +// "cms_product", +// "cms_product_url", +// "cms_product_spec", +// "cms_product_spec_value", +// "sys_company_content" + ).contains(tableName); + } + }; + TenantLineInnerInterceptor tenantLineInnerInterceptor = new TenantLineInnerInterceptor(tenantLineHandler); + interceptor.addInnerInterceptor(tenantLineInnerInterceptor); + + // 分页插件配置 + PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor(DbType.MYSQL); + interceptor.addInnerInterceptor(paginationInnerInterceptor); + + return interceptor; + } + + /** + * 获取当前登录用户的租户id + * + * @return Integer + */ + public Expression getLoginUserTenantId() { + try { + Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); + if (authentication != null) { + Object object = authentication.getPrincipal(); + if (object instanceof User) { + return new LongValue(((User) object).getTenantId()); + } + } + } catch (Exception e) { + System.out.println(e.getMessage()); + } + return new NullValue(); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/core/config/OpenApiConfig.java b/src/main/java/com/gxwebsoft/common/core/config/OpenApiConfig.java new file mode 100644 index 0000000..3f2a255 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/config/OpenApiConfig.java @@ -0,0 +1,46 @@ +package com.gxwebsoft.common.core.config; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Contact; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.security.SecurityRequirement; +import io.swagger.v3.oas.models.security.SecurityScheme; +import io.swagger.v3.oas.models.Components; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import javax.annotation.Resource; + +/** + * OpenAPI 配置 + * + * @author WebSoft + * @since 2025-09-11 + */ +@Configuration +public class OpenApiConfig { + + @Resource + private ConfigProperties config; + + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .info(new Info() + .title(config.getSwaggerTitle()) + .description(config.getSwaggerDescription()) + .version(config.getSwaggerVersion()) + .contact(new Contact() + .name("科技小王子") + .url("https://websoft.top") + .email("170083662@qq.com"))) + .addSecurityItem(new SecurityRequirement().addList("Authorization")) + .components(new Components() + .addSecuritySchemes("Authorization", + new SecurityScheme() + .type(SecurityScheme.Type.HTTP) + .scheme("bearer") + .bearerFormat("JWT") + .description("JWT 认证"))); + } +} diff --git a/src/main/java/com/gxwebsoft/common/core/config/RestTemplateConfig.java b/src/main/java/com/gxwebsoft/common/core/config/RestTemplateConfig.java new file mode 100644 index 0000000..786798f --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/config/RestTemplateConfig.java @@ -0,0 +1,29 @@ +package com.gxwebsoft.common.core.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.client.ClientHttpRequestFactory; +import org.springframework.http.client.SimpleClientHttpRequestFactory; +import org.springframework.web.client.RestTemplate; + + +@Configuration +public class RestTemplateConfig { + + @Bean + public RestTemplate restTemplate(ClientHttpRequestFactory factory) { + RestTemplate restTemplate = new RestTemplate(factory); + restTemplate.getMessageConverters().add(new HttpMessageConverter()); + return restTemplate; + } + @Bean + public ClientHttpRequestFactory simpleClientHttpRequestFactory() { + SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory(); + // ms + factory.setReadTimeout(60000); + // ms + factory.setConnectTimeout(60000); + + return factory; + } +} diff --git a/src/main/java/com/gxwebsoft/common/core/config/SpringContextUtil.java b/src/main/java/com/gxwebsoft/common/core/config/SpringContextUtil.java new file mode 100644 index 0000000..4e6d883 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/config/SpringContextUtil.java @@ -0,0 +1,62 @@ +package com.gxwebsoft.common.core.config; + +import org.springframework.beans.BeansException; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.stereotype.Component; + +/** + * @Author ds + * @Date 2022-05-05 + */ +@Component +public class SpringContextUtil implements ApplicationContextAware { + /** + * spring的应用上下文 + */ + private static ApplicationContext applicationContext; + + /** + * 初始化时将应用上下文设置进applicationContext + * @param applicationContext + * @throws BeansException + */ + @Override + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { + SpringContextUtil.applicationContext=applicationContext; + } + + public static ApplicationContext getApplicationContext(){ + return applicationContext; + } + + /** + * 根据bean名称获取某个bean对象 + * + * @param name bean名称 + * @return Object + * @throws BeansException + */ + public static Object getBean(String name) throws BeansException { + return applicationContext.getBean(name); + } + + /** + * 根据bean的class获取某个bean对象 + * @param beanClass + * @param + * @return + * @throws BeansException + */ + public static T getBean(Class beanClass) throws BeansException { + return applicationContext.getBean(beanClass); + } + + /** + * 获取spring.profiles.active + * @return + */ + public static String getProfile(){ + return getApplicationContext().getEnvironment().getActiveProfiles()[0]; + } +} diff --git a/src/main/java/com/gxwebsoft/common/core/config/WebMvcConfig.java b/src/main/java/com/gxwebsoft/common/core/config/WebMvcConfig.java new file mode 100644 index 0000000..2ed9d8b --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/config/WebMvcConfig.java @@ -0,0 +1,31 @@ +package com.gxwebsoft.common.core.config; + +import com.gxwebsoft.common.core.Constants; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +/** + * WebMvc配置, 拦截器、资源映射等都在此配置 + * + * @author WebSoft + * @since 2019-06-12 10:11:16 + */ +@Configuration +public class WebMvcConfig implements WebMvcConfigurer { + + /** + * 支持跨域访问 + */ + @Override + public void addCorsMappings(CorsRegistry registry) { + registry.addMapping("/**") + .allowedOriginPatterns("*") + .allowedHeaders("*") + .exposedHeaders(Constants.TOKEN_HEADER_NAME) + .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS", "PATCH") + .allowCredentials(true) + .maxAge(3600); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/core/constants/AppUserConstants.java b/src/main/java/com/gxwebsoft/common/core/constants/AppUserConstants.java new file mode 100644 index 0000000..538e295 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/constants/AppUserConstants.java @@ -0,0 +1,8 @@ +package com.gxwebsoft.common.core.constants; + +public class AppUserConstants { + // 成员角色 + public static final Integer TRIAL = 10; // 体验成员 + public static final Integer DEVELOPER = 20; // 开发者 + public static final Integer ADMINISTRATOR = 30; // 管理员 +} diff --git a/src/main/java/com/gxwebsoft/common/core/constants/ArticleConstants.java b/src/main/java/com/gxwebsoft/common/core/constants/ArticleConstants.java new file mode 100644 index 0000000..62a38cc --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/constants/ArticleConstants.java @@ -0,0 +1,6 @@ +package com.gxwebsoft.common.core.constants; + +public class ArticleConstants extends BaseConstants { + public static final String[] ARTICLE_STATUS = {"已发布","待审核","已驳回","违规内容"}; + public static final String CACHE_KEY_ARTICLE = "Article:"; +} diff --git a/src/main/java/com/gxwebsoft/common/core/constants/BalanceConstants.java b/src/main/java/com/gxwebsoft/common/core/constants/BalanceConstants.java new file mode 100644 index 0000000..6857250 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/constants/BalanceConstants.java @@ -0,0 +1,10 @@ +package com.gxwebsoft.common.core.constants; + +public class BalanceConstants { + // 余额变动场景 + public static final Integer BALANCE_RECHARGE = 10; // 用户充值 + public static final Integer BALANCE_USE = 20; // 用户消费 + public static final Integer BALANCE_RE_LET = 21; // 续租 + public static final Integer BALANCE_ADMIN = 30; // 管理员操作 + public static final Integer BALANCE_REFUND = 40; // 订单退款 +} diff --git a/src/main/java/com/gxwebsoft/common/core/constants/BaseConstants.java b/src/main/java/com/gxwebsoft/common/core/constants/BaseConstants.java new file mode 100644 index 0000000..66cf4c0 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/constants/BaseConstants.java @@ -0,0 +1,5 @@ +package com.gxwebsoft.common.core.constants; + +public class BaseConstants { + public static final String[] STATUS = {"未定义","显示","隐藏"}; +} diff --git a/src/main/java/com/gxwebsoft/common/core/constants/DomainConstants.java b/src/main/java/com/gxwebsoft/common/core/constants/DomainConstants.java new file mode 100644 index 0000000..c101769 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/constants/DomainConstants.java @@ -0,0 +1,10 @@ +package com.gxwebsoft.common.core.constants; + +public class DomainConstants { + public static final String ROOT_DOMAIN = "websoft.top"; // 根域名 + public static final String PREFIX = "https://"; // 域名前缀 + public static final String ADMIN_SUFFIX = ".".concat(ROOT_DOMAIN); // 后台管理域名拼接 + public static final String WEB_SUFFIX = ".wsdns.cn"; // 应用域名拼接 + public static final String DOMAIN = PREFIX.concat(ROOT_DOMAIN); // 完整域名 + +} diff --git a/src/main/java/com/gxwebsoft/common/core/constants/OrderConstants.java b/src/main/java/com/gxwebsoft/common/core/constants/OrderConstants.java new file mode 100644 index 0000000..e866654 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/constants/OrderConstants.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.common.core.constants; + +public class OrderConstants { + // 支付方式 + public static final String PAY_METHOD_BALANCE = "10"; // 余额支付 + public static final String PAY_METHOD_WX = "20"; // 微信支付 + public static final String PAY_METHOD_ALIPAY = "30"; // 支付宝支付 + public static final String PAY_METHOD_OTHER = "40"; // 其他支付 + + // 付款状态 + public static final Integer PAY_STATUS_NO_PAY = 10; // 未付款 + public static final Integer PAY_STATUS_SUCCESS = 20; // 已付款 + + // 发货状态 + public static final Integer DELIVERY_STATUS_NO = 10; // 未发货 + public static final Integer DELIVERY_STATUS_YES = 20; // 已发货 + public static final Integer DELIVERY_STATUS_30 = 30; // 部分发货 + + // 收货状态 + public static final Integer RECEIPT_STATUS_NO = 10; // 未收货 + public static final Integer RECEIPT_STATUS_YES = 20; // 已收货 + public static final Integer RECEIPT_STATUS_RETURN = 30; // 已退货 + + // 订单状态 + public static final Integer ORDER_STATUS_DOING = 10; // 进行中 + public static final Integer ORDER_STATUS_CANCEL = 20; // 已取消 + public static final Integer ORDER_STATUS_TO_CANCEL = 21; // 待取消 + public static final Integer ORDER_STATUS_COMPLETED = 30; // 已完成 + + // 订单结算状态 + public static final Integer ORDER_SETTLED_YES = 1; // 已结算 + public static final Integer ORDER_SETTLED_NO = 0; // 未结算 + + + + +} diff --git a/src/main/java/com/gxwebsoft/common/core/constants/PlatformConstants.java b/src/main/java/com/gxwebsoft/common/core/constants/PlatformConstants.java new file mode 100644 index 0000000..896f8e3 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/constants/PlatformConstants.java @@ -0,0 +1,12 @@ +package com.gxwebsoft.common.core.constants; + +public class PlatformConstants { + public static final String MP_OFFICIAL = "MP-OFFICIAL"; // 微信公众号 + public static final String MP_WEIXIN = "MP-WEIXIN"; // 微信小程序 + public static final String MP_ALIPAY = "MP-ALIPAY"; // 支付宝小程序 + public static final String WEB = "WEB"; // web(同H5) + public static final String H5 = "H5"; // H5(推荐使用 WEB) + public static final String APP = "APP"; // App + public static final String MP_BAIDU = "MP-BAIDU"; // 百度小程序 + public static final String MP_TOUTIAO = "MP-TOUTIAO"; // 百度小程序 +} diff --git a/src/main/java/com/gxwebsoft/common/core/constants/ProfitConstants.java b/src/main/java/com/gxwebsoft/common/core/constants/ProfitConstants.java new file mode 100644 index 0000000..2cb60fd --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/constants/ProfitConstants.java @@ -0,0 +1,9 @@ +package com.gxwebsoft.common.core.constants; + +public class ProfitConstants { + // 收益类型 + public static final Integer PROFIT_TYPE10 = 10; // 推广收益 + public static final Integer PROFIT_TYPE20 = 20; // 团队收益 + public static final Integer PROFIT_TYPE30 = 30; // 门店收益 + public static final Integer PROFIT_TYPE40 = 30; // 区域收益 +} diff --git a/src/main/java/com/gxwebsoft/common/core/constants/QRCodeConstants.java b/src/main/java/com/gxwebsoft/common/core/constants/QRCodeConstants.java new file mode 100644 index 0000000..1b30868 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/constants/QRCodeConstants.java @@ -0,0 +1,10 @@ +package com.gxwebsoft.common.core.constants; + +public class QRCodeConstants { + // 二维码类型 + public static final String USER_QRCODE = "user"; // 用户二维码 + public static final String TASK_QRCODE = "task"; // 工单二维码 + public static final String ARTICLE_QRCODE = "article"; // 文章二维码 + public static final String GOODS_QRCODE = "goods"; // 商品二维码 + public static final String DIY_QRCODE = "diy"; // 工单二维码 +} diff --git a/src/main/java/com/gxwebsoft/common/core/constants/RedisConstants.java b/src/main/java/com/gxwebsoft/common/core/constants/RedisConstants.java new file mode 100644 index 0000000..605f2d9 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/constants/RedisConstants.java @@ -0,0 +1,48 @@ +package com.gxwebsoft.common.core.constants; + +public class RedisConstants { + // 短信验证码Key + public static final String SMS_CODE_KEY = "sms"; + // 验证码过期时间 + public static final Long SMS_CODE_TTL = 5L; + // 微信凭证access-token + public static final String ACCESS_TOKEN_KEY = "access-token"; + // 空值防止击穿数据库 + public static final Long CACHE_NULL_TTL = 2L; + // 商户信息 + public static final String MERCHANT_KEY = "merchant"; + // 添加商户定位点 + public static final String MERCHANT_GEO_KEY = "merchant-geo"; + + // token + public static final String TOKEN_USER_ID = "cache:token:"; + // 排行榜 + public static final String USER_RANKING_BY_APPS = "userRankingByApps"; + // 搜索历史 + public static final String SEARCH_HISTORY = "searchHistory"; + // 租户系统设置信息 + public static final String TEN_ANT_SETTING_KEY = "setting"; + // 排行榜Key + public static final String USER_RANKING_BY_APPS_5 = "cache5:userRankingByApps"; + + + + // 扫码登录相关key + public static final String QR_LOGIN_TOKEN_KEY = "qr-login:token:"; // 扫码登录token前缀 + public static final Long QR_LOGIN_TOKEN_TTL = 300L; // 扫码登录token过期时间(5分钟) + public static final String QR_LOGIN_STATUS_PENDING = "pending"; // 等待扫码 + public static final String QR_LOGIN_STATUS_SCANNED = "scanned"; // 已扫码 + public static final String QR_LOGIN_STATUS_CONFIRMED = "confirmed"; // 已确认 + public static final String QR_LOGIN_STATUS_BIND_PHONE = "bind_phone"; // 待绑定手机号 + public static final String QR_LOGIN_STATUS_EXPIRED = "expired"; // 已过期 + + // 哗啦啦key + public static final String getAllShop = "allShop"; + public static final String getBaseInfo = "baseInfo"; + public static final String getFoodClassCategory = "foodCategory"; + public static final String getOpenFood = "openFood"; + public static final String haulalaGeoKey = "cache10:hualala-geo"; + public static final String HLL_CART_KEY = "hll-cart"; // hll-cart[shopId]:[userId] + public static final String HLL_CART_FOOD_KEY = "hll-cart-list"; // hll-cart-list[shopId]:[userId] + +} diff --git a/src/main/java/com/gxwebsoft/common/core/constants/TaskConstants.java b/src/main/java/com/gxwebsoft/common/core/constants/TaskConstants.java new file mode 100644 index 0000000..42cec5e --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/constants/TaskConstants.java @@ -0,0 +1,22 @@ +package com.gxwebsoft.common.core.constants; + +public class TaskConstants { + // 工单进度 + public static final Integer TOBEARRANGED = 0; // 待安排 + public static final Integer PENDING = 1; // 待处理 + public static final Integer PROCESSING = 2; // 处理中 + public static final Integer TOBECONFIRMED = 3; // 待评价 + public static final Integer COMPLETED = 4; // 已完成 + public static final Integer CLOSED = 5; // 已关闭 + + // 工单状态 + public static final Integer TASK_STATUS_0 = 0; // 待处理 + public static final Integer TASK_STATUS_1 = 1; // 已完成 + + // 操作类型 + public static final String ACTION_1 = "派单"; + public static final String ACTION_2 = "已解决"; + public static final String ACTION_3 = "关单"; + public static final String ACTION_4 = "分享"; + public static final String ACTION_5 = "编辑"; +} diff --git a/src/main/java/com/gxwebsoft/common/core/constants/WebsiteConstants.java b/src/main/java/com/gxwebsoft/common/core/constants/WebsiteConstants.java new file mode 100644 index 0000000..117b2f3 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/constants/WebsiteConstants.java @@ -0,0 +1,25 @@ +package com.gxwebsoft.common.core.constants; + +public class WebsiteConstants extends BaseConstants { + // 运行状态 0未开通 1运行中 2维护中 3已关闭 4已欠费停机 5违规关停 + public static final String[] WEBSITE_STATUS_NAME = {"未开通","运行中","维护中","已关闭","已欠费停机","违规关停"}; + // 状态图标 + public static final String[] WEBSITE_STATUS_ICON = {"error","success","warning","error","error","error"}; + // 关闭原因 + public static final String[] WEBSITE_STATUS_TEXT = {"产品未开通","","系统升级维护","","已欠费停机","违规关停"}; + // 跳转地址 + public static final String[] WEBSITE_STATUS_URL = {"https://websoft.top","","","","https://websoft.top/user","https://websoft.top/user"}; + // 跳转按钮文字 + public static final String[] WEBSITE_STATUS_BTN_TEXT = {"立即开通","","","","立即续费","申请解封"}; + + + // 站点信息 + public static final String CACHE_KEY_ROOT_SITE_INFO = "RootSiteInfo:"; + + // 万能登录密码 + public static final String CACHE_KEY_UNIVERSAL_PASSWORD = "UniversalPassword:"; + + // 万能短信验证码:VerificationCodeByDevSMS + public static final String CACHE_KEY_VERIFICATION_CODE_BY_DEV_SMS = "VerificationCodeByDevSMS:"; + +} diff --git a/src/main/java/com/gxwebsoft/common/core/context/TenantContext.java b/src/main/java/com/gxwebsoft/common/core/context/TenantContext.java new file mode 100644 index 0000000..42adb46 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/context/TenantContext.java @@ -0,0 +1,67 @@ +package com.gxwebsoft.common.core.context; + +/** + * 租户上下文管理器 + * + * 用于在特定场景下临时禁用租户隔离 + * + * @author WebSoft + * @since 2025-01-26 + */ +public class TenantContext { + + private static final ThreadLocal IGNORE_TENANT = new ThreadLocal<>(); + + /** + * 设置忽略租户隔离 + */ + public static void setIgnoreTenant(boolean ignore) { + IGNORE_TENANT.set(ignore); + } + + /** + * 是否忽略租户隔离 + */ + public static boolean isIgnoreTenant() { + Boolean ignore = IGNORE_TENANT.get(); + return ignore != null && ignore; + } + + /** + * 清除租户上下文 + */ + public static void clear() { + IGNORE_TENANT.remove(); + } + + /** + * 在忽略租户隔离的上下文中执行操作 + * + * @param runnable 要执行的操作 + */ + public static void runIgnoreTenant(Runnable runnable) { + boolean originalIgnore = isIgnoreTenant(); + try { + setIgnoreTenant(true); + runnable.run(); + } finally { + setIgnoreTenant(originalIgnore); + } + } + + /** + * 在忽略租户隔离的上下文中执行操作并返回结果 + * + * @param supplier 要执行的操作 + * @return 操作结果 + */ + public static T callIgnoreTenant(java.util.function.Supplier supplier) { + boolean originalIgnore = isIgnoreTenant(); + try { + setIgnoreTenant(true); + return supplier.get(); + } finally { + setIgnoreTenant(originalIgnore); + } + } +} diff --git a/src/main/java/com/gxwebsoft/common/core/controller/CertificateController.java b/src/main/java/com/gxwebsoft/common/core/controller/CertificateController.java new file mode 100644 index 0000000..4eb61d1 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/controller/CertificateController.java @@ -0,0 +1,201 @@ +package com.gxwebsoft.common.core.controller; + +import com.gxwebsoft.common.core.service.CertificateHealthService; +import com.gxwebsoft.common.core.service.CertificateService; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.BaseController; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import lombok.extern.slf4j.Slf4j; + +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.Map; + +/** + * 证书管理控制器 + * 提供证书状态查询、健康检查等功能 + * + * @author 科技小王子 + * @since 2024-07-26 + */ +@Slf4j +@Tag(name = "证书管理") +@RestController +@RequestMapping("/api/system/certificate") +public class CertificateController extends BaseController { + + @Resource + private CertificateService certificateService; + + @Resource + private CertificateHealthService certificateHealthService; + + @Operation(summary = "获取所有证书状态") + @GetMapping("/status") + @PreAuthorize("hasAuthority('system:certificate:view')") + public ApiResult> getCertificateStatus() { + try { + Map status = certificateService.getAllCertificateStatus(); + return success("获取证书状态成功", status); + } catch (Exception e) { + log.error("获取证书状态失败", e); + return new ApiResult<>(1, "获取证书状态失败: " + e.getMessage()); + } + } + + @Operation(summary = "证书健康检查") + @GetMapping("/health") + @PreAuthorize("hasAuthority('system:certificate:view')") + public ApiResult> healthCheck() { + try { + CertificateHealthService.HealthResult health = certificateHealthService.health(); + Map result = Map.of( + "status", health.getStatus(), + "details", health.getDetails() + ); + return success("证书健康检查完成", result); + } catch (Exception e) { + log.error("证书健康检查失败", e); + return new ApiResult<>(1, "证书健康检查失败: " + e.getMessage()); + } + } + + @Operation(summary = "获取证书诊断信息") + @GetMapping("/diagnostic") + @PreAuthorize("hasAuthority('system:certificate:view')") + public ApiResult> getDiagnosticInfo() { + try { + Map diagnostic = certificateHealthService.getDiagnosticInfo(); + return success("获取证书诊断信息成功", diagnostic); + } catch (Exception e) { + log.error("获取证书诊断信息失败", e); + return new ApiResult<>(1, "获取证书诊断信息失败: " + e.getMessage()); + } + } + + @Operation(summary = "检查特定证书") + @GetMapping("/check/{certType}/{fileName}") + @PreAuthorize("hasAuthority('system:certificate:view')") + public ApiResult> checkSpecificCertificate( + @Parameter(description = "证书类型", example = "wechat") @PathVariable String certType, + @Parameter(description = "文件名", example = "apiclient_key.pem") @PathVariable String fileName) { + try { + Map result = certificateHealthService.checkSpecificCertificate(certType, fileName); + return success("检查证书完成", result); + } catch (Exception e) { + log.error("检查证书失败: {}/{}", certType, fileName, e); + return new ApiResult<>(1, "检查证书失败: " + e.getMessage()); + } + } + + @Operation(summary = "验证证书文件") + @GetMapping("/validate/{certType}/{fileName}") + @PreAuthorize("hasAuthority('system:certificate:view')") + public ApiResult validateCertificate( + @Parameter(description = "证书类型", example = "wechat") @PathVariable String certType, + @Parameter(description = "文件名", example = "apiclient_cert.pem") @PathVariable String fileName) { + try { + CertificateService.CertificateInfo certInfo = + certificateService.validateX509Certificate(certType, fileName); + + if (certInfo != null) { + return success("证书验证成功", certInfo); + } else { + return new ApiResult<>(1, "证书验证失败,可能不是有效的X509证书"); + } + } catch (Exception e) { + log.error("验证证书失败: {}/{}", certType, fileName, e); + return new ApiResult<>(1, "验证证书失败: " + e.getMessage()); + } + } + + @Operation(summary = "检查证书文件是否存在") + @GetMapping("/exists/{certType}/{fileName}") + @PreAuthorize("hasAuthority('system:certificate:view')") + public ApiResult checkCertificateExists( + @Parameter(description = "证书类型", example = "alipay") @PathVariable String certType, + @Parameter(description = "文件名", example = "appCertPublicKey.crt") @PathVariable String fileName) { + try { + boolean exists = certificateService.certificateExists(certType, fileName); + String message = exists ? "证书文件存在" : "证书文件不存在"; + return success(message, exists); + } catch (Exception e) { + log.error("检查证书文件存在性失败: {}/{}", certType, fileName, e); + return new ApiResult<>(1, "检查证书文件存在性失败: " + e.getMessage()); + } + } + + @Operation(summary = "获取证书文件路径") + @GetMapping("/path/{certType}/{fileName}") + @PreAuthorize("hasAuthority('system:certificate:view')") + public ApiResult getCertificatePath( + @Parameter(description = "证书类型", example = "wechat") @PathVariable String certType, + @Parameter(description = "文件名", example = "wechatpay_cert.pem") @PathVariable String fileName) { + try { + String path = certificateService.getCertificateFilePath(certType, fileName); + return success("获取证书路径成功", path); + } catch (Exception e) { + log.error("获取证书路径失败: {}/{}", certType, fileName, e); + return new ApiResult<>(1, "获取证书路径失败: " + e.getMessage()); + } + } + + @Operation(summary = "获取微信支付证书路径") + @GetMapping("/wechat-path/{fileName}") + @PreAuthorize("hasAuthority('system:certificate:view')") + public ApiResult getWechatPayCertPath( + @Parameter(description = "文件名", example = "apiclient_key.pem") @PathVariable String fileName) { + try { + String path = certificateService.getWechatPayCertPath(fileName); + return success("获取微信支付证书路径成功", path); + } catch (Exception e) { + log.error("获取微信支付证书路径失败: {}", fileName, e); + return new ApiResult<>(1, "获取微信支付证书路径失败: " + e.getMessage()); + } + } + + @Operation(summary = "获取支付宝证书路径") + @GetMapping("/alipay-path/{fileName}") + @PreAuthorize("hasAuthority('system:certificate:view')") + public ApiResult getAlipayCertPath( + @Parameter(description = "文件名", example = "appCertPublicKey.crt") @PathVariable String fileName) { + try { + String path = certificateService.getAlipayCertPath(fileName); + return success("获取支付宝证书路径成功", path); + } catch (Exception e) { + log.error("获取支付宝证书路径失败: {}", fileName, e); + return new ApiResult<>(1, "获取支付宝证书路径失败: " + e.getMessage()); + } + } + + @Operation(summary = "检查数据库证书配置") + @GetMapping("/database-check") + @PreAuthorize("hasAuthority('system:certificate:view')") + public ApiResult> checkDatabaseCertificates() { + try { + Map result = certificateHealthService.checkDatabaseCertificates(); + return success("数据库证书检查完成", result); + } catch (Exception e) { + log.error("检查数据库证书配置失败", e); + return new ApiResult<>(1, "检查数据库证书配置失败: " + e.getMessage()); + } + } + + @Operation(summary = "刷新证书缓存") + @PostMapping("/refresh") + @PreAuthorize("hasAuthority('system:certificate:manage')") + public ApiResult refreshCertificateCache() { + try { + // 这里可以添加刷新证书缓存的逻辑 + log.info("证书缓存刷新请求,操作用户: {}", getLoginUser().getUsername()); + return new ApiResult<>(0, "证书缓存刷新成功", "success"); + } catch (Exception e) { + log.error("刷新证书缓存失败", e); + return new ApiResult<>(1, "刷新证书缓存失败: " + e.getMessage()); + } + } +} diff --git a/src/main/java/com/gxwebsoft/common/core/controller/LogAnalysisController.java b/src/main/java/com/gxwebsoft/common/core/controller/LogAnalysisController.java new file mode 100644 index 0000000..f022324 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/controller/LogAnalysisController.java @@ -0,0 +1,237 @@ +package com.gxwebsoft.common.core.controller; + +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.BaseController; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.extern.slf4j.Slf4j; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * 日志分析控制器 + * + * @author WebSoft + * @since 2025-01-20 + */ +@Slf4j +@RestController +@RequestMapping("/api/log-analysis") +@Tag(name = "日志分析", description = "日志分析和诊断接口") +public class LogAnalysisController extends BaseController { + + @Operation(summary = "分析系统日志") + @GetMapping("/analyze") + @PreAuthorize("hasAuthority('system:log:view')") + public ApiResult> analyzeSystemLogs( + @Parameter(description = "查询的小时数,默认24小时") @RequestParam(defaultValue = "24") int hours, + @Parameter(description = "日志级别过滤,如ERROR,WARN") @RequestParam(required = false) String level) { + + try { + Map analysis = new HashMap<>(); + + // 分析错误日志 + List> errorLogs = analyzeErrorLogs(hours); + analysis.put("errorLogs", errorLogs); + + // 分析安全事件 + List> securityEvents = analyzeSecurityEvents(hours); + analysis.put("securityEvents", securityEvents); + + // 分析性能问题 + List> performanceIssues = analyzePerformanceIssues(hours); + analysis.put("performanceIssues", performanceIssues); + + // 统计信息 + Map statistics = getLogStatistics(hours); + analysis.put("statistics", statistics); + + // 建议 + List recommendations = generateRecommendations(errorLogs, securityEvents, performanceIssues); + analysis.put("recommendations", recommendations); + + return success("日志分析完成", analysis); + + } catch (Exception e) { + log.error("分析系统日志失败", e); + return new ApiResult<>(1, "分析日志失败: " + e.getMessage()); + } + } + + @Operation(summary = "获取实时日志") + @GetMapping("/real-time") + @PreAuthorize("hasAuthority('system:log:view')") + public ApiResult> getRealTimeLogs( + @Parameter(description = "获取的行数") @RequestParam(defaultValue = "100") int lines) { + + try { + List recentLogs = getRecentLogLines(lines); + return success("获取实时日志成功", recentLogs); + + } catch (Exception e) { + log.error("获取实时日志失败", e); + return new ApiResult<>(1, "获取实时日志失败: " + e.getMessage()); + } + } + + @Operation(summary = "搜索日志") + @GetMapping("/search") + @PreAuthorize("hasAuthority('system:log:view')") + public ApiResult>> searchLogs( + @Parameter(description = "搜索关键词") @RequestParam String keyword, + @Parameter(description = "开始时间 yyyy-MM-dd HH:mm:ss") @RequestParam(required = false) String startTime, + @Parameter(description = "结束时间 yyyy-MM-dd HH:mm:ss") @RequestParam(required = false) String endTime) { + + try { + List> searchResults = searchLogsByKeyword(keyword, startTime, endTime); + return success("搜索日志成功", searchResults); + + } catch (Exception e) { + log.error("搜索日志失败", e); + return new ApiResult<>(1, "搜索日志失败: " + e.getMessage()); + } + } + + @Operation(summary = "清理旧日志") + @PostMapping("/cleanup") + @PreAuthorize("hasAuthority('system:log:delete')") + public ApiResult> cleanupOldLogs( + @Parameter(description = "保留天数") @RequestParam(defaultValue = "30") int keepDays) { + + try { + Map result = performLogCleanup(keepDays); + return success("日志清理完成", result); + + } catch (Exception e) { + log.error("清理日志失败", e); + return new ApiResult<>(1, "清理日志失败: " + e.getMessage()); + } + } + + /** + * 分析错误日志 + */ + private List> analyzeErrorLogs(int hours) { + List> errorLogs = new ArrayList<>(); + // 这里实现错误日志分析逻辑 + // 可以读取日志文件,解析ERROR级别的日志 + return errorLogs; + } + + /** + * 分析安全事件 + */ + private List> analyzeSecurityEvents(int hours) { + List> securityEvents = new ArrayList<>(); + // 这里实现安全事件分析逻辑 + // 可以检查登录失败、权限拒绝等安全相关事件 + return securityEvents; + } + + /** + * 分析性能问题 + */ + private List> analyzePerformanceIssues(int hours) { + List> performanceIssues = new ArrayList<>(); + // 这里实现性能问题分析逻辑 + // 可以检查慢查询、长时间处理的请求等 + return performanceIssues; + } + + /** + * 获取日志统计信息 + */ + private Map getLogStatistics(int hours) { + Map statistics = new HashMap<>(); + statistics.put("totalLogs", 0); + statistics.put("errorCount", 0); + statistics.put("warnCount", 0); + statistics.put("infoCount", 0); + // 这里实现统计逻辑 + return statistics; + } + + /** + * 生成建议 + */ + private List generateRecommendations(List> errorLogs, + List> securityEvents, + List> performanceIssues) { + List recommendations = new ArrayList<>(); + + if (!errorLogs.isEmpty()) { + recommendations.add("检测到错误日志,建议检查系统异常情况"); + } + + if (!securityEvents.isEmpty()) { + recommendations.add("检测到安全事件,建议加强安全监控"); + } + + if (!performanceIssues.isEmpty()) { + recommendations.add("检测到性能问题,建议优化系统性能"); + } + + if (recommendations.isEmpty()) { + recommendations.add("系统运行正常,无异常发现"); + } + + return recommendations; + } + + /** + * 获取最近的日志行 + */ + private List getRecentLogLines(int lines) throws IOException { + List recentLogs = new ArrayList<>(); + File logFile = new File("logs/websoft-core.log"); + + if (logFile.exists()) { + try (BufferedReader reader = new BufferedReader(new FileReader(logFile))) { + String line; + LinkedList buffer = new LinkedList<>(); + + while ((line = reader.readLine()) != null) { + buffer.add(line); + if (buffer.size() > lines) { + buffer.removeFirst(); + } + } + + recentLogs.addAll(buffer); + } + } + + return recentLogs; + } + + /** + * 根据关键词搜索日志 + */ + private List> searchLogsByKeyword(String keyword, String startTime, String endTime) { + List> results = new ArrayList<>(); + // 这里实现关键词搜索逻辑 + return results; + } + + /** + * 执行日志清理 + */ + private Map performLogCleanup(int keepDays) { + Map result = new HashMap<>(); + result.put("cleaned", false); + result.put("message", "日志清理功能待实现"); + // 这里实现日志清理逻辑 + return result; + } +} \ No newline at end of file diff --git a/src/main/java/com/gxwebsoft/common/core/controller/WechatCertTestController.java b/src/main/java/com/gxwebsoft/common/core/controller/WechatCertTestController.java new file mode 100644 index 0000000..396f5dc --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/controller/WechatCertTestController.java @@ -0,0 +1,157 @@ +package com.gxwebsoft.common.core.controller; + +import com.gxwebsoft.common.core.utils.WechatCertAutoConfig; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.BaseController; +import com.wechat.pay.java.core.Config; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; +import java.util.Map; + +/** + * 微信支付证书自动配置测试控制器 + * + * @author 科技小王子 + * @since 2024-07-26 + */ +@Slf4j +@RestController +@RequestMapping("/api/wechat-cert-test") +@Tag(name = "微信支付证书自动配置测试") +public class WechatCertTestController extends BaseController { + + @Autowired + private WechatCertAutoConfig wechatCertAutoConfig; + + @Operation(summary = "测试默认开发环境证书配置") + @PostMapping("/test-default") + public ApiResult> testDefaultConfig() { + Map result = new HashMap<>(); + + try { + log.info("开始测试默认开发环境证书配置..."); + + // 创建自动证书配置 + Config config = wechatCertAutoConfig.createDefaultDevConfig(); + + // 测试配置 + boolean testResult = wechatCertAutoConfig.testConfig(config); + + result.put("success", true); + result.put("configCreated", config != null); + result.put("testPassed", testResult); + result.put("message", "默认证书配置测试完成"); + result.put("instructions", wechatCertAutoConfig.getUsageInstructions()); + + log.info("✅ 默认证书配置测试成功"); + return success("测试成功", result); + + } catch (Exception e) { + log.error("❌ 默认证书配置测试失败: {}", e.getMessage(), e); + + result.put("success", false); + result.put("error", e.getMessage()); + result.put("message", "证书配置测试失败"); + result.put("troubleshooting", getTroubleshootingInfo()); + + return fail("测试失败: " + e.getMessage(), result); + } + } + + @Operation(summary = "测试自定义证书配置") + @PostMapping("/test-custom") + public ApiResult> testCustomConfig( + @Parameter(description = "商户号") @RequestParam String merchantId, + @Parameter(description = "私钥文件路径") @RequestParam String privateKeyPath, + @Parameter(description = "证书序列号") @RequestParam String merchantSerialNumber, + @Parameter(description = "APIv3密钥") @RequestParam String apiV3Key) { + + Map result = new HashMap<>(); + + try { + log.info("开始测试自定义证书配置..."); + log.info("商户号: {}", merchantId); + log.info("私钥路径: {}", privateKeyPath); + + // 创建自动证书配置 + Config config = wechatCertAutoConfig.createAutoConfig( + merchantId, privateKeyPath, merchantSerialNumber, apiV3Key); + + // 测试配置 + boolean testResult = wechatCertAutoConfig.testConfig(config); + + result.put("success", true); + result.put("configCreated", config != null); + result.put("testPassed", testResult); + result.put("message", "自定义证书配置测试完成"); + result.put("merchantId", merchantId); + result.put("privateKeyPath", privateKeyPath); + + log.info("✅ 自定义证书配置测试成功"); + return success("测试成功", result); + + } catch (Exception e) { + log.error("❌ 自定义证书配置测试失败: {}", e.getMessage(), e); + + result.put("success", false); + result.put("error", e.getMessage()); + result.put("message", "证书配置测试失败"); + result.put("troubleshooting", getTroubleshootingInfo()); + + return fail("测试失败: " + e.getMessage(), result); + } + } + + @Operation(summary = "获取使用说明") + @GetMapping("/instructions") + public ApiResult getInstructions() { + String instructions = wechatCertAutoConfig.getUsageInstructions(); + return success("获取使用说明成功", instructions); + } + + @Operation(summary = "获取故障排除信息") + @GetMapping("/troubleshooting") + public ApiResult> getTroubleshooting() { + Map troubleshooting = getTroubleshootingInfo(); + return success("获取故障排除信息成功", troubleshooting); + } + + /** + * 获取故障排除信息 + */ + private Map getTroubleshootingInfo() { + Map info = new HashMap<>(); + + info.put("commonIssues", Map.of( + "404错误", "商户平台未开启API安全功能或未申请使用微信支付公钥", + "证书序列号错误", "请检查商户平台中的证书序列号是否正确", + "APIv3密钥错误", "请确认APIv3密钥是否正确设置", + "私钥文件不存在", "请检查私钥文件路径是否正确", + "网络连接问题", "请检查网络连接是否正常" + )); + + info.put("solutions", Map.of( + "开启API安全", "登录微信商户平台 -> 账户中心 -> API安全 -> 申请使用微信支付公钥", + "获取证书序列号", "在API安全页面查看或重新下载证书", + "设置APIv3密钥", "在API安全页面设置APIv3密钥", + "检查私钥文件", "确保apiclient_key.pem文件存在且路径正确" + )); + + info.put("advantages", Map.of( + "自动下载", "RSAAutoCertificateConfig会自动下载平台证书", + "自动更新", "证书过期时会自动更新", + "简化管理", "无需手动管理wechatpay_cert.pem文件", + "官方推荐", "微信支付官方推荐的证书管理方式" + )); + + info.put("documentation", "https://pay.weixin.qq.com/doc/v3/merchant/4012153196"); + + return info; + } +} diff --git a/src/main/java/com/gxwebsoft/common/core/enums/ChatMessageType.java b/src/main/java/com/gxwebsoft/common/core/enums/ChatMessageType.java new file mode 100644 index 0000000..9ebb38e --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/enums/ChatMessageType.java @@ -0,0 +1,25 @@ +package com.gxwebsoft.common.core.enums; + +public enum ChatMessageType { + TEXT( 1, "text"), + IMAGE(2, "image"), + VOICE(3, "voice"), + CARD(4, "card"), + ; + + private int index; + + private String name; + ChatMessageType(int i, String text) { + this.name = text; + this.index = i; + } + + public String getName() { + return name; + } + + public int getIndex() { + return index; + } +} diff --git a/src/main/java/com/gxwebsoft/common/core/enums/GreenWebType.java b/src/main/java/com/gxwebsoft/common/core/enums/GreenWebType.java new file mode 100644 index 0000000..d9a0a5f --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/enums/GreenWebType.java @@ -0,0 +1,52 @@ +package com.gxwebsoft.common.core.enums; + +public enum GreenWebType { + /** + * 用户昵称 + */ + nickname_detection, + /** + * 聊天互动 + */ + chat_detection, + /** + * 动态评论 + */ + comment_detection, + /** + * 教学无聊 + */ + pgc_detection, + /** + * 图片检测service: baselineCheck通用基线检测 + */ + baselineCheck, + /** + * 视频检测 + */ + videoDetection; + + public enum ChatMessageType { + TEXT( 1, "text"), + IMAGE(2, "image"), + VOICE(3, "voice"), + CARD(4, "card"), + ; + + private int index; + + private String name; + ChatMessageType(int i, String text) { + this.name = text; + this.index = i; + } + + public String getName() { + return name; + } + + public int getIndex() { + return index; + } + } +} diff --git a/src/main/java/com/gxwebsoft/common/core/exception/BusinessException.java b/src/main/java/com/gxwebsoft/common/core/exception/BusinessException.java new file mode 100644 index 0000000..8e10e82 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/exception/BusinessException.java @@ -0,0 +1,48 @@ +package com.gxwebsoft.common.core.exception; + +import com.gxwebsoft.common.core.Constants; + +/** + * 自定义业务异常 + * + * @author WebSoft + * @since 2018-02-22 11:29:28 + */ +public class BusinessException extends RuntimeException { + private static final long serialVersionUID = 1L; + + private Integer code; + + public BusinessException() { + this(Constants.RESULT_ERROR_MSG); + } + + public BusinessException(String message) { + this(Constants.RESULT_ERROR_CODE, message); + } + + public BusinessException(Integer code, String message) { + super(message); + this.code = code; + } + + public BusinessException(Integer code, String message, Throwable cause) { + super(message, cause); + this.code = code; + } + + public BusinessException(Integer code, String message, Throwable cause, + boolean enableSuppression, boolean writableStackTrace) { + super(message, cause, enableSuppression, writableStackTrace); + this.code = code; + } + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + +} diff --git a/src/main/java/com/gxwebsoft/common/core/exception/GlobalExceptionHandler.java b/src/main/java/com/gxwebsoft/common/core/exception/GlobalExceptionHandler.java new file mode 100644 index 0000000..6649a2d --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/exception/GlobalExceptionHandler.java @@ -0,0 +1,56 @@ +package com.gxwebsoft.common.core.exception; + +import com.gxwebsoft.common.core.Constants; +import com.gxwebsoft.common.core.utils.CommonUtil; +import com.gxwebsoft.common.core.web.ApiResult; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.security.access.AccessDeniedException; +import org.springframework.web.HttpRequestMethodNotSupportedException; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseBody; + +import javax.servlet.http.HttpServletResponse; + +/** + * 全局异常处理器 + * + * @author WebSoft + * @since 2018-02-22 11:29:30 + */ +@ControllerAdvice +public class GlobalExceptionHandler { + private final Logger logger = LoggerFactory.getLogger(getClass()); + + @ResponseBody + @ExceptionHandler(HttpRequestMethodNotSupportedException.class) + public ApiResult methodNotSupportedExceptionHandler(HttpRequestMethodNotSupportedException e, + HttpServletResponse response) { + CommonUtil.addCrossHeaders(response); + return new ApiResult<>(Constants.RESULT_ERROR_CODE, "请求方式不正确").setError(e.toString()); + } + + @ResponseBody + @ExceptionHandler(AccessDeniedException.class) + public ApiResult accessDeniedExceptionHandler(AccessDeniedException e, HttpServletResponse response) { + CommonUtil.addCrossHeaders(response); + return new ApiResult<>(Constants.UNAUTHORIZED_CODE, Constants.UNAUTHORIZED_MSG).setError(e.toString()); + } + + @ResponseBody + @ExceptionHandler(BusinessException.class) + public ApiResult businessExceptionHandler(BusinessException e, HttpServletResponse response) { + CommonUtil.addCrossHeaders(response); + return new ApiResult<>(e.getCode(), e.getMessage()); + } + + @ResponseBody + @ExceptionHandler(Throwable.class) + public ApiResult exceptionHandler(Throwable e, HttpServletResponse response) { + logger.error(e.getMessage(), e); + CommonUtil.addCrossHeaders(response); + return new ApiResult<>(Constants.RESULT_ERROR_CODE, Constants.RESULT_ERROR_MSG).setError(e.toString()); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/core/security/JwtAccessDeniedHandler.java b/src/main/java/com/gxwebsoft/common/core/security/JwtAccessDeniedHandler.java new file mode 100644 index 0000000..66acb5c --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/security/JwtAccessDeniedHandler.java @@ -0,0 +1,29 @@ +package com.gxwebsoft.common.core.security; + +import com.gxwebsoft.common.core.Constants; +import com.gxwebsoft.common.core.utils.CommonUtil; +import org.springframework.security.access.AccessDeniedException; +import org.springframework.security.web.access.AccessDeniedHandler; +import org.springframework.stereotype.Component; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +/** + * 没有访问权限异常处理 + * + * @author WebSoft + * @since 2020-03-25 00:35:03 + */ +@Component +public class JwtAccessDeniedHandler implements AccessDeniedHandler { + + @Override + public void handle(HttpServletRequest request, HttpServletResponse response, AccessDeniedException e) + throws IOException, ServletException { + CommonUtil.responseError(response, Constants.UNAUTHORIZED_CODE, Constants.UNAUTHORIZED_MSG, e.getMessage()); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/core/security/JwtAuthenticationEntryPoint.java b/src/main/java/com/gxwebsoft/common/core/security/JwtAuthenticationEntryPoint.java new file mode 100644 index 0000000..42b7f3f --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/security/JwtAuthenticationEntryPoint.java @@ -0,0 +1,30 @@ +package com.gxwebsoft.common.core.security; + +import com.gxwebsoft.common.core.Constants; +import com.gxwebsoft.common.core.utils.CommonUtil; +import org.springframework.security.core.AuthenticationException; +import org.springframework.security.web.AuthenticationEntryPoint; +import org.springframework.stereotype.Component; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +/** + * 没有登录异常处理 + * + * @author WebSoft + * @since 2020-03-25 00:35:03 + */ +@Component +public class JwtAuthenticationEntryPoint implements AuthenticationEntryPoint { + + @Override + public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException e) + throws IOException, ServletException { + CommonUtil.responseError(response, Constants.UNAUTHENTICATED_CODE, Constants.UNAUTHENTICATED_MSG, + e.getMessage()); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/core/security/JwtAuthenticationFilter.java b/src/main/java/com/gxwebsoft/common/core/security/JwtAuthenticationFilter.java new file mode 100644 index 0000000..58f118e --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/security/JwtAuthenticationFilter.java @@ -0,0 +1,103 @@ +package com.gxwebsoft.common.core.security; + +import cn.hutool.core.util.StrUtil; +import com.gxwebsoft.common.core.Constants; +import com.gxwebsoft.common.core.config.ConfigProperties; +import com.gxwebsoft.common.core.utils.CommonUtil; +import com.gxwebsoft.common.core.utils.LogAnalysisUtil; +import com.gxwebsoft.common.core.utils.RedisUtil; +import com.gxwebsoft.common.core.utils.SignCheckUtil; +import com.gxwebsoft.common.system.entity.LoginRecord; +import com.gxwebsoft.common.system.entity.Menu; +import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.common.system.service.LoginRecordService; +import com.gxwebsoft.common.system.service.UserService; +import io.jsonwebtoken.Claims; +import io.jsonwebtoken.ExpiredJwtException; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.security.core.userdetails.UsernameNotFoundException; +import org.springframework.stereotype.Component; +import org.springframework.web.filter.OncePerRequestFilter; + +import javax.annotation.Resource; +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.Date; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 处理携带token的请求过滤器 + * + * @author WebSoft + * @since 2020-03-30 20:48:05 + */ +@Component +public class JwtAuthenticationFilter extends OncePerRequestFilter { + @Resource + private ConfigProperties configProperties; + @Resource + private UserService userService; + @Resource + private RedisUtil redisUtil; + @Resource + private LoginRecordService loginRecordService; + + @Override + protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) + throws ServletException, IOException { + String access_token = JwtUtil.getAccessToken(request); + if (StrUtil.isNotBlank(access_token)) { + try { + // 解析token + Claims claims = JwtUtil.parseToken(access_token, configProperties.getTokenKey()); + JwtSubject jwtSubject = JwtUtil.getJwtSubject(claims); + + // 校验服务器域名白名单 + final SignCheckUtil checkUtil = new SignCheckUtil(); + String key = "WhiteDomain:" + jwtSubject.getTenantId(); + List whiteDomains = redisUtil.get(key, List.class); + if (!checkUtil.checkWhiteDomains(whiteDomains, request.getServerName()) && !"localhost".equals(request.getServerName()) && !"server.gxwebsoft.com".equals(request.getServerName())) { + throw new UsernameNotFoundException("The requested domain name is not on the whitelist"); + } + + User user = userService.getByUsername(jwtSubject.getUsername(), jwtSubject.getTenantId()); + if (user == null) { + throw new UsernameNotFoundException("Username not found"); + } + List authorities = user.getAuthorities().stream() + .filter(m -> StrUtil.isNotBlank(m.getAuthority())).collect(Collectors.toList()); + UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken( + user, null, authorities); + SecurityContextHolder.getContext().setAuthentication(authentication); + + // token将要过期签发新token, 防止突然退出登录 + long expiration = (claims.getExpiration().getTime() - new Date().getTime()) / 1000 / 60; + if (expiration < configProperties.getTokenRefreshTime()) { + String token = JwtUtil.buildToken(jwtSubject, configProperties.getTokenExpireTime(), + configProperties.getTokenKey()); + response.addHeader(Constants.TOKEN_HEADER_NAME, token); + loginRecordService.saveAsync(user.getUsername(), LoginRecord.TYPE_REFRESH, null, + user.getTenantId(), request); + } + } catch (ExpiredJwtException e) { + LogAnalysisUtil.logSecurityEvent("JWT_TOKEN_EXPIRED", "unknown", e.getMessage(), request); + CommonUtil.responseError(response, Constants.TOKEN_EXPIRED_CODE, Constants.TOKEN_EXPIRED_MSG, + e.getMessage()); + return; + } catch (Exception e) { + LogAnalysisUtil.logSecurityEvent("JWT_AUTHENTICATION_FAILED", "unknown", e.getMessage(), request); + LogAnalysisUtil.logExceptionDetails(e, "JWT认证过程"); + CommonUtil.responseError(response, Constants.BAD_CREDENTIALS_CODE, Constants.BAD_CREDENTIALS_MSG, + e.toString()); + return; + } + } + chain.doFilter(request, response); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/core/security/JwtSubject.java b/src/main/java/com/gxwebsoft/common/core/security/JwtSubject.java new file mode 100644 index 0000000..1a0ff7d --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/security/JwtSubject.java @@ -0,0 +1,31 @@ +package com.gxwebsoft.common.core.security; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * Jwt载体 + * + * @author WebSoft + * @since 2021-09-03 00:11:12 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class JwtSubject implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 账号 + */ + private String username; + + /** + * 租户id + */ + private Integer tenantId; + +} diff --git a/src/main/java/com/gxwebsoft/common/core/security/JwtUtil.java b/src/main/java/com/gxwebsoft/common/core/security/JwtUtil.java new file mode 100644 index 0000000..2f05d23 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/security/JwtUtil.java @@ -0,0 +1,141 @@ +package com.gxwebsoft.common.core.security; + +import cn.hutool.core.util.StrUtil; +import cn.hutool.extra.servlet.ServletUtil; +import com.gxwebsoft.common.core.Constants; +import com.gxwebsoft.common.core.utils.JSONUtil; +import io.jsonwebtoken.Claims; +import io.jsonwebtoken.Jwts; +import io.jsonwebtoken.SignatureAlgorithm; +import io.jsonwebtoken.io.Decoders; +import io.jsonwebtoken.io.Encoders; +import io.jsonwebtoken.security.Keys; + +import javax.servlet.http.HttpServletRequest; +import java.security.Key; +import java.util.Date; + +/** + * JWT工具类 + * + * @author WebSoft + * @since 2018-01-21 16:30:59 + */ +public class JwtUtil { + + /** + * 获取请求中的access_token + * + * @param request HttpServletRequest + * @return String + */ + public static String getAccessToken(HttpServletRequest request) { + String access_token = ServletUtil.getHeaderIgnoreCase(request, Constants.TOKEN_HEADER_NAME); + if (StrUtil.isNotBlank(access_token)) { + if (access_token.startsWith(Constants.TOKEN_TYPE)) { + access_token = StrUtil.removePrefix(access_token, Constants.TOKEN_TYPE).trim(); + } + } else { + access_token = request.getParameter(Constants.TOKEN_PARAM_NAME); + } + return access_token; + } + + /** + * 生成token + * + * @param subject 载体 + * @param expire 过期时间 + * @param base64EncodedKey base64编码的Key + * @return token + */ + public static String buildToken(JwtSubject subject, Long expire, String base64EncodedKey) { + return buildToken(JSONUtil.toJSONString(subject), expire, decodeKey(base64EncodedKey)); + } + + /** + * 生成token + * + * @param subject 载体 + * @param expire 过期时间 + * @param key 密钥 + * @return token + */ + public static String buildToken(String subject, Long expire, Key key) { + Date expireDate = new Date(new Date().getTime() + 1000 * expire); + return Jwts.builder() + .setSubject(subject) + .setExpiration(expireDate) + .setIssuedAt(new Date()) + .signWith(key) + .compact(); + } + + /** + * 解析token + * + * @param token token + * @param base64EncodedKey base64编码的Key + * @return Claims + */ + public static Claims parseToken(String token, String base64EncodedKey) { + return parseToken(token, decodeKey(base64EncodedKey)); + } + + /** + * 解析token + * + * @param token token + * @param key 密钥 + * @return Claims + */ + public static Claims parseToken(String token, Key key) { + return Jwts.parserBuilder() + .setSigningKey(key) + .build() + .parseClaimsJws(token) + .getBody(); + } + + /** + * 获取JwtSubject + * + * @param claims Claims + * @return JwtSubject + */ + public static JwtSubject getJwtSubject(Claims claims) { + return JSONUtil.parseObject(claims.getSubject(), JwtSubject.class); + } + + /** + * 生成Key + * + * @return Key + */ + public static Key randomKey() { + return Keys.secretKeyFor(SignatureAlgorithm.HS256); + } + + /** + * base64编码key + * + * @return String + */ + public static String encodeKey(Key key) { + return Encoders.BASE64.encode(key.getEncoded()); + } + + /** + * base64编码Key + * + * @param base64EncodedKey base64编码的key + * @return Key + */ + public static Key decodeKey(String base64EncodedKey) { + if (StrUtil.isBlank(base64EncodedKey)) { + return null; + } + return Keys.hmacShaKeyFor(Decoders.BASE64.decode(base64EncodedKey)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/core/security/SecurityConfig.java b/src/main/java/com/gxwebsoft/common/core/security/SecurityConfig.java new file mode 100644 index 0000000..c6c34d3 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/security/SecurityConfig.java @@ -0,0 +1,121 @@ +package com.gxwebsoft.common.core.security; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.HttpMethod; +import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; +import org.springframework.security.config.http.SessionCreationPolicy; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; + +import javax.annotation.Resource; + +/** + * Spring Security配置 + * + * @author WebSoft + * @since 2020-03-23 18:04:52 + */ +@Configuration +@EnableWebSecurity +@EnableGlobalMethodSecurity(prePostEnabled = true) +public class SecurityConfig extends WebSecurityConfigurerAdapter { + @Resource + private JwtAccessDeniedHandler jwtAccessDeniedHandler; + @Resource + private JwtAuthenticationEntryPoint jwtAuthenticationEntryPoint; + @Resource + private JwtAuthenticationFilter jwtAuthenticationFilter; + + @Override + protected void configure(HttpSecurity http) throws Exception { + http.authorizeRequests() + .antMatchers(HttpMethod.OPTIONS, "/**") + .permitAll() + .antMatchers(HttpMethod.GET, "/api/file/**","/**", "/api/captcha", "/") + .permitAll() + .antMatchers( + "/api/login", + "/api/qr-login/**", + "/api/loginByUserId", + "/api/register", + "/api/superAdminRegister", + "/api/findAccountByPhone", + "/api/resetPassword", + "/api/checkPhoneRegistered", + "/api/existence", + "/api/oss/upload", + "/druid/**", + "/swagger-resources/**", + "/webjars/**", + "/hxz/v1/**", + "/api/sendSmsCaptcha", + "/api/loginBySms", + "/api/system/user/regByPhone", + "/api/parseToken/*", + "/api/login-alipay/*", + "/api/wx-login/loginByMpWxPhone", + "/api/wx-login/getAccessToken", + "/api/wx-login/loginByOpenId", + "/api/wx-login/getOpenId", + "/api/wx-login/getWxOpenIdOnly", + "/api/system/wx-native-pay/**", + "/api/system/wx-pay/**", + "/api/wxWorkQrConnect", + "/api/sys/user-plan-log/wx-pay/**", + "/api/wx-official/**", + "/api/system/user/loginByPhoneForTest", + "/api/system/user/updateUserBalanceWithoutLogin", + "/api/system/user/addUserBalanceWithoutLogin", + "/api/system/user/getUserWithoutLogin", + "/api/system/user/batchBackUserId", + "/api/system/user/getByPhone/**", + "/api/system/user/getByUserId/**", + "/api/system/user/getByUnionid/**", + "/api/system/user/updateUserOfficeOpenidWithoutLogin", + "/api/system/user/updateWithoutLogin", + "/api/system/user-referee/getReferee/**", + "/api/system/dict-data/page", + "/api/system/organization", + "/api/system/tenant/saveByPhone", + "/api/system/user-referee/getRefereeNum", + "/api/system/user-referee/getRefereeNumByUidList", + "/api/system/setting/getByKey/**", + "/api/system/setting/updateByKey/**", + "/lvQ4EoivKJ.txt", + "/api/wechat-cert-test", + "/MP_verify_joj96VBHPtL9YROj.txt" + ) + .permitAll() + .anyRequest() + .authenticated() + .and() + .sessionManagement() + .sessionCreationPolicy(SessionCreationPolicy.STATELESS) + .and() + .csrf() + .disable() + .cors() + .and() + .logout() + .disable() + .headers() + .frameOptions() + .disable() + .and() + .exceptionHandling() + .accessDeniedHandler(jwtAccessDeniedHandler) + .authenticationEntryPoint(jwtAuthenticationEntryPoint) + .and() + .addFilterBefore(jwtAuthenticationFilter, UsernamePasswordAuthenticationFilter.class); + } + + @Bean + public BCryptPasswordEncoder bCryptPasswordEncoder() { + return new BCryptPasswordEncoder(); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/core/service/CertificateHealthService.java b/src/main/java/com/gxwebsoft/common/core/service/CertificateHealthService.java new file mode 100644 index 0000000..b621f40 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/service/CertificateHealthService.java @@ -0,0 +1,423 @@ +package com.gxwebsoft.common.core.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.gxwebsoft.common.core.config.CertificateProperties; +import com.gxwebsoft.common.core.config.ConfigProperties; +import com.gxwebsoft.common.system.entity.Payment; +import com.gxwebsoft.common.system.service.PaymentService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.io.File; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 证书健康检查服务 + * 提供证书状态检查和健康监控功能 + * + * @author 科技小王子 + * @since 2024-07-26 + */ +@Slf4j +@Service +public class CertificateHealthService { + + private final CertificateService certificateService; + private final CertificateProperties certificateProperties; + + @Resource + private PaymentService paymentService; + + @Resource + private ConfigProperties configProperties; + + @Value("${spring.profiles.active:dev}") + private String active; + + public CertificateHealthService(CertificateService certificateService, + CertificateProperties certificateProperties) { + this.certificateService = certificateService; + this.certificateProperties = certificateProperties; + } + + /** + * 获取当前租户ID + */ + private Integer getCurrentTenantId() { + try { + Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); + if (authentication != null && authentication.getPrincipal() instanceof com.gxwebsoft.common.system.entity.User) { + return ((com.gxwebsoft.common.system.entity.User) authentication.getPrincipal()).getTenantId(); + } + } catch (Exception e) { + log.warn("获取当前租户ID失败: {}", e.getMessage()); + } + return 1; // 默认租户ID + } + + /** + * 自定义健康检查结果类 + */ + public static class HealthResult { + private final String status; + private final Map details; + + public HealthResult(String status, Map details) { + this.status = status; + this.details = details; + } + + public String getStatus() { + return status; + } + + public Map getDetails() { + return details; + } + + public static HealthResult up(Map details) { + return new HealthResult("UP", details); + } + + public static HealthResult down(Map details) { + return new HealthResult("DOWN", details); + } + } + + public HealthResult health() { + try { + Map details = new HashMap<>(); + boolean allHealthy = true; + + // 检查微信支付证书(配置文件模式) + Map wechatHealth = checkWechatPayCertificates(); + details.put("wechatPay", wechatHealth); + if (!(Boolean) wechatHealth.get("healthy")) { + allHealthy = false; + } + + // 检查支付宝证书(配置文件模式) + Map alipayHealth = checkAlipayCertificates(); + details.put("alipay", alipayHealth); + if (!(Boolean) alipayHealth.get("healthy")) { + allHealthy = false; + } + + // 检查数据库中的支付配置证书路径 + Map databaseCertHealth = checkDatabaseCertificates(); + details.put("databaseCertificates", databaseCertHealth); + if (!(Boolean) databaseCertHealth.get("healthy")) { + allHealthy = false; + } + + // 添加系统信息 + details.put("loadMode", certificateProperties.getLoadMode()); + details.put("certRootPath", certificateProperties.getCertRootPath()); + details.put("currentEnvironment", active); + + if (allHealthy) { + return HealthResult.up(details); + } else { + return HealthResult.down(details); + } + + } catch (Exception e) { + log.error("证书健康检查失败", e); + Map errorDetails = new HashMap<>(); + errorDetails.put("error", e.getMessage()); + return HealthResult.down(errorDetails); + } + } + + /** + * 检查微信支付证书健康状态 + */ + private Map checkWechatPayCertificates() { + Map health = new HashMap<>(); + boolean healthy = true; + Map certificates = new HashMap<>(); + + CertificateProperties.WechatPayConfig wechatConfig = certificateProperties.getWechatPay(); + + // 检查私钥证书 + String privateKeyFile = wechatConfig.getDev().getPrivateKeyFile(); + boolean privateKeyExists = certificateService.certificateExists("wechat", privateKeyFile); + certificates.put("privateKey", Map.of( + "file", privateKeyFile, + "exists", privateKeyExists, + "path", certificateService.getWechatPayCertPath(privateKeyFile) + )); + if (!privateKeyExists) healthy = false; + + // 检查商户证书 + String apiclientCertFile = wechatConfig.getDev().getApiclientCertFile(); + boolean apiclientCertExists = certificateService.certificateExists("wechat", apiclientCertFile); + certificates.put("apiclientCert", Map.of( + "file", apiclientCertFile, + "exists", apiclientCertExists, + "path", certificateService.getWechatPayCertPath(apiclientCertFile) + )); + if (!apiclientCertExists) healthy = false; + + // 检查微信支付平台证书 + String wechatpayCertFile = wechatConfig.getDev().getWechatpayCertFile(); + boolean wechatpayCertExists = certificateService.certificateExists("wechat", wechatpayCertFile); + certificates.put("wechatpayCert", Map.of( + "file", wechatpayCertFile, + "exists", wechatpayCertExists, + "path", certificateService.getWechatPayCertPath(wechatpayCertFile) + )); + if (!wechatpayCertExists) healthy = false; + + health.put("healthy", healthy); + health.put("certificates", certificates); + return health; + } + + /** + * 检查支付宝证书健康状态 + */ + private Map checkAlipayCertificates() { + Map health = new HashMap<>(); + boolean healthy = true; + Map certificates = new HashMap<>(); + + CertificateProperties.AlipayConfig alipayConfig = certificateProperties.getAlipay(); + + // 检查应用私钥 + String appPrivateKeyFile = alipayConfig.getAppPrivateKeyFile(); + boolean appPrivateKeyExists = certificateService.certificateExists("alipay", appPrivateKeyFile); + certificates.put("appPrivateKey", Map.of( + "file", appPrivateKeyFile, + "exists", appPrivateKeyExists, + "path", certificateService.getAlipayCertPath(appPrivateKeyFile) + )); + if (!appPrivateKeyExists) healthy = false; + + // 检查应用公钥证书 + String appCertPublicKeyFile = alipayConfig.getAppCertPublicKeyFile(); + boolean appCertExists = certificateService.certificateExists("alipay", appCertPublicKeyFile); + certificates.put("appCertPublicKey", Map.of( + "file", appCertPublicKeyFile, + "exists", appCertExists, + "path", certificateService.getAlipayCertPath(appCertPublicKeyFile) + )); + if (!appCertExists) healthy = false; + + // 检查支付宝公钥证书 + String alipayCertPublicKeyFile = alipayConfig.getAlipayCertPublicKeyFile(); + boolean alipayCertExists = certificateService.certificateExists("alipay", alipayCertPublicKeyFile); + certificates.put("alipayCertPublicKey", Map.of( + "file", alipayCertPublicKeyFile, + "exists", alipayCertExists, + "path", certificateService.getAlipayCertPath(alipayCertPublicKeyFile) + )); + if (!alipayCertExists) healthy = false; + + // 检查支付宝根证书 + String alipayRootCertFile = alipayConfig.getAlipayRootCertFile(); + boolean rootCertExists = certificateService.certificateExists("alipay", alipayRootCertFile); + certificates.put("alipayRootCert", Map.of( + "file", alipayRootCertFile, + "exists", rootCertExists, + "path", certificateService.getAlipayCertPath(alipayRootCertFile) + )); + if (!rootCertExists) healthy = false; + + health.put("healthy", healthy); + health.put("certificates", certificates); + return health; + } + + /** + * 获取详细的证书诊断信息 + */ + public Map getDiagnosticInfo() { + Map diagnostic = new HashMap<>(); + + try { + // 基本系统信息 + diagnostic.put("loadMode", certificateProperties.getLoadMode()); + diagnostic.put("certRootPath", certificateProperties.getCertRootPath()); + diagnostic.put("devCertPath", certificateProperties.getDevCertPath()); + + // 获取所有证书状态 + diagnostic.put("certificateStatus", certificateService.getAllCertificateStatus()); + + // 健康检查结果 + HealthResult health = health(); + diagnostic.put("healthStatus", health.getStatus()); + diagnostic.put("healthDetails", health.getDetails()); + + } catch (Exception e) { + log.error("获取证书诊断信息失败", e); + diagnostic.put("error", e.getMessage()); + } + + return diagnostic; + } + + /** + * 检查特定证书的详细信息 + */ + public Map checkSpecificCertificate(String certType, String fileName) { + Map result = new HashMap<>(); + + try { + boolean exists = certificateService.certificateExists(certType, fileName); + String path = certificateService.getCertificateFilePath(certType, fileName); + + result.put("certType", certType); + result.put("fileName", fileName); + result.put("exists", exists); + result.put("path", path); + + if (exists && (fileName.endsWith(".crt") || fileName.endsWith(".pem"))) { + // 尝试验证证书 + CertificateService.CertificateInfo certInfo = + certificateService.validateX509Certificate(certType, fileName); + result.put("certificateInfo", certInfo); + } + + } catch (Exception e) { + log.error("检查证书失败: {}/{}", certType, fileName, e); + result.put("error", e.getMessage()); + } + + return result; + } + + /** + * 检查数据库中存储的证书路径 + */ + public Map checkDatabaseCertificates() { + Map health = new HashMap<>(); + boolean healthy = true; + Map certificates = new HashMap<>(); + + try { + Integer tenantId = getCurrentTenantId(); + log.info("检查租户 {} 的数据库证书配置", tenantId); + + // 查询微信支付配置 + List wechatPayments = paymentService.list( + new LambdaQueryWrapper() + .eq(Payment::getCode, "wxPay") + .eq(Payment::getStatus, true) + .eq(Payment::getTenantId, tenantId) + ); + + Map wechatDbCerts = new HashMap<>(); + if (!wechatPayments.isEmpty()) { + Payment wechatPayment = wechatPayments.get(0); + log.info("找到微信支付配置: 商户号={}, 序列号={}", wechatPayment.getMchId(), wechatPayment.getMerchantSerialNumber()); + + // 检查微信支付证书路径 + String apiclientKey = wechatPayment.getApiclientKey(); + String apiclientCert = wechatPayment.getApiclientCert(); + + if (apiclientKey != null && !apiclientKey.isEmpty()) { + String keyPath = getAbsoluteCertPath(apiclientKey); + boolean keyExists = new File(keyPath).exists(); + wechatDbCerts.put("privateKey", Map.of( + "relativePath", apiclientKey, + "absolutePath", keyPath, + "exists", keyExists + )); + log.info("微信支付私钥证书 - 相对路径: {}, 绝对路径: {}, 存在: {}", apiclientKey, keyPath, keyExists); + if (!keyExists) healthy = false; + } else { + wechatDbCerts.put("privateKey", Map.of("error", "私钥路径未配置")); + healthy = false; + } + + if (apiclientCert != null && !apiclientCert.isEmpty()) { + String certPath = getAbsoluteCertPath(apiclientCert); + boolean certExists = new File(certPath).exists(); + wechatDbCerts.put("certificate", Map.of( + "relativePath", apiclientCert, + "absolutePath", certPath, + "exists", certExists + )); + log.info("微信支付证书 - 相对路径: {}, 绝对路径: {}, 存在: {}", apiclientCert, certPath, certExists); + if (!certExists) healthy = false; + } else { + wechatDbCerts.put("certificate", Map.of("error", "证书路径未配置")); + healthy = false; + } + + wechatDbCerts.put("merchantId", wechatPayment.getMchId()); + wechatDbCerts.put("serialNumber", wechatPayment.getMerchantSerialNumber()); + wechatDbCerts.put("apiV3Key", wechatPayment.getApiKey() != null ? "已配置" : "未配置"); + + } else { + wechatDbCerts.put("error", "未找到微信支付配置"); + healthy = false; + log.warn("租户 {} 未找到微信支付配置", tenantId); + } + + certificates.put("wechatPay", wechatDbCerts); + + // 查询支付宝配置(如果有的话) + List alipayPayments = paymentService.list( + new LambdaQueryWrapper() + .eq(Payment::getCode, "alipay") + .eq(Payment::getStatus, true) + .eq(Payment::getTenantId, tenantId) + ); + + Map alipayDbCerts = new HashMap<>(); + if (!alipayPayments.isEmpty()) { + Payment alipayPayment = alipayPayments.get(0); + log.info("找到支付宝配置: 应用ID={}", alipayPayment.getAppId()); + + // 这里可以添加支付宝证书路径检查逻辑 + alipayDbCerts.put("appId", alipayPayment.getAppId()); + alipayDbCerts.put("status", "支付宝配置存在,但证书路径检查需要根据具体字段实现"); + } else { + alipayDbCerts.put("status", "未找到支付宝配置"); + log.info("租户 {} 未找到支付宝配置", tenantId); + } + + certificates.put("alipay", alipayDbCerts); + + } catch (Exception e) { + log.error("检查数据库证书配置失败", e); + certificates.put("error", e.getMessage()); + healthy = false; + } + + health.put("healthy", healthy); + health.put("certificates", certificates); + return health; + } + + /** + * 获取证书的完整绝对路径 + */ + private String getAbsoluteCertPath(String relativePath) { + if (relativePath == null || relativePath.isEmpty()) { + return ""; + } + + // 如果是生产环境,证书存储在上传目录 + if (!"dev".equals(active)) { + String uploadPath = configProperties.getUploadPath(); + // 修改路径拼接规则:uploadPath + "file" + 数据库存储的相对路径 + String fullPath = uploadPath + "file" + relativePath; + log.debug("生产环境证书路径构建 - 上传根路径: {}, 相对路径: {}, 完整路径: {}", + uploadPath, relativePath, fullPath); + return fullPath; + } else { + // 开发环境,可能需要不同的处理逻辑 + log.debug("开发环境证书路径: {}", relativePath); + return relativePath; + } + } +} diff --git a/src/main/java/com/gxwebsoft/common/core/service/CertificateService.java b/src/main/java/com/gxwebsoft/common/core/service/CertificateService.java new file mode 100644 index 0000000..6d013ea --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/service/CertificateService.java @@ -0,0 +1,321 @@ +package com.gxwebsoft.common.core.service; + +import com.gxwebsoft.common.core.config.CertificateProperties; +import lombok.extern.slf4j.Slf4j; +import org.springframework.core.io.ClassPathResource; +import org.springframework.core.io.Resource; +import org.springframework.stereotype.Service; + +import javax.annotation.PostConstruct; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +/** + * 证书管理服务 + * 负责处理不同环境下的证书加载、验证和管理 + * + * @author 科技小王子 + * @since 2024-07-26 + */ +@Slf4j +@Service +public class CertificateService { + + private final CertificateProperties certificateProperties; + + public CertificateService(CertificateProperties certificateProperties) { + this.certificateProperties = certificateProperties; + } + + @PostConstruct + public void init() { + log.info("证书服务初始化,当前加载模式: {}", certificateProperties.getLoadMode()); + log.info("证书根路径: {}", certificateProperties.getCertRootPath()); + + // 检查证书目录和文件 + checkCertificateDirectories(); + } + + /** + * 获取证书文件的输入流 + * + * @param certType 证书类型(wechat/alipay) + * @param fileName 文件名 + * @return 输入流 + * @throws IOException 文件读取异常 + */ + public InputStream getCertificateInputStream(String certType, String fileName) throws IOException { + String certPath = certificateProperties.getCertificatePath(certType, fileName); + + if (certificateProperties.isClasspathMode()) { + // 从classpath加载 + Resource resource = new ClassPathResource(certPath); + if (!resource.exists()) { + throw new IOException("证书文件不存在: " + certPath); + } + log.debug("从classpath加载证书: {}", certPath); + return resource.getInputStream(); + } else { + // 从文件系统加载 + File file = new File(certPath); + if (!file.exists()) { + throw new IOException("证书文件不存在: " + certPath); + } + log.debug("从文件系统加载证书: {}", certPath); + return Files.newInputStream(file.toPath()); + } + } + + /** + * 获取证书文件路径 + * + * @param certType 证书类型 + * @param fileName 文件名 + * @return 文件路径 + */ + public String getCertificateFilePath(String certType, String fileName) { + return certificateProperties.getCertificatePath(certType, fileName); + } + + /** + * 检查证书文件是否存在 + * + * @param certType 证书类型 + * @param fileName 文件名 + * @return 是否存在 + */ + public boolean certificateExists(String certType, String fileName) { + try { + String certPath = certificateProperties.getCertificatePath(certType, fileName); + + if (certificateProperties.isClasspathMode()) { + Resource resource = new ClassPathResource(certPath); + return resource.exists(); + } else { + File file = new File(certPath); + return file.exists() && file.isFile(); + } + } catch (Exception e) { + log.error("检查证书文件存在性时出错: {}", e.getMessage()); + return false; + } + } + + /** + * 获取微信支付证书路径 + * + * @param fileName 文件名 + * @return 证书路径 + */ + public String getWechatPayCertPath(String fileName) { + String certPath = certificateProperties.getWechatPayCertPath(fileName); + log.debug("获取微信支付证书路径 - 文件名: {}, 路径: {}", fileName, certPath); + + // 打印完整的绝对路径信息 + if (certificateProperties.isClasspathMode()) { + log.info("微信支付证书路径模式: CLASSPATH"); + log.info("微信支付证书相对路径: {}", certPath); + try { + ClassPathResource resource = new ClassPathResource(certPath); + if (resource.exists()) { + String absolutePath = resource.getFile().getAbsolutePath(); + log.info("微信支付证书完整绝对路径: {}", absolutePath); + } else { + log.warn("微信支付证书文件不存在于classpath: {}", certPath); + } + } catch (Exception e) { + log.warn("无法获取微信支付证书绝对路径: {}", e.getMessage()); + } + } else { + File file = new File(certPath); + String absolutePath = file.getAbsolutePath(); + log.info("微信支付证书路径模式: FILESYSTEM"); + log.info("微信支付证书完整绝对路径: {}", absolutePath); + log.info("微信支付证书文件是否存在: {}", file.exists()); + } + + return certPath; + } + + /** + * 获取支付宝证书路径 + * + * @param fileName 文件名 + * @return 证书路径 + */ + public String getAlipayCertPath(String fileName) { + String certPath = certificateProperties.getAlipayCertPath(fileName); + log.debug("获取支付宝证书路径 - 文件名: {}, 路径: {}", fileName, certPath); + + // 打印完整的绝对路径信息 + if (certificateProperties.isClasspathMode()) { + log.info("支付宝证书路径模式: CLASSPATH"); + log.info("支付宝证书相对路径: {}", certPath); + try { + ClassPathResource resource = new ClassPathResource(certPath); + if (resource.exists()) { + String absolutePath = resource.getFile().getAbsolutePath(); + log.info("支付宝证书完整绝对路径: {}", absolutePath); + } else { + log.warn("支付宝证书文件不存在于classpath: {}", certPath); + } + } catch (Exception e) { + log.warn("无法获取支付宝证书绝对路径: {}", e.getMessage()); + } + } else { + File file = new File(certPath); + String absolutePath = file.getAbsolutePath(); + log.info("支付宝证书路径模式: FILESYSTEM"); + log.info("支付宝证书完整绝对路径: {}", absolutePath); + log.info("支付宝证书文件是否存在: {}", file.exists()); + } + + return certPath; + } + + /** + * 验证X509证书 + * + * @param certType 证书类型 + * @param fileName 文件名 + * @return 证书信息 + */ + public CertificateInfo validateX509Certificate(String certType, String fileName) { + try (InputStream inputStream = getCertificateInputStream(certType, fileName)) { + CertificateFactory cf = CertificateFactory.getInstance("X.509"); + X509Certificate cert = (X509Certificate) cf.generateCertificate(inputStream); + + CertificateInfo info = new CertificateInfo(); + info.setSubject(cert.getSubjectX500Principal().toString()); + info.setIssuer(cert.getIssuerX500Principal().toString()); + info.setNotBefore(cert.getNotBefore()); + info.setNotAfter(cert.getNotAfter()); + info.setSerialNumber(cert.getSerialNumber().toString()); + info.setValid(isValidDate(cert.getNotBefore(), cert.getNotAfter())); + + return info; + } catch (Exception e) { + log.error("验证证书失败: {}/{}, 错误: {}", certType, fileName, e.getMessage()); + return null; + } + } + + /** + * 检查证书目录结构 + */ + private void checkCertificateDirectories() { + String[] certTypes = {"wechat", "alipay"}; + + for (String certType : certTypes) { + if (!certificateProperties.isClasspathMode()) { + // 检查文件系统目录 + String dirPath = certificateProperties.getCertificatePath(certType, ""); + File dir = new File(dirPath); + if (!dir.exists()) { + log.warn("证书目录不存在: {}", dirPath); + } else { + log.info("证书目录存在: {}", dirPath); + } + } + } + } + + /** + * 获取所有证书状态 + * + * @return 证书状态映射 + */ + public Map getAllCertificateStatus() { + Map status = new HashMap<>(); + + // 微信支付证书状态 + Map wechatStatus = new HashMap<>(); + CertificateProperties.WechatPayConfig wechatConfig = certificateProperties.getWechatPay(); + wechatStatus.put("privateKey", getCertStatus("wechat", wechatConfig.getDev().getPrivateKeyFile())); + wechatStatus.put("apiclientCert", getCertStatus("wechat", wechatConfig.getDev().getApiclientCertFile())); + wechatStatus.put("wechatpayCert", getCertStatus("wechat", wechatConfig.getDev().getWechatpayCertFile())); + status.put("wechat", wechatStatus); + + // 支付宝证书状态 + Map alipayStatus = new HashMap<>(); + CertificateProperties.AlipayConfig alipayConfig = certificateProperties.getAlipay(); + alipayStatus.put("appPrivateKey", getCertStatus("alipay", alipayConfig.getAppPrivateKeyFile())); + alipayStatus.put("appCertPublicKey", getCertStatus("alipay", alipayConfig.getAppCertPublicKeyFile())); + alipayStatus.put("alipayCertPublicKey", getCertStatus("alipay", alipayConfig.getAlipayCertPublicKeyFile())); + alipayStatus.put("alipayRootCert", getCertStatus("alipay", alipayConfig.getAlipayRootCertFile())); + status.put("alipay", alipayStatus); + + // 系统信息 + Map systemInfo = new HashMap<>(); + systemInfo.put("loadMode", certificateProperties.getLoadMode()); + systemInfo.put("certRootPath", certificateProperties.getCertRootPath()); + systemInfo.put("devCertPath", certificateProperties.getDevCertPath()); + status.put("system", systemInfo); + + return status; + } + + /** + * 获取单个证书状态 + */ + private Map getCertStatus(String certType, String fileName) { + Map status = new HashMap<>(); + status.put("fileName", fileName); + status.put("exists", certificateExists(certType, fileName)); + status.put("path", getCertificateFilePath(certType, fileName)); + + // 如果是.crt或.pem文件,尝试验证证书 + if (fileName.endsWith(".crt") || fileName.endsWith(".pem")) { + CertificateInfo certInfo = validateX509Certificate(certType, fileName); + status.put("certificateInfo", certInfo); + } + + return status; + } + + /** + * 检查日期是否有效 + */ + private boolean isValidDate(Date notBefore, Date notAfter) { + Date now = new Date(); + return now.after(notBefore) && now.before(notAfter); + } + + /** + * 证书信息类 + */ + public static class CertificateInfo { + private String subject; + private String issuer; + private Date notBefore; + private Date notAfter; + private String serialNumber; + private boolean valid; + + // Getters and Setters + public String getSubject() { return subject; } + public void setSubject(String subject) { this.subject = subject; } + + public String getIssuer() { return issuer; } + public void setIssuer(String issuer) { this.issuer = issuer; } + + public Date getNotBefore() { return notBefore; } + public void setNotBefore(Date notBefore) { this.notBefore = notBefore; } + + public Date getNotAfter() { return notAfter; } + public void setNotAfter(Date notAfter) { this.notAfter = notAfter; } + + public String getSerialNumber() { return serialNumber; } + public void setSerialNumber(String serialNumber) { this.serialNumber = serialNumber; } + + public boolean isValid() { return valid; } + public void setValid(boolean valid) { this.valid = valid; } + } +} diff --git a/src/main/java/com/gxwebsoft/common/core/service/PaymentCacheService.java b/src/main/java/com/gxwebsoft/common/core/service/PaymentCacheService.java new file mode 100644 index 0000000..17a8e32 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/service/PaymentCacheService.java @@ -0,0 +1,174 @@ +package com.gxwebsoft.common.core.service; + +import cn.hutool.core.util.ObjectUtil; +import com.gxwebsoft.common.core.exception.BusinessException; +import com.gxwebsoft.common.core.utils.RedisUtil; +import com.gxwebsoft.common.system.entity.Payment; +import com.gxwebsoft.common.system.param.PaymentParam; +import com.gxwebsoft.common.system.service.PaymentService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 支付配置缓存服务 + * 统一管理支付配置的缓存读取,支持 Payment:1* 格式 + * + * @author 科技小王子 + * @since 2025-07-27 + */ +@Slf4j +@Service +public class PaymentCacheService { + + @Autowired + private RedisUtil redisUtil; + + @Autowired + private PaymentService paymentService; + + /** + * 根据支付类型获取支付配置 + * 优先从 Payment:1{payType} 格式的缓存读取 + * + * @param payType 支付类型 (0=微信支付, 1=支付宝, 2=其他) + * @param tenantId 租户ID (用于兜底查询) + * @return Payment 支付配置 + */ + public Payment getPaymentConfig(Integer payType, Integer tenantId) { + // 1. 优先使用 Payment:1{payType} 格式的缓存键 + String primaryKey = "Payment:1:" + tenantId; + Payment payment = redisUtil.get(primaryKey, Payment.class); + + if (ObjectUtil.isNotEmpty(payment)) { + log.debug("从缓存获取支付配置成功: {}", primaryKey); + return payment; + } + + // 2. 如果 Payment:1* 格式不存在,尝试原有格式 + String fallbackKey = "Payment:" + payType + ":" + tenantId; + payment = redisUtil.get(fallbackKey, Payment.class); + + if (ObjectUtil.isNotEmpty(payment)) { + log.debug("从兜底缓存获取支付配置成功: {}", fallbackKey); + // 将查询结果缓存到 Payment:1* 格式 + redisUtil.set(primaryKey, payment); + return payment; + } + + // 3. 最后从数据库查询 + log.debug("从数据库查询支付配置, payType: {}, tenantId: {}", payType, tenantId); + PaymentParam paymentParam = new PaymentParam(); + paymentParam.setType(payType); + paymentParam.setTenantId(tenantId); // 设置租户ID进行过滤 + List payments = paymentService.listRel(paymentParam); + + if (payments.isEmpty()) { + throw new BusinessException("请完成支付配置,支付类型: " + payType); + } + + Payment dbPayment = payments.get(0); + + // 清理时间字段,避免序列化问题 + Payment cachePayment = cleanPaymentForCache(dbPayment); + + // 将查询结果缓存到 Payment:1* 格式 + redisUtil.set(primaryKey, cachePayment); + log.debug("支付配置已缓存到: {}", primaryKey); + + return dbPayment; // 返回原始对象,不影响业务逻辑 + } + + /** + * 缓存支付配置 + * 同时缓存到 Payment:1{payType} 和原有格式 + * + * @param payment 支付配置 + * @param tenantId 租户ID + */ + public void cachePaymentConfig(Payment payment, Integer tenantId) { + // 缓存到 Payment:1* 格式 + String primaryKey = "Payment:1" + payment.getCode(); + redisUtil.set(primaryKey, payment); + log.debug("支付配置已缓存到: {}", primaryKey); + + // 兼容原有格式 + String legacyKey = "Payment:" + payment.getCode() + ":" + tenantId; + redisUtil.set(legacyKey, payment); + log.debug("支付配置已缓存到兼容格式: {}", legacyKey); + } + + /** + * 删除支付配置缓存 + * 同时删除 Payment:1{payType} 和原有格式 + * + * @param paymentCode 支付代码 (可以是String或Integer) + * @param tenantId 租户ID + */ + public void removePaymentConfig(String paymentCode, Integer tenantId) { + // 删除 Payment:1* 格式缓存 + String primaryKey = "Payment:1" + paymentCode; + redisUtil.delete(primaryKey); + log.debug("已删除支付配置缓存: {}", primaryKey); + + // 删除原有格式缓存 + String legacyKey = "Payment:" + paymentCode + ":" + tenantId; + redisUtil.delete(legacyKey); + log.debug("已删除兼容格式缓存: {}", legacyKey); + } + + /** + * 获取微信支付配置 (payType = 0) + */ + public Payment getWechatPayConfig(Integer tenantId) { + return getPaymentConfig(0, tenantId); + } + + /** + * 获取支付宝配置 (payType = 1) + */ + public Payment getAlipayConfig(Integer tenantId) { + return getPaymentConfig(1, tenantId); + } + + /** + * 清理Payment对象用于缓存 + * 移除可能导致序列化问题的时间字段 + */ + private Payment cleanPaymentForCache(Payment original) { + if (original == null) { + return null; + } + + Payment cleaned = new Payment(); + // 复制所有业务相关字段 + cleaned.setId(original.getId()); + cleaned.setName(original.getName()); + cleaned.setType(original.getType()); + cleaned.setCode(original.getCode()); + cleaned.setImage(original.getImage()); + cleaned.setWechatType(original.getWechatType()); + cleaned.setAppId(original.getAppId()); + cleaned.setMchId(original.getMchId()); + cleaned.setApiKey(original.getApiKey()); + cleaned.setApiclientCert(original.getApiclientCert()); + cleaned.setApiclientKey(original.getApiclientKey()); + cleaned.setPubKey(original.getPubKey()); + cleaned.setPubKeyId(original.getPubKeyId()); + cleaned.setMerchantSerialNumber(original.getMerchantSerialNumber()); + cleaned.setNotifyUrl(original.getNotifyUrl()); + cleaned.setComments(original.getComments()); + cleaned.setSortNumber(original.getSortNumber()); + cleaned.setStatus(original.getStatus()); + cleaned.setDeleted(original.getDeleted()); + cleaned.setTenantId(original.getTenantId()); + + // 不设置时间字段,避免序列化问题 + // cleaned.setCreateTime(null); + // cleaned.setUpdateTime(null); + + return cleaned; + } +} diff --git a/src/main/java/com/gxwebsoft/common/core/socketio/cache/ClientCache.java b/src/main/java/com/gxwebsoft/common/core/socketio/cache/ClientCache.java new file mode 100644 index 0000000..399b56b --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/socketio/cache/ClientCache.java @@ -0,0 +1,75 @@ +package com.gxwebsoft.common.core.socketio.cache; + +import com.corundumstudio.socketio.SocketIOClient; +import com.corundumstudio.socketio.SocketIOServer; +import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; + +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; + +/** + * @Author + * @Description 用户信息缓存 + * @Date 14:00 2022/1/21 + * @Param + * @return + **/ +@Component +public class ClientCache { + + private static Map> concurrentHashMap = new ConcurrentHashMap<>(); + + private static SocketIOServer socketIOServer; + + public static SocketIOServer getSocketIOServer() { + return socketIOServer; + } + + public static void setSocketIOServer(SocketIOServer instance) { + socketIOServer = instance; + } + public void saveClient(String userId,UUID sessionId,SocketIOClient socketIOClient){ + HashMap sessionIdClientCache = concurrentHashMap.get(userId); + if(sessionIdClientCache == null){ + sessionIdClientCache = new HashMap<>(); + } + sessionIdClientCache.put(sessionId,socketIOClient); + concurrentHashMap.put(userId,sessionIdClientCache); + } + + + public HashMap getUserClient(String userId){ + return concurrentHashMap.get(userId); + } + + public void deleteSessionClientByUserId(String userId,UUID sessionId){ + concurrentHashMap.get(userId).remove(sessionId); + } + + + public void deleteUserCacheByUserId(String userId){ + concurrentHashMap.remove(userId); + } + + public int getOnLineCount(){ + return concurrentHashMap.size(); + } + + public void sendUserEvent(String userId,String event, Object message) { + // 发送到接收方 + HashMap userClient = concurrentHashMap.get(userId); + + // 查看对方是否在线 + if(!CollectionUtils.isEmpty(userClient)){ + for (UUID uuid : userClient.keySet()) { + SocketIOClient ioClient = userClient.get(uuid); + ioClient.sendEvent(event, message); + + } + } + } + +} diff --git a/src/main/java/com/gxwebsoft/common/core/socketio/config/SocketIOConfig.java b/src/main/java/com/gxwebsoft/common/core/socketio/config/SocketIOConfig.java new file mode 100644 index 0000000..d79884f --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/socketio/config/SocketIOConfig.java @@ -0,0 +1,82 @@ +package com.gxwebsoft.common.core.socketio.config; + +import com.corundumstudio.socketio.SocketIOServer; +import com.gxwebsoft.common.core.config.ConfigProperties; +import com.gxwebsoft.common.core.security.JwtSubject; +import com.gxwebsoft.common.core.security.JwtUtil; +import com.gxwebsoft.common.core.socketio.cache.ClientCache; +import com.gxwebsoft.common.core.socketio.handler.SocketIOHandler; +import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.common.system.service.UserService; +import io.jsonwebtoken.Claims; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Configuration; +import org.springframework.util.StringUtils; + +import javax.annotation.Resource; +import java.io.InputStream; + +/** + * socket服务配置 + * @author machenike + */ +@Configuration +public class SocketIOConfig implements InitializingBean { + + private final static Logger logger = LoggerFactory.getLogger(SocketIOConfig.class); + @Value("${socketio.host}") + private String host; + + @Value("${socketio.port}") + private Integer port; + + @Resource + private SocketIOHandler socketIOHandler; + + @Resource + private UserService userService; + + @Resource + private ConfigProperties configProperties; + + @Override + public void afterPropertiesSet() throws Exception { + com.corundumstudio.socketio.Configuration config = new com.corundumstudio.socketio.Configuration(); + //设置host + config.setHostname(host); + //设置端口 + config.setPort(port); + config.setBossThreads(1); + config.setAuthorizationListener(handshakeData -> { + String userId =handshakeData.getSingleUrlParam("userId"); + String token = handshakeData.getSingleUrlParam("token"); + logger.info("身份验证 token:{}", token); + if(!StringUtils.hasText(token) || !StringUtils.hasText(userId)){ + return false; + } + // 身份验证 + Claims claims = JwtUtil.parseToken(token, configProperties.getTokenKey()); + JwtSubject jwtSubject = JwtUtil.getJwtSubject(claims); + User user = userService.getByUsername(jwtSubject.getUsername(), jwtSubject.getTenantId()); + + if (user == null || !user.getUserId().equals(Integer.valueOf(userId))) { + return false; + } + return true; + }); + + InputStream resourceAsStream = this.getClass().getResourceAsStream("/jks/love.jks"); // 读取证书文件流 + config.setKeyStore(resourceAsStream); // 设置证书文件 + config.setKeyStorePassword("123456"); // 设置证书密码 + + // 启动socket服务 +// SocketIOServer server = new SocketIOServer(config); +// server.addListeners(socketIOHandler); +// server.start(); +// ClientCache.setSocketIOServer(server); +// logger.debug("Netty SocketIO启动:{}:{}",host,port); + } +} diff --git a/src/main/java/com/gxwebsoft/common/core/socketio/handler/SocketIOHandler.java b/src/main/java/com/gxwebsoft/common/core/socketio/handler/SocketIOHandler.java new file mode 100644 index 0000000..5df67ec --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/socketio/handler/SocketIOHandler.java @@ -0,0 +1,104 @@ +package com.gxwebsoft.common.core.socketio.handler; + +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import com.corundumstudio.socketio.AckRequest; +import com.corundumstudio.socketio.SocketIOClient; +import com.corundumstudio.socketio.annotation.OnConnect; +import com.corundumstudio.socketio.annotation.OnDisconnect; +import com.corundumstudio.socketio.annotation.OnEvent; +import com.gxwebsoft.common.core.config.ConfigProperties; +import com.gxwebsoft.common.core.socketio.cache.ClientCache; +import com.gxwebsoft.common.system.entity.ChatMessage; +import com.gxwebsoft.common.system.service.ChatConversationService; +import com.gxwebsoft.common.system.service.ChatMessageService; +import com.gxwebsoft.common.system.service.UserService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.UUID; + + +/** + * socket处理拦截器 + * @author machenike + */ + +@Component +public class SocketIOHandler { + + + @Resource + private ChatMessageService messageService; + + @Resource + private ChatConversationService conversationService; + + @Resource + private ClientCache clientCache; + + @Resource + private UserService userService; + + @Resource + private ConfigProperties configProperties; + /** + * 日志 + */ + private final static Logger logger = LoggerFactory.getLogger(SocketIOHandler.class); + + + + + /** + * 客户端连上socket服务器时执行此事件 + * @param client + */ + @OnConnect + public void onConnect(SocketIOClient client) { + String userId = client.getHandshakeData().getSingleUrlParam("userId"); + logger.debug("socket client auth success [userId="+userId+"]"); + UUID sessionId = client.getSessionId(); + + + // 管理员 + String isAdmin = client.getHandshakeData().getSingleUrlParam("isAdmin"); + if(StringUtils.isNotBlank(isAdmin)){ + // todo 权限验证 + clientCache.saveClient("admin",sessionId, client); + }else { + clientCache.saveClient(userId,sessionId, client); + } + + System.out.println("userId: "+userId+"连接建立成功 - "+sessionId); + logger.info("当前在线人数:{}",clientCache.getOnLineCount()); + + } + + + /** + * 客户端断开socket服务器时执行此事件 + * @param client + */ + @OnDisconnect + public void onDisconnect(SocketIOClient client) { + String userId = client.getHandshakeData().getSingleUrlParam("userId"); + UUID sessionId = client.getSessionId(); + clientCache.deleteSessionClientByUserId(userId,sessionId); + System.out.println("userId: "+userId+"连接关闭成功 - "+sessionId); + + } + + /** + * + * @param client + */ + @OnEvent( value = "message") + @Transactional + public void onMessage(SocketIOClient client, AckRequest request, ChatMessage message) { + + } + +} diff --git a/src/main/java/com/gxwebsoft/common/core/utils/AliYunSender.java b/src/main/java/com/gxwebsoft/common/core/utils/AliYunSender.java new file mode 100644 index 0000000..80fe4b1 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/utils/AliYunSender.java @@ -0,0 +1,145 @@ +package com.gxwebsoft.common.core.utils; +import cn.hutool.core.codec.Base64; +import org.springframework.stereotype.Component; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; +import java.io.*; +import java.net.HttpURLConnection; +import java.net.URL; +import java.net.URLConnection; +import java.security.MessageDigest; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Locale; +import java.util.UUID; + +@Component +public class AliYunSender { + /* + * 计算MD5+BASE64 + */ + public static String MD5Base64(String s) { + if (s == null) + return null; + String encodeStr = ""; + byte[] utfBytes = s.getBytes(); + MessageDigest mdTemp; + try { + mdTemp = MessageDigest.getInstance("MD5"); + mdTemp.update(utfBytes); + byte[] md5Bytes = mdTemp.digest(); + encodeStr = Base64.encode(md5Bytes); + } catch (Exception e) { + throw new Error("Failed to generate MD5 : " + e.getMessage()); + } + return encodeStr; + } + /* + * 计算 HMAC-SHA1 + */ + public static String HMACSha1(String data, String key) { + String result; + try { + SecretKeySpec signingKey = new SecretKeySpec(key.getBytes(), "HmacSHA1"); + Mac mac = Mac.getInstance("HmacSHA1"); + mac.init(signingKey); + byte[] rawHmac = mac.doFinal(data.getBytes()); + result = Base64.encode(rawHmac); + } catch (Exception e) { + throw new Error("Failed to generate HMAC : " + e.getMessage()); + } + return result; + } + /* + * 获取时间 + */ + public static String toGMTString(Date date) { + SimpleDateFormat df = new SimpleDateFormat("E, dd MMM yyyy HH:mm:ss z", Locale.UK); + df.setTimeZone(new java.util.SimpleTimeZone(0, "GMT")); + return df.format(date); + } + /* + * 发送POST请求 + */ + public static String sendPost(String url, String body, String ak_id, String ak_secret) { + PrintWriter out = null; + BufferedReader in = null; + String result = ""; + try { + URL realUrl = new URL(url); + /* + * http header 参数 + */ + String method = "POST"; + String accept = "application/json"; + String content_type = "application/json;chrset=utf-8"; + String path = realUrl.getFile(); + String date = toGMTString(new Date()); + String host = realUrl.getHost(); + // 1.对body做MD5+BASE64加密 + String bodyMd5 = MD5Base64(body); + String uuid = UUID.randomUUID().toString(); + String stringToSign = method + "\n" + accept + "\n" + bodyMd5 + "\n" + content_type + "\n" + date + "\n" + + "x-acs-signature-method:HMAC-SHA1\n" + + "x-acs-signature-nonce:" + uuid + "\n" + + "x-acs-version:2019-01-02\n" + + path; + // 2.计算 HMAC-SHA1 + String signature = HMACSha1(stringToSign, ak_secret); + // 3.得到 authorization header + String authHeader = "acs " + ak_id + ":" + signature; + // 打开和URL之间的连接 + URLConnection conn = realUrl.openConnection(); + // 设置通用的请求属性 + conn.setRequestProperty("Accept", accept); + conn.setRequestProperty("Content-Type", content_type); + conn.setRequestProperty("Content-MD5", bodyMd5); + conn.setRequestProperty("Date", date); + conn.setRequestProperty("Host", host); + conn.setRequestProperty("Authorization", authHeader); + conn.setRequestProperty("x-acs-signature-nonce", uuid); + conn.setRequestProperty("x-acs-signature-method", "HMAC-SHA1"); + conn.setRequestProperty("x-acs-version", "2019-01-02"); // 版本可选 + // 发送POST请求必须设置如下两行 + conn.setDoOutput(true); + conn.setDoInput(true); + // 获取URLConnection对象对应的输出流 + out = new PrintWriter(conn.getOutputStream()); + // 发送请求参数 + out.print(body); + // flush输出流的缓冲 + out.flush(); + // 定义BufferedReader输入流来读取URL的响应 + InputStream is; + HttpURLConnection httpconn = (HttpURLConnection) conn; + if (httpconn.getResponseCode() == 200) { + is = httpconn.getInputStream(); + } else { + is = httpconn.getErrorStream(); + } + in = new BufferedReader(new InputStreamReader(is)); + String line; + while ((line = in.readLine()) != null) { + result += line; + } + } catch (Exception e) { + System.out.println("发送 POST 请求出现异常!" + e); + e.printStackTrace(); + } + // 使用finally块来关闭输出流、输入流 + finally { + try { + if (out != null) { + out.close(); + } + if (in != null) { + in.close(); + } + } catch (IOException ex) { + ex.printStackTrace(); + } + } + return result; + } +} diff --git a/src/main/java/com/gxwebsoft/common/core/utils/AlipayConfigUtil.java b/src/main/java/com/gxwebsoft/common/core/utils/AlipayConfigUtil.java new file mode 100644 index 0000000..489d828 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/utils/AlipayConfigUtil.java @@ -0,0 +1,203 @@ +package com.gxwebsoft.common.core.utils; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.alipay.api.AlipayApiException; +import com.alipay.api.AlipayConstants; +import com.alipay.api.CertAlipayRequest; +import com.alipay.api.DefaultAlipayClient; +import com.gxwebsoft.common.core.config.ConfigProperties; +import com.gxwebsoft.common.core.config.CertificateProperties; +import com.gxwebsoft.common.core.service.CertificateService; +import com.gxwebsoft.common.core.exception.BusinessException; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; + +/** + * 支付宝工具类 + * 支持新的证书管理系统 + * @author leng + * + */ +@Slf4j +@Component +public class AlipayConfigUtil { + private final StringRedisTemplate stringRedisTemplate; + public Integer tenantId; + public String gateway; + public JSONObject config; + public String appId; + public String privateKey; + public String appCertPublicKey; + public String alipayCertPublicKey; + public String alipayRootCert; + + @Value("${spring.profiles.active}") + private String active; + + @Resource + private ConfigProperties pathConfig; + @Resource + private CertificateService certificateService; + @Resource + private CertificateProperties certificateProperties; + + public AlipayConfigUtil(StringRedisTemplate stringRedisTemplate){ + this.stringRedisTemplate = stringRedisTemplate; + } + + // 实例化客户端 + public DefaultAlipayClient alipayClient(Integer tenantId) throws AlipayApiException { + this.gateway = "https://openapi.alipay.com/gateway.do"; + this.tenantId = tenantId; + this.payment(tenantId); + CertAlipayRequest certAlipayRequest = new CertAlipayRequest(); + certAlipayRequest.setServerUrl(this.gateway); + certAlipayRequest.setAppId(this.appId); + certAlipayRequest.setPrivateKey(this.privateKey); + certAlipayRequest.setFormat(AlipayConstants.FORMAT_JSON); + certAlipayRequest.setCharset(AlipayConstants.CHARSET_UTF8); + certAlipayRequest.setSignType(AlipayConstants.SIGN_TYPE_RSA2); + certAlipayRequest.setCertPath(this.appCertPublicKey); + certAlipayRequest.setAlipayPublicCertPath(this.alipayCertPublicKey); + certAlipayRequest.setRootCertPath(this.alipayRootCert); +// System.out.println("this.appId = " + this.appId); +// System.out.println("this.appId = " + this.gateway); +// System.out.println("this.appId = " + this.privateKey); +// System.out.println("this.appId = " + this.appCertPublicKey); +// System.out.println("this.appId = " + this.alipayCertPublicKey); +// System.out.println("this.appId = " + this.alipayRootCert); +// System.out.println("this.config = " + this.config); + return new DefaultAlipayClient(certAlipayRequest); + } + + /** + * 获取支付宝秘钥 + */ + public JSONObject payment(Integer tenantId) { + log.debug("获取支付宝配置,租户ID: {}", tenantId); + String key = "cache".concat(tenantId.toString()).concat(":setting:payment"); + log.debug("Redis缓存key: {}", key); + + // 测试期间注释掉从缓存获取支付配置 + // String cache = stringRedisTemplate.opsForValue().get(key); + // if (cache == null) { + // throw new BusinessException("支付方式未配置"); + // } + + // 测试期间:模拟缓存为空的情况 + String cache = null; + log.debug("测试模式:支付宝配置缓存设为null"); + if (cache == null) { + throw new BusinessException("支付方式未配置(测试模式:缓存已注释)"); + } + + // 解析json数据 + JSONObject payment = JSON.parseObject(cache.getBytes()); + this.config = payment; + this.appId = payment.getString("alipayAppId"); + this.privateKey = payment.getString("privateKey"); + + try { + if (active.equals("dev")) { + // 开发环境:使用证书服务获取证书路径 + CertificateProperties.AlipayConfig alipayConfig = certificateProperties.getAlipay(); + this.appCertPublicKey = certificateService.getAlipayCertPath(alipayConfig.getAppCertPublicKeyFile()); + this.alipayCertPublicKey = certificateService.getAlipayCertPath(alipayConfig.getAlipayCertPublicKeyFile()); + this.alipayRootCert = certificateService.getAlipayCertPath(alipayConfig.getAlipayRootCertFile()); + + log.info("开发环境支付宝证书路径:"); + log.info("应用证书相对路径: {}", this.appCertPublicKey); + log.info("支付宝证书相对路径: {}", this.alipayCertPublicKey); + log.info("根证书相对路径: {}", this.alipayRootCert); + + // 打印完整的绝对路径 + try { + if (certificateProperties.isClasspathMode()) { + log.info("支付宝证书加载模式: CLASSPATH"); + org.springframework.core.io.ClassPathResource appCertResource = new org.springframework.core.io.ClassPathResource(this.appCertPublicKey); + org.springframework.core.io.ClassPathResource alipayCertResource = new org.springframework.core.io.ClassPathResource(this.alipayCertPublicKey); + org.springframework.core.io.ClassPathResource rootCertResource = new org.springframework.core.io.ClassPathResource(this.alipayRootCert); + + if (appCertResource.exists()) { + log.info("应用证书完整绝对路径: {}", appCertResource.getFile().getAbsolutePath()); + } + if (alipayCertResource.exists()) { + log.info("支付宝证书完整绝对路径: {}", alipayCertResource.getFile().getAbsolutePath()); + } + if (rootCertResource.exists()) { + log.info("根证书完整绝对路径: {}", rootCertResource.getFile().getAbsolutePath()); + } + } else { + log.info("支付宝证书加载模式: FILESYSTEM"); + log.info("应用证书完整绝对路径: {}", new java.io.File(this.appCertPublicKey).getAbsolutePath()); + log.info("支付宝证书完整绝对路径: {}", new java.io.File(this.alipayCertPublicKey).getAbsolutePath()); + log.info("根证书完整绝对路径: {}", new java.io.File(this.alipayRootCert).getAbsolutePath()); + } + } catch (Exception e) { + log.warn("获取支付宝证书绝对路径失败: {}", e.getMessage()); + } + + // 检查证书文件是否存在 + if (!certificateService.certificateExists("alipay", alipayConfig.getAppCertPublicKeyFile())) { + throw new RuntimeException("支付宝应用证书文件不存在"); + } + if (!certificateService.certificateExists("alipay", alipayConfig.getAlipayCertPublicKeyFile())) { + throw new RuntimeException("支付宝公钥证书文件不存在"); + } + if (!certificateService.certificateExists("alipay", alipayConfig.getAlipayRootCertFile())) { + throw new RuntimeException("支付宝根证书文件不存在"); + } + } else { + // 生产环境:使用上传的证书文件 + // 修改路径拼接规则:uploadPath + "file" + 数据库存储的相对路径 + String appCertPath = payment.getString("appCertPublicKey"); + String alipayCertPath = payment.getString("alipayCertPublicKey"); + String rootCertPath = payment.getString("alipayRootCert"); + + this.appCertPublicKey = pathConfig.getUploadPath() + "file" + appCertPath; + this.alipayCertPublicKey = pathConfig.getUploadPath() + "file" + alipayCertPath; + this.alipayRootCert = pathConfig.getUploadPath() + "file" + rootCertPath; + + log.info("生产环境支付宝证书路径构建:"); + log.info("上传根路径: {}", pathConfig.getUploadPath()); + log.info("应用证书 - 数据库路径: {}, 完整路径: {}", appCertPath, this.appCertPublicKey); + log.info("支付宝证书 - 数据库路径: {}, 完整路径: {}", alipayCertPath, this.alipayCertPublicKey); + log.info("根证书 - 数据库路径: {}, 完整路径: {}", rootCertPath, this.alipayRootCert); + } + } catch (Exception e) { + log.error("配置支付宝证书路径失败: {}", e.getMessage(), e); + throw new RuntimeException("支付宝证书配置失败: " + e.getMessage()); + } + + return payment; + } + + public String appId(){ + return this.appId; + } + + public String privateKey(){ + return this.privateKey; + } + + public String appCertPublicKey(){ + return this.appCertPublicKey; + } + + public String alipayCertPublicKey(){ + return this.alipayCertPublicKey; + } + + public String alipayRootCert(){ + return this.alipayRootCert; + } + + + + +} diff --git a/src/main/java/com/gxwebsoft/common/core/utils/CacheClient.java b/src/main/java/com/gxwebsoft/common/core/utils/CacheClient.java new file mode 100644 index 0000000..0ff11c9 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/utils/CacheClient.java @@ -0,0 +1,264 @@ +package com.gxwebsoft.common.core.utils; + +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.common.system.result.RedisResult; +import org.springframework.data.geo.Point; +import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.stereotype.Component; + +import java.time.LocalDateTime; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.TimeUnit; +import java.util.function.Function; + +import static com.gxwebsoft.common.core.constants.RedisConstants.CACHE_NULL_TTL; + +@Component +public class CacheClient { + private final StringRedisTemplate stringRedisTemplate; + public static Integer tenantId; + + public CacheClient(StringRedisTemplate stringRedisTemplate){ + this.stringRedisTemplate = stringRedisTemplate; + } + + /** + * 写入redis缓存 + * @param key [表名]:id + * @param entity 实体类对象 + */ + public void set(String key, T entity){ + stringRedisTemplate.opsForValue().set(prefix(key), JSONUtil.toJSONString(entity)); + } + + /** + * 写入redis缓存 + * @param key [表名]:id + * @param entity 实体类对象 + * 示例 cacheClient.set("merchant:"+id,merchant,1L,TimeUnit.DAYS) + */ + public void set(String key, T entity, Long time, TimeUnit unit){ + stringRedisTemplate.opsForValue().set(prefix(key), JSONUtil.toJSONString(entity),time,unit); + } + + /** + * 读取redis缓存 + * @param key [表名]:id + * 示例 cacheClient.get(key) + * @return merchant + */ + public String get(String key) { + return stringRedisTemplate.opsForValue().get(prefix(key)); + } + + /** + * 读取redis缓存 + * @param key [表名]:id + * @param clazz Merchant.class + * @param + * 示例 cacheClient.get("merchant:"+id,Merchant.class) + * @return merchant + */ + public T get(String key, Class clazz) { + String json = stringRedisTemplate.opsForValue().get(prefix(key)); + if(StrUtil.isNotBlank(json)){ + return JSONUtil.parseObject(json, clazz); + } + return null; + } + + /** + * 写redis缓存(哈希类型) + * @param key [表名]:id + * @param field 字段 + * 示例 cacheClient.get("merchant:"+id,Merchant.class) + */ + public void hPut(String key, String field, T entity) { + stringRedisTemplate.opsForHash().put(prefix(key),field,JSONUtil.toJSONString(entity)); + } + + /** + * 写redis缓存(哈希类型) + * @param key [表名]:id + * @param map 字段 + * 示例 cacheClient.get("merchant:"+id,Merchant.class) + */ + public void hPutAll(String key, Map map) { + stringRedisTemplate.opsForHash().putAll(prefix(key),map); + } + + /** + * 读取redis缓存(哈希类型) + * 示例 cacheClient.get("merchant:"+id,Merchant.class) + * @param key [表名]:id + * @param field 字段 + * @return merchant + */ + public T hGet(String key, String field, Class clazz) { + Object obj = stringRedisTemplate.opsForHash().get(prefix(key), field); + return JSONUtil.parseObject(JSONUtil.toJSONString(obj),clazz); + } + + public List hValues(String key){ + return stringRedisTemplate.opsForHash().values(prefix(key)); + } + + public Long hSize(String key){ + return stringRedisTemplate.opsForHash().size(prefix(key)); + } + + // 逻辑过期方式写入redis + public void setWithLogicalExpire(String key, T value, Long time, TimeUnit unit){ + // 设置逻辑过期时间 + final RedisResult redisResult = new RedisResult<>(); + redisResult.setData(value); + redisResult.setExpireTime(LocalDateTime.now().plusSeconds(unit.toSeconds(time))); + stringRedisTemplate.opsForValue().set(prefix(key),JSONUtil.toJSONString(redisResult)); + } + + // 读取redis + public R query(String keyPrefix, ID id, Class clazz, Function dbFallback, Long time, TimeUnit unit){ + String key = keyPrefix + id; + // 1.从redis查询缓存 + final String json = stringRedisTemplate.opsForValue().get(prefix(key)); + // 2.判断是否存在 + if (StrUtil.isNotBlank(json)) { + // 3.存在,直接返回 + return JSONUtil.parseObject(json,clazz); + } + // 判断命中的是否为空值 + if (json != null) { + return null; + } + // 4. 不存在,跟进ID查询数据库 + R r = dbFallback.apply(id); + // 5. 数据库不存在,返回错误 + if(r == null){ + // 空值写入数据库 + this.set(prefix(key),"",CACHE_NULL_TTL,TimeUnit.MINUTES); + return null; + } + // 写入redis + this.set(prefix(key),r,time,unit); + return r; + } + + /** + * 添加商户定位点 + * @param key geo + * @param id + * 示例 cacheClient.geoAdd("merchant-geo",merchant) + */ + public void geoAdd(String key, Double x, Double y, String id){ + stringRedisTemplate.opsForGeo().add(prefix(key),new Point(x,y),id); + } + + /** + * 删除定位 + * @param key geo + * @param id + * 示例 cacheClient.geoRemove("merchant-geo",id) + */ + public void geoRemove(String key, Integer id){ + stringRedisTemplate.opsForGeo().remove(prefix(key),id.toString()); + } + + + + public void sAdd(String key, T entity){ + stringRedisTemplate.opsForSet().add(prefix(key),JSONUtil.toJSONString(entity)); + } + + public Set sMembers(String key){ + return stringRedisTemplate.opsForSet().members(prefix(key)); + } + + // 更新排行榜 + public void zAdd(String key, Integer userId, Double value) { + stringRedisTemplate.opsForZSet().add(prefix(key),userId.toString(),value); + } + // 增加元素的score值,并返回增加后的值 + public Double zIncrementScore(String key,Integer userId, Double delta){ + return stringRedisTemplate.opsForZSet().incrementScore(key, userId.toString(), delta); + } + // 获取排名榜 + public Set range(String key, Integer start, Integer end) { + return stringRedisTemplate.opsForZSet().range(prefix(key), start, end); + } + // 获取排名榜 + public Set reverseRange(String key, Integer start, Integer end){ + return stringRedisTemplate.opsForZSet().reverseRange(prefix(key), start, end); + } + // 获取分数 + public Double score(String key, Object value){ + return stringRedisTemplate.opsForZSet().score(prefix(key), value); + } + + public void delete(String key){ + stringRedisTemplate.delete(prefix(key)); + } + + // 存储在list头部 + public void leftPush(String key, String keyword){ + stringRedisTemplate.opsForList().leftPush(prefix(key),keyword); + } + + // 获取列表指定范围内的元素 + public List listRange(String key,Long start, Long end){ + return stringRedisTemplate.opsForList().range(prefix(key), start, end); + } + + // 获取列表长度 + public Long listSize(String key){ + return stringRedisTemplate.opsForList().size(prefix(key)); + } + + // 裁剪list + public void listTrim(String key){ + stringRedisTemplate.opsForList().trim(prefix(key), 0L, 100L); + } + + /** + * 读取后台系统设置信息 + * @param keyName 键名wx-word + * @param tenantId 租户ID + * @return + * key示例 cache10048:setting:wx-work + */ + public JSONObject getSettingInfo(String keyName,Integer tenantId){ + String key = "cache" + tenantId + ":setting:" + keyName; + final String cache = stringRedisTemplate.opsForValue().get(key); + assert cache != null; + return JSON.parseObject(cache); + } + + /** + * KEY前缀 + * cache[tenantId]:[key+id] + */ + public static String prefix(String key){ + String prefix = "cache"; + Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); + if (authentication != null) { + Object object = authentication.getPrincipal(); + if (object instanceof User) { + final Integer tenantId = ((User) object).getTenantId(); + prefix = prefix.concat(tenantId.toString()).concat(":"); + } + } + return prefix.concat(key); + } + + // 组装key + public String key(String name,Integer id){ + return name.concat(":").concat(id.toString()); + } +} diff --git a/src/main/java/com/gxwebsoft/common/core/utils/CertificateLoader.java b/src/main/java/com/gxwebsoft/common/core/utils/CertificateLoader.java new file mode 100644 index 0000000..37f35d1 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/utils/CertificateLoader.java @@ -0,0 +1,228 @@ +package com.gxwebsoft.common.core.utils; + +import com.gxwebsoft.common.core.config.CertificateProperties; +import lombok.extern.slf4j.Slf4j; +import org.springframework.core.io.ClassPathResource; +import org.springframework.stereotype.Component; +import org.springframework.util.StringUtils; + +import javax.annotation.PostConstruct; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +/** + * 证书加载工具类 + * 支持多种证书加载方式,适配Docker容器化部署 + * + * @author 科技小王子 + * @since 2025-01-26 + */ +@Slf4j +@Component +public class CertificateLoader { + + private final CertificateProperties certConfig; + + public CertificateLoader(CertificateProperties certConfig) { + this.certConfig = certConfig; + } + + @PostConstruct + public void init() { + log.info("证书加载器初始化,加载模式:{}", certConfig.getLoadMode()); + if (certConfig.getLoadMode() == CertificateProperties.LoadMode.VOLUME) { + log.info("Docker挂载卷证书路径:{}", certConfig.getCertRootPath()); + validateCertDirectory(); + } + } + + /** + * 验证证书目录是否存在 + */ + private void validateCertDirectory() { + File certDir = new File(certConfig.getCertRootPath()); + if (!certDir.exists()) { + log.warn("证书目录不存在:{},将尝试创建", certConfig.getCertRootPath()); + if (!certDir.mkdirs()) { + log.error("无法创建证书目录:{}", certConfig.getCertRootPath()); + } + } else { + log.info("证书目录验证成功:{}", certConfig.getCertRootPath()); + } + } + + /** + * 加载证书文件路径 + * + * @param certPath 证书路径(可能是相对路径、绝对路径或classpath路径) + * @return 实际的证书文件路径 + */ + public String loadCertificatePath(String certPath) { + if (!StringUtils.hasText(certPath)) { + throw new IllegalArgumentException("证书路径不能为空"); + } + + try { + switch (certConfig.getLoadMode()) { + case CLASSPATH: + return loadFromClasspath(certPath); + case VOLUME: + return loadFromVolume(certPath); + case FILESYSTEM: + default: + return loadFromFileSystem(certPath); + } + } catch (Exception e) { + log.error("加载证书失败,路径:{}", certPath, e); + throw new RuntimeException("证书加载失败:" + certPath, e); + } + } + + /** + * 从classpath加载证书 + */ + private String loadFromClasspath(String certPath) throws IOException { + String resourcePath = certPath.startsWith("classpath:") ? + certPath.substring("classpath:".length()) : certPath; + + ClassPathResource resource = new ClassPathResource(resourcePath); + if (!resource.exists()) { + throw new IOException("Classpath中找不到证书文件:" + resourcePath); + } + + // 将classpath中的文件复制到临时目录 + Path tempFile = Files.createTempFile("cert_", ".pem"); + try (InputStream inputStream = resource.getInputStream()) { + Files.copy(inputStream, tempFile, java.nio.file.StandardCopyOption.REPLACE_EXISTING); + } + + String tempPath = tempFile.toAbsolutePath().toString(); + log.debug("从classpath加载证书:{} -> {}", resourcePath, tempPath); + return tempPath; + } + + /** + * 从Docker挂载卷加载证书 + */ + private String loadFromVolume(String certPath) { + log.debug("尝试从Docker挂载卷加载证书:{}", certPath); + + // 如果是完整路径,直接使用 + if (certPath.startsWith("/") || certPath.contains(":")) { + File file = new File(certPath); + log.debug("检查完整路径文件是否存在:{}", certPath); + if (file.exists()) { + log.debug("使用完整路径加载证书:{}", certPath); + return certPath; + } else { + log.error("完整路径文件不存在:{}", certPath); + } + } + + // 否则拼接挂载卷路径 + String fullPath = Paths.get(certConfig.getCertRootPath(), certPath).toString(); + File file = new File(fullPath); + if (!file.exists()) { + throw new RuntimeException("Docker挂载卷中找不到证书文件:" + fullPath); + } + + log.debug("从Docker挂载卷加载证书:{}", fullPath); + return fullPath; + } + + /** + * 从文件系统加载证书 + */ + private String loadFromFileSystem(String certPath) { + File file = new File(certPath); + if (!file.exists()) { + throw new RuntimeException("文件系统中找不到证书文件:" + certPath); + } + + log.debug("从文件系统加载证书:{}", certPath); + return certPath; + } + + /** + * 检查证书文件是否存在 + * + * @param certPath 证书路径 + * @return 是否存在 + */ + public boolean certificateExists(String certPath) { + try { + switch (certConfig.getLoadMode()) { + case CLASSPATH: + String resourcePath = certPath.startsWith("classpath:") ? + certPath.substring("classpath:".length()) : certPath; + ClassPathResource resource = new ClassPathResource(resourcePath); + return resource.exists(); + case VOLUME: + String fullPath = certPath.startsWith("/") ? certPath : + Paths.get(certConfig.getCertRootPath(), certPath).toString(); + return new File(fullPath).exists(); + case FILESYSTEM: + default: + return new File(certPath).exists(); + } + } catch (Exception e) { + log.warn("检查证书文件存在性时出错:{}", certPath, e); + return false; + } + } + + /** + * 获取证书文件的输入流 + * + * @param certPath 证书路径 + * @return 输入流 + */ + public InputStream getCertificateInputStream(String certPath) throws IOException { + switch (certConfig.getLoadMode()) { + case CLASSPATH: + String resourcePath = certPath.startsWith("classpath:") ? + certPath.substring("classpath:".length()) : certPath; + ClassPathResource resource = new ClassPathResource(resourcePath); + return resource.getInputStream(); + case VOLUME: + case FILESYSTEM: + default: + String actualPath = loadCertificatePath(certPath); + return Files.newInputStream(Paths.get(actualPath)); + } + } + + /** + * 列出证书目录中的所有文件 + * + * @return 证书文件列表 + */ + public String[] listCertificateFiles() { + try { + switch (certConfig.getLoadMode()) { + case VOLUME: + File certDir = new File(certConfig.getCertRootPath()); + if (certDir.exists() && certDir.isDirectory()) { + return certDir.list(); + } + break; + case CLASSPATH: + // classpath模式下不支持列出文件 + log.warn("Classpath模式下不支持列出证书文件"); + break; + case FILESYSTEM: + default: + // 文件系统模式下证书可能分散在不同目录,不支持统一列出 + log.warn("文件系统模式下不支持列出证书文件"); + break; + } + } catch (Exception e) { + log.error("列出证书文件时出错", e); + } + return new String[0]; + } +} diff --git a/src/main/java/com/gxwebsoft/common/core/utils/CommonUtil.java b/src/main/java/com/gxwebsoft/common/core/utils/CommonUtil.java new file mode 100644 index 0000000..828e800 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/utils/CommonUtil.java @@ -0,0 +1,293 @@ +package com.gxwebsoft.common.core.utils; + +import cn.hutool.core.date.DatePattern; +import cn.hutool.core.date.DateTime; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.RandomUtil; +import com.gxwebsoft.common.core.Constants; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.utils.JSONUtil; +import com.gxwebsoft.common.system.entity.Role; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.PrintWriter; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.function.BiConsumer; +import java.util.function.Consumer; +import java.util.function.Function; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +/** + * 常用工具方法 + * + * @author WebSoft + * @since 2017-06-10 10:10:22 + */ +public class CommonUtil { + // 生成uuid的字符 + private static final String[] chars = new String[]{ + "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", + "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", + "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", + "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", + "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" + }; + + /** + * 生成8位uuid + * + * @return String + */ + public static String randomUUID8() { + StringBuilder sb = new StringBuilder(); + String uuid = UUID.randomUUID().toString().replace("-", ""); + for (int i = 0; i < 8; i++) { + String str = uuid.substring(i * 4, i * 4 + 4); + int x = Integer.parseInt(str, 16); + sb.append(chars[x % 0x3E]); + } + return sb.toString(); + } + + /** + * 生成16位uuid + * + * @return String + */ + public static String randomUUID16() { + StringBuilder sb = new StringBuilder(); + String uuid = UUID.randomUUID().toString().replace("-", ""); + for (int i = 0; i < 16; i++) { + String str = uuid.substring(i * 2, i * 2 + 2); + int x = Integer.parseInt(str, 16); + sb.append(chars[x % 0x3E]); + } + return sb.toString(); + } + + /** + * 获取当前时间 + * + * @return String + */ + public static String currentTime() { + Date date = new Date(); + SimpleDateFormat sdf = new SimpleDateFormat("yyMMddHHmmss"); + return sdf.format(date); + } + + /** + * 生成10位随机用户名 + * + * @return String + */ + public static String randomUsername(String prefix) { + Date date = new Date(); + SimpleDateFormat sdf = new SimpleDateFormat("yyMMddHHmmss"); + String currentTime = sdf.format(date); + return prefix + currentTime; + } + + /** + * 生成订单号 + * 20233191166110426 + * 20230419135802391412 + * @return + */ + public static String createOrderNo() { + String prefix = DateTime.now().toString(DatePattern.PURE_DATETIME_PATTERN); + return prefix + RandomUtil.randomNumbers(2); + } + + /** + * 生成订单号 + * @param tenantId + * 20233191166110426 + * 20230419135802391412 + * @return + */ + public static String createOrderNo(String tenantId) { + String prefix = DateTime.now().toString(DatePattern.PURE_DATETIME_PATTERN); + return prefix + tenantId + RandomUtil.randomNumbers(2); + } + + /** + * 生成订单水流号 + * @param tenantId + * @return + */ + public static String serialNo(int tenantId) { + String prefix = DateTime.now().toString(DatePattern.PURE_DATETIME_PATTERN); + return prefix + tenantId + RandomUtil.randomNumbers(2); + } + + /** + * 检查List是否有重复元素 + * + * @param list List + * @param mapper 获取需要检查的字段的Function + * @param 数据的类型 + * @param 需要检查的字段的类型 + * @return boolean + */ + public static boolean checkRepeat(List list, Function mapper) { + for (int i = 0; i < list.size(); i++) { + for (int j = 0; j < list.size(); j++) { + if (i != j && mapper.apply(list.get(i)).equals(mapper.apply(list.get(j)))) { + return true; + } + } + } + return false; + } + + /** + * List转为树形结构 + * + * @param data List + * @param parentId 顶级的parentId + * @param parentIdMapper 获取parentId的Function + * @param idMapper 获取id的Function + * @param consumer 赋值children的Consumer + * @param 数据的类型 + * @param parentId的类型 + * @return List + */ + public static List toTreeData(List data, R parentId, + Function parentIdMapper, + Function idMapper, + BiConsumer> consumer) { + List result = new ArrayList<>(); + for (T d : data) { + R dParentId = parentIdMapper.apply(d); + if (ObjectUtil.equals(parentId, dParentId)) { + R dId = idMapper.apply(d); + List children = toTreeData(data, dId, parentIdMapper, idMapper, consumer); + consumer.accept(d, children); + result.add(d); + } + } + return result; + } + + /** + * 遍历树形结构数据 + * + * @param data List + * @param consumer 回调 + * @param mapper 获取children的Function + * @param 数据的类型 + */ + public static void eachTreeData(List data, Consumer consumer, Function> mapper) { + for (T d : data) { + consumer.accept(d); + List children = mapper.apply(d); + if (children != null && children.size() > 0) { + eachTreeData(children, consumer, mapper); + } + } + } + + /** + * 获取集合中的第一条数据 + * + * @param records 集合 + * @return 第一条数据 + */ + public static T listGetOne(List records) { + return records == null || records.size() == 0 ? null : records.get(0); + } + + /** + * 支持跨域 + * + * @param response HttpServletResponse + */ + public static void addCrossHeaders(HttpServletResponse response) { + response.setHeader("Access-Control-Max-Age", "3600"); + response.setHeader("Access-Control-Allow-Origin", "*"); + response.setHeader("Access-Control-Allow-Methods", "*"); + response.setHeader("Access-Control-Allow-Headers", "*"); + response.setHeader("Access-Control-Expose-Headers", Constants.TOKEN_HEADER_NAME); + } + + /** + * 输出错误信息 + * + * @param response HttpServletResponse + * @param code 错误码 + * @param message 提示信息 + * @param error 错误信息 + */ + public static void responseError(HttpServletResponse response, Integer code, String message, String error) { + response.setContentType("application/json;charset=UTF-8"); + try { + PrintWriter out = response.getWriter(); + out.write(JSONUtil.toJSONString(new ApiResult<>(code, message, null, error))); + out.flush(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + + + public static boolean hasRole(List array, String value){ + System.out.println("value = " + value); + if (value == null) { + return true; + } + if (array == null) { + return false; + } + if (!array.isEmpty()) { + final List collect = array.stream().map(Role::getRoleCode) + .collect(Collectors.toList()); + final boolean contains = collect.contains(value); + if (contains) { + return true; + } + } + return false; + } + + public static boolean hasRole(List array,List value){ + System.out.println("value = " + value); + if (value == null) { + return true; + } + if (array == null) { + return false; + } + if (!array.isEmpty()) { + final List collect = array.stream().map(Role::getRoleCode) + .collect(Collectors.toList()); + final boolean disjoint = Collections.disjoint(collect, value); + if (!disjoint) { + return true; + } + } + return false; + } + + /** + * 验证给定的字符串是否为有效的中国大陆手机号码。 + * + * @param phoneNumber 要验证的电话号码字符串 + * @return 如果字符串是有效的手机号码,则返回true;否则返回false + */ + public static boolean isValidPhoneNumber(String phoneNumber) { + // 定义手机号码的正则表达式 + String regex = "^1[3-9]\\d{9}$"; + + // 创建Pattern对象 + Pattern pattern = Pattern.compile(regex); + + // 使用matcher方法创建Matcher对象并进行匹配 + return pattern.matcher(phoneNumber).matches(); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/core/utils/DomainUtil.java b/src/main/java/com/gxwebsoft/common/core/utils/DomainUtil.java new file mode 100644 index 0000000..c2b84cd --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/utils/DomainUtil.java @@ -0,0 +1,32 @@ +package com.gxwebsoft.common.core.utils; + +import static com.gxwebsoft.common.core.constants.DomainConstants.*; + +public class DomainUtil { + + /** + * 根域名 + * @return domain.com + */ + public static String getRootDomain() { + return ROOT_DOMAIN; + } + + /** + * 管理后台地址 + * @return https://{tenantId}.websoft.top + */ + public static String getAdminUrl(String tenantId) { + return PREFIX.concat(tenantId).concat(ADMIN_SUFFIX); + } + + /** + * 应用网址 + * @param tenantId + * @return https://{tenantId}.wsdns.cn + */ + public static String getSiteUrl(String tenantId){ + return PREFIX.concat(tenantId).concat(WEB_SUFFIX); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/core/utils/FileServerUtil.java b/src/main/java/com/gxwebsoft/common/core/utils/FileServerUtil.java new file mode 100644 index 0000000..45201d2 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/utils/FileServerUtil.java @@ -0,0 +1,401 @@ +package com.gxwebsoft.common.core.utils; + +import cn.hutool.core.img.ImgUtil; +import cn.hutool.core.io.FileUtil; +import cn.hutool.core.io.IORuntimeException; +import cn.hutool.core.io.IoUtil; +import cn.hutool.core.util.StrUtil; +import org.apache.tika.Tika; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.*; +import java.net.MalformedURLException; +import java.net.URLEncoder; +import java.text.SimpleDateFormat; +import java.util.*; + +/** + * 文件上传下载工具类 + * + * @author WebSoft + * @since 2018-12-14 08:38:53 + */ +public class FileServerUtil { + // 除 text/* 外也需要设置输出编码的 content-type + private final static List SET_CHARSET_CONTENT_TYPES = Arrays.asList( + "application/json", + "application/javascript" + ); + + /** + * 上传文件 + * + * @param file MultipartFile + * @param directory 文件保存的目录 + * @param uuidName 是否用uuid命名 + * @return File + */ + public static File upload(MultipartFile file, String directory, boolean uuidName) + throws IOException, IllegalStateException { + File outFile = getUploadFile(file.getOriginalFilename(), directory, uuidName); + if (!outFile.getParentFile().exists()) { + if (!outFile.getParentFile().mkdirs()) { + throw new RuntimeException("make directory fail"); + } + } + file.transferTo(outFile); + return outFile; + } + + /** + * 上传base64格式文件 + * + * @param base64 base64编码字符 + * @param fileName 文件名称, 为空使用uuid命名 + * @param directory 文件保存的目录 + * @return File + */ + public static File upload(String base64, String fileName, String directory) + throws FileNotFoundException, IORuntimeException { + if (StrUtil.isBlank(base64) || !base64.startsWith("data:image/") || !base64.contains(";base64,")) { + throw new RuntimeException("base64 data error"); + } + String suffix = "." + base64.substring(11, base64.indexOf(";")); // 获取文件后缀 + boolean uuidName = StrUtil.isBlank(fileName); + File outFile = getUploadFile(uuidName ? suffix : fileName, directory, uuidName); + byte[] bytes = Base64.getDecoder().decode(base64.substring(base64.indexOf(";") + 8).getBytes()); + IoUtil.write(new FileOutputStream(outFile), true, bytes); + return outFile; + } + + /** + * 获取上传文件位置 + * + * @param name 文件名称 + * @param directory 上传目录 + * @param uuidName 是否使用uuid命名 + * @return File + */ + public static File getUploadFile(String name, String directory, boolean uuidName) { + // 当前日期作为上传子目录 + String dir = new SimpleDateFormat("yyyyMMdd/").format(new Date()); + // 获取文件后缀 + String suffix = (name == null || !name.contains(".")) ? "" : name.substring(name.lastIndexOf(".")); + // 使用uuid命名 + if (uuidName || name == null) { + String uuid = UUID.randomUUID().toString().replaceAll("-", ""); + return new File(directory, dir + uuid + suffix); + } + // 使用原名称, 存在相同则加(1) + File file = new File(directory, dir + name); + String prefix = StrUtil.removeSuffix(name, suffix); + int sameSize = 2; + while (file.exists()) { + file = new File(directory, dir + prefix + "(" + sameSize + ")" + suffix); + sameSize++; + } + return file; + } + + /** + * 查看文件, 支持断点续传 + * + * @param file 文件 + * @param pdfDir office转pdf输出目录 + * @param officeHome openOffice安装目录 + * @param response HttpServletResponse + * @param request HttpServletRequest + */ + public static void preview(File file, String pdfDir, String officeHome, + HttpServletResponse response, HttpServletRequest request) { + preview(file, false, null, pdfDir, officeHome, response, request); + } + + /** + * 查看文件, 支持断点续传 + * + * @param file 文件 + * @param forceDownload 是否强制下载 + * @param fileName 强制下载的文件名称 + * @param pdfDir office转pdf输出目录 + * @param officeHome openOffice安装目录 + * @param response HttpServletResponse + * @param request HttpServletRequest + */ + public static void preview(File file, boolean forceDownload, String fileName, String pdfDir, String officeHome, + HttpServletResponse response, HttpServletRequest request) { + CommonUtil.addCrossHeaders(response); + if (file == null || !file.exists()) { + outNotFund(response); + return; + } + if (forceDownload) { + setDownloadHeader(response, StrUtil.isBlank(fileName) ? file.getName() : fileName); + } else { + // office转pdf预览 + if (OpenOfficeUtil.canConverter(file.getName())) { + File pdfFile = OpenOfficeUtil.converterToPDF(file.getAbsolutePath(), pdfDir, officeHome); + if (pdfFile != null) { + file = pdfFile; + } + } + // 获取文件类型 + String contentType = getContentType(file); + if (contentType != null) { + response.setContentType(contentType); + // 设置编码 + if (contentType.startsWith("text/") || SET_CHARSET_CONTENT_TYPES.contains(contentType)) { + try { + String charset = JChardetFacadeUtil.detectCodepage(file.toURI().toURL()); + if (charset != null) { + response.setCharacterEncoding(charset); + } + } catch (MalformedURLException e) { + e.printStackTrace(); + } + } + } else { + setDownloadHeader(response, file.getName()); + } + } + response.setHeader("Cache-Control", "public"); + output(file, response, request); + } + + /** + * 查看缩略图 + * + * @param file 原文件 + * @param thumbnail 缩略图文件 + * @param size 缩略图文件的最大值(kb) + * @param response HttpServletResponse + * @param request HttpServletRequest + */ + public static void previewThumbnail(File file, File thumbnail, Integer size, + HttpServletResponse response, HttpServletRequest request) { + // 如果是图片并且缩略图不存在则生成 + if (!thumbnail.exists() && isImage(file)) { + long fileSize = file.length(); + if ((fileSize / 1024) > size) { + try { + if (thumbnail.getParentFile().mkdirs()) { + System.out.println("生成缩略图1>>>>>>>>>>>>>>>> = " + thumbnail); + ImgUtil.scale(file, thumbnail, size / (fileSize / 1024f)); + if (thumbnail.exists() && thumbnail.length() > file.length()) { + FileUtil.copy(file, thumbnail, true); + } + }else{ + System.out.println("生成缩略图2>>>>>>>>>>>>>>>> = " + thumbnail); + ImgUtil.scale(file, thumbnail, size / (fileSize / 1024f)); + if (thumbnail.exists() && thumbnail.length() > file.length()) { + FileUtil.copy(file, thumbnail, true); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + } else { + preview(file, null, null, response, request); + return; + } + } + preview(thumbnail.exists() ? thumbnail : file, null, null, response, request); + } + + /** + * 输出文件流, 支持断点续传 + * + * @param file 文件 + * @param response HttpServletResponse + * @param request HttpServletRequest + */ + public static void output(File file, HttpServletResponse response, HttpServletRequest request) { + long length = file.length(); // 文件总大小 + long start = 0, to = length - 1; // 开始读取位置, 结束读取位置 + long lastModified = file.lastModified(); // 文件修改时间 + response.setHeader("Accept-Ranges", "bytes"); + response.setHeader("ETag", "\"" + length + "-" + lastModified + "\""); + response.setHeader("Last-Modified", new Date(lastModified).toString()); + String range = request.getHeader("Range"); + if (range != null) { + response.setStatus(HttpServletResponse.SC_PARTIAL_CONTENT); + String[] ranges = range.replace("bytes=", "").split("-"); + start = Long.parseLong(ranges[0].trim()); + if (ranges.length > 1) { + to = Long.parseLong(ranges[1].trim()); + } + response.setHeader("Content-Range", "bytes " + start + "-" + to + "/" + length); + } + response.setHeader("Content-Length", String.valueOf(to - start + 1)); + try { + output(file, response.getOutputStream(), 2048, start, to); + } catch (IOException e) { + e.printStackTrace(); + } + } + + /** + * 输出文件流 + * + * @param file 文件 + * @param os 输出流 + */ + public static void output(File file, OutputStream os) { + output(file, os, null); + } + + /** + * 输出文件流 + * + * @param file 文件 + * @param os 输出流 + * @param size 读取缓冲区大小 + */ + public static void output(File file, OutputStream os, Integer size) { + output(file, os, size, null, null); + } + + /** + * 输出文件流, 支持分片 + * + * @param file 文件 + * @param os 输出流 + * @param size 读取缓冲区大小 + * @param start 开始位置 + * @param to 结束位置 + */ + public static void output(File file, OutputStream os, Integer size, Long start, Long to) { + BufferedInputStream is = null; + try { + is = new BufferedInputStream(new FileInputStream(file)); + if (start != null) { + long skip = is.skip(start); + if (skip < start) { + System.out.println("ERROR: skip fail[ skipped=" + skip + ", start= " + start + " ]"); + } + to = to - start + 1; + } + byte[] bytes = new byte[size == null ? 2048 : size]; + int len; + if (to == null) { + while ((len = is.read(bytes)) != -1) { + os.write(bytes, 0, len); + } + } else { + while (to > 0 && (len = is.read(bytes)) != -1) { + os.write(bytes, 0, to < len ? (int) ((long) to) : len); + to -= len; + } + } + os.flush(); + } catch (IOException ignored) { + } catch (Exception e) { + e.printStackTrace(); + } finally { + if (os != null) { + try { + os.close(); + } catch (IOException ignored) { + } + } + if (is != null) { + try { + is.close(); + } catch (IOException e) { + System.out.println(e.getMessage()); + } + } + } + } + + /** + * 获取文件类型 + * + * @param file 文件 + * @return String + */ + public static String getContentType(File file) { + String contentType = null; + if (file.exists()) { + try { + contentType = new Tika().detect(file); + } catch (IOException e) { + e.printStackTrace(); + } + } + return contentType; + } + + /** + * 判断文件是否是图片类型 + * + * @param file 文件 + * @return boolean + */ + public static boolean isImage(File file) { + return isImage(getContentType(file)); + } + + /** + * 判断文件是否是图片类型 + * + * @param contentType 文件类型 + * @return boolean + */ + public static boolean isImage(String contentType) { + return contentType != null && contentType.startsWith("image/"); + } + + /** + * 设置下载文件的header + * + * @param response HttpServletResponse + * @param fileName 文件名称 + */ + public static void setDownloadHeader(HttpServletResponse response, String fileName) { + response.setContentType("application/force-download"); + try { + fileName = URLEncoder.encode(fileName, "utf-8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + response.setHeader("Content-Disposition", "attachment;fileName=" + fileName); + } + + /** + * 输出404错误页面 + * + * @param response HttpServletResponse + */ + public static void outNotFund(HttpServletResponse response) { + response.setStatus(HttpServletResponse.SC_NOT_FOUND); + outMessage("404 Not Found", null, response); + } + + /** + * 输出错误页面 + * + * @param title 标题 + * @param message 内容 + * @param response HttpServletResponse + */ + public static void outMessage(String title, String message, HttpServletResponse response) { + response.setContentType("text/html;charset=UTF-8"); + try { + PrintWriter writer = response.getWriter(); + writer.write(""); + writer.write("" + title + ""); + writer.write("

" + title + "

"); + if (message != null) { + writer.write(message); + } + writer.write("

WebSoft File Server

"); + writer.flush(); + } catch (IOException e) { + e.printStackTrace(); + } + } + +} diff --git a/src/main/java/com/gxwebsoft/common/core/utils/HttpUtils.java b/src/main/java/com/gxwebsoft/common/core/utils/HttpUtils.java new file mode 100644 index 0000000..888acc2 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/utils/HttpUtils.java @@ -0,0 +1,311 @@ +package com.gxwebsoft.common.core.utils; + +import org.apache.commons.lang3.StringUtils; +import org.apache.http.HttpResponse; +import org.apache.http.NameValuePair; +import org.apache.http.client.HttpClient; +import org.apache.http.client.entity.UrlEncodedFormEntity; +import org.apache.http.client.methods.HttpDelete; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.client.methods.HttpPut; +import org.apache.http.conn.ClientConnectionManager; +import org.apache.http.conn.scheme.Scheme; +import org.apache.http.conn.scheme.SchemeRegistry; +import org.apache.http.conn.ssl.SSLSocketFactory; +import org.apache.http.entity.ByteArrayEntity; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.DefaultHttpClient; +import org.apache.http.message.BasicNameValuePair; + +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManager; +import javax.net.ssl.X509TrustManager; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.security.KeyManagementException; +import java.security.NoSuchAlgorithmException; +import java.security.cert.X509Certificate; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +public class HttpUtils { + + /** + * get + * + * @param host + * @param path + * @param method + * @param headers + * @param querys + * @return + * @throws Exception + */ + public static HttpResponse doGet(String host, String path, String method, + Map headers, + Map querys) + throws Exception { + HttpClient httpClient = wrapClient(host); + + HttpGet request = new HttpGet(buildUrl(host, path, querys)); + for (Map.Entry e : headers.entrySet()) { + request.addHeader(e.getKey(), e.getValue()); + } + + return httpClient.execute(request); + } + + /** + * post form + * + * @param host + * @param path + * @param method + * @param headers + * @param querys + * @param bodys + * @return + * @throws Exception + */ + public static HttpResponse doPost(String host, String path, String method, + Map headers, + Map querys, + Map bodys) + throws Exception { + HttpClient httpClient = wrapClient(host); + + HttpPost request = new HttpPost(buildUrl(host, path, querys)); + for (Map.Entry e : headers.entrySet()) { + request.addHeader(e.getKey(), e.getValue()); + } + + if (bodys != null) { + List nameValuePairList = new ArrayList(); + + for (String key : bodys.keySet()) { + nameValuePairList.add(new BasicNameValuePair(key, bodys.get(key))); + } + UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(nameValuePairList, "utf-8"); + formEntity.setContentType("application/x-www-form-urlencoded; charset=UTF-8"); + request.setEntity(formEntity); + } + + return httpClient.execute(request); + } + + /** + * Post String + * + * @param host + * @param path + * @param method + * @param headers + * @param querys + * @param body + * @return + * @throws Exception + */ + public static HttpResponse doPost(String host, String path, String method, + Map headers, + Map querys, + String body) + throws Exception { + HttpClient httpClient = wrapClient(host); + + HttpPost request = new HttpPost(buildUrl(host, path, querys)); + for (Map.Entry e : headers.entrySet()) { + request.addHeader(e.getKey(), e.getValue()); + } + + if (StringUtils.isNotBlank(body)) { + request.setEntity(new StringEntity(body, "utf-8")); + } + + return httpClient.execute(request); + } + + /** + * Post stream + * + * @param host + * @param path + * @param method + * @param headers + * @param querys + * @param body + * @return + * @throws Exception + */ + public static HttpResponse doPost(String host, String path, String method, + Map headers, + Map querys, + byte[] body) + throws Exception { + HttpClient httpClient = wrapClient(host); + + HttpPost request = new HttpPost(buildUrl(host, path, querys)); + for (Map.Entry e : headers.entrySet()) { + request.addHeader(e.getKey(), e.getValue()); + } + + if (body != null) { + request.setEntity(new ByteArrayEntity(body)); + } + + return httpClient.execute(request); + } + + /** + * Put String + * @param host + * @param path + * @param method + * @param headers + * @param querys + * @param body + * @return + * @throws Exception + */ + public static HttpResponse doPut(String host, String path, String method, + Map headers, + Map querys, + String body) + throws Exception { + HttpClient httpClient = wrapClient(host); + + HttpPut request = new HttpPut(buildUrl(host, path, querys)); + for (Map.Entry e : headers.entrySet()) { + request.addHeader(e.getKey(), e.getValue()); + } + + if (StringUtils.isNotBlank(body)) { + request.setEntity(new StringEntity(body, "utf-8")); + } + + return httpClient.execute(request); + } + + /** + * Put stream + * @param host + * @param path + * @param method + * @param headers + * @param querys + * @param body + * @return + * @throws Exception + */ + public static HttpResponse doPut(String host, String path, String method, + Map headers, + Map querys, + byte[] body) + throws Exception { + HttpClient httpClient = wrapClient(host); + + HttpPut request = new HttpPut(buildUrl(host, path, querys)); + for (Map.Entry e : headers.entrySet()) { + request.addHeader(e.getKey(), e.getValue()); + } + + if (body != null) { + request.setEntity(new ByteArrayEntity(body)); + } + + return httpClient.execute(request); + } + + /** + * Delete + * + * @param host + * @param path + * @param method + * @param headers + * @param querys + * @return + * @throws Exception + */ + public static HttpResponse doDelete(String host, String path, String method, + Map headers, + Map querys) + throws Exception { + HttpClient httpClient = wrapClient(host); + + HttpDelete request = new HttpDelete(buildUrl(host, path, querys)); + for (Map.Entry e : headers.entrySet()) { + request.addHeader(e.getKey(), e.getValue()); + } + + return httpClient.execute(request); + } + + private static String buildUrl(String host, String path, Map querys) throws UnsupportedEncodingException { + StringBuilder sbUrl = new StringBuilder(); + sbUrl.append(host); + if (!StringUtils.isBlank(path)) { + sbUrl.append(path); + } + if (null != querys) { + StringBuilder sbQuery = new StringBuilder(); + for (Map.Entry query : querys.entrySet()) { + if (0 < sbQuery.length()) { + sbQuery.append("&"); + } + if (StringUtils.isBlank(query.getKey()) && !StringUtils.isBlank(query.getValue())) { + sbQuery.append(query.getValue()); + } + if (!StringUtils.isBlank(query.getKey())) { + sbQuery.append(query.getKey()); + if (!StringUtils.isBlank(query.getValue())) { + sbQuery.append("="); + sbQuery.append(URLEncoder.encode(query.getValue(), "utf-8")); + } + } + } + if (0 < sbQuery.length()) { + sbUrl.append("?").append(sbQuery); + } + } + + return sbUrl.toString(); + } + + private static HttpClient wrapClient(String host) { + HttpClient httpClient = new DefaultHttpClient(); + if (host.startsWith("https://")) { + sslClient(httpClient); + } + + return httpClient; + } + + private static void sslClient(HttpClient httpClient) { + try { + SSLContext ctx = SSLContext.getInstance("TLS"); + X509TrustManager tm = new X509TrustManager() { + public X509Certificate[] getAcceptedIssuers() { + return null; + } + public void checkClientTrusted(X509Certificate[] xcs, String str) { + + } + public void checkServerTrusted(X509Certificate[] xcs, String str) { + + } + }; + ctx.init(null, new TrustManager[] { tm }, null); + SSLSocketFactory ssf = new SSLSocketFactory(ctx); + ssf.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER); + ClientConnectionManager ccm = httpClient.getConnectionManager(); + SchemeRegistry registry = ccm.getSchemeRegistry(); + registry.register(new Scheme("https", 443, ssf)); + } catch (KeyManagementException ex) { + throw new RuntimeException(ex); + } catch (NoSuchAlgorithmException ex) { + throw new RuntimeException(ex); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/gxwebsoft/common/core/utils/ImageUtil.java b/src/main/java/com/gxwebsoft/common/core/utils/ImageUtil.java new file mode 100644 index 0000000..9a1e18f --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/utils/ImageUtil.java @@ -0,0 +1,62 @@ +package com.gxwebsoft.common.core.utils; + +import cn.hutool.core.codec.Base64Encoder; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.HttpURLConnection; +import java.net.URL; + +public class ImageUtil { + public static String ImageBase64(String imgUrl) { + URL url = null; + InputStream is = null; + ByteArrayOutputStream outStream = null; + HttpURLConnection httpUrl = null; + try{ + url = new URL(imgUrl); + httpUrl = (HttpURLConnection) url.openConnection(); + httpUrl.connect(); + httpUrl.getInputStream(); + is = httpUrl.getInputStream(); + + outStream = new ByteArrayOutputStream(); + //创建一个Buffer字符串 + byte[] buffer = new byte[1024]; + //每次读取的字符串长度,如果为-1,代表全部读取完毕 + int len = 0; + //使用一个输入流从buffer里把数据读取出来 + while( (len=is.read(buffer)) != -1 ){ + //用输出流往buffer里写入数据,中间参数代表从哪个位置开始读,len代表读取的长度 + outStream.write(buffer, 0, len); + } + // 对字节数组Base64编码 + return new Base64Encoder().encode(outStream.toByteArray()); + }catch (Exception e) { + e.printStackTrace(); + } + finally{ + if(is != null) + { + try { + is.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + if(outStream != null) + { + try { + outStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + if(httpUrl != null) + { + httpUrl.disconnect(); + } + } + return imgUrl; + } +} diff --git a/src/main/java/com/gxwebsoft/common/core/utils/JChardetFacadeUtil.java b/src/main/java/com/gxwebsoft/common/core/utils/JChardetFacadeUtil.java new file mode 100644 index 0000000..1b49fb7 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/utils/JChardetFacadeUtil.java @@ -0,0 +1,2025 @@ +package com.gxwebsoft.common.core.utils; + +import java.io.*; +import java.net.URL; +import java.nio.charset.Charset; +import java.nio.charset.UnsupportedCharsetException; + +/** + * 文件编码检测工具, 核心代码来自 cpDetector 和 jChardet, 可以检测大多数文件的编码 + * + * @author WebSoft + * @since 2020-09-15 09:24:20 + */ +public class JChardetFacadeUtil { + + public static String detectCodepage(URL url) { + try { + Charset ret = JChardetFacade.getInstance().detectCodepage(url); + return ret == null ? null : ret.name(); + } catch (Exception ignored) { + } + return null; + } + + /** + * 下面代码来自: https://github.com/r91987/cpdetector + */ + public static class JChardetFacade extends AbstractCodepageDetector implements nsICharsetDetectionObserver { + private static JChardetFacade instance = null; + private static nsDetector det; + private byte[] buf = new byte[4096]; + private Charset codpage = null; + private boolean m_guessing = true; + private int amountOfVerifiers = 0; + + private JChardetFacade() { + det = new nsDetector(0); + det.Init(this); + this.amountOfVerifiers = det.getProbableCharsets().length; + } + + public static JChardetFacade getInstance() { + if (instance == null) { + instance = new JChardetFacade(); + } + + return instance; + } + + public synchronized Charset detectCodepage(InputStream in, int length) throws IOException { + this.Reset(); + int read = 0; + boolean done = false; + boolean isAscii = true; + Charset ret = null; + + int len; + do { + len = in.read(this.buf, 0, Math.min(this.buf.length, length - read)); + if (len > 0) { + read += len; + } + + if (!done) { + done = det.DoIt(this.buf, len, false); + } + } while (len > 0 && !done); + + det.DataEnd(); + if (this.codpage == null) { + if (this.m_guessing) { + ret = this.guess(); + } + } else { + ret = this.codpage; + } + return ret; + } + + private Charset guess() { + Charset ret = null; + String[] possibilities = det.getProbableCharsets(); + if (possibilities.length == this.amountOfVerifiers) { + ret = Charset.forName("US-ASCII"); + } else { + String check = possibilities[0]; + if (!check.equalsIgnoreCase("nomatch")) { + for (int i = 0; ret == null && i < possibilities.length; ++i) { + try { + ret = Charset.forName(possibilities[i]); + } catch (UnsupportedCharsetException ignored) { + } + } + } + } + return ret; + } + + public void Notify(String charset) { + this.codpage = Charset.forName(charset); + } + + public void Reset() { + det.Reset(); + this.codpage = null; + } + + public boolean isGuessing() { + return this.m_guessing; + } + + public synchronized void setGuessing(boolean guessing) { + this.m_guessing = guessing; + } + } + + /** + * + */ + public static abstract class AbstractCodepageDetector implements ICodepageDetector { + public AbstractCodepageDetector() { + } + + public Charset detectCodepage(URL url) throws IOException { + BufferedInputStream in = new BufferedInputStream(url.openStream()); + Charset result = this.detectCodepage(in, 2147483647); + in.close(); + return result; + } + + public final Reader open(URL url) throws IOException { + Reader ret = null; + Charset cs = this.detectCodepage(url); + if (cs != null) { + ret = new InputStreamReader(new BufferedInputStream(url.openStream()), cs); + } + + return ret; + } + + public int compareTo(Object o) { + String other = o.getClass().getName(); + String mine = this.getClass().getName(); + return mine.compareTo(other); + } + } + + /** + * + */ + interface ICodepageDetector extends Serializable, Comparable { + Reader open(URL var1) throws IOException; + + Charset detectCodepage(URL var1) throws IOException; + + Charset detectCodepage(InputStream var1, int var2) throws IOException; + } + + /** + * 以下代码开始是由Mozilla组织提供的JChardet, 它可以检测大多数文件的编码 + * http://jchardet.sourceforge.net/ + */ + public static class nsDetector extends nsPSMDetector implements nsICharsetDetector { + nsICharsetDetectionObserver mObserver = null; + + public nsDetector() { + } + + public nsDetector(int var1) { + super(var1); + } + + public void Init(nsICharsetDetectionObserver var1) { + this.mObserver = var1; + } + + public boolean DoIt(byte[] var1, int var2, boolean var3) { + if (var1 != null && !var3) { + this.HandleData(var1, var2); + return this.mDone; + } else { + return false; + } + } + + public void Done() { + this.DataEnd(); + } + + public void Report(String var1) { + if (this.mObserver != null) { + this.mObserver.Notify(var1); + } + + } + + public boolean isAscii(byte[] var1, int var2) { + for (int var3 = 0; var3 < var2; ++var3) { + if ((128 & var1[var3]) != 0) { + return false; + } + } + + return true; + } + } + + /** + * + */ + public static abstract class nsPSMDetector { + public static final int ALL = 0; + public static final int JAPANESE = 1; + public static final int CHINESE = 2; + public static final int SIMPLIFIED_CHINESE = 3; + public static final int TRADITIONAL_CHINESE = 4; + public static final int KOREAN = 5; + public static final int NO_OF_LANGUAGES = 6; + public static final int MAX_VERIFIERS = 16; + nsVerifier[] mVerifier; + nsEUCStatistics[] mStatisticsData; + nsEUCSampler mSampler = new nsEUCSampler(); + byte[] mState = new byte[16]; + int[] mItemIdx = new int[16]; + int mItems; + int mClassItems; + boolean mDone; + boolean mRunSampler; + boolean mClassRunSampler; + + public nsPSMDetector() { + this.initVerifiers(0); + this.Reset(); + } + + public nsPSMDetector(int var1) { + this.initVerifiers(var1); + this.Reset(); + } + + public nsPSMDetector(int var1, nsVerifier[] var2, nsEUCStatistics[] var3) { + this.mClassRunSampler = var3 != null; + this.mStatisticsData = var3; + this.mVerifier = var2; + this.mClassItems = var1; + this.Reset(); + } + + public void Reset() { + this.mRunSampler = this.mClassRunSampler; + this.mDone = false; + this.mItems = this.mClassItems; + + for (int var1 = 0; var1 < this.mItems; this.mItemIdx[var1] = var1++) { + this.mState[var1] = 0; + } + + this.mSampler.Reset(); + } + + protected void initVerifiers(int var1) { + boolean var2 = false; + int var3; + if (var1 >= 0 && var1 < 6) { + var3 = var1; + } else { + var3 = 0; + } + + this.mVerifier = null; + this.mStatisticsData = null; + if (var3 == 4) { + this.mVerifier = new nsVerifier[]{new nsUTF8Verifier(), new nsBIG5Verifier(), new nsISO2022CNVerifier(), new nsEUCTWVerifier(), new nsCP1252Verifier(), new nsUCS2BEVerifier(), new nsUCS2LEVerifier()}; + this.mStatisticsData = new nsEUCStatistics[]{null, new Big5Statistics(), null, new EUCTWStatistics(), null, null, null}; + } else if (var3 == 5) { + this.mVerifier = new nsVerifier[]{new nsUTF8Verifier(), new nsEUCKRVerifier(), new nsISO2022KRVerifier(), new nsCP1252Verifier(), new nsUCS2BEVerifier(), new nsUCS2LEVerifier()}; + } else if (var3 == 3) { + this.mVerifier = new nsVerifier[]{new nsUTF8Verifier(), new nsGB2312Verifier(), new nsGB18030Verifier(), new nsISO2022CNVerifier(), new nsHZVerifier(), new nsCP1252Verifier(), new nsUCS2BEVerifier(), new nsUCS2LEVerifier()}; + } else if (var3 == 1) { + this.mVerifier = new nsVerifier[]{new nsUTF8Verifier(), new nsSJISVerifier(), new nsEUCJPVerifier(), new nsISO2022JPVerifier(), new nsCP1252Verifier(), new nsUCS2BEVerifier(), new nsUCS2LEVerifier()}; + } else if (var3 == 2) { + this.mVerifier = new nsVerifier[]{new nsUTF8Verifier(), new nsGB2312Verifier(), new nsGB18030Verifier(), new nsBIG5Verifier(), new nsISO2022CNVerifier(), new nsHZVerifier(), new nsEUCTWVerifier(), new nsCP1252Verifier(), new nsUCS2BEVerifier(), new nsUCS2LEVerifier()}; + this.mStatisticsData = new nsEUCStatistics[]{null, new GB2312Statistics(), null, new Big5Statistics(), null, null, new EUCTWStatistics(), null, null, null}; + } else if (var3 == 0) { + this.mVerifier = new nsVerifier[]{new nsUTF8Verifier(), new nsSJISVerifier(), new nsEUCJPVerifier(), new nsISO2022JPVerifier(), new nsEUCKRVerifier(), new nsISO2022KRVerifier(), new nsBIG5Verifier(), new nsEUCTWVerifier(), new nsGB2312Verifier(), new nsGB18030Verifier(), new nsISO2022CNVerifier(), new nsHZVerifier(), new nsCP1252Verifier(), new nsUCS2BEVerifier(), new nsUCS2LEVerifier()}; + this.mStatisticsData = new nsEUCStatistics[]{null, null, new EUCJPStatistics(), null, new EUCKRStatistics(), null, new Big5Statistics(), new EUCTWStatistics(), new GB2312Statistics(), null, null, null, null, null, null}; + } + + this.mClassRunSampler = this.mStatisticsData != null; + this.mClassItems = this.mVerifier.length; + } + + public abstract void Report(String var1); + + public boolean HandleData(byte[] var1, int var2) { + for (int var3 = 0; var3 < var2; ++var3) { + byte var5 = var1[var3]; + int var4 = 0; + + while (var4 < this.mItems) { + byte var6 = nsVerifier.getNextState(this.mVerifier[this.mItemIdx[var4]], var5, this.mState[var4]); + if (var6 == 2) { + this.Report(this.mVerifier[this.mItemIdx[var4]].charset()); + this.mDone = true; + return this.mDone; + } + + if (var6 == 1) { + --this.mItems; + if (var4 < this.mItems) { + this.mItemIdx[var4] = this.mItemIdx[this.mItems]; + this.mState[var4] = this.mState[this.mItems]; + } + } else { + this.mState[var4++] = var6; + } + } + + if (this.mItems <= 1) { + if (1 == this.mItems) { + this.Report(this.mVerifier[this.mItemIdx[0]].charset()); + } + + this.mDone = true; + return this.mDone; + } + + int var7 = 0; + int var8 = 0; + + for (var4 = 0; var4 < this.mItems; ++var4) { + if (!this.mVerifier[this.mItemIdx[var4]].isUCS2() && !this.mVerifier[this.mItemIdx[var4]].isUCS2()) { + ++var7; + var8 = var4; + } + } + + if (1 == var7) { + this.Report(this.mVerifier[this.mItemIdx[var8]].charset()); + this.mDone = true; + return this.mDone; + } + } + + if (this.mRunSampler) { + this.Sample(var1, var2); + } + + return this.mDone; + } + + public void DataEnd() { + if (!this.mDone) { + if (this.mItems == 2) { + if (this.mVerifier[this.mItemIdx[0]].charset().equals("GB18030")) { + this.Report(this.mVerifier[this.mItemIdx[1]].charset()); + this.mDone = true; + } else if (this.mVerifier[this.mItemIdx[1]].charset().equals("GB18030")) { + this.Report(this.mVerifier[this.mItemIdx[0]].charset()); + this.mDone = true; + } + } + + if (this.mRunSampler) { + this.Sample((byte[]) null, 0, true); + } + + } + } + + public void Sample(byte[] var1, int var2) { + this.Sample(var1, var2, false); + } + + public void Sample(byte[] var1, int var2, boolean var3) { + int var4 = 0; + int var6 = 0; + + int var5; + for (var5 = 0; var5 < this.mItems; ++var5) { + if (null != this.mStatisticsData[this.mItemIdx[var5]]) { + ++var6; + } + + if (!this.mVerifier[this.mItemIdx[var5]].isUCS2() && !this.mVerifier[this.mItemIdx[var5]].charset().equals("GB18030")) { + ++var4; + } + } + + this.mRunSampler = var6 > 1; + if (this.mRunSampler) { + this.mRunSampler = this.mSampler.Sample(var1, var2); + if ((var3 && this.mSampler.GetSomeData() || this.mSampler.EnoughData()) && var6 == var4) { + this.mSampler.CalFreq(); + int var7 = -1; + int var8 = 0; + float var9 = 0.0F; + + for (var5 = 0; var5 < this.mItems; ++var5) { + if (null != this.mStatisticsData[this.mItemIdx[var5]] && !this.mVerifier[this.mItemIdx[var5]].charset().equals("Big5")) { + float var10 = this.mSampler.GetScore(this.mStatisticsData[this.mItemIdx[var5]].mFirstByteFreq(), this.mStatisticsData[this.mItemIdx[var5]].mFirstByteWeight(), this.mStatisticsData[this.mItemIdx[var5]].mSecondByteFreq(), this.mStatisticsData[this.mItemIdx[var5]].mSecondByteWeight()); + if (0 == var8++ || var9 > var10) { + var9 = var10; + var7 = var5; + } + } + } + + if (var7 >= 0) { + this.Report(this.mVerifier[this.mItemIdx[var7]].charset()); + this.mDone = true; + } + } + } + + } + + public String[] getProbableCharsets() { + String[] var1; + if (this.mItems <= 0) { + var1 = new String[]{"nomatch"}; + return var1; + } else { + var1 = new String[this.mItems]; + + for (int var2 = 0; var2 < this.mItems; ++var2) { + var1[var2] = this.mVerifier[this.mItemIdx[var2]].charset(); + } + + return var1; + } + } + } + + /** + * + */ + public static interface nsICharsetDetectionObserver { + void Notify(String var1); + } + + /** + * + */ + public static interface nsICharsetDetector { + void Init(nsICharsetDetectionObserver var1); + + boolean DoIt(byte[] var1, int var2, boolean var3); + + void Done(); + } + + /** + * + */ + public static abstract class nsVerifier { + static final byte eStart = 0; + static final byte eError = 1; + static final byte eItsMe = 2; + static final int eidxSft4bits = 3; + static final int eSftMsk4bits = 7; + static final int eBitSft4bits = 2; + static final int eUnitMsk4bits = 15; + + nsVerifier() { + } + + public abstract String charset(); + + public abstract int stFactor(); + + public abstract int[] cclass(); + + public abstract int[] states(); + + public abstract boolean isUCS2(); + + public static byte getNextState(nsVerifier var0, byte var1, byte var2) { + return (byte) (255 & var0.states()[(var2 * var0.stFactor() + (var0.cclass()[(var1 & 255) >> 3] >> ((var1 & 7) << 2) & 15) & 255) >> 3] >> ((var2 * var0.stFactor() + (var0.cclass()[(var1 & 255) >> 3] >> ((var1 & 7) << 2) & 15) & 255 & 7) << 2) & 15); + } + } + + /** + * + */ + public static class nsEUCSampler { + int mTotal = 0; + int mThreshold = 200; + int mState = 0; + public int[] mFirstByteCnt = new int[94]; + public int[] mSecondByteCnt = new int[94]; + public float[] mFirstByteFreq = new float[94]; + public float[] mSecondByteFreq = new float[94]; + + public nsEUCSampler() { + this.Reset(); + } + + public void Reset() { + this.mTotal = 0; + this.mState = 0; + + for (int var1 = 0; var1 < 94; ++var1) { + this.mFirstByteCnt[var1] = this.mSecondByteCnt[var1] = 0; + } + + } + + boolean EnoughData() { + return this.mTotal > this.mThreshold; + } + + boolean GetSomeData() { + return this.mTotal > 1; + } + + boolean Sample(byte[] var1, int var2) { + if (this.mState == 1) { + return false; + } else { + int var3 = 0; + + for (int var4 = 0; var4 < var2 && 1 != this.mState; ++var3) { + int var10002; + switch (this.mState) { + case 0: + if ((var1[var3] & 128) != 0) { + if (255 != (255 & var1[var3]) && 161 <= (255 & var1[var3])) { + ++this.mTotal; + var10002 = this.mFirstByteCnt[(255 & var1[var3]) - 161]++; + this.mState = 2; + } else { + this.mState = 1; + } + } + case 1: + break; + case 2: + if ((var1[var3] & 128) != 0) { + if (255 != (255 & var1[var3]) && 161 <= (255 & var1[var3])) { + ++this.mTotal; + var10002 = this.mSecondByteCnt[(255 & var1[var3]) - 161]++; + this.mState = 0; + } else { + this.mState = 1; + } + } else { + this.mState = 1; + } + break; + default: + this.mState = 1; + } + + ++var4; + } + + return 1 != this.mState; + } + } + + void CalFreq() { + for (int var1 = 0; var1 < 94; ++var1) { + this.mFirstByteFreq[var1] = (float) this.mFirstByteCnt[var1] / (float) this.mTotal; + this.mSecondByteFreq[var1] = (float) this.mSecondByteCnt[var1] / (float) this.mTotal; + } + + } + + float GetScore(float[] var1, float var2, float[] var3, float var4) { + return var2 * this.GetScore(var1, this.mFirstByteFreq) + var4 * this.GetScore(var3, this.mSecondByteFreq); + } + + float GetScore(float[] var1, float[] var2) { + float var4 = 0.0F; + + for (int var5 = 0; var5 < 94; ++var5) { + float var3 = var1[var5] - var2[var5]; + var4 += var3 * var3; + } + + return (float) Math.sqrt((double) var4) / 94.0F; + } + } + + /** + * + */ + public static abstract class nsEUCStatistics { + public abstract float[] mFirstByteFreq(); + + public abstract float mFirstByteStdDev(); + + public abstract float mFirstByteMean(); + + public abstract float mFirstByteWeight(); + + public abstract float[] mSecondByteFreq(); + + public abstract float mSecondByteStdDev(); + + public abstract float mSecondByteMean(); + + public abstract float mSecondByteWeight(); + + public nsEUCStatistics() { + } + } + + /** + * + */ + public static class EUCJPStatistics extends nsEUCStatistics { + static float[] mFirstByteFreq; + static float mFirstByteStdDev; + static float mFirstByteMean; + static float mFirstByteWeight; + static float[] mSecondByteFreq; + static float mSecondByteStdDev; + static float mSecondByteMean; + static float mSecondByteWeight; + + public float[] mFirstByteFreq() { + return mFirstByteFreq; + } + + public float mFirstByteStdDev() { + return mFirstByteStdDev; + } + + public float mFirstByteMean() { + return mFirstByteMean; + } + + public float mFirstByteWeight() { + return mFirstByteWeight; + } + + public float[] mSecondByteFreq() { + return mSecondByteFreq; + } + + public float mSecondByteStdDev() { + return mSecondByteStdDev; + } + + public float mSecondByteMean() { + return mSecondByteMean; + } + + public float mSecondByteWeight() { + return mSecondByteWeight; + } + + public EUCJPStatistics() { + mFirstByteFreq = new float[]{0.364808F, 0.0F, 0.0F, 0.145325F, 0.304891F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.001835F, 0.010771F, 0.006462F, 0.001157F, 0.002114F, 0.003231F, 0.001356F, 0.00742F, 0.004189F, 0.003231F, 0.003032F, 0.03319F, 0.006303F, 0.006064F, 0.009973F, 0.002354F, 0.00367F, 0.009135F, 0.001675F, 0.002792F, 0.002194F, 0.01472F, 0.011928F, 8.78E-4F, 0.013124F, 0.001077F, 0.009295F, 0.003471F, 0.002872F, 0.002433F, 9.57E-4F, 0.001636F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 8.0E-5F, 2.79E-4F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 8.0E-5F, 0.0F}; + mFirstByteStdDev = 0.050407F; + mFirstByteMean = 0.010638F; + mFirstByteWeight = 0.640871F; + mSecondByteFreq = new float[]{0.002473F, 0.039134F, 0.152745F, 0.009694F, 3.59E-4F, 0.02218F, 7.58E-4F, 0.004308F, 1.6E-4F, 0.002513F, 0.003072F, 0.001316F, 0.00383F, 0.001037F, 0.00359F, 9.57E-4F, 1.6E-4F, 2.39E-4F, 0.006462F, 0.001596F, 0.031554F, 0.001316F, 0.002194F, 0.016555F, 0.003271F, 6.78E-4F, 5.98E-4F, 0.206438F, 7.18E-4F, 0.001077F, 0.00371F, 0.001356F, 0.001356F, 4.39E-4F, 0.004388F, 0.005704F, 8.78E-4F, 0.010172F, 0.007061F, 0.01468F, 6.38E-4F, 0.02573F, 0.002792F, 7.18E-4F, 0.001795F, 0.091551F, 7.58E-4F, 0.003909F, 5.58E-4F, 0.031195F, 0.007061F, 0.001316F, 0.022579F, 0.006981F, 0.00726F, 0.001117F, 2.39E-4F, 0.012127F, 8.78E-4F, 0.00379F, 0.001077F, 7.58E-4F, 0.002114F, 0.002234F, 6.78E-4F, 0.002992F, 0.003311F, 0.023416F, 0.001237F, 0.002753F, 0.005146F, 0.002194F, 0.007021F, 0.008497F, 0.013763F, 0.011768F, 0.006303F, 0.001915F, 6.38E-4F, 0.008776F, 9.18E-4F, 0.003431F, 0.057603F, 4.39E-4F, 4.39E-4F, 7.58E-4F, 0.002872F, 0.001675F, 0.01105F, 0.0F, 2.79E-4F, 0.012127F, 7.18E-4F, 0.00738F}; + mSecondByteStdDev = 0.028247F; + mSecondByteMean = 0.010638F; + mSecondByteWeight = 0.359129F; + } + } + + /** + * + */ + public static class nsEUCJPVerifier extends nsVerifier { + static int[] cclass; + static int[] states; + static int stFactor; + static String charset; + + public int[] cclass() { + return cclass; + } + + public int[] states() { + return states; + } + + public int stFactor() { + return stFactor; + } + + public String charset() { + return charset; + } + + public nsEUCJPVerifier() { + cclass = new int[32]; + cclass[0] = 1145324612; + cclass[1] = 1430537284; + cclass[2] = 1145324612; + cclass[3] = 1145328708; + cclass[4] = 1145324612; + cclass[5] = 1145324612; + cclass[6] = 1145324612; + cclass[7] = 1145324612; + cclass[8] = 1145324612; + cclass[9] = 1145324612; + cclass[10] = 1145324612; + cclass[11] = 1145324612; + cclass[12] = 1145324612; + cclass[13] = 1145324612; + cclass[14] = 1145324612; + cclass[15] = 1145324612; + cclass[16] = 1431655765; + cclass[17] = 827675989; + cclass[18] = 1431655765; + cclass[19] = 1431655765; + cclass[20] = 572662309; + cclass[21] = 572662306; + cclass[22] = 572662306; + cclass[23] = 572662306; + cclass[24] = 572662306; + cclass[25] = 572662306; + cclass[26] = 572662306; + cclass[27] = 572662306; + cclass[28] = 0; + cclass[29] = 0; + cclass[30] = 0; + cclass[31] = 1342177280; + states = new int[5]; + states[0] = 286282563; + states[1] = 572657937; + states[2] = 286265378; + states[3] = 319885329; + states[4] = 4371; + charset = "EUC-JP"; + stFactor = 6; + } + + public boolean isUCS2() { + return false; + } + } + + /** + * + */ + public static class EUCKRStatistics extends nsEUCStatistics { + static float[] mFirstByteFreq; + static float mFirstByteStdDev; + static float mFirstByteMean; + static float mFirstByteWeight; + static float[] mSecondByteFreq; + static float mSecondByteStdDev; + static float mSecondByteMean; + static float mSecondByteWeight; + + public float[] mFirstByteFreq() { + return mFirstByteFreq; + } + + public float mFirstByteStdDev() { + return mFirstByteStdDev; + } + + public float mFirstByteMean() { + return mFirstByteMean; + } + + public float mFirstByteWeight() { + return mFirstByteWeight; + } + + public float[] mSecondByteFreq() { + return mSecondByteFreq; + } + + public float mSecondByteStdDev() { + return mSecondByteStdDev; + } + + public float mSecondByteMean() { + return mSecondByteMean; + } + + public float mSecondByteWeight() { + return mSecondByteWeight; + } + + public EUCKRStatistics() { + mFirstByteFreq = new float[]{0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 4.12E-4F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.057502F, 0.033182F, 0.002267F, 0.016076F, 0.014633F, 0.032976F, 0.004122F, 0.011336F, 0.058533F, 0.024526F, 0.025969F, 0.054411F, 0.01958F, 0.063273F, 0.113974F, 0.029885F, 0.150041F, 0.059151F, 0.002679F, 0.009893F, 0.014839F, 0.026381F, 0.015045F, 0.069456F, 0.08986F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F}; + mFirstByteStdDev = 0.025593F; + mFirstByteMean = 0.010638F; + mFirstByteWeight = 0.647437F; + mSecondByteFreq = new float[]{0.016694F, 0.0F, 0.012778F, 0.030091F, 0.002679F, 0.006595F, 0.001855F, 8.24E-4F, 0.005977F, 0.00474F, 0.003092F, 8.24E-4F, 0.01958F, 0.037304F, 0.008244F, 0.014633F, 0.001031F, 0.0F, 0.003298F, 0.002061F, 0.006183F, 0.005977F, 8.24E-4F, 0.021847F, 0.014839F, 0.052968F, 0.017312F, 0.007626F, 4.12E-4F, 8.24E-4F, 0.011129F, 0.0F, 4.12E-4F, 0.001649F, 0.005977F, 0.065746F, 0.020198F, 0.021434F, 0.014633F, 0.004122F, 0.001649F, 8.24E-4F, 8.24E-4F, 0.051937F, 0.01958F, 0.023289F, 0.026381F, 0.040396F, 0.009068F, 0.001443F, 0.00371F, 0.00742F, 0.001443F, 0.01319F, 0.002885F, 4.12E-4F, 0.003298F, 0.025969F, 4.12E-4F, 4.12E-4F, 0.006183F, 0.003298F, 0.066983F, 0.002679F, 0.002267F, 0.011129F, 4.12E-4F, 0.010099F, 0.015251F, 0.007626F, 0.043899F, 0.00371F, 0.002679F, 0.001443F, 0.010923F, 0.002885F, 0.009068F, 0.019992F, 4.12E-4F, 0.00845F, 0.005153F, 0.0F, 0.010099F, 0.0F, 0.001649F, 0.01216F, 0.011542F, 0.006595F, 0.001855F, 0.010923F, 4.12E-4F, 0.023702F, 0.00371F, 0.001855F}; + mSecondByteStdDev = 0.013937F; + mSecondByteMean = 0.010638F; + mSecondByteWeight = 0.352563F; + } + } + + /** + * + */ + public static class nsEUCKRVerifier extends nsVerifier { + static int[] cclass; + static int[] states; + static int stFactor; + static String charset; + + public int[] cclass() { + return cclass; + } + + public int[] states() { + return states; + } + + public int stFactor() { + return stFactor; + } + + public String charset() { + return charset; + } + + public nsEUCKRVerifier() { + cclass = new int[32]; + cclass[0] = 286331153; + cclass[1] = 1118481; + cclass[2] = 286331153; + cclass[3] = 286327057; + cclass[4] = 286331153; + cclass[5] = 286331153; + cclass[6] = 286331153; + cclass[7] = 286331153; + cclass[8] = 286331153; + cclass[9] = 286331153; + cclass[10] = 286331153; + cclass[11] = 286331153; + cclass[12] = 286331153; + cclass[13] = 286331153; + cclass[14] = 286331153; + cclass[15] = 286331153; + cclass[16] = 0; + cclass[17] = 0; + cclass[18] = 0; + cclass[19] = 0; + cclass[20] = 572662304; + cclass[21] = 858923554; + cclass[22] = 572662306; + cclass[23] = 572662306; + cclass[24] = 572662306; + cclass[25] = 572662322; + cclass[26] = 572662306; + cclass[27] = 572662306; + cclass[28] = 572662306; + cclass[29] = 572662306; + cclass[30] = 572662306; + cclass[31] = 35791394; + states = new int[2]; + states[0] = 286331649; + states[1] = 1122850; + charset = "EUC-KR"; + stFactor = 4; + } + + public boolean isUCS2() { + return false; + } + } + + /** + * + */ + public static class EUCTWStatistics extends nsEUCStatistics { + static float[] mFirstByteFreq; + static float mFirstByteStdDev; + static float mFirstByteMean; + static float mFirstByteWeight; + static float[] mSecondByteFreq; + static float mSecondByteStdDev; + static float mSecondByteMean; + static float mSecondByteWeight; + + public float[] mFirstByteFreq() { + return mFirstByteFreq; + } + + public float mFirstByteStdDev() { + return mFirstByteStdDev; + } + + public float mFirstByteMean() { + return mFirstByteMean; + } + + public float mFirstByteWeight() { + return mFirstByteWeight; + } + + public float[] mSecondByteFreq() { + return mSecondByteFreq; + } + + public float mSecondByteStdDev() { + return mSecondByteStdDev; + } + + public float mSecondByteMean() { + return mSecondByteMean; + } + + public float mSecondByteWeight() { + return mSecondByteWeight; + } + + public EUCTWStatistics() { + mFirstByteFreq = new float[]{0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.119286F, 0.052233F, 0.044126F, 0.052494F, 0.045906F, 0.019038F, 0.032465F, 0.026252F, 0.025502F, 0.015963F, 0.052493F, 0.019256F, 0.015137F, 0.031782F, 0.01737F, 0.018494F, 0.015575F, 0.016621F, 0.007444F, 0.011642F, 0.013916F, 0.019159F, 0.016445F, 0.007851F, 0.011079F, 0.022842F, 0.015513F, 0.010033F, 0.00995F, 0.010347F, 0.013103F, 0.015371F, 0.012502F, 0.007436F, 0.018253F, 0.014134F, 0.008907F, 0.005411F, 0.00957F, 0.013598F, 0.006092F, 0.007409F, 0.008432F, 0.005816F, 0.009349F, 0.005472F, 0.00717F, 0.00742F, 0.003681F, 0.007523F, 0.00461F, 0.006154F, 0.003348F, 0.005074F, 0.005922F, 0.005254F, 0.004682F, 0.002093F, 0.0F}; + mFirstByteStdDev = 0.016681F; + mFirstByteMean = 0.010638F; + mFirstByteWeight = 0.715599F; + mSecondByteFreq = new float[]{0.028933F, 0.011371F, 0.011053F, 0.007232F, 0.010192F, 0.004093F, 0.015043F, 0.011752F, 0.022387F, 0.00841F, 0.012448F, 0.007473F, 0.003594F, 0.007139F, 0.018912F, 0.006083F, 0.003302F, 0.010215F, 0.008791F, 0.024236F, 0.014107F, 0.014108F, 0.010303F, 0.009728F, 0.007877F, 0.009719F, 0.007952F, 0.021028F, 0.005764F, 0.009341F, 0.006591F, 0.012517F, 0.005921F, 0.008982F, 0.008771F, 0.012802F, 0.005926F, 0.008342F, 0.003086F, 0.006843F, 0.007576F, 0.004734F, 0.016404F, 0.008803F, 0.008071F, 0.005349F, 0.008566F, 0.01084F, 0.015401F, 0.031904F, 0.00867F, 0.011479F, 0.010936F, 0.007617F, 0.008995F, 0.008114F, 0.008658F, 0.005934F, 0.010452F, 0.009142F, 0.004519F, 0.008339F, 0.007476F, 0.007027F, 0.006025F, 0.021804F, 0.024248F, 0.015895F, 0.003768F, 0.010171F, 0.010007F, 0.010178F, 0.008316F, 0.006832F, 0.006364F, 0.009141F, 0.009148F, 0.012081F, 0.011914F, 0.004464F, 0.014257F, 0.006907F, 0.011292F, 0.018622F, 0.008149F, 0.004636F, 0.006612F, 0.013478F, 0.012614F, 0.005186F, 0.048285F, 0.006816F, 0.006743F, 0.008671F}; + mSecondByteStdDev = 0.00663F; + mSecondByteMean = 0.010638F; + mSecondByteWeight = 0.284401F; + } + } + + /** + * + */ + public static class nsEUCTWVerifier extends nsVerifier { + static int[] cclass; + static int[] states; + static int stFactor; + static String charset; + + public int[] cclass() { + return cclass; + } + + public int[] states() { + return states; + } + + public int stFactor() { + return stFactor; + } + + public String charset() { + return charset; + } + + public nsEUCTWVerifier() { + cclass = new int[32]; + cclass[0] = 572662306; + cclass[1] = 2236962; + cclass[2] = 572662306; + cclass[3] = 572654114; + cclass[4] = 572662306; + cclass[5] = 572662306; + cclass[6] = 572662306; + cclass[7] = 572662306; + cclass[8] = 572662306; + cclass[9] = 572662306; + cclass[10] = 572662306; + cclass[11] = 572662306; + cclass[12] = 572662306; + cclass[13] = 572662306; + cclass[14] = 572662306; + cclass[15] = 572662306; + cclass[16] = 0; + cclass[17] = 100663296; + cclass[18] = 0; + cclass[19] = 0; + cclass[20] = 1145324592; + cclass[21] = 286331221; + cclass[22] = 286331153; + cclass[23] = 286331153; + cclass[24] = 858985233; + cclass[25] = 858993459; + cclass[26] = 858993459; + cclass[27] = 858993459; + cclass[28] = 858993459; + cclass[29] = 858993459; + cclass[30] = 858993459; + cclass[31] = 53687091; + states = new int[6]; + states[0] = 338898961; + states[1] = 571543825; + states[2] = 269623842; + states[3] = 286330880; + states[4] = 1052949; + states[5] = 16; + charset = "x-euc-tw"; + stFactor = 7; + } + + public boolean isUCS2() { + return false; + } + } + + /** + * + */ + public static class Big5Statistics extends nsEUCStatistics { + static float[] mFirstByteFreq; + static float mFirstByteStdDev; + static float mFirstByteMean; + static float mFirstByteWeight; + static float[] mSecondByteFreq; + static float mSecondByteStdDev; + static float mSecondByteMean; + static float mSecondByteWeight; + + public float[] mFirstByteFreq() { + return mFirstByteFreq; + } + + public float mFirstByteStdDev() { + return mFirstByteStdDev; + } + + public float mFirstByteMean() { + return mFirstByteMean; + } + + public float mFirstByteWeight() { + return mFirstByteWeight; + } + + public float[] mSecondByteFreq() { + return mSecondByteFreq; + } + + public float mSecondByteStdDev() { + return mSecondByteStdDev; + } + + public float mSecondByteMean() { + return mSecondByteMean; + } + + public float mSecondByteWeight() { + return mSecondByteWeight; + } + + public Big5Statistics() { + mFirstByteFreq = new float[]{0.0F, 0.0F, 0.0F, 0.114427F, 0.061058F, 0.075598F, 0.048386F, 0.063966F, 0.027094F, 0.095787F, 0.029525F, 0.031331F, 0.036915F, 0.021805F, 0.019349F, 0.037496F, 0.018068F, 0.01276F, 0.030053F, 0.017339F, 0.016731F, 0.019501F, 0.01124F, 0.032973F, 0.016658F, 0.015872F, 0.021458F, 0.012378F, 0.017003F, 0.020802F, 0.012454F, 0.009239F, 0.012829F, 0.007922F, 0.010079F, 0.009815F, 0.010104F, 0.0F, 0.0F, 0.0F, 5.3E-5F, 3.5E-5F, 1.05E-4F, 3.1E-5F, 8.8E-5F, 2.7E-5F, 2.7E-5F, 2.6E-5F, 3.5E-5F, 2.4E-5F, 3.4E-5F, 3.75E-4F, 2.5E-5F, 2.8E-5F, 2.0E-5F, 2.4E-5F, 2.8E-5F, 3.1E-5F, 5.9E-5F, 4.0E-5F, 3.0E-5F, 7.9E-5F, 3.7E-5F, 4.0E-5F, 2.3E-5F, 3.0E-5F, 2.7E-5F, 6.4E-5F, 2.0E-5F, 2.7E-5F, 2.5E-5F, 7.4E-5F, 1.9E-5F, 2.3E-5F, 2.1E-5F, 1.8E-5F, 1.7E-5F, 3.5E-5F, 2.1E-5F, 1.9E-5F, 2.5E-5F, 1.7E-5F, 3.7E-5F, 1.8E-5F, 1.8E-5F, 1.9E-5F, 2.2E-5F, 3.3E-5F, 3.2E-5F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F}; + mFirstByteStdDev = 0.020606F; + mFirstByteMean = 0.010638F; + mFirstByteWeight = 0.675261F; + mSecondByteFreq = new float[]{0.020256F, 0.003293F, 0.045811F, 0.01665F, 0.007066F, 0.004146F, 0.009229F, 0.007333F, 0.003296F, 0.005239F, 0.008282F, 0.003791F, 0.006116F, 0.003536F, 0.004024F, 0.016654F, 0.009334F, 0.005429F, 0.033392F, 0.006121F, 0.008983F, 0.002801F, 0.004221F, 0.010357F, 0.014695F, 0.077937F, 0.006314F, 0.00402F, 0.007331F, 0.00715F, 0.005341F, 0.009195F, 0.00535F, 0.005698F, 0.004472F, 0.007242F, 0.004039F, 0.011154F, 0.016184F, 0.004741F, 0.012814F, 0.007679F, 0.008045F, 0.016631F, 0.009451F, 0.016487F, 0.007287F, 0.012688F, 0.017421F, 0.013205F, 0.03148F, 0.003404F, 0.009149F, 0.008921F, 0.007514F, 0.008683F, 0.008203F, 0.031403F, 0.011733F, 0.015617F, 0.015306F, 0.004004F, 0.010899F, 0.009961F, 0.008388F, 0.01092F, 0.003925F, 0.008585F, 0.009108F, 0.015546F, 0.004659F, 0.006934F, 0.007023F, 0.020252F, 0.005387F, 0.024704F, 0.006963F, 0.002625F, 0.009512F, 0.002971F, 0.008233F, 0.01F, 0.011973F, 0.010553F, 0.005945F, 0.006349F, 0.009401F, 0.008577F, 0.008186F, 0.008159F, 0.005033F, 0.008714F, 0.010614F, 0.006554F}; + mSecondByteStdDev = 0.009909F; + mSecondByteMean = 0.010638F; + mSecondByteWeight = 0.324739F; + } + } + + /** + * + */ + public static class nsBIG5Verifier extends nsVerifier { + static int[] cclass; + static int[] states; + static int stFactor; + static String charset; + + public int[] cclass() { + return cclass; + } + + public int[] states() { + return states; + } + + public int stFactor() { + return stFactor; + } + + public String charset() { + return charset; + } + + public nsBIG5Verifier() { + cclass = new int[32]; + cclass[0] = 286331153; + cclass[1] = 1118481; + cclass[2] = 286331153; + cclass[3] = 286327057; + cclass[4] = 286331153; + cclass[5] = 286331153; + cclass[6] = 286331153; + cclass[7] = 286331153; + cclass[8] = 572662306; + cclass[9] = 572662306; + cclass[10] = 572662306; + cclass[11] = 572662306; + cclass[12] = 572662306; + cclass[13] = 572662306; + cclass[14] = 572662306; + cclass[15] = 304226850; + cclass[16] = 1145324612; + cclass[17] = 1145324612; + cclass[18] = 1145324612; + cclass[19] = 1145324612; + cclass[20] = 858993460; + cclass[21] = 858993459; + cclass[22] = 858993459; + cclass[23] = 858993459; + cclass[24] = 858993459; + cclass[25] = 858993459; + cclass[26] = 858993459; + cclass[27] = 858993459; + cclass[28] = 858993459; + cclass[29] = 858993459; + cclass[30] = 858993459; + cclass[31] = 53687091; + states = new int[3]; + states[0] = 286339073; + states[1] = 304226833; + states[2] = 1; + charset = "Big5"; + stFactor = 5; + } + + public boolean isUCS2() { + return false; + } + } + + /** + * + */ + public static class GB2312Statistics extends nsEUCStatistics { + static float[] mFirstByteFreq; + static float mFirstByteStdDev; + static float mFirstByteMean; + static float mFirstByteWeight; + static float[] mSecondByteFreq; + static float mSecondByteStdDev; + static float mSecondByteMean; + static float mSecondByteWeight; + + public float[] mFirstByteFreq() { + return mFirstByteFreq; + } + + public float mFirstByteStdDev() { + return mFirstByteStdDev; + } + + public float mFirstByteMean() { + return mFirstByteMean; + } + + public float mFirstByteWeight() { + return mFirstByteWeight; + } + + public float[] mSecondByteFreq() { + return mSecondByteFreq; + } + + public float mSecondByteStdDev() { + return mSecondByteStdDev; + } + + public float mSecondByteMean() { + return mSecondByteMean; + } + + public float mSecondByteWeight() { + return mSecondByteWeight; + } + + public GB2312Statistics() { + mFirstByteFreq = new float[]{0.011628F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.011628F, 0.012403F, 0.009302F, 0.003876F, 0.017829F, 0.037209F, 0.008527F, 0.010078F, 0.01938F, 0.054264F, 0.010078F, 0.041085F, 0.02093F, 0.018605F, 0.010078F, 0.013178F, 0.016279F, 0.006202F, 0.009302F, 0.017054F, 0.011628F, 0.008527F, 0.004651F, 0.006202F, 0.017829F, 0.024806F, 0.020155F, 0.013953F, 0.032558F, 0.035659F, 0.068217F, 0.010853F, 0.036434F, 0.117054F, 0.027907F, 0.100775F, 0.010078F, 0.017829F, 0.062016F, 0.012403F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.00155F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F}; + mFirstByteStdDev = 0.020081F; + mFirstByteMean = 0.010638F; + mFirstByteWeight = 0.586533F; + mSecondByteFreq = new float[]{0.006202F, 0.031008F, 0.005426F, 0.003101F, 0.00155F, 0.003101F, 0.082171F, 0.014729F, 0.006977F, 0.00155F, 0.013953F, 0.0F, 0.013953F, 0.010078F, 0.008527F, 0.006977F, 0.004651F, 0.003101F, 0.003101F, 0.003101F, 0.008527F, 0.003101F, 0.005426F, 0.005426F, 0.005426F, 0.003101F, 0.00155F, 0.006202F, 0.014729F, 0.010853F, 0.0F, 0.011628F, 0.0F, 0.031783F, 0.013953F, 0.030233F, 0.039535F, 0.008527F, 0.015504F, 0.0F, 0.003101F, 0.008527F, 0.016279F, 0.005426F, 0.00155F, 0.013953F, 0.013953F, 0.044961F, 0.003101F, 0.004651F, 0.006977F, 0.00155F, 0.005426F, 0.012403F, 0.00155F, 0.015504F, 0.0F, 0.006202F, 0.00155F, 0.0F, 0.007752F, 0.006977F, 0.00155F, 0.009302F, 0.011628F, 0.004651F, 0.010853F, 0.012403F, 0.017829F, 0.005426F, 0.024806F, 0.0F, 0.006202F, 0.0F, 0.082171F, 0.015504F, 0.004651F, 0.0F, 0.006977F, 0.004651F, 0.0F, 0.008527F, 0.012403F, 0.004651F, 0.003876F, 0.003101F, 0.022481F, 0.024031F, 0.00155F, 0.047287F, 0.009302F, 0.00155F, 0.005426F, 0.017054F}; + mSecondByteStdDev = 0.014156F; + mSecondByteMean = 0.010638F; + mSecondByteWeight = 0.413467F; + } + } + + /** + * + */ + public static class nsGB2312Verifier extends nsVerifier { + static int[] cclass; + static int[] states; + static int stFactor; + static String charset; + + public int[] cclass() { + return cclass; + } + + public int[] states() { + return states; + } + + public int stFactor() { + return stFactor; + } + + public String charset() { + return charset; + } + + public nsGB2312Verifier() { + cclass = new int[32]; + cclass[0] = 286331153; + cclass[1] = 1118481; + cclass[2] = 286331153; + cclass[3] = 286327057; + cclass[4] = 286331153; + cclass[5] = 286331153; + cclass[6] = 286331153; + cclass[7] = 286331153; + cclass[8] = 286331153; + cclass[9] = 286331153; + cclass[10] = 286331153; + cclass[11] = 286331153; + cclass[12] = 286331153; + cclass[13] = 286331153; + cclass[14] = 286331153; + cclass[15] = 286331153; + cclass[16] = 0; + cclass[17] = 0; + cclass[18] = 0; + cclass[19] = 0; + cclass[20] = 572662304; + cclass[21] = 858993442; + cclass[22] = 572662306; + cclass[23] = 572662306; + cclass[24] = 572662306; + cclass[25] = 572662306; + cclass[26] = 572662306; + cclass[27] = 572662306; + cclass[28] = 572662306; + cclass[29] = 572662306; + cclass[30] = 572662306; + cclass[31] = 35791394; + states = new int[2]; + states[0] = 286331649; + states[1] = 1122850; + charset = "GB2312"; + stFactor = 4; + } + + public boolean isUCS2() { + return false; + } + } + + /** + * + */ + public static class nsGB18030Verifier extends nsVerifier { + static int[] cclass; + static int[] states; + static int stFactor; + static String charset; + + public int[] cclass() { + return cclass; + } + + public int[] states() { + return states; + } + + public int stFactor() { + return stFactor; + } + + public String charset() { + return charset; + } + + public nsGB18030Verifier() { + cclass = new int[32]; + cclass[0] = 286331153; + cclass[1] = 1118481; + cclass[2] = 286331153; + cclass[3] = 286327057; + cclass[4] = 286331153; + cclass[5] = 286331153; + cclass[6] = 858993459; + cclass[7] = 286331187; + cclass[8] = 572662306; + cclass[9] = 572662306; + cclass[10] = 572662306; + cclass[11] = 572662306; + cclass[12] = 572662306; + cclass[13] = 572662306; + cclass[14] = 572662306; + cclass[15] = 1109533218; + cclass[16] = 1717986917; + cclass[17] = 1717986918; + cclass[18] = 1717986918; + cclass[19] = 1717986918; + cclass[20] = 1717986918; + cclass[21] = 1717986918; + cclass[22] = 1717986918; + cclass[23] = 1717986918; + cclass[24] = 1717986918; + cclass[25] = 1717986918; + cclass[26] = 1717986918; + cclass[27] = 1717986918; + cclass[28] = 1717986918; + cclass[29] = 1717986918; + cclass[30] = 1717986918; + cclass[31] = 107374182; + states = new int[6]; + states[0] = 318767105; + states[1] = 571543825; + states[2] = 17965602; + states[3] = 286326804; + states[4] = 303109393; + states[5] = 17; + charset = "GB18030"; + stFactor = 7; + } + + public boolean isUCS2() { + return false; + } + } + + /** + * + */ + public static class nsISO2022CNVerifier extends nsVerifier { + static int[] cclass; + static int[] states; + static int stFactor; + static String charset; + + public int[] cclass() { + return cclass; + } + + public int[] states() { + return states; + } + + public int stFactor() { + return stFactor; + } + + public String charset() { + return charset; + } + + public nsISO2022CNVerifier() { + cclass = new int[32]; + cclass[0] = 2; + cclass[1] = 0; + cclass[2] = 0; + cclass[3] = 4096; + cclass[4] = 0; + cclass[5] = 48; + cclass[6] = 0; + cclass[7] = 0; + cclass[8] = 16384; + cclass[9] = 0; + cclass[10] = 0; + cclass[11] = 0; + cclass[12] = 0; + cclass[13] = 0; + cclass[14] = 0; + cclass[15] = 0; + cclass[16] = 572662306; + cclass[17] = 572662306; + cclass[18] = 572662306; + cclass[19] = 572662306; + cclass[20] = 572662306; + cclass[21] = 572662306; + cclass[22] = 572662306; + cclass[23] = 572662306; + cclass[24] = 572662306; + cclass[25] = 572662306; + cclass[26] = 572662306; + cclass[27] = 572662306; + cclass[28] = 572662306; + cclass[29] = 572662306; + cclass[30] = 572662306; + cclass[31] = 572662306; + states = new int[8]; + states[0] = 304; + states[1] = 286331152; + states[2] = 572662289; + states[3] = 336663074; + states[4] = 286335249; + states[5] = 286331237; + states[6] = 286335249; + states[7] = 18944273; + charset = "ISO-2022-CN"; + stFactor = 9; + } + + public boolean isUCS2() { + return false; + } + } + + /** + * + */ + public static class nsISO2022JPVerifier extends nsVerifier { + static int[] cclass; + static int[] states; + static int stFactor; + static String charset; + + public int[] cclass() { + return cclass; + } + + public int[] states() { + return states; + } + + public int stFactor() { + return stFactor; + } + + public String charset() { + return charset; + } + + public nsISO2022JPVerifier() { + cclass = new int[32]; + cclass[0] = 2; + cclass[1] = 570425344; + cclass[2] = 0; + cclass[3] = 4096; + cclass[4] = 458752; + cclass[5] = 3; + cclass[6] = 0; + cclass[7] = 0; + cclass[8] = 1030; + cclass[9] = 1280; + cclass[10] = 0; + cclass[11] = 0; + cclass[12] = 0; + cclass[13] = 0; + cclass[14] = 0; + cclass[15] = 0; + cclass[16] = 572662306; + cclass[17] = 572662306; + cclass[18] = 572662306; + cclass[19] = 572662306; + cclass[20] = 572662306; + cclass[21] = 572662306; + cclass[22] = 572662306; + cclass[23] = 572662306; + cclass[24] = 572662306; + cclass[25] = 572662306; + cclass[26] = 572662306; + cclass[27] = 572662306; + cclass[28] = 572662306; + cclass[29] = 572662306; + cclass[30] = 572662306; + cclass[31] = 572662306; + states = new int[6]; + states[0] = 304; + states[1] = 286331153; + states[2] = 572662306; + states[3] = 1091653905; + states[4] = 303173905; + states[5] = 287445265; + charset = "ISO-2022-JP"; + stFactor = 8; + } + + public boolean isUCS2() { + return false; + } + } + + /** + * + */ + public static class nsISO2022KRVerifier extends nsVerifier { + static int[] cclass; + static int[] states; + static int stFactor; + static String charset; + + public int[] cclass() { + return cclass; + } + + public int[] states() { + return states; + } + + public int stFactor() { + return stFactor; + } + + public String charset() { + return charset; + } + + public nsISO2022KRVerifier() { + cclass = new int[32]; + cclass[0] = 2; + cclass[1] = 0; + cclass[2] = 0; + cclass[3] = 4096; + cclass[4] = 196608; + cclass[5] = 64; + cclass[6] = 0; + cclass[7] = 0; + cclass[8] = 20480; + cclass[9] = 0; + cclass[10] = 0; + cclass[11] = 0; + cclass[12] = 0; + cclass[13] = 0; + cclass[14] = 0; + cclass[15] = 0; + cclass[16] = 572662306; + cclass[17] = 572662306; + cclass[18] = 572662306; + cclass[19] = 572662306; + cclass[20] = 572662306; + cclass[21] = 572662306; + cclass[22] = 572662306; + cclass[23] = 572662306; + cclass[24] = 572662306; + cclass[25] = 572662306; + cclass[26] = 572662306; + cclass[27] = 572662306; + cclass[28] = 572662306; + cclass[29] = 572662306; + cclass[30] = 572662306; + cclass[31] = 572662306; + states = new int[5]; + states[0] = 285212976; + states[1] = 572657937; + states[2] = 289476898; + states[3] = 286593297; + states[4] = 8465; + charset = "ISO-2022-KR"; + stFactor = 6; + } + + public boolean isUCS2() { + return false; + } + } + + /** + * + */ + public static class nsUCS2BEVerifier extends nsVerifier { + static int[] cclass; + static int[] states; + static int stFactor; + static String charset; + + public int[] cclass() { + return cclass; + } + + public int[] states() { + return states; + } + + public int stFactor() { + return stFactor; + } + + public String charset() { + return charset; + } + + public nsUCS2BEVerifier() { + cclass = new int[32]; + cclass[0] = 0; + cclass[1] = 2097408; + cclass[2] = 0; + cclass[3] = 12288; + cclass[4] = 0; + cclass[5] = 3355440; + cclass[6] = 0; + cclass[7] = 0; + cclass[8] = 0; + cclass[9] = 0; + cclass[10] = 0; + cclass[11] = 0; + cclass[12] = 0; + cclass[13] = 0; + cclass[14] = 0; + cclass[15] = 0; + cclass[16] = 0; + cclass[17] = 0; + cclass[18] = 0; + cclass[19] = 0; + cclass[20] = 0; + cclass[21] = 0; + cclass[22] = 0; + cclass[23] = 0; + cclass[24] = 0; + cclass[25] = 0; + cclass[26] = 0; + cclass[27] = 0; + cclass[28] = 0; + cclass[29] = 0; + cclass[30] = 0; + cclass[31] = 1409286144; + states = new int[7]; + states[0] = 288626549; + states[1] = 572657937; + states[2] = 291923490; + states[3] = 1713792614; + states[4] = 393569894; + states[5] = 1717659269; + states[6] = 1140326; + charset = "UTF-16BE"; + stFactor = 6; + } + + public boolean isUCS2() { + return true; + } + } + + /** + * + */ + public static class nsUCS2LEVerifier extends nsVerifier { + static int[] cclass; + static int[] states; + static int stFactor; + static String charset; + + public int[] cclass() { + return cclass; + } + + public int[] states() { + return states; + } + + public int stFactor() { + return stFactor; + } + + public String charset() { + return charset; + } + + public nsUCS2LEVerifier() { + cclass = new int[32]; + cclass[0] = 0; + cclass[1] = 2097408; + cclass[2] = 0; + cclass[3] = 12288; + cclass[4] = 0; + cclass[5] = 3355440; + cclass[6] = 0; + cclass[7] = 0; + cclass[8] = 0; + cclass[9] = 0; + cclass[10] = 0; + cclass[11] = 0; + cclass[12] = 0; + cclass[13] = 0; + cclass[14] = 0; + cclass[15] = 0; + cclass[16] = 0; + cclass[17] = 0; + cclass[18] = 0; + cclass[19] = 0; + cclass[20] = 0; + cclass[21] = 0; + cclass[22] = 0; + cclass[23] = 0; + cclass[24] = 0; + cclass[25] = 0; + cclass[26] = 0; + cclass[27] = 0; + cclass[28] = 0; + cclass[29] = 0; + cclass[30] = 0; + cclass[31] = 1409286144; + states = new int[7]; + states[0] = 288647014; + states[1] = 572657937; + states[2] = 303387938; + states[3] = 1712657749; + states[4] = 357927015; + states[5] = 1427182933; + states[6] = 1381717; + charset = "UTF-16LE"; + stFactor = 6; + } + + public boolean isUCS2() { + return true; + } + } + + /** + * + */ + public static class nsCP1252Verifier extends nsVerifier { + static int[] cclass; + static int[] states; + static int stFactor; + static String charset; + + public int[] cclass() { + return cclass; + } + + public int[] states() { + return states; + } + + public int stFactor() { + return stFactor; + } + + public String charset() { + return charset; + } + + public nsCP1252Verifier() { + cclass = new int[32]; + cclass[0] = 572662305; + cclass[1] = 2236962; + cclass[2] = 572662306; + cclass[3] = 572654114; + cclass[4] = 572662306; + cclass[5] = 572662306; + cclass[6] = 572662306; + cclass[7] = 572662306; + cclass[8] = 572662306; + cclass[9] = 572662306; + cclass[10] = 572662306; + cclass[11] = 572662306; + cclass[12] = 572662306; + cclass[13] = 572662306; + cclass[14] = 572662306; + cclass[15] = 572662306; + cclass[16] = 572662274; + cclass[17] = 16851234; + cclass[18] = 572662304; + cclass[19] = 285286690; + cclass[20] = 572662306; + cclass[21] = 572662306; + cclass[22] = 572662306; + cclass[23] = 572662306; + cclass[24] = 286331153; + cclass[25] = 286331153; + cclass[26] = 554766609; + cclass[27] = 286331153; + cclass[28] = 286331153; + cclass[29] = 286331153; + cclass[30] = 554766609; + cclass[31] = 286331153; + states = new int[3]; + states[0] = 571543601; + states[1] = 340853778; + states[2] = 65; + charset = "windows-1252"; + stFactor = 3; + } + + public boolean isUCS2() { + return false; + } + } + + /** + * + */ + public static class nsHZVerifier extends nsVerifier { + static int[] cclass; + static int[] states; + static int stFactor; + static String charset; + + public int[] cclass() { + return cclass; + } + + public int[] states() { + return states; + } + + public int stFactor() { + return stFactor; + } + + public String charset() { + return charset; + } + + public nsHZVerifier() { + cclass = new int[32]; + cclass[0] = 1; + cclass[1] = 0; + cclass[2] = 0; + cclass[3] = 4096; + cclass[4] = 0; + cclass[5] = 0; + cclass[6] = 0; + cclass[7] = 0; + cclass[8] = 0; + cclass[9] = 0; + cclass[10] = 0; + cclass[11] = 0; + cclass[12] = 0; + cclass[13] = 0; + cclass[14] = 0; + cclass[15] = 38813696; + cclass[16] = 286331153; + cclass[17] = 286331153; + cclass[18] = 286331153; + cclass[19] = 286331153; + cclass[20] = 286331153; + cclass[21] = 286331153; + cclass[22] = 286331153; + cclass[23] = 286331153; + cclass[24] = 286331153; + cclass[25] = 286331153; + cclass[26] = 286331153; + cclass[27] = 286331153; + cclass[28] = 286331153; + cclass[29] = 286331153; + cclass[30] = 286331153; + cclass[31] = 286331153; + states = new int[6]; + states[0] = 285213456; + states[1] = 572657937; + states[2] = 335548706; + states[3] = 341120533; + states[4] = 336872468; + states[5] = 36; + charset = "HZ-GB-2312"; + stFactor = 6; + } + + public boolean isUCS2() { + return false; + } + } + + /** + * + */ + public static class nsSJISVerifier extends nsVerifier { + static int[] cclass; + static int[] states; + static int stFactor; + static String charset; + + public int[] cclass() { + return cclass; + } + + public int[] states() { + return states; + } + + public int stFactor() { + return stFactor; + } + + public String charset() { + return charset; + } + + public nsSJISVerifier() { + cclass = new int[32]; + cclass[0] = 286331152; + cclass[1] = 1118481; + cclass[2] = 286331153; + cclass[3] = 286327057; + cclass[4] = 286331153; + cclass[5] = 286331153; + cclass[6] = 286331153; + cclass[7] = 286331153; + cclass[8] = 572662306; + cclass[9] = 572662306; + cclass[10] = 572662306; + cclass[11] = 572662306; + cclass[12] = 572662306; + cclass[13] = 572662306; + cclass[14] = 572662306; + cclass[15] = 304226850; + cclass[16] = 858993459; + cclass[17] = 858993459; + cclass[18] = 858993459; + cclass[19] = 858993459; + cclass[20] = 572662308; + cclass[21] = 572662306; + cclass[22] = 572662306; + cclass[23] = 572662306; + cclass[24] = 572662306; + cclass[25] = 572662306; + cclass[26] = 572662306; + cclass[27] = 572662306; + cclass[28] = 858993459; + cclass[29] = 1145393971; + cclass[30] = 1145324612; + cclass[31] = 279620; + states = new int[3]; + states[0] = 286339073; + states[1] = 572657937; + states[2] = 4386; + charset = "Shift_JIS"; + stFactor = 6; + } + + public boolean isUCS2() { + return false; + } + } + + /** + * + */ + public static class nsUTF8Verifier extends nsVerifier { + static int[] cclass; + static int[] states; + static int stFactor; + static String charset; + + public int[] cclass() { + return cclass; + } + + public int[] states() { + return states; + } + + public int stFactor() { + return stFactor; + } + + public String charset() { + return charset; + } + + public nsUTF8Verifier() { + cclass = new int[32]; + cclass[0] = 286331153; + cclass[1] = 1118481; + cclass[2] = 286331153; + cclass[3] = 286327057; + cclass[4] = 286331153; + cclass[5] = 286331153; + cclass[6] = 286331153; + cclass[7] = 286331153; + cclass[8] = 286331153; + cclass[9] = 286331153; + cclass[10] = 286331153; + cclass[11] = 286331153; + cclass[12] = 286331153; + cclass[13] = 286331153; + cclass[14] = 286331153; + cclass[15] = 286331153; + cclass[16] = 858989090; + cclass[17] = 1145324612; + cclass[18] = 1145324612; + cclass[19] = 1145324612; + cclass[20] = 1431655765; + cclass[21] = 1431655765; + cclass[22] = 1431655765; + cclass[23] = 1431655765; + cclass[24] = 1717986816; + cclass[25] = 1717986918; + cclass[26] = 1717986918; + cclass[27] = 1717986918; + cclass[28] = -2004318073; + cclass[29] = -2003269496; + cclass[30] = -1145324614; + cclass[31] = 16702940; + states = new int[26]; + states[0] = -1408167679; + states[1] = 878082233; + states[2] = 286331153; + states[3] = 286331153; + states[4] = 572662306; + states[5] = 572662306; + states[6] = 290805009; + states[7] = 286331153; + states[8] = 290803985; + states[9] = 286331153; + states[10] = 293041937; + states[11] = 286331153; + states[12] = 293015825; + states[13] = 286331153; + states[14] = 295278865; + states[15] = 286331153; + states[16] = 294719761; + states[17] = 286331153; + states[18] = 298634257; + states[19] = 286331153; + states[20] = 297865489; + states[21] = 286331153; + states[22] = 287099921; + states[23] = 286331153; + states[24] = 285212689; + states[25] = 286331153; + charset = "UTF-8"; + stFactor = 16; + } + + public boolean isUCS2() { + return false; + } + } + +} diff --git a/src/main/java/com/gxwebsoft/common/core/utils/JSONUtil.java b/src/main/java/com/gxwebsoft/common/core/utils/JSONUtil.java new file mode 100644 index 0000000..8d63168 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/utils/JSONUtil.java @@ -0,0 +1,69 @@ +package com.gxwebsoft.common.core.utils; + +import cn.hutool.core.util.StrUtil; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.ObjectWriter; + +/** + * JSON解析工具类 + * + * @author WebSoft + * @since 2017-06-10 10:10:39 + */ +public class JSONUtil { + private static final ObjectMapper objectMapper = new ObjectMapper(); + private static final ObjectWriter objectWriter = objectMapper.writerWithDefaultPrettyPrinter(); + + /** + * 对象转json字符串 + * + * @param value 对象 + * @return String + */ + public static String toJSONString(Object value) { + return toJSONString(value, false); + } + + /** + * 对象转json字符串 + * + * @param value 对象 + * @param pretty 是否格式化输出 + * @return String + */ + public static String toJSONString(Object value, boolean pretty) { + if (value != null) { + if (value instanceof String) { + return (String) value; + } + try { + if (pretty) { + return objectWriter.writeValueAsString(value); + } + return objectMapper.writeValueAsString(value); + } catch (Exception e) { + e.printStackTrace(); + } + } + return null; + } + + /** + * json字符串转对象 + * + * @param json String + * @param clazz Class + * @return T + */ + public static T parseObject(String json, Class clazz) { + if (StrUtil.isNotBlank(json) && clazz != null) { + try { + return objectMapper.readValue(json, clazz); + } catch (Exception e) { + e.printStackTrace(); + } + } + return null; + } + +} diff --git a/src/main/java/com/gxwebsoft/common/core/utils/LogAnalysisUtil.java b/src/main/java/com/gxwebsoft/common/core/utils/LogAnalysisUtil.java new file mode 100644 index 0000000..c50a01a --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/utils/LogAnalysisUtil.java @@ -0,0 +1,190 @@ +package com.gxwebsoft.common.core.utils; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +import javax.servlet.http.HttpServletRequest; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.Map; + +/** + * 日志分析工具类 + * 用于收集和分析请求相关信息 + * + * @author WebSoft + * @since 2025-01-20 + */ +@Slf4j +@Component +public class LogAnalysisUtil { + + /** + * 记录请求详细信息 + */ + public static void logRequestDetails(HttpServletRequest request, String operation) { + try { + Map requestInfo = new HashMap<>(); + + // 基本请求信息 + requestInfo.put("operation", operation); + requestInfo.put("method", request.getMethod()); + requestInfo.put("requestURL", request.getRequestURL().toString()); + requestInfo.put("requestURI", request.getRequestURI()); + requestInfo.put("queryString", request.getQueryString()); + requestInfo.put("remoteAddr", request.getRemoteAddr()); + requestInfo.put("userAgent", request.getHeader("User-Agent")); + + // 请求头信息 + Map headers = new HashMap<>(); + Enumeration headerNames = request.getHeaderNames(); + while (headerNames.hasMoreElements()) { + String headerName = headerNames.nextElement(); + // 过滤敏感信息 + if (!isSensitiveHeader(headerName)) { + headers.put(headerName, request.getHeader(headerName)); + } + } + requestInfo.put("headers", headers); + + // 参数信息 + Map parameters = request.getParameterMap(); + Map params = new HashMap<>(); + parameters.forEach((key, values) -> { + if (!isSensitiveParameter(key)) { + params.put(key, values.length == 1 ? values[0] : values); + } + }); + requestInfo.put("parameters", params); + + log.info("请求详情: {}", requestInfo); + + } catch (Exception e) { + log.error("记录请求详情失败", e); + } + } + + /** + * 记录异常详细信息 + */ + public static void logExceptionDetails(Exception exception, String context) { + try { + Map exceptionInfo = new HashMap<>(); + + exceptionInfo.put("context", context); + exceptionInfo.put("exceptionType", exception.getClass().getSimpleName()); + exceptionInfo.put("message", exception.getMessage()); + exceptionInfo.put("timestamp", System.currentTimeMillis()); + + // 堆栈跟踪 + StackTraceElement[] stackTrace = exception.getStackTrace(); + if (stackTrace.length > 0) { + StackTraceElement firstElement = stackTrace[0]; + exceptionInfo.put("errorLocation", + firstElement.getClassName() + "." + firstElement.getMethodName() + + "(" + firstElement.getFileName() + ":" + firstElement.getLineNumber() + ")"); + } + + // 根异常 + Throwable rootCause = getRootCause(exception); + if (rootCause != exception) { + exceptionInfo.put("rootCause", rootCause.getClass().getSimpleName()); + exceptionInfo.put("rootCauseMessage", rootCause.getMessage()); + } + + log.error("异常详情: {}", exceptionInfo, exception); + + } catch (Exception e) { + log.error("记录异常详情失败", e); + } + } + + /** + * 记录性能信息 + */ + public static void logPerformanceInfo(String operation, long startTime, long endTime) { + try { + long duration = endTime - startTime; + Map performanceInfo = new HashMap<>(); + + performanceInfo.put("operation", operation); + performanceInfo.put("startTime", startTime); + performanceInfo.put("endTime", endTime); + performanceInfo.put("duration", duration + "ms"); + + // 性能级别判断 + String level = "INFO"; + if (duration > 5000) { + level = "WARN"; + } else if (duration > 10000) { + level = "ERROR"; + } + performanceInfo.put("performanceLevel", level); + + if ("ERROR".equals(level)) { + log.error("性能异常: {}", performanceInfo); + } else if ("WARN".equals(level)) { + log.warn("性能告警: {}", performanceInfo); + } else { + log.info("性能信息: {}", performanceInfo); + } + + } catch (Exception e) { + log.error("记录性能信息失败", e); + } + } + + /** + * 检查是否为敏感请求头 + */ + private static boolean isSensitiveHeader(String headerName) { + String lowerName = headerName.toLowerCase(); + return lowerName.contains("password") || + lowerName.contains("token") || + lowerName.contains("authorization") || + lowerName.contains("cookie"); + } + + /** + * 检查是否为敏感参数 + */ + private static boolean isSensitiveParameter(String paramName) { + String lowerName = paramName.toLowerCase(); + return lowerName.contains("password") || + lowerName.contains("token") || + lowerName.contains("secret") || + lowerName.contains("key"); + } + + /** + * 获取根异常 + */ + private static Throwable getRootCause(Throwable throwable) { + Throwable rootCause = throwable; + while (rootCause.getCause() != null && rootCause.getCause() != rootCause) { + rootCause = rootCause.getCause(); + } + return rootCause; + } + + /** + * 记录安全相关日志 + */ + public static void logSecurityEvent(String event, String username, String details, HttpServletRequest request) { + try { + Map securityInfo = new HashMap<>(); + + securityInfo.put("event", event); + securityInfo.put("username", username); + securityInfo.put("details", details); + securityInfo.put("timestamp", System.currentTimeMillis()); + securityInfo.put("remoteAddr", request != null ? request.getRemoteAddr() : "unknown"); + securityInfo.put("userAgent", request != null ? request.getHeader("User-Agent") : "unknown"); + + log.warn("安全事件: {}", securityInfo); + + } catch (Exception e) { + log.error("记录安全事件失败", e); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/gxwebsoft/common/core/utils/MyQrCodeUtil.java b/src/main/java/com/gxwebsoft/common/core/utils/MyQrCodeUtil.java new file mode 100644 index 0000000..48bdca1 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/utils/MyQrCodeUtil.java @@ -0,0 +1,80 @@ +package com.gxwebsoft.common.core.utils; + +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.io.FileUtil; +import cn.hutool.extra.qrcode.QrCodeUtil; +import cn.hutool.extra.qrcode.QrConfig; + +import javax.imageio.ImageIO; +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.net.URL; +import java.util.HashMap; + +import static com.gxwebsoft.common.core.constants.QRCodeConstants.*; + +/** + * 常用工具方法 + * + * @author WebSoft + * @since 2017-06-10 10:10:22 + */ +public class MyQrCodeUtil { + + private static final String logoUrl = "https://file.wsdns.cn/20230430/6fa31aca3b0d47af98a149cf2dd26a4f.jpeg"; + + /** + * 生成用户二维码 + */ + public static String getUserCode(Integer userId, String content) throws IOException { + return createQrCode(USER_QRCODE,userId,content); + } + + /** + * 生成工单二维码 + */ + public static String getTaskCode(Integer taskId, String content) throws IOException { + return createQrCode(TASK_QRCODE,taskId,content); + } + + /** + * 生成商品二维码 + */ + public static String getGoodsCode(Integer goodsId, String content) throws IOException { + return createQrCode(GOODS_QRCODE,goodsId,content); + } + + /** + * 生成自定义二维码 + */ + public static String getCodeMap(HashMap map) throws IOException { + return ""; + } + + /** + * 生成带水印的二维码 + * @param type 类型 + * @param id 实体ID + * @param content 二维码内容 + * @return 二维码图片地址 + */ + public static String createQrCode(String type,Integer id, String content) throws IOException { + String filePath = "/www/wwwroot/file.ws/qrcode/".concat(type).concat("/"); + String qrcodeUrl = "https://file.websoft.top/qrcode/".concat(type).concat("/"); + // 将URL转为BufferedImage + BufferedImage bufferedImage = ImageIO.read(new URL(logoUrl)); + // 生成二维码 + QrConfig config = new QrConfig(300, 300); + // 设置边距,既二维码和背景之间的边距 + config.setMargin(1); + // 附带小logo + config.setImg(bufferedImage); + // 保存路径 + filePath = filePath.concat(id + ".jpg"); + qrcodeUrl = qrcodeUrl.concat(id + ".jpg") + "?v=" + DateUtil.current(); + + // 生成二维码 + QrCodeUtil.generate(content, config, FileUtil.file(filePath)); + return qrcodeUrl; + } +} diff --git a/src/main/java/com/gxwebsoft/common/core/utils/OpenOfficeUtil.java b/src/main/java/com/gxwebsoft/common/core/utils/OpenOfficeUtil.java new file mode 100644 index 0000000..cca3990 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/utils/OpenOfficeUtil.java @@ -0,0 +1,124 @@ +package com.gxwebsoft.common.core.utils; + +import cn.hutool.core.util.StrUtil; +import org.artofsolving.jodconverter.OfficeDocumentConverter; +import org.artofsolving.jodconverter.office.DefaultOfficeManagerConfiguration; +import org.artofsolving.jodconverter.office.OfficeManager; + +import java.io.File; +import java.util.Arrays; +import java.util.Base64; + +/** + * OpenOfficeUtil + * + * @author WebSoft + * @since 2018-12-14 08:38:19 + */ +public class OpenOfficeUtil { + // 支持转换pdf的文件后缀列表 + private static final String[] CAN_CONVERTER_FILES = new String[]{ + "doc", "docx", "xls", "xlsx", "ppt", "pptx" + }; + + /** + * 文件转pdf + * + * @param filePath 源文件路径 + * @param outDir 输出目录 + * @param officeHome OpenOffice安装路径 + * @return File + */ + public static File converterToPDF(String filePath, String outDir, String officeHome) { + return converterToPDF(filePath, outDir, officeHome, true); + } + + /** + * 文件转pdf + * + * @param filePath 源文件路径 + * @param outDir 输出目录 + * @param officeHome OpenOffice安装路径 + * @param cache 是否使用上次转换过的文件 + * @return File + */ + public static File converterToPDF(String filePath, String outDir, String officeHome, boolean cache) { + if (StrUtil.isBlank(filePath)) { + return null; + } + File srcFile = new File(filePath); + if (!srcFile.exists()) { + return null; + } + // 是否转换过 + String outPath = Base64.getEncoder().encodeToString(filePath.getBytes()) + .replace("/", "-").replace("+", "-"); + File outFile = new File(outDir, outPath + ".pdf"); + if (cache && outFile.exists()) { + return outFile; + } + // 转换 + OfficeManager officeManager = null; + try { + officeManager = getOfficeManager(officeHome); + OfficeDocumentConverter converter = new OfficeDocumentConverter(officeManager); + return converterFile(srcFile, outFile, converter); + } catch (Exception e) { + e.printStackTrace(); + } finally { + if (officeManager != null) { + officeManager.stop(); + } + } + return null; + } + + /** + * 转换文件 + * + * @param inFile 源文件 + * @param outFile 输出文件 + * @param converter OfficeDocumentConverter + * @return File + */ + public static File converterFile(File inFile, File outFile, OfficeDocumentConverter converter) { + if (!outFile.getParentFile().exists()) { + if (!outFile.getParentFile().mkdirs()) { + return outFile; + } + } + converter.convert(inFile, outFile); + return outFile; + } + + /** + * 判断文件后缀是否可以转换pdf + * + * @param path 文件路径 + * @return boolean + */ + public static boolean canConverter(String path) { + try { + String suffix = path.substring(path.lastIndexOf(".") + 1); + return Arrays.asList(CAN_CONVERTER_FILES).contains(suffix); + } catch (Exception e) { + return false; + } + } + + /** + * 连接并启动OpenOffice + * + * @param officeHome OpenOffice安装路径 + * @return OfficeManager + */ + public static OfficeManager getOfficeManager(String officeHome) { + if (officeHome == null || officeHome.trim().isEmpty()) return null; + DefaultOfficeManagerConfiguration config = new DefaultOfficeManagerConfiguration(); + config.setOfficeHome(officeHome); // 设置OpenOffice安装目录 + OfficeManager officeManager = config.buildOfficeManager(); + officeManager.start(); // 启动OpenOffice服务 + return officeManager; + } + +} diff --git a/src/main/java/com/gxwebsoft/common/core/utils/PushUtil.java b/src/main/java/com/gxwebsoft/common/core/utils/PushUtil.java new file mode 100644 index 0000000..fadf410 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/utils/PushUtil.java @@ -0,0 +1,96 @@ +package com.gxwebsoft.common.core.utils; + +import cn.hutool.crypto.SecureUtil; +import cn.hutool.http.HttpRequest; +import com.alibaba.fastjson.JSONObject; +import com.gxwebsoft.common.system.service.UserService; +import com.gxwebsoft.common.system.vo.PushMessageVO; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.HashSet; +import java.util.concurrent.TimeUnit; + +/** + * 个推推送消息工具类 + * + * @author WebSoft + * @since 2017-06-10 10:10:39 + */ +@Component +public class PushUtil { + @Resource + RedisUtil redisUtil; + + @Resource + private UserService userService; + private static final String url = "https://fc-mp-ba98f1e0-713d-457b-a0a4-27a7939371e6.next.bspapp.com/unipush"; + + /** + * 获取鉴权token + * @return + */ + public String getToken() { + String key = "token:oOVaDtYDYQ8q3lNjhLh401"; + + if(redisUtil.get(key) != null){ + return redisUtil.get(key); + } + + HashMap map = new HashMap<>(); + long timeMillis = System.currentTimeMillis(); + String sign = SecureUtil.sha256("AC6IghgsUx7Mwjb7G5eqv" + timeMillis + "JVRkOCXXzA6EyE2Fi5sPr9"); + map.put("sign",sign); + map.put("timestamp",timeMillis); + map.put("appkey","AC6IghgsUx7Mwjb7G5eqv"); + final String body = HttpRequest.post(url.concat("/auth")).body(JSONUtil.toJSONString(map)).execute().body(); + final JSONObject jsonObject = JSONObject.parseObject(body); + final String data = jsonObject.getString("data"); + final JSONObject jsonData = JSONObject.parseObject(data); + + final String token = jsonData.getString("token"); + final Long expireTime = Long.valueOf(jsonData.getString("expire_time")); + // 保存token + + redisUtil.set(key,token, expireTime-System.currentTimeMillis(), TimeUnit.MILLISECONDS); + return token; + } + + /** + * 执行cid单推 + * cid数组,只能填一个cid + * + */ + public static boolean toSingle(PushMessageVO pushMessageVO){ + final String body = HttpRequest.post(url).body(JSONUtil.toJSONString(pushMessageVO)).execute().body(); + JSONObject jsonObject = JSONObject.parseObject(body); + if("success".equals(jsonObject.get("errMsg"))){ + return true; + } + return false; + } + + + public boolean toSingle(Integer userId,String title, String content,String type, Object obj){ + PushMessageVO.Payload payload = new PushMessageVO.Payload(); + payload.setType(type); + payload.setData(obj); + + String clientId = userService.getById(userId).getClientId(); + HashSet clientIds = new HashSet<>(); + clientIds.add(clientId); + + PushMessageVO messageVO = PushMessageVO.builder().title(title).content(content).payload(payload).push_clientid(clientIds).build(); + + final String body = HttpRequest.post(url).body(JSONUtil.toJSONString(messageVO)).execute().body(); + + JSONObject jsonObject = JSONObject.parseObject(body); + if("success".equals(jsonObject.get("errMsg"))){ + return true; + } + return false; + } + + +} diff --git a/src/main/java/com/gxwebsoft/common/core/utils/RedisUtil.java b/src/main/java/com/gxwebsoft/common/core/utils/RedisUtil.java new file mode 100644 index 0000000..39c79e3 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/utils/RedisUtil.java @@ -0,0 +1,282 @@ +package com.gxwebsoft.common.core.utils; + +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.common.system.result.RedisResult; +import org.springframework.data.geo.Point; +import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.stereotype.Component; + +import java.time.LocalDateTime; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.TimeUnit; +import java.util.function.Function; + +import static com.gxwebsoft.common.core.constants.RedisConstants.CACHE_NULL_TTL; + +@Component +public class RedisUtil { + private final StringRedisTemplate stringRedisTemplate; + public static Integer tenantId; + + public RedisUtil(StringRedisTemplate stringRedisTemplate){ + this.stringRedisTemplate = stringRedisTemplate; + } + + /** + * 写入redis缓存 + * @param key [表名]:id + * @param entity 实体类对象 + * 示例 cacheClient.set("merchant:"+id,merchant) + */ + public void set(String key, T entity){ + stringRedisTemplate.opsForValue().set(key, JSONUtil.toJSONString(entity)); + } + + /** + * 写入redis缓存 + * @param key [表名]:id + * @param entity 实体类对象 + * 示例 cacheClient.set("merchant:"+id,merchant,1L,TimeUnit.DAYS) + */ + public void set(String key, T entity, Long time, TimeUnit unit){ + stringRedisTemplate.opsForValue().set(key, JSONUtil.toJSONString(entity),time,unit); + } + + /** + * 读取redis缓存 + * @param key [表名]:id + * 示例 cacheClient.get(key) + * @return merchant + */ + public String get(String key) { + return stringRedisTemplate.opsForValue().get(key); + } + + /** + * 读取redis缓存 + * @param key [表名]:id + * @param clazz Merchant.class + * @param + * 示例 cacheClient.get("merchant:"+id,Merchant.class) + * @return merchant + */ + public T get(String key, Class clazz) { + String json = stringRedisTemplate.opsForValue().get(key); + if(StrUtil.isNotBlank(json)){ + return JSONUtil.parseObject(json, clazz); + } + return null; + } + + /** + * 写redis缓存(哈希类型) + * @param key [表名]:id + * @param field 字段 + * 示例 cacheClient.get("merchant:"+id,Merchant.class) + */ + public void hPut(String key, String field, T entity) { + stringRedisTemplate.opsForHash().put(key,field,JSONUtil.toJSONString(entity)); + } + + /** + * 写redis缓存(哈希类型) + * @param key [表名]:id + * @param map 字段 + * 示例 cacheClient.get("merchant:"+id,Merchant.class) + */ + public void hPutAll(String key, Map map) { + stringRedisTemplate.opsForHash().putAll(key,map); + } + + /** + * 读取redis缓存(哈希类型) + * 示例 cacheClient.get("merchant:"+id,Merchant.class) + * @param key [表名]:id + * @param field 字段 + * @return merchant + */ + public T hGet(String key, String field, Class clazz) { + Object obj = stringRedisTemplate.opsForHash().get(key, field); + return JSONUtil.parseObject(JSONUtil.toJSONString(obj),clazz); + } + + public List hValues(String key){ + return stringRedisTemplate.opsForHash().values(key); + } + + public Long hSize(String key){ + return stringRedisTemplate.opsForHash().size(key); + } + + // 逻辑过期方式写入redis + public void setWithLogicalExpire(String key, T value, Long time, TimeUnit unit){ + // 设置逻辑过期时间 + final RedisResult redisResult = new RedisResult<>(); + redisResult.setData(value); + redisResult.setExpireTime(LocalDateTime.now().plusSeconds(unit.toSeconds(time))); + stringRedisTemplate.opsForValue().set(key,JSONUtil.toJSONString(redisResult)); + } + + // 读取redis + public R query(String keyPrefix, ID id, Class clazz, Function dbFallback, Long time, TimeUnit unit){ + String key = keyPrefix + id; + // 1.从redis查询缓存 + final String json = stringRedisTemplate.opsForValue().get(key); + // 2.判断是否存在 + if (StrUtil.isNotBlank(json)) { + // 3.存在,直接返回 + return JSONUtil.parseObject(json,clazz); + } + // 判断命中的是否为空值 + if (json != null) { + return null; + } + // 4. 不存在,跟进ID查询数据库 + R r = dbFallback.apply(id); + // 5. 数据库不存在,返回错误 + if(r == null){ + // 空值写入数据库 + this.set(key,"",CACHE_NULL_TTL,TimeUnit.MINUTES); + return null; + } + // 写入redis + this.set(key,r,time,unit); + return r; + } + + /** + * 添加商户定位点 + * @param key geo + * @param id + * 示例 cacheClient.geoAdd("merchant-geo",merchant) + */ + public void geoAdd(String key, Double x, Double y, String id){ + stringRedisTemplate.opsForGeo().add(key,new Point(x,y),id); + } + + /** + * 删除定位 + * @param key geo + * @param id + * 示例 cacheClient.geoRemove("merchant-geo",id) + */ + public void geoRemove(String key, Integer id){ + stringRedisTemplate.opsForGeo().remove(key,id.toString()); + } + + + + public void sAdd(String key, T entity){ + stringRedisTemplate.opsForSet().add(key,JSONUtil.toJSONString(entity)); + } + + public Set sMembers(String key){ + return stringRedisTemplate.opsForSet().members(key); + } + + // 更新排行榜 + public void zAdd(String key, Integer userId, Double value) { + stringRedisTemplate.opsForZSet().add(key,userId.toString(),value); + } + // 增加元素的score值,并返回增加后的值 + public Double zIncrementScore(String key,Integer userId, Double delta){ + return stringRedisTemplate.opsForZSet().incrementScore(key, userId.toString(), delta); + } + // 获取排名榜 + public Set range(String key, Integer start, Integer end) { + return stringRedisTemplate.opsForZSet().range(key, start, end); + } + // 获取排名榜 + public Set reverseRange(String key, Integer start, Integer end){ + return stringRedisTemplate.opsForZSet().reverseRange(key, start, end); + } + // 获取分数 + public Double score(String key, Object value){ + return stringRedisTemplate.opsForZSet().score(key, value); + } + + public void delete(String key){ + stringRedisTemplate.delete(key); + } + + // 存储在list头部 + public void leftPush(String key, String keyword){ + stringRedisTemplate.opsForList().leftPush(key,keyword); + } + + // 获取列表指定范围内的元素 + public List listRange(String key,Long start, Long end){ + return stringRedisTemplate.opsForList().range(key, start, end); + } + + // 获取列表长度 + public Long listSize(String key){ + return stringRedisTemplate.opsForList().size(key); + } + + // 裁剪list + public void listTrim(String key){ + stringRedisTemplate.opsForList().trim(key, 0L, 100L); + } + + /** + * 读取后台系统设置信息 + * @param keyName 键名wx-word + * @param tenantId 租户ID + * @return + * key示例 cache10048:setting:wx-work + */ + public JSONObject getSettingInfo(String keyName,Integer tenantId){ + String key = "cache" + tenantId + ":setting:" + keyName; + final String cache = stringRedisTemplate.opsForValue().get(key); + assert cache != null; + return JSON.parseObject(cache); + } + + /** + * KEY前缀 + * cache[tenantId]:[key+id] + */ + public static String prefix(String key){ + String prefix = "cache"; + Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); + if (authentication != null) { + Object object = authentication.getPrincipal(); + if (object instanceof User) { + final Integer tenantId = ((User) object).getTenantId(); + prefix = prefix.concat(tenantId.toString()).concat(":"); + } + } + return prefix.concat(key); + } + + // 组装key + public String key(String name,Integer id){ + return name.concat(":").concat(id.toString()); + } + + // 获取上传配置 + public HashMap getUploadConfig(Integer tenantId){ + String key = "setting:upload:" + tenantId; + final String s = get(key); + final JSONObject jsonObject = JSONObject.parseObject(s); + final String uploadMethod = jsonObject.getString("uploadMethod"); + final String bucketDomain = jsonObject.getString("bucketDomain"); + + final HashMap map = new HashMap<>(); + map.put("uploadMethod",uploadMethod); + map.put("bucketDomain",bucketDomain); + return map; + } + + +} diff --git a/src/main/java/com/gxwebsoft/common/core/utils/RequestUtil.java b/src/main/java/com/gxwebsoft/common/core/utils/RequestUtil.java new file mode 100644 index 0000000..e8cbc30 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/utils/RequestUtil.java @@ -0,0 +1,155 @@ +package com.gxwebsoft.common.core.utils; + +import cn.hutool.http.HttpRequest; +import com.alibaba.fastjson.JSONObject; +import com.gxwebsoft.common.system.entity.*; +import com.wechat.pay.java.service.partnerpayments.jsapi.model.Transaction; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.HashMap; + +@Component +public class RequestUtil { + private static final String SERVER_HOST = "https://server.websoft.top/api"; + private static final String MODULES_HOST = "https://modules.gxwebsoft.com/api"; + private static String ACCESS_TOKEN; + private static String TENANT_ID; + + public void setTenantId(String tenantId) { + TENANT_ID = tenantId; + } + + public void setAccessToken(String token) { + ACCESS_TOKEN = token; + } + + + // 余额支付通知 + public void pushBalancePayNotify(Transaction transaction, Payment payment) { + System.out.println("payment = " + payment); + System.out.println("transaction = " + transaction); + // 设置租户ID + setTenantId(payment.getTenantId().toString()); + // 推送支付通知地址 + String path = payment.getNotifyUrl(); + try { + // 链式构建请求 + HttpRequest.post(path) + .header("Tenantid", TENANT_ID) + .body(JSONUtil.toJSONString(transaction))//表单内容 + .timeout(20000)//超时,毫秒 + .execute().body(); + + } catch (Exception e) { + e.printStackTrace(); + } + } + + // 微信支付通知 + public void pushWxPayNotify(Transaction transaction, Payment payment) { + // 设置租户ID + setTenantId(payment.getTenantId().toString()); + // 推送支付通知地址 + String path = payment.getNotifyUrl(); + try { + // 链式构建请求 + HttpRequest.post(path) + .header("Tenantid", TENANT_ID) + .body(JSONUtil.toJSONString(transaction))//表单内容 + .timeout(20000)//超时,毫秒 + .execute().body(); + + } catch (Exception e) { + e.printStackTrace(); + } + } + + public User getMerchantAccountByPhone(String phone) { + String path = "/shop/merchant-account/getMerchantAccountByPhone/" + phone; + try { + // 链式构建请求 + String result = HttpRequest.get(MODULES_HOST.concat(path)) + .header("Authorization", ACCESS_TOKEN) + .header("Tenantid", TENANT_ID) + .timeout(20000)//超时,毫秒 + .execute().body(); + + JSONObject jsonObject = JSONObject.parseObject(result); + final String data = jsonObject.getString("data"); + return JSONObject.parseObject(data, User.class); + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } + + public User getByUserId(Integer userId) { + String path = "/system/user/" + userId; + try { + // 链式构建请求 + String result = HttpRequest.get(MODULES_HOST.concat(path)) + .header("Authorization", ACCESS_TOKEN) + .header("Tenantid", TENANT_ID) + .timeout(20000)//超时,毫秒 + .execute().body(); + + JSONObject jsonObject = JSONObject.parseObject(result); + final String data = jsonObject.getString("data"); + return JSONObject.parseObject(data, User.class); + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } + + public User getUserByPhone(String phone) { + String path = "/system/user/getByPhone/" + phone; + try { + // 链式构建请求 + String result = HttpRequest.get(SERVER_HOST.concat(path)) + .header("Authorization", ACCESS_TOKEN) + .header("Tenantid", TENANT_ID) + .timeout(20000)//超时,毫秒 + .execute().body(); + + JSONObject jsonObject = JSONObject.parseObject(result); + final String data = jsonObject.getString("data"); + return JSONObject.parseObject(data, User.class); + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } + + // 新增用户 + public boolean saveUserByPhone(MerchantAccount merchantAccount) { + String path = "/system/user/"; + try { + HashMap map = new HashMap<>(); + map.put("nickname", merchantAccount.getRealName()); + map.put("username", merchantAccount.getPhone()); + map.put("realName", merchantAccount.getRealName()); + map.put("phone", merchantAccount.getPhone()); + map.put("password", merchantAccount.getPassword()); + final ArrayList roles = new ArrayList<>(); + final UserRole userRole = new UserRole(); + userRole.setUserId(merchantAccount.getUserId()); + userRole.setRoleId(merchantAccount.getRoleId()); + userRole.setTenantId(merchantAccount.getTenantId()); + roles.add(userRole); + map.put("roles", roles); + map.put("tenantId", TENANT_ID); + // 链式构建请求 + String result = HttpRequest.post(SERVER_HOST.concat(path)) + .header("Authorization", ACCESS_TOKEN) + .header("Tenantid", TENANT_ID) + .body(JSONUtil.toJSONString(map))//表单内容 + .timeout(20000)//超时,毫秒 + .execute().body(); + } catch (Exception e) { + e.printStackTrace(); + } + return true; + } +} diff --git a/src/main/java/com/gxwebsoft/common/core/utils/SignCheckUtil.java b/src/main/java/com/gxwebsoft/common/core/utils/SignCheckUtil.java new file mode 100644 index 0000000..45aed11 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/utils/SignCheckUtil.java @@ -0,0 +1,196 @@ +package com.gxwebsoft.common.core.utils; + +import cn.hutool.crypto.SecureUtil; +import com.alibaba.fastjson.JSONObject; +import com.gxwebsoft.common.system.entity.KVEntity; +import org.apache.commons.lang3.StringUtils; + +import javax.annotation.Resource; +import java.util.*; + +/** + * 签名检查和获取签名 + * https://blog.csdn.net/u011628753/article/details/110251445 + * @author leng + * + */ +public class SignCheckUtil { + // 签名字段 + public final static String SIGN = "sign"; + + /** + * 签名检查,签名参数中,sign是用于校验的加密值,其他参数按照字母顺序排序,加密,并将其内容链接起来 + * + * @param params + * @param key + * @return + */ + public static boolean signCheck(JSONObject params, String key) { + if (null != params) { + Map map = new HashMap<>(); + + params.forEach((k, v) -> { + map.put(k, v.toString()); + }); + return signCheck(map, key); + } + + return false; + } + + /** + * 签名检查,签名参数中,sign是用于校验的加密值,其他参数按照字母顺序排序,加密,并将其内容链接起来 + * + * @param params + * @param key + * 签名key不允许为空 + * @return + */ + public static boolean signCheck(Map params, String key) { + String sign = params.get(SIGN);// 签名 + if (null == sign) { + return false; + } + String signTemp = getSignString(params,key); + if (null == signTemp) { + return false; + } + return signTemp.equals(sign); + } + + /** + * 获取签名的字符串 + * + * @param params + * @param key + * @return + */ + public static String getSignString(JSONObject params, String key) { + if (null != params) { + Map map = new HashMap<>(); + + params.forEach((k, v) -> { + map.put(k, v.toString()); + }); + return getSignString(map, key); + } + + return null; + } + + /** + * 获取签名的字符串 + * + * @param params + * @param key + * @return + */ + public static String getSignString(Map params, String key) { + // 签名 + if (null == params || params.size() == 0) { + return null; + } + key = (null == key) ? "" : key; + List> list = new ArrayList<>(params.size() - 1); + + params.forEach((k, v) -> { + if (!SIGN.equals(k)) { + list.add(KVEntity.build(k, v)); + } + }); + + Collections.sort(list, (obj1, obj2) -> { + return obj1.getK().compareTo(obj2.getK()); + }); + + StringBuffer sb = new StringBuffer(); + for (KVEntity kv : list) { + String value = kv.getV(); + if (!StringUtils.isEmpty(value)) { + sb.append(kv.getV()).append("-"); + } + } + sb.append(key); + System.out.println("md5加密前的字符串 = " + sb + key); + String signTemp = SecureUtil.md5(sb.toString()).toLowerCase(); + return signTemp; + } + + /** + * 获取微信签名的字符串 + * + * 注意签名(sign)的生成方式,具体见官方文档(传参都要参与生成签名,且参数名按照字典序排序,最后接上APP_KEY,转化成大写) + * + * @param params + * @param key + * @return + */ + public static String getWXSignString(Map params, String key) { + // 签名 + if (null == params || params.size() == 0 || StringUtils.isEmpty(key)) { + return null; + } + + List> list = new ArrayList<>(params.size() - 1); + + params.forEach((k, v) -> { + if (!SIGN.equals(k)) { + list.add(KVEntity.build(k, v)); + } + }); + + Collections.sort(list, (obj1, obj2) -> { + return obj1.getK().compareTo(obj2.getK()); + }); + + StringBuffer sb = new StringBuffer(); + for (KVEntity kv : list) { + String value = kv.getV(); + if (!StringUtils.isEmpty(value)) { + sb.append(kv.getK() + "=" + value + "&"); + } + } + + sb.append("key=" + key); + String signTemp = SecureUtil.md5(sb.toString()).toLowerCase(); + return signTemp; + } + + /** + * 微信签名验证 + * @param params + * @param key + * @return + */ + public static boolean WXsignCheck(Map params, String key) { + String sign = params.get(SIGN); + if (StringUtils.isEmpty(sign)) { + return false; + } + return sign.equals(getWXSignString(params, key)); + } + + /** + * 白名单校验 + * @param domainName abc.com + * @return true + */ + public boolean checkWhiteDomains(List whiteDomains, String domainName) { + if(whiteDomains == null){ + return true; + } + if (whiteDomains.isEmpty()) { + return true; + } + // 服务器域名白名单列表 + whiteDomains.add("server.gxwebsoft.com"); + for(String item: whiteDomains){ +// System.out.println(">>> domainName = " + domainName); + if(Objects.equals(item, domainName)){ + return true; + } + } + return false; + } + +} diff --git a/src/main/java/com/gxwebsoft/common/core/utils/WechatCertAutoConfig.java b/src/main/java/com/gxwebsoft/common/core/utils/WechatCertAutoConfig.java new file mode 100644 index 0000000..0d90c69 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/utils/WechatCertAutoConfig.java @@ -0,0 +1,141 @@ +package com.gxwebsoft.common.core.utils; + +import com.wechat.pay.java.core.Config; +import com.wechat.pay.java.core.RSAAutoCertificateConfig; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +/** + * 微信支付证书自动配置工具类 + * 使用RSAAutoCertificateConfig实现证书自动管理 + * + * @author 科技小王子 + * @since 2024-07-26 + */ +@Slf4j +@Component +public class WechatCertAutoConfig { + + /** + * 创建微信支付自动证书配置 + * + * @param merchantId 商户号 + * @param privateKeyPath 私钥文件路径 + * @param merchantSerialNumber 商户证书序列号 + * @param apiV3Key APIv3密钥 + * @return 微信支付配置对象 + */ + public Config createAutoConfig(String merchantId, String privateKeyPath, + String merchantSerialNumber, String apiV3Key) { + try { + log.info("创建微信支付自动证书配置..."); + log.info("商户号: {}", merchantId); + log.info("私钥路径: {}", privateKeyPath); + log.info("证书序列号: {}", merchantSerialNumber); + + Config config = new RSAAutoCertificateConfig.Builder() + .merchantId(merchantId) + .privateKeyFromPath(privateKeyPath) + .merchantSerialNumber(merchantSerialNumber) + .apiV3Key(apiV3Key) + .build(); + + log.info("✅ 微信支付自动证书配置创建成功"); + log.info("🔄 系统将自动管理平台证书的下载和更新"); + + return config; + + } catch (Exception e) { + log.error("❌ 创建微信支付自动证书配置失败: {}", e.getMessage(), e); + + // 提供详细的错误诊断信息 + log.error("🔍 错误诊断:"); + log.error("1. 请检查商户平台是否已开启API安全功能"); + log.error("2. 请确认已申请使用微信支付公钥"); + log.error("3. 请验证APIv3密钥和证书序列号是否正确"); + log.error("4. 请检查网络连接是否正常"); + log.error("5. 请确认私钥文件路径是否正确: {}", privateKeyPath); + + throw new RuntimeException("微信支付自动证书配置失败: " + e.getMessage(), e); + } + } + + /** + * 使用默认开发环境配置创建自动证书配置 + * + * @return 微信支付配置对象 + */ + public Config createDefaultDevConfig() { + String merchantId = "1723321338"; + String privateKeyPath = "src/main/resources/certs/dev/wechat/apiclient_key.pem"; + String merchantSerialNumber = "2B933F7C35014A1C363642623E4A62364B34C4EB"; + String apiV3Key = "0kF5OlPr482EZwtn9zGufUcqa7ovgxRL"; + + return createAutoConfig(merchantId, privateKeyPath, merchantSerialNumber, apiV3Key); + } + + /** + * 测试证书配置是否正常 + * + * @param config 微信支付配置 + * @return 是否配置成功 + */ + public boolean testConfig(Config config) { + try { + // 这里可以添加一些基本的配置验证逻辑 + log.info("🧪 测试微信支付证书配置..."); + + if (config == null) { + log.error("配置对象为空"); + return false; + } + + log.info("✅ 证书配置测试通过"); + return true; + + } catch (Exception e) { + log.error("❌ 证书配置测试失败: {}", e.getMessage(), e); + return false; + } + } + + /** + * 获取配置使用说明 + * + * @return 使用说明 + */ + public String getUsageInstructions() { + return """ + 🚀 微信支付自动证书配置使用说明 + ================================ + + ✅ 优势: + 1. 自动下载微信支付平台证书 + 2. 证书过期时自动更新 + 3. 无需手动管理 wechatpay_cert.pem 文件 + 4. 符合微信支付官方最佳实践 + + 📝 使用方法: + + // 方法1: 使用默认开发环境配置 + Config config = wechatCertAutoConfig.createDefaultDevConfig(); + + // 方法2: 自定义配置 + Config config = wechatCertAutoConfig.createAutoConfig( + "商户号", + "私钥路径", + "证书序列号", + "APIv3密钥" + ); + + 🔧 前置条件: + 1. 微信商户平台已开启API安全功能 + 2. 已申请使用微信支付公钥 + 3. 私钥文件存在且路径正确 + 4. 网络连接正常 + + 📚 更多信息: + https://pay.weixin.qq.com/doc/v3/merchant/4012153196 + """; + } +} diff --git a/src/main/java/com/gxwebsoft/common/core/utils/WechatPayCertificateDiagnostic.java b/src/main/java/com/gxwebsoft/common/core/utils/WechatPayCertificateDiagnostic.java new file mode 100644 index 0000000..ebe8189 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/utils/WechatPayCertificateDiagnostic.java @@ -0,0 +1,314 @@ +package com.gxwebsoft.common.core.utils; + +import com.gxwebsoft.common.core.config.CertificateProperties; +import com.gxwebsoft.common.system.entity.Payment; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; + + +/** + * 微信支付证书诊断工具 + * 专门用于诊断和解决证书相关问题 + * + * @author 科技小王子 + * @since 2025-07-29 + */ +@Slf4j +@Component +public class WechatPayCertificateDiagnostic { + + private final CertificateProperties certConfig; + private final CertificateLoader certificateLoader; + + public WechatPayCertificateDiagnostic(CertificateProperties certConfig, CertificateLoader certificateLoader) { + this.certConfig = certConfig; + this.certificateLoader = certificateLoader; + } + + /** + * 全面诊断微信支付证书配置 + * + * @param payment 支付配置 + * @param tenantId 租户ID + * @param environment 环境(dev/prod) + * @return 诊断结果 + */ + public DiagnosticResult diagnoseCertificateConfig(Payment payment, Integer tenantId, String environment) { + DiagnosticResult result = new DiagnosticResult(); + + log.info("=== 开始微信支付证书诊断 ==="); + log.info("租户ID: {}, 环境: {}", tenantId, environment); + + try { + // 1. 检查基本配置 + checkBasicConfig(payment, result); + + // 2. 检查证书文件 + checkCertificateFiles(payment, tenantId, environment, result); + + // 3. 检查证书内容 + validateCertificateContent(payment, tenantId, environment, result); + + // 4. 生成建议 + generateRecommendations(result); + + } catch (Exception e) { + result.addError("诊断过程中发生异常: " + e.getMessage()); + log.error("证书诊断异常", e); + } + + log.info("=== 证书诊断完成 ==="); + return result; + } + + /** + * 检查基本配置 + */ + private void checkBasicConfig(Payment payment, DiagnosticResult result) { + if (payment == null) { + result.addError("支付配置为空"); + return; + } + + if (payment.getMchId() == null || payment.getMchId().trim().isEmpty()) { + result.addError("商户号未配置"); + } else { + result.addInfo("商户号: " + payment.getMchId()); + } + + if (payment.getAppId() == null || payment.getAppId().trim().isEmpty()) { + result.addError("应用ID未配置"); + } else { + result.addInfo("应用ID: " + payment.getAppId()); + } + + if (payment.getMerchantSerialNumber() == null || payment.getMerchantSerialNumber().trim().isEmpty()) { + result.addError("商户证书序列号未配置"); + } else { + result.addInfo("商户证书序列号: " + payment.getMerchantSerialNumber()); + } + + if (payment.getApiKey() == null || payment.getApiKey().trim().isEmpty()) { + result.addWarning("数据库中APIv3密钥未配置,将使用配置文件默认值"); + } else { + result.addInfo("APIv3密钥: 已配置(" + payment.getApiKey().length() + "位)"); + } + } + + /** + * 检查证书文件 + */ + private void checkCertificateFiles(Payment payment, Integer tenantId, String environment, DiagnosticResult result) { + if ("dev".equals(environment)) { + // 开发环境证书检查 + String tenantCertPath = "dev/wechat/" + tenantId; + String privateKeyPath = tenantCertPath + "/" + certConfig.getWechatPay().getDev().getPrivateKeyFile(); + String apiclientCertPath = tenantCertPath + "/" + certConfig.getWechatPay().getDev().getApiclientCertFile(); + + // 检查私钥文件 + if (certificateLoader.certificateExists(privateKeyPath)) { + result.addInfo("✅ 私钥文件存在: " + privateKeyPath); + try { + String privateKeyFile = certificateLoader.loadCertificatePath(privateKeyPath); + result.addInfo("私钥文件路径: " + privateKeyFile); + } catch (Exception e) { + result.addError("私钥文件加载失败: " + e.getMessage()); + } + } else { + result.addError("❌ 私钥文件不存在: " + privateKeyPath); + } + + // 检查商户证书文件 + if (certificateLoader.certificateExists(apiclientCertPath)) { + result.addInfo("✅ 商户证书文件存在: " + apiclientCertPath); + } else { + result.addWarning("⚠️ 商户证书文件不存在: " + apiclientCertPath + " (自动证书配置不需要此文件)"); + } + + } else { + // 生产环境证书检查 + if (payment.getApiclientKey() != null) { + result.addInfo("私钥文件配置: " + payment.getApiclientKey()); + } else { + result.addError("生产环境私钥文件路径未配置"); + } + + if (payment.getApiclientCert() != null) { + result.addInfo("商户证书文件配置: " + payment.getApiclientCert()); + } else { + result.addWarning("生产环境商户证书文件路径未配置 (自动证书配置不需要此文件)"); + } + } + } + + /** + * 验证证书内容 + */ + private void validateCertificateContent(Payment payment, Integer tenantId, String environment, DiagnosticResult result) { + try { + if ("dev".equals(environment)) { + String tenantCertPath = "dev/wechat/" + tenantId; + String apiclientCertPath = tenantCertPath + "/" + certConfig.getWechatPay().getDev().getApiclientCertFile(); + + if (certificateLoader.certificateExists(apiclientCertPath)) { + validateX509Certificate(apiclientCertPath, payment.getMerchantSerialNumber(), result); + } + } + } catch (Exception e) { + result.addWarning("证书内容验证失败: " + e.getMessage()); + } + } + + /** + * 验证X509证书 + */ + private void validateX509Certificate(String certPath, String expectedSerialNumber, DiagnosticResult result) { + try { + String actualCertPath = certificateLoader.loadCertificatePath(certPath); + + try (InputStream inputStream = new FileInputStream(new File(actualCertPath))) { + CertificateFactory cf = CertificateFactory.getInstance("X.509"); + X509Certificate cert = (X509Certificate) cf.generateCertificate(inputStream); + + if (cert != null) { + String actualSerialNumber = cert.getSerialNumber().toString(16).toUpperCase(); + result.addInfo("证书序列号: " + actualSerialNumber); + result.addInfo("证书有效期: " + cert.getNotBefore() + " 至 " + cert.getNotAfter()); + result.addInfo("证书主体: " + cert.getSubjectX500Principal().toString()); + + // 检查序列号是否匹配 + if (expectedSerialNumber != null && !expectedSerialNumber.equalsIgnoreCase(actualSerialNumber)) { + result.addError("证书序列号不匹配! 配置: " + expectedSerialNumber + ", 实际: " + actualSerialNumber); + } else { + result.addInfo("✅ 证书序列号匹配"); + } + + // 检查证书是否过期 + long now = System.currentTimeMillis(); + if (now < cert.getNotBefore().getTime()) { + result.addError("证书尚未生效"); + } else if (now > cert.getNotAfter().getTime()) { + result.addError("证书已过期"); + } else { + result.addInfo("✅ 证书在有效期内"); + } + } else { + result.addError("无法解析证书文件"); + } + } + } catch (Exception e) { + result.addError("证书验证失败: " + e.getMessage()); + } + } + + /** + * 生成建议 + */ + private void generateRecommendations(DiagnosticResult result) { + if (result.hasErrors()) { + result.addRecommendation("🔧 修复建议:"); + + String errorText = result.getErrors(); + if (errorText.contains("商户号")) { + result.addRecommendation("1. 请在支付配置中设置正确的商户号"); + } + + if (errorText.contains("序列号")) { + result.addRecommendation("2. 请检查商户证书序列号是否正确,可在微信商户平台查看"); + } + + if (errorText.contains("证书文件")) { + result.addRecommendation("3. 请确保证书文件已正确放置在指定目录"); + } + + if (errorText.contains("过期")) { + result.addRecommendation("4. 请更新过期的证书文件"); + } + + result.addRecommendation("5. 建议使用RSAAutoCertificateConfig自动证书配置,可避免手动管理证书"); + result.addRecommendation("6. 确保在微信商户平台开启API安全功能并申请使用微信支付公钥"); + } else { + result.addRecommendation("✅ 证书配置正常,建议使用自动证书配置以获得最佳体验"); + } + } + + /** + * 诊断结果类 + */ + public static class DiagnosticResult { + private final StringBuilder errors = new StringBuilder(); + private final StringBuilder warnings = new StringBuilder(); + private final StringBuilder info = new StringBuilder(); + private final StringBuilder recommendations = new StringBuilder(); + + public void addError(String error) { + if (errors.length() > 0) errors.append("\n"); + errors.append(error); + } + + public void addWarning(String warning) { + if (warnings.length() > 0) warnings.append("\n"); + warnings.append(warning); + } + + public void addInfo(String information) { + if (info.length() > 0) info.append("\n"); + info.append(information); + } + + public void addRecommendation(String recommendation) { + if (recommendations.length() > 0) recommendations.append("\n"); + recommendations.append(recommendation); + } + + public boolean hasErrors() { + return errors.length() > 0; + } + + public String getErrors() { + return errors.toString(); + } + + public String getWarnings() { + return warnings.toString(); + } + + public String getInfo() { + return info.toString(); + } + + public String getRecommendations() { + return recommendations.toString(); + } + + public String getFullReport() { + StringBuilder report = new StringBuilder(); + report.append("=== 微信支付证书诊断报告 ===\n\n"); + + if (info.length() > 0) { + report.append("📋 基本信息:\n").append(info).append("\n\n"); + } + + if (warnings.length() > 0) { + report.append("⚠️ 警告:\n").append(warnings).append("\n\n"); + } + + if (errors.length() > 0) { + report.append("❌ 错误:\n").append(errors).append("\n\n"); + } + + if (recommendations.length() > 0) { + report.append("💡 建议:\n").append(recommendations).append("\n\n"); + } + + report.append("=== 诊断报告结束 ==="); + return report.toString(); + } + } +} diff --git a/src/main/java/com/gxwebsoft/common/core/utils/WechatPayConfigValidator.java b/src/main/java/com/gxwebsoft/common/core/utils/WechatPayConfigValidator.java new file mode 100644 index 0000000..23326d2 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/utils/WechatPayConfigValidator.java @@ -0,0 +1,223 @@ +package com.gxwebsoft.common.core.utils; + +import com.gxwebsoft.common.core.config.CertificateProperties; +import com.gxwebsoft.common.system.entity.Payment; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; +import org.springframework.util.StringUtils; + +/** + * 微信支付配置验证工具 + * + * @author 科技小王子 + * @since 2025-07-27 + */ +@Slf4j +@Component +public class WechatPayConfigValidator { + + private final CertificateProperties certConfig; + private final CertificateLoader certificateLoader; + + @Value("${spring.profiles.active}") + private String activeProfile; + + public WechatPayConfigValidator(CertificateProperties certConfig, CertificateLoader certificateLoader) { + this.certConfig = certConfig; + this.certificateLoader = certificateLoader; + } + + /** + * 验证微信支付配置 + * + * @param payment 支付配置 + * @param tenantId 租户ID + * @return 验证结果 + */ + public ValidationResult validateWechatPayConfig(Payment payment, Integer tenantId) { + ValidationResult result = new ValidationResult(); + + log.info("开始验证微信支付配置 - 租户ID: {}", tenantId); + + // 1. 验证基本配置 + if (payment == null) { + result.addError("支付配置为空"); + return result; + } + + if (!StringUtils.hasText(payment.getMchId())) { + result.addError("商户号未配置"); + } + + if (!StringUtils.hasText(payment.getAppId())) { + result.addError("应用ID未配置"); + } + + if (!StringUtils.hasText(payment.getMerchantSerialNumber())) { + result.addError("商户证书序列号未配置"); + } + + // 2. 验证 APIv3 密钥 + String apiV3Key = getValidApiV3Key(payment); + if (!StringUtils.hasText(apiV3Key)) { + result.addError("APIv3密钥未配置"); + } else { + validateApiV3Key(apiV3Key, result); + } + + // 3. 验证证书文件 + validateCertificateFiles(tenantId, result); + + // 4. 记录验证结果 + if (result.isValid()) { + log.info("✅ 微信支付配置验证通过 - 租户ID: {}", tenantId); + } else { + log.error("❌ 微信支付配置验证失败 - 租户ID: {}, 错误: {}", tenantId, result.getErrors()); + } + + return result; + } + + /** + * 获取有效的 APIv3 密钥 + * 优先使用数据库配置,如果为空则使用配置文件默认值 + */ + public String getValidApiV3Key(Payment payment) { + String apiV3Key = payment.getApiKey(); + + if (!StringUtils.hasText(apiV3Key)) { + apiV3Key = certConfig.getWechatPay().getDev().getApiV3Key(); + log.warn("数据库中APIv3密钥为空,使用配置文件默认值"); + } + + return apiV3Key; + } + + /** + * 验证 APIv3 密钥格式 + */ + private void validateApiV3Key(String apiV3Key, ValidationResult result) { + if (apiV3Key.length() != 32) { + result.addError("APIv3密钥长度错误,应为32位,实际为: " + apiV3Key.length()); + } + + if (!apiV3Key.matches("^[a-zA-Z0-9]+$")) { + result.addError("APIv3密钥格式错误,应仅包含字母和数字"); + } + + log.info("APIv3密钥验证 - 长度: {}, 格式: {}", + apiV3Key.length(), + apiV3Key.matches("^[a-zA-Z0-9]+$") ? "正确" : "错误"); + } + + /** + * 验证证书文件 + */ + private void validateCertificateFiles(Integer tenantId, ValidationResult result) { + if ("dev".equals(activeProfile)) { + // 开发环境证书验证 + String tenantCertPath = "dev/wechat/" + tenantId; + String privateKeyPath = tenantCertPath + "/" + certConfig.getWechatPay().getDev().getPrivateKeyFile(); + + if (!certificateLoader.certificateExists(privateKeyPath)) { + result.addError("证书文件不存在: " + privateKeyPath); + return; + } + + try { + certificateLoader.loadCertificatePath(privateKeyPath); + log.info("✅ 开发环境证书文件验证通过: {}", privateKeyPath); + } catch (Exception e) { + result.addError("证书文件加载失败: " + e.getMessage()); + } + } else { + // 生产环境证书验证 - 跳过文件存在性检查,因为证书路径来自数据库 + log.info("✅ 生产环境跳过证书文件存在性验证,使用数据库配置的证书路径"); + } + } + + /** + * 验证结果类 + */ + public static class ValidationResult { + private boolean valid = true; + private StringBuilder errors = new StringBuilder(); + + public void addError(String error) { + this.valid = false; + if (errors.length() > 0) { + errors.append("; "); + } + errors.append(error); + } + + public boolean isValid() { + return valid; + } + + public String getErrors() { + return errors.toString(); + } + + public void logErrors() { + if (!valid) { + log.error("配置验证失败: {}", errors.toString()); + } + } + } + + /** + * 生成配置诊断报告 + */ + public String generateDiagnosticReport(Payment payment, Integer tenantId) { + StringBuilder report = new StringBuilder(); + report.append("=== 微信支付配置诊断报告 ===\n"); + report.append("租户ID: ").append(tenantId).append("\n"); + + if (payment != null) { + report.append("商户号: ").append(payment.getMchId()).append("\n"); + report.append("应用ID: ").append(payment.getAppId()).append("\n"); + report.append("商户证书序列号: ").append(payment.getMerchantSerialNumber()).append("\n"); + + String dbApiKey = payment.getApiKey(); + String configApiKey = certConfig.getWechatPay().getDev().getApiV3Key(); + + report.append("数据库APIv3密钥: ").append(dbApiKey != null ? "已配置(" + dbApiKey.length() + "位)" : "未配置").append("\n"); + report.append("配置文件APIv3密钥: ").append(configApiKey != null ? "已配置(" + configApiKey.length() + "位)" : "未配置").append("\n"); + + String finalApiKey = getValidApiV3Key(payment); + report.append("最终使用APIv3密钥: ").append(finalApiKey != null ? "已配置(" + finalApiKey.length() + "位)" : "未配置").append("\n"); + + } else { + report.append("❌ 支付配置为空\n"); + } + + // 证书文件检查 + report.append("当前环境: ").append(activeProfile).append("\n"); + if ("dev".equals(activeProfile)) { + String tenantCertPath = "dev/wechat/" + tenantId; + String privateKeyPath = tenantCertPath + "/" + certConfig.getWechatPay().getDev().getPrivateKeyFile(); + boolean certExists = certificateLoader.certificateExists(privateKeyPath); + + report.append("开发环境证书文件路径: ").append(privateKeyPath).append("\n"); + report.append("证书文件存在: ").append(certExists ? "是" : "否").append("\n"); + } else { + report.append("生产环境证书路径: 从数据库配置获取\n"); + if (payment != null) { + report.append("私钥文件: ").append(payment.getApiclientKey()).append("\n"); + report.append("证书文件: ").append(payment.getApiclientCert()).append("\n"); + } + } + + ValidationResult validation = validateWechatPayConfig(payment, tenantId); + report.append("配置验证结果: ").append(validation.isValid() ? "通过" : "失败").append("\n"); + if (!validation.isValid()) { + report.append("验证错误: ").append(validation.getErrors()).append("\n"); + } + + report.append("=== 诊断报告结束 ==="); + + return report.toString(); + } +} diff --git a/src/main/java/com/gxwebsoft/common/core/utils/WechatPayDiagnostic.java b/src/main/java/com/gxwebsoft/common/core/utils/WechatPayDiagnostic.java new file mode 100644 index 0000000..620d506 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/utils/WechatPayDiagnostic.java @@ -0,0 +1,222 @@ +package com.gxwebsoft.common.core.utils; + +import com.gxwebsoft.common.system.entity.Payment; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Paths; + +/** + * 微信支付配置诊断工具 + * 用于排查微信支付签名验证失败等问题 + * + * @author 科技小王子 + * @since 2025-07-27 + */ +@Slf4j +@Component +public class WechatPayDiagnostic { + + /** + * 诊断微信支付配置 + * + * @param payment 支付配置 + * @param privateKeyPath 私钥路径 + * @param environment 环境标识 + */ + public void diagnosePaymentConfig(Payment payment, String privateKeyPath, String environment) { + log.info("=== 微信支付配置诊断开始 ==="); + log.info("环境: {}", environment); + + // 1. 检查支付配置基本信息 + checkBasicConfig(payment); + + // 2. 检查证书文件 + checkCertificateFiles(payment, privateKeyPath, environment); + + // 3. 检查配置完整性 + checkConfigCompleteness(payment); + + log.info("=== 微信支付配置诊断结束 ==="); + } + + /** + * 检查基本配置信息 + */ + private void checkBasicConfig(Payment payment) { + log.info("--- 基本配置检查 ---"); + + if (payment == null) { + log.error("❌ 支付配置为空"); + return; + } + + log.info("支付配置ID: {}", payment.getId()); + log.info("支付方式名称: {}", payment.getName()); + log.info("支付类型: {}", payment.getType()); + log.info("支付代码: {}", payment.getCode()); + log.info("状态: {}", payment.getStatus()); + + // 检查关键字段 + checkField("应用ID", payment.getAppId()); + checkField("商户号", payment.getMchId()); + checkField("商户证书序列号", payment.getMerchantSerialNumber()); + checkField("API密钥", payment.getApiKey(), true); + } + + /** + * 检查证书文件 + */ + private void checkCertificateFiles(Payment payment, String privateKeyPath, String environment) { + log.info("--- 证书文件检查 ---"); + + // 检查私钥文件 + if (privateKeyPath != null) { + checkFileExists("私钥文件", privateKeyPath); + } + + // 生产环境检查证书文件 + if (!"dev".equals(environment)) { + if (payment.getApiclientCert() != null) { + log.info("商户证书文件配置: {}", payment.getApiclientCert()); + } + + if (payment.getPubKey() != null) { + log.info("公钥文件配置: {}", payment.getPubKey()); + log.info("公钥ID: {}", payment.getPubKeyId()); + } + } + } + + /** + * 检查配置完整性 + */ + private void checkConfigCompleteness(Payment payment) { + log.info("--- 配置完整性检查 ---"); + + boolean isComplete = true; + + if (isEmpty(payment.getMchId())) { + log.error("❌ 商户号未配置"); + isComplete = false; + } + + if (isEmpty(payment.getMerchantSerialNumber())) { + log.error("❌ 商户证书序列号未配置"); + isComplete = false; + } + + if (isEmpty(payment.getApiKey())) { + log.error("❌ API密钥未配置"); + isComplete = false; + } + + if (isEmpty(payment.getAppId())) { + log.error("❌ 应用ID未配置"); + isComplete = false; + } + + if (isComplete) { + log.info("✅ 配置完整性检查通过"); + } else { + log.error("❌ 配置不完整,请补充缺失的配置项"); + } + } + + /** + * 检查字段是否为空 + */ + private void checkField(String fieldName, String value) { + checkField(fieldName, value, false); + } + + /** + * 检查字段是否为空 + */ + private void checkField(String fieldName, String value, boolean isSensitive) { + if (isEmpty(value)) { + log.warn("⚠️ {}: 未配置", fieldName); + } else { + if (isSensitive) { + log.info("✅ {}: 已配置(长度:{})", fieldName, value.length()); + } else { + log.info("✅ {}: {}", fieldName, value); + } + } + } + + /** + * 检查文件是否存在 + */ + private void checkFileExists(String fileName, String filePath) { + try { + File file = new File(filePath); + if (file.exists() && file.isFile()) { + log.info("✅ {}: 文件存在 - {}", fileName, filePath); + log.info(" 文件大小: {} bytes", file.length()); + + // 检查文件内容格式 + if (filePath.endsWith(".pem")) { + checkPemFileFormat(fileName, filePath); + } + } else { + log.error("❌ {}: 文件不存在 - {}", fileName, filePath); + } + } catch (Exception e) { + log.error("❌ {}: 检查文件时出错 - {} ({})", fileName, filePath, e.getMessage()); + } + } + + /** + * 检查PEM文件格式 + */ + private void checkPemFileFormat(String fileName, String filePath) { + try { + String content = Files.readString(Paths.get(filePath)); + if (content.contains("-----BEGIN") && content.contains("-----END")) { + log.info("✅ {}: PEM格式正确", fileName); + } else { + log.warn("⚠️ {}: PEM格式可能有问题", fileName); + } + } catch (Exception e) { + log.warn("⚠️ {}: 无法读取文件内容进行格式检查 ({})", fileName, e.getMessage()); + } + } + + /** + * 检查字符串是否为空 + */ + private boolean isEmpty(String str) { + return str == null || str.trim().isEmpty(); + } + + /** + * 生成诊断报告 + */ + public String generateDiagnosticReport(Payment payment, String environment) { + StringBuilder report = new StringBuilder(); + report.append("🔍 微信支付配置诊断报告\n"); + report.append("========================\n\n"); + + report.append("环境: ").append(environment).append("\n"); + report.append("租户ID: ").append(payment != null ? payment.getTenantId() : "未知").append("\n"); + report.append("商户号: ").append(payment != null ? payment.getMchId() : "未配置").append("\n"); + report.append("应用ID: ").append(payment != null ? payment.getAppId() : "未配置").append("\n\n"); + + report.append("🚨 常见问题排查:\n"); + report.append("1. 商户证书序列号是否正确\n"); + report.append("2. APIv3密钥是否正确\n"); + report.append("3. 私钥文件是否正确\n"); + report.append("4. 微信支付平台证书是否过期\n"); + report.append("5. 网络连接是否正常\n\n"); + + report.append("💡 建议解决方案:\n"); + report.append("1. 使用自动证书配置(RSAAutoCertificateConfig)\n"); + report.append("2. 在微信商户平台重新下载证书\n"); + report.append("3. 检查商户平台API安全设置\n"); + + return report.toString(); + } +} diff --git a/src/main/java/com/gxwebsoft/common/core/utils/WechatPayUtils.java b/src/main/java/com/gxwebsoft/common/core/utils/WechatPayUtils.java new file mode 100644 index 0000000..14a31e9 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/utils/WechatPayUtils.java @@ -0,0 +1,111 @@ +package com.gxwebsoft.common.core.utils; + +import java.nio.charset.StandardCharsets; + +/** + * 微信支付工具类 + * 处理微信支付API的字段限制和格式要求 + * + * @author 科技小王子 + * @since 2025-01-11 + */ +public class WechatPayUtils { + + /** + * 微信支付description字段的最大字节数限制 + */ + public static final int DESCRIPTION_MAX_BYTES = 127; + + /** + * 微信支付attach字段的最大字节数限制 + */ + public static final int ATTACH_MAX_BYTES = 127; + + /** + * 截断字符串以确保字节数不超过指定限制 + * 主要用于微信支付API的字段限制处理 + * + * @param text 原始文本 + * @param maxBytes 最大字节数 + * @return 截断后的文本,确保UTF-8字符完整性 + */ + public static String truncateToByteLimit(String text, int maxBytes) { + if (text == null || text.isEmpty()) { + return text; + } + + byte[] bytes = text.getBytes(StandardCharsets.UTF_8); + if (bytes.length <= maxBytes) { + return text; + } + + // 截断字节数组,但要确保不会截断UTF-8字符的中间 + int truncateLength = maxBytes; + while (truncateLength > 0) { + byte[] truncated = new byte[truncateLength]; + System.arraycopy(bytes, 0, truncated, 0, truncateLength); + + try { + String result = new String(truncated, StandardCharsets.UTF_8); + // 检查是否有无效字符(被截断的UTF-8字符) + if (!result.contains("\uFFFD")) { + return result; + } + } catch (Exception e) { + // 继续尝试更短的长度 + } + truncateLength--; + } + + return ""; // 如果无法安全截断,返回空字符串 + } + + /** + * 处理微信支付商品描述字段 + * 确保字节数不超过127字节 + * + * @param description 商品描述 + * @return 处理后的描述,符合微信支付要求 + */ + public static String processDescription(String description) { + return truncateToByteLimit(description, DESCRIPTION_MAX_BYTES); + } + + /** + * 处理微信支付附加数据字段 + * 确保字节数不超过127字节 + * + * @param attach 附加数据 + * @return 处理后的附加数据,符合微信支付要求 + */ + public static String processAttach(String attach) { + return truncateToByteLimit(attach, ATTACH_MAX_BYTES); + } + + /** + * 验证字符串是否符合微信支付字段的字节限制 + * + * @param text 待验证的文本 + * @param maxBytes 最大字节数限制 + * @return true如果符合限制,false如果超出限制 + */ + public static boolean isWithinByteLimit(String text, int maxBytes) { + if (text == null) { + return true; + } + return text.getBytes(StandardCharsets.UTF_8).length <= maxBytes; + } + + /** + * 获取字符串的UTF-8字节数 + * + * @param text 文本 + * @return 字节数 + */ + public static int getByteLength(String text) { + if (text == null) { + return 0; + } + return text.getBytes(StandardCharsets.UTF_8).length; + } +} diff --git a/src/main/java/com/gxwebsoft/common/core/utils/WxMiniProgramDecryptUtil.java b/src/main/java/com/gxwebsoft/common/core/utils/WxMiniProgramDecryptUtil.java new file mode 100644 index 0000000..b2af68f --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/utils/WxMiniProgramDecryptUtil.java @@ -0,0 +1,105 @@ +package com.gxwebsoft.common.core.utils; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import org.apache.commons.codec.binary.Base64; + +import javax.crypto.Cipher; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; +import java.nio.charset.StandardCharsets; +import java.security.spec.AlgorithmParameterSpec; + +/** + * 微信小程序数据解密工具类 + * 用于解密微信小程序的encryptedData数据 + * + * @author WebSoft + */ +public class WxMiniProgramDecryptUtil { + + /** + * 解密微信小程序数据 + * + * @param encryptedData 加密的数据 + * @param sessionKey 会话密钥 + * @param iv 初始向量 + * @return 解密后的JSON字符串 + * @throws Exception 解密失败时抛出异常 + */ + public static String decrypt(String encryptedData, String sessionKey, String iv) throws Exception { + // Base64解码 + byte[] dataByte = Base64.decodeBase64(encryptedData); + byte[] keyByte = Base64.decodeBase64(sessionKey); + byte[] ivByte = Base64.decodeBase64(iv); + + try { + // 如果密钥长度不够,则补齐到32位 + if (keyByte.length % 16 != 0) { + int groups = keyByte.length / 16 + (keyByte.length % 16 != 0 ? 1 : 0); + byte[] temp = new byte[groups * 16]; + System.arraycopy(keyByte, 0, temp, 0, keyByte.length); + keyByte = temp; + } + + // 初始化 + Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); + SecretKeySpec spec = new SecretKeySpec(keyByte, "AES"); + AlgorithmParameterSpec paramSpec = new IvParameterSpec(ivByte); + cipher.init(Cipher.DECRYPT_MODE, spec, paramSpec); + + // 解密 + byte[] resultByte = cipher.doFinal(dataByte); + if (null != resultByte && resultByte.length > 0) { + String result = new String(resultByte, StandardCharsets.UTF_8); + return result; + } + } catch (Exception e) { + throw new Exception("微信小程序数据解密失败", e); + } + return null; + } + + /** + * 解密手机号信息 + * + * @param encryptedData 加密的数据 + * @param sessionKey 会话密钥 + * @param iv 初始向量 + * @return 手机号码,解密失败返回null + */ + public static String decryptPhoneNumber(String encryptedData, String sessionKey, String iv) { + try { + String decryptedData = decrypt(encryptedData, sessionKey, iv); + if (decryptedData != null) { + JSONObject jsonObject = JSON.parseObject(decryptedData); + return jsonObject.getString("phoneNumber"); + } + } catch (Exception e) { + System.err.println("解密手机号失败: " + e.getMessage()); + e.printStackTrace(); + } + return null; + } + + /** + * 解密用户信息 + * + * @param encryptedData 加密的数据 + * @param sessionKey 会话密钥 + * @param iv 初始向量 + * @return 解密后的用户信息JSON对象,解密失败返回null + */ + public static JSONObject decryptUserInfo(String encryptedData, String sessionKey, String iv) { + try { + String decryptedData = decrypt(encryptedData, sessionKey, iv); + if (decryptedData != null) { + return JSON.parseObject(decryptedData); + } + } catch (Exception e) { + System.err.println("解密用户信息失败: " + e.getMessage()); + e.printStackTrace(); + } + return null; + } +} diff --git a/src/main/java/com/gxwebsoft/common/core/utils/WxNativeUtil.java b/src/main/java/com/gxwebsoft/common/core/utils/WxNativeUtil.java new file mode 100644 index 0000000..67d6eff --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/utils/WxNativeUtil.java @@ -0,0 +1,19 @@ +package com.gxwebsoft.common.core.utils; + +import java.util.HashMap; +import java.util.Map; +import com.wechat.pay.java.core.Config; + + +public class WxNativeUtil { + + private static final Map tenantConfigs = new HashMap<>(); + + public static void addConfig(Integer tenantId, Config config) { + tenantConfigs.put(tenantId, config); + } + + public static Config getConfig(Integer tenantId) { + return tenantConfigs.get(tenantId); + } +} diff --git a/src/main/java/com/gxwebsoft/common/core/utils/WxOfficialUtil.java b/src/main/java/com/gxwebsoft/common/core/utils/WxOfficialUtil.java new file mode 100644 index 0000000..0851846 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/utils/WxOfficialUtil.java @@ -0,0 +1,106 @@ +package com.gxwebsoft.common.core.utils; + +import cn.hutool.core.util.CharsetUtil; +import cn.hutool.http.HttpUtil; +import com.alibaba.fastjson.JSONObject; +import com.gxwebsoft.common.core.config.ConfigProperties; +import com.gxwebsoft.common.core.exception.BusinessException; +import com.gxwebsoft.common.system.service.SettingService; +import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; + +/** + * 微信公众号工具类 + * @author 科技小王子 + * + */ +@Component +public class WxOfficialUtil { + private final StringRedisTemplate stringRedisTemplate; + private Integer tenantId; + public String appId; + public String appSecret; + public String openid; + public String unionid; + public String access_token; + public String expires_in; + public String nickname; + + + @Resource + private SettingService settingService; + @Resource + private ConfigProperties pathConfig; + @Resource + private CacheClient cacheClient; + + public WxOfficialUtil(StringRedisTemplate stringRedisTemplate){ + this.stringRedisTemplate = stringRedisTemplate; + } + + // 实例化客户端 + public WxOfficialUtil client(Integer tenantId) { + if(tenantId > 0){ + throw new BusinessException(tenantId + "123123"); + } + this.tenantId = tenantId; + this.config(); + System.out.println("this.tenantId = " + this.tenantId); + return this; + } + + // 开发者ID和秘钥 + private void config() { + String key = "cache"+ this.tenantId +":setting:wx-official"; + String wxOfficial = stringRedisTemplate.opsForValue().get(key); + JSONObject data = JSONObject.parseObject(wxOfficial); + if(data != null){ + this.appId = data.getString("appId"); + this.appSecret = data.getString("appSecret"); + } + System.out.println("this.appId = " + this.appId); + System.out.println("this.appSecret = " + this.appSecret); + } + + // 获取appId + public String getAppSecret(){ + return this.appSecret; + } + + public String getCodeUrl() throws UnsupportedEncodingException { + String encodedReturnUrl = URLEncoder.encode("https://server.websoft.top/api/open/wx-official/accessToken","UTF-8"); + return "https://open.weixin.qq.com/connect/oauth2/authorize?appid="+ this.appId +"&redirect_uri=" + encodedReturnUrl + "&response_type=code&scope=snsapi_userinfo&state="+ this.tenantId +"#wechat_redirect"; + } + + // 获取access_token + public String getAccessToken(String code) { + String url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid="+ this.appId +"&secret="+ this.appSecret +"&code="+ code +"&grant_type=authorization_code"; + System.out.println("url = " + url); + String response = HttpUtil.get(url, CharsetUtil.CHARSET_UTF_8); + final JSONObject jsonObject = JSONObject.parseObject(response); + access_token = jsonObject.getString("access_token"); + if(access_token == null){ + throw new BusinessException("获取access_token失败"); + } + this.openid = jsonObject.getString("openid"); + this.unionid = jsonObject.getString("unionid"); + this.expires_in = jsonObject.getString("expires_in"); + return access_token; + } + + // 获取userinfo + public JSONObject getUserInfo(String access_token) { + String url = "https://api.weixin.qq.com/sns/userinfo?access_token="+ access_token +"&openid="+ this.openid +"&lang=zh_CN"; + System.out.println("url2 = " + url); + String response = HttpUtil.get(url, CharsetUtil.CHARSET_UTF_8); + System.out.println("response = " + response); + if(response == null){ + throw new BusinessException("获取userinfo失败"); + } + return JSONObject.parseObject(response); + } +} diff --git a/src/main/java/com/gxwebsoft/common/core/utils/WxUtil.java b/src/main/java/com/gxwebsoft/common/core/utils/WxUtil.java new file mode 100644 index 0000000..72f1755 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/utils/WxUtil.java @@ -0,0 +1,134 @@ +package com.gxwebsoft.common.core.utils; + +import cn.hutool.core.util.CharsetUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpUtil; +import com.alibaba.fastjson.JSONObject; +import com.gxwebsoft.common.core.exception.BusinessException; +import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import java.util.concurrent.TimeUnit; + +/** + * 微信小程序工具类 + * @author 科技小王子 + * + */ +@Component +public class WxUtil { + private final StringRedisTemplate stringRedisTemplate; + private Integer tenantId; + public String appId; + public String appSecret; + public String access_token; + public String expires_in; + public String nickname; + public String userid; + public String user_ticket; + public String openid; + public String external_userid; + public String name; + public String position; + public String mobile; + public String gender; + public String email; + public String avatar; + public String thumb_avatar; + public String telephone; + public String address; + public String alias; + public String qr_code; + public String open_userid; + + @Resource + private CacheClient cacheClient; + + + public WxUtil(StringRedisTemplate stringRedisTemplate){ + this.stringRedisTemplate = stringRedisTemplate; + } + + + // 实例化客户端 + public WxUtil client(Integer tenantId) { + this.tenantId = tenantId; + this.config(); + return this; + } + + // 开发者ID和秘钥 + private void config() { + JSONObject settingInfo = cacheClient.getSettingInfo("wx-work", this.tenantId); + if(settingInfo == null){ + throw new BusinessException("微信小程序未配置"); + } + this.appId = settingInfo.getString("corpId"); + this.appSecret = settingInfo.getString("secret"); + System.out.println("this.appId = " + this.appId); + System.out.println("this.appSecret = " + this.appSecret); + } + + // 获取access_token + public void getAccessToken(String code) { + String key = "cache"+ this.tenantId +":ww:access_token"; + final String access_token = stringRedisTemplate.opsForValue().get(key); + if(access_token != null){ + this.getUserInfo(code,access_token); + }else { + String url = "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=" +this.appId+ "&corpsecret="+ this.appSecret; + System.out.println("url = " + url); + String response = HttpUtil.get(url, CharsetUtil.CHARSET_UTF_8); + System.out.println("response = " + response); + final JSONObject jsonObject = JSONObject.parseObject(response); + // 获取成功 + if(jsonObject.getString("access_token") != null){ + this.access_token = jsonObject.getString("access_token"); + this.expires_in = jsonObject.getString("expires_in"); + stringRedisTemplate.opsForValue().set(key,this.access_token,7000, TimeUnit.SECONDS); + System.out.println("获取access_token成功 = " + this.access_token); + this.getUserInfo(code,this.access_token); + } + } + } + + // 获取userinfo + public void getUserInfo(String code, String access_token) { + String url = "https://qyapi.weixin.qq.com/cgi-bin/auth/getuserinfo?access_token=" +access_token+ "&code=" + code; + System.out.println("url2 = " + url); + String response = HttpUtil.get(url, CharsetUtil.CHARSET_UTF_8); + System.out.println("response = " + response); + JSONObject jsonObject = JSONObject.parseObject(response); + final String errcode = jsonObject.getString("errcode"); + final String errmsg = jsonObject.getString("errmsg"); + if(!StrUtil.equals(errcode,"0")){ + throw new BusinessException(errmsg); + } + this.userid = jsonObject.getString("userid"); + this.user_ticket = jsonObject.getString("user_ticket"); + this.openid = jsonObject.getString("openid"); + this.external_userid = jsonObject.getString("external_userid"); + System.out.println("获取用户信息成功 = " + jsonObject); + } + + public void getUserProfile(String userid, String access_token) { + String url = "https://qyapi.weixin.qq.com/cgi-bin/user/get?access_token="+ access_token +"&userid=" + userid; + String response = HttpUtil.get(url, CharsetUtil.CHARSET_UTF_8); + System.out.println("response3 = " + response); + JSONObject jsonObject = JSONObject.parseObject(response); + System.out.println("读取用户详细信息 = " + jsonObject); + + this.name = jsonObject.getString("name"); + this.position = jsonObject.getString("position"); + this.gender = jsonObject.getString("gender"); + this.email = jsonObject.getString("email"); + this.avatar = jsonObject.getString("avatar"); + this.thumb_avatar = jsonObject.getString("thumb_avatar"); + this.telephone = jsonObject.getString("telephone"); + this.address = jsonObject.getString("address"); + this.alias = jsonObject.getString("alias"); + this.qr_code = jsonObject.getString("qr_code"); + this.open_userid = jsonObject.getString("open_userid"); + } +} diff --git a/src/main/java/com/gxwebsoft/common/core/utils/WxWorkUtil.java b/src/main/java/com/gxwebsoft/common/core/utils/WxWorkUtil.java new file mode 100644 index 0000000..5a4e449 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/utils/WxWorkUtil.java @@ -0,0 +1,134 @@ +package com.gxwebsoft.common.core.utils; + +import cn.hutool.core.util.CharsetUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpUtil; +import com.alibaba.fastjson.JSONObject; +import com.gxwebsoft.common.core.exception.BusinessException; +import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import java.util.concurrent.TimeUnit; + +/** + * 企业微信工具类 + * @author 科技小王子 + * + */ +@Component +public class WxWorkUtil { + private final StringRedisTemplate stringRedisTemplate; + private Integer tenantId; + public String appId; + public String appSecret; + public String access_token; + public String expires_in; + public String nickname; + public String userid; + public String user_ticket; + public String openid; + public String external_userid; + public String name; + public String position; + public String mobile; + public String gender; + public String email; + public String avatar; + public String thumb_avatar; + public String telephone; + public String address; + public String alias; + public String qr_code; + public String open_userid; + + @Resource + private CacheClient cacheClient; + + + public WxWorkUtil(StringRedisTemplate stringRedisTemplate){ + this.stringRedisTemplate = stringRedisTemplate; + } + + + // 实例化客户端 + public WxWorkUtil client(Integer tenantId) { + this.tenantId = tenantId; + this.config(); + return this; + } + + // 开发者ID和秘钥 + private void config() { + JSONObject settingInfo = cacheClient.getSettingInfo("wx-work", this.tenantId); + if(settingInfo == null){ + throw new BusinessException("企业微信未配置"); + } + this.appId = settingInfo.getString("corpId"); + this.appSecret = settingInfo.getString("secret"); + System.out.println("this.appId = " + this.appId); + System.out.println("this.appSecret = " + this.appSecret); + } + + // 获取access_token + public void getAccessToken(String code) { + String key = "cache"+ this.tenantId +":ww:access_token"; + final String access_token = stringRedisTemplate.opsForValue().get(key); + if(access_token != null){ + this.getUserInfo(code,access_token); + }else { + String url = "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=" +this.appId+ "&corpsecret="+ this.appSecret; + System.out.println("url = " + url); + String response = HttpUtil.get(url, CharsetUtil.CHARSET_UTF_8); + System.out.println("response = " + response); + final JSONObject jsonObject = JSONObject.parseObject(response); + // 获取成功 + if(jsonObject.getString("access_token") != null){ + this.access_token = jsonObject.getString("access_token"); + this.expires_in = jsonObject.getString("expires_in"); + stringRedisTemplate.opsForValue().set(key,this.access_token,7000, TimeUnit.SECONDS); + System.out.println("获取access_token成功 = " + this.access_token); + this.getUserInfo(code,this.access_token); + } + } + } + + // 获取userinfo + public void getUserInfo(String code, String access_token) { + String url = "https://qyapi.weixin.qq.com/cgi-bin/auth/getuserinfo?access_token=" +access_token+ "&code=" + code; + System.out.println("url2 = " + url); + String response = HttpUtil.get(url, CharsetUtil.CHARSET_UTF_8); + System.out.println("response = " + response); + JSONObject jsonObject = JSONObject.parseObject(response); + final String errcode = jsonObject.getString("errcode"); + final String errmsg = jsonObject.getString("errmsg"); + if(!StrUtil.equals(errcode,"0")){ + throw new BusinessException(errmsg); + } + this.userid = jsonObject.getString("userid"); + this.user_ticket = jsonObject.getString("user_ticket"); + this.openid = jsonObject.getString("openid"); + this.external_userid = jsonObject.getString("external_userid"); + System.out.println("获取用户信息成功 = " + jsonObject); + } + + public void getUserProfile(String userid, String access_token) { + String url = "https://qyapi.weixin.qq.com/cgi-bin/user/get?access_token="+ access_token +"&userid=" + userid; + String response = HttpUtil.get(url, CharsetUtil.CHARSET_UTF_8); + System.out.println("response3 = " + response); + JSONObject jsonObject = JSONObject.parseObject(response); + System.out.println("读取用户详细信息 = " + jsonObject); + + this.name = jsonObject.getString("name"); + this.position = jsonObject.getString("position"); + this.gender = jsonObject.getString("gender"); + this.email = jsonObject.getString("email"); + this.avatar = jsonObject.getString("avatar"); + this.thumb_avatar = jsonObject.getString("thumb_avatar"); + this.telephone = jsonObject.getString("telephone"); + this.address = jsonObject.getString("address"); + this.alias = jsonObject.getString("alias"); + this.qr_code = jsonObject.getString("qr_code"); + this.open_userid = jsonObject.getString("open_userid"); + } +} diff --git a/src/main/java/com/gxwebsoft/common/core/web/ApiResult.java b/src/main/java/com/gxwebsoft/common/core/web/ApiResult.java new file mode 100644 index 0000000..0313839 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/web/ApiResult.java @@ -0,0 +1,87 @@ +package com.gxwebsoft.common.core.web; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.io.Serializable; + +/** + * 返回结果 + * + * @author WebSoft + * @since 2017-06-10 10:10:50 + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +public class ApiResult implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "状态码") + private Integer code; + + @Schema(description = "状态信息") + private String message; + + @Schema(description = "返回数据") + private T data; + + @Schema(description = "错误信息") + private String error; + + public ApiResult() {} + + public ApiResult(Integer code) { + this(code, null); + } + + public ApiResult(Integer code, String message) { + this(code, message, null); + } + + public ApiResult(Integer code, String message, T data) { + this(code, message, data, null); + } + + public ApiResult(Integer code, String message, T data, String error) { + setCode(code); + setMessage(message); + setData(data); + setError(error); + } + + public Integer getCode() { + return this.code; + } + + public ApiResult setCode(Integer code) { + this.code = code; + return this; + } + + public String getMessage() { + return this.message; + } + + public ApiResult setMessage(String message) { + this.message = message; + return this; + } + + public T getData() { + return this.data; + } + + public ApiResult setData(T data) { + this.data = data; + return this; + } + + public String getError() { + return this.error; + } + + public ApiResult setError(String error) { + this.error = error; + return this; + } + +} diff --git a/src/main/java/com/gxwebsoft/common/core/web/BaseController.java b/src/main/java/com/gxwebsoft/common/core/web/BaseController.java new file mode 100644 index 0000000..8c5f48d --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/web/BaseController.java @@ -0,0 +1,262 @@ +package com.gxwebsoft.common.core.web; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.core.Constants; +import com.gxwebsoft.common.core.exception.BusinessException; +import com.gxwebsoft.common.core.utils.RedisUtil; +import com.gxwebsoft.common.system.entity.Company; +import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.common.system.service.CompanyService; +import com.gxwebsoft.common.system.service.UserService; +import org.springframework.beans.propertyeditors.StringTrimmerEditor; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.util.CollectionUtils; +import org.springframework.web.bind.WebDataBinder; +import org.springframework.web.bind.annotation.InitBinder; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.List; + +/** + * Controller基类 + * + * @author WebSoft + * @since 2017-06-10 10:10:19 + */ +public class BaseController { + @Resource + private HttpServletRequest request; + @Resource + private UserService userService; + @Resource + private CompanyService companyService; + @Resource + private RedisUtil redisUtil; + + /** + * 获取当前登录的user + * + * @return User + */ + public User getLoginUser() { + try { + Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); + if (authentication != null) { + Object object = authentication.getPrincipal(); + if (object instanceof User) { + return (User) object; + } + } + } catch (Exception e) { + System.out.println(e.getMessage()); + } + return null; + } + + /** + * 获取当前登录的userId + * + * @return userId + */ + public Integer getLoginUserId() { + User loginUser = getLoginUser(); + return loginUser == null ? null : loginUser.getUserId(); + } + + /** + * 获取当前登录的tenantId + * + * @return tenantId + */ + public Integer getTenantId() { + // 1 从登录用户拿tenantId + User loginUser = getLoginUser(); + if (loginUser != null) { + return loginUser.getTenantId(); + } + // 2 从请求头拿ID + String tenantId = request.getHeader("tenantId"); + if(StrUtil.isNotBlank(tenantId)){ + return Integer.valueOf(tenantId); + } + // 3 从域名拿ID + String Domain = request.getHeader("Domain"); + if (StrUtil.isNotBlank(Domain)) { + String key = "Domain:" + Domain; + tenantId = redisUtil.get(key); + if(tenantId != null){ + System.out.println("从域名拿ID = " + tenantId); + return Integer.valueOf(tenantId); + } + } + return null; + } + + + /** + * 获取当前登录的企业信息 + * + * @return Company + */ + public Company getCompany() { + List list = companyService.list(new LambdaQueryWrapper().eq(Company::getAuthoritative, 1)); + if (!CollectionUtils.isEmpty(list)) { + final Company company = list.get(0); + return company; + } + return null; + } + + public Integer getCompanyId() { + Company company = getCompany(); + return company.getCompanyId(); + } + + /** + * 返回成功 + * + * @return ApiResult + */ + public ApiResult success() { + return new ApiResult<>(Constants.RESULT_OK_CODE, Constants.RESULT_OK_MSG); + } + + /** + * 返回成功 + * + * @param message 状态信息 + * @return ApiResult + */ + public ApiResult success(String message) { + return success().setMessage(message); + } + + /** + * 返回成功 + * + * @param data 返回数据 + * @return ApiResult + */ + public ApiResult success(T data) { + return new ApiResult<>(Constants.RESULT_OK_CODE, Constants.RESULT_OK_MSG, data); + } + + /** + * 返回成功 + * + * @param message 状态信息 + * @return ApiResult + */ + public ApiResult success(String message, T data) { + return success(data).setMessage(message); + } + + /** + * 返回分页查询数据 + * + * @param list 当前页数据 + * @param count 总数量 + * @return ApiResult + */ + public ApiResult> success(List list, Long count) { + return success(new PageResult<>(list, count)); + } + + /** + * 返回分页查询数据 + * + * @param iPage IPage + * @return ApiResult + */ + public ApiResult> success(IPage iPage) { + return success(iPage.getRecords(), iPage.getTotal()); + } + + /** + * 返回失败 + * + * @return ApiResult + */ + public ApiResult fail() { + return new ApiResult<>(Constants.RESULT_ERROR_CODE, Constants.RESULT_ERROR_MSG); + } + + /** + * 返回失败 + * + * @param message 状态信息 + * @return ApiResult + */ + public ApiResult fail(String message) { + return fail().setMessage(message); + } + + /** + * 返回失败 + * + * @param data 返回数据 + * @return ApiResult + */ + public ApiResult fail(T data) { + return fail(Constants.RESULT_ERROR_MSG, data); + } + + /** + * 返回失败 + * + * @param message 状态信息 + * @param data 返回数据 + * @return ApiResult + */ + public ApiResult fail(String message, T data) { + return new ApiResult<>(Constants.RESULT_ERROR_CODE, message, data); + } + + /** + * 请求参数的空字符串转为null + */ + @InitBinder + public void initBinder(WebDataBinder binder) { + binder.registerCustomEditor(String.class, new StringTrimmerEditor(true)); + } + + // 自定义函数 + public String getAuthorization() { + return request.getHeader("Authorization"); + } + + public String getSign() { + return request.getParameter("sign"); + } + + + + /** + * 根据账号|手机号码|邮箱查找用户ID + * + * @return userId + */ + public Integer getUserIdByUsername(String username, Integer tenantId) { + // 按账号搜素 + User user = userService.getOne(new LambdaQueryWrapper().eq(User::getUsername, username).eq(User::getTenantId, tenantId)); + if (user != null && user.getUserId() > 0) { + return user.getUserId(); + } + // 按手机号码搜索 + User userByPhone = userService.getOne(new LambdaQueryWrapper().eq(User::getPhone, username).eq(User::getTenantId, tenantId)); + if (userByPhone != null && userByPhone.getUserId() > 0) { + return userByPhone.getUserId(); + } + // 按邮箱搜索 + User userByEmail = userService.getOne(new LambdaQueryWrapper().eq(User::getEmail, username).eq(User::getTenantId, tenantId)); + if (userByEmail != null && userByEmail.getUserId() > 0) { + return userByEmail.getUserId(); + } + throw new BusinessException("找不到该用户"); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/core/web/BaseParam.java b/src/main/java/com/gxwebsoft/common/core/web/BaseParam.java new file mode 100644 index 0000000..59dcd59 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/web/BaseParam.java @@ -0,0 +1,98 @@ +package com.gxwebsoft.common.core.web; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.annotation.TableField; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.utils.CommonUtil; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 查询参数基本字段 + * + * @author WebSoft + * @since 2021-08-26 22:14:43 + */ +@Data +public class BaseParam implements Serializable { + private static final long serialVersionUID = 1L; + + @TableField(exist = false) + @Schema(description = "分页查询页码") + private Long page; + + @TableField(exist = false) + @Schema(description = "分页查询每页数量") + private Long limit; + + @Schema(description = "国际化语言") + @TableField(exist = false) + private String lang; + + @TableField(exist = false) + @Schema(description = "排序字段或sql, 如果是sql则order字段无用, 如: `id asc, name desc`") + private String sort; + + @TableField(exist = false) + @Schema(description = "sort是字段名称时对应的排序方式, asc升序, desc降序") + private String order; + + @QueryField(value = "create_time", type = QueryType.GE) + @TableField(exist = false) + @Schema(description = "创建时间起始值") + private String createTimeStart; + + @QueryField(value = "create_time", type = QueryType.LE) + @TableField(exist = false) + @Schema(description = "创建时间结束值") + private String createTimeEnd; + + @QueryField(value = "create_time", type = QueryType.GE) + @Schema(description = "搜索场景") + @TableField(exist = false) + private String sceneType; + + @Schema(description = "商户ID") + @TableField(exist = false) + private Long merchantId; + + @Schema(description = "租户ID") + @TableField(exist = false) + private Integer tenantId; + + @Schema(description = "模糊搜素") + @TableField(exist = false) + private String keywords; + + @Schema(description = "token") + @TableField(exist = false) + private String token; + + /** + * 获取集合中的第一条数据 + * + * @param records 集合 + * @return 第一条数据 + */ + public T getOne(List records) { + return CommonUtil.listGetOne(records); + } + + /** + * 国际化参数 + */ + public String getLang(){ + if(StrUtil.isBlank(this.lang)){ + return null; + } + if(this.lang.equals("zh")){ + return "zh_CN"; + } + return this.lang; + } + +} diff --git a/src/main/java/com/gxwebsoft/common/core/web/BatchParam.java b/src/main/java/com/gxwebsoft/common/core/web/BatchParam.java new file mode 100644 index 0000000..cc69572 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/web/BatchParam.java @@ -0,0 +1,57 @@ +package com.gxwebsoft.common.core.web; + +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; +import com.baomidou.mybatisplus.extension.service.IService; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 批量修改通用参数 + * + * @author WebSoft + * @since 2020-03-13 00:11:06 + */ +@Data +public class BatchParam implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "需要修改的数据id集合") + private List ids; + + @Schema(description = "需要修改的字段和值") + private T data; + + /** + * 通用批量修改方法 + * + * @param service IService + * @param idField id字段名称 + * @return boolean + */ + public boolean update(IService service, String idField) { + if (this.data == null) { + return false; + } + return service.update(this.data, new UpdateWrapper().in(idField, this.ids)); + } + + /** + * 通用批量修改方法 + * + * @param service IService + * @param idField id字段名称 + * @return boolean + */ + public boolean update(IService service, SFunction idField) { + if (this.data == null) { + return false; + } + return service.update(this.data, new LambdaUpdateWrapper().in(idField, this.ids)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/core/web/ExistenceParam.java b/src/main/java/com/gxwebsoft/common/core/web/ExistenceParam.java new file mode 100644 index 0000000..8c51268 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/web/ExistenceParam.java @@ -0,0 +1,96 @@ +package com.gxwebsoft.common.core.web; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; +import com.baomidou.mybatisplus.extension.service.IService; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * 检查是否存在通用参数 + * + * @author WebSoft + * @since 2021-09-07 22:24:39 + */ +@Data +public class ExistenceParam implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "检查的字段") + private String field; + + @Schema(description = "字段的值") + private String value; + + @Schema(description = "修改时的主键") + private Integer id; + + /** + * 检查是否存在 + * + * @param service IService + * @param idField 修改时的主键字段 + * @return boolean + */ + public boolean isExistence(IService service, String idField) { + return isExistence(service, idField, true); + } + + /** + * 检查是否存在 + * + * @param service IService + * @param idField 修改时的主键字段 + * @param isToUnderlineCase 是否需要把field转为下划线格式 + * @return boolean + */ + public boolean isExistence(IService service, String idField, boolean isToUnderlineCase) { + if (StrUtil.hasBlank(this.field, this.value)) { + return false; + } + String fieldName = isToUnderlineCase ? StrUtil.toUnderlineCase(field) : field; + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(fieldName, value); + if (id != null) { + wrapper.ne(idField, id); + } + return service.count(wrapper) > 0; + } + + /** + * 检查是否存在 + * + * @param service IService + * @param idField 修改时的主键字段 + * @return boolean + */ + public boolean isExistence(IService service, SFunction idField) { + return isExistence(service, idField, true); + } + + /** + * 检查是否存在 + * + * @param service IService + * @param idField 修改时的主键字段 + * @param isToUnderlineCase 是否需要把field转为下划线格式 + * @return boolean + */ + public boolean isExistence(IService service, SFunction idField, boolean isToUnderlineCase) { + if (StrUtil.hasBlank(this.field, this.value)) { + return false; + } + String fieldName = isToUnderlineCase ? StrUtil.toUnderlineCase(field) : field; + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.apply(fieldName + " = {0}", value); + if (id != null) { + wrapper.ne(idField, id); + } + return service.count(wrapper) > 0; + } + +} diff --git a/src/main/java/com/gxwebsoft/common/core/web/PageParam.java b/src/main/java/com/gxwebsoft/common/core/web/PageParam.java new file mode 100644 index 0000000..596ea58 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/web/PageParam.java @@ -0,0 +1,343 @@ +package com.gxwebsoft.common.core.web; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.ReflectUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gxwebsoft.common.core.Constants; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.utils.CommonUtil; + +import java.lang.reflect.Field; +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * 分页、排序、搜索参数封装 + * + * @author WebSoft + * @since 2019-04-26 10:34:35 + */ +public class PageParam extends Page { + private static final long serialVersionUID = 1L; + + /** + * 租户id字段名称 + */ + private static final String TENANT_ID_FIELD = "tenantId"; + + /** + * 查询条件 + */ + private final U where; + + /** + * 是否把字段名称驼峰转下划线 + */ + private final boolean isToUnderlineCase; + + public PageParam() { + this(null); + } + + public PageParam(U where) { + this(where, true); + } + + public PageParam(U where, boolean isToUnderlineCase) { + super(); + this.where = where; + this.isToUnderlineCase = isToUnderlineCase; + if (where != null) { + // 获取分页页码 + if (where.getPage() != null) { + setCurrent(where.getPage()); + } + // 获取分页每页数量 + if (where.getLimit() != null) { + setSize(where.getLimit()); + } + // 获取排序方式 + if (where.getSort() != null) { + if (sortIsSQL(where.getSort())) { + setOrders(parseOrderSQL(where.getSort())); + } else { + List orderItems = new ArrayList<>(); + String column = this.isToUnderlineCase ? StrUtil.toUnderlineCase(where.getSort()) : where.getSort(); + boolean asc = !Constants.ORDER_DESC_VALUE.equals(where.getOrder()); + orderItems.add(new OrderItem(column, asc)); + setOrders(orderItems); + } + } + } + } + + /** + * 排序字段是否是sql + */ + private boolean sortIsSQL(String sort) { + return sort != null && (sort.contains(",") || sort.trim().contains(" ")); + } + + /** + * 解析排序sql + */ + private List parseOrderSQL(String orderSQL) { + List orders = new ArrayList<>(); + if (StrUtil.isNotBlank(orderSQL)) { + for (String item : orderSQL.split(",")) { + String[] temp = item.trim().split(" "); + if (!temp[0].isEmpty()) { + String column = this.isToUnderlineCase ? StrUtil.toUnderlineCase(temp[0]) : temp[0]; + boolean asc = temp.length == 1 || !temp[temp.length - 1].equals(Constants.ORDER_DESC_VALUE); + orders.add(new OrderItem(column, asc)); + } + } + } + return orders; + } + + /** + * 设置默认排序方式 + * + * @param orderItems 排序方式 + * @return PageParam + */ + public PageParam setDefaultOrder(List orderItems) { + if (orders() == null || orders().size() == 0) { + setOrders(orderItems); + } + return this; + } + + /** + * 设置默认排序方式 + * + * @param orderSQL 排序方式 + * @return PageParam + */ + public PageParam setDefaultOrder(String orderSQL) { + setDefaultOrder(parseOrderSQL(orderSQL)); + return this; + } + + /** + * 获取查询条件 + * + * @param excludes 不包含的字段 + * @return QueryWrapper + */ + public QueryWrapper getWrapper(String... excludes) { + return buildWrapper(null, Arrays.asList(excludes)); + } + + /** + * 获取查询条件 + * + * @param columns 只包含的字段 + * @return QueryWrapper + */ + public QueryWrapper getWrapperWith(String... columns) { + return buildWrapper(Arrays.asList(columns), null); + } + + /** + * 构建QueryWrapper + * + * @param columns 包含的字段 + * @param excludes 排除的字段 + * @return QueryWrapper + */ + private QueryWrapper buildWrapper(List columns, List excludes) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + Map map = BeanUtil.beanToMap(where, false, true); + for (String fieldName : map.keySet()) { + Object fieldValue = map.get(fieldName); + Field field = ReflectUtil.getField(where.getClass(), fieldName); + + // 过滤不包含的字段 + if (columns != null && !columns.contains(fieldName)) { + continue; + } + + // 过滤排除的字段 + if (excludes != null && excludes.contains(fieldName)) { + continue; + } + + // 过滤逻辑删除字段 + if (field.getAnnotation(TableLogic.class) != null) { + continue; + } + + // 过滤租户id字段 + if (fieldName.equals(TENANT_ID_FIELD)) { + continue; + } + + // 获取注解指定的查询字段及查询方式 + QueryType queryType = QueryType.LIKE; + QueryField queryField = field.getAnnotation(QueryField.class); + if (queryField != null) { + if (StrUtil.isNotEmpty(queryField.value())) { + fieldName = queryField.value(); + } + if (queryField.type() != null) { + queryType = queryField.type(); + } + } else { + // 过滤非本表的字段 + TableField tableField = field.getAnnotation(TableField.class); + if (tableField != null && !tableField.exist()) { + continue; + } + } + + // 字段名驼峰转下划线 + if (this.isToUnderlineCase) { + fieldName = StrUtil.toUnderlineCase(fieldName); + } + + // + switch (queryType) { + case EQ: + queryWrapper.eq(fieldName, fieldValue); + break; + case NE: + queryWrapper.ne(fieldName, fieldValue); + break; + case GT: + queryWrapper.gt(fieldName, fieldValue); + break; + case GE: + queryWrapper.ge(fieldName, fieldValue); + break; + case LT: + queryWrapper.lt(fieldName, fieldValue); + break; + case LE: + queryWrapper.le(fieldName, fieldValue); + break; + case LIKE: + queryWrapper.like(fieldName, fieldValue); + break; + case NOT_LIKE: + queryWrapper.notLike(fieldName, fieldValue); + break; + case LIKE_LEFT: + queryWrapper.likeLeft(fieldName, fieldValue); + break; + case LIKE_RIGHT: + queryWrapper.likeRight(fieldName, fieldValue); + break; + case IS_NULL: + queryWrapper.isNull(fieldName); + break; + case IS_NOT_NULL: + queryWrapper.isNotNull(fieldName); + break; + case IN: + queryWrapper.in(fieldName, fieldValue); + break; + case NOT_IN: + queryWrapper.notIn(fieldName, fieldValue); + break; + case IN_STR: + if (fieldValue instanceof String) { + queryWrapper.in(fieldName, Arrays.asList(((String) fieldValue).split(","))); + } + break; + case NOT_IN_STR: + if (fieldValue instanceof String) { + queryWrapper.notIn(fieldName, Arrays.asList(((String) fieldValue).split(","))); + } + break; + } + } + return queryWrapper; + } + + /** + * 获取包含排序的查询条件 + * + * @return 包含排序的QueryWrapper + */ + public QueryWrapper getOrderWrapper() { + return getOrderWrapper(getWrapper()); + } + + /** + * 获取包含排序的查询条件 + * + * @param queryWrapper 不含排序的QueryWrapper + * @return 包含排序的QueryWrapper + */ + public QueryWrapper getOrderWrapper(QueryWrapper queryWrapper) { + if (queryWrapper == null) { + queryWrapper = new QueryWrapper<>(); + } + for (OrderItem orderItem : orders()) { + if (orderItem.isAsc()) { + queryWrapper.orderByAsc(orderItem.getColumn()); + } else { + queryWrapper.orderByDesc(orderItem.getColumn()); + } + } + return queryWrapper; + } + + /** + * 获取集合中的第一条数据 + * + * @param records 集合 + * @return 第一条数据 + */ + public T getOne(List records) { + return CommonUtil.listGetOne(records); + } + + /** + * 代码排序集合 + * + * @param records 集合 + * @return 排序后的集合 + */ + public List sortRecords(List records) { + List orderItems = orders(); + if (records == null || records.size() < 2 || orderItems == null || orderItems.size() == 0) { + return records; + } + Comparator comparator = null; + for (OrderItem item : orderItems) { + if (item.getColumn() == null) { + continue; + } + String field = this.isToUnderlineCase ? StrUtil.toCamelCase(item.getColumn()) : item.getColumn(); + Function keyExtractor = t -> ReflectUtil.getFieldValue(t, field); + if (comparator == null) { + if (item.isAsc()) { + comparator = Comparator.comparing(keyExtractor); + } else { + comparator = Comparator.comparing(keyExtractor, Comparator.reverseOrder()); + } + } else { + if (item.isAsc()) { + comparator.thenComparing(keyExtractor); + } else { + comparator.thenComparing(keyExtractor, Comparator.reverseOrder()); + } + } + } + if (comparator != null) { + return records.stream().sorted(comparator).collect(Collectors.toList()); + } + return records; + } + +} diff --git a/src/main/java/com/gxwebsoft/common/core/web/PageResult.java b/src/main/java/com/gxwebsoft/common/core/web/PageResult.java new file mode 100644 index 0000000..a9bc057 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/web/PageResult.java @@ -0,0 +1,51 @@ +package com.gxwebsoft.common.core.web; + +import io.swagger.v3.oas.annotations.media.Schema; + +import java.io.Serializable; +import java.util.List; + +/** + * 分页查询返回结果 + * + * @author WebSoft + * @since 2017-06-10 10:10:02 + */ +public class PageResult implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "当前页数据") + private List list; + + @Schema(description = "总数量") + private Long count; + + public PageResult() { + } + + public PageResult(List list) { + this(list, null); + } + + public PageResult(List list, Long count) { + setList(list); + setCount(count); + } + + public List getList() { + return this.list; + } + + public void setList(List list) { + this.list = list; + } + + public Long getCount() { + return this.count; + } + + public void setCount(Long count) { + this.count = count; + } + +} diff --git a/src/main/java/com/gxwebsoft/common/mq/config/RabbitMQConfig.java b/src/main/java/com/gxwebsoft/common/mq/config/RabbitMQConfig.java new file mode 100644 index 0000000..9806753 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/mq/config/RabbitMQConfig.java @@ -0,0 +1,145 @@ +package com.gxwebsoft.common.mq.config; + +import com.fasterxml.jackson.databind.ObjectMapper; +import org.springframework.amqp.core.DirectExchange; +import org.springframework.amqp.core.TopicExchange; +import org.springframework.amqp.core.Queue; +import org.springframework.amqp.core.QueueBuilder; +import org.springframework.amqp.core.Binding; +import org.springframework.amqp.core.BindingBuilder; +import org.springframework.amqp.core.AcknowledgeMode; +import org.springframework.amqp.rabbit.config.SimpleRabbitListenerContainerFactory; +import org.springframework.amqp.rabbit.connection.CachingConnectionFactory; +import org.springframework.amqp.rabbit.connection.ConnectionFactory; +import org.springframework.amqp.rabbit.core.RabbitTemplate; +import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter; +import org.springframework.amqp.support.converter.MessageConverter; +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; + +/** + * RabbitMQ 配置类 + */ +@Configuration +@ConditionalOnProperty(name = "sync.mq.enabled", havingValue = "true", matchIfMissing = true) +public class RabbitMQConfig { + + // ==================== 常量定义 ==================== + public static final String SYNC_EXCHANGE = "sync.topic.exchange"; + public static final String SYNC_QUEUE = "sync.queue"; + public static final String SYNC_ROUTING_KEY = "sync.message"; + + // 死信队列 + public static final String DLX_EXCHANGE = "sync.dlx.exchange"; + public static final String DLQ_QUEUE = "sync.dlq"; + public static final String DLQ_ROUTING_KEY = "sync.dlq"; + + @Value("${spring.rabbitmq.host:localhost}") + private String host; + + @Value("${spring.rabbitmq.port:5672}") + private int port; + + @Value("${spring.rabbitmq.username:guest}") + private String username; + + @Value("${spring.rabbitmq.password:guest}") + private String password; + + @Value("${spring.rabbitmq.virtual-host:/}") + private String virtualHost; + + // ==================== Connection Factory ==================== + + @Bean + public ConnectionFactory connectionFactory() { + CachingConnectionFactory connectionFactory = new CachingConnectionFactory(); + connectionFactory.setHost(host); + connectionFactory.setPort(port); + connectionFactory.setUsername(username); + connectionFactory.setPassword(password); + connectionFactory.setVirtualHost(virtualHost); + // 开启publisher-confirm确认模式 + connectionFactory.setPublisherConfirmType(CachingConnectionFactory.ConfirmType.CORRELATED); + // 开启publisher-return确认模式 + connectionFactory.setPublisherReturns(true); + return connectionFactory; + } + + // ==================== Message Converter ==================== + + @Bean + public MessageConverter messageConverter(ObjectMapper objectMapper) { + return new Jackson2JsonMessageConverter(objectMapper); + } + + // ==================== RabbitTemplate ==================== + + @Bean + public RabbitTemplate rabbitTemplate(ConnectionFactory connectionFactory, MessageConverter messageConverter) { + RabbitTemplate rabbitTemplate = new RabbitTemplate(connectionFactory); + rabbitTemplate.setMessageConverter(messageConverter); + // 设置Mandatory为true,才能触发ReturnCallback + rabbitTemplate.setMandatory(true); + return rabbitTemplate; + } + + @Bean + public SimpleRabbitListenerContainerFactory rabbitListenerContainerFactory( + ConnectionFactory connectionFactory, MessageConverter messageConverter) { + SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory(); + factory.setConnectionFactory(connectionFactory); + factory.setMessageConverter(messageConverter); + // 设置并发数 + factory.setConcurrentConsumers(1); + factory.setMaxConcurrentConsumers(5); + // 设置手动ack + factory.setAcknowledgeMode(AcknowledgeMode.MANUAL); + // 预取数量 + factory.setPrefetchCount(10); + return factory; + } + + // ==================== 交换机 ==================== + + /** + * 用户同步 Topic Exchange + * 使用 Topic 类型,支持按 targetSystem 路由到不同队列 + * routing key 格式: user.sync.{targetSystem} + * 各子系统可以绑定自己的队列来消费消息 + */ + @Bean + public TopicExchange syncExchange() { + return new TopicExchange(SYNC_EXCHANGE, true, false); + } + + @Bean + public DirectExchange deadLetterExchange() { + return new DirectExchange(DLX_EXCHANGE, true, false); + } + + // ==================== 队列 ==================== + + /** + * 注意:core 系统只负责发送消息,不消费消息 + * 各子系统(websopy等)需要在自己的系统中配置消费者和队列 + * + * 如果 core 系统也需要消费某些消息,可以在这里添加对应的队列 + */ + + @Bean + public Queue deadLetterQueue() { + return QueueBuilder.durable(DLQ_QUEUE).build(); + } + + // ==================== 绑定 ==================== + + @Bean + public Binding dlqBinding() { + return BindingBuilder.bind(deadLetterQueue()) + .to(deadLetterExchange()) + .with(DLQ_ROUTING_KEY); + } +} diff --git a/src/main/java/com/gxwebsoft/common/mq/message/SyncMessage.java b/src/main/java/com/gxwebsoft/common/mq/message/SyncMessage.java new file mode 100644 index 0000000..e141025 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/mq/message/SyncMessage.java @@ -0,0 +1,80 @@ +package com.gxwebsoft.common.mq.message; + +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Map; + +/** + * 统一消息实体 - 用于各模块间的数据同步 + */ +@Data +public class SyncMessage implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 消息唯一ID + */ + private String messageId; + + /** + * 消息类型:USER_SYNC, TENANT_SYNC, etc. + */ + private String messageType; + + /** + * 事件类型:CREATE, UPDATE, DELETE + */ + private String eventType; + + /** + * 目标系统标识 + */ + private String targetSystem; + + /** + * 业务数据(Map格式,便于序列化) + */ + private Map data; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 消息重试次数 + */ + private Integer retryCount; + + public SyncMessage() { + this.createTime = LocalDateTime.now(); + this.retryCount = 0; + } + + public SyncMessage(String messageType, String eventType, String targetSystem, Map data) { + this(); + this.messageId = java.util.UUID.randomUUID().toString().replace("-", ""); + this.messageType = messageType; + this.eventType = eventType; + this.targetSystem = targetSystem; + this.data = data; + } + + /** + * 创建用户同步消息 + */ + public static SyncMessage userCreate(String targetSystem, Map userData) { + return new SyncMessage("USER_SYNC", "CREATE", targetSystem, userData); + } + + public static SyncMessage userUpdate(String targetSystem, Map userData) { + return new SyncMessage("USER_SYNC", "UPDATE", targetSystem, userData); + } + + public static SyncMessage userDelete(String targetSystem, Map userData) { + return new SyncMessage("USER_SYNC", "DELETE", targetSystem, userData); + } +} diff --git a/src/main/java/com/gxwebsoft/common/mq/producer/SyncMessageProducer.java b/src/main/java/com/gxwebsoft/common/mq/producer/SyncMessageProducer.java new file mode 100644 index 0000000..49db5b2 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/mq/producer/SyncMessageProducer.java @@ -0,0 +1,41 @@ +package com.gxwebsoft.common.mq.producer; + +import com.gxwebsoft.common.mq.message.SyncMessage; + +/** + * 消息生产者接口 - 预留抽象层,便于将来切换MQ实现(如从RabbitMQ迁移到RocketMQ) + */ +public interface SyncMessageProducer { + + /** + * 发送同步消息 + * + * @param message 消息体 + */ + void sendSyncMessage(SyncMessage message); + + /** + * 发送同步消息(带回调) + * + * @param message 消息体 + * @param callback 发送回调 + */ + void sendSyncMessage(SyncMessage message, SendCallback callback); + + /** + * 发送用户同步消息 + * + * @param targetSystem 目标系统 + * @param eventType 事件类型:CREATE, UPDATE, DELETE + * @param userData 用户数据 + */ + void sendUserSyncMessage(String targetSystem, String eventType, Object userData); + + /** + * 发送回调接口 + */ + interface SendCallback { + void onSuccess(String messageId); + void onFailure(String messageId, Throwable throwable); + } +} diff --git a/src/main/java/com/gxwebsoft/common/mq/producer/impl/RabbitMQSyncProducer.java b/src/main/java/com/gxwebsoft/common/mq/producer/impl/RabbitMQSyncProducer.java new file mode 100644 index 0000000..5aff9ad --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/mq/producer/impl/RabbitMQSyncProducer.java @@ -0,0 +1,141 @@ +package com.gxwebsoft.common.mq.producer.impl; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.gxwebsoft.common.mq.config.RabbitMQConfig; +import com.gxwebsoft.common.mq.message.SyncMessage; +import com.gxwebsoft.common.mq.producer.SyncMessageProducer; +import lombok.extern.slf4j.Slf4j; +import org.springframework.amqp.core.Message; +import org.springframework.amqp.core.MessageProperties; +import org.springframework.amqp.rabbit.connection.CorrelationData; +import org.springframework.amqp.rabbit.core.RabbitTemplate; +import org.springframework.amqp.support.converter.MessageConverter; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.stereotype.Component; + + +import java.util.HashMap; +import java.util.Map; + +/** + * RabbitMQ 消息生产者实现 + */ +@Slf4j +@Component +@ConditionalOnProperty(name = "sync.mq.enabled", havingValue = "true", matchIfMissing = true) +public class RabbitMQSyncProducer implements SyncMessageProducer, RabbitTemplate.ConfirmCallback, RabbitTemplate.ReturnCallback { + + private final RabbitTemplate rabbitTemplate; + private final MessageConverter messageConverter; + private final ObjectMapper objectMapper; + + public RabbitMQSyncProducer(RabbitTemplate rabbitTemplate, MessageConverter messageConverter, ObjectMapper objectMapper) { + this.rabbitTemplate = rabbitTemplate; + this.messageConverter = messageConverter; + this.objectMapper = objectMapper; + // 设置确认回调 + this.rabbitTemplate.setConfirmCallback(this); + this.rabbitTemplate.setReturnCallback(this); + } + + @Override + public void sendSyncMessage(SyncMessage message) { + sendSyncMessage(message, null); + } + + @Override + public void sendSyncMessage(SyncMessage message, SendCallback callback) { + try { + log.info("发送MQ消息: messageId={}, type={}, event={}, target={}", + message.getMessageId(), message.getMessageType(), + message.getEventType(), message.getTargetSystem()); + + CorrelationData correlationData = new CorrelationData(message.getMessageId()); + + if (callback != null) { + correlationData.getFuture().addCallback( + result -> { + if (result.isAck()) { + callback.onSuccess(message.getMessageId()); + } else { + callback.onFailure(message.getMessageId(), + new RuntimeException("消息发送未被确认")); + } + }, + ex -> callback.onFailure(message.getMessageId(), ex) + ); + } + + // 使用 targetSystem 作为 routing key + // 格式: user.sync.{targetSystem} + // 各子系统绑定队列时使用 pattern: user.sync.{systemName} + String routingKey = buildRoutingKey(message.getTargetSystem()); + + rabbitTemplate.convertAndSend( + RabbitMQConfig.SYNC_EXCHANGE, + routingKey, + message, + correlationData + ); + + } catch (Exception e) { + log.error("发送MQ消息失败: messageId={}, error={}", message.getMessageId(), e.getMessage(), e); + if (callback != null) { + callback.onFailure(message.getMessageId(), e); + } + } + } + + /** + * 构建 routing key + * 格式: user.sync.{targetSystem} + */ + private String buildRoutingKey(String targetSystem) { + if (targetSystem == null || targetSystem.isEmpty()) { + return "user.sync.all"; + } + return "user.sync." + targetSystem.toLowerCase(); + } + + @Override + public void sendUserSyncMessage(String targetSystem, String eventType, Object userData) { + try { + Map dataMap; + if (userData instanceof Map) { + dataMap = (Map) userData; + } else { + // 转换为Map + dataMap = objectMapper.convertValue(userData, Map.class); + } + + SyncMessage message = new SyncMessage("USER_SYNC", eventType, targetSystem, dataMap); + sendSyncMessage(message); + } catch (Exception e) { + log.error("发送用户同步消息失败: targetSystem={}, eventType={}, error={}", + targetSystem, eventType, e.getMessage(), e); + } + } + + /** + * 确认回调 - Broker确认收到消息 + */ + @Override + public void confirm(CorrelationData correlationData, boolean ack, String cause) { + String messageId = correlationData.getId(); + if (ack) { + log.debug("消息确认成功: messageId={}", messageId); + } else { + log.warn("消息确认失败: messageId={}, cause={}", messageId, cause); + } + } + + /** + * Return回调 - 消息无法路由时回调 + */ + @Override + public void returnedMessage(Message message, int replyCode, String replyText, + String exchange, String routingKey) { + log.error("消息无法路由: exchange={}, routingKey={}, replyCode={}, replyText={}", + exchange, routingKey, replyCode, replyText); + } +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/AccessKeyController.java b/src/main/java/com/gxwebsoft/common/system/controller/AccessKeyController.java new file mode 100644 index 0000000..59339f1 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/AccessKeyController.java @@ -0,0 +1,177 @@ +package com.gxwebsoft.common.system.controller; + +import cn.hutool.core.util.StrUtil; +import com.gxwebsoft.common.core.annotation.OperationLog; +import com.gxwebsoft.common.core.utils.CacheClient; +import com.gxwebsoft.common.core.utils.CommonUtil; +import com.gxwebsoft.common.core.utils.RedisUtil; +import com.gxwebsoft.common.core.web.*; +import com.gxwebsoft.common.system.entity.AccessKey; +import com.gxwebsoft.common.system.param.AccessKeyParam; +import com.gxwebsoft.common.system.service.AccessKeyService; +import io.swagger.v3.oas.annotations.tags.Tag; + +import java.util.concurrent.TimeUnit; + +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Random; + +import static com.gxwebsoft.common.core.constants.WebsiteConstants.CACHE_KEY_VERIFICATION_CODE_BY_DEV_SMS; + +/** + * 访问凭证管理控制器 + * + * @author 科技小王子 + * @since 2023-05-16 19:19:55 + */ +@Tag(name = "安全访问凭证") +@RestController +@RequestMapping("/api/system/access-key") +public class AccessKeyController extends BaseController { + @Resource + private AccessKeyService accessKeyService; + @Resource + private CacheClient cacheClient; + @Resource + private RedisUtil redisUtil; + + @PreAuthorize("hasAuthority('sys:accessKey:list')") + @OperationLog + @Operation(summary = "分页查询访问凭证") + @GetMapping("/page") + public ApiResult> page(AccessKeyParam param) { + // 使用关联查询 + final PageResult accessKeyPageResult = accessKeyService.pageRel(param); + if (param.getCode() != null) { + // 短信验证码校验 + final String code = param.getCode(); + // 验证码校验 + String key = "code:" + param.getPhone(); + if (!code.equals(redisUtil.get(key)) && !redisUtil.get(CACHE_KEY_VERIFICATION_CODE_BY_DEV_SMS).equals(code)) { + String message = "验证码不正确"; + return fail(message, null); + } + return success(accessKeyPageResult); + } + // 默认不给查看AccessSecret + accessKeyPageResult.getList().forEach(d -> { + d.setAccessSecret(null); + }); + return success(accessKeyPageResult); + } + + @PreAuthorize("hasAuthority('sys:accessKey:list')") + @OperationLog + @Operation(summary = "查询全部访问凭证管理") + @GetMapping() + public ApiResult> list(AccessKeyParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + return success(accessKeyService.list(page.getOrderWrapper())); + // 使用关联查询 + //return success(accessKeyService.listRel(param)); + } + + @PreAuthorize("hasAuthority('sys:accessKey:list')") + @OperationLog + @Operation(summary = "根据id查询访问凭证管理") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + return success(accessKeyService.getById(id)); + // 使用关联查询 + //return success(accessKeyService.getByIdRel(id)); + } + + @PreAuthorize("hasAuthority('sys:accessKey:list')") + @OperationLog + @Operation(summary = "添加访问凭证管理") + @PostMapping() + public ApiResult save(@RequestBody AccessKey accessKey) { + final int count = accessKeyService.count(); + if (count >= 5) { + return fail("当前账号只能绑定 5 个 AccessKey"); + } + if(accessKey.getAccessKey() == null){ + accessKey.setAccessKey(CommonUtil.randomUUID16()); + } + accessKey.setAccessSecret("sk-" + CommonUtil.randomUUID16().concat(CommonUtil.randomUUID16())); + if (accessKeyService.save(accessKey)) { + return success("创建成功", accessKey); + } + return fail("创建失败"); + } + + @PreAuthorize("hasAuthority('sys:accessKey:update')") + @OperationLog + @Operation(summary = "修改访问凭证管理") + @PutMapping() + public ApiResult update(@RequestBody AccessKey accessKey) { + if (accessKeyService.updateById(accessKey)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:accessKey:remove')") + @OperationLog + @Operation(summary = "删除访问凭证管理") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (accessKeyService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:accessKey:save')") + @OperationLog + @Operation(summary = "批量添加访问凭证管理") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (accessKeyService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:accessKey:update')") + @OperationLog + @Operation(summary = "批量修改访问凭证管理") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(accessKeyService, "id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:accessKey:remove')") + @OperationLog + @Operation(summary = "批量删除访问凭证管理") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (accessKeyService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:accessKey:resetSMSCode')") + @OperationLog + @Operation(summary = "重置万能短信验证码") + @PostMapping("/resetSMSCode") + public ApiResult resetSMSCode() { + // 生成短信验证码 + Random randObj = new Random(); + String code = Integer.toString(100000 + randObj.nextInt(900000)); + redisUtil.set(CACHE_KEY_VERIFICATION_CODE_BY_DEV_SMS, code, 5L, TimeUnit.MINUTES); + return success("新验证码:".concat(code)); + } + + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/AliOssController.java b/src/main/java/com/gxwebsoft/common/system/controller/AliOssController.java new file mode 100644 index 0000000..f9b5e32 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/AliOssController.java @@ -0,0 +1,294 @@ +package com.gxwebsoft.common.system.controller; + +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; +import com.aliyun.oss.ClientException; +import com.aliyun.oss.OSS; +import com.aliyun.oss.OSSClientBuilder; +import com.aliyun.oss.OSSException; +import com.aliyun.oss.common.auth.CredentialsProvider; +import com.aliyun.oss.common.auth.DefaultCredentialProvider; +import com.aliyun.oss.common.utils.BinaryUtil; +import com.aliyun.oss.model.PolicyConditions; +import com.aliyun.oss.model.PutObjectRequest; +import com.aliyun.oss.model.PutObjectResult; +import com.aliyuncs.DefaultAcsClient; +import com.aliyuncs.auth.sts.AssumeRoleRequest; +import com.aliyuncs.auth.sts.AssumeRoleResponse; +import com.aliyuncs.http.MethodType; +import com.aliyuncs.profile.DefaultProfile; +import com.aliyuncs.profile.IClientProfile; +import com.gxwebsoft.common.core.annotation.OperationLog; +import com.gxwebsoft.common.core.config.ConfigProperties; +import com.gxwebsoft.common.core.utils.FileServerUtil; +import com.gxwebsoft.common.core.utils.RedisUtil; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.system.entity.Company; +import com.gxwebsoft.common.system.entity.FileRecord; +import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.common.system.service.CompanyService; +import com.gxwebsoft.common.system.service.FileRecordService; +import com.gxwebsoft.common.system.service.SettingService; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.io.File; +import java.nio.charset.StandardCharsets; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +/** + * 阿里云OSS云存储 + * + * @author WebSoft + * @since 2022-11-19 13:54:27 + */ +@Tag(name = "阿里云OSS") +@RestController +@RequestMapping("/api/oss") +public class AliOssController extends BaseController { + @Resource + private ConfigProperties config; + @Resource + private RedisUtil redisUtil; + @Resource + private FileRecordService fileRecordService; + @Resource + private CompanyService companyService; + @Resource + private SettingService settingService; + + @Operation(summary = "上传文件") + @PostMapping("/upload") + public ApiResult upload(@RequestParam MultipartFile file, HttpServletRequest request) throws Exception{ + // 获取租户ID + String tenantId = request.getHeader("TenantId"); + String companyId = request.getHeader("CompanyId"); + String merchantId = request.getHeader("MerchantId"); + String groupId = request.getHeader("GroupId"); + String appId = request.getHeader("AppId"); + if(StrUtil.isBlank(tenantId)){ + return fail("传参错误",null); + } + + // 读取配置信息 + JSONObject settingInfo; + String key3 = "Upload:" + tenantId; + settingInfo = redisUtil.get(key3, JSONObject.class); + if (ObjectUtil.isEmpty(settingInfo)) { + settingInfo = settingService.getBySettingKey("upload"); + if (ObjectUtil.isNotEmpty(settingInfo)) { + redisUtil.set(key3,settingInfo); + }else { + return fail("请先配置云存储",null); + } + } + String endpoint = settingInfo.getString("bucketEndpoint"); + String bucketDomain = settingInfo.getString("bucketDomain"); + String bucketName = settingInfo.getString("bucketName"); + String accessKeyId = settingInfo.getString("accessKeyId"); + String accessKeySecret = settingInfo.getString("accessKeySecret"); + + // 判断是否登录 + String authorization = getAuthorization(); + + // 判断存储空间是否已满 + String key = "StorageIsFull:" + tenantId; + String storageIsFull = redisUtil.get(key); + if(StrUtil.isNotBlank(storageIsFull)){ + // 使用自定义云存储不限制 + if(bucketName.equals("oss-gxwebsoft")){ + return fail("存储空间已满", null); + } + } + + // 上传文件结果 + FileRecord result; + CredentialsProvider credentialsProvider = new DefaultCredentialProvider(accessKeyId, accessKeySecret); + // 创建OSSClient实例。 + OSS ossClient = new OSSClientBuilder().build(endpoint, credentialsProvider); + + try { + + String dir = getUploadDir(); + File upload = FileServerUtil.upload(file, dir, config.getUploadUuidName()); + String path = upload.getAbsolutePath().replace("\\", "/").substring(dir.length()); + String originalName = file.getOriginalFilename(); + + // 创建PutObjectRequest对象。 + PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, path, upload); + // 如果需要上传时设置存储类型和访问权限,请参考以下示例代码。 + // ObjectMetadata metadata = new ObjectMetadata(); + // metadata.setHeader(OSSHeaders.OSS_STORAGE_CLASS, StorageClass.Standard.toString()); + // metadata.setObjectAcl(CannedAccessControlList.Private); + // putObjectRequest.setMetadata(metadata); + + // 上传文件。 + PutObjectResult ossResult = ossClient.putObject(putObjectRequest); + + // 保存记录并返回 + result = new FileRecord(); + if(StrUtil.isNotBlank(authorization)){ + result.setCreateUserId(getLoginUserId()); + } + if(StrUtil.isNotBlank(companyId)){ + result.setCompanyId(Integer.valueOf(companyId)); + } + if(StrUtil.isNotBlank(merchantId)){ + result.setMerchantId(Long.valueOf(merchantId)); + } + if(StrUtil.isNotBlank(groupId)){ + result.setGroupId(Integer.valueOf(groupId)); + } + if(StrUtil.isNotBlank(appId)){ + result.setAppId(Integer.valueOf(appId)); + } + path = "/".concat(path); + result.setName(StrUtil.isBlank(originalName) ? upload.getName() : originalName); + result.setLength(upload.length()); + result.setPath(bucketDomain + path); + result.setThumbnail(bucketDomain + path + "?x-oss-process=image/resize,m_fixed,w_100,h_100/quality,Q_90"); + result.setUrl(bucketDomain + path + "?x-oss-process=image/resize,w_750/quality,Q_90"); + result.setDownloadUrl(bucketDomain + path); + String contentType = FileServerUtil.getContentType(upload); + result.setContentType(contentType); + result.setTenantId(Integer.valueOf(tenantId)); + upload.delete(); + fileRecordService.save(result); + // 更新存储空间 + if(companyId != null){ + Company company = companyService.getById(Integer.valueOf(companyId)); + company.setStorage(company.getStorage() + result.getLength()); + if(company.getStorage().compareTo(company.getStorageMax()) > 0){ + redisUtil.set(key,1); + } + companyService.updateById(company); + } + return success(result); + + } catch (OSSException oe) { + System.out.println("Caught an OSSException, which means your request made it to OSS, " + + "but was rejected with an error response for some reason."); + System.out.println("Error Message:" + oe.getErrorMessage()); + System.out.println("Error Code:" + oe.getErrorCode()); + System.out.println("Request ID:" + oe.getRequestId()); + System.out.println("Host ID:" + oe.getHostId()); + } catch (ClientException ce) { + System.out.println("Caught an ClientException, which means the client encountered " + + "a serious internal problem while trying to communicate with OSS, " + + "such as not being able to access the network."); + System.out.println("Error Message:" + ce.getMessage()); + } finally { + if (ossClient != null) { + ossClient.shutdown(); + } + } + return fail("上传失败", null); + } + + @OperationLog + @Operation(summary = "获取临时osstoken") + @GetMapping("/getSTSToken") + public ApiResult getSTSToken() { + final User loginUser = getLoginUser(); + if(loginUser == null){ + return fail("请先登录"); + } + // STS接入地址,例如sts.cn-hangzhou.aliyuncs.com。 + String endpoint = "sts.cn-shenzhen.aliyuncs.com"; + // 填写步骤1生成的RAM用户访问密钥AccessKey ID和AccessKey Secret。 + String accessKeyId = "AAAAA"; + String accessKeySecret = "123456"; + // 填写步骤3获取的角色ARN。 + String roleArn = "acs:ram::1470199532233684:role/wsoss"; + // 自定义角色会话名称,用来区分不同的令牌,例如可填写为SessionTest。 + String roleSessionName = "wsoss"; + // 设置临时访问凭证的有效时间为3600秒。 + Long durationSeconds = 3600L; + try { + // regionId表示RAM的地域ID。以华东1(杭州)地域为例,regionID填写为cn-hangzhou。也可以保留默认值,默认值为空字符串("")。 + String regionId = ""; + // 添加endpoint。适用于Java SDK 3.12.0及以上版本。 + DefaultProfile.addEndpoint(regionId, "Sts", endpoint); + // 构造default profile。 + IClientProfile profile = DefaultProfile.getProfile(regionId, accessKeyId, accessKeySecret); + // 构造client。 + DefaultAcsClient client = new DefaultAcsClient(profile); + final AssumeRoleRequest request = new AssumeRoleRequest(); + // 适用于Java SDK 3.12.0及以上版本。 + request.setSysMethod(MethodType.POST); + // 适用于Java SDK 3.12.0以下版本。 + //request.setMethod(MethodType.POST); + request.setRoleArn(roleArn); + request.setRoleSessionName(roleSessionName); +// request.setPolicy(policy); + request.setDurationSeconds(durationSeconds); + final AssumeRoleResponse response = client.getAcsResponse(request); + return success(response); + } catch (ClientException | com.aliyuncs.exceptions.ClientException e) { + System.out.println("Failed:"); + System.out.println("Error message: " + e.getMessage()); + return fail(e.getMessage()); + + } + } + + /** + * 获取前端表单提交的参数 + * @return + */ + @Operation(summary = "获取前端表单提交的参数") + @GetMapping("/getPostForm") + public ApiResult getPostForm(){ + String endpoint = config.getEndpoint(); + // RAM用户的访问密钥(AccessKey ID和AccessKey Secret)。 + String accessKeyId = "LTAI5t8UTh8CTXEi2dYxobhj"; + String accessKeySecret = "123456"; + // 使用代码嵌入的RAM用户的访问密钥配置访问凭证。 + CredentialsProvider credentialsProvider = new DefaultCredentialProvider(accessKeyId, accessKeySecret); + // 填写Bucket名称,例如examplebucket。 + String bucket = config.getBucketName(); + OSS ossClient = new OSSClientBuilder().build(endpoint, credentialsProvider); + + try { + String host = "https://" + bucket + "." + endpoint; + String format = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); + + + long expireTime = 60; + long expireEndTime = System.currentTimeMillis() + expireTime * 1000; + Date expiration = new Date(expireEndTime); + PolicyConditions policyConds = new PolicyConditions(); + policyConds.addConditionItem(PolicyConditions.COND_CONTENT_LENGTH_RANGE,0,100*1024*1024); + + + String postPolicy = ossClient.generatePostPolicy(expiration, policyConds); + byte[] binaryData = postPolicy.getBytes(StandardCharsets.UTF_8); + String encodedPolicy = BinaryUtil.toBase64String(binaryData); + String postSignature = ossClient.calculatePostSignature(postPolicy); + Map result = new HashMap<>(); + result.put("polocyBase64",encodedPolicy); + result.put("signature",postSignature); + result.put("expireEndTime",expireEndTime); + return success(result); + } finally { + ossClient.shutdown(); + } + + } + + /** + * 文件上传位置(服务器) + */ + private String getUploadDir() { + return config.getUploadPath() + "/"; + } +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/AuthorizeCodeController.java b/src/main/java/com/gxwebsoft/common/system/controller/AuthorizeCodeController.java new file mode 100644 index 0000000..a19f232 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/AuthorizeCodeController.java @@ -0,0 +1,132 @@ +package com.gxwebsoft.common.system.controller; + +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.common.system.service.AuthorizeCodeService; +import com.gxwebsoft.common.system.entity.AuthorizeCode; +import com.gxwebsoft.common.system.param.AuthorizeCodeParam; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.BatchParam; +import com.gxwebsoft.common.core.annotation.OperationLog; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 授权码控制器 + * + * @author 科技小王子 + * @since 2025-08-05 01:17:27 + */ +@Tag(name = "授权码管理") +@RestController +@RequestMapping("/api/system/authorize-code") +public class AuthorizeCodeController extends BaseController { + @Resource + private AuthorizeCodeService authorizeCodeService; + + @PreAuthorize("hasAuthority('sys:authorizeCode:list')") + @OperationLog + @Operation(summary = "分页查询授权码") + @GetMapping("/page") + public ApiResult> page(AuthorizeCodeParam param) { + // 使用关联查询 + return success(authorizeCodeService.pageRel(param)); + } + + @PreAuthorize("hasAuthority('sys:authorizeCode:list')") + @OperationLog + @Operation(summary = "查询全部授权码") + @GetMapping() + public ApiResult> list(AuthorizeCodeParam param) { + // 使用关联查询 + return success(authorizeCodeService.listRel(param)); + } + + @PreAuthorize("hasAuthority('sys:authorizeCode:list')") + @OperationLog + @Operation(summary = "根据id查询授权码") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + // 使用关联查询 + return success(authorizeCodeService.getByIdRel(id)); + } + + @PreAuthorize("hasAuthority('sys:authorizeCode:save')") + @OperationLog + @Operation(summary = "添加授权码") + @PostMapping() + public ApiResult save(@RequestBody AuthorizeCode authorizeCode) { + // 记录当前登录用户id + User loginUser = getLoginUser(); + if (loginUser != null) { + authorizeCode.setUserId(loginUser.getUserId()); + } + if (authorizeCodeService.save(authorizeCode)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:authorizeCode:update')") + @OperationLog + @Operation(summary = "修改授权码") + @PutMapping() + public ApiResult update(@RequestBody AuthorizeCode authorizeCode) { + if (authorizeCodeService.updateById(authorizeCode)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:authorizeCode:remove')") + @OperationLog + @Operation(summary = "删除授权码") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (authorizeCodeService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:authorizeCode:save')") + @OperationLog + @Operation(summary = "批量添加授权码") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (authorizeCodeService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:authorizeCode:update')") + @OperationLog + @Operation(summary = "批量修改授权码") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(authorizeCodeService, "id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:authorizeCode:remove')") + @OperationLog + @Operation(summary = "批量删除授权码") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (authorizeCodeService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/CacheController.java b/src/main/java/com/gxwebsoft/common/system/controller/CacheController.java new file mode 100644 index 0000000..e233b23 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/CacheController.java @@ -0,0 +1,113 @@ +package com.gxwebsoft.common.system.controller; + +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; +import com.gxwebsoft.common.core.annotation.OperationLog; +import com.gxwebsoft.common.core.utils.RedisUtil; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.system.entity.Cache; +import com.gxwebsoft.common.system.entity.User; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +/** + * 缓存控制器 + * + * @author WebSoft + * @since 2022-11-19 13:54:27 + */ +@Tag(name = "Redis缓存") +@RestController +@RequestMapping("/api/system/cache") +public class CacheController extends BaseController { + @Resource + private RedisUtil redisUtil; + @Resource + private StringRedisTemplate stringRedisTemplate; + + @Operation(summary = "查询全部缓存") + @GetMapping() + public ApiResult> list() { + final Integer tenantId = getTenantId(); + if(tenantId == null){ + return fail("请传tenantID",null); + } + String key = "cache".concat(getTenantId().toString()).concat("*"); + final Set keys = stringRedisTemplate.keys(key); + final HashMap map = new HashMap<>(); + final ArrayList list = new ArrayList<>(); + assert keys != null; + keys.forEach(d -> { + final Cache cache = new Cache(); + cache.setKey(d); + try { + final String content = stringRedisTemplate.opsForValue().get(d); + if(content != null){ + cache.setContent(stringRedisTemplate.opsForValue().get(d)); + } + } catch (Exception e) { + e.printStackTrace(); + } + list.add(cache); + }); + map.put("count",keys.size()); + map.put("list",list); + return success(map); + } + + @PreAuthorize("hasAuthority('sys:cache:list')") + @Operation(summary = "根据key查询缓存信息") + @GetMapping("/{key}") + public ApiResult get(@PathVariable("key") String key) { + final String s = redisUtil.get(key + getTenantId()); + if(StrUtil.isNotBlank(s)){ + return success("读取成功", JSONObject.parseObject(s)); + } + return fail("缓存不存在!"); + } + + @PreAuthorize("hasAuthority('sys:cache:save')") + @Operation(summary = "添加缓存") + @PostMapping() + public ApiResult add(@RequestBody Cache cache) { + if (cache.getExpireTime() != null) { + redisUtil.set(cache.getKey() + ":" + getTenantId(),cache.getContent(),cache.getExpireTime(), TimeUnit.MINUTES); + return success("缓存成功"); + } + redisUtil.set(cache.getKey() + ":" + getTenantId(),cache.getContent()); + return success("缓存成功"); + } + + @PreAuthorize("hasAuthority('sys:cache:save')") + @OperationLog + @Operation(summary = "删除缓存") + @DeleteMapping("/{key}") + public ApiResult remove(@PathVariable("key") String key) { + if (Boolean.TRUE.equals(stringRedisTemplate.delete(key))) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @Operation(summary = "缓存皮肤") + @PostMapping("/theme") + public ApiResult saveTheme(@RequestBody Cache cache) { + final User loginUser = getLoginUser(); + final String username = loginUser.getUsername(); + if (username.equals("admin")) { + redisUtil.set(cache.getKey() + ":" + getTenantId(),cache.getContent()); + return success("缓存成功"); + } + return success("缓存失败"); + } +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/CartController.java b/src/main/java/com/gxwebsoft/common/system/controller/CartController.java new file mode 100644 index 0000000..c91811a --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/CartController.java @@ -0,0 +1,136 @@ +package com.gxwebsoft.common.system.controller; + +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.core.web.BatchParam; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.Cart; +import com.gxwebsoft.common.system.entity.OrderGoods; +import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.common.system.param.CartParam; +import com.gxwebsoft.common.system.service.CartService; +import com.gxwebsoft.common.system.service.OrderGoodsService; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; + +/** + * 购物车控制器 + * + * @author 科技小王子 + * @since 2024-10-26 10:54:51 + */ +@Tag(name = "购物车管理") +@RestController +@RequestMapping("/api/system/cart") +public class CartController extends BaseController { + @Resource + private CartService cartService; + @Resource + private OrderGoodsService orderGoodsService; + + @Operation(summary = "分页查询购物车") + @GetMapping("/page") + public ApiResult> page(CartParam param) { + // 使用关联查询 + return success(cartService.pageRel(param)); + } + + @Operation(summary = "查询全部购物车") + @GetMapping() + public ApiResult> list(CartParam param) { + // 使用关联查询 + return success(cartService.listRel(param)); + } + + @Operation(summary = "根据id查询购物车") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Long id) { + // 使用关联查询 + return success(cartService.getByIdRel(id)); + } + + @Operation(summary = "添加购物车") + @PostMapping() + public ApiResult save(@RequestBody Cart cart) { + System.out.println("cart = " + cart); + final ArrayList orderGoods = new ArrayList<>(); + // 记录当前登录用户id + User loginUser = getLoginUser(); + if (loginUser != null) { + cart.setUserId(loginUser.getUserId()); + cart.setTenantId(loginUser.getTenantId()); + if (cart.getType().equals(1)) { + cart.getList().forEach(item -> { + final OrderGoods og = new OrderGoods(); + og.setType(cart.getType()); + og.setItemId(item.getCompanyId()); + og.setPayPrice(item.getPrice()); + og.setMonth(cart.getMonth()); + og.setTotalNum(cart.getCartNum()); + og.setPayStatus(false); + og.setOrderStatus(0); + og.setTenantId(loginUser.getTenantId()); + og.setUserId(loginUser.getUserId()); + og.setComments("购买".concat(item.getTenantName())); + orderGoods.add(og); + }); + } + if (cartService.save(cart)) { + orderGoodsService.saveBatch(orderGoods); + return success("添加成功"); + } + } + return fail("添加失败"); + } + + @Operation(summary = "修改购物车") + @PutMapping() + public ApiResult update(@RequestBody Cart cart) { + if (cartService.updateById(cart)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @Operation(summary = "删除购物车") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (cartService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @Operation(summary = "批量添加购物车") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (cartService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @Operation(summary = "批量修改购物车") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(cartService, "id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @Operation(summary = "批量删除购物车") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (cartService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/ChatConversationController.java b/src/main/java/com/gxwebsoft/common/system/controller/ChatConversationController.java new file mode 100644 index 0000000..719dcc1 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/ChatConversationController.java @@ -0,0 +1,125 @@ +package com.gxwebsoft.common.system.controller; + +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.system.service.ChatConversationService; +import com.gxwebsoft.common.system.entity.ChatConversation; +import com.gxwebsoft.common.system.param.ChatConversationParam; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.core.web.BatchParam; +import com.gxwebsoft.common.core.annotation.OperationLog; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 聊天消息表控制器 + * + * @author 科技小王子 + * @since 2024-04-27 15:57:27 + */ +@Tag(name = "聊天") +@RestController +@RequestMapping("/api/system/chat-conversation") +public class ChatConversationController extends BaseController { + @Resource + private ChatConversationService chatConversationService; + + @PreAuthorize("hasAuthority('sys:chatConversation:list')") + @OperationLog + @Operation(summary = "分页查询聊天消息表") + @GetMapping("/page") + public ApiResult> page(ChatConversationParam param) { + // 使用关联查询 + return success(chatConversationService.pageRel(param)); + } + + @PreAuthorize("hasAuthority('sys:chatConversation:list')") + @OperationLog + @Operation(summary = "查询全部聊天消息表") + @GetMapping() + public ApiResult> list(ChatConversationParam param) { + // 使用关联查询 + return success(chatConversationService.listRel(param)); + } + + @PreAuthorize("hasAuthority('sys:chatConversation:list')") + @OperationLog + @Operation(summary = "根据id查询聊天消息表") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + // 使用关联查询 + return success(chatConversationService.getByIdRel(id)); + } + + @PreAuthorize("hasAuthority('sys:chatConversation:save')") + @OperationLog + @Operation(summary = "添加聊天消息表") + @PostMapping() + public ApiResult save(@RequestBody ChatConversation chatConversation) { + if (chatConversationService.save(chatConversation)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:chatConversation:update')") + @OperationLog + @Operation(summary = "修改聊天消息表") + @PutMapping() + public ApiResult update(@RequestBody ChatConversation chatConversation) { + if (chatConversationService.updateById(chatConversation)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:chatConversation:remove')") + @OperationLog + @Operation(summary = "删除聊天消息表") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (chatConversationService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:chatConversation:save')") + @OperationLog + @Operation(summary = "批量添加聊天消息表") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (chatConversationService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:chatConversation:update')") + @OperationLog + @Operation(summary = "批量修改聊天消息表") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(chatConversationService, "id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:chatConversation:remove')") + @OperationLog + @Operation(summary = "批量删除聊天消息表") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (chatConversationService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/ChatMessageController.java b/src/main/java/com/gxwebsoft/common/system/controller/ChatMessageController.java new file mode 100644 index 0000000..6a6a707 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/ChatMessageController.java @@ -0,0 +1,127 @@ +package com.gxwebsoft.common.system.controller; + +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.common.system.service.ChatMessageService; +import com.gxwebsoft.common.system.entity.ChatMessage; +import com.gxwebsoft.common.system.param.ChatMessageParam; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.core.web.BatchParam; +import com.gxwebsoft.common.core.annotation.OperationLog; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; + +/** + * 聊天消息表控制器 + * + * @author 科技小王子 + * @since 2024-04-27 15:57:27 + */ +@Tag(name = "聊天") +@RestController +@RequestMapping("/api/system/chat-message") +public class ChatMessageController extends BaseController { + @Resource + private ChatMessageService chatMessageService; + + @Operation(summary = "分页查询聊天消息表") + @GetMapping("/page") + public ApiResult> page(ChatMessageParam param) { + // 使用关联查询 + return success(chatMessageService.pageRel(param)); + } + + @Operation(summary = "查询全部聊天消息表") + @GetMapping() + public ApiResult> list(ChatMessageParam param) { + User loginUser = getLoginUser(); + param.setToUserId(loginUser.getUserId()); + return success(chatMessageService.listRel(param)); + } + + @Operation(summary = "根据id查询聊天消息表") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + // 使用关联查询 + return success(chatMessageService.getByIdRel(id)); + } + + @Operation(summary = "添加聊天消息表") + @PostMapping() + public ApiResult save(@RequestBody ChatMessage chatMessage) { + // 记录当前登录用户id + User loginUser = getLoginUser(); + if (loginUser != null) { + chatMessage.setFormUserId(loginUser.getUserId()); + if (chatMessageService.save(chatMessage)) { + return success("添加成功"); + } + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:chatMessage:update')") + @Operation(summary = "修改聊天消息表") + @PutMapping() + public ApiResult update(@RequestBody ChatMessage chatMessage) { + if (chatMessageService.updateById(chatMessage)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:chatMessage:remove')") + @OperationLog + @Operation(summary = "删除聊天消息表") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (chatMessageService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @Operation(summary = "批量添加聊天消息表") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + final ArrayList saveData = new ArrayList<>(); + list.forEach(d -> { + d.setFormUserId(getLoginUserId()); + saveData.add(d); + }); + if(!saveData.isEmpty()){ + if (chatMessageService.saveBatch(saveData)) { + return success("发送成功"); + } + } + return fail("发送失败"); + } + + @PreAuthorize("hasAuthority('sys:chatMessage:update')") + @Operation(summary = "批量修改聊天消息表") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(chatMessageService, "id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:chatMessage:remove')") + @Operation(summary = "批量删除聊天消息表") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (chatMessageService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/CompanyCommentController.java b/src/main/java/com/gxwebsoft/common/system/controller/CompanyCommentController.java new file mode 100644 index 0000000..5f460b4 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/CompanyCommentController.java @@ -0,0 +1,131 @@ +package com.gxwebsoft.common.system.controller; + +import com.gxwebsoft.common.core.annotation.OperationLog; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.core.web.BatchParam; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.CompanyComment; +import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.common.system.param.CompanyCommentParam; +import com.gxwebsoft.common.system.service.CompanyCommentService; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 应用评论控制器 + * + * @author 科技小王子 + * @since 2024-10-17 15:30:24 + */ +@Tag(name = "应用评论管理") +@RestController +@RequestMapping("/api/system/company-comment") +public class CompanyCommentController extends BaseController { + @Resource + private CompanyCommentService companyCommentService; + + @PreAuthorize("hasAuthority('sys:company:list')") + @OperationLog + @Operation(summary = "分页查询应用评论") + @GetMapping("/page") + public ApiResult> page(CompanyCommentParam param) { + // 使用关联查询 + return success(companyCommentService.pageRel(param)); + } + + @PreAuthorize("hasAuthority('sys:company:list')") + @OperationLog + @Operation(summary = "查询全部应用评论") + @GetMapping() + public ApiResult> list(CompanyCommentParam param) { + // 使用关联查询 + return success(companyCommentService.listRel(param)); + } + + @PreAuthorize("hasAuthority('sys:company:list')") + @OperationLog + @Operation(summary = "根据id查询应用评论") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + // 使用关联查询 + return success(companyCommentService.getByIdRel(id)); + } + + @PreAuthorize("hasAuthority('sys:company:save')") + @OperationLog + @Operation(summary = "添加应用评论") + @PostMapping() + public ApiResult save(@RequestBody CompanyComment companyComment) { + // 记录当前登录用户id + User loginUser = getLoginUser(); + if (loginUser != null) { + companyComment.setUserId(loginUser.getUserId()); + } + if (companyCommentService.save(companyComment)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:company:update')") + @OperationLog + @Operation(summary = "修改应用评论") + @PutMapping() + public ApiResult update(@RequestBody CompanyComment companyComment) { + if (companyCommentService.updateById(companyComment)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:company:remove')") + @OperationLog + @Operation(summary = "删除应用评论") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (companyCommentService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:company:save')") + @OperationLog + @Operation(summary = "批量添加应用评论") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (companyCommentService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:company:update')") + @OperationLog + @Operation(summary = "批量修改应用评论") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(companyCommentService, "id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:company:remove')") + @OperationLog + @Operation(summary = "批量删除应用评论") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (companyCommentService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/CompanyContentController.java b/src/main/java/com/gxwebsoft/common/system/controller/CompanyContentController.java new file mode 100644 index 0000000..cc63569 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/CompanyContentController.java @@ -0,0 +1,125 @@ +package com.gxwebsoft.common.system.controller; + +import com.gxwebsoft.common.core.annotation.OperationLog; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.core.web.BatchParam; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.CompanyContent; +import com.gxwebsoft.common.system.param.CompanyContentParam; +import com.gxwebsoft.common.system.service.CompanyContentService; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 应用详情控制器 + * + * @author 科技小王子 + * @since 2024-10-16 13:41:21 + */ +@Tag(name = "应用详情管理") +@RestController +@RequestMapping("/api/system/company-content") +public class CompanyContentController extends BaseController { + @Resource + private CompanyContentService companyContentService; + + @PreAuthorize("hasAuthority('sys:company:list')") + @OperationLog + @Operation(summary = "分页查询应用详情") + @GetMapping("/page") + public ApiResult> page(CompanyContentParam param) { + // 使用关联查询 + return success(companyContentService.pageRel(param)); + } + + @PreAuthorize("hasAuthority('sys:company:list')") + @OperationLog + @Operation(summary = "查询全部应用详情") + @GetMapping() + public ApiResult> list(CompanyContentParam param) { + // 使用关联查询 + return success(companyContentService.listRel(param)); + } + + @PreAuthorize("hasAuthority('sys:company:list')") + @OperationLog + @Operation(summary = "根据id查询应用详情") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + // 使用关联查询 + return success(companyContentService.getByIdRel(id)); + } + + @PreAuthorize("hasAuthority('sys:company:save')") + @OperationLog + @Operation(summary = "添加应用详情") + @PostMapping() + public ApiResult save(@RequestBody CompanyContent companyContent) { + if (companyContentService.save(companyContent)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:company:update')") + @OperationLog + @Operation(summary = "修改应用详情") + @PutMapping() + public ApiResult update(@RequestBody CompanyContent companyContent) { + if (companyContentService.updateById(companyContent)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:company:remove')") + @OperationLog + @Operation(summary = "删除应用详情") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (companyContentService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:company:save')") + @OperationLog + @Operation(summary = "批量添加应用详情") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (companyContentService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:company:update')") + @OperationLog + @Operation(summary = "批量修改应用详情") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(companyContentService, "id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:company:remove')") + @OperationLog + @Operation(summary = "批量删除应用详情") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (companyContentService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/CompanyController.java b/src/main/java/com/gxwebsoft/common/system/controller/CompanyController.java new file mode 100644 index 0000000..dffcbd0 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/CompanyController.java @@ -0,0 +1,363 @@ +package com.gxwebsoft.common.system.controller; + +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.DesensitizedUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.gxwebsoft.common.core.annotation.OperationLog; +import com.gxwebsoft.common.core.exception.BusinessException; +import com.gxwebsoft.common.core.utils.CommonUtil; +import com.gxwebsoft.common.core.utils.RedisUtil; +import com.gxwebsoft.common.core.web.*; +import com.gxwebsoft.common.system.entity.*; +import com.gxwebsoft.common.system.mapper.CompanyMapper; +import com.gxwebsoft.common.system.mapper.TenantMapper; +import com.gxwebsoft.common.system.param.CompanyParam; +import com.gxwebsoft.common.system.service.*; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.transaction.annotation.Isolation; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +/** + * 企业信息控制器 + * + * @author 科技小王子 + * @since 2023-05-27 14:57:34 + */ +@Tag(name = "企业") +@RestController +@RequestMapping("/api/system/company") +public class CompanyController extends BaseController { + @Resource + private CompanyService companyService; + @Resource + private CompanyContentService companyContentService; + @Resource + private CompanyUrlService companyUrlService; + @Resource + private CompanyParameterService companyParameterService; + @Resource + private TenantService tenantService; + @Resource + private CompanyMapper companyMapper; + @Resource + private TenantMapper tenantMapper; + @Resource + private DomainService domainService; + @Resource + private UserCollectionService userCollectionService; + @Resource + private RedisUtil redisUtil; + + + @Operation(summary = "分页查询企业信息不限租户") + @GetMapping("/pageAll") + public ApiResult> pageAll(CompanyParam param) { + final PageResult result = companyService.pageRelAll(param); + result.getList().forEach(d -> { + d.setPhone(DesensitizedUtil.mobilePhone(d.getPhone())); + d.setCompanyCode(DesensitizedUtil.idCardNum(d.getCompanyCode(),1,2)); + }); + final User loginUser = getLoginUser(); + if(loginUser != null){ + // 我的收藏 + final List myFocus = userCollectionService.list(new LambdaQueryWrapper().eq(UserCollection::getUserId, getLoginUserId())); + if (!CollectionUtils.isEmpty(myFocus)) { + final Set collect = myFocus.stream().map(UserCollection::getTid).collect(Collectors.toSet()); + if (param.getVersion() != null) { + // 我的收藏 + if (param.getVersion().equals(99)) { + param.setVersion(null); + param.setCompanyIds(collect); + } + } + result.getList().forEach(d -> { + d.setCollection(collect.contains(d.getCompanyId())); + }); + return success(result); + } + } + // 使用关联查询 + return success(result); + } + + @PreAuthorize("hasAuthority('sys:company:list')") + @Operation(summary = "分页查询企业信息") + @GetMapping("/page") + public ApiResult> page(CompanyParam param) { + // 使用关联查询 + return success(companyService.pageRel(param)); + } + + @PreAuthorize("hasAuthority('sys:company:list')") + @OperationLog + @Operation(summary = "查询全部企业信息") + @GetMapping() + public ApiResult> list(CompanyParam param) { + // 使用关联查询 + return success(companyService.listRel(param)); + } + + @Operation(summary = "根据id查询企业信息") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + // 使用关联查询 + final Company company = companyService.getByIdRel(id); + if (ObjectUtil.isNotEmpty(company)) { + // 应用详情 + final CompanyContent content = companyContentService.getOne(new LambdaQueryWrapper().eq(CompanyContent::getCompanyId, company.getCompanyId()).last("limit 1")); + if (ObjectUtil.isNotEmpty(content)) { + company.setContent(content.getContent()); + } + // 应用链接 + company.setLinks(companyUrlService.list(new LambdaQueryWrapper().eq(CompanyUrl::getCompanyId, company.getCompanyId()))); + // 应用参数 + company.setParameters(companyParameterService.list(new LambdaQueryWrapper().eq(CompanyParameter::getCompanyId, company.getCompanyId()))); + + } + return success(company); + } + + @Transactional(rollbackFor = {Exception.class}, isolation = Isolation.SERIALIZABLE) + @PreAuthorize("hasAuthority('sys:company:save')") + @Operation(summary = "添加企业信息") + @PostMapping() + public ApiResult save(@RequestBody Company company) { + Tenant tenant = new Tenant(); + // 记录当前登录用户id + User loginUser = getLoginUser(); + if (loginUser != null) { + company.setUserId(loginUser.getUserId()); + tenant.setUserId(loginUser.getUserId()); + } + tenant.setTenantName(company.getShortName()); + tenant.setTenantCode(CommonUtil.randomUUID16()); + tenant.setComments(company.getComments()); + tenantService.save(tenant); + company.setTenantId(tenant.getTenantId()); + company.setTid(tenant.getTenantId()); + company.setAuthoritative(true); + // 添加租户并初始化 + final Company result = tenantService.initialization(company); + if (result != null) { + return success("添加成功",result); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:company:update')") + @OperationLog + @Operation(summary = "修改企业信息") + @PutMapping() + public ApiResult update(@RequestBody Company company) { + // 授权新的免费域名 + if (StrUtil.isNotBlank(company.getFreeDomain())) { + // 待授权的二级域名 + String domain = company.getFreeDomain().concat(".websoft.top"); + // 删除旧授权域名 + final Domain one = domainService.getOne(new LambdaQueryWrapper().eq(Domain::getType, 2).eq(Domain::getCompanyId, company.getCompanyId()).eq(Domain::getDeleted,0).last("limit 1")); + if(one != null){ + redisUtil.delete("Domain:".concat(one.getDomain())); + domainService.removeById(one); + } + // 保存记录 + final Domain sysDomain = new Domain(); + sysDomain.setDomain(domain); + sysDomain.setType(2); + sysDomain.setSortNumber(100); + sysDomain.setCompanyId(company.getCompanyId()); + sysDomain.setTenantId(company.getTenantId()); + domainService.save(sysDomain); + company.setDomain(domain); + // 写入缓存 + redisUtil.set("Domain:".concat(domain), company.getTenantId()); + } + // 同步更新租户表 + if(StrUtil.isNotBlank(company.getShortName())){ + final Tenant tenant = new Tenant(); + tenant.setTenantId(company.getTenantId()); + tenant.setTenantName(company.getShortName()); + tenantService.updateById(tenant); + } + if (companyService.updateById(company)) { + // 清除缓存 + redisUtil.delete("TenantInfo:".concat(company.getTenantId().toString())); + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:company:remove')") + @OperationLog + @Operation(summary = "删除企业信息") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + final Company company = companyService.getById(id); + tenantService.removeById(company.getTenantId()); + if (companyService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:company:save')") + @OperationLog + @Operation(summary = "批量添加企业信息") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (companyService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:company:update')") + @OperationLog + @Operation(summary = "批量修改企业信息") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(companyService, "company_id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:company:remove')") + @OperationLog + @Operation(summary = "批量删除企业信息") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (companyService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @Operation(summary = "根据id查询企业信息") + @GetMapping("/profile") + public ApiResult profile() { + final User loginUser = getLoginUser(); + if(loginUser != null){ + final Company company = companyService.getOne(new LambdaQueryWrapper().eq(Company::getTenantId, loginUser.getTenantId()).eq(Company::getAuthoritative, true).last("limit 1")); + if (ObjectUtil.isNotEmpty(company)) { + // 即将过期(一周内过期的) + company.setSoon(DateUtil.offsetDay(company.getExpirationTime(), -7).compareTo(DateUtil.date())); + // 是否过期 -1已过期 大于0 未过期 + company.setStatus(company.getExpirationTime().compareTo(DateUtil.date())); + return success(company); + } + } + return fail("企业不存在",null); + } + + @PreAuthorize("hasAuthority('sys:company:profile')") + @OperationLog + @Operation(summary = "根据id查询企业信息不限租户") + @GetMapping("/profileAll/{companyId}") + public ApiResult profileAll(@PathVariable("companyId") Integer companyId) { + return success(companyMapper.getCompanyAll(companyId)); + } + + @PreAuthorize("hasAuthority('sys:company:remove')") + @OperationLog + @Operation(summary = "销毁租户") + @DeleteMapping("/destruction/{id}") + public ApiResult destruction(@PathVariable("id") Integer id) { + final User loginUser = getLoginUser(); + if (!loginUser.getUsername().equals("admin")) { + throw new BusinessException("只有超级管理员才能操作"); + } + final Integer tenantId = getTenantId(); + if (tenantService.removeById(tenantId)) { + return success("删除成功",tenantId); + } + return fail("删除失败"); + } + @Operation(summary = "检查企业是否存在") + @GetMapping("/existence") + public ApiResult existence(ExistenceParam param) { + CompanyParam companyParam = new CompanyParam(); + if (param.getField().equals("shortName")) { + companyParam.setAppName(param.getValue()); + List count = companyMapper.getCount(companyParam); + if (!CollectionUtils.isEmpty(count)) { + return success(param.getValue() + "已存在"); + } + } + if (param.getField().equals("email")) { + companyParam.setEmail(param.getValue()); + List count = companyMapper.getCount(companyParam); + if (!CollectionUtils.isEmpty(count)) { + return success(param.getValue() + "已存在"); + } + } + if (param.getField().equals("phone")) { + companyParam.setPhone(param.getValue()); + List count = companyMapper.getCount(companyParam); + if (!CollectionUtils.isEmpty(count)) { + return success(param.getValue() + "已存在"); + } + } + return fail(param.getValue() + "不存在"); + } + + @Operation(summary = "根据id查询企业信息不限租户不带token") + @GetMapping("/companyInfoAll/{companyId}") + public ApiResult companyInfoAll(@PathVariable("companyId") Integer companyId) { + return success(companyMapper.getCompanyAll(companyId)); + } + + @PreAuthorize("hasAuthority('sys:company:updateAll')") + @OperationLog + @Operation(summary = "修改企业信息") + @PutMapping("/updateCompanyAll") + public ApiResult updateCompanyAll(@RequestBody Company company) { + if (companyMapper.updateByIdAll(company)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:company:removeAll')") + @OperationLog + @Operation(summary = "删除企业信息") + @DeleteMapping("/removeAll/{id}") + public ApiResult removeAll(@PathVariable("id") Integer id) { + if (companyMapper.removeCompanyAll(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:company:removeAll')") + @OperationLog + @Operation(summary = "恢复租户") + @DeleteMapping("/undeleteAll/{id}") + public ApiResult undeleteAll(@PathVariable("id") Integer id) { + if (companyMapper.undeleteAll(id)) { + return success("恢复成功"); + } + return fail("恢复失败"); + } + + @PreAuthorize("hasAuthority('sys:company:destructionAll')") + @OperationLog + @Operation(summary = "销毁租户") + @DeleteMapping("/destructionAll/{id}") + public ApiResult destructionAll(@PathVariable("id") Integer id) { + if (tenantMapper.destructionAll(id)) { + return success("销毁成功"); + } + return fail("销毁失败"); + } +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/CompanyGitController.java b/src/main/java/com/gxwebsoft/common/system/controller/CompanyGitController.java new file mode 100644 index 0000000..451118c --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/CompanyGitController.java @@ -0,0 +1,122 @@ +package com.gxwebsoft.common.system.controller; + +import com.gxwebsoft.common.core.annotation.OperationLog; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.core.web.BatchParam; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.CompanyGit; +import com.gxwebsoft.common.system.param.CompanyGitParam; +import com.gxwebsoft.common.system.service.CompanyGitService; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 代码仓库控制器 + * + * @author 科技小王子 + * @since 2024-10-19 18:08:51 + */ +@Tag(name = "代码仓库管理") +@RestController +@RequestMapping("/api/system/company-git") +public class CompanyGitController extends BaseController { + @Resource + private CompanyGitService companyGitService; + + @PreAuthorize("hasAuthority('sys:companyGit:list')") + @Operation(summary = "分页查询代码仓库") + @GetMapping("/page") + public ApiResult> page(CompanyGitParam param) { + // 使用关联查询 + return success(companyGitService.pageRel(param)); + } + + @PreAuthorize("hasAuthority('sys:companyGit:list')") + @Operation(summary = "查询全部代码仓库") + @GetMapping() + public ApiResult> list(CompanyGitParam param) { + // 使用关联查询 + return success(companyGitService.listRel(param)); + } + + @PreAuthorize("hasAuthority('sys:companyGit:list')") + @Operation(summary = "根据id查询代码仓库") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + // 使用关联查询 + return success(companyGitService.getByIdRel(id)); + } + + @PreAuthorize("hasAuthority('sys:companyGit:save')") + @OperationLog + @Operation(summary = "添加代码仓库") + @PostMapping() + public ApiResult save(@RequestBody CompanyGit companyGit) { + if (companyGitService.save(companyGit)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:companyGit:update')") + @OperationLog + @Operation(summary = "修改代码仓库") + @PutMapping() + public ApiResult update(@RequestBody CompanyGit companyGit) { + if (companyGitService.updateById(companyGit)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:companyGit:remove')") + @OperationLog + @Operation(summary = "删除代码仓库") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (companyGitService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:companyGit:save')") + @OperationLog + @Operation(summary = "批量添加代码仓库") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (companyGitService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:companyGit:update')") + @OperationLog + @Operation(summary = "批量修改代码仓库") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(companyGitService, "id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:companyGit:remove')") + @OperationLog + @Operation(summary = "批量删除代码仓库") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (companyGitService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/CompanyParameterController.java b/src/main/java/com/gxwebsoft/common/system/controller/CompanyParameterController.java new file mode 100644 index 0000000..086964f --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/CompanyParameterController.java @@ -0,0 +1,125 @@ +package com.gxwebsoft.common.system.controller; + +import com.gxwebsoft.common.core.annotation.OperationLog; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.core.web.BatchParam; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.CompanyParameter; +import com.gxwebsoft.common.system.param.CompanyParameterParam; +import com.gxwebsoft.common.system.service.CompanyParameterService; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 应用参数控制器 + * + * @author 科技小王子 + * @since 2024-10-17 15:30:24 + */ +@Tag(name = "应用参数管理") +@RestController +@RequestMapping("/api/system/company-parameter") +public class CompanyParameterController extends BaseController { + @Resource + private CompanyParameterService companyParameterService; + + @PreAuthorize("hasAuthority('sys:company:list')") + @OperationLog + @Operation(summary = "分页查询应用参数") + @GetMapping("/page") + public ApiResult> page(CompanyParameterParam param) { + // 使用关联查询 + return success(companyParameterService.pageRel(param)); + } + + @PreAuthorize("hasAuthority('sys:company:list')") + @OperationLog + @Operation(summary = "查询全部应用参数") + @GetMapping() + public ApiResult> list(CompanyParameterParam param) { + // 使用关联查询 + return success(companyParameterService.listRel(param)); + } + + @PreAuthorize("hasAuthority('sys:company:list')") + @OperationLog + @Operation(summary = "根据id查询应用参数") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + // 使用关联查询 + return success(companyParameterService.getByIdRel(id)); + } + + @PreAuthorize("hasAuthority('sys:company:save')") + @OperationLog + @Operation(summary = "添加应用参数") + @PostMapping() + public ApiResult save(@RequestBody CompanyParameter companyParameter) { + if (companyParameterService.save(companyParameter)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:company:update')") + @OperationLog + @Operation(summary = "修改应用参数") + @PutMapping() + public ApiResult update(@RequestBody CompanyParameter companyParameter) { + if (companyParameterService.updateById(companyParameter)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:company:remove')") + @OperationLog + @Operation(summary = "删除应用参数") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (companyParameterService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:company:save')") + @OperationLog + @Operation(summary = "批量添加应用参数") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (companyParameterService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:company:update')") + @OperationLog + @Operation(summary = "批量修改应用参数") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(companyParameterService, "id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:company:remove')") + @OperationLog + @Operation(summary = "批量删除应用参数") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (companyParameterService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/CompanyUrlController.java b/src/main/java/com/gxwebsoft/common/system/controller/CompanyUrlController.java new file mode 100644 index 0000000..6de5078 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/CompanyUrlController.java @@ -0,0 +1,125 @@ +package com.gxwebsoft.common.system.controller; + +import com.gxwebsoft.common.core.annotation.OperationLog; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.core.web.BatchParam; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.CompanyUrl; +import com.gxwebsoft.common.system.param.CompanyUrlParam; +import com.gxwebsoft.common.system.service.CompanyUrlService; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 应用域名控制器 + * + * @author 科技小王子 + * @since 2024-10-17 15:30:24 + */ +@Tag(name = "应用域名管理") +@RestController +@RequestMapping("/api/system/company-url") +public class CompanyUrlController extends BaseController { + @Resource + private CompanyUrlService companyUrlService; + + @PreAuthorize("hasAuthority('sys:company:list')") + @OperationLog + @Operation(summary = "分页查询应用域名") + @GetMapping("/page") + public ApiResult> page(CompanyUrlParam param) { + // 使用关联查询 + return success(companyUrlService.pageRel(param)); + } + + @PreAuthorize("hasAuthority('sys:company:list')") + @OperationLog + @Operation(summary = "查询全部应用域名") + @GetMapping() + public ApiResult> list(CompanyUrlParam param) { + // 使用关联查询 + return success(companyUrlService.listRel(param)); + } + + @PreAuthorize("hasAuthority('sys:company:list')") + @OperationLog + @Operation(summary = "根据id查询应用域名") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + // 使用关联查询 + return success(companyUrlService.getByIdRel(id)); + } + + @PreAuthorize("hasAuthority('sys:company:save')") + @OperationLog + @Operation(summary = "添加应用域名") + @PostMapping() + public ApiResult save(@RequestBody CompanyUrl companyUrl) { + if (companyUrlService.save(companyUrl)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:company:update')") + @OperationLog + @Operation(summary = "修改应用域名") + @PutMapping() + public ApiResult update(@RequestBody CompanyUrl companyUrl) { + if (companyUrlService.updateById(companyUrl)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:company:remove')") + @OperationLog + @Operation(summary = "删除应用域名") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (companyUrlService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:company:save')") + @OperationLog + @Operation(summary = "批量添加应用域名") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (companyUrlService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:company:update')") + @OperationLog + @Operation(summary = "批量修改应用域名") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(companyUrlService, "id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:company:remove')") + @OperationLog + @Operation(summary = "批量删除应用域名") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (companyUrlService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/ComponentsController.java b/src/main/java/com/gxwebsoft/common/system/controller/ComponentsController.java new file mode 100644 index 0000000..324459d --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/ComponentsController.java @@ -0,0 +1,139 @@ +package com.gxwebsoft.common.system.controller; + +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.common.system.service.ComponentsService; +import com.gxwebsoft.common.system.entity.Components; +import com.gxwebsoft.common.system.param.ComponentsParam; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.BatchParam; +import com.gxwebsoft.common.core.annotation.OperationLog; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 组件控制器 + * + * @author 科技小王子 + * @since 2024-08-25 19:08:51 + */ +@Tag(name = "组件管理") +@RestController +@RequestMapping("/api/system/components") +public class ComponentsController extends BaseController { + @Resource + private ComponentsService componentsService; + + @PreAuthorize("hasAuthority('sys:components:list')") + @OperationLog + @Operation(summary = "分页查询组件") + @GetMapping("/page") + public ApiResult> page(ComponentsParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + return success(componentsService.page(page, page.getWrapper())); + // 使用关联查询 + //return success(componentsService.pageRel(param)); + } + + @PreAuthorize("hasAuthority('sys:components:list')") + @OperationLog + @Operation(summary = "查询全部组件") + @GetMapping() + public ApiResult> list(ComponentsParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + return success(componentsService.list(page.getOrderWrapper())); + // 使用关联查询 + //return success(componentsService.listRel(param)); + } + + @PreAuthorize("hasAuthority('sys:components:list')") + @OperationLog + @Operation(summary = "根据id查询组件") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + return success(componentsService.getById(id)); + // 使用关联查询 + //return success(componentsService.getByIdRel(id)); + } + + @PreAuthorize("hasAuthority('sys:components:save')") + @OperationLog + @Operation(summary = "添加组件") + @PostMapping() + public ApiResult save(@RequestBody Components components) { + // 记录当前登录用户id + User loginUser = getLoginUser(); + if (loginUser != null) { + components.setUserId(loginUser.getUserId()); + } + if (componentsService.save(components)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:components:update')") + @OperationLog + @Operation(summary = "修改组件") + @PutMapping() + public ApiResult update(@RequestBody Components components) { + if (componentsService.updateById(components)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:components:remove')") + @OperationLog + @Operation(summary = "删除组件") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (componentsService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:components:save')") + @OperationLog + @Operation(summary = "批量添加组件") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (componentsService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:components:update')") + @OperationLog + @Operation(summary = "批量修改组件") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(componentsService, "id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:components:remove')") + @OperationLog + @Operation(summary = "批量删除组件") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (componentsService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/DictController.java b/src/main/java/com/gxwebsoft/common/system/controller/DictController.java new file mode 100644 index 0000000..9013759 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/DictController.java @@ -0,0 +1,183 @@ +package com.gxwebsoft.common.system.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.gxwebsoft.common.core.annotation.OperationLog; +import com.gxwebsoft.common.core.utils.CommonUtil; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.Dict; +import com.gxwebsoft.common.system.entity.DictData; +import com.gxwebsoft.common.system.param.DictDataParam; +import com.gxwebsoft.common.system.param.DictParam; +import com.gxwebsoft.common.system.service.DictDataService; +import com.gxwebsoft.common.system.service.DictService; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 字典控制器 + * + * @author WebSoft + * @since 2020-03-14 11:29:03 + */ +@Tag(name = "字典") +@RestController +@RequestMapping("/api/system/dict") +public class DictController extends BaseController { + @Resource + private DictService dictService; + @Resource + private DictDataService dictDataService; + + @PreAuthorize("hasAuthority('sys:dict:list')") + @Operation(summary = "分页查询字典") + @GetMapping("/page") + public ApiResult> page(DictParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("sort_number"); + return success(dictService.page(page, page.getWrapper())); + } + + @PreAuthorize("hasAuthority('sys:dict:list')") + @Operation(summary = "查询全部字典") + @GetMapping() + public ApiResult> list(DictParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("sort_number"); + return success(dictService.list(page.getOrderWrapper())); + } + + @Operation(summary = "查询全部字典") + @GetMapping("/tree") + public ApiResult tree() { + if (getTenantId() == null) { + return fail("租户ID不存在"); + } + final HashMap result = new HashMap<>(); + final List dictData = dictDataService.listRel(new DictDataParam()); + final Map> dataCollect = dictData.stream().collect(Collectors.groupingBy(DictData::getDictCode)); + for (String code : dataCollect.keySet()) { + Dict dict = new Dict(); + dict.setDictCode(code); + final Set> list = new LinkedHashSet<>(); + Set codes = new LinkedHashSet<>(); + for(DictData item : dictData){ + if (item.getDictCode().equals(code)) { + codes.add(item.getDictDataCode()); + } + } + list.add(codes); + dict.setItems(list); + result.put(code,dict.getItems()); + } + return success(result); + } + + @PreAuthorize("hasAuthority('sys:dict:list')") + @Operation(summary = "根据id查询字典") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + return success(dictService.getById(id)); + } + + @PreAuthorize("hasAuthority('sys:dict:save')") + @Operation(summary = "添加字典") + @PostMapping() + public ApiResult add(@RequestBody Dict dict) { + if (dictService.count(new LambdaQueryWrapper() + .eq(Dict::getDictCode, dict.getDictCode())) > 0) { + return fail("字典标识已存在"); + } + if (dictService.count(new LambdaQueryWrapper() + .eq(Dict::getDictName, dict.getDictName())) > 0) { + return fail("字典名称已存在"); + } + if (dictService.save(dict)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:dict:update')") + @OperationLog + @Operation(summary = "修改字典") + @PutMapping() + public ApiResult update(@RequestBody Dict dict) { + if (dictService.count(new LambdaQueryWrapper() + .eq(Dict::getDictCode, dict.getDictCode()) + .ne(Dict::getDictId, dict.getDictId())) > 0) { + return fail("字典标识已存在"); + } + if (dictService.count(new LambdaQueryWrapper() + .eq(Dict::getDictName, dict.getDictName()) + .ne(Dict::getDictId, dict.getDictId())) > 0) { + return fail("字典名称已存在"); + } + if (dictService.updateById(dict)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:dict:remove')") + @OperationLog + @Operation(summary = "删除字典") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (dictService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:dict:save')") + @OperationLog + @Operation(summary = "批量添加字典") + @PostMapping("/batch") + public ApiResult> saveBatch(@RequestBody List list) { + if (CommonUtil.checkRepeat(list, Dict::getDictCode)) { + return fail("字典标识不能重复", null); + } + if (CommonUtil.checkRepeat(list, Dict::getDictName)) { + return fail("字典名称不能重复", null); + } + List codeExists = dictService.list(new LambdaQueryWrapper() + .in(Dict::getDictCode, list.stream().map(Dict::getDictCode) + .collect(Collectors.toList()))); + if (codeExists.size() > 0) { + return fail("字典标识已存在", codeExists.stream().map(Dict::getDictCode) + .collect(Collectors.toList())).setCode(2); + } + List nameExists = dictService.list(new LambdaQueryWrapper() + .in(Dict::getDictName, list.stream().map(Dict::getDictCode) + .collect(Collectors.toList()))); + if (nameExists.size() > 0) { + return fail("字典名称已存在", nameExists.stream().map(Dict::getDictName) + .collect(Collectors.toList())).setCode(3); + } + if (dictService.saveBatch(list)) { + return success("添加成功", null); + } + return fail("添加失败", null); + } + + @PreAuthorize("hasAuthority('sys:dict:remove')") + @OperationLog + @Operation(summary = "批量删除字典") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (dictService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/DictDataController.java b/src/main/java/com/gxwebsoft/common/system/controller/DictDataController.java new file mode 100644 index 0000000..39d8e70 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/DictDataController.java @@ -0,0 +1,143 @@ +package com.gxwebsoft.common.system.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.gxwebsoft.common.core.annotation.OperationLog; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.Dict; +import com.gxwebsoft.common.system.entity.DictData; +import com.gxwebsoft.common.system.param.DictDataParam; +import com.gxwebsoft.common.system.service.DictDataService; +import com.gxwebsoft.common.system.service.DictService; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 字典数据控制器 + * + * @author WebSoft + * @since 2020-03-14 11:29:04 + */ +@Tag(name = "字典") +@RestController +@RequestMapping("/api/system/dict-data") +public class DictDataController extends BaseController { + @Resource + private DictDataService dictDataService; + @Resource + private DictService dictService; + + @Operation(summary = "分页查询字典数据") + @GetMapping("/page") + public ApiResult> page(DictDataParam param) { + return success(dictDataService.pageRel(param)); + } + + @Operation(summary = "查询全部字典数据") + @GetMapping() + public ApiResult> list(DictDataParam param) { + return success(dictDataService.listRel(param)); + } + + @Operation(summary = "根据id查询字典数据") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + return success(dictDataService.getByIdRel(id)); + } + + @PreAuthorize("hasAuthority('sys:dict:save')") + @OperationLog + @Operation(summary = "添加字典数据") + @PostMapping() + public ApiResult add(@RequestBody DictData dictData) { + if (dictDataService.count(new LambdaQueryWrapper() + .eq(DictData::getDictId, dictData.getDictId()) + .eq(DictData::getDictDataName, dictData.getDictDataName())) > 0) { + return fail("字典数据名称已存在"); + } + if (dictDataService.count(new LambdaQueryWrapper() + .eq(DictData::getDictId, dictData.getDictId()) + .eq(DictData::getDictDataCode, dictData.getDictDataCode())) > 0) { + return fail("字典数据标识已存在"); + } + // 自动添加字典 + final int count = dictService.count(new LambdaQueryWrapper().eq(Dict::getDictCode, dictData.getDictCode())); + if (dictData.getDictCode() != null && count == 0) { + final Dict dict = new Dict(); + dict.setDictCode(dictData.getDictCode()); + dict.setDictName(dictData.getDictCode()); + if (dictData.getDictName() != null) { + dict.setDictName(dictData.getDictName()); + } + if(dictService.save(dict)){ + dictData.setDictId(dict.getDictId()); + } + } + if (dictDataService.save(dictData)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:dict:update')") + @Operation(summary = "修改字典数据") + @PutMapping() + public ApiResult update(@RequestBody DictData dictData) { + if (dictDataService.count(new LambdaQueryWrapper() + .eq(DictData::getDictId, dictData.getDictId()) + .eq(DictData::getDictDataName, dictData.getDictDataName()) + .ne(DictData::getDictDataId, dictData.getDictDataId())) > 0) { + return fail("字典数据名称已存在"); + } + if (dictDataService.count(new LambdaQueryWrapper() + .eq(DictData::getDictId, dictData.getDictId()) + .eq(DictData::getDictDataCode, dictData.getDictDataCode()) + .ne(DictData::getDictDataId, dictData.getDictDataId())) > 0) { + return fail("字典数据标识已存在"); + } + if (dictDataService.updateById(dictData)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:dict:remove')") + @OperationLog + @Operation(summary = "删除字典数据") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (dictDataService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:dict:save')") + @OperationLog + @Operation(summary = "批量添加字典数据") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List dictDataList) { + if (dictDataService.saveBatch(dictDataList)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:dict:remove')") + @OperationLog + @Operation(summary = "批量删除字典数据") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (dictDataService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/DictionaryController.java b/src/main/java/com/gxwebsoft/common/system/controller/DictionaryController.java new file mode 100644 index 0000000..020e82e --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/DictionaryController.java @@ -0,0 +1,155 @@ +package com.gxwebsoft.common.system.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.gxwebsoft.common.core.annotation.OperationLog; +import com.gxwebsoft.common.core.utils.CommonUtil; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.Dictionary; +import com.gxwebsoft.common.system.param.DictionaryParam; +import com.gxwebsoft.common.system.service.DictionaryService; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 字典控制器 + * + * @author WebSoft + * @since 2020-03-14 11:29:03 + */ +@Tag(name = "字典(公共字典)") +@RestController +@RequestMapping("/api/system/dictionary") +public class DictionaryController extends BaseController { + @Resource + private DictionaryService dictionaryService; + + @PreAuthorize("hasAuthority('sys:dictionary:list')") + @OperationLog + @Operation(summary = "分页查询字典") + @GetMapping("/page") + public ApiResult> page(DictionaryParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("sort_number"); + return success(dictionaryService.page(page, page.getWrapper())); + } + + @PreAuthorize("hasAuthority('sys:dictionary:list')") + @OperationLog + @Operation(summary = "查询全部字典") + @GetMapping() + public ApiResult> list(DictionaryParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("sort_number"); + return success(dictionaryService.list(page.getOrderWrapper())); + } + + @PreAuthorize("hasAuthority('sys:dictionary:list')") + @OperationLog + @Operation(summary = "根据id查询字典") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + return success(dictionaryService.getById(id)); + } + + @PreAuthorize("hasAuthority('sys:dictionary:save')") + @Operation(summary = "添加字典") + @PostMapping() + public ApiResult add(@RequestBody Dictionary dictionary) { + if (dictionaryService.count(new LambdaQueryWrapper() + .eq(Dictionary::getDictCode, dictionary.getDictCode())) > 0) { + return fail("字典标识已存在"); + } + if (dictionaryService.count(new LambdaQueryWrapper() + .eq(Dictionary::getDictName, dictionary.getDictName())) > 0) { + return fail("字典名称已存在"); + } + if (dictionaryService.save(dictionary)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:dictionary:update')") + @OperationLog + @Operation(summary = "修改字典") + @PutMapping() + public ApiResult update(@RequestBody Dictionary dictionary) { + if (dictionaryService.count(new LambdaQueryWrapper() + .eq(Dictionary::getDictCode, dictionary.getDictCode()) + .ne(Dictionary::getDictId, dictionary.getDictId())) > 0) { + return fail("字典标识已存在"); + } + if (dictionaryService.count(new LambdaQueryWrapper() + .eq(Dictionary::getDictName, dictionary.getDictName()) + .ne(Dictionary::getDictId, dictionary.getDictId())) > 0) { + return fail("字典名称已存在"); + } + if (dictionaryService.updateById(dictionary)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:dictionary:remove')") + @OperationLog + @Operation(summary = "删除字典") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (dictionaryService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:dictionary:save')") + @OperationLog + @Operation(summary = "批量添加字典") + @PostMapping("/batch") + public ApiResult> saveBatch(@RequestBody List list) { + if (CommonUtil.checkRepeat(list, Dictionary::getDictCode)) { + return fail("字典标识不能重复", null); + } + if (CommonUtil.checkRepeat(list, Dictionary::getDictName)) { + return fail("字典名称不能重复", null); + } + List codeExists = dictionaryService.list(new LambdaQueryWrapper() + .in(Dictionary::getDictCode, list.stream().map(Dictionary::getDictCode) + .collect(Collectors.toList()))); + if (codeExists.size() > 0) { + return fail("字典标识已存在", codeExists.stream().map(Dictionary::getDictCode) + .collect(Collectors.toList())).setCode(2); + } + List nameExists = dictionaryService.list(new LambdaQueryWrapper() + .in(Dictionary::getDictName, list.stream().map(Dictionary::getDictCode) + .collect(Collectors.toList()))); + if (nameExists.size() > 0) { + return fail("字典名称已存在", nameExists.stream().map(Dictionary::getDictName) + .collect(Collectors.toList())).setCode(3); + } + if (dictionaryService.saveBatch(list)) { + return success("添加成功", null); + } + return fail("添加失败", null); + } + + @PreAuthorize("hasAuthority('sys:dictionary:remove')") + @OperationLog + @Operation(summary = "批量删除字典") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (dictionaryService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/DictionaryDataController.java b/src/main/java/com/gxwebsoft/common/system/controller/DictionaryDataController.java new file mode 100644 index 0000000..e83f8ad --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/DictionaryDataController.java @@ -0,0 +1,125 @@ +package com.gxwebsoft.common.system.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.gxwebsoft.common.core.annotation.OperationLog; +import com.gxwebsoft.common.core.web.*; +import com.gxwebsoft.common.system.entity.DictionaryData; +import com.gxwebsoft.common.system.param.DictionaryDataParam; +import com.gxwebsoft.common.system.service.DictionaryDataService; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 字典数据控制器 + * + * @author WebSoft + * @since 2020-03-14 11:29:04 + */ +@Tag(name = "字典(公共字典)") +@RestController +@RequestMapping("/api/system/dictionary-data") +public class DictionaryDataController extends BaseController { + @Resource + private DictionaryDataService dictionaryDataService; + + @Operation(summary = "分页查询字典数据") + @GetMapping("/page") + public ApiResult> page(DictionaryDataParam param) { + return success(dictionaryDataService.pageRel(param)); + } + + @Operation(summary = "查询全部字典数据") + @GetMapping() + public ApiResult> list(DictionaryDataParam param) { + return success(dictionaryDataService.listRel(param)); + } + + @PreAuthorize("hasAuthority('sys:dictionary:list')") + @Operation(summary = "根据id查询字典数据") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + return success(dictionaryDataService.getByIdRel(id)); + } + + @PreAuthorize("hasAuthority('sys:dictionary:save')") + @OperationLog + @Operation(summary = "添加字典数据") + @PostMapping() + public ApiResult add(@RequestBody DictionaryData dictionaryData) { + if (dictionaryDataService.count(new LambdaQueryWrapper() + .eq(DictionaryData::getDictId, dictionaryData.getDictId()) + .eq(DictionaryData::getDictDataName, dictionaryData.getDictDataName())) > 0) { + return fail("字典数据名称已存在"); + } + if (dictionaryDataService.count(new LambdaQueryWrapper() + .eq(DictionaryData::getDictId, dictionaryData.getDictId()) + .eq(DictionaryData::getDictDataCode, dictionaryData.getDictDataCode())) > 0) { + return fail("字典数据标识已存在"); + } + if (dictionaryDataService.save(dictionaryData)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:dictionary:update')") + @Operation(summary = "修改字典数据") + @PutMapping() + public ApiResult update(@RequestBody DictionaryData dictionaryData) { + if (dictionaryDataService.count(new LambdaQueryWrapper() + .eq(DictionaryData::getDictId, dictionaryData.getDictId()) + .eq(DictionaryData::getDictDataName, dictionaryData.getDictDataName()) + .ne(DictionaryData::getDictDataId, dictionaryData.getDictDataId())) > 0) { + return fail("字典数据名称已存在"); + } + if (dictionaryDataService.count(new LambdaQueryWrapper() + .eq(DictionaryData::getDictId, dictionaryData.getDictId()) + .eq(DictionaryData::getDictDataCode, dictionaryData.getDictDataCode()) + .ne(DictionaryData::getDictDataId, dictionaryData.getDictDataId())) > 0) { + return fail("字典数据标识已存在"); + } + if (dictionaryDataService.updateById(dictionaryData)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:dictionary:remove')") + @OperationLog + @Operation(summary = "删除字典数据") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (dictionaryDataService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:dictionary:save')") + @OperationLog + @Operation(summary = "批量添加字典数据") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List dictDataList) { + if (dictionaryDataService.saveBatch(dictDataList)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:dictionary:remove')") + @OperationLog + @Operation(summary = "批量删除字典数据") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (dictionaryDataService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/DomainController.java b/src/main/java/com/gxwebsoft/common/system/controller/DomainController.java new file mode 100644 index 0000000..79db3ab --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/DomainController.java @@ -0,0 +1,135 @@ +package com.gxwebsoft.common.system.controller; + +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.common.system.service.DomainService; +import com.gxwebsoft.common.system.entity.Domain; +import com.gxwebsoft.common.system.param.DomainParam; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.BatchParam; +import com.gxwebsoft.common.core.annotation.OperationLog; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 授权域名控制器 + * + * @author 科技小王子 + * @since 2024-09-19 23:56:33 + */ +@Tag(name = "授权域名管理") +@RestController +@RequestMapping("/api/system/domain") +public class DomainController extends BaseController { + @Resource + private DomainService domainService; + + @Operation(summary = "分页查询授权域名") + @GetMapping("/page") + public ApiResult> page(DomainParam param) { + // 使用关联查询 + return success(domainService.pageRel(param)); + } + + @Operation(summary = "查询全部授权域名") + @GetMapping() + public ApiResult> list(DomainParam param) { + // 使用关联查询 + return success(domainService.listRel(param)); + } + + @PreAuthorize("hasAuthority('sys:domain:list')") + @OperationLog + @Operation(summary = "根据id查询授权域名") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + // 使用关联查询 + return success(domainService.getByIdRel(id)); + } + + @Operation(summary = "根据domain查询授权域名") + @GetMapping("/getByDomain/{domain}") + public ApiResult getByDomain(@PathVariable("domain") String domain) { + // 使用关联查询 + return success(domainService.getByDomainRel(domain)); + } + + @PreAuthorize("hasAuthority('sys:domain:save')") + @OperationLog + @Operation(summary = "添加授权域名") + @PostMapping() + public ApiResult save(@RequestBody Domain domain) { + // 记录当前登录用户id + User loginUser = getLoginUser(); + if (loginUser != null) { + domain.setUserId(loginUser.getUserId()); + } + if (domainService.save(domain)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:domain:update')") + @OperationLog + @Operation(summary = "修改授权域名") + @PutMapping() + public ApiResult update(@RequestBody Domain domain) { + if (domainService.updateById(domain)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:domain:remove')") + @OperationLog + @Operation(summary = "删除授权域名") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (domainService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:domain:save')") + @OperationLog + @Operation(summary = "批量添加授权域名") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (domainService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:domain:update')") + @OperationLog + @Operation(summary = "批量修改授权域名") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(domainService, "id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:domain:remove')") + @OperationLog + @Operation(summary = "批量删除授权域名") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (domainService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/EmailController.java b/src/main/java/com/gxwebsoft/common/system/controller/EmailController.java new file mode 100644 index 0000000..66f9c4f --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/EmailController.java @@ -0,0 +1,49 @@ +package com.gxwebsoft.common.system.controller; + +import com.gxwebsoft.common.core.annotation.OperationLog; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.system.entity.EmailRecord; +import com.gxwebsoft.common.system.service.EmailRecordService; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +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.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import javax.mail.MessagingException; + +/** + * 邮件控制器 + * + * @author WebSoft + * @since 2020-03-21 00:37:11 + */ +@Tag(name = "邮件") +@RestController +@RequestMapping("/api/system/email") +public class EmailController extends BaseController { + @Resource + private EmailRecordService emailRecordService; + + @PreAuthorize("hasAuthority('sys:email:send')") + @OperationLog + @Operation(summary = "发送邮件") + @PostMapping() + public ApiResult send(@RequestBody EmailRecord emailRecord) { + try { + emailRecordService.sendFullTextEmail(emailRecord.getTitle(), emailRecord.getContent(), + emailRecord.getReceiver().split(",")); + emailRecord.setCreateUserId(getLoginUserId()); + emailRecordService.save(emailRecord); + return success("发送成功"); + } catch (MessagingException e) { + e.printStackTrace(); + } + return fail("发送失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/EmailTestController.java b/src/main/java/com/gxwebsoft/common/system/controller/EmailTestController.java new file mode 100644 index 0000000..6e4c3f4 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/EmailTestController.java @@ -0,0 +1,116 @@ +package com.gxwebsoft.common.system.controller; + +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.system.util.EmailTemplateUtil; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; + +/** + * 邮件测试控制器 + * 用于测试邮件模板功能 + * + * @author WebSoft + * @since 2024-08-28 + */ +@Tag(name = "邮件测试") +@RestController +@RequestMapping("/api/email-test") +public class EmailTestController extends BaseController { + + @Resource + private EmailTemplateUtil emailTemplateUtil; + + @Operation(summary = "测试注册成功邮件") + @PostMapping("/register-success") + public ApiResult testRegisterSuccessEmail(@RequestParam String email) { + try { + emailTemplateUtil.sendRegisterSuccessEmail( + "测试用户", + "13800138000", + "TestPassword123", + email, + getTenantId() + ); + return success("注册成功邮件发送成功"); + } catch (Exception e) { + return fail("邮件发送失败: " + e.getMessage()); + } + } + + @Operation(summary = "测试密码重置邮件") + @PostMapping("/password-reset") + public ApiResult testPasswordResetEmail(@RequestParam String email) { + try { + emailTemplateUtil.sendPasswordResetEmail( + "测试用户", + "13800138000", + "NewPassword456", + email, + getTenantId() + ); + return success("密码重置邮件发送成功"); + } catch (Exception e) { + return fail("邮件发送失败: " + e.getMessage()); + } + } + + @Operation(summary = "测试通知邮件") + @PostMapping("/notification") + public ApiResult testNotificationEmail(@RequestParam String email, + @RequestParam(required = false) String title, + @RequestParam(required = false) String content) { + try { + String emailTitle = title != null ? title : "WebSoft系统通知"; + String emailContent = content != null ? content : "这是一条测试通知消息,用于验证邮件模板功能是否正常工作。"; + + emailTemplateUtil.sendNotificationEmailWithAction( + emailTitle, + emailContent, + email, + getTenantId(), + "https://www.gxwebsoft.com", + "访问官网" + ); + return success("通知邮件发送成功"); + } catch (Exception e) { + return fail("邮件发送失败: " + e.getMessage()); + } + } + + @Operation(summary = "测试安全提醒邮件") + @PostMapping("/security-alert") + public ApiResult testSecurityAlertEmail(@RequestParam String email) { + try { + emailTemplateUtil.sendSecurityAlertEmail( + "测试用户", + "13800138000", + email, + getTenantId(), + "异地登录检测" + ); + return success("安全提醒邮件发送成功"); + } catch (Exception e) { + return fail("邮件发送失败: " + e.getMessage()); + } + } + + @Operation(summary = "测试系统维护通知邮件") + @PostMapping("/maintenance") + public ApiResult testMaintenanceEmail(@RequestParam String email) { + try { + emailTemplateUtil.sendMaintenanceNotificationEmail( + email, + getTenantId(), + "2024年8月28日 23:00-24:00", + "1小时" + ); + return success("维护通知邮件发送成功"); + } catch (Exception e) { + return fail("邮件发送失败: " + e.getMessage()); + } + } +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/EnvironmentController.java b/src/main/java/com/gxwebsoft/common/system/controller/EnvironmentController.java new file mode 100644 index 0000000..9ba356b --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/EnvironmentController.java @@ -0,0 +1,139 @@ +package com.gxwebsoft.common.system.controller; + +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.common.system.service.EnvironmentService; +import com.gxwebsoft.common.system.entity.Environment; +import com.gxwebsoft.common.system.param.EnvironmentParam; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.BatchParam; +import com.gxwebsoft.common.core.annotation.OperationLog; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 环境管理控制器 + * + * @author 科技小王子 + * @since 2023-10-18 08:45:13 + */ +@Tag(name = "环境管理") +@RestController +@RequestMapping("/api/system/environment") +public class EnvironmentController extends BaseController { + @Resource + private EnvironmentService environmentService; + + @PreAuthorize("hasAuthority('sys:company:list')") + @OperationLog + @Operation(summary = "分页查询环境管理") + @GetMapping("/page") + public ApiResult> page(EnvironmentParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + return success(environmentService.page(page, page.getWrapper())); + // 使用关联查询 + //return success(environmentService.pageRel(param)); + } + + @PreAuthorize("hasAuthority('sys:company:list')") + @OperationLog + @Operation(summary = "查询全部环境管理") + @GetMapping() + public ApiResult> list(EnvironmentParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + return success(environmentService.list(page.getOrderWrapper())); + // 使用关联查询 + //return success(environmentService.listRel(param)); + } + + @PreAuthorize("hasAuthority('sys:company:list')") + @OperationLog + @Operation(summary = "根据id查询环境管理") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + return success(environmentService.getById(id)); + // 使用关联查询 + //return success(environmentService.getByIdRel(id)); + } + + @PreAuthorize("hasAuthority('sys:company:save')") + @OperationLog + @Operation(summary = "添加环境管理") + @PostMapping() + public ApiResult save(@RequestBody Environment environment) { + // 记录当前登录用户id + User loginUser = getLoginUser(); + if (loginUser != null) { + environment.setUserId(loginUser.getUserId()); + } + if (environmentService.save(environment)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:company:update')") + @OperationLog + @Operation(summary = "修改环境管理") + @PutMapping() + public ApiResult update(@RequestBody Environment environment) { + if (environmentService.updateById(environment)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:company:remove')") + @OperationLog + @Operation(summary = "删除环境管理") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (environmentService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:company:save')") + @OperationLog + @Operation(summary = "批量添加环境管理") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (environmentService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:company:update')") + @OperationLog + @Operation(summary = "批量修改环境管理") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(environmentService, "id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:company:remove')") + @OperationLog + @Operation(summary = "批量删除环境管理") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (environmentService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/FileController.java b/src/main/java/com/gxwebsoft/common/system/controller/FileController.java new file mode 100644 index 0000000..324684e --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/FileController.java @@ -0,0 +1,344 @@ +package com.gxwebsoft.common.system.controller; + +import cn.hutool.core.util.StrUtil; +import com.gxwebsoft.common.core.annotation.OperationLog; +import com.gxwebsoft.common.core.config.ConfigProperties; +import com.gxwebsoft.common.core.utils.FileServerUtil; +import com.gxwebsoft.common.core.utils.RedisUtil; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.FileRecord; +import com.gxwebsoft.common.system.param.FileRecordParam; +import com.gxwebsoft.common.system.service.CompanyService; +import com.gxwebsoft.common.system.service.FileRecordService; +import com.gxwebsoft.common.system.service.SettingService; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; + +/** + * 文件上传下载控制器 + * + * @author WebSoft + * @since 2018-12-24 16:10:24 + */ +@Tag(name = "文件上传下载") +@RestController +@RequestMapping("/api/file") +public class FileController extends BaseController { + @Resource + private ConfigProperties config; + @Resource + private RedisUtil redisUtil; + @Resource + private FileRecordService fileRecordService; + @Resource + private CompanyService companyService; + @Resource + private SettingService settingService; + + @PreAuthorize("hasAuthority('sys:file:upload')") + @OperationLog + @Operation(summary = "上传文件") + @PostMapping("/upload") + public ApiResult upload(@RequestParam MultipartFile file, HttpServletRequest request) { + FileRecord result = null; + try { + String dir = getUploadDir(); + File upload = FileServerUtil.upload(file, dir, config.getUploadUuidName()); + String path = upload.getAbsolutePath().replace("\\", "/").substring(dir.length() - 1); +// String requestURL = StrUtil.removeSuffix(request.getRequestURL(), "/upload"); + String requestURL = config.getFileServer() + "/api/file"; + String originalName = file.getOriginalFilename(); + result = new FileRecord(); + result.setCreateUserId(getLoginUserId()); + result.setName(StrUtil.isBlank(originalName) ? upload.getName() : originalName); + result.setLength(upload.length()); + result.setPath(path); + result.setUrl(requestURL + path); + String contentType = FileServerUtil.getContentType(upload); + result.setContentType(contentType); + if (FileServerUtil.isImage(contentType)) { + result.setThumbnail(requestURL + "/thumbnail" + path); + } + result.setDownloadUrl(config.getFileServer() + "/download" + path); + // 云存储配置 +// final String s = redisUtil.get("setting:upload:" + getTenantId()); +// +// final JSONObject jsonObject = JSONObject.parseObject(s); +// final String uploadMethod = jsonObject.getString("uploadMethod"); +// final String bucketDomain = jsonObject.getString("bucketDomain"); +// if(!uploadMethod.equals("file")){ +// path = bucketDomain + path; +// } + result.setUrl(path); + fileRecordService.save(result); + return success(result); + } catch (Exception e) { + e.printStackTrace(); + return fail("上传失败", result).setError(e.toString()); + } + } + + @PreAuthorize("hasAuthority('sys:file:upload')") + @OperationLog + @Operation(summary = "上传base64文件") + @PostMapping("/upload/base64") + public ApiResult uploadBase64( + @Parameter(description = "base64编码的文件内容", required = true) String base64, + @Parameter(description = "文件名称") String fileName, + HttpServletRequest request) { + FileRecord result = null; + try { + String dir = getUploadDir(); + File upload = FileServerUtil.upload(base64, fileName, getUploadDir()); + String path = upload.getAbsolutePath().substring(dir.length()).replace("\\", "/"); + String requestURL = StrUtil.removeSuffix(request.getRequestURL(), "/upload/base64"); + result = new FileRecord(); + result.setCreateUserId(getLoginUserId()); + result.setName(StrUtil.isBlank(fileName) ? upload.getName() : fileName); + result.setLength(upload.length()); + result.setPath(path); + result.setUrl(requestURL + path); + result.setThumbnail(FileServerUtil.isImage(upload) ? (requestURL + "/thumbnail" + path) : null); + fileRecordService.save(result); + return success(result); + } catch (Exception e) { + e.printStackTrace(); + return fail("上传失败", result).setError(e.toString()); + } + } + + @PreAuthorize("hasAuthority('sys:file:upload')") + @OperationLog + @Operation(summary = "上传图片") + @PostMapping("/image") + public HashMap image(@RequestParam MultipartFile file, HttpServletRequest request) { + FileRecord result = null; + try { + String dir = getUploadDir(); + File upload = FileServerUtil.upload(file, dir, config.getUploadUuidName()); + String path = upload.getAbsolutePath().replace("\\", "/").substring(dir.length() - 1); +// System.out.println("request.getRequestURL() = " + request.getRequestURL()); +// String requestURL = StrUtil.removeSuffix(request.getRequestURL(), "/image"); + String requestURL = config.getFileServer() + "/api/file"; +// System.out.println("requestURL = " + requestURL); +// config.getServerUrl() + String originalName = file.getOriginalFilename(); + result = new FileRecord(); + result.setCreateUserId(getLoginUserId()); + result.setName(StrUtil.isBlank(originalName) ? upload.getName() : originalName); + result.setLength(upload.length()); + result.setPath(path); + result.setUrl(path); + String contentType = FileServerUtil.getContentType(upload); + result.setContentType(contentType); + if (FileServerUtil.isImage(contentType)) { + result.setThumbnail(requestURL + "/thumbnail" + path); + } + result.setDownloadUrl(requestURL + "/download" + path); + final HashMap map = new HashMap<>(); + map.put("name",result.getName()); + map.put("status","done"); + map.put("thumbUrl",result.getThumbnail()); + map.put("downloadUrl",result.getDownloadUrl()); + map.put("url",result.getUrl()); + fileRecordService.save(result); + return map; + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + + @PreAuthorize("hasAuthority('sys:file:list')") + @OperationLog + @Operation(summary = "根据id查询文件") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + return success(fileRecordService.getByIdRel(id)); + } + + @Operation(summary = "查看原文件") + @GetMapping("/{dir}/{name:.+}") + public void preview(@PathVariable("dir") String dir, @PathVariable("name") String name, + HttpServletResponse response, HttpServletRequest request) { + File file = new File(getUploadDir(), dir + "/" + name); + FileServerUtil.preview(file, getPdfOutDir(), config.getOpenOfficeHome(), response, request); + } + + @Operation(summary = "下载原文件") + @GetMapping("/download/{dir}/{name:.+}") + public void download(@PathVariable("dir") String dir, @PathVariable("name") String name, + HttpServletResponse response, HttpServletRequest request) { + String path = dir + "/" + name; + FileRecord record = fileRecordService.getByIdPath(path); + File file = new File(getUploadDir(), path); + String fileName = record == null ? file.getName() : record.getName(); + FileServerUtil.preview(file, true, fileName, null, null, response, request); + } + + @Operation(summary = "查看缩略图") + @GetMapping("/thumbnail/{dir}/{name:.+}") + public void thumbnail(@PathVariable("dir") String dir, @PathVariable("name") String name, + HttpServletResponse response, HttpServletRequest request) { + File file = new File(getUploadDir(), dir + "/" + name); + File thumbnail = new File(getUploadSmDir(), dir + "/" + name); + FileServerUtil.previewThumbnail(file, thumbnail, config.getThumbnailSize(), response, request); + } + + @PreAuthorize("hasAuthority('sys:file:remove')") + @OperationLog + @Operation(summary = "删除文件") + @DeleteMapping("/remove/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + FileRecord record = fileRecordService.getById(id); + List fileRecords = new ArrayList<>(); + fileRecords.add(record); + if (fileRecordService.removeById(id)) { + if (StrUtil.isNotBlank(record.getPath())) { + // 删除文件 + fileRecordService.deleteFileAsync(Arrays.asList( + new File(getUploadDir(), record.getPath()), + new File(getUploadSmDir(), record.getPath()) + )); + } + fileRecordService.deleteOssFileAsync(fileRecords); + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:file:remove')") + @OperationLog + @Operation(summary = "批量删除文件") + @DeleteMapping("/remove/batch") + public ApiResult deleteBatch(@Parameter(description = "要删除的文件ID数组", required = true) @RequestBody List ids) { + List fileRecords = fileRecordService.listByIds(ids); + if (fileRecordService.removeByIds(ids)) { + List files = new ArrayList<>(); + for (FileRecord record : fileRecords) { + if (StrUtil.isNotBlank(record.getPath())) { + files.add(new File(getUploadDir(), record.getPath())); + files.add(new File(getUploadSmDir(), record.getPath())); + } + } + fileRecordService.deleteFileAsync(files); + fileRecordService.deleteOssFileAsync(fileRecords); + return success("删除成功"); + } + return fail("删除失败"); + } + + @Operation(summary = "分页查询文件") + @GetMapping("/page") + public ApiResult> page(FileRecordParam param, HttpServletRequest request) { + PageResult result = fileRecordService.pageRel(param); +// String requestURL = StrUtil.removeSuffix(request.getRequestURL(), "/page"); + String requestURL = config.getFileServer(); + for (FileRecord record : result.getList()) { + if (StrUtil.isNotBlank(record.getPath())) { + record.setDownloadUrl(record.getPath()); + if (FileServerUtil.isImage(record.getContentType())) { + record.setThumbnail(record.getPath() + "?x-oss-process=image/resize,m_fixed,w_100,h_100/quality,Q_90"); + record.setPath(record.getPath() + "?x-oss-process=image/resize,m_fixed,w_750/quality,Q_90"); + record.setUrl(record.getDownloadUrl() + "?x-oss-process=image/resize,m_fixed,w_750/quality,Q_90"); + record.setBigImage(record.getDownloadUrl() + "?x-oss-process=image/resize,m_fixed,w_2000/quality,Q_90"); + } + + } + } + return success(result); + } + + @Operation(summary = "查询全部文件") + @GetMapping("/list") + public ApiResult> list(FileRecordParam param, HttpServletRequest request) { + List records = fileRecordService.listRel(param); +// String requestURL = StrUtil.removeSuffix(request.getRequestURL(), "/list"); + String requestURL = config.getFileServer(); + for (FileRecord record : records) { + if (StrUtil.isNotBlank(record.getPath())) { + record.setDownloadUrl(record.getPath()); + if (FileServerUtil.isImage(record.getContentType())) { + record.setThumbnail(record.getPath() + "?x-oss-process=image/resize,m_fixed,w_100,h_100/quality,Q_90"); + record.setPath(record.getPath() + "?x-oss-process=image/resize,m_fixed,w_750/quality,Q_90"); + record.setUrl(record.getDownloadUrl() + "?x-oss-process=image/resize,m_fixed,w_750/quality,Q_90"); + record.setBigImage(record.getDownloadUrl() + "?x-oss-process=image/resize,m_fixed,w_2000/quality,Q_90"); + } + } + } + return success(records); + } + + /** + * 文件上传基目录 + */ + private String getUploadBaseDir() { + return config.getUploadPath() + "/"; + } + + /** + * 文件上传位置(服务器) + */ + private String getUploadDir() { + return config.getUploadPath() + "/"; + } + + /** + * 文件上传位置(本地) + */ +// private String getUploadDir() { +// return "/Users/gxwebsoft/Documents/uploads/"; +// } + + /** + * 缩略图生成位置 + */ + private String getUploadSmDir() { + return getUploadBaseDir() + "thumbnail/"; + } + + /** + * office转pdf输出位置 + */ + private String getPdfOutDir() { + return getUploadBaseDir() + "pdf/"; + } + + @PreAuthorize("hasAuthority('sys:file:upload')") + @OperationLog + @Operation(summary = "添加文件") + @PostMapping() + public ApiResult save(@RequestBody FileRecord fileRecord) { + if (fileRecordService.save(fileRecord)) { + return success("上传成功"); + } + return fail("上传失败"); + } + + @PreAuthorize("hasAuthority('sys:file:update')") + @OperationLog + @Operation(summary = "修改文件") + @PutMapping() + public ApiResult update(@RequestBody FileRecord fileRecord) { + if (fileRecordService.updateById(fileRecord)) { + return success("修改成功"); + } + return fail("修改失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/LoginRecordController.java b/src/main/java/com/gxwebsoft/common/system/controller/LoginRecordController.java new file mode 100644 index 0000000..265e6dc --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/LoginRecordController.java @@ -0,0 +1,58 @@ +package com.gxwebsoft.common.system.controller; + +import com.gxwebsoft.common.core.annotation.OperationLog; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.LoginRecord; +import com.gxwebsoft.common.system.param.LoginRecordParam; +import com.gxwebsoft.common.system.service.LoginRecordService; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +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.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 登录日志控制器 + * + * @author WebSoft + * @since 2018-12-24 16:10:31 + */ +@Tag(name = "登录日志") +@RestController +@RequestMapping("/api/system/login-record") +public class LoginRecordController extends BaseController { + @Resource + private LoginRecordService loginRecordService; + + @PreAuthorize("hasAuthority('sys:login-record:list')") + @OperationLog + @Operation(summary = "分页查询登录日志") + @GetMapping("/page") + public ApiResult> page(LoginRecordParam param) { + return success(loginRecordService.pageRel(param)); + } + + @PreAuthorize("hasAuthority('sys:login-record:list')") + @OperationLog + @Operation(summary = "查询全部登录日志") + @GetMapping() + public ApiResult> list(LoginRecordParam param) { + return success(loginRecordService.listRel(param)); + } + + @PreAuthorize("hasAuthority('sys:login-record:list')") + @OperationLog + @Operation(summary = "根据id查询登录日志") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + return success(loginRecordService.getByIdRel(id)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/MainController.java b/src/main/java/com/gxwebsoft/common/system/controller/MainController.java new file mode 100644 index 0000000..654c085 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/MainController.java @@ -0,0 +1,1125 @@ +package com.gxwebsoft.common.system.controller; + +import cn.hutool.core.date.DateField; +import cn.hutool.core.date.DateTime; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.DesensitizedUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; +import com.aliyuncs.CommonRequest; +import com.aliyuncs.CommonResponse; +import com.aliyuncs.DefaultAcsClient; +import com.aliyuncs.IAcsClient; +import com.aliyuncs.exceptions.ClientException; +import com.aliyuncs.exceptions.ServerException; +import com.aliyuncs.http.MethodType; +import com.aliyuncs.profile.DefaultProfile; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.google.gson.Gson; +import com.gxwebsoft.common.core.annotation.OperationLog; +import com.gxwebsoft.common.core.config.ConfigProperties; +import com.gxwebsoft.common.core.exception.BusinessException; +import com.gxwebsoft.common.core.security.JwtSubject; +import com.gxwebsoft.common.core.security.JwtUtil; +import com.gxwebsoft.common.core.utils.CacheClient; +import com.gxwebsoft.common.core.utils.CommonUtil; +import com.gxwebsoft.common.core.utils.DomainUtil; +import com.gxwebsoft.common.core.utils.RedisUtil; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.core.web.ExistenceParam; +import com.gxwebsoft.common.system.entity.*; +import com.gxwebsoft.common.system.mapper.CompanyMapper; +import com.gxwebsoft.common.system.param.LoginParam; +import com.gxwebsoft.common.system.param.SmsCaptchaParam; +import com.gxwebsoft.common.system.param.FindAccountByPhoneParam; +import com.gxwebsoft.common.system.param.ResetPasswordParam; +import com.gxwebsoft.common.system.param.UpdatePasswordParam; +import com.gxwebsoft.common.system.param.UserParam; +import com.gxwebsoft.common.system.result.CaptchaResult; +import com.gxwebsoft.common.system.result.LoginResult; +import com.gxwebsoft.common.system.result.AccountInfoResult; +import com.gxwebsoft.common.system.result.CheckPhoneResult; +import com.gxwebsoft.common.system.service.*; +import com.gxwebsoft.common.system.util.EmailTemplateUtil; +import com.wf.captcha.SpecCaptcha; +import io.jsonwebtoken.Claims; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.transaction.annotation.Isolation; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.text.MessageFormat; +import java.time.Instant; +import java.time.LocalDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.ThreadLocalRandom; + +import static com.gxwebsoft.common.core.constants.WebsiteConstants.CACHE_KEY_UNIVERSAL_PASSWORD; +import static com.gxwebsoft.common.core.constants.WebsiteConstants.CACHE_KEY_VERIFICATION_CODE_BY_DEV_SMS; + +/** + * 登录认证控制器 + * + * @author WebSoft + * @since 2018-12-24 16:10:11 + */ +@Slf4j +@Tag(name = "登录认证") +@RestController +@RequestMapping("/api") +public class MainController extends BaseController { + @Resource + private ConfigProperties configProperties; + @Resource + private UserService userService; + @Resource + private RoleMenuService roleMenuService; + @Resource + private LoginRecordService loginRecordService; + @Resource + private CacheClient cacheClient; + @Resource + private RedisUtil redisUtil; + @Resource + private AccessKeyService accessKeyService; + @Resource + private TenantService tenantService; + @Resource + private CompanyMapper companyMapper; + @Resource + private UserRoleService userRoleService; + @Resource + private UserRefereeService userRefereeService; + @Resource + private EmailRecordService emailRecordService; + @Resource + private EmailTemplateUtil emailTemplateUtil; + + + @Operation(summary = "用户登录") + @PostMapping("/login") + public ApiResult login(@RequestBody LoginParam param, HttpServletRequest request) { + // 设置过期时间 + Long tokenExpireTime = configProperties.getTokenExpireTime(); + String username = param.getUsername(); + // 租户ID + Integer tenantId = 5; + // 用户信息 + User user = null; + + // 普通用户登录 + if(param.getTenantId() != null){ + // 表单主动交租户ID + tenantId = param.getTenantId(); + }else { + // 从域名获取租户ID + tenantId = getTenantId(); + } + + // 管理员登录 + if(param.getIsSuperAdmin() != null){ + // 如果是手机号码登录 +// if(username.matches("\\d+") && username.length() == 11){ +// final LoginParam loginParam = new LoginParam(); +// loginParam.setPhone(username); +// loginParam.setTenantId(tenantId); +// final List adminsByPhone = userService.getAdminsByPhone(loginParam); +// if(adminsByPhone.isEmpty()){ +// return fail("用户不存在",null); +// } +// user = adminsByPhone.get(0); +// // 签发token +// String access_token = JwtUtil.buildToken(new JwtSubject(username, user.getTenantId()), +// tokenExpireTime, configProperties.getTokenKey()); +// // 同一个手机号码存在多个管理员账号 +// if(adminsByPhone.size() > 1){ +// String message = "请选择登录用户"; +// user.setHasAdminsByPhone(true); +// return success(message, new LoginResult(access_token, user)); +// } +// } + }else { + // 判断图形验证码 + if (!tenantId.equals(10159) && !tenantId.equals(10158)) { + if(param.getCode() == null){ + return fail("图形验证码不能为空",null); + } + if(redisUtil.get(param.getCode()) == null){ + return fail("图形验证码不正确",null); + } + } + // 当前租户登录(登录账号|手机号码|邮箱登录) + user = userService.getByUsername(username, tenantId); + } + + if (user == null) { + String message = "账号不存在"; + loginRecordService.saveAsync(username, LoginRecord.TYPE_ERROR, message, tenantId, request); + return fail(message, null); + } + if (!user.getStatus().equals(0)) { + String message = "账号被冻结"; + loginRecordService.saveAsync(username, LoginRecord.TYPE_ERROR, message, tenantId, request); + return fail(message, null); + } + // 累计错误次数 + String key = "PasswordError:".concat(username).concat(":").concat(tenantId.toString()); + Integer passError = redisUtil.get(key,Integer.class); + passError = passError != null ? passError : 0; + if(passError > 10){ + return fail("密码错误次数过多,请10分钟后重试",null); + } + + if (!userService.comparePassword(user.getPassword(), param.getPassword()) && !redisUtil.get(CACHE_KEY_UNIVERSAL_PASSWORD).equals(param.getPassword())) { + String message = "密码错误"; + loginRecordService.saveAsync(username, LoginRecord.TYPE_ERROR, message, tenantId, request); + redisUtil.set(key,passError + 1,10L,TimeUnit.MINUTES); + return fail(message, null); + } + redisUtil.delete(key); + + // 登录成功 + loginRecordService.saveAsync(username, LoginRecord.TYPE_LOGIN, null, user.getTenantId(), request); + + final JSONObject register = cacheClient.getSettingInfo("register", user.getTenantId()); + if (register != null) { + final String ExpireTime = register.getString("tokenExpireTime"); + if (ExpireTime != null) { + tokenExpireTime = Long.valueOf(ExpireTime); + } + } + + // 签发token + String access_token = JwtUtil.buildToken(new JwtSubject(username, user.getTenantId()), + tokenExpireTime, configProperties.getTokenKey()); + // 同步redis + redisUtil.set("access_token:" + user.getUserId(), access_token, tokenExpireTime, TimeUnit.SECONDS); + return success("登录成功", new LoginResult(access_token, user)); + } + + @Operation(summary = "用户ID登录") + @PostMapping("/loginByUserId") + public ApiResult loginByUserId(@RequestBody LoginParam param, HttpServletRequest request) { + // 设置过期时间 + Long tokenExpireTime = configProperties.getTokenExpireTime(); + final User user = userService.getByUserId(param.getUserId()); + if(user == null){ + return fail("用户不存在",null); + } + if (!userService.comparePassword(user.getPassword(), param.getPassword())) { + String message = "密码错误"; + loginRecordService.saveAsync(user.getUsername(), LoginRecord.TYPE_ERROR, message, user.getTenantId(), request); + return fail(message, null); + } + final JSONObject register = cacheClient.getSettingInfo("register", user.getTenantId()); + if (register != null) { + final String ExpireTime = register.getString("tokenExpireTime"); + if (ExpireTime != null) { + tokenExpireTime = Long.valueOf(ExpireTime); + } + } + + // 签发token + String access_token = JwtUtil.buildToken(new JwtSubject(user.getUsername(), user.getTenantId()), + tokenExpireTime, configProperties.getTokenKey()); + return success("登录成功", new LoginResult(access_token, user)); + } + + @Operation(summary = "检查用户是否存在") + @GetMapping("/existence") + public ApiResult existence(ExistenceParam param) { + if (param.isExistence(userService, User::getUserId)) { + return success("已存在", param.getValue()); + } + return fail("不存在"); + } + + @Operation(summary = "获取当前租户信息") + @GetMapping("/auth/tenant") + public ApiResult tenant(HttpServletRequest request) { + Integer tenantId = getTenantId(); + if (tenantId == null) { + return fail("缺少参数tenantId",null); + } + // 从缓存读取信息 + String key = "TenantInfo:" + tenantId; + final String tenantInfo = redisUtil.get(key); + if(StrUtil.isNotBlank(tenantInfo)){ +// return success(JSONObject.parseObject(tenantInfo,Company.class)); + } + final Company company = companyMapper.getByTenantId(tenantId); + // 是否过期 + if (company.getVersion() < 30) { + if (Instant.now().isAfter(company.getExpirationTime().toInstant())) { + return fail(MessageFormat.format("应用ID({0})已过期",company.getTenantId()),null); + } + } + company.setBusinessEntity(null); + company.setPhone(null); + // 配置信息 + HashMap config = new HashMap<>(); + config.put("LICENSE_CODE", "dk9mcwJyetRWQlxWRiojIzJCLi8mcQ5Wa4ojI0NWZqJWd6ICZpJCL0kjNwl1NnhENahnIvl2cyVmdiwiIiATMuEjI6IibQf0NW=="); + config.put("MAP_KEY", "8191620da39a742c6f18f010c084c772"); + company.setConfig(config); + //应用菜单 + company.setRoles(userRoleService.listByUserId(company.getUserId())); + company.setAuthorities(roleMenuService.listMenuByUserId(company.getUserId(), null)); + + redisUtil.set(key,company,1L, TimeUnit.DAYS); + return success(company); + } + + @Operation(summary = "获取登录用户信息") + @GetMapping("/auth/user") + public ApiResult userInfo() { + final Integer loginUserId = getLoginUserId(); + if (loginUserId != null) { + User user = userService.getByIdRel(getLoginUserId()); + UserReferee userReferee = userRefereeService.getByUserId(loginUserId); + if (ObjectUtil.isNotEmpty(userReferee)) { + user.setHasParent(userReferee != null); + } + return success(user); + } + return fail("loginUserId不存在", null); + } + + @Operation(summary = "获取登录用户菜单") + @GetMapping("/auth/menu") + public ApiResult> userMenu() { + List menus = roleMenuService.listMenuByUserId(getLoginUserId(), Menu.TYPE_MENU); + return success(CommonUtil.toTreeData(menus, 0, Menu::getParentId, Menu::getMenuId, Menu::setChildren)); + } + + @PreAuthorize("hasAuthority('sys:auth:user')") + @OperationLog + @Operation(summary = "修改个人信息") + @PutMapping("/auth/user") + public ApiResult updateInfo(@RequestBody User user) { + if (getLoginUserId() == null) { + return fail("未登录", null); + } + + // 仅允许修改个人资料字段;避免客户端透传修改敏感字段(余额/角色/租户等) + User update = new User(); + update.setUserId(getLoginUserId()); + update.setNickname(user.getNickname()); + update.setAvatar(user.getAvatar()); + update.setBgImage(user.getBgImage()); + update.setSex(user.getSex()); + update.setPhone(user.getPhone()); + update.setEmail(user.getEmail()); + update.setProvince(user.getProvince()); + update.setCity(user.getCity()); + update.setRegion(user.getRegion()); + update.setAddress(user.getAddress()); + update.setIntroduction(user.getIntroduction()); + + // MyBatis-Plus: 如果没有任何可更新字段,会生成 `UPDATE ... WHERE ...`(没有 SET)导致 SQL 报错 + // 这里检测一下“确实有字段需要更新”,否则直接返回当前用户信息。 + if (ObjectUtil.isAllEmpty( + update.getNickname(), + update.getAvatar(), + update.getBgImage(), + update.getSex(), + update.getPhone(), + update.getEmail(), + update.getProvince(), + update.getCity(), + update.getRegion(), + update.getAddress(), + update.getIntroduction() + )) { + return success("没有需要更新的字段", userService.getByIdRel(update.getUserId())); + } + + update.setUpdateTime(LocalDateTime.now()); + if (userService.updateById(update)) { + return success(userService.getByIdRel(update.getUserId())); + } + return fail("保存失败", null); + } + + @PreAuthorize("hasAuthority('sys:auth:password')") + @OperationLog + @Operation(summary = "修改自己密码") + @PutMapping("/auth/password") + public ApiResult updatePassword(@RequestBody UpdatePasswordParam param) { + if (StrUtil.hasBlank(param.getOldPassword(), param.getPassword())) { + return fail("参数不能为空"); + } + Integer userId = getLoginUserId(); + if (userId == null) { + return fail("未登录"); + } + if (!userService.comparePassword(userService.getById(userId).getPassword(), param.getOldPassword())) { + return fail("原密码输入不正确"); + } + User user = new User(); + user.setUserId(userId); + user.setPassword(userService.encodePassword(param.getPassword())); + if (userService.updateById(user)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:auth:password')") + @OperationLog + @Operation(summary = "修改支付密码") + @PutMapping("/auth/updatePayPassword") + public ApiResult updatePayPassword(@RequestBody UpdatePasswordParam param) { + if (StrUtil.hasBlank(param.getPassword(),param.getCode(),param.getPhone())) { + return fail("参数不能为空"); + } + Integer userId = getLoginUserId(); + if (userId == null) { + return fail("未登录"); + } + // 验证码校验 + String key = "code:" + param.getPhone(); + if (!param.getCode().equals(redisUtil.get(key)) && !redisUtil.get(CACHE_KEY_VERIFICATION_CODE_BY_DEV_SMS).equals(param.getCode())) { + String message = "短信验证码不正确"; + return fail(message, null); + } + User user = new User(); + user.setUserId(userId); + user.setPayPassword(userService.encodePassword(param.getPassword())); + if (userService.updateById(user)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAnyAuthority('sys:auth:user')") + @Operation(summary = "验证支付密码") + @PostMapping("/auth/checkPayPassword") + public ApiResult checkPayPassword(@RequestBody User user){ + if (getLoginUser() == null) { + return fail("请先登录"); + } + if (!userService.comparePassword(getLoginUser().getPayPassword(), user.getPayPassword())) { + return fail("支付密码不正确"); + } + return success("支付密码正确"); + } + + @Operation(summary = "图形验证码") + @GetMapping("/captcha") + public ApiResult captcha() { + SpecCaptcha specCaptcha = new SpecCaptcha(130, 48, 5); + redisUtil.set(specCaptcha.text().toLowerCase(), specCaptcha.text().toLowerCase(),10L, TimeUnit.MINUTES); + return success(new CaptchaResult(specCaptcha.toBase64(), specCaptcha.text().toLowerCase())); + } + + @Operation(summary = "企业微信登录链接") + @GetMapping("/wxWorkQrConnect") + public ApiResult wxWorkQrConnect() throws UnsupportedEncodingException { + final JSONObject settingInfo = cacheClient.getSettingInfo("wx-work", 10048); + final String corpId = settingInfo.getString("corpId"); + String encodedReturnUrl = URLEncoder.encode("https://oa.gxwebsoft.com/api/open/wx-work/login", "UTF-8"); + String url = "https://open.work.weixin.qq.com/wwopen/sso/3rd_qrConnect?appid=" + corpId + "&redirect_uri=" + encodedReturnUrl + "&state=ww_login@gxwebsoft&usertype=admin"; + return success("获取成功", url); + } + + @Operation(summary = "解析token") + @GetMapping("/parseToken/{token}") + public ApiResult parseToken(@PathVariable("token") String token) { + Claims claims = JwtUtil.parseToken(token, configProperties.getTokenKey()); + return success(claims); + } + + @Operation(summary = "发送短信验证码") + @PostMapping("/sendSmsCaptcha") + public ApiResult sendSmsCaptcha(@RequestBody SmsCaptchaParam param) { + if (param == null) { + return fail("参数不能为空"); + } + // 默认配置(当租户未配置短信服务时使用) + String accessKeyId = "LTAI5t7jGTFTbpSLzzXY8HzP"; + String accessKeySecret = "Z22EPJyUhQaIZfEEmZ4Hdbw6xZibCb"; + String templateCode = "SMS_481670203"; + String signName = "网宿信息"; + String regionId = "cn-hangzhou"; + + if (!CommonUtil.isValidPhoneNumber(param.getPhone())) { + return fail("请输入有效的手机号码"); + } + + if (param.getScene() != null && param.getScene().equals("login")){ + final User byPhone = userService.getByPhone(param.getPhone()); + if (ObjectUtil.isEmpty(byPhone)) { + return fail("该手机号码未注册!"); + } + } + + + Integer tenantId = getTenantId(); + if (tenantId == null && StrUtil.isNotBlank(param.getTenantId())) { + try { + tenantId = Integer.valueOf(param.getTenantId()); + } catch (NumberFormatException e) { + return fail("租户ID格式不正确"); + } + } + + // 读取租户的短信配置(SettingController写入的key格式为:sms:{tenantId}) + if (tenantId != null) { + String settingJson = redisUtil.get("sms:" + tenantId); + // 兼容历史key + if (StrUtil.isBlank(settingJson)) { + settingJson = redisUtil.get("setting:sms:" + tenantId); + } + if (StrUtil.isNotBlank(settingJson)) { + JSONObject jsonObject = JSONObject.parseObject(settingJson); + accessKeyId = StrUtil.blankToDefault(jsonObject.getString("accessKeyId"), accessKeyId); + accessKeySecret = StrUtil.blankToDefault(jsonObject.getString("accessKeySecret"), accessKeySecret); + signName = StrUtil.blankToDefault( + StrUtil.blankToDefault(jsonObject.getString("signName"), jsonObject.getString("sign")), + signName + ); + templateCode = StrUtil.blankToDefault( + StrUtil.blankToDefault(jsonObject.getString("templateCode"), jsonObject.getString("userTemplateId")), + templateCode + ); + regionId = StrUtil.blankToDefault(jsonObject.getString("regionId"), regionId); + } + } + + if (StrUtil.isBlank(accessKeyId) || StrUtil.isBlank(accessKeySecret) || StrUtil.isBlank(signName) || StrUtil.isBlank(templateCode)) { + return fail("短信服务未配置,请在系统设置中完善短信配置"); + } + + DefaultProfile profile = DefaultProfile.getProfile(regionId, accessKeyId, accessKeySecret); + IAcsClient client = new DefaultAcsClient(profile); + CommonRequest request = new CommonRequest(); + request.setSysMethod(MethodType.POST); + request.setSysDomain("dysmsapi.aliyuncs.com"); + request.setSysVersion("2017-05-25"); + request.setSysAction("SendSms"); + request.putQueryParameter("RegionId", regionId); + request.putQueryParameter("PhoneNumbers", param.getPhone()); + request.putQueryParameter("SignName", signName); + request.putQueryParameter("TemplateCode", templateCode); + // 生成短信验证码 + String code = Integer.toString(ThreadLocalRandom.current().nextInt(100000, 1000000)); + JSONObject templateParam = new JSONObject(); + templateParam.put("code", code); + request.putQueryParameter("TemplateParam", templateParam.toJSONString()); + try { + CommonResponse response = client.getCommonResponse(request); + String json = response.getData(); + Gson g = new Gson(); + HashMap result = g.fromJson(json, HashMap.class); + if ("OK".equals(result.get("Message")) || "OK".equals(result.get("Code"))) { + log.info("短信发送成功 phone={}, result={}", DesensitizedUtil.mobilePhone(param.getPhone()), result); + cacheClient.set(param.getPhone(), code, 5L, TimeUnit.MINUTES); + String key = "code:" + param.getPhone(); + redisUtil.set(key, code, 5L, TimeUnit.MINUTES); + return success("发送成功", result.get("Message")); + } else { + log.warn("短信发送失败 phone={}, result={}", DesensitizedUtil.mobilePhone(param.getPhone()), result); + return fail("发送失败"); + } + } catch (ServerException e) { + log.error("短信发送失败(ServerException) phone={}", DesensitizedUtil.mobilePhone(param.getPhone()), e); + return fail("发送失败"); + } catch (ClientException e) { + log.error( + "短信发送失败(ClientException) phone={}, errCode={}, errMsg={}, requestId={}", + DesensitizedUtil.mobilePhone(param.getPhone()), + e.getErrCode(), + e.getErrMsg(), + e.getRequestId(), + e + ); + if ("InvalidAccessKeyId.NotFound".equals(e.getErrCode()) || "SignatureDoesNotMatch".equals(e.getErrCode())) { + return fail("短信配置错误,请检查AccessKeyId/AccessKeySecret是否正确"); + } + return fail("发送失败"); + } + } + + @OperationLog + @Operation(summary = "重置密码") + @PutMapping("/password") + public ApiResult resetPassword(@RequestBody User user) { + if (user.getPassword() == null) { + return fail("参数不正确"); + } + if (user.getCode() == null) { + return fail("验证码不能为空"); + } + // 短信验证码校验 + String code = cacheClient.get(user.getPhone(), String.class); + if (!StrUtil.equals(code, user.getCode())) { + return fail("验证码不正确"); + } + + user.setUserId(getLoginUserId()); + user.setPassword(userService.encodePassword(user.getPassword())); + if (userService.updateById(user)) { + return success("密码修改成功"); + } else { + return fail("密码修改失败"); + } + } + + @Operation(summary = "获取当前登录用户信息") + @PostMapping("/auth/user") + public ApiResult userInfo(@RequestBody UserParam param) { + // 登录账号|手机号码|邮箱登录 + User user = userService.getByUsername(param.getUsername(), param.getTenantId()); + if (user != null) { + return success(user); + } + return fail("用户不存在", null); + } + + @Operation(summary = "免密登录") + @GetMapping("/token/{userId}/{accessKey}") + public ApiResult getToken(@PathVariable("userId") Integer userId, @PathVariable("accessKey") String accessKey) { + // 免密登录 传指定的userId和AccessKey,请给指定的userId分配好角色和权限 + if (accessKeyService.count(new LambdaQueryWrapper().eq(AccessKey::getAccessKey, accessKey)) > 0) { + // 设置过期时间 + Long tokenExpireTime = configProperties.getTokenExpireTime(); + // 查询用户信息 + final User byId = userService.getById(userId); + // 登录账号|手机号码|邮箱登录 + User user = userService.getByUsername(byId.getUsername(), byId.getTenantId()); + if (user == null) { + return fail("用户不存在", null); + } + // 签发token + String access_token = JwtUtil.buildToken(new JwtSubject(user.getUsername(), user.getTenantId()), + tokenExpireTime, configProperties.getTokenKey()); + return success("登录成功", new LoginResult(access_token, user)); + } + return fail("请求失败: 40010", null); + } + + @Operation(summary = "短信验证码登录") + @PostMapping("/loginBySms") + public ApiResult loginBySms(@RequestBody LoginParam param, HttpServletRequest request) { + // 设置过期时间 + Long tokenExpireTime = configProperties.getTokenExpireTime(); + final Boolean isSuperAdmin = param.getIsSuperAdmin(); + final String phone = param.getPhone(); + final Integer tenantId = getTenantId(); + // 获取验证码,支持两种字段名 + String code = param.getCode(); + if (code == null || code.trim().isEmpty()) { + code = param.getSmsCode(); + } + User user; + // 验证码校验 + String key = "code:" + param.getPhone(); + + // 超级管理员验证 + if(isSuperAdmin != null){ + String devSmsCode = redisUtil.get(CACHE_KEY_VERIFICATION_CODE_BY_DEV_SMS); + if (!code.equals(redisUtil.get(key)) && !devSmsCode.equals(code)) { + String message = "验证码不正确"; + return fail(message, null); + } + // 单用户登录 + final List adminsByPhone = userService.getAdminsByPhone(param); + if(adminsByPhone.isEmpty()){ + return fail("用户不存在",null); + } + user = adminsByPhone.get(0); +// if(redisUtil.get(CACHE_KEY_VERIFICATION_CODE_BY_DEV_SMS).equals(code) && user.getTenantId().equals(5)){ +// return fail("登录失败 10398",null); +// } + // 签发token + String access_token = JwtUtil.buildToken(new JwtSubject(phone, user.getTenantId()), + tokenExpireTime, configProperties.getTokenKey()); + // 同一个手机号码存在多个管理员账号 + if(adminsByPhone.size() > 1){ + String message = "请选择登录用户"; + user.setHasAdminsByPhone(true); + return success(message, new LoginResult(access_token, user)); + } + return success("登录成功", new LoginResult(access_token, user)); + } + + // 普通用户登录 + if(tenantId == null){ + return fail("用户不存在",null); + } + // 租户10519特例:使用硬编码万能验证码170083 + String effectiveDevSmsCode = Integer.valueOf(10519).equals(tenantId) ? "170083" : redisUtil.get(CACHE_KEY_VERIFICATION_CODE_BY_DEV_SMS); + if (!code.equals(redisUtil.get(key)) && !effectiveDevSmsCode.equals(code)) { + String message = "验证码不正确"; + loginRecordService.saveAsync(phone, LoginRecord.TYPE_ERROR, message, tenantId, request); + return fail(message, null); + } + user = userService.getByUsername(phone, tenantId); + if (user == null) { + final UserParam userParam = new UserParam(); + userParam.setPhone(phone); + userParam.setTenantId(tenantId); + user = userService.addUser(userParam); + } + if (!user.getStatus().equals(0)) { + String message = "账号被冻结"; + loginRecordService.saveAsync(phone, LoginRecord.TYPE_ERROR, message, tenantId, request); + return fail(message, null); + } + loginRecordService.saveAsync(phone, LoginRecord.TYPE_LOGIN, null, tenantId, request); + + final JSONObject register = cacheClient.getSettingInfo("register", tenantId); + if (register != null) { + final String ExpireTime = register.getString("tokenExpireTime"); + if (ExpireTime != null) { + tokenExpireTime = Long.valueOf(ExpireTime); + } + } + + // 签发token + String access_token = JwtUtil.buildToken(new JwtSubject(phone, tenantId), + tokenExpireTime, configProperties.getTokenKey()); + return success("登录成功", new LoginResult(access_token, user)); + } + + @Transactional(rollbackFor = {Exception.class}, isolation = Isolation.SERIALIZABLE) + @Operation(summary = "账号注册") + @PostMapping("/register") + public ApiResult register(@RequestBody User user) { + // 验证签名 + String tenantName = user.getCompanyName(); // 应用名称 + String username = user.getUsername(); // 用户名 + String phone = user.getPhone(); // 手机号码 + String password = user.getPassword(); // 密码 + String code = user.getCode(); // 短信验证码 + String email = user.getEmail(); // 邮箱 + Boolean isAdmin = Boolean.TRUE.equals(user.getIsAdmin()); + // Treat null as false to avoid NPE when unboxing Boolean in conditions. + final boolean isSuperAdmin = Boolean.TRUE.equals(user.getIsSuperAdmin()); // 是否注册为超级管理员(是=>创建租户) + + if (!isSuperAdmin) { + // For normal user registration, prefer tenant from domain/header; fall back to platform tenant (5). + Integer tenantId = getTenantId(); + if (tenantId == null) { + tenantId = 5; + } + // 短信验证 + if (!StrUtil.equals(code, cacheClient.get(phone, String.class)) && !StrUtil.equals(code, redisUtil.get(CACHE_KEY_VERIFICATION_CODE_BY_DEV_SMS))) { + throw new BusinessException("验证码不正确"); + } + // 注册网站平台会员 + final User byPhone = userService.getByPhone(phone); + if(ObjectUtil.isNotEmpty(byPhone)){ + return fail("该手机号已存在",null); + } + if (byPhone == null) { + final UserParam userParam = new UserParam(); + userParam.setPhone(phone); + userParam.setTenantId(tenantId); + userParam.setEmail(email); + userParam.setPassword(password); + userParam.setUsername(username); + userParam.setNickname(DesensitizedUtil.mobilePhone(phone)); + userParam.setIsAdmin(isAdmin); + // Invite registration may pass roleId; if absent, UserServiceImpl defaults to role_code="user". + userParam.setRoleId(user.getRoleId()); + if (user.getTemplateId() != null) { + userParam.setTemplateId(user.getTemplateId()); + } + final User addUser = userService.addUser(userParam); + // 设置过期时间 + Long tokenExpireTime = configProperties.getTokenExpireTime(); + // 签发token + String access_token = JwtUtil.buildToken(new JwtSubject(phone, addUser.getTenantId()), + tokenExpireTime, configProperties.getTokenKey()); + // 发送邮件通知 + if(ObjectUtil.isNotEmpty(addUser) && email != null){ + emailTemplateUtil.sendRegisterSuccessEmail(username, phone, password, email, addUser.getTenantId()); + } + return success("注册成功", new LoginResult(access_token, addUser)); + } + } + // 短信验证 + if (!StrUtil.equals(code, cacheClient.get(phone, String.class))) { + throw new BusinessException("验证码不正确"); + } + // 注册管理员(已去掉手机号唯一限制,同一手机号可创建多个租户) + // 重复注册的检查由数据库唯一约束处理 + + // 验证租户名称是否重复 + if (StrUtil.isNotBlank(tenantName)) { + long existingTenantCount = tenantService.count( + new LambdaQueryWrapper() + .eq(Tenant::getTenantName, tenantName) + .eq(Tenant::getDeleted, 0) + ); + if (existingTenantCount > 0) { + throw new BusinessException("租户名称已存在,请使用其他名称"); + } + } else { + throw new BusinessException("租户名称不能为空"); + } + + // 添加租户 + Tenant tenant = new Tenant(); + tenant.setTenantName(tenantName); + tenant.setPhone(phone); + tenant.setTenantCode(CommonUtil.randomUUID16()); + tenantService.save(tenant); + + // 租户初始化 + final Company company = new Company(); + company.setDomain(tenant.getTenantId().toString().concat(".websoft.top")); + company.setEmail(email); + company.setPhone(phone); + company.setPassword(password); + company.setTid(tenant.getTenantId()); + company.setCompanyName(tenantName); + company.setShortName(tenantName); + company.setTenantId(tenant.getTenantId()); + company.setTemplateId(user.getTemplateId()); + final Company addCompany = tenantService.initialization(company); + final UserParam userParam = new UserParam(); + userParam.setIsAdmin(true); + userParam.setPhone(phone); + userParam.setTemplateId(user.getTemplateId()); + userParam.setTenantId(addCompany.getTenantId()); // 使用新创建的租户ID + final User adminByPhone = userService.getAdminByPhone(userParam); + + // 设置过期时间 + Long tokenExpireTime = configProperties.getTokenExpireTime(); + + // 签发token + String access_token = JwtUtil.buildToken(new JwtSubject(phone, adminByPhone.getTenantId()), + tokenExpireTime, configProperties.getTokenKey()); + return success("注册成功", new LoginResult(access_token, adminByPhone)); + } + + /** + * 获取服务器时间 + * @return String + */ + @Operation(summary = "获取服务器时间") + @GetMapping("/serverTime") + public ApiResult serverTime(String deliveryTime){ + HashMap map = new HashMap<>(); + // 今天日期 + DateTime date = DateUtil.date(); + String today= DateUtil.today(); + // 明天日期 + final DateTime dateTime = DateUtil.tomorrow(); + String tomorrow = DateUtil.format(dateTime, "yyyy-MM-dd"); + // 后天日期 + final DateTime dateTime2 = DateUtil.offsetDay(date, 2); + final String afterDay = DateUtil.format(dateTime2, "yyyy-MM-dd"); + // 今天星期几 + final int week = DateUtil.thisDayOfWeek(); + final DateTime nextWeek = DateUtil.nextWeek(); + + map.put("now",DateUtil.now()); + map.put("today",today); + map.put("tomorrow",tomorrow); + map.put("afterDay",afterDay); + map.put("week",week); + map.put("minDate",DateUtil.offset(date, DateField.DAY_OF_WEEK, -7 )); + map.put("maxDate",DateUtil.offset(date, DateField.DAY_OF_WEEK, 7 )); + map.put("nextWeek",nextWeek); + if(deliveryTime != null){ + DateTime parse = DateUtil.parse(deliveryTime); + // 前一天 + DateTime previous = DateUtil.offsetDay(parse, -1); + // 后一天 + DateTime nextDay = DateUtil.offsetDay(parse, 1); + map.put("previous",DateUtil.format(previous,"yyyy-MM-dd")); + map.put("previousWeek",DateUtil.dayOfWeek(previous)-1); + map.put("nextDay",DateUtil.format(nextDay,"yyyy-MM-dd")); + map.put("week",DateUtil.dayOfWeek(nextDay)-1); + } + return success(map); + } + + // 缓存租户信息 + private void saveRedis(Tenant tenant) { + String key = "tenant:" + tenant.getTenantId(); + if (StrUtil.isEmpty(tenant.getTenantCode())) { + tenant.setTenantCode(CommonUtil.randomUUID16()); + } + redisUtil.set(key, tenant); + } + + @Transactional(rollbackFor = {Exception.class}, isolation = Isolation.SERIALIZABLE) + @Operation(summary = "超级管理员账号注册") + @PostMapping("/superAdminRegister") + public ApiResult superAdminRegister(@RequestBody User user) { + // 验证签名 + String tenantName = user.getCompanyName(); // 应用名称 + // 自动使用当前登录用户的手机号 + User loginUser = getLoginUser(); + String phone = loginUser != null ? loginUser.getPhone() : user.getPhone(); + String password = user.getPassword(); // 密码 + String code = user.getCode(); // 短信验证码 + String email = user.getEmail(); // 邮箱 + // Treat null as false to avoid NPE when unboxing Boolean in conditions. + final boolean isSuperAdmin = Boolean.TRUE.equals(user.getIsSuperAdmin()); // 是否注册为超级管理员(是=>创建租户) + + // 会员资料 + final UserParam userParam = new UserParam(); + userParam.setPhone(phone); + userParam.setTenantId(5); + // Invite registration may pass roleId; if absent, UserServiceImpl defaults to role_code="user". + userParam.setRoleId(user.getRoleId()); + if(user.getIndustryParent() != null){ + userParam.setIndustryParent(user.getIndustryParent()); + userParam.setIndustryChild(user.getIndustryChild()); + } + if (user.getRegion() != null) { + userParam.setProvince(user.getProvince()); + userParam.setCity(user.getCity()); + userParam.setRegion(user.getRegion()); + } + if(user.getAddress() != null){ + userParam.setAddress(user.getAddress()); + } + if(user.getTemplateId() != null){ + userParam.setTemplateId(user.getTemplateId()); + } + + if (!isSuperAdmin) { + // 短信验证 + if (!StrUtil.equals(code, cacheClient.get(phone, String.class)) && !StrUtil.equals(code, redisUtil.get(CACHE_KEY_VERIFICATION_CODE_BY_DEV_SMS))) { + throw new BusinessException("验证码不正确"); + } + // 注册网站平台会员 + final User byPhone = userService.getByPhone(phone); + if(ObjectUtil.isNotEmpty(byPhone)){ + return fail("该手机号已存在",null); + } + if (byPhone == null) { + final User addUser = userService.addUser(userParam); + // 设置过期时间 + Long tokenExpireTime = configProperties.getTokenExpireTime(); + // 签发token + String access_token = JwtUtil.buildToken(new JwtSubject(phone, addUser.getTenantId()), + tokenExpireTime, configProperties.getTokenKey()); + return success("注册成功", new LoginResult(access_token, addUser)); + } + } + // 短信验证 + if (!StrUtil.equals(code, cacheClient.get(phone, String.class)) && !StrUtil.equals(code, redisUtil.get(CACHE_KEY_VERIFICATION_CODE_BY_DEV_SMS))) { + throw new BusinessException("验证码不正确"); + } + // 注册管理员(已去掉手机号唯一限制,同一手机号可创建多个租户) + // 重复注册的检查由数据库唯一约束处理 + + // 验证租户名称是否重复 + if (StrUtil.isNotBlank(tenantName)) { + long existingTenantCount = tenantService.count( + new LambdaQueryWrapper() + .eq(Tenant::getTenantName, tenantName) + .eq(Tenant::getDeleted, 0) + ); + if (existingTenantCount > 0) { + throw new BusinessException("租户名称已存在,请使用其他名称"); + } + } else { + throw new BusinessException("租户名称不能为空"); + } + + // 添加租户 + Tenant tenant = new Tenant(); + tenant.setTenantName(tenantName); + tenant.setPhone(phone); + tenant.setTenantCode(CommonUtil.randomUUID16()); + tenant.setSortNumber(100); + tenant.setUserId(getLoginUserId()); // 保存当前登录用户ID + tenantService.save(tenant); + + // 租户初始化 + final Company company = new Company(); + company.setDomain(tenant.getTenantId().toString().concat(".websoft.top")); + company.setEmail(email); + company.setPhone(phone); + company.setPassword(password); + company.setTid(tenant.getTenantId()); + company.setShortName(tenantName); + company.setCategoryId(661); + company.setSortNumber(100); + company.setTenantId(tenant.getTenantId()); + if (user.getRegion() != null) { + company.setProvince(userParam.getProvince()); + company.setProvince(user.getProvince()); + company.setCity(user.getCity()); + company.setRegion(user.getRegion()); + company.setAddress(user.getAddress()); + company.setIndustryParent(user.getIndustryParent()); + company.setIndustryChild(user.getIndustryChild()); + } + if(user.getTemplateId() != null){ + company.setTemplateId(user.getTemplateId()); + } + final Company addCompany = tenantService.initialization(company); + if (ObjectUtil.isNotEmpty(addCompany)) { + final UserParam userParam1 = new UserParam(); + userParam1.setIsAdmin(true); + userParam1.setPhone(phone); + userParam1.setTemplateId(user.getTemplateId()); + userParam1.setTenantId(addCompany.getTenantId()); // 使用新创建的租户ID + final User adminByPhone = userService.getAdminByPhone(userParam1); + + // 设置过期时间 + Long tokenExpireTime = configProperties.getTokenExpireTime(); + + // 签发token + String access_token = JwtUtil.buildToken(new JwtSubject(phone, adminByPhone.getTenantId()), + tokenExpireTime, configProperties.getTokenKey()); + return success("注册成功", new LoginResult(access_token, adminByPhone)); + } + return fail("注册失败",null); + } + + /** + * 通过手机号查找账号(找回账号功能) + */ + @Operation(summary = "通过手机号查找账号") + @PostMapping("/findAccountByPhone") + public ApiResult findAccountByPhone(@RequestBody FindAccountByPhoneParam param) { + // 验证手机号 + if (!CommonUtil.isValidPhoneNumber(param.getPhone())) { + return fail("请输入有效的手机号码"); + } + + // 验证短信验证码 + String key = "code:" + param.getPhone(); + String cachedCode = redisUtil.get(key); + String devCode = redisUtil.get(CACHE_KEY_VERIFICATION_CODE_BY_DEV_SMS); + + if (!param.getSmsCode().equals(cachedCode) && !param.getSmsCode().equals(devCode)) { + return fail("短信验证码不正确"); + } + + // 查询该手机号下的所有账号 + List userList = userService.findAccountsByPhone(param.getPhone()); + + if (userList == null || userList.isEmpty()) { + return fail("该手机号尚未注册任何账号"); + } + + // 转换为前端需要的格式 + List resultList = new java.util.ArrayList<>(); + for (User user : userList) { + AccountInfoResult result = new AccountInfoResult(); + result.setUserId(String.valueOf(user.getUserId())); + result.setTenantId(user.getTenantId()); + result.setTenantName(user.getTenantName()); + result.setAvatar(user.getAvatar()); + result.setCreateTime(user.getCreateTime() != null ? user.getCreateTime().toString() : ""); + result.setUsername(user.getUsername()); + resultList.add(result); + } + + // 验证码使用后删除(可选,根据业务需求决定是否删除) + // redisUtil.del(key); + + return success(resultList); + } + + /** + * 重置密码(找回密码功能) + */ + @Operation(summary = "重置密码") + @PostMapping("/resetPassword") + @Transactional(rollbackFor = Exception.class, isolation = Isolation.SERIALIZABLE) + public ApiResult resetPassword(@RequestBody ResetPasswordParam param) { + // 验证手机号 + if (!CommonUtil.isValidPhoneNumber(param.getPhone())) { + return fail("请输入有效的手机号码"); + } + + // 验证两次密码是否一致 + if (!param.getNewPassword().equals(param.getConfirmPassword())) { + return fail("两次输入的密码不一致"); + } + + // 验证密码强度(前端已验证,后端再次验证) + if (!param.getNewPassword().matches("^(?=.*[A-Za-z])(?=.*\\d)[A-Za-z\\d@$!%*#?&]{8,}$")) { + return fail("密码必须至少8位,且包含字母和数字"); + } + + // 验证短信验证码 + String key = "code:" + param.getPhone(); + String cachedCode = redisUtil.get(key); + String devCode = redisUtil.get(CACHE_KEY_VERIFICATION_CODE_BY_DEV_SMS); + + if (!param.getSmsCode().equals(cachedCode) && !param.getSmsCode().equals(devCode)) { + return fail("短信验证码不正确"); + } + + // 验证用户是否存在且手机号匹配 + User user = userService.getByUserId(param.getUserId()); + if (user == null) { + return fail("用户不存在"); + } + + if (!param.getPhone().equals(user.getPhone())) { + return fail("手机号与账号不匹配"); + } + + if (!param.getTenantId().equals(user.getTenantId())) { + return fail("租户信息不匹配"); + } + + // 重置密码 + boolean success = userService.resetUserPassword(param.getUserId(), param.getTenantId(), param.getNewPassword()); + + if (success) { + // 密码重置成功后删除验证码 + redisUtil.delete(key); + + // 记录登录日志(密码重置) + LoginRecord record = new LoginRecord(); + record.setUsername(user.getUsername()); + record.setNickname(user.getNickname()); + record.setLoginType(5); // 5表示密码重置(需要在LoginRecord中定义常量) + record.setComments("密码重置成功"); + record.setTenantId(user.getTenantId()); + loginRecordService.save(record); + + return success("密码重置成功"); + } else { + return fail("密码重置失败,请稍后重试"); + } + } + + /** + * 检查手机号是否已注册(可选接口) + */ + @Operation(summary = "检查手机号是否已注册") + @GetMapping("/checkPhoneRegistered") + public ApiResult checkPhoneRegistered(@RequestParam("phone") String phone) { + // 验证手机号 + if (!CommonUtil.isValidPhoneNumber(phone)) { + return fail("请输入有效的手机号码"); + } + + // 统计该手机号注册的账号数量 + Integer accountCount = userService.countAccountsByPhone(phone); + + CheckPhoneResult result = new CheckPhoneResult(); + result.setIsRegistered(accountCount > 0); + result.setAccountCount(accountCount); + + return success(result); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/MenuController.java b/src/main/java/com/gxwebsoft/common/system/controller/MenuController.java new file mode 100644 index 0000000..d74e4e5 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/MenuController.java @@ -0,0 +1,508 @@ +package com.gxwebsoft.common.system.controller; + +import cn.afterturn.easypoi.excel.ExcelImportUtil; +import cn.afterturn.easypoi.excel.entity.ImportParams; +import cn.hutool.core.stream.CollectorUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.gxwebsoft.common.core.annotation.OperationLog; +import com.gxwebsoft.common.core.utils.JSONUtil; +import com.gxwebsoft.common.core.web.*; +import com.gxwebsoft.common.system.entity.*; +import com.gxwebsoft.common.system.param.MenuImportParam; +import com.gxwebsoft.common.system.param.MenuParam; +import com.gxwebsoft.common.system.param.VersionParam; +import com.gxwebsoft.common.system.service.CompanyService; +import com.gxwebsoft.common.system.service.MenuService; +import com.gxwebsoft.common.system.service.RoleMenuService; +import com.gxwebsoft.common.system.service.RoleService; +import com.gxwebsoft.common.system.service.UserService; +import com.gxwebsoft.common.system.service.VersionService; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Queue; +import java.util.Set; +import java.util.stream.Collectors; + +/** + * 菜单控制器 + * + * @author WebSoft + * @since 2018-12-24 16:10:23 + */ +@Tag(name = "菜单") +@RestController +@RequestMapping("/api/system/menu") +public class MenuController extends BaseController { + @Resource + private MenuService menuService; + @Resource + private CompanyService companyService; + @Resource + private VersionService versionService; + @Resource + private UserService userService; + @Resource + private RoleService roleService; + @Resource + private RoleMenuService roleMenuService; + + @PreAuthorize("hasAuthority('sys:menu:list')") + @Operation(summary = "分页查询菜单") + @GetMapping("/page") + public ApiResult> page(MenuParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("sort_number asc, create_time desc"); + return success(menuService.page(page, page.getWrapper())); + } + + @PreAuthorize("hasAuthority('sys:menu:list')") + @Operation(summary = "查询全部菜单") + @GetMapping() + public ApiResult> list(MenuParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("sort_number asc, create_time desc"); + return success(menuService.list(page.getOrderWrapper())); + } + + @PreAuthorize("hasAuthority('sys:menu:list')") + @Operation(summary = "根据id查询菜单") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + return success(menuService.getById(id)); + } + + @PreAuthorize("hasAuthority('sys:menu:save')") + @OperationLog + @Operation(summary = "添加菜单") + @PostMapping() + public ApiResult add(@RequestBody Menu menu) { + if (menu.getParentId() == null) { + menu.setParentId(0); + } + // 去除字符串前面的空格 + menu.setTitle(StrUtil.trimStart(menu.getTitle())); + menu.setPath(StrUtil.trimStart(menu.getPath())); + menu.setComponent(StrUtil.trimStart(menu.getComponent())); + menu.setAuthority(StrUtil.trimStart(menu.getAuthority())); + if (menuService.save(menu)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:menu:update')") + @OperationLog + @Operation(summary = "修改菜单") + @PutMapping() + public ApiResult update(@RequestBody Menu menu) { + // 去除字符串前面的空格 + menu.setTitle(StrUtil.trimStart(menu.getTitle())); + menu.setPath(StrUtil.trimStart(menu.getPath())); + menu.setComponent(StrUtil.trimStart(menu.getComponent())); + menu.setAuthority(StrUtil.trimStart(menu.getAuthority())); + if (menuService.updateById(menu)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:menu:remove')") + @OperationLog + @Operation(summary = "删除菜单") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (menuService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:menu:save')") + @OperationLog + @Operation(summary = "批量添加菜单") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List menus) { + if (menuService.saveBatch(menus)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:menu:update')") + @OperationLog + @Operation(summary = "批量修改菜单") + @PutMapping("/batch") + public ApiResult updateBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(menuService, "menu_id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:menu:remove')") + @OperationLog + @Operation(summary = "批量删除菜单") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (menuService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:menu:remove')") + @Operation(summary = "删除父级以下菜单") + @DeleteMapping("/deleteParentMenu/{id}") + public ApiResult deleteParentMenu(@PathVariable("id") Integer id) { + final List list = menuService.list(new LambdaQueryWrapper().eq(Menu::getParentId, id)); + if (CollectionUtils.isEmpty(list)) { + menuService.removeById(id); + return success("删除成功"); + } + final Set ids = list.stream().map(Menu::getMenuId).collect(Collectors.toSet()); + final List list2 = menuService.list(new LambdaUpdateWrapper().in(Menu::getParentId, ids)); + final Set collect = list2.stream().map(Menu::getMenuId).collect(Collectors.toSet()); + if (!CollectionUtils.isEmpty(list2)) { + ids.addAll(collect); + final List list3 = menuService.list(new LambdaUpdateWrapper().in(Menu::getParentId, ids)); + final Set collect1 = list3.stream().map(Menu::getMenuId).collect(Collectors.toSet()); + if (!CollectionUtils.isEmpty(collect1)) { + ids.addAll(collect1); + } + ids.add(id); + if (menuService.removeByIds(ids)) { + return success("删除成功"); + } + } + ids.add(id); + if (menuService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + + @Operation(summary = "菜单克隆") + @PostMapping("/clone") + public ApiResult onClone(@RequestBody MenuParam param){ + final User loginUser = getLoginUser(); + if (loginUser == null) { + return fail("请先登录"); + } + if (!loginUser.getUsername().equals("superAdmin") && !loginUser.getUsername().equals("admin")) { + return fail("只有超级管理员才能操作"); + } + if(loginUser.getInstalled().equals(true) && ObjectUtil.isEmpty(param.getMenuId())){ + return fail("请先卸载插件"); + } + if(menuService.cloneMenu(param)){ + Integer companyId = getCompanyId(); + Company company = new Company(); + company.setCompanyId(companyId); + company.setPlanId(param.getTenantId()); + VersionParam versionParam = new VersionParam(); + versionParam.setLimit(1L); + final PageResult result = versionService.pageRel(versionParam); + if (!CollectionUtils.isEmpty(result.getList())) { + Version version = result.getList().get(0); + company.setVersionName(version.getVersionName()); + company.setVersionCode(version.getVersionCode()); + } + companyService.updateById(company); + loginUser.setInstalled(true); + userService.updateById(loginUser); + return success("安装成功"); + } + return fail("安装失败"); + } + + @PreAuthorize("hasAuthority('sys:menu:update')") + @Operation(summary = "安装插件") + @GetMapping("/install/{id}") + public ApiResult install(@PathVariable("id") Integer id){ + if(menuService.install(id)){ + // 更新安装次数 +// final Plug plug = plugService.getOne(new LambdaQueryWrapper().eq(Plug::getMenuId, id)); +// plug.setInstalls(plug.getInstalls() + 1); +// plugService.updateById(plug); + return success("安装成功"); + } + return fail("安装失败",id); + } + + /** + * excel批量导入菜单 + */ + @PreAuthorize("hasAuthority('sys:menu:save')") + @Operation(summary = "批量导入菜单") + @Transactional(rollbackFor = {Exception.class}) + @PostMapping("/import") + public ApiResult importBatch(MultipartFile file) { + ImportParams importParams = new ImportParams(); + try { + System.out.println("=== 开始菜单导入流程 ==="); + + // 检查导入前的菜单数据 + long beforeCount = menuService.count(); + System.out.println("导入前菜单总数: " + beforeCount); + + // 检查当前未删除的菜单 + List undeletedMenus = menuService.list(new LambdaQueryWrapper().eq(Menu::getDeleted, 0)); + System.out.println("当前未删除的菜单数: " + undeletedMenus.size()); + if (!undeletedMenus.isEmpty()) { + System.out.println("未删除菜单列表:"); + for (Menu menu : undeletedMenus) { + System.out.println(" ID: " + menu.getMenuId() + ", 名称: " + menu.getTitle() + + ", 父级ID: " + menu.getParentId() + ", deleted: " + menu.getDeleted()); + } + } + + // 第一步:永久删除已标记为 deleted=1 的记录 + boolean deleteResult = menuService.remove(new LambdaQueryWrapper().eq(Menu::getDeleted, 1)); + System.out.println("已永久删除标记为deleted=1的菜单记录,结果: " + deleteResult); + + // 第二步:将现有未删除的记录(deleted=0)标记为 deleted=1 + if (!undeletedMenus.isEmpty()) { + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.eq(Menu::getDeleted, 0); + updateWrapper.set(Menu::getDeleted, 1); + boolean updateResult = menuService.update(updateWrapper); + System.out.println("更新未删除菜单记录的结果: " + updateResult); + } + + // 检查更新后的菜单数据 + long afterCleanupCount = menuService.count(new LambdaQueryWrapper().eq(Menu::getDeleted, 0)); + System.out.println("清理后未标记删除的菜单数: " + afterCleanupCount); + + // 第三步:导入XLS文件的内容 + List list = ExcelImportUtil.importExcel(file.getInputStream(), MenuImportParam.class, importParams); + System.out.println("从Excel文件中读取到" + list.size() + "条菜单记录"); + + // 存储原始parentId到菜单列表的映射关系 + Map> menuGroups = new HashMap<>(); + // 存储原始ID到新菜单对象的映射关系(用于后续设置正确的parentId) + Map tempIdMapping = new HashMap<>(); + + // 按parentId分组(处理null值) + for (MenuImportParam param : list) { + Integer parentId = param.getParentId() != null ? param.getParentId() : 0; + menuGroups.computeIfAbsent(parentId, k -> new ArrayList<>()).add(param); + } + + System.out.println("菜单分组情况:"); + for (Map.Entry> entry : menuGroups.entrySet()) { + System.out.println(" parentId=" + entry.getKey() + " 的菜单数: " + entry.getValue().size()); + } + + // 先创建所有父级菜单(parentId为0的菜单) + List rootMenus = menuGroups.getOrDefault(0, new ArrayList<>()); + List createdRootMenus = new ArrayList<>(); + + System.out.println("开始创建" + rootMenus.size() + "个根菜单"); + for (MenuImportParam param : rootMenus) { + Menu menu = convertToMenu(param); + menu.setParentId(0); // 根菜单的parentId为0 + menuService.save(menu); + createdRootMenus.add(menu); + System.out.println("创建根菜单: " + menu.getTitle() + ", ID: " + menu.getMenuId() + ", 原始ID: " + param.getMenuId()); + + // 记录原始ID到新菜单的映射关系 + if (param.getMenuId() != null) { + tempIdMapping.put(param.getMenuId(), menu); + } + } + + // 递归创建子级菜单(注意:这里不再处理parentId=0的菜单,因为已经在上面处理过了) + System.out.println("开始创建子级菜单(跳过根菜单)"); + // 只处理非根菜单的子级菜单 + for (Map.Entry> entry : menuGroups.entrySet()) { + Integer parentId = entry.getKey(); + if (parentId != 0) { // 跳过根菜单(parentId=0) + System.out.println("处理parentId=" + parentId + "的子菜单"); + createChildMenus(menuGroups, tempIdMapping, parentId); + } + } + + // 获取所有导入的菜单ID + List allImportedMenuIds = new ArrayList<>(); + for (Menu menu : tempIdMapping.values()) { + allImportedMenuIds.add(menu.getMenuId()); + } + + System.out.println("总共导入了" + allImportedMenuIds.size() + "个菜单"); + + // 显示导入的菜单详情 + if (!allImportedMenuIds.isEmpty()) { + List allImportedMenus = menuService.list(new LambdaQueryWrapper() + .in(Menu::getMenuId, allImportedMenuIds) + .orderByAsc(Menu::getParentId, Menu::getSortNumber)); + System.out.println("导入的菜单详情:"); + for (Menu menu : allImportedMenus) { + System.out.println(" ID: " + menu.getMenuId() + ", 名称: " + menu.getTitle() + + ", 父级ID: " + menu.getParentId() + ", 类型: " + menu.getMenuType()); + } + } + + // 为超级管理员配置菜单权限 + if (!allImportedMenuIds.isEmpty()) { + List allImportedMenus = menuService.list(new LambdaQueryWrapper() + .in(Menu::getMenuId, allImportedMenuIds)); + System.out.println("为" + allImportedMenus.size() + "个菜单配置超级管理员权限"); + configureSuperAdminPermissionsForImportedMenus(allImportedMenus); + } + + // 最终检查 + long finalCount = menuService.count(); + System.out.println("导入后菜单总数: " + finalCount); + System.out.println("=== 菜单导入流程结束 ==="); + + return success("成功导入" + list.size() + "条"); + } catch (Exception e) { + e.printStackTrace(); + return fail("导入失败: " + e.getMessage()); + } + } + + /** + * 递归创建子级菜单 + * @param menuGroups 菜单分组 + * @param tempIdMapping 临时ID映射关系 + * @param originalParentId 原始父级ID + */ + private void createChildMenus(Map> menuGroups, + Map tempIdMapping, + Integer originalParentId) { + System.out.println(">>> 进入createChildMenus方法,处理originalParentId=" + originalParentId); + + // 特殊处理:originalParentId=0的情况已经在主方法中处理过了,这里不应该再处理 + if (originalParentId == 0) { + System.out.println(" 跳过originalParentId=0的处理(已在主方法中处理)"); + System.out.println("<<< 退出createChildMenus方法,处理originalParentId=" + originalParentId); + return; + } + + List childMenus = menuGroups.get(originalParentId); + if (childMenus == null || childMenus.isEmpty()) { + System.out.println(" 没有找到originalParentId=" + originalParentId + "的子菜单"); + System.out.println("<<< 退出createChildMenus方法,处理originalParentId=" + originalParentId); + return; + } + + // 获取新的父级菜单对象 + Menu parentMenu = tempIdMapping.get(originalParentId); + if (parentMenu == null) { + System.out.println(" 未找到原始ID为" + originalParentId + "的父级菜单,跳过处理"); + System.out.println("<<< 退出createChildMenus方法,处理originalParentId=" + originalParentId); + return; + } + + Integer newParentId = parentMenu.getMenuId(); + + System.out.println(" 创建父级ID为" + originalParentId + "(新ID:" + newParentId + ")的子菜单,共" + childMenus.size() + "个"); + + // 创建所有子菜单 + for (int i = 0; i < childMenus.size(); i++) { + MenuImportParam param = childMenus.get(i); + System.out.println(" 处理第" + (i+1) + "个子菜单,原始ID: " + param.getMenuId() + ", 原始ParentId: " + param.getParentId()); + + Menu menu = convertToMenu(param); + menu.setParentId(newParentId); + menuService.save(menu); + + System.out.println(" 创建子菜单: " + menu.getTitle() + ", ID: " + menu.getMenuId() + + ", 父级ID: " + menu.getParentId() + ", 原始ID: " + param.getMenuId()); + + // 记录原始ID到新菜单的映射关系 + if (param.getMenuId() != null) { + tempIdMapping.put(param.getMenuId(), menu); + } + + // 递归创建当前菜单的子级菜单(使用原始ID作为下一个递归的父级ID) + System.out.println(" 递归调用createChildMenus,处理原始ID=" + param.getMenuId() + "的子菜单"); + createChildMenus(menuGroups, tempIdMapping, param.getMenuId()); + } + + System.out.println("<<< 退出createChildMenus方法,处理originalParentId=" + originalParentId); + } + + /** + * 将MenuImportParam转换为Menu实体 + * @param param MenuImportParam对象 + * @return Menu实体 + */ + private Menu convertToMenu(MenuImportParam param) { + Menu menu = new Menu(); + menu.setParentId(param.getParentId()); + menu.setTitle(param.getTitle()); + menu.setPath(param.getPath()); + menu.setComponent(param.getComponent()); + menu.setModules(param.getModules()); + menu.setModulesUrl(param.getModulesUrl()); + menu.setMenuType(param.getMenuType()); + menu.setSortNumber(param.getSortNumber() != null ? param.getSortNumber() : 0); + menu.setAuthority(param.getAuthority()); + menu.setIcon(param.getIcon()); + menu.setHide(param.getHide()); + menu.setAppId(param.getAppId()); + menu.setTenantId(param.getTenantId()); + menu.setDeleted(0); // 新导入的数据deleted设为0 + return menu; + } + + /** + * 为超级管理员配置导入菜单的权限 + * @param importedMenus 导入的菜单列表 + */ + private void configureSuperAdminPermissionsForImportedMenus(List importedMenus) { + try { + // 1.查找当前租户的超管权限的roleId + final Role superAdmin = roleService.getOne(new LambdaQueryWrapper().eq(Role::getRoleCode, "superAdmin")); + if (superAdmin == null) { + System.out.println("未找到superAdmin角色"); + return; + } + + final Integer roleId = superAdmin.getRoleId(); + final Integer tenantId = superAdmin.getTenantId(); + + // 为所有导入的菜单配置权限 + for (Menu menu : importedMenus) { + RoleMenu roleMenu = new RoleMenu(); + roleMenu.setRoleId(roleId); + roleMenu.setMenuId(menu.getMenuId()); + roleMenu.setTenantId(tenantId); + roleMenuService.save(roleMenu); + } + + // 调整根菜单的排序(如果有根菜单的话) + for (Menu menu : importedMenus) { + if (menu.getParentId() == 0) { + menu.setSortNumber(0); + menuService.updateById(menu); + break; + } + } + + System.out.println("为超级管理员配置菜单权限成功,共配置了" + importedMenus.size() + "个菜单"); + } catch (Exception e) { + System.err.println("为超级管理员配置菜单权限失败: " + e.getMessage()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/ModulesController.java b/src/main/java/com/gxwebsoft/common/system/controller/ModulesController.java new file mode 100644 index 0000000..71a1e14 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/ModulesController.java @@ -0,0 +1,139 @@ +package com.gxwebsoft.common.system.controller; + +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.common.system.service.ModulesService; +import com.gxwebsoft.common.system.entity.Modules; +import com.gxwebsoft.common.system.param.ModulesParam; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.BatchParam; +import com.gxwebsoft.common.core.annotation.OperationLog; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 模块管理控制器 + * + * @author 科技小王子 + * @since 2023-10-18 15:53:43 + */ +@Tag(name = "模块") +@RestController +@RequestMapping("/api/system/modules") +public class ModulesController extends BaseController { + @Resource + private ModulesService modulesService; + + @PreAuthorize("hasAuthority('sys:modules:list')") + @OperationLog + @Operation(summary = "分页查询模块管理") + @GetMapping("/page") + public ApiResult> page(ModulesParam param) { + PageParam page = new PageParam<>(param); +// page.setDefaultOrder("create_time desc"); + return success(modulesService.page(page, page.getWrapper())); + // 使用关联查询 + //return success(modulesService.pageRel(param)); + } + + @PreAuthorize("hasAuthority('sys:modules:list')") + @OperationLog + @Operation(summary = "查询全部模块管理") + @GetMapping() + public ApiResult> list(ModulesParam param) { + PageParam page = new PageParam<>(param); +// page.setDefaultOrder("create_time desc"); + return success(modulesService.list(page.getOrderWrapper())); + // 使用关联查询 + //return success(modulesService.listRel(param)); + } + + @PreAuthorize("hasAuthority('sys:modules:list')") + @OperationLog + @Operation(summary = "根据id查询模块管理") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + return success(modulesService.getById(id)); + // 使用关联查询 + //return success(modulesService.getByIdRel(id)); + } + + @PreAuthorize("hasAuthority('sys:modules:save')") + @OperationLog + @Operation(summary = "添加模块管理") + @PostMapping() + public ApiResult save(@RequestBody Modules modules) { + // 记录当前登录用户id + User loginUser = getLoginUser(); + if (loginUser != null) { + modules.setUserId(loginUser.getUserId()); + } + if (modulesService.save(modules)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:modules:update')") + @OperationLog + @Operation(summary = "修改模块管理") + @PutMapping() + public ApiResult update(@RequestBody Modules modules) { + if (modulesService.updateById(modules)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:modules:remove')") + @OperationLog + @Operation(summary = "删除模块管理") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (modulesService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:modules:save')") + @OperationLog + @Operation(summary = "批量添加模块管理") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (modulesService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:modules:update')") + @OperationLog + @Operation(summary = "批量修改模块管理") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(modulesService, "id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:modules:remove')") + @OperationLog + @Operation(summary = "批量删除模块管理") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (modulesService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/NoticeController.java b/src/main/java/com/gxwebsoft/common/system/controller/NoticeController.java new file mode 100644 index 0000000..8575dc4 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/NoticeController.java @@ -0,0 +1,141 @@ +package com.gxwebsoft.common.system.controller; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.core.web.BatchParam; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.Notice; +import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.common.system.param.NoticeParam; +import com.gxwebsoft.common.system.service.NoticeService; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 消息记录表控制器 + * + * @author 科技小王子 + * @since 2023-10-08 13:22:21 + */ +@Tag(name = "通知") +@RestController +@RequestMapping("/api/system/notice") +public class NoticeController extends BaseController { + @Resource + private NoticeService noticeService; + + @PreAuthorize("hasAuthority('sys:notice:list')") + @Operation(summary = "分页查询消息记录表") + @GetMapping("/page") + public ApiResult> page(NoticeParam param) { + // 使用关联查询 + return success(noticeService.pageRel(param)); + } + + @PreAuthorize("hasAuthority('sys:notice:list')") + @Operation(summary = "查询全部消息记录表") + @GetMapping() + public ApiResult> list(NoticeParam param) { + // 使用关联查询 + return success(noticeService.listRel(param)); + } + + @PreAuthorize("hasAuthority('sys:notice:list')") + @Operation(summary = "根据id查询消息记录表") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + // 使用关联查询 + return success(noticeService.getByIdRel(id)); + } + + @PreAuthorize("hasAuthority('sys:notice:save')") + @Operation(summary = "添加消息记录表") + @PostMapping() + public ApiResult save(@RequestBody Notice notice) { + // 记录当前登录用户id + User loginUser = getLoginUser(); + if (loginUser != null) { + notice.setUserId(loginUser.getUserId()); + } + if (noticeService.save(notice)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:notice:update')") + @Operation(summary = "修改消息记录表") + @PutMapping() + public ApiResult update(@RequestBody Notice notice) { + if (noticeService.updateById(notice)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:notice:remove')") + @Operation(summary = "删除消息记录表") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (noticeService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:notice:save')") + @Operation(summary = "批量添加消息记录表") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (noticeService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:notice:update')") + @Operation(summary = "批量修改消息记录表") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(noticeService, "notice_id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:notice:remove')") + @Operation(summary = "批量删除消息记录表") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (noticeService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + @Operation(summary = "统计信息") + @GetMapping("/getUnReadNum") + public ApiResult getUnReadNum(){ + JSONObject json = new JSONObject(); + json.put("notice",noticeService.count(new LambdaQueryWrapper() + .eq(Notice::getUserId, getLoginUserId()) + .eq(Notice::getType,"notice") + .eq(Notice::getStatus,0))); + json.put("letter",noticeService.count(new LambdaQueryWrapper() + .eq(Notice::getUserId, getLoginUserId()) + .eq(Notice::getType,"letter") + .eq(Notice::getStatus,0))); + json.put("todo",noticeService.count(new LambdaQueryWrapper() + .eq(Notice::getUserId, getLoginUserId()) + .eq(Notice::getType,"todo") + .eq(Notice::getStatus,0))); + return success("操作成功",json); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/NotifyByBalancePayController.java b/src/main/java/com/gxwebsoft/common/system/controller/NotifyByBalancePayController.java new file mode 100644 index 0000000..d5594ef --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/NotifyByBalancePayController.java @@ -0,0 +1,52 @@ +package com.gxwebsoft.common.system.controller; + +import com.gxwebsoft.common.core.config.ConfigProperties; +import com.gxwebsoft.common.core.utils.RedisUtil; +import com.gxwebsoft.common.core.utils.RequestUtil; +import com.gxwebsoft.common.core.web.BaseController; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.media.Schema; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.Map; + +/** + * 会员特权购买记录表控制器 + * + * @author 科技小王子 + * @since 2023-06-20 18:07:50 + */ +@Tag(name = "支付") +@RestController +@RequestMapping("/api/system/balance-pay") +public class NotifyByBalancePayController extends BaseController { + @Value("${spring.profiles.active}") + String active; + @Resource + private RedisUtil redisUtil; + @Resource + private RequestUtil requestUtil; + @Resource + private ConfigProperties conf; + + @Schema(description = "余额支付通知(未完成)") + @PostMapping("/notify/{tenantId}") + public String wxNotify(@RequestHeader Map header, @RequestBody String body, @PathVariable("tenantId") Integer tenantId) { + System.out.println("异步通知*************** = "); + + // 以支付通知回调为例,验签、解密并转换成 Transaction + try { + // 推送微信官方支付结果(携带租户ID的POST请求) +// requestUtil.pushBalancePayNotify(); + return "SUCCESS"; + } catch (Exception $e) { + System.out.println($e.getMessage()); + } + + return "fail"; + } + + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/OperationRecordController.java b/src/main/java/com/gxwebsoft/common/system/controller/OperationRecordController.java new file mode 100644 index 0000000..e6ccd04 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/OperationRecordController.java @@ -0,0 +1,62 @@ +package com.gxwebsoft.common.system.controller; + +import com.gxwebsoft.common.core.annotation.OperationLog; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.OperationRecord; +import com.gxwebsoft.common.system.param.OperationRecordParam; +import com.gxwebsoft.common.system.service.OperationRecordService; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 操作日志控制器 + * + * @author WebSoft + * @since 2018-12-24 16:10:12 + */ +@Tag(name = "操作日志") +@RestController +@RequestMapping("/api/system/operation-record") +public class OperationRecordController extends BaseController { + @Resource + private OperationRecordService operationRecordService; + + /** + * 分页查询操作日志 + */ + @PreAuthorize("hasAuthority('sys:operation-record:list')") + @Operation(summary = "分页查询操作日志") + @GetMapping("/page") + public ApiResult> page(OperationRecordParam param) { + return success(operationRecordService.pageRel(param)); + } + + /** + * 查询全部操作日志 + */ + @PreAuthorize("hasAuthority('sys:operation-record:list')") + @OperationLog + @Operation(summary = "查询全部操作日志") + @GetMapping() + public ApiResult> list(OperationRecordParam param) { + return success(operationRecordService.listRel(param)); + } + + /** + * 根据id查询操作日志 + */ + @PreAuthorize("hasAuthority('sys:operation-record:list')") + @Operation(summary = "根据id查询操作日志") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + return success(operationRecordService.getByIdRel(id)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/OrderController.java b/src/main/java/com/gxwebsoft/common/system/controller/OrderController.java new file mode 100644 index 0000000..3ea9fd9 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/OrderController.java @@ -0,0 +1,270 @@ +package com.gxwebsoft.common.system.controller; + +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import com.gxwebsoft.common.core.annotation.OperationLog; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.core.web.BatchParam; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.Cart; +import com.gxwebsoft.common.system.entity.Order; +import com.gxwebsoft.common.system.entity.OrderGoods; +import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.common.system.mapper.MenuMapper; +import com.gxwebsoft.common.system.param.MenuParam; +import com.gxwebsoft.common.system.param.OrderParam; +import com.gxwebsoft.common.system.service.MenuService; +import com.gxwebsoft.common.system.service.OrderGoodsService; +import com.gxwebsoft.common.system.service.OrderService; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +/** + * 订单控制器 + * + * @author 科技小王子 + * @since 2024-10-16 12:32:52 + */ +@Tag(name = "订单管理") +@RestController +@RequestMapping("/api/system/order") +public class OrderController extends BaseController { + @Resource + private OrderService orderService; + @Resource + private OrderGoodsService orderGoodsService; + @Resource + private MenuService menuService; + @Resource + private MenuMapper menuMapper; + + @Operation(summary = "分页查询订单") + @GetMapping("/page") + public ApiResult> page(OrderParam param) { + // 使用关联查询 + final User loginUser = getLoginUser(); + if (loginUser == null) { + return fail("请先登陆",null); + } + // 非平台权限 + if (!loginUser.getTenantId().equals(5)) { + param.setUserId(loginUser.getUserId()); + } + return success(orderService.pageRel(param)); + } + + @PreAuthorize("hasAuthority('sys:order:list')") + @OperationLog + @Operation(summary = "查询全部订单") + @GetMapping() + public ApiResult> list(OrderParam param) { + final User loginUser = getLoginUser(); + // 非平台权限 + if (!loginUser.getTenantId().equals(5)) { + param.setUserId(loginUser.getUserId()); + } + // 使用关联查询 + return success(orderService.listRel(param)); + } + + @PreAuthorize("hasAuthority('sys:order:list')") + @OperationLog + @Operation(summary = "根据id查询订单") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + // 使用关联查询 + return success(orderService.getByIdRel(id)); + } + + @Operation(summary = "添加订单") + @PostMapping() + public ApiResult save(@RequestBody Order order) { + // 记录当前登录用户id + User loginUser = getLoginUser(); + if(loginUser == null){ + return fail("请先登录"); + } + if (ObjectUtil.isEmpty(order.getType())) { + return fail("订单类型不能为空"); + } + // 封装订单信息 + order.setUserId(loginUser.getUserId()); + order.setTenantId(loginUser.getTenantId()); + order.setOrderNo(Long.toString(IdUtil.getSnowflakeNextId())); + order.setPhone(loginUser.getPhone()); + order.setRealName(loginUser.getRealName()); + // 购买商品 + if (order.getType().equals(0)) { + order.setVersion(0); + } + // 购买插件 + if (order.getType().equals(1)) { + order.setVersion(1); + } + + if (orderService.save(order)) { + // 余额支付 + if(order.getPayType().equals(0)){ + if (loginUser.getBalance().compareTo(order.getPayPrice()) < 0) { + return fail("余额不足"+loginUser.getBalance()+"==="+order.getPayPrice()); + } + return success("支付成功"); + } + } + return fail("添加失败"); + } + + @Operation(summary = "修改订单") + @PutMapping() + public ApiResult update(@RequestBody Order order) { + if (orderService.updateById(order)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:order:remove')") + @OperationLog + @Operation(summary = "删除订单") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (orderService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:order:save')") + @OperationLog + @Operation(summary = "批量添加订单") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (orderService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:order:update')") + @OperationLog + @Operation(summary = "批量修改订单") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(orderService, "order_id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:order:remove')") + @OperationLog + @Operation(summary = "批量删除订单") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (orderService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @Operation(summary = "统一下单") + @PostMapping("/createOrder") + public ApiResult createOrder(@RequestBody Cart cart) { + final MenuParam menuParam = new MenuParam(); + // 记录当前登录用户id + User loginUser = getLoginUser(); + if (loginUser != null) { + // 封装订单数据 + final Order order = new Order(); + order.setType(cart.getType()); + order.setPayType(cart.getPayType()); + order.setPayPrice(cart.getPayPrice()); + order.setTotalPrice(cart.getTotalPrice()); + order.setMonth(cart.getMonth()); + order.setUserId(loginUser.getUserId()); + order.setOrderNo(Long.toString(IdUtil.getSnowflakeNextId())); + order.setPhone(loginUser.getPhone()); + order.setComments(cart.getComments()); + order.setTenantId(loginUser.getTenantId()); + order.setRealName(loginUser.getRealName()); + order.setPayTime(DateUtil.date()); + + // 购买商品 + if (order.getType().equals(0)) { + order.setVersion(0); + } + // 购买插件 + if (order.getType().equals(1)) { + order.setVersion(1); + } + // 判断支付方式 + if(order.getPayType() == null){ + return fail("支付方式不能为空"); + } + // 商品描述(必填) + if (StrUtil.isBlank(order.getComments())) { + return fail("商品描述(必填)"); + } + // 微信支付 + if(order.getPayType().equals(1)){ + // 微信openid(必填) + if (StrUtil.isBlank(loginUser.getOpenid())) { + return fail("微信openid(必填)"); + } + // 微信支付(商品金额不能为0) + if (order.getTotalPrice().compareTo(BigDecimal.ZERO) == 0) { + return fail("商品金额不能为0"); + } + } + // 创建订单成功 + if (orderService.save(order)) { + final ArrayList orderGoods = new ArrayList<>(); + if (order.getType().equals(1)) { + cart.getList().forEach(item -> { + final OrderGoods og = new OrderGoods(); + og.setOrderId(order.getOrderId()); + og.setType(order.getType()); + og.setItemId(item.getCompanyId()); + og.setMenuId(item.getMenuId()); + og.setPayPrice(item.getPrice()); + og.setMonth(order.getMonth()); + og.setTotalNum(order.getCartNum()); + og.setPayStatus(false); + og.setOrderStatus(0); + og.setTenantId(loginUser.getTenantId()); + og.setUserId(loginUser.getUserId()); + og.setComments(item.getTenantName()); + orderGoods.add(og); + menuParam.setMenuId(item.getMenuId()); + menuParam.setTenantId(item.getTenantId()); + }); + } + // 记录订单商品 + orderGoodsService.saveBatch(orderGoods); + + // 余额支付 + if(order.getPayType().equals(0)){ + if (loginUser.getBalance().compareTo(order.getPayPrice()) < 0) { + return fail("余额不足"+loginUser.getBalance()+"==="+order.getPayPrice()); + } + // 附加插件参数 + order.setMenuParam(menuParam); + // 执行支付成功后事务 + orderService.paySuccess(order); + return success("余额支付成功"); + } + } + } + return fail("下单失败"); + } +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/OrderGoodsController.java b/src/main/java/com/gxwebsoft/common/system/controller/OrderGoodsController.java new file mode 100644 index 0000000..03b7450 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/OrderGoodsController.java @@ -0,0 +1,158 @@ +package com.gxwebsoft.common.system.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.core.web.BatchParam; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.Order; +import com.gxwebsoft.common.system.entity.OrderGoods; +import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.common.system.param.OrderGoodsParam; +import com.gxwebsoft.common.system.service.MenuService; +import com.gxwebsoft.common.system.service.OrderGoodsService; +import com.gxwebsoft.common.system.service.OrderService; +import com.gxwebsoft.common.system.service.impl.MenuServiceImpl; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 订单商品控制器 + * + * @author 科技小王子 + * @since 2024-10-26 12:18:05 + */ +@Tag(name = "订单商品管理") +@RestController +@RequestMapping("/api/system/order-goods") +public class OrderGoodsController extends BaseController { + @Resource + private OrderGoodsService orderGoodsService; + @Resource + private OrderService orderService; + @Resource + private MenuService menuService; + @Resource + private MenuServiceImpl menuServiceImpl; + + @Operation(summary = "分页查询订单商品") + @GetMapping("/page") + public ApiResult> page(OrderGoodsParam param) { + // 使用关联查询 + final User loginUser = getLoginUser(); + if (loginUser == null) { + return fail("请先登陆",null); + } + // 非平台权限 + if (!loginUser.getTenantId().equals(5)) { + param.setUserId(loginUser.getUserId()); + } + return success(orderGoodsService.pageRel(param)); + } + + @PreAuthorize("hasAuthority('sys:order:list')") + @Operation(summary = "查询全部订单商品") + @GetMapping() + public ApiResult> list(OrderGoodsParam param) { + // 使用关联查询 + return success(orderGoodsService.listRel(param)); + } + + @PreAuthorize("hasAuthority('sys:order:list')") + @Operation(summary = "根据id查询订单商品") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + // 使用关联查询 + return success(orderGoodsService.getByIdRel(id)); + } + + @PreAuthorize("hasAuthority('sys:order:save')") + @Operation(summary = "添加订单商品") + @PostMapping() + public ApiResult save(@RequestBody OrderGoods orderGoods) { + // 记录当前登录用户id + User loginUser = getLoginUser(); + if (loginUser != null) { + orderGoods.setUserId(loginUser.getUserId()); + } + if (orderGoodsService.save(orderGoods)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:order:update')") + @Operation(summary = "修改订单商品") + @PutMapping() + public ApiResult update(@RequestBody OrderGoods orderGoods) { + if (orderGoodsService.updateById(orderGoods)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @Operation(summary = "修改订单商品状态") + @PutMapping("/updateOrderStatus") + public ApiResult updateOrderStatus(@RequestBody OrderGoods orderGoods) { + final User loginUser = getLoginUser(); + if (loginUser == null) { + return fail("请先登录"); + } + // 复制菜单 + menuServiceImpl.install(orderGoods.getMenuId()); + if (orderGoodsService.updateById(orderGoods)) { + if (orderGoodsService.count(new LambdaQueryWrapper().eq(OrderGoods::getOrderStatus,0).eq(OrderGoods::getOrderId,orderGoods.getOrderId())) == 0) { + orderService.update(new LambdaUpdateWrapper().eq(Order::getOrderId,orderGoods.getOrderId()).set(Order::getOrderStatus,1)); + } + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:order:remove')") + @Operation(summary = "删除订单商品") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (orderGoodsService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:order:save')") + @Operation(summary = "批量添加订单商品") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (orderGoodsService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:order:update')") + @Operation(summary = "批量修改订单商品") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(orderGoodsService, "id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:order:remove')") + @Operation(summary = "批量删除订单商品") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (orderGoodsService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/OrganizationController.java b/src/main/java/com/gxwebsoft/common/system/controller/OrganizationController.java new file mode 100644 index 0000000..e7bd040 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/OrganizationController.java @@ -0,0 +1,141 @@ +package com.gxwebsoft.common.system.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.gxwebsoft.common.core.annotation.OperationLog; +import com.gxwebsoft.common.core.web.*; +import com.gxwebsoft.common.system.entity.FileRecord; +import com.gxwebsoft.common.system.entity.Organization; +import com.gxwebsoft.common.system.param.OrganizationParam; +import com.gxwebsoft.common.system.service.OrganizationService; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.apache.poi.xssf.streaming.SXSSFRow; +import org.apache.poi.xssf.streaming.SXSSFSheet; +import org.apache.poi.xssf.streaming.SXSSFWorkbook; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.Date; +import java.util.List; + +/** + * 组织机构控制器 + * + * @author WebSoft + * @since 2020-03-14 11:29:04 + */ +@Tag(name = "组织架构") +@RestController +@RequestMapping("/api/system/organization") +public class OrganizationController extends BaseController { + @Resource + private OrganizationService organizationService; + + @Operation(summary = "分页查询组织机构") + @GetMapping("/page") + public ApiResult> page(OrganizationParam param) { + return success(organizationService.pageRel(param)); + } + + @Operation(summary = "查询全部组织机构") + @GetMapping() + public ApiResult> list(OrganizationParam param) { + return success(organizationService.listRel(param)); + } + + @OperationLog + @Operation(summary = "根据id查询组织机构") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + return success(organizationService.getByIdRel(id)); + } + +// @PreAuthorize("hasAuthority('sys:org:save')") + @Operation(summary = "添加组织机构") + @PostMapping() + public ApiResult add(@RequestBody Organization organization) { + if (organization.getParentId() == null) { + organization.setParentId(0); + } + if (organizationService.count(new LambdaQueryWrapper() + .eq(Organization::getOrganizationName, organization.getOrganizationName()) + .eq(Organization::getParentId, organization.getParentId())) > 0) { + return fail("机构名称已存在"); + } + if (organizationService.save(organization)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:org:update')") + @OperationLog + @Operation(summary = "修改组织机构") + @PutMapping() + public ApiResult update(@RequestBody Organization organization) { + if (organization.getOrganizationName() != null) { + if (organization.getParentId() == null) { + organization.setParentId(0); + } +// if (organizationService.count(new LambdaQueryWrapper() +// .eq(Organization::getOrganizationName, organization.getOrganizationName()) +// .eq(Organization::getParentId, organization.getParentId()) +// .ne(Organization::getOrganizationId, organization.getOrganizationId())) > 0) { +// return fail("机构名称已存在"); +// } + } + if (organizationService.updateById(organization)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:org:remove')") + @OperationLog + @Operation(summary = "删除组织机构") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (organizationService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:org:save')") + @OperationLog + @Operation(summary = "批量添加组织机构") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List organizationList) { + if (organizationService.saveBatch(organizationList)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:org:update')") + @OperationLog + @Operation(summary = "批量修改组织机构") + @PutMapping("/batch") + public ApiResult updateBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(organizationService, Organization::getOrganizationId)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:org:remove')") + @OperationLog + @Operation(summary = "批量删除组织机构") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (organizationService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/PaymentController.java b/src/main/java/com/gxwebsoft/common/system/controller/PaymentController.java new file mode 100644 index 0000000..6de4d67 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/PaymentController.java @@ -0,0 +1,172 @@ +package com.gxwebsoft.common.system.controller; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.gxwebsoft.common.core.utils.RedisUtil; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.system.entity.*; +import com.gxwebsoft.common.system.service.PaymentService; +import com.gxwebsoft.common.system.param.PaymentParam; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.BatchParam; +import com.gxwebsoft.common.core.annotation.OperationLog; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.util.CollectionUtils; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; +import java.util.concurrent.TimeUnit; + +/** + * 支付方式控制器 + * + * @author 科技小王子 + * @since 2024-05-11 12:39:11 + */ +@Tag(name = "支付") +@RestController +@RequestMapping("/api/system/payment") +public class PaymentController extends BaseController { + @Resource + private PaymentService paymentService; + @Resource + private RedisUtil redisUtil; + + @Operation(summary = "选择支付方式") + @GetMapping("/select") + public ApiResult select(PaymentParam param) { + String key = "SelectPayment:".concat(getTenantId().toString()); + final String string = redisUtil.get(key); + final List paymentList = JSONObject.parseArray(string, Payment.class); + if (!CollectionUtils.isEmpty(paymentList)) { + return success(paymentList); + } + // 使用关联查询 + final List list = paymentService.list(new LambdaUpdateWrapper().eq(Payment::getStatus, true)); + if (!CollectionUtils.isEmpty(list)) { + list.forEach(d -> { + d.setApiKey(null); + d.setApiclientCert(null); + d.setApiclientKey(null); + d.setMerchantSerialNumber(null); + }); + } + redisUtil.set(key,list,1L, TimeUnit.DAYS); + return success(list); + } + + @PreAuthorize("hasAuthority('sys:payment:list')") + @Operation(summary = "分页查询支付方式") + @GetMapping("/page") + public ApiResult> page(PaymentParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("sort_number asc, create_time asc"); + return success(paymentService.page(page, page.getWrapper())); + // 使用关联查询 +// return success(paymentService.pageRel(param)); + } + + @PreAuthorize("hasAuthority('sys:payment:list')") + @Operation(summary = "查询全部支付方式") + @GetMapping() + public ApiResult> list(PaymentParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("sort_number asc, create_time asc"); + return success(paymentService.list(page.getOrderWrapper())); + // 使用关联查询 + //return success(paymentService.listRel(param)); + } + + @PreAuthorize("hasAuthority('sys:payment:list')") + @Operation(summary = "根据id查询支付方式") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + return success(paymentService.getById(id)); + // 使用关联查询 + //return success(paymentService.getByIdRel(id)); + } + + @PreAuthorize("hasAuthority('sys:payment:save')") + @OperationLog + @Operation(summary = "添加支付方式") + @PostMapping() + public ApiResult save(@RequestBody Payment payment) { + if (paymentService.count(new LambdaQueryWrapper().eq(Payment::getCode,payment.getCode())) > 0) { + return fail(payment.getName() + "已存在"); + } + if (paymentService.save(payment)) { + String key = "Payment:" + payment.getCode() + ":" + getTenantId(); + redisUtil.set(key,payment); + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:payment:update')") + @OperationLog + @Operation(summary = "修改支付方式") + @PutMapping() + public ApiResult update(@RequestBody Payment payment) { + if (paymentService.updateById(payment)) { + String key = "Payment:" + payment.getCode() + ":" + getTenantId(); + redisUtil.set(key,payment); + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:payment:remove')") + @OperationLog + @Operation(summary = "删除支付方式") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + final Payment payment = paymentService.getById(id); + System.out.println("payment = " + payment); + String key = "Payment:" + payment.getCode() + ":" + getTenantId(); + redisUtil.delete(key); + if (paymentService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:payment:save')") + @OperationLog + @Operation(summary = "批量添加支付方式") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (paymentService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:payment:update')") + @OperationLog + @Operation(summary = "批量修改支付方式") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(paymentService, "id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:payment:remove')") + @OperationLog + @Operation(summary = "批量删除支付方式") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (paymentService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/PlugController.java b/src/main/java/com/gxwebsoft/common/system/controller/PlugController.java new file mode 100644 index 0000000..d41c06d --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/PlugController.java @@ -0,0 +1,125 @@ +package com.gxwebsoft.common.system.controller; + +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.common.system.service.PlugService; +import com.gxwebsoft.common.system.entity.Plug; +import com.gxwebsoft.common.system.param.PlugParam; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.core.web.BatchParam; +import com.gxwebsoft.common.core.annotation.OperationLog; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 插件扩展控制器 + * + * @author 科技小王子 + * @since 2023-10-12 09:53:07 + */ +@Tag(name = "插件") +@RestController +@RequestMapping("/api/system/plug") +public class PlugController extends BaseController { + @Resource + private PlugService plugService; + + @Operation(summary = "分页查询插件扩展") + @GetMapping("/page") + public ApiResult> page(PlugParam param) { + // 使用关联查询 + return success(plugService.pageRel(param)); + } + + @Operation(summary = "查询全部插件扩展") + @GetMapping() + public ApiResult> list(PlugParam param) { + // 使用关联查询 + return success(plugService.listRel(param)); + } + + @Operation(summary = "根据id查询插件扩展") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + // 使用关联查询 + return success(plugService.getByIdRel(id)); + } + + @PreAuthorize("hasAuthority('sys:plug:save')") + @OperationLog + @Operation(summary = "添加插件扩展") + @PostMapping() + public ApiResult save(@RequestBody Plug plug) { + // 记录当前登录用户id + User loginUser = getLoginUser(); + if (loginUser != null) { + plug.setUserId(loginUser.getUserId()); + } + if (plugService.save(plug)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:plug:update')") + @OperationLog + @Operation(summary = "修改插件扩展") + @PutMapping() + public ApiResult update(@RequestBody Plug plug) { + if (plugService.updateById(plug)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:plug:remove')") + @OperationLog + @Operation(summary = "删除插件扩展") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (plugService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:plug:save')") + @OperationLog + @Operation(summary = "批量添加插件扩展") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (plugService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:plug:update')") + @OperationLog + @Operation(summary = "批量修改插件扩展") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(plugService, "plug_id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:plug:remove')") + @OperationLog + @Operation(summary = "批量删除插件扩展") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (plugService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/RechargeOrderController.java b/src/main/java/com/gxwebsoft/common/system/controller/RechargeOrderController.java new file mode 100644 index 0000000..9668ce6 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/RechargeOrderController.java @@ -0,0 +1,191 @@ +package com.gxwebsoft.common.system.controller; + +import cn.hutool.core.util.IdUtil; +import com.gxwebsoft.common.core.utils.CommonUtil; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.core.web.BatchParam; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.common.system.service.UserService; +import com.gxwebsoft.common.system.entity.RechargeOrder; +import com.gxwebsoft.common.system.entity.UserBalanceLog; +import com.gxwebsoft.common.system.param.RechargeOrderParam; +import com.gxwebsoft.common.system.service.RechargeOrderService; +import com.gxwebsoft.common.system.service.UserBalanceLogService; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +import static com.gxwebsoft.common.core.constants.BalanceConstants.BALANCE_ADMIN; + +/** + * 会员充值订单表控制器 + * + * @author 科技小王子 + * @since 2024-07-26 23:18:48 + */ +@Tag(name = "用户充值订单") +@RestController +@RequestMapping("/api/sys/recharge-order") +public class RechargeOrderController extends BaseController { + @Resource + private RechargeOrderService rechargeOrderService; + @Resource + private UserService userService; + @Resource + private UserBalanceLogService userBalanceLogService; + + @PreAuthorize("hasAuthority('sys:rechargeOrder:save')") + @Operation(summary = "会员充值") + @PostMapping("/recharge") + @Transactional(rollbackFor = {Exception.class}) + public ApiResult recharge(@RequestBody RechargeOrder rechargeOrder) { + // 充值 + User user = userService.getById(rechargeOrder.getUserId()); + BigDecimal balance = user.getBalance().add(rechargeOrder.getPayPrice()); + user.setBalance(balance); + userService.updateById(user); + // 保存充值记录 + rechargeOrder.setOrderNo(Long.toString(IdUtil.getSnowflakeNextId())); + rechargeOrder.setTradeId(Integer.valueOf(CommonUtil.createOrderNo())); + rechargeOrder.setBalance(balance); + if (rechargeOrderService.save(rechargeOrder)) { + // 记录余额明细 + UserBalanceLog userBalanceLog = new UserBalanceLog(); + userBalanceLog.setUserId(rechargeOrder.getUserId()); + userBalanceLog.setScene(BALANCE_ADMIN); + userBalanceLog.setMoney(rechargeOrder.getPayPrice()); + userBalanceLog.setBalance(balance); + userBalanceLog.setTransactionId(UUID.randomUUID().toString()); + userBalanceLog.setComments("操作人:" + getLoginUser().getNickname()); + userBalanceLog.setRemark(rechargeOrder.getComments()); + userBalanceLog.setMerchantCode(rechargeOrder.getMerchantCode()); + userBalanceLogService.save(userBalanceLog); + return success("充值成功", user); + } + return fail("充值失败"); + } + + @PreAuthorize("hasAuthority('sys:rechargeOrder:list')") + @Operation(summary = "分页查询会员充值订单表") + @GetMapping("/page") + public ApiResult> page(RechargeOrderParam param) { + // 使用关联查询 + return success(rechargeOrderService.pageRel(param)); + } + + @PreAuthorize("hasAuthority('sys:rechargeOrder:list')") + @Operation(summary = "查询全部会员充值订单表") + @GetMapping() + public ApiResult> list(RechargeOrderParam param) { + // 使用关联查询 + return success(rechargeOrderService.listRel(param)); + } + + @PreAuthorize("hasAuthority('sys:rechargeOrder:list')") + @Operation(summary = "根据id查询会员充值订单表") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + // 使用关联查询 + return success(rechargeOrderService.getByIdRel(id)); + } + + @Operation(summary = "添加会员充值订单表") + @PostMapping() + public ApiResult save(@RequestBody RechargeOrder rechargeOrder) { + // 记录当前登录用户id + User loginUser = getLoginUser(); + if (loginUser != null) { + rechargeOrder.setUserId(loginUser.getUserId()); + } + if (rechargeOrderService.save(rechargeOrder)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @Operation(summary = "修改会员充值订单表") + @PutMapping() + public ApiResult update(@RequestBody RechargeOrder rechargeOrder) { + if (rechargeOrderService.updateById(rechargeOrder)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @Operation(summary = "删除会员充值订单表") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (rechargeOrderService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:rechargeOrder:save')") + @Operation(summary = "批量充值") + @PostMapping("/batchRecharge") + @Transactional(rollbackFor = {Exception.class}) + public ApiResult batchRecharge(@RequestBody List list) { + String nickname = getLoginUser().getNickname(); + String realName = getLoginUser().getRealName(); + ArrayList users = new ArrayList<>(list.size()); + ArrayList logs = new ArrayList<>(list.size()); + + list.forEach(d -> { + User user = userService.getByIdRel(d.getUserId()); + BigDecimal balance = user.getBalance().add(d.getPayPrice()); + user.setBalance(balance); + users.add(user); + UserBalanceLog userBalanceLog = new UserBalanceLog(); + userBalanceLog.setUserId(d.getUserId()); + userBalanceLog.setScene(BALANCE_ADMIN); + userBalanceLog.setMoney(d.getPayPrice()); + userBalanceLog.setBalance(balance); + userBalanceLog.setComments("操作员:" + realName); + userBalanceLog.setRemark(d.getComments()); + userBalanceLog.setMerchantCode(d.getMerchantCode()); + d.setOperator(realName); + logs.add(userBalanceLog); + }); + + if (rechargeOrderService.saveBatch(list)) { + // 批量充值 + userService.updateBatchById(users); + // 记录余额明细 + userBalanceLogService.saveBatch(logs); + return success("充值成功"); + } + return fail("充值失败"); + } + + @PreAuthorize("hasAuthority('sys:rechargeOrder:update')") + @Operation(summary = "批量修改会员充值订单表") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(rechargeOrderService, "order_id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:rechargeOrder:remove')") + @Operation(summary = "批量删除会员充值订单表") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (rechargeOrderService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/RedisUtilController.java b/src/main/java/com/gxwebsoft/common/system/controller/RedisUtilController.java new file mode 100644 index 0000000..a8216f4 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/RedisUtilController.java @@ -0,0 +1,75 @@ +package com.gxwebsoft.common.system.controller; + +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.system.entity.User; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.web.bind.annotation.*; + +@RestController +@RequestMapping("/api/redis-util") +@Tag(name = "Redis缓存") +public class RedisUtilController extends BaseController { + private final StringRedisTemplate redisTemplate; + private static final String SPLIT = ":"; + private static final String PREFIX_ENTITY_LIKE = "focus:user"; + private static final String PREFIX_USER_LIKE = "like:user"; + private static final String PREFIX_FOLLOWEE = "followee"; + private static final String PREFIX_FOLLOWER = "follower"; + + + public RedisUtilController(StringRedisTemplate redisTemplate) { + this.redisTemplate = redisTemplate; + } + + @Operation(summary = "添加关注") + @PostMapping("/addFocus") + public ApiResult addFocus(@RequestBody User user) { + final Integer userId = user.getUserId(); + redisTemplate.opsForZSet().incrementScore(getFocusKey(userId), userId.toString(), 1); + return success("关注成功"); + } + + /** + * 某个用户的关注数 + * @return like:entity:[entityId] ->set(userId) + */ + public static String getFocusKey(Integer userId) { + return PREFIX_ENTITY_LIKE + SPLIT + userId; + } + + /** + * 某个用户的赞 + * @return like:entity:[entityId] ->set(userId) + */ + public static String getEntityLikeKey(int entityType, int entityId) { + return PREFIX_ENTITY_LIKE + SPLIT + entityType + SPLIT + entityId; + } + + /** + * 某个用户的赞 + * @return like:user:[userId] ->int + */ + public static String getUserLikeKey(int userId) { + return PREFIX_USER_LIKE + SPLIT + userId; + } + + /** + * 某个用户关注的实体(键:用户Id,值:实体Id) + * @return followee:[userId:entityType] ->zSet(entityId,now) + */ + public static String getFolloweeKey(int userId, int entityType) { + return PREFIX_FOLLOWEE + SPLIT + userId + SPLIT + entityType; + } + + /** + * 某个实体拥有的粉丝(键:实体Id,值:用户Id) + * @return follower:[entityType:entityId] ->zSet(entityId,now) + */ + public static String getFollowerKey(int entityType, int entityId) { + return PREFIX_FOLLOWER + SPLIT + entityType + SPLIT + entityId; + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/RoleController.java b/src/main/java/com/gxwebsoft/common/system/controller/RoleController.java new file mode 100644 index 0000000..f919b82 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/RoleController.java @@ -0,0 +1,148 @@ +package com.gxwebsoft.common.system.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.gxwebsoft.common.core.annotation.OperationLog; +import com.gxwebsoft.common.core.utils.CommonUtil; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.Role; +import com.gxwebsoft.common.system.param.RoleParam; +import com.gxwebsoft.common.system.service.RoleService; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 角色控制器 + * + * @author WebSoft + * @since 2018-12-24 16:10:02 + */ +@Tag(name = "角色") +@RestController +@RequestMapping("/api/system/role") +public class RoleController extends BaseController { + @Resource + private RoleService roleService; + + @Operation(summary = "分页查询角色") + @GetMapping("/page") + public ApiResult> page(RoleParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("sort_number asc"); + return success(roleService.page(page, page.getWrapper())); + } + + @Operation(summary = "查询全部角色") + @GetMapping() + public ApiResult> list(RoleParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("sort_number asc"); + return success(roleService.list(page.getOrderWrapper())); + } + + @Operation(summary = "根据id查询角色") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + return success(roleService.getById(id)); + } + + @PreAuthorize("hasAuthority('sys:role:save')") + @OperationLog + @Operation(summary = "添加角色") + @PostMapping() + public ApiResult save(@RequestBody Role role) { + if (roleService.count(new LambdaQueryWrapper().eq(Role::getRoleCode, role.getRoleCode())) > 0) { + return fail("角色标识已存在"); + } + if (roleService.count(new LambdaQueryWrapper().eq(Role::getRoleName, role.getRoleName())) > 0) { + return fail("角色名称已存在"); + } + if (roleService.save(role)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:role:update')") + @OperationLog + @Operation(summary = "修改角色") + @PutMapping() + public ApiResult update(@RequestBody Role role) { + if (role.getRoleCode() != null && roleService.count(new LambdaQueryWrapper() + .eq(Role::getRoleCode, role.getRoleCode()) + .ne(Role::getRoleId, role.getRoleId())) > 0) { + return fail("角色标识已存在"); + } + if (role.getRoleName() != null && roleService.count(new LambdaQueryWrapper() + .eq(Role::getRoleName, role.getRoleName()) + .ne(Role::getRoleId, role.getRoleId())) > 0) { + return fail("角色名称已存在"); + } + if (roleService.updateById(role)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:role:remove')") + @OperationLog + @Operation(summary = "删除角色") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (roleService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:role:save')") + @OperationLog + @Operation(summary = "批量添加角色") + @PostMapping("/batch") + public ApiResult> saveBatch(@RequestBody List list) { + // 校验是否重复 + if (CommonUtil.checkRepeat(list, Role::getRoleName)) { + return fail("角色名称存在重复", null); + } + if (CommonUtil.checkRepeat(list, Role::getRoleCode)) { + return fail("角色标识存在重复", null); + } + // 校验是否存在 + List codeExists = roleService.list(new LambdaQueryWrapper().in(Role::getRoleCode, + list.stream().map(Role::getRoleCode).collect(Collectors.toList()))); + if (codeExists.size() > 0) { + return fail("角色标识已存在", codeExists.stream().map(Role::getRoleCode) + .collect(Collectors.toList())).setCode(2); + } + List nameExists = roleService.list(new LambdaQueryWrapper().in(Role::getRoleName, + list.stream().map(Role::getRoleCode).collect(Collectors.toList()))); + if (nameExists.size() > 0) { + return fail("角色标识已存在", nameExists.stream().map(Role::getRoleCode) + .collect(Collectors.toList())).setCode(3); + } + if (roleService.saveBatch(list)) { + return success("添加成功", null); + } + return fail("添加失败", null); + } + + @PreAuthorize("hasAuthority('sys:role:remove')") + @OperationLog + @Operation(summary = "批量删除角色") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (roleService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/RoleMenuController.java b/src/main/java/com/gxwebsoft/common/system/controller/RoleMenuController.java new file mode 100644 index 0000000..b0552d7 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/RoleMenuController.java @@ -0,0 +1,100 @@ +package com.gxwebsoft.common.system.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.gxwebsoft.common.core.annotation.OperationLog; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.core.exception.BusinessException; +import com.gxwebsoft.common.system.entity.Menu; +import com.gxwebsoft.common.system.entity.RoleMenu; +import com.gxwebsoft.common.system.service.MenuService; +import com.gxwebsoft.common.system.service.RoleMenuService; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; + +/** + * 角色菜单控制器 + * + * @author WebSoft + * @since 2018-12-24 16:10:01 + */ +@Tag(name = "角色菜单") +@RestController +@RequestMapping("/api/system/role-menu") +public class RoleMenuController extends BaseController { + @Resource + private RoleMenuService roleMenuService; + @Resource + private MenuService menuService; + + @PreAuthorize("hasAuthority('sys:role:list')") + @OperationLog + @Operation(summary = "查询角色菜单") + @GetMapping("/{id}") + public ApiResult> list(@PathVariable("id") Integer roleId) { + List menus = menuService.list(new LambdaQueryWrapper().orderByAsc(Menu::getSortNumber)); + List roleMenus = roleMenuService.list(new LambdaQueryWrapper() + .eq(RoleMenu::getRoleId, roleId)); + for (Menu menu : menus) { + menu.setChecked(roleMenus.stream().anyMatch((d) -> d.getMenuId().equals(menu.getMenuId()))); + } + return success(menus); + } + + @Transactional(rollbackFor = {Exception.class}) + @PreAuthorize("hasAuthority('sys:role:update')") + @OperationLog + @Operation(summary = "修改角色菜单") + @PutMapping("/{id}") + public ApiResult update(@PathVariable("id") Integer roleId, @RequestBody List menuIds) { + roleMenuService.remove(new LambdaUpdateWrapper().eq(RoleMenu::getRoleId, roleId)); + if (menuIds != null && menuIds.size() > 0) { + List roleMenuList = new ArrayList<>(); + for (Integer menuId : menuIds) { + RoleMenu roleMenu = new RoleMenu(); + roleMenu.setRoleId(roleId); + roleMenu.setMenuId(menuId); + roleMenuList.add(roleMenu); + } + if (!roleMenuService.saveBatch(roleMenuList)) { + throw new BusinessException("保存失败"); + } + } + return success("保存成功"); + } + + @PreAuthorize("hasAuthority('sys:role:update')") + @OperationLog + @Operation(summary = "添加角色菜单") + @PostMapping("/{id}") + public ApiResult addRoleAuth(@PathVariable("id") Integer roleId, @RequestBody Integer menuId) { + RoleMenu roleMenu = new RoleMenu(); + roleMenu.setRoleId(roleId); + roleMenu.setMenuId(menuId); + if (roleMenuService.save(roleMenu)) { + return success(); + } + return fail(); + } + + @PreAuthorize("hasAuthority('sys:role:update')") + @OperationLog + @Operation(summary = "移除角色菜单") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer roleId, @RequestBody Integer menuId) { + if (roleMenuService.remove(new LambdaUpdateWrapper() + .eq(RoleMenu::getRoleId, roleId).eq(RoleMenu::getMenuId, menuId))) { + return success(); + } + return fail(); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/SettingController.java b/src/main/java/com/gxwebsoft/common/system/controller/SettingController.java new file mode 100644 index 0000000..fe42930 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/SettingController.java @@ -0,0 +1,397 @@ +package com.gxwebsoft.common.system.controller; + +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.gxwebsoft.common.core.annotation.OperationLog; +import com.gxwebsoft.common.core.utils.JSONUtil; +import com.gxwebsoft.common.core.utils.RedisUtil; +import com.gxwebsoft.common.core.web.*; +import com.gxwebsoft.common.system.entity.Setting; +import com.gxwebsoft.common.system.entity.Tenant; +import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.common.system.param.SettingParam; +import com.gxwebsoft.common.system.param.SettingUpdateParam; +import com.gxwebsoft.common.system.service.SettingService; +import com.gxwebsoft.common.system.service.TenantService; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 系统设置控制器 + * + * @author WebSoft + * @since 2022-11-19 13:54:27 + */ +@Tag(name = "系统设置") +@RestController +@RequestMapping("/api/system/setting") +public class SettingController extends BaseController { + @Resource + private SettingService settingService; + @Resource + private TenantService tenantService; + @Resource + private RedisUtil redisUtil; + + @PreAuthorize("hasAuthority('sys:setting:save')") + @OperationLog + @Operation(summary = "分页查询系统设置") + @GetMapping("/page") + public ApiResult> page(SettingParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + return success(settingService.page(page, page.getWrapper())); + // 使用关联查询 + //return success(settingService.pageRel(param)); + } + + @PreAuthorize("hasAuthority('sys:setting:save')") + @OperationLog + @Operation(summary = "查询全部系统设置") + @GetMapping() + public ApiResult> list(SettingParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + return success(settingService.list(page.getOrderWrapper())); + // 使用关联查询 + //return success(settingService.listRel(param)); + } + + @PreAuthorize("hasAuthority('sys:setting:save')") + @OperationLog + @Operation(summary = "根据id查询系统设置") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + return success(settingService.getById(id)); + // 使用关联查询 + //return success(settingService.getByIdRel(id)); + } + + @PreAuthorize("hasAuthority('sys:setting:save')") + @OperationLog + @Operation(summary = "添加系统设置") + @PostMapping() + public ApiResult save(@RequestBody SettingUpdateParam settingParam) { + final User loginUser = getLoginUser(); + if(loginUser == null){ + return fail("请先登录"); + } + + // 转换为Setting对象 + Setting setting = convertToSetting(settingParam); + setting.setTenantId(loginUser.getTenantId()); + + if (settingService.save(setting)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:setting:save')") + @OperationLog + @Operation(summary = "修改系统设置") + @PutMapping() + public ApiResult update(@RequestBody SettingUpdateParam settingParam) { + final User loginUser = getLoginUser(); + if(loginUser == null){ + return fail("请先登录"); + } + + // 转换为Setting对象 + Setting setting = convertToSetting(settingParam); + setting.setTenantId(loginUser.getTenantId()); + if (settingService.updateById(setting)) { + // 更新系统设置信息到缓存 key = "" + String key = setting.getSettingKey().concat(":").concat(loginUser.getTenantId().toString()); + redisUtil.set(key, JSON.parseObject(setting.getContent())); + // 更新租户信息 + if (setting.getSettingKey().equals("setting")) { + final String content = setting.getContent(); + final JSONObject jsonObject = JSONObject.parseObject(content); + final String siteName = jsonObject.getString("siteName"); + final String logo = jsonObject.getString("logo"); + final Tenant tenant = new Tenant(); + tenant.setTenantName(siteName); + tenant.setTenantId(getTenantId()); + tenant.setLogo(logo); + tenantService.updateById(tenant); + } + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:setting:remove')") + @OperationLog + @Operation(summary = "删除系统设置") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (settingService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:setting:save')") + @OperationLog + @Operation(summary = "批量添加系统设置") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (settingService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:setting:update')") + @OperationLog + @Operation(summary = "批量修改系统设置") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(settingService, "setting_id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:setting:remove')") + @OperationLog + @Operation(summary = "批量删除系统设置") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (settingService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:setting:data')") + @OperationLog + @Operation(summary = "查询租户设置信息") + @GetMapping("/data") + public ApiResult data() { + return success(settingService.getData("setting")); + } + + @Operation(summary = "根据key查询系统设置") + @GetMapping("/getByKey/{key}") + public ApiResult getByKey(@PathVariable("key") String key) { + final User loginUser = getLoginUser(); + if(loginUser != null){ + return success(settingService.getBySettingKey(key)); + } + return fail("请先登录", null); + } + + @Operation(summary = "根据key更新系统设置") + @OperationLog + @PutMapping("/updateByKey") + public ApiResult updateByKey(@RequestBody SettingUpdateParam settingParam) { + final User loginUser = getLoginUser(); + if(loginUser == null){ + return fail("请先登录"); + } + // getIsSuperAdmin() is a Boolean and may be null; avoid NPE from auto-unboxing. + if(!"superAdmin".equals(loginUser.getUsername())){ + return fail("权限不足!"); + } + + // 转换为Setting对象 + Setting setting = convertToSetting(settingParam); + setting.setTenantId(loginUser.getTenantId()); + + return success(settingService.updateByKey(setting)); + } + + @PreAuthorize("hasAuthority('sys:setting:save')") + @OperationLog + @Operation(summary = "更新主题皮肤") + @PutMapping("/theme") + public ApiResult theme(@RequestBody SettingUpdateParam settingParam) { + // 转换为Setting对象 + Setting setting = convertToSetting(settingParam); + setting.setTenantId(getTenantId()); + String key = "theme:".concat(getTenantId().toString()); + // 新增 + final Setting one = settingService.getOne(new LambdaQueryWrapper().eq(Setting::getSettingKey, setting.getSettingKey())); + if(one == null){ + settingService.save(setting); + redisUtil.set(key,setting.getContent()); + return success("保存成功"); + } + // 更新 + final Setting update = settingService.getOne(new LambdaQueryWrapper().eq(Setting::getSettingKey, setting.getSettingKey())); + update.setContent(setting.getContent()); + if (settingService.updateById(update)) { + redisUtil.set(key,setting.getContent()); + return success("更新成功"); + } + return fail("更新失败"); + } + + @Operation(summary = "更新主题皮肤") + @GetMapping("/getTheme") + public ApiResult getTheme() { + String key = "theme:".concat(getTenantId().toString()); + return success("获取成功",redisUtil.get(key)); + } + + /** + * 将SettingUpdateParam转换为Setting对象 + * 根据settingKey的不同,将相应的字段组装成JSON格式的content + */ + private Setting convertToSetting(SettingUpdateParam param) { + Setting setting = new Setting(); + setting.setSettingKey(param.getSettingKey()); + setting.setSortNumber(param.getSortNumber()); + setting.setComments(param.getComments()); + setting.setTenantId(param.getTenantId()); + + // 如果直接提供了content,则使用content + if (StrUtil.isNotBlank(param.getContent())) { + setting.setContent(param.getContent()); + return setting; + } + + // 根据settingKey构建相应的JSON content + JSONObject contentJson = new JSONObject(); + + switch (param.getSettingKey()) { + case "mp-weixin": + // 微信小程序配置 + if (StrUtil.isNotBlank(param.getAppId())) { + contentJson.put("appId", param.getAppId()); + } + if (StrUtil.isNotBlank(param.getAppSecret())) { + contentJson.put("appSecret", param.getAppSecret()); + } + break; + + case "payment": + // 支付配置 + if (StrUtil.isNotBlank(param.getMchId())) { + contentJson.put("mchId", param.getMchId()); + } + if (StrUtil.isNotBlank(param.getApiKey())) { + contentJson.put("apiKey", param.getApiKey()); + } + if (StrUtil.isNotBlank(param.getWechatApiKey())) { + contentJson.put("wechatApiKey", param.getWechatApiKey()); + } + if (StrUtil.isNotBlank(param.getMerchantSerialNumber())) { + contentJson.put("merchantSerialNumber", param.getMerchantSerialNumber()); + } + if (StrUtil.isNotBlank(param.getApiclientCert())) { + contentJson.put("apiclientCert", param.getApiclientCert()); + } + if (StrUtil.isNotBlank(param.getApiclientKey())) { + contentJson.put("apiclientKey", param.getApiclientKey()); + } + break; + + case "sms": + // 短信配置 + if (StrUtil.isNotBlank(param.getAccessKeyId())) { + contentJson.put("accessKeyId", param.getAccessKeyId()); + } + if (StrUtil.isNotBlank(param.getAccessKeySecret())) { + contentJson.put("accessKeySecret", param.getAccessKeySecret()); + } + if (StrUtil.isNotBlank(param.getSignName())) { + contentJson.put("signName", param.getSignName()); + } + if (StrUtil.isNotBlank(param.getTemplateCode())) { + contentJson.put("templateCode", param.getTemplateCode()); + } + break; + + case "wx-work": + // 企业微信配置 + if (StrUtil.isNotBlank(param.getCorpId())) { + contentJson.put("corpId", param.getCorpId()); + } + if (StrUtil.isNotBlank(param.getSecret())) { + contentJson.put("secret", param.getSecret()); + } + break; + + case "wx-official": + // 微信公众号配置 + if (StrUtil.isNotBlank(param.getAppId())) { + contentJson.put("appId", param.getAppId()); + } + if (StrUtil.isNotBlank(param.getAppSecret())) { + contentJson.put("appSecret", param.getAppSecret()); + } + if (StrUtil.isNotBlank(param.getToken())) { + contentJson.put("token", param.getToken()); + } + if (StrUtil.isNotBlank(param.getEncodingAESKey())) { + contentJson.put("encodingAESKey", param.getEncodingAESKey()); + } + break; + + case "setting": + // 基本设置 + if (StrUtil.isNotBlank(param.getSiteName())) { + contentJson.put("siteName", param.getSiteName()); + } + if (StrUtil.isNotBlank(param.getLogo())) { + contentJson.put("logo", param.getLogo()); + } + if (StrUtil.isNotBlank(param.getDescription())) { + contentJson.put("description", param.getDescription()); + } + if (StrUtil.isNotBlank(param.getKeywords())) { + contentJson.put("keywords", param.getKeywords()); + } + break; + + case "upload": + // 上传配置 + if (StrUtil.isNotBlank(param.getBucketName())) { + contentJson.put("bucketName", param.getBucketName()); + } + if (StrUtil.isNotBlank(param.getBucketDomain())) { + contentJson.put("bucketDomain", param.getBucketDomain()); + } + if (StrUtil.isNotBlank(param.getBucketEndpoint())) { + contentJson.put("bucketEndpoint", param.getBucketEndpoint()); + } + if (StrUtil.isNotBlank(param.getAccessKeyId())) { + contentJson.put("accessKeyId", param.getAccessKeyId()); + } + if (StrUtil.isNotBlank(param.getAccessKeySecret())) { + contentJson.put("accessKeySecret", param.getAccessKeySecret()); + } + break; + + case "printer": + // 打印机配置 + if (StrUtil.isNotBlank(param.getDeviceNo())) { + contentJson.put("deviceNo", param.getDeviceNo()); + } + if (StrUtil.isNotBlank(param.getPrinterKey())) { + contentJson.put("printerKey", param.getPrinterKey()); + } + break; + + default: + // 处理其他配置或动态字段 + if (param.getAdditionalProperties() != null) { + contentJson.putAll(param.getAdditionalProperties()); + } + break; + } + + setting.setContent(contentJson.toJSONString()); + return setting; + } +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/SysFileTypeController.java b/src/main/java/com/gxwebsoft/common/system/controller/SysFileTypeController.java new file mode 100644 index 0000000..d84ab2b --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/SysFileTypeController.java @@ -0,0 +1,122 @@ +package com.gxwebsoft.common.system.controller; + +import com.gxwebsoft.common.core.annotation.OperationLog; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.core.web.BatchParam; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.SysFileType; +import com.gxwebsoft.common.system.param.SysFileTypeParam; +import com.gxwebsoft.common.system.service.SysFileTypeService; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 存储类型控制器 + * + * @author 科技小王子 + * @since 2025-05-16 14:24:28 + */ +@Tag(name = "存储类型管理") +@RestController +@RequestMapping("/api/system/sys-file-type") +public class SysFileTypeController extends BaseController { + @Resource + private SysFileTypeService sysFileTypeService; + + @PreAuthorize("hasAuthority('sys:sysFileType:list')") + @Operation(summary = "分页查询存储类型") + @GetMapping("/page") + public ApiResult> page(SysFileTypeParam param) { + // 使用关联查询 + return success(sysFileTypeService.pageRel(param)); + } + + @PreAuthorize("hasAuthority('sys:sysFileType:list')") + @Operation(summary = "查询全部存储类型") + @GetMapping() + public ApiResult> list(SysFileTypeParam param) { + // 使用关联查询 + return success(sysFileTypeService.listRel(param)); + } + + @PreAuthorize("hasAuthority('sys:sysFileType:list')") + @Operation(summary = "根据id查询存储类型") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + // 使用关联查询 + return success(sysFileTypeService.getByIdRel(id)); + } + + @PreAuthorize("hasAuthority('sys:sysFileType:save')") + @OperationLog + @Operation(summary = "添加存储类型") + @PostMapping() + public ApiResult save(@RequestBody SysFileType sysFileType) { + if (sysFileTypeService.save(sysFileType)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:sysFileType:update')") + @OperationLog + @Operation(summary = "修改存储类型") + @PutMapping() + public ApiResult update(@RequestBody SysFileType sysFileType) { + if (sysFileTypeService.updateById(sysFileType)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:sysFileType:remove')") + @OperationLog + @Operation(summary = "删除存储类型") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (sysFileTypeService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:sysFileType:save')") + @OperationLog + @Operation(summary = "批量添加存储类型") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (sysFileTypeService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:sysFileType:update')") + @OperationLog + @Operation(summary = "批量修改存储类型") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(sysFileTypeService, "id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:sysFileType:remove')") + @OperationLog + @Operation(summary = "批量删除存储类型") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (sysFileTypeService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/TenantController.java b/src/main/java/com/gxwebsoft/common/system/controller/TenantController.java new file mode 100644 index 0000000..957ffac --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/TenantController.java @@ -0,0 +1,247 @@ +package com.gxwebsoft.common.system.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.gxwebsoft.common.core.config.ConfigProperties; +import com.gxwebsoft.common.core.exception.BusinessException; +import com.gxwebsoft.common.core.utils.CommonUtil; +import com.gxwebsoft.common.core.utils.JSONUtil; +import com.gxwebsoft.common.core.utils.RedisUtil; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.system.entity.*; +import com.gxwebsoft.common.system.service.*; +import com.gxwebsoft.common.system.param.TenantParam; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.core.web.BatchParam; +import com.gxwebsoft.common.core.annotation.OperationLog; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.util.CollectionUtils; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; + +/** + * 租户控制器 + * + * @author 科技小王子 + * @since 2023-07-17 17:49:53 + */ +@Tag(name = "系统租户") +@RestController +@RequestMapping("/api/system/tenant") +public class TenantController extends BaseController { + @Resource + private TenantService tenantService; + @Resource + private MenuService menuService; + @Resource + private RoleMenuService roleMenuService; + @Resource + private CompanyService companyService; + @Resource + private RedisUtil redisUtil; + @Resource + private UserService userService; + + @Operation(summary = "分页查询租户") + @GetMapping("/page") + public ApiResult> page(TenantParam param) { + // 如果传了 all=true,查询全部租户;否则自动用当前登录用户的 userId + if (param.getAll() == null || !param.getAll()) { + if (param.getUserId() == null) { + final User loginUser = getLoginUser(); + if (loginUser != null && loginUser.getUserId() != null) { + param.setUserId(loginUser.getUserId()); + } + } + } + PageResult result = tenantService.pageRel(param); + // 如果传入 mask=false,设置不脱敏 + if (param.getMask() != null && !param.getMask()) { + if (result.getList() != null) { + for (Tenant tenant : result.getList()) { + tenant.setPhoneMasked(false); + } + } + } + return success(result); + } + + @PreAuthorize("hasAuthority('sys:tenant:list')") + @Operation(summary = "查询全部租户") + @GetMapping() + public ApiResult> list(TenantParam param) { + // 使用关联查询 + return success(tenantService.listRel(param)); + } + + @Operation(summary = "根据id查询租户") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + Tenant tenant = tenantService.getById(id); + // 附加企业信息 + List list = companyService.list(new LambdaQueryWrapper().eq(Company::getTenantId, tenant.getTenantId()).eq(Company::getAuthoritative, true)); + if (!CollectionUtils.isEmpty(list)) { + final Company company = list.get(0); + tenant.setCompany(company); + } + return success(tenant); + } + + @Operation(summary = "根据code搜索租户") + @GetMapping("/getTenantId/{code}") + public ApiResult getTenantIdByKeywords(@PathVariable("code") String code) { + String key = "TenantCode:".concat(code); + // 查询缓存 + final String string = redisUtil.get(key); + if(string != null){ + return success(JSONUtil.parseObject(string, Integer.class)); + } + // 使用关联查询 + final Tenant tenant = tenantService.getOne(new LambdaUpdateWrapper().eq(Tenant::getTenantId, code).or().eq(Tenant::getTenantCode, code).last("limit 1")); + if(tenant == null){ + return fail("应用不存在或已过期",null); + } + redisUtil.set(key,tenant.getTenantId().toString(),1L, TimeUnit.DAYS); + return success(tenant.getTenantId()); + } + + @Operation(summary = "根据code搜索租户") + @GetMapping("/getByCode/{code}") + public ApiResult getByCode(@PathVariable("code") String code) { + return success(tenantService.getByCodeRel(code)); + } + + @PreAuthorize("hasAuthority('sys:tenant:save')") + @OperationLog + @Operation(summary = "添加租户") + @PostMapping() + public ApiResult save(@RequestBody Tenant tenant) { + if (tenantService.save(tenant)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:tenant:update')") + @OperationLog + @Operation(summary = "修改租户") + @PutMapping() + public ApiResult update(@RequestBody Tenant tenant) { + final User loginUser = getLoginUser(); + if(loginUser != null){ + tenant.setTenantId(loginUser.getTenantId()); + } + if (tenantService.updateById(tenant)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:tenant:remove')") + @OperationLog + @Operation(summary = "删除租户") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (tenantService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:tenant:save')") + @OperationLog + @Operation(summary = "批量添加租户") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (tenantService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:tenant:update')") + @OperationLog + @Operation(summary = "批量修改租户") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(tenantService, "tenant_id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:tenant:remove')") + @OperationLog + @Operation(summary = "批量删除租户") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (tenantService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @Operation(summary = "租户角色权限初始化") + @GetMapping("/role-menu/{id}") + public ApiResult> initialization(@PathVariable("id") Integer roleId) { + List menus = menuService.list(new LambdaQueryWrapper().orderByAsc(Menu::getSortNumber)); + List roleMenus = roleMenuService.list(new LambdaQueryWrapper() + .eq(RoleMenu::getRoleId, roleId)); + for (Menu menu : menus) { + menu.setChecked(roleMenus.stream().anyMatch((d) -> d.getMenuId().equals(menu.getMenuId()))); + } + List menuIds = menus.stream().map(Menu::getMenuId).collect(Collectors.toList()); + roleMenuService.remove(new LambdaUpdateWrapper().eq(RoleMenu::getRoleId, roleId)); + if (menuIds.size() > 0) { + List roleMenuList = new ArrayList<>(); + for (Integer menuId : menuIds) { + RoleMenu roleMenu = new RoleMenu(); + roleMenu.setRoleId(roleId); + roleMenu.setMenuId(menuId); + roleMenuList.add(roleMenu); + } + if (!roleMenuService.saveBatch(roleMenuList)) { + throw new BusinessException("保存失败"); + } + } + return success(menus); + } + + @Operation(summary = "创建租户") + @PostMapping("/saveByPhone") + public ApiResult saveByPhone(@RequestBody Tenant tenant) { + final String phone = tenant.getPhone(); + if(tenant.getTenantName() == null){ + return null; + } + if(tenant.getTenantCode() == null){ + return null; + } + if (tenantService.count(new LambdaQueryWrapper().eq(Tenant::getTenantCode, phone)) > 0) { + return null; + } + if (tenantService.save(tenant)) { + // 租户初始化 + final Company company = new Company(); + company.setDomain(tenant.getTenantId().toString().concat(".websoft.top")); + company.setPhone(phone); + company.setEmail(null); + company.setPassword(userService.encodePassword(phone)); + company.setTid(tenant.getTenantId()); + company.setCompanyName(tenant.getTenantName()); + company.setShortName(tenant.getTenantName()); + company.setTenantId(tenant.getTenantId()); + tenantService.initialization(company); + return success("创建成功",tenant); + } + return null; + } +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/TenantPackageController.java b/src/main/java/com/gxwebsoft/common/system/controller/TenantPackageController.java new file mode 100644 index 0000000..96a4bc8 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/TenantPackageController.java @@ -0,0 +1,54 @@ +package com.gxwebsoft.common.system.controller; + +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.system.entity.TenantPackage; +import com.gxwebsoft.common.system.service.TenantPackageService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 租户套餐控制器 + * + * @author WebSoft + * @since 2025-12-12 + */ +@Tag(name = "租户套餐管理") +@RestController +@RequestMapping("/api/system/package") +public class TenantPackageController extends BaseController { + + @Resource + private TenantPackageService tenantPackageService; + + @Operation(summary = "查询所有上架套餐") + @GetMapping("/list") + public ApiResult> list() { + List packages = tenantPackageService.listAvailablePackages(); + return success(packages); + } + + @Operation(summary = "根据ID查询套餐详情") + @GetMapping("/{id}") + public ApiResult getById(@PathVariable("id") Integer id) { + TenantPackage tenantPackage = tenantPackageService.getById(id); + if (tenantPackage == null) { + return fail("套餐不存在", null); + } + return success(tenantPackage); + } + + @Operation(summary = "根据版本号查询套餐") + @GetMapping("/version/{version}") + public ApiResult getByVersion(@PathVariable("version") Integer version) { + TenantPackage tenantPackage = tenantPackageService.getByVersion(version); + if (tenantPackage == null) { + return fail("套餐不存在", null); + } + return success(tenantPackage); + } +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/TenantSubscriptionController.java b/src/main/java/com/gxwebsoft/common/system/controller/TenantSubscriptionController.java new file mode 100644 index 0000000..c2fe60d --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/TenantSubscriptionController.java @@ -0,0 +1,183 @@ +package com.gxwebsoft.common.system.controller; + +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.TenantSubscription; +import com.gxwebsoft.common.system.entity.TenantSubscriptionOrder; +import com.gxwebsoft.common.system.service.TenantSubscriptionOrderService; +import com.gxwebsoft.common.system.service.TenantSubscriptionService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.Map; + +/** + * 租户订阅控制器 + * + * @author WebSoft + * @since 2025-12-12 + */ +@Tag(name = "租户订阅管理") +@RestController +@RequestMapping("/api/system/subscription") +public class TenantSubscriptionController extends BaseController { + + @Resource + private TenantSubscriptionService tenantSubscriptionService; + + @Resource + private TenantSubscriptionOrderService tenantSubscriptionOrderService; + + @Operation(summary = "查询当前租户订阅信息") + @GetMapping("/current") + public ApiResult getCurrentSubscription() { + Integer tenantId = getTenantId(); + if (tenantId == null) { + return fail("租户ID不存在", null); + } + TenantSubscription subscription = tenantSubscriptionService.getByTenantId(tenantId); + return success(subscription); + } + + @Operation(summary = "检查订阅是否有效") + @GetMapping("/check") + public ApiResult> checkSubscription() { + Integer tenantId = getTenantId(); + if (tenantId == null) { + return fail("租户ID不存在", null); + } + + boolean isValid = tenantSubscriptionService.isSubscriptionValid(tenantId); + boolean isExpired = tenantSubscriptionService.isSubscriptionExpired(tenantId); + + Map result = new HashMap<>(); + result.put("isValid", isValid); + result.put("isExpired", isExpired); + + return success(result); + } + + @Operation(summary = "查询订阅激活状态") + @GetMapping("/active") + public ApiResult> getActiveStatus() { + Integer tenantId = getTenantId(); + if (tenantId == null) { + return fail("租户ID不存在", null); + } + + TenantSubscription subscription = tenantSubscriptionService.getByTenantId(tenantId); + Map result = new HashMap<>(); + + if (subscription == null) { + result.put("active", false); + result.put("message", "未订阅任何套餐"); + } else { + boolean isActive = subscription.getStatus() == 1 && subscription.getIsExpired() == 0; + result.put("active", isActive); + result.put("version", subscription.getVersion()); + result.put("packageId", subscription.getPackageId()); + result.put("endTime", subscription.getEndTime()); + result.put("isTrial", subscription.getIsTrial()); + } + + return success(result); + } + + @Operation(summary = "创建试用订单") + @PostMapping("/trial") + public ApiResult createTrialOrder() { + Integer tenantId = getTenantId(); + Integer userId = getLoginUserId(); + + if (tenantId == null || userId == null) { + return fail("参数错误", null); + } + + TenantSubscriptionOrder order = tenantSubscriptionOrderService.createTrialOrder(tenantId, userId); + return success("试用开通成功", order); + } + + @Operation(summary = "创建订阅订单") + @PostMapping("/order") + public ApiResult createOrder(@RequestParam Integer packageId, + @RequestParam Integer payType) { + Integer tenantId = getTenantId(); + Integer userId = getLoginUserId(); + + if (tenantId == null || userId == null) { + return fail("参数错误", null); + } + + TenantSubscriptionOrder order = tenantSubscriptionOrderService.createOrder(packageId, payType, tenantId, userId); + return success("订单创建成功", order); + } + + @Operation(summary = "查询订单列表") + @GetMapping("/orders") + public ApiResult> listOrders(@RequestParam(defaultValue = "1") Integer page, + @RequestParam(defaultValue = "10") Integer limit) { + Integer tenantId = getTenantId(); + if (tenantId == null) { + return fail("租户ID不存在", null); + } + + PageResult result = tenantSubscriptionOrderService.pageByTenant(tenantId, page, limit); + return success(result); + } + + @Operation(summary = "根据订单号查询订单") + @GetMapping("/order/{orderNo}") + public ApiResult getOrderByNo(@PathVariable String orderNo) { + TenantSubscriptionOrder order = tenantSubscriptionOrderService.getByOrderNo(orderNo); + if (order == null) { + return fail("订单不存在", null); + } + return success(order); + } + + @Operation(summary = "取消订单") + @PostMapping("/order/cancel") + public ApiResult cancelOrder(@RequestParam String orderNo, + @RequestParam(required = false) String cancelReason) { + boolean success = tenantSubscriptionOrderService.cancelOrder(orderNo, cancelReason); + if (success) { + return success("订单已取消"); + } + return fail("取消失败", null); + } + + @Operation(summary = "设置自动续费") + @PostMapping("/auto-renewal") + public ApiResult setAutoRenewal(@RequestParam Integer autoRenewal, + @RequestParam(required = false) Integer renewalPackageId) { + Integer tenantId = getTenantId(); + if (tenantId == null) { + return fail("租户ID不存在", null); + } + + boolean success = tenantSubscriptionService.setAutoRenewal(tenantId, autoRenewal, renewalPackageId); + if (success) { + return success(autoRenewal == 1 ? "自动续费已开启" : "自动续费已关闭"); + } + return fail("设置失败", null); + } + + @Operation(summary = "升级套餐") + @PostMapping("/upgrade") + public ApiResult upgradeSubscription(@RequestParam Integer newPackageId) { + Integer tenantId = getTenantId(); + if (tenantId == null) { + return fail("租户ID不存在", null); + } + + boolean success = tenantSubscriptionService.upgradeSubscription(tenantId, newPackageId); + if (success) { + return success("升级成功"); + } + return fail("升级失败", null); + } +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/TenantSubscriptionOrderController.java b/src/main/java/com/gxwebsoft/common/system/controller/TenantSubscriptionOrderController.java new file mode 100644 index 0000000..11ab86c --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/TenantSubscriptionOrderController.java @@ -0,0 +1,288 @@ +package com.gxwebsoft.common.system.controller; + +import cn.hutool.core.util.IdUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.gxwebsoft.common.core.Constants; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.system.entity.Order; +import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.common.system.param.SubscriptionOrderParam; +import com.gxwebsoft.common.system.result.SubscriptionOrderCreateResult; +import com.gxwebsoft.common.system.result.SubscriptionOrderPayResult; +import com.gxwebsoft.common.system.result.SubscriptionPriceResult; +import com.gxwebsoft.common.system.service.SettingService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.Arrays; +import java.util.List; + +/** + * 订阅订单接口 + */ +@Tag(name = "订阅订单") +@RestController +@RequestMapping("/api/system/subscription-order") +public class TenantSubscriptionOrderController extends BaseController { + + @Resource + private SettingService settingService; + @Resource + private WxNativePayController wxNativePayController; + + @Operation(summary = "计算订阅订单价格") + @PostMapping("/calculate-price") + public ApiResult calculatePrice(@RequestBody SubscriptionOrderParam param) { + final User loginUser = getLoginUser(); + if (loginUser == null) { + return fail("请先登录", null); + } + if (param.getPackageId() == null) { + return fail("套餐ID不能为空", null); + } + + JSONObject config = loadSubscriptionConfig(); + final SubscriptionPriceResult result = buildPriceResult(param, config); + return success(result); + } + + @Operation(summary = "创建订阅订单") + @PostMapping("/create") + public ApiResult create(@RequestBody SubscriptionOrderParam param) { + final User loginUser = getLoginUser(); + if (loginUser == null) { + return fail("请先登录", null); + } + if (param.getPackageId() == null) { + return fail("套餐ID不能为空", null); + } + + JSONObject config = loadSubscriptionConfig(); + final SubscriptionPriceResult price = buildPriceResult(param, config); + + SubscriptionOrderCreateResult result = new SubscriptionOrderCreateResult(); + result.setOrderNo(IdUtil.getSnowflakeNextIdStr()); + result.setPrice(price); + return success(result); + } + + @Operation(summary = "订阅订单支付(生成微信Native二维码)") + @PostMapping("/pay") + public ApiResult pay(@RequestBody SubscriptionOrderParam param) { + final User loginUser = getLoginUser(); + if (loginUser == null) { + return fail("请先登录", null); + } + if (param.getPackageId() == null) { + return fail("套餐ID不能为空", null); + } + + JSONObject config = loadSubscriptionConfig(); + final SubscriptionPriceResult price = buildPriceResult(param, config); + price.setPayPrice(new BigDecimal("0.01")); + if (price.getPayPrice() == null || price.getPayPrice().compareTo(BigDecimal.ZERO) <= 0) { + return fail("支付金额必须大于0", null); + } + + // 构造订单用于生成支付二维码 + Order order = new Order(); + order.setPayPrice(price.getPayPrice()); + order.setTotalPrice(price.getTotalPrice()); + order.setComments("订阅套餐-" + param.getPackageId()); + order.setPayType(param.getPayType()); + order.setUserId(loginUser.getUserId()); + order.setTenantId(loginUser.getTenantId()); + + ApiResult payResp = wxNativePayController.getCodeUrl(order); + if (payResp.getCode() == null || !payResp.getCode().equals(Constants.RESULT_OK_CODE)) { + return fail(payResp.getMessage(), null); + } + + SubscriptionOrderPayResult result = new SubscriptionOrderPayResult(); + result.setOrderNo(order.getOrderNo()); + result.setCodeUrl(String.valueOf(payResp.getData())); + result.setPrice(price); + return success(result); + } + + /** + * 从配置表读取订阅套餐配置(尝试多种key以兼容历史数据) + */ + private JSONObject loadSubscriptionConfig() { + final List keys = Arrays.asList("subscription", "subscription-package", "subscriptionOrder"); + for (String key : keys) { + try { + JSONObject cfg = settingService.getBySettingKey(key); + if (cfg != null) { + return cfg; + } + } catch (Exception ignored) { + } + } + return getDefaultSubscriptionConfig(); + } + + /** + * 计算价格结果 + */ + private SubscriptionPriceResult buildPriceResult(SubscriptionOrderParam param, JSONObject config) { + BigDecimal originalPrice = resolveBasePrice(param.getPackageId(), config); + BigDecimal factor = BigDecimal.ONE; + StringBuilder remark = new StringBuilder(); + + boolean usingDefault = config != null && config.getBooleanValue("defaultConfig"); + if (usingDefault) { + remark.append("订阅价格未配置,已使用默认配置;"); + } else if (config == null || config.isEmpty()) { + remark.append("未查询到订阅价格配置,已按0元试算;"); + } + if (originalPrice.compareTo(BigDecimal.ZERO) == 0 && config != null && !config.isEmpty()) { + remark.append("未找到套餐价格,已按0元试算;"); + } + + if (isTrue(param.getIsRenewal())) { + BigDecimal renewalFactor = resolveFactor(config, "renewalDiscount"); + factor = factor.multiply(renewalFactor); + remark.append("续费系数:").append(renewalFactor).append(";"); + } + + if (isTrue(param.getIsUpgrade())) { + BigDecimal upgradeFactor = resolveFactor(config, "upgradeDiscount"); + factor = factor.multiply(upgradeFactor); + remark.append("升级系数:").append(upgradeFactor).append(";"); + } + + BigDecimal payTypeFactor = resolvePayTypeFactor(config, param.getPayType()); + factor = factor.multiply(payTypeFactor); + if (param.getPayType() != null) { + remark.append("支付系数:").append(payTypeFactor).append(";"); + } + + BigDecimal payPrice = originalPrice.multiply(factor).setScale(2, RoundingMode.HALF_UP); + BigDecimal discount = originalPrice.subtract(payPrice); + if (discount.compareTo(BigDecimal.ZERO) < 0) { + discount = BigDecimal.ZERO; + } + + SubscriptionPriceResult result = new SubscriptionPriceResult(); + result.setPackageId(param.getPackageId()); + result.setIsRenewal(param.getIsRenewal()); + result.setIsUpgrade(param.getIsUpgrade()); + result.setPayType(param.getPayType()); + result.setOriginalPrice(originalPrice.setScale(2, RoundingMode.HALF_UP)); + result.setTotalPrice(originalPrice.setScale(2, RoundingMode.HALF_UP)); + result.setPayPrice(payPrice); + result.setDiscountAmount(discount.setScale(2, RoundingMode.HALF_UP)); + result.setRemark(remark.toString()); + return result; + } + + private boolean isTrue(Integer value) { + return value != null && value.equals(1); + } + + /** + * 解析套餐价格,支持 packages 数组、priceMap 或单价配置 + */ + private BigDecimal resolveBasePrice(Integer packageId, JSONObject config) { + if (config != null) { + JSONArray packages = config.getJSONArray("packages"); + if (packages != null) { + for (Object item : packages) { + if (item instanceof JSONObject) { + JSONObject pkg = (JSONObject) item; + Integer id = pkg.getInteger("id"); + if (id == null) { + id = pkg.getInteger("packageId"); + } + if (packageId.equals(id)) { + BigDecimal price = pkg.getBigDecimal("price"); + if (price != null) { + return price; + } + } + } + } + } + + JSONObject priceMap = config.getJSONObject("priceMap"); + if (priceMap != null) { + BigDecimal price = priceMap.getBigDecimal(packageId.toString()); + if (price != null) { + return price; + } + } + + BigDecimal fallbackPrice = config.getBigDecimal("price"); + if (fallbackPrice != null) { + return fallbackPrice; + } + } + return BigDecimal.ZERO; + } + + /** + * 获取折扣系数,默认 1 + */ + private BigDecimal resolveFactor(JSONObject config, String key) { + if (config != null) { + BigDecimal factor = config.getBigDecimal(key); + if (factor != null) { + return factor; + } + } + return BigDecimal.ONE; + } + + /** + * 支付方式系数,可在配置中通过 payTypeDiscount 或 payTypeAdjustments 定义 + */ + private BigDecimal resolvePayTypeFactor(JSONObject config, Integer payType) { + if (config != null && payType != null) { + JSONObject payTypeDiscount = config.getJSONObject("payTypeDiscount"); + if (payTypeDiscount == null) { + payTypeDiscount = config.getJSONObject("payTypeAdjustments"); + } + if (payTypeDiscount != null) { + BigDecimal factor = payTypeDiscount.getBigDecimal(payType.toString()); + if (factor != null) { + return factor; + } + } + } + return BigDecimal.ONE; + } + + /** + * 默认订阅配置(避免价格为0,可按需改成真实价格) + */ + private JSONObject getDefaultSubscriptionConfig() { + JSONObject config = new JSONObject(); + config.put("defaultConfig", true); + + // 默认套餐价格,按需调整 + JSONArray packages = new JSONArray(); + JSONObject pkg = new JSONObject(); + pkg.put("id", 2); + pkg.put("price", new BigDecimal("1.00")); + packages.add(pkg); + config.put("packages", packages); + + // 默认系数 + config.put("renewalDiscount", BigDecimal.ONE); + config.put("upgradeDiscount", BigDecimal.ONE); + JSONObject payTypeDiscount = new JSONObject(); + payTypeDiscount.put("12", BigDecimal.ONE); + config.put("payTypeDiscount", payTypeDiscount); + return config; + } +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/UserBalanceLogController.java b/src/main/java/com/gxwebsoft/common/system/controller/UserBalanceLogController.java new file mode 100644 index 0000000..97990a3 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/UserBalanceLogController.java @@ -0,0 +1,132 @@ +package com.gxwebsoft.common.system.controller; + +import com.gxwebsoft.common.core.annotation.OperationLog; +import com.gxwebsoft.common.core.web.*; +import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.common.system.entity.UserBalanceLog; +import com.gxwebsoft.common.system.param.UserBalanceLogParam; +import com.gxwebsoft.common.system.service.UserBalanceLogService; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 用户余额变动明细表控制器 + * + * @author 科技小王子 + * @since 2023-04-21 15:59:09 + */ +@Tag(name = "用户余额明细") +@RestController +@RequestMapping("/api/sys/user-balance-log") +public class UserBalanceLogController extends BaseController { + @Resource + private UserBalanceLogService userBalanceLogService; + + @PreAuthorize("hasAuthority('sys:userBalanceLog:list')") + @OperationLog + @Operation(summary = "分页查询用户余额变动明细表") + @GetMapping("/page") + public ApiResult> page(UserBalanceLogParam param) { + // 使用关联查询 + return success(userBalanceLogService.pageRel(param)); + } + + @PreAuthorize("hasAuthority('sys:userBalanceLog:list')") + @OperationLog + @Operation(summary = "查询全部用户余额变动明细表") + @GetMapping() + public ApiResult> list(UserBalanceLogParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + return success(userBalanceLogService.list(page.getOrderWrapper())); + // 使用关联查询 + //return success(userBalanceLogService.listRel(param)); + } + + @PreAuthorize("hasAuthority('sys:userBalanceLog:list')") + @OperationLog + @Operation(summary = "根据id查询用户余额变动明细表") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + return success(userBalanceLogService.getById(id)); + // 使用关联查询 + //return success(userBalanceLogService.getByIdRel(id)); + } + + @PreAuthorize("hasAuthority('sys:userBalanceLog:save')") + @OperationLog + @Operation(summary = "添加用户余额变动明细表") + @PostMapping() + public ApiResult save(@RequestBody UserBalanceLog userBalanceLog) { + // 记录当前登录用户id、租户id、商户编号 + User loginUser = getLoginUser(); + if (loginUser != null) { + userBalanceLog.setUserId(loginUser.getUserId()); + } + if (userBalanceLogService.save(userBalanceLog)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:userBalanceLog:update')") + @OperationLog + @Operation(summary = "修改用户余额变动明细表") + @PutMapping() + public ApiResult update(@RequestBody UserBalanceLog userBalanceLog) { + if (userBalanceLogService.updateById(userBalanceLog)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:userBalanceLog:remove')") + @OperationLog + @Operation(summary = "删除用户余额变动明细表") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (userBalanceLogService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:userBalanceLog:save')") + @OperationLog + @Operation(summary = "批量添加用户余额变动明细表") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (userBalanceLogService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:userBalanceLog:update')") + @OperationLog + @Operation(summary = "批量修改用户余额变动明细表") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(userBalanceLogService, "log_id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:userBalanceLog:remove')") + @OperationLog + @Operation(summary = "批量删除用户余额变动明细表") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (userBalanceLogService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/UserCollectionController.java b/src/main/java/com/gxwebsoft/common/system/controller/UserCollectionController.java new file mode 100644 index 0000000..7aad0ad --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/UserCollectionController.java @@ -0,0 +1,135 @@ +package com.gxwebsoft.common.system.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.common.system.service.UserCollectionService; +import com.gxwebsoft.common.system.entity.UserCollection; +import com.gxwebsoft.common.system.param.UserCollectionParam; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.core.web.BatchParam; +import com.gxwebsoft.common.core.annotation.OperationLog; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 我的收藏控制器 + * + * @author 科技小王子 + * @since 2024-04-28 18:08:32 + */ +@Tag(name = "用户收藏") +@RestController +@RequestMapping("/api/system/user-collection") +public class UserCollectionController extends BaseController { + @Resource + private UserCollectionService userCollectionService; + + @PreAuthorize("hasAuthority('sys:userCollection:list')") + @Operation(summary = "分页查询我的收藏") + @GetMapping("/page") + public ApiResult> page(UserCollectionParam param) { + // 使用关联查询 + return success(userCollectionService.pageRel(param)); + } + + @PreAuthorize("hasAuthority('sys:userCollection:list')") + @Operation(summary = "查询全部我的收藏") + @GetMapping() + public ApiResult> list(UserCollectionParam param) { + // 使用关联查询 + return success(userCollectionService.listRel(param)); + } + + @PreAuthorize("hasAuthority('sys:userCollection:list')") + @Operation(summary = "根据id查询我的收藏") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + // 使用关联查询 + return success(userCollectionService.getByIdRel(id)); + } + + @PreAuthorize("hasAuthority('sys:userCollection:save')") + @OperationLog + @Operation(summary = "添加和取消收藏") + @PostMapping() + public ApiResult save(@RequestBody UserCollection userCollection) { + // 记录当前登录用户id + User loginUser = getLoginUser(); + if (loginUser != null) { + userCollection.setUserId(loginUser.getUserId()); + userCollection.setTid(userCollection.getTid()); + final UserCollection one = userCollectionService.getOne(new LambdaQueryWrapper().eq(UserCollection::getUserId, loginUser.getUserId()).eq(UserCollection::getTid, userCollection.getTid()).last("limit 1")); + if (one != null) { + userCollectionService.removeById(one.getId()); + return success("已取消收藏"); + } + if (userCollectionService.save(userCollection)) { + return success("已添加收藏"); + } + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:userCollection:update')") + @OperationLog + @Operation(summary = "修改我的收藏") + @PutMapping() + public ApiResult update(@RequestBody UserCollection userCollection) { + if (userCollectionService.updateById(userCollection)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:userCollection:remove')") + @OperationLog + @Operation(summary = "删除我的收藏") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (userCollectionService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:userCollection:save')") + @OperationLog + @Operation(summary = "批量添加我的收藏") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (userCollectionService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:userCollection:update')") + @OperationLog + @Operation(summary = "批量修改我的收藏") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(userCollectionService, "id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:userCollection:remove')") + @OperationLog + @Operation(summary = "批量删除我的收藏") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (userCollectionService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/UserController.java b/src/main/java/com/gxwebsoft/common/system/controller/UserController.java new file mode 100644 index 0000000..bc6dc80 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/UserController.java @@ -0,0 +1,809 @@ +package com.gxwebsoft.common.system.controller; + +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.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.gxwebsoft.common.core.annotation.OperationLog; +import com.gxwebsoft.common.core.config.ConfigProperties; +import com.gxwebsoft.common.core.security.JwtSubject; +import com.gxwebsoft.common.core.security.JwtUtil; +import com.gxwebsoft.common.core.utils.CommonUtil; +import com.gxwebsoft.common.core.web.*; +import com.gxwebsoft.common.system.entity.*; +import com.gxwebsoft.common.system.param.LoginParam; +import com.gxwebsoft.common.system.param.UserImportParam; +import com.gxwebsoft.common.system.param.UserParam; +import com.gxwebsoft.common.system.result.LoginResult; +import com.gxwebsoft.common.system.service.*; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.apache.poi.ss.usermodel.Workbook; + +import javax.servlet.http.HttpServletResponse; +import java.util.HashMap; +import java.util.Map; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.math.BigDecimal; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 用户控制器 + * + * @author WebSoft + * @since 2018-12-24 16:10:41 + */ +@Slf4j +@Tag(name = "用户") +@RestController +@RequestMapping("/api/system/user") +public class UserController extends BaseController { + @Resource + private UserService userService; + @Resource + private RoleService roleService; + @Resource + private OrganizationService organizationService; + @Resource + private DictionaryDataService dictionaryDataService; + @Resource + private UserRoleService userRoleService; + @Resource + private ConfigProperties configProperties; + @Resource + private LoginRecordService loginRecordService; + @Resource + private UserSyncService userSyncService; + + @PreAuthorize("hasAuthority('sys:auth:user')") + @Operation(summary = "分页查询用户") + @GetMapping("/page") + public ApiResult> page(UserParam param) { + return success(userService.pageRel(param)); + } + + @PreAuthorize("hasAuthority('sys:auth:user')") + @Operation(summary = "查询全部用户") + @GetMapping() + public ApiResult> list(UserParam param) { + return success(userService.listRel(param)); + } + + @Operation(summary = "查询全部用户(无需登录)") + @GetMapping("/withoutAuth") + public ApiResult> listWithoutAuth(UserParam param) { + return success(userService.listRel(param)); + } + + @PreAuthorize("hasAuthority('sys:auth:user')") + @Operation(summary = "根据id查询用户") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + return success(userService.getByIdRel(id)); + } + +// @PreAuthorize("hasAuthority('sys:auth:user')") + @Operation(summary = "根据手机号码查询用户") + @GetMapping("/getByPhone/{phone}") + public ApiResult getByPhone(@PathVariable("phone") String phone) { + return success(userService.getByPhone(phone)); + } + + @Operation(summary = "根据UserId查询用户(无需登录)") + @GetMapping("/getByUserId/{userId}") + public ApiResult getByUserId(@PathVariable("userId") String userId) { + return success(userService.getAllByUserId(userId)); + } + + @Operation(summary = "根据unionid查询用户") + @GetMapping("/getByUnionid/{unionid}") + public ApiResult getByUnionid(@PathVariable("unionid") String unionid) { + return success(userService.getByUnionId(new UserParam() {{ + setUnionid(unionid); + }})); + } + + @Operation(summary = "当前登录用户信息") + @GetMapping("/info") + public ApiResult getLoginUserInfo() { + return success(getLoginUser()); + } + + + @Operation(summary = "手机号登录(测试用)") + @PostMapping("/loginByPhoneForTest") + public ApiResult loginByPhoneForTest(@RequestBody User user) { + User getLoginUser = userService.getByPhone(user.getPhone()); + if (!user.getPhoneLoginCode().equals("1700083")) return fail("验证码错误"); + String access_token = JwtUtil.buildToken(new JwtSubject(getLoginUser.getUsername(), getLoginUser.getTenantId()), + configProperties.getTokenExpireTime(), configProperties.getTokenKey()); + return success("登录成功", new LoginResult(access_token, user)); + } + + @Operation(summary = "手机号注册") + @PostMapping("/regByPhone") + public ApiResult regByPhone(@RequestBody User user) { + user.setPassword(userService.encodePassword(user.getPassword())); + // 排重 + final User byPhone = userService.getByPhone(user.getPhone()); + if (ObjectUtil.isNotEmpty(byPhone)) { + return fail("该手机号码已存在"); + } + if (userService.saveUser(user)) { + // 同步到 websopy + userSyncService.syncUserToWebsopy(user); + return success("添加成功", user.getUserId()); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:user:save')") + @Operation(summary = "添加用户") + @PostMapping() + public ApiResult add(@RequestBody User user) { + user.setStatus(0); + user.setPassword(userService.encodePassword(user.getPassword())); + // 排重 + final User byPhone = userService.getByPhone(user.getPhone()); + if (ObjectUtil.isNotEmpty(byPhone)) { + return fail("该手机号码已存在"); + } + if (userService.saveUser(user)) { + // 同步到 websopy + userSyncService.syncUserToWebsopy(user); + return success("添加成功", user.getUserId()); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:user:save')") + @Operation(summary = "批量添加用户") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List userList) { + userList.forEach(d -> { + d.setStatus(0); + if (d.getPassword() != null) { + d.setPassword(userService.encodePassword(d.getPassword())); + } + }); + + final Set collect = userList.stream().map(User::getPhone).collect(Collectors.toSet()); + final List list = userService.list(new LambdaQueryWrapper().in(User::getPhone, collect).select(User::getPhone)); + final Map> phoneCollect = list.stream().collect(Collectors.groupingBy(User::getPhone)); + userList.removeIf(d -> phoneCollect.containsKey(d.getPhone())); + + if (userService.saveBatch(userList)) { + // 同步到 websopy(异步处理,不阻塞响应) + userList.forEach(user -> userSyncService.syncUserToWebsopy(user)); + return success("添加成功"); + } + return fail("添加失败"); + } + +// @PreAuthorize("hasAuthority('sys:user:save')") + @Operation(summary = "批量添加用户并返回userId") + @PostMapping("/batchBackUserId") + public ApiResult saveBatchBackUserId(@RequestBody List userList) { + userList.forEach(d -> { + d.setStatus(0); + d.setPassword(userService.encodePassword(d.getPassword())); + }); + final Set phones = userList.stream().map(User::getPhone).collect(Collectors.toSet()); + if (userService.saveBatch(userList)) { + final UserParam userParam = new UserParam(); + userParam.setPhones(phones); + userParam.setLimit(500L); + final PageResult result = userService.pageRel(userParam); + final Set collect = result.getList().stream().map(User::getUserId).collect(Collectors.toSet()); + // 同步到 websopy(异步处理,不阻塞响应) + userList.forEach(user -> userSyncService.syncUserToWebsopy(user)); + return success("添加成功", collect); + } + return fail("添加失败"); + } + + // @PreAuthorize("hasAuthority('sys:user:update')") + @OperationLog + @Operation(summary = "修改用户") + @PutMapping() + public ApiResult update(@RequestBody User user) { + user.setStatus(null); + user.setUsername(null); + if (user.getPassword() != null) { + String pwd = userService.encodePassword(user.getPassword()); + User originData = userService.getByIdRel(user.getUserId()); + if(!pwd.equals(originData.getPassword())) { + user.setPassword(pwd); + }else { + user.setPassword(null); + } + } + // 同步管理员的产品套餐ID + if(user.getIsAdmin() != null){ + final User superAdmin = userService.getOne(new LambdaQueryWrapper().eq(User::getIsAdmin, 1).eq(User::getUsername, "superAdmin").last("limit 1")); + if (superAdmin != null) user.setTemplateId(superAdmin.getTemplateId()); + } + if (userService.updateUser(user)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @OperationLog + @Operation(summary = "修改用户(无需登录)") + @PutMapping("/updateWithoutLogin") + public ApiResult updateWithoutLogin(@RequestBody User user) { + if (userService.updateUser(user)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:user:remove')") + @OperationLog + @Operation(summary = "删除用户") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (userService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:user:update')") + @OperationLog + @Operation(summary = "批量修改用户") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(userService, User::getUserId)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:user:remove')") + @OperationLog + @Operation(summary = "批量删除用户") + @Transactional(rollbackFor = {Exception.class}) + @DeleteMapping("/batch") + public ApiResult deleteBatch(@Parameter(description = "要删除的用户ID数组", required = true) @RequestBody List ids) { + if (userService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:user:update')") + @OperationLog + @Operation(summary = "修改用户状态") + @PutMapping("/status") + public ApiResult updateStatus(@RequestBody User user) { + if (user.getUserId() == null || user.getStatus() == null || !Arrays.asList(0, 1).contains(user.getStatus())) { + return fail("参数不正确"); + } + User u = new User(); + u.setUserId(user.getUserId()); + u.setStatus(user.getStatus()); + if (userService.updateById(u)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:user:update')") + @OperationLog + @Operation(summary = "修改推荐状态") + @PutMapping("/recommend") + public ApiResult updateRecommend(@RequestBody User user) { + if (user.getUserId() == null || user.getRecommend() == null || !Arrays.asList(0, 1).contains(user.getRecommend())) { + return fail("参数不正确"); + } + User u = new User(); + u.setUserId(user.getUserId()); + u.setRecommend(user.getRecommend()); + if (userService.updateById(u)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:user:update')") + @OperationLog + @Operation(summary = "批量修改用户状态") + @PutMapping("/status/batch") + public ApiResult updateStatusBatch(@RequestBody BatchParam batchParam) { + if (!Arrays.asList(0, 1).contains(batchParam.getData())) { + return fail("状态值不正确"); + } + if (userService.update(new LambdaUpdateWrapper() + .in(User::getUserId, batchParam.getIds()) + .set(User::getStatus, batchParam.getData()))) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:user:update')") + @OperationLog + @Operation(summary = "重置密码") + @PutMapping("/password") + public ApiResult resetPassword(@RequestBody User user) { + if (user.getUserId() == null || StrUtil.isBlank(user.getPassword())) { + return fail("参数不正确"); + } + User u = new User(); + u.setUserId(user.getUserId()); + u.setPassword(userService.encodePassword(user.getPassword())); + if (userService.updateById(u)) { + return success("重置成功"); + } else { + return fail("重置失败"); + } + } + + @PreAuthorize("hasAuthority('sys:user:update')") + @OperationLog + @Operation(summary = "批量重置密码") + @PutMapping("/password/batch") + public ApiResult resetPasswordBatch(@RequestBody BatchParam batchParam) { + if (batchParam.getIds() == null || batchParam.getIds().size() == 0) { + return fail("请选择用户"); + } + if (batchParam.getData() == null) { + return fail("请输入密码"); + } + if (userService.update(new LambdaUpdateWrapper() + .in(User::getUserId, batchParam.getIds()) + .set(User::getPassword, userService.encodePassword(batchParam.getData())))) { + return success("重置成功"); + } else { + return fail("重置失败"); + } + } + + @Operation(summary = "检查用户是否存在") + @GetMapping("/existence") + public ApiResult existence(ExistenceParam param) { + if (param.isExistence(userService, User::getUserId)) { + return success(param.getValue() + "已存在"); + } + return fail(param.getValue() + "不存在"); + } + + /** + * excel导入用户 + */ + @PreAuthorize("hasAuthority('sys:user:save')") + @Operation(summary = "导入用户") + @PostMapping("/import") + public ApiResult importBatch(MultipartFile file) { + ImportParams importParams = new ImportParams(); + // 设置标题行,跳过第一行表头 + importParams.setTitleRows(1); + importParams.setHeadRows(1); + + try { + List list = ExcelImportUtil.importExcel(file.getInputStream(), + UserImportParam.class, importParams); + + if (list == null || list.isEmpty()) { + return fail("导入文件为空", null); + } + + // 过滤掉空行和无效数据 + list = list.stream() + .filter(param -> param.getUsername() != null && !param.getUsername().trim().isEmpty()) + .collect(Collectors.toList()); + + if (list.isEmpty()) { + return fail("没有有效的用户数据", null); + } + + // 简化验证:只检查必填字段 + for (UserImportParam param : list) { + if (param.getPassword() == null || param.getPassword().trim().isEmpty()) { + return fail("用户 " + param.getUsername() + " 的密码不能为空", null); + } + } + + // 校验账号是否重复 + if (CommonUtil.checkRepeat(list, UserImportParam::getUsername)) { + return fail("Excel中账号存在重复", null); + } + + // 校验手机号是否重复(只验证非空的手机号) + List listWithPhone = list.stream() + .filter(param -> param.getPhone() != null && !param.getPhone().trim().isEmpty()) + .collect(Collectors.toList()); + if (!listWithPhone.isEmpty() && CommonUtil.checkRepeat(listWithPhone, UserImportParam::getPhone)) { + return fail("Excel中手机号存在重复", null); + } + + // 获取已存在的用户账号,用于跳过处理 + List existingUsernames = userService.list(new LambdaQueryWrapper().in(User::getUsername, + list.stream().map(UserImportParam::getUsername).collect(Collectors.toList()))) + .stream().map(User::getUsername).collect(Collectors.toList()); + + // 检查手机号是否已存在(只检查非空手机号) + List phonesToCheck = list.stream() + .map(UserImportParam::getPhone) + .filter(phone -> phone != null && !phone.trim().isEmpty()) + .collect(Collectors.toList()); + + final List existingPhones; + if (!phonesToCheck.isEmpty()) { + existingPhones = userService.list(new LambdaQueryWrapper().in(User::getPhone, phonesToCheck)) + .stream().map(User::getPhone).collect(Collectors.toList()); + } else { + existingPhones = new ArrayList<>(); + } + + // 分离新用户和已存在用户(账号或手机号已存在都算已存在) + List newUsers = list.stream() + .filter(param -> !existingUsernames.contains(param.getUsername()) && + (param.getPhone() == null || param.getPhone().trim().isEmpty() || + !existingPhones.contains(param.getPhone()))) + .collect(Collectors.toList()); + + // 收集跳过的用户(账号已存在或手机号已存在) + List skippedUsers = new ArrayList<>(); + for (UserImportParam param : list) { + if (existingUsernames.contains(param.getUsername())) { + skippedUsers.add(param.getUsername() + "(账号已存在)"); + } else if (param.getPhone() != null && !param.getPhone().trim().isEmpty() && + existingPhones.contains(param.getPhone())) { + skippedUsers.add(param.getUsername() + "(手机号已存在)"); + } + } + + // 创建用户列表(只处理新用户) + List users = new ArrayList<>(); + for (UserImportParam one : newUsers) { + User u = new User(); + u.setStatus(0); + u.setUsername(one.getUsername()); + u.setUserCode(one.getUserCode()); + u.setPassword(userService.encodePassword(one.getPassword())); + u.setNickname(one.getNickname()); + u.setRealName(one.getRealName()); + u.setPhone(one.getPhone()); + u.setPoints(one.getPoints()); + u.setEmail(one.getEmail()); + u.setAddress(one.getAddress()); + u.setStatus(one.getStatus()); + u.setComments(one.getComments()); + u.setCompanyId(one.getCompanyId()); + + // 设置角色(如果提供) + if (one.getRoleName() != null && !one.getRoleName().trim().isEmpty()) { + Role role = roleService.getOne(new QueryWrapper() + .eq("role_name", one.getRoleName()), false); + if (role != null) { + u.setRoles(Collections.singletonList(role)); + } + } + + // 设置机构(如果提供) + if (one.getOrganizationName() != null && !one.getOrganizationName().trim().isEmpty()) { + Organization organization = organizationService.getOne(new QueryWrapper() + .eq("organization_full_name", one.getOrganizationName()), false); + if (organization != null) { + u.setOrganizationId(organization.getOrganizationId()); + } + } + + // 设置性别(如果提供) + if (one.getSexName() != null && !one.getSexName().trim().isEmpty()) { + DictionaryData sex = dictionaryDataService.getByDictCodeAndName("sex", one.getSexName()); + if (sex != null) { + u.setSex(sex.getDictDataCode()); + } + } + + // 关键修复:将用户添加到列表中 + users.add(u); + } + + // 保存新用户(逐个保存以处理角色关系) + int successCount = 0; + List failedUsers = new ArrayList<>(); + List successUsers = new ArrayList<>(); + + for (User user : users) { + try { + // 先保存用户基本信息 + if (userService.save(user)) { + // 如果有角色,再保存角色关系 + if (user.getRoles() != null && !user.getRoles().isEmpty()) { + List roleIds = user.getRoles().stream() + .map(Role::getRoleId) + .collect(Collectors.toList()); + userRoleService.saveBatch(user.getUserId(), roleIds); + } + successCount++; + successUsers.add(user); + } else { + failedUsers.add(user.getUsername()); + } + } catch (Exception e) { + e.printStackTrace(); + failedUsers.add(user.getUsername()); + // 继续处理下一个用户,不中断整个导入过程 + } + } + + // 同步成功导入的用户到 websopy + for (User successUser : successUsers) { + userSyncService.syncUserToWebsopy(successUser); + } + + // 构建返回消息 + StringBuilder message = new StringBuilder(); + if (successCount > 0) { + message.append("成功导入").append(successCount).append("个用户"); + } + if (!skippedUsers.isEmpty()) { + if (message.length() > 0) { + message.append(","); + } + message.append("跳过").append(skippedUsers.size()).append("个已存在用户"); + } + if (!failedUsers.isEmpty()) { + if (message.length() > 0) { + message.append(","); + } + message.append("失败").append(failedUsers.size()).append("个用户"); + } + if (message.length() == 0) { + message.append("没有新用户需要导入"); + } + + // 构建返回数据 + Map resultData = new HashMap<>(); + if (!skippedUsers.isEmpty()) { + resultData.put("skipped", skippedUsers); + } + if (!failedUsers.isEmpty()) { + resultData.put("failed", failedUsers); + } + + // 返回结果 + return success(message.toString(), resultData.isEmpty() ? null : resultData); + } catch (Exception e) { + e.printStackTrace(); + return fail("导入失败:" + e.getMessage(), null); + } + } + + /** + * 下载用户导入模板 + */ + @Operation(summary = "下载用户导入模板") + @GetMapping("/import/template") + public void downloadImportTemplate(HttpServletResponse response) { + try { + // 创建示例数据 + List templateData = new ArrayList<>(); + + // 添加示例数据行 + UserImportParam example1 = new UserImportParam(); + example1.setUsername("admin001"); + example1.setPassword("123456"); + example1.setNickname("管理员"); + example1.setRealName("张三"); + example1.setPhone("13800138001"); + example1.setPoints(1000); + example1.setEmail("admin@example.com"); + example1.setOrganizationName("总公司"); + example1.setSexName("男"); + example1.setRoleName("管理员"); + example1.setStatus(0); + example1.setAddress("地址"); + example1.setComments(""); + templateData.add(example1); + + UserImportParam example2 = new UserImportParam(); + example2.setUsername("user001"); + example2.setPassword("123456"); + example2.setNickname("注册用户"); + example2.setRealName("李四"); + example2.setPhone("13800138002"); + example1.setPoints(2000); + example2.setEmail("user@example.com"); + example2.setOrganizationName("分公司"); + example2.setSexName("女"); + example2.setRoleName("注册用户"); + example1.setStatus(0); + example2.setAddress("地址"); + example2.setComments(""); + templateData.add(example2); + + // 设置导出参数 + ExportParams exportParams = new ExportParams("用户导入模板", "用户数据"); + exportParams.setCreateHeadRows(true); + + // 生成Excel工作簿 + Workbook workbook = ExcelExportUtil.exportExcel(exportParams, UserImportParam.class, templateData); + + // 设置响应头 + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.setCharacterEncoding("UTF-8"); + String fileName = "用户导入模板.xlsx"; + response.setHeader("Content-Disposition", "attachment; filename=\"" + + java.net.URLEncoder.encode(fileName, "UTF-8") + "\""); + + // 输出到响应流 + workbook.write(response.getOutputStream()); + workbook.close(); + + } catch (Exception e) { + e.printStackTrace(); + try { + response.setContentType("application/json;charset=UTF-8"); + response.getWriter().write("{\"code\":1,\"message\":\"模板下载失败:" + e.getMessage() + "\"}"); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + } + + @PreAuthorize("hasAuthority('sys:auth:user')") + @PostMapping("/getAvatarByMpWx") + @Operation(summary = "更新微信头像") + public ApiResult getAvatarByMpWx(@RequestBody User user) { + user.setAvatar("https://oa.gxwebsoft.com/assets/logo.7ccfefb9.svg"); + if (userService.updateUser(user)) { + return success("更新成功"); + } + return fail("更新失败"); + } + + @PostMapping("/updatePointsBySign") + @Operation(summary = "签到成功累加积分") + public ApiResult updatePointsBySign() { + final User loginUser = getLoginUser(); + loginUser.setPoints(loginUser.getPoints() + 1); + if (userService.updateUser(loginUser)) { + return success("签到成功"); + } + return fail("签到失败"); + } + + @PreAuthorize("hasAuthority('sys:auth:user')") + @PutMapping("/updateUserBalance") + @Operation(summary = "更新用户余额") + public ApiResult updateUserBalance(@RequestBody User user) { + if (getLoginUser() == null) { + return fail("请先登录"); + } + if (userService.updateUser(user)) { + return success("操作成功"); + } + return fail("操作失败"); + } + + @PostMapping("/updateUserBalanceWithoutLogin") + @Operation(summary = "更新用户余额(无需登陆)") + public ApiResult updateUserBalanceWithoutLogin(@RequestBody User user) { + if (user.getAuthCode() == null || !user.getAuthCode().equals("1700083")) + return fail("参数错误"); + if (userService.updateById(user)) { + return success("操作成功"); + } + return fail("操作失败"); + } + + @PostMapping("/addUserBalanceWithoutLogin") + @Operation(summary = "增加用户余额(无需登陆)") + public ApiResult addUserBalanceWithoutLogin(@RequestBody User user) { + if (user.getAuthCode() == null || !user.getAuthCode().equals("1700083")) + return fail("参数错误"); + User user1 = userService.getByIdRel(user.getUserId()); + user1.setBalance(user1.getBalance().add(user.getBalance())); + if (userService.updateById(user1)) { + return success("操作成功"); + } + return fail("操作失败"); + } + + @PostMapping("/updateUserOfficeOpenidWithoutLogin") + @Operation(summary = "更新用户公众号openid(无需登陆)") + public ApiResult updateUserOfficeOpenidWithoutLogin(@RequestBody User user) { + if (user.getAuthCode() == null || !user.getAuthCode().equals("1700083")) + return fail("参数错误"); + if (userService.updateUser(user)) { + return success("操作成功"); + } + return fail("操作失败"); + } + + @Operation(summary = "获取用户(无需登陆)") + @PostMapping("/getUserWithoutLogin") + public ApiResult getUserWithoutLogin(@RequestBody User user) { + if (user.getAuthCode() == null || !user.getAuthCode().equals("1700083")) + return fail("参数错误"); + return success(userService.getByIdRel(user.getUserId())); + } + + @PreAuthorize("hasAuthority('sys:user:list')") + @OperationLog + @Operation(summary = "统计用户余额") + @GetMapping("/countUserBalance") + public ApiResult countUserBalance(User param) { + final LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.gt(User::getBalance, 0); + if (!param.getOrganizationId().equals(0)) { + wrapper.eq(User::getOrganizationId, param.getOrganizationId()); + } + final List list = userService.list(wrapper); + final BigDecimal totalBalance = list.stream().map(User::getBalance).reduce(BigDecimal.ZERO, BigDecimal::add); + // System.out.println("统计用户余额 = " + totalBalance); + return success("统计成功", totalBalance); + } + + @Operation(summary = "更新商户ID") + @PutMapping("/updateUserMerchantId") + public ApiResult updateUserMerchantId(@RequestBody User user) { + if (userService.updateUser(user)) { + return success("更新成功"); + } + return fail("更新失败"); + } + + @Operation(summary = "园区内用户数") + @GetMapping("/userNumInPark") + public ApiResult userNumInPark(UserParam param) { + return success("统计成功", userService.userNumInPark(param)); + } + + @Operation(summary = "园区内企业数") + @GetMapping("/orgNumInPark") + public ApiResult orgNumInPark(UserParam param) { + return success("统计成功", userService.orgNumInPark(param)); + } + + @PreAuthorize("hasAuthority('sys:auth:user')") + @Operation(summary = "查询全部用户") + @GetMapping("/listAdminsByPhoneAll") + public ApiResult listAdminsByPhoneAll(LoginParam param, HttpServletRequest request){ + final List adminsByPhone = userService.getAdminsByPhone(param); + if (adminsByPhone.size() == 1) { + // 设置过期时间 + Long tokenExpireTime = configProperties.getTokenExpireTime(); + final User user = adminsByPhone.get(0); + // 签发token + String access_token = JwtUtil.buildToken(new JwtSubject(user.getUsername(), user.getTenantId()), + tokenExpireTime, configProperties.getTokenKey()); + loginRecordService.saveAsync(user.getUsername(), LoginRecord.TYPE_LOGIN, null, user.getTenantId(), request); + return success("登录成功", new LoginResult(access_token, user)); + } + return success(adminsByPhone); + } + + @PreAuthorize("hasAuthority('sys:user:pageAll')") + @Operation(summary = "查询全部用户All") + @GetMapping("/pageAll") + public ApiResult> pageAll(UserParam param){ + final User loginUser = getLoginUser(); + if(loginUser != null){ + if(!loginUser.getTenantId().equals(5)){ + param.setTenantId(getLoginUser().getTenantId()); + } + } + return success(userService.pageAll(param)); + } +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/UserFileController.java b/src/main/java/com/gxwebsoft/common/system/controller/UserFileController.java new file mode 100644 index 0000000..160f13b --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/UserFileController.java @@ -0,0 +1,164 @@ +package com.gxwebsoft.common.system.controller; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.gxwebsoft.common.core.utils.FileServerUtil; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.system.service.UserFileService; +import com.gxwebsoft.common.system.entity.UserFile; +import com.gxwebsoft.common.system.param.UserFileParam; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.annotation.OperationLog; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.List; + +/** + * 用户文件控制器 + * + * @author WebSoft + * @since 2022-07-21 14:34:40 + */ +@Tag(name = "用户上传文件") +@RestController +@RequestMapping("/api/system/user-file") +public class UserFileController extends BaseController { + @Resource + private UserFileService userFileService; + + @OperationLog + @Operation(summary = "分页查询用户文件") + @GetMapping("/page") + public ApiResult> page(UserFileParam param, HttpServletRequest request) { + param.setUserId(getLoginUserId()); + PageParam page = new PageParam<>(param); + page.setDefaultOrder("is_directory desc"); + PageParam result = userFileService.page(page, page.getWrapper()); + List records = result.getRecords(); + String requestURL = StrUtil.removeSuffix(request.getRequestURL(), "/system/user-file") + "/file"; + for (UserFile record : records) { + if (StrUtil.isNotBlank(record.getPath())) { + record.setUrl(requestURL + "/" + record.getPath()); + if (FileServerUtil.isImage(record.getContentType())) { + record.setThumbnail(requestURL + "/thumbnail/" + record.getPath()); + } + record.setDownloadUrl(requestURL + "/download/" + record.getPath()); + } + } + return success(records, result.getTotal()); + } + + @OperationLog + @Operation(summary = "查询全部用户文件") + @GetMapping() + public ApiResult> list(UserFileParam param, HttpServletRequest request) { + param.setUserId(getLoginUserId()); + PageParam page = new PageParam<>(param); + page.setDefaultOrder("is_directory desc"); + List records = userFileService.list(page.getOrderWrapper()); + String requestURL = StrUtil.removeSuffix(request.getRequestURL(), "/system/user-file") + "/file"; + for (UserFile record : records) { + if (StrUtil.isNotBlank(record.getPath())) { + record.setUrl(requestURL + "/" + record.getPath()); + if (FileServerUtil.isImage(record.getContentType())) { + record.setThumbnail(requestURL + "/thumbnail/" + record.getPath()); + } + record.setDownloadUrl(requestURL + "/download/" + record.getPath()); + } + } + return success(records); + } + + @PreAuthorize("hasAuthority('sys:auth:user')") + @OperationLog + @Operation(summary = "添加用户文件") + @PostMapping() + public ApiResult save(@RequestBody UserFile userFile) { + userFile.setUserId(getLoginUserId()); + if (userFile.getParentId() == null) { + userFile.setParentId(0); + } + if (userFile.getIsDirectory() != null && userFile.getIsDirectory().equals(1)) { + if (userFileService.count(new LambdaQueryWrapper() + .eq(UserFile::getName, userFile.getName()) + .eq(UserFile::getParentId, userFile.getParentId()) + .eq(UserFile::getUserId, userFile.getUserId())) > 0) { + return fail("文件夹名称已存在"); + } + } + if (userFileService.save(userFile)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:auth:user')") + @OperationLog + @Operation(summary = "修改用户文件") + @PutMapping() + public ApiResult update(@RequestBody UserFile userFile) { + Integer loginUserId = getLoginUserId(); + UserFile old = userFileService.getById(userFile.getId()); + UserFile entity = new UserFile(); + if (StrUtil.isNotBlank(userFile.getName())) { + entity.setName(userFile.getName()); + } + if (userFile.getParentId() != null) { + entity.setParentId(userFile.getParentId()); + } + if (!old.getUserId().equals(loginUserId) || + (entity.getName() == null && entity.getParentId() == null)) { + return fail("修改失败"); + } + if (old.getIsDirectory() != null && old.getIsDirectory().equals(1)) { + if (userFileService.count(new LambdaQueryWrapper() + .eq(UserFile::getName, entity.getName() == null ? old.getName() : entity.getName()) + .eq(UserFile::getParentId, entity.getParentId() == null ? old.getParentId() : entity.getParentId()) + .eq(UserFile::getUserId, loginUserId) + .ne(UserFile::getId, old.getId())) > 0) { + return fail("文件夹名称已存在"); + } + } + if (userFileService.update(entity, new LambdaUpdateWrapper() + .eq(UserFile::getId, userFile.getId()) + .eq(UserFile::getUserId, loginUserId))) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:auth:user')") + @OperationLog + @Operation(summary = "删除用户文件") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (userFileService.remove(new LambdaUpdateWrapper() + .eq(UserFile::getId, id) + .eq(UserFile::getUserId, getLoginUserId()))) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:auth:user')") + @OperationLog + @Operation(summary = "批量删除用户文件") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (userFileService.remove(new LambdaUpdateWrapper() + .in(UserFile::getId, ids) + .eq(UserFile::getUserId, getLoginUserId()))) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/UserGradeController.java b/src/main/java/com/gxwebsoft/common/system/controller/UserGradeController.java new file mode 100644 index 0000000..c5a4716 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/UserGradeController.java @@ -0,0 +1,132 @@ +package com.gxwebsoft.common.system.controller; + +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.common.system.service.UserGradeService; +import com.gxwebsoft.common.system.entity.UserGrade; +import com.gxwebsoft.common.system.param.UserGradeParam; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.core.web.BatchParam; +import com.gxwebsoft.common.core.annotation.OperationLog; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 用户会员等级表控制器 + * + * @author 科技小王子 + * @since 2023-10-07 22:51:17 + */ +@Tag(name = "用户等级") +@RestController +@RequestMapping("/api/system/user-grade") +public class UserGradeController extends BaseController { + @Resource + private UserGradeService userGradeService; + + @Operation(summary = "分页查询用户会员等级表") + @GetMapping("/page") + public ApiResult> page(UserGradeParam param) { + // 使用关联查询 + return success(userGradeService.pageRel(param)); + } + + @Operation(summary = "查询全部用户会员等级表") + @GetMapping() + public ApiResult> list(UserGradeParam param) { + // 使用关联查询 + return success(userGradeService.listRel(param)); + } + + @Operation(summary = "根据id查询用户会员等级表") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + // 使用关联查询 + return success(userGradeService.getByIdRel(id)); + } + + @PreAuthorize("hasAuthority('sys:userGrade:save')") + @OperationLog + @Operation(summary = "添加用户会员等级表") + @PostMapping() + public ApiResult save(@RequestBody UserGrade userGrade) { + if (userGradeService.save(userGrade)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:userGrade:update')") + @OperationLog + @Operation(summary = "修改用户会员等级表") + @PutMapping() + public ApiResult update(@RequestBody UserGrade userGrade) { + if (userGradeService.updateById(userGrade)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:userGrade:remove')") + @OperationLog + @Operation(summary = "删除用户会员等级表") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (userGradeService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:userGrade:save')") + @OperationLog + @Operation(summary = "批量添加用户会员等级表") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (userGradeService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:userGrade:update')") + @OperationLog + @Operation(summary = "批量修改用户会员等级表") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(userGradeService, "grade_id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:userGrade:remove')") + @OperationLog + @Operation(summary = "批量删除用户会员等级表") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (userGradeService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @Operation(summary = "修改用户会员等级表") + @PutMapping("/updateGradeId") + public ApiResult updateGradeId(@RequestBody UserGrade userGrade) { + final User loginUser = getLoginUser(); + if(loginUser != null){ + if (userGradeService.updateById(userGrade)) { + return success("修改成功"); + } + } + return fail("修改失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/UserGroupController.java b/src/main/java/com/gxwebsoft/common/system/controller/UserGroupController.java new file mode 100644 index 0000000..38b1e55 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/UserGroupController.java @@ -0,0 +1,133 @@ +package com.gxwebsoft.common.system.controller; + +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.system.service.UserGroupService; +import com.gxwebsoft.common.system.entity.UserGroup; +import com.gxwebsoft.common.system.param.UserGroupParam; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.BatchParam; +import com.gxwebsoft.common.core.annotation.OperationLog; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 用户分组管理表控制器 + * + * @author 科技小王子 + * @since 2023-10-28 15:16:39 + */ +@Tag(name = "用户") +@RestController +@RequestMapping("/api/system/user-group") +public class UserGroupController extends BaseController { + @Resource + private UserGroupService userGroupService; + + @PreAuthorize("hasAuthority('sys:userGroup:list')") + @OperationLog + @Operation(summary = "分页查询用户分组管理表") + @GetMapping("/page") + public ApiResult> page(UserGroupParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + return success(userGroupService.page(page, page.getWrapper())); + // 使用关联查询 + //return success(userGroupService.pageRel(param)); + } + + @PreAuthorize("hasAuthority('sys:userGroup:list')") + @OperationLog + @Operation(summary = "查询全部用户分组管理表") + @GetMapping() + public ApiResult> list(UserGroupParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + return success(userGroupService.list(page.getOrderWrapper())); + // 使用关联查询 + //return success(userGroupService.listRel(param)); + } + + @PreAuthorize("hasAuthority('sys:userGroup:list')") + @OperationLog + @Operation(summary = "根据id查询用户分组管理表") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + return success(userGroupService.getById(id)); + // 使用关联查询 + //return success(userGroupService.getByIdRel(id)); + } + + @PreAuthorize("hasAuthority('sys:userGroup:save')") + @OperationLog + @Operation(summary = "添加用户分组管理表") + @PostMapping() + public ApiResult save(@RequestBody UserGroup userGroup) { + if (userGroupService.save(userGroup)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:userGroup:update')") + @OperationLog + @Operation(summary = "修改用户分组管理表") + @PutMapping() + public ApiResult update(@RequestBody UserGroup userGroup) { + if (userGroupService.updateById(userGroup)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:userGroup:remove')") + @OperationLog + @Operation(summary = "删除用户分组管理表") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (userGroupService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:userGroup:save')") + @OperationLog + @Operation(summary = "批量添加用户分组管理表") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (userGroupService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:userGroup:update')") + @OperationLog + @Operation(summary = "批量修改用户分组管理表") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(userGroupService, "group_id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:userGroup:remove')") + @OperationLog + @Operation(summary = "批量删除用户分组管理表") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (userGroupService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/UserOauthController.java b/src/main/java/com/gxwebsoft/common/system/controller/UserOauthController.java new file mode 100644 index 0000000..6e49d78 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/UserOauthController.java @@ -0,0 +1,131 @@ +package com.gxwebsoft.common.system.controller; + +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.common.system.service.UserOauthService; +import com.gxwebsoft.common.system.entity.UserOauth; +import com.gxwebsoft.common.system.param.UserOauthParam; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.core.web.BatchParam; +import com.gxwebsoft.common.core.annotation.OperationLog; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 第三方用户信息表控制器 + * + * @author 科技小王子 + * @since 2023-10-07 22:39:46 + */ +@Tag(name = "第三方用户") +@RestController +@RequestMapping("/api/system/user-oauth") +public class UserOauthController extends BaseController { + @Resource + private UserOauthService userOauthService; + + @PreAuthorize("hasAuthority('sys:userOauth:list')") + @OperationLog + @Operation(summary = "分页查询第三方用户信息表") + @GetMapping("/page") + public ApiResult> page(UserOauthParam param) { + // 使用关联查询 + return success(userOauthService.pageRel(param)); + } + + @PreAuthorize("hasAuthority('sys:userOauth:list')") + @OperationLog + @Operation(summary = "查询全部第三方用户信息表") + @GetMapping() + public ApiResult> list(UserOauthParam param) { + // 使用关联查询 + return success(userOauthService.listRel(param)); + } + + @PreAuthorize("hasAuthority('sys:userOauth:list')") + @OperationLog + @Operation(summary = "根据id查询第三方用户信息表") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + // 使用关联查询 + return success(userOauthService.getByIdRel(id)); + } + + @PreAuthorize("hasAuthority('sys:userOauth:save')") + @OperationLog + @Operation(summary = "添加第三方用户信息表") + @PostMapping() + public ApiResult save(@RequestBody UserOauth userOauth) { + // 记录当前登录用户id + User loginUser = getLoginUser(); + if (loginUser != null) { + userOauth.setUserId(loginUser.getUserId()); + } + if (userOauthService.save(userOauth)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:userOauth:update')") + @OperationLog + @Operation(summary = "修改第三方用户信息表") + @PutMapping() + public ApiResult update(@RequestBody UserOauth userOauth) { + if (userOauthService.updateById(userOauth)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:userOauth:remove')") + @OperationLog + @Operation(summary = "删除第三方用户信息表") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (userOauthService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:userOauth:save')") + @OperationLog + @Operation(summary = "批量添加第三方用户信息表") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (userOauthService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:userOauth:update')") + @OperationLog + @Operation(summary = "批量修改第三方用户信息表") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(userOauthService, "id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:userOauth:remove')") + @OperationLog + @Operation(summary = "批量删除第三方用户信息表") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (userOauthService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/UserRefereeController.java b/src/main/java/com/gxwebsoft/common/system/controller/UserRefereeController.java new file mode 100644 index 0000000..3e82bd6 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/UserRefereeController.java @@ -0,0 +1,220 @@ +package com.gxwebsoft.common.system.controller; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.common.system.service.UserRefereeService; +import com.gxwebsoft.common.system.entity.UserReferee; +import com.gxwebsoft.common.system.param.UserRefereeParam; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.core.web.BatchParam; +import com.gxwebsoft.common.core.annotation.OperationLog; +import com.gxwebsoft.common.system.service.UserService; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 用户推荐关系表控制器 + * + * @author 科技小王子 + * @since 2023-10-07 22:56:36 + */ +@Tag(name = "用户") +@RestController +@RequestMapping("/api/system/user-referee") +public class UserRefereeController extends BaseController { + @Resource + private UserRefereeService userRefereeService; + @Resource + private UserService userService; + + @PreAuthorize("hasAuthority('sys:userReferee:list')") + @OperationLog + @Operation(summary = "分页查询用户推荐关系表") + @GetMapping("/page") + public ApiResult> page(UserRefereeParam param) { + // 使用关联查询 + return success(userRefereeService.pageRel(param)); + } + + @PreAuthorize("hasAuthority('sys:userReferee:list')") + @OperationLog + @Operation(summary = "查询全部用户推荐关系表") + @GetMapping() + public ApiResult> list(UserRefereeParam param) { + // 使用关联查询 + return success(userRefereeService.listRel(param)); + } + + @PreAuthorize("hasAuthority('sys:userReferee:list')") + @OperationLog + @Operation(summary = "根据id查询用户推荐关系表") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + // 使用关联查询 + return success(userRefereeService.getByIdRel(id)); + } + + @PreAuthorize("hasAuthority('sys:userReferee:save')") + @OperationLog + @Operation(summary = "添加用户推荐关系表") + @PostMapping() + public ApiResult save(@RequestBody UserReferee userReferee) { + // 记录当前登录用户id + User loginUser = getLoginUser(); + if (loginUser != null) { + userReferee.setUserId(loginUser.getUserId()); + } + if (userRefereeService.save(userReferee)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:userReferee:update')") + @OperationLog + @Operation(summary = "修改用户推荐关系表") + @PutMapping() + public ApiResult update(@RequestBody UserReferee userReferee) { + if (userRefereeService.updateById(userReferee)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:userReferee:remove')") + @OperationLog + @Operation(summary = "删除用户推荐关系表") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (userRefereeService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:userReferee:save')") + @OperationLog + @Operation(summary = "批量添加用户推荐关系表") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (userRefereeService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:userReferee:update')") + @OperationLog + @Operation(summary = "批量修改用户推荐关系表") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(userRefereeService, "id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:userReferee:remove')") + @OperationLog + @Operation(summary = "批量删除用户推荐关系表") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (userRefereeService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @Operation(summary = "查询推荐人信息") + @GetMapping("/getReferee/{id}") + public ApiResult getReferee(@PathVariable("id") Integer id) { + if (id == null) { + return fail("参数错误", null); + } + + final UserReferee referee = userRefereeService.getOne(new LambdaQueryWrapper() + .eq(UserReferee::getUserId, id) + .eq(UserReferee::getDeleted, 0) + .last("limit 1") + ); + + if (ObjectUtil.isEmpty(referee)) { + return fail("查询失败", null); + } + + final User user = userService.getByIdRel(referee.getDealerId()); + if (ObjectUtil.isNotEmpty(user)) { + return success(user); + } + return fail("查询失败", null); + } + + @Operation(summary = "查询推荐人列表") + @GetMapping("/getRefereeList/{id}") + public ApiResult> getRefereeList(@PathVariable("id") Integer id) { + if (id == null) { + return fail("参数错误", null); + } + + final List refereeList = userRefereeService.list(new LambdaQueryWrapper() + .eq(UserReferee::getDealerId, id) + .eq(UserReferee::getDeleted, 0)); + + if (ObjectUtil.isEmpty(refereeList)) { + return fail("查询失败", null); + } + + final List users = userService.list( + new LambdaQueryWrapper() + .in(User::getUserId, refereeList.stream().map(UserReferee::getUserId).toList()) + ); + if (ObjectUtil.isNotEmpty(users)) { + return success(users); + } + return fail("查询失败", null); + } + + @Operation(summary = "查询推荐人数量") + @GetMapping("/getRefereeNum/{id}") + public ApiResult getRefereeNum(@PathVariable("id") Integer id) { + if (id == null) { + return fail("参数错误", null); + } + + final List refereeList = userRefereeService.list(new LambdaQueryWrapper() + .eq(UserReferee::getDealerId, id) + .eq(UserReferee::getDeleted, 0)); + + if (ObjectUtil.isEmpty(refereeList)) { + return success("查询成功", 0); + } + return success("查询成功", refereeList.size()); + } + + @Operation(summary = "根据id列表查询推荐人数量") + @PostMapping("/getRefereeNumByUidList") + public ApiResult>> getRefereeNum(@RequestBody UserReferee userReferee) { + List> list = new ArrayList<>(); + for (Integer id : userReferee.getUserIdList()) { + Map data = new HashMap<>(); + data.put("userId", id); + final List refereeList = userRefereeService.list(new LambdaQueryWrapper() + .eq(UserReferee::getDealerId, id) + .eq(UserReferee::getDeleted, 0)); + data.put("num", refereeList.size()); + list.add(data); + } + return success("查询成功", list); + } +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/UserRoleController.java b/src/main/java/com/gxwebsoft/common/system/controller/UserRoleController.java new file mode 100644 index 0000000..692600a --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/UserRoleController.java @@ -0,0 +1,134 @@ +package com.gxwebsoft.common.system.controller; + +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.common.system.service.UserRoleService; +import com.gxwebsoft.common.system.entity.UserRole; +import com.gxwebsoft.common.system.param.UserRoleParam; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.core.web.BatchParam; +import com.gxwebsoft.common.core.annotation.OperationLog; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 用户角色控制器 + * + * @author 科技小王子 + * @since 2025-06-16 20:39:53 + */ +@Tag(name = "用户角色管理") +@RestController +@RequestMapping("/api/system/user-role") +public class UserRoleController extends BaseController { + @Resource + private UserRoleService userRoleService; + + @Operation(summary = "查询角色下的用户") + @GetMapping("/user-list-in-role/{id}") + public ApiResult> userListInRole(@PathVariable Integer id) { + return success(userRoleService.listByRoleId(id)); + } + + @Operation(summary = "分页查询用户角色") + @GetMapping("/page") + public ApiResult> page(UserRoleParam param) { + // 使用关联查询 + return success(userRoleService.pageRel(param)); + } + + @Operation(summary = "查询全部用户角色") + @GetMapping() + public ApiResult> list(UserRoleParam param) { + // 使用关联查询 + return success(userRoleService.listRel(param)); + } + + + @Operation(summary = "根据id查询用户角色") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + // 使用关联查询 + return success(userRoleService.getByIdRel(id)); + } + + @PreAuthorize("hasAuthority('sys:userRole:save')") + @OperationLog + @Operation(summary = "添加用户角色") + @PostMapping() + public ApiResult save(@RequestBody UserRole userRole) { + // 记录当前登录用户id + User loginUser = getLoginUser(); + if (loginUser != null) { + userRole.setUserId(loginUser.getUserId()); + } + if (userRoleService.save(userRole)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @Operation(summary = "修改用户角色") + @PutMapping() + public ApiResult update(@RequestBody UserRole userRole) { + final User loginUser = getLoginUser(); + if (loginUser == null) { + return fail("请先登录"); + } + if (userRoleService.updateById(userRole)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:userRole:remove')") + @OperationLog + @Operation(summary = "删除用户角色") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (userRoleService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:userRole:save')") + @OperationLog + @Operation(summary = "批量添加用户角色") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (userRoleService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:userRole:update')") + @OperationLog + @Operation(summary = "批量修改用户角色") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(userRoleService, "id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:userRole:remove')") + @OperationLog + @Operation(summary = "批量删除用户角色") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (userRoleService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/UserVerifyController.java b/src/main/java/com/gxwebsoft/common/system/controller/UserVerifyController.java new file mode 100644 index 0000000..effce62 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/UserVerifyController.java @@ -0,0 +1,182 @@ +package com.gxwebsoft.common.system.controller; + +import cn.hutool.core.util.ObjUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.gxwebsoft.common.core.annotation.OperationLog; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.core.web.BatchParam; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.Organization; +import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.common.system.entity.UserVerify; +import com.gxwebsoft.common.system.param.UserVerifyParam; +import com.gxwebsoft.common.system.service.OrganizationService; +import com.gxwebsoft.common.system.service.UserService; +import com.gxwebsoft.common.system.service.UserVerifyService; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 实名认证控制器 + * + * @author 科技小王子 + * @since 2025-05-29 23:01:04 + */ +@Tag(name = "实名认证管理") +@RestController +@RequestMapping("/api/system/user-verify") +public class UserVerifyController extends BaseController { + @Resource + private UserVerifyService userVerifyService; + @Resource + private UserService userService; + @Resource + private OrganizationService organizationService; + + @PreAuthorize("hasAuthority('sys:userVerify:list')") + @Operation(summary = "分页查询实名认证") + @GetMapping("/page") + public ApiResult> page(UserVerifyParam param) { + // 使用关联查询 + return success(userVerifyService.pageRel(param)); + } + + @PreAuthorize("hasAuthority('sys:userVerify:list')") + @Operation(summary = "查询全部实名认证") + @GetMapping() + public ApiResult> list(UserVerifyParam param) { + // 使用关联查询 + return success(userVerifyService.listRel(param)); + } + + @Operation(summary = "根据id查询实名认证") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + // 使用关联查询 + return success(userVerifyService.getByIdRel(id)); + } + + @Operation(summary = "根据userId查询实名认证") + @GetMapping("/myUserVerify") + public ApiResult myUserVerify(UserVerifyParam param) { + if (getLoginUser() == null) { + return fail("请先登录", null); + } + final LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(UserVerify::getUserId, getLoginUserId()); + wrapper.eq(UserVerify::getDeleted, 0); + if(param.getStatus() != null){ + wrapper.eq(UserVerify::getStatus, param.getStatus()); + } + wrapper.last("limit 1"); + final UserVerify one = userVerifyService.getOne(wrapper); + if(ObjUtil.isNotEmpty(one) && one.getOrganizationId() > 0){ + final Organization organization = organizationService.getById(one.getOrganizationId()); + if(organization != null){ + one.setOrganizationName(organization.getOrganizationName()); + } + } + return success(one); + } + + @Operation(summary = "提交实名认证") + @PostMapping() + public ApiResult save(@RequestBody UserVerify userVerify) { + if (getLoginUser() == null) { + return fail("请先登录"); + } + userVerify.setUserId(getLoginUserId()); + if (userVerifyService.save(userVerify)) { + return success("提交成功"); + } + return fail("提交失败"); + } + + @Transactional(rollbackFor = Exception.class) + @Operation(summary = "修改实名认证") + @PutMapping() + public ApiResult update(@RequestBody UserVerify userVerify) { + final User loginUser = getLoginUser(); + if (loginUser == null) { + return fail("请先登录"); + } + + final User byUserId = userService.getById(userVerify.getUserId()); + if (ObjUtil.isEmpty(byUserId)) { + return fail("用户不存在"); + } + // 不通过 + byUserId.setCertification(false); + // 通过认证 + if (userVerify.getStatus().equals(1)) { + byUserId.setRealName(userVerify.getRealName()); + byUserId.setCertification(true); + byUserId.setType(userVerify.getType()); + // 企业认证 + if (userVerify.getType().equals(1)) { + byUserId.setRealName(userVerify.getName()); + } + // 设置管理员id + userVerify.setAdminId(loginUser.getUserId()); + } + userService.updateById(byUserId); + + if (userVerifyService.updateById(userVerify)) { + return success("提交成功"); + } + return fail("提交失败"); + } + + @PreAuthorize("hasAuthority('sys:userVerify:remove')") + @OperationLog + @Operation(summary = "删除实名认证") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (userVerifyService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:userVerify:save')") + @OperationLog + @Operation(summary = "批量添加实名认证") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (userVerifyService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:userVerify:update')") + @OperationLog + @Operation(summary = "批量修改实名认证") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(userVerifyService, "id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:userVerify:remove')") + @OperationLog + @Operation(summary = "批量删除实名认证") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (userVerifyService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/VerifyTxt.java b/src/main/java/com/gxwebsoft/common/system/controller/VerifyTxt.java new file mode 100644 index 0000000..2b87b73 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/VerifyTxt.java @@ -0,0 +1,19 @@ +package com.gxwebsoft.common.system.controller; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@Tag(name = "安全") +@RestController +@RequestMapping("/lvQ4EoivKJ.txt") +public class VerifyTxt { + + @Operation(summary = "域名所有权验证") + @GetMapping() + public String verify(){ + return "cbfbfe827744f1ebfaf03bfe2a0def6a"; + } +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/VerifyTxt2.java b/src/main/java/com/gxwebsoft/common/system/controller/VerifyTxt2.java new file mode 100644 index 0000000..c7e4897 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/VerifyTxt2.java @@ -0,0 +1,19 @@ +package com.gxwebsoft.common.system.controller; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@Tag(name = "安全") +@RestController +@RequestMapping("/MP_verify_joj96VBHPtL9YROj.txt") +public class VerifyTxt2 { + + @Operation(summary = "域名所有权验证") + @GetMapping() + public String verify(){ + return "joj96VBHPtL9YROj"; + } +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/VersionController.java b/src/main/java/com/gxwebsoft/common/system/controller/VersionController.java new file mode 100644 index 0000000..8094e55 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/VersionController.java @@ -0,0 +1,138 @@ +package com.gxwebsoft.common.system.controller; + +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.common.system.service.VersionService; +import com.gxwebsoft.common.system.entity.Version; +import com.gxwebsoft.common.system.param.VersionParam; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.BatchParam; +import com.gxwebsoft.common.core.annotation.OperationLog; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 版本更新控制器 + * + * @author 科技小王子 + * @since 2024-01-15 18:52:24 + */ +@Tag(name = "系统版本") +@RestController +@RequestMapping("/api/system/version") +public class VersionController extends BaseController { + @Resource + private VersionService versionService; + + @PreAuthorize("hasAuthority('sys:version:list')") + @OperationLog + @Operation(summary = "分页查询版本更新") + @GetMapping("/page") + public ApiResult> page(VersionParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + return success(versionService.page(page, page.getWrapper())); + // 使用关联查询 + //return success(versionService.pageRel(param)); + } + + @PreAuthorize("hasAuthority('sys:version:list')") + @OperationLog + @Operation(summary = "查询全部版本更新") + @GetMapping() + public ApiResult> list(VersionParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + return success(versionService.list(page.getOrderWrapper())); + // 使用关联查询 + //return success(versionService.listRel(param)); + } + + @PreAuthorize("hasAuthority('sys:version:list')") + @OperationLog + @Operation(summary = "根据id查询版本更新") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + return success(versionService.getById(id)); + // 使用关联查询 + //return success(versionService.getByIdRel(id)); + } + + @PreAuthorize("hasAuthority('sys:version:save')") + @OperationLog + @Operation(summary = "添加版本更新") + @PostMapping() + public ApiResult save(@RequestBody Version version) { + // 记录当前登录用户id + User loginUser = getLoginUser(); + if (loginUser != null) { + version.setUserId(loginUser.getUserId()); + } + if (versionService.save(version)) { + return success("发布成功"); + } + return fail("发布失败"); + } + + @PreAuthorize("hasAuthority('sys:version:save')") + @OperationLog + @Operation(summary = "修改版本更新") + @PutMapping() + public ApiResult update(@RequestBody Version version) { + if (versionService.updateById(version)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:version:save')") + @OperationLog + @Operation(summary = "删除版本更新") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (versionService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:version:save')") + @OperationLog + @Operation(summary = "批量添加版本更新") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (versionService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:version:save')") + @OperationLog + @Operation(summary = "批量修改版本更新") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(versionService, "id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:version:save')") + @OperationLog + @Operation(summary = "批量删除版本更新") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (versionService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/WebsiteFieldController.java b/src/main/java/com/gxwebsoft/common/system/controller/WebsiteFieldController.java new file mode 100644 index 0000000..9d38c96 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/WebsiteFieldController.java @@ -0,0 +1,136 @@ +package com.gxwebsoft.common.system.controller; + +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.common.system.service.WebsiteFieldService; +import com.gxwebsoft.common.system.entity.WebsiteField; +import com.gxwebsoft.common.system.param.WebsiteFieldParam; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.BatchParam; +import com.gxwebsoft.common.core.annotation.OperationLog; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.List; + +/** + * 应用参数控制器 + * + * @author 科技小王子 + * @since 2024-08-27 15:18:05 + */ +@Tag(name = "应用参数管理") +@RestController +@RequestMapping("/api/system/website-field") +public class WebsiteFieldController extends BaseController { + @Resource + private WebsiteFieldService websiteFieldService; + + @Operation(summary = "分页查询应用参数") + @GetMapping("/page") + public ApiResult> page(WebsiteFieldParam param) { + // 使用关联查询 + return success(websiteFieldService.pageRel(param)); + } + + @Operation(summary = "查询全部应用参数") + @GetMapping() + public ApiResult> list(WebsiteFieldParam param) { + // 使用关联查询 + return success(websiteFieldService.listRel(param)); + } + + @Operation(summary = "根据id查询应用参数") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + // 使用关联查询 + return success(websiteFieldService.getByIdRel(id)); + } + + @PreAuthorize("hasAuthority('system:websiteField:save')") + @OperationLog + @Operation(summary = "添加应用参数") + @PostMapping() + public ApiResult save(@RequestBody WebsiteField websiteField) { + if (websiteFieldService.save(websiteField)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('system:websiteField:update')") + @OperationLog + @Operation(summary = "修改应用参数") + @PutMapping() + public ApiResult update(@RequestBody WebsiteField websiteField) { + if (websiteFieldService.updateById(websiteField)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('system:websiteField:remove')") + @OperationLog + @Operation(summary = "删除应用参数") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (websiteFieldService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('system:websiteField:save')") + @OperationLog + @Operation(summary = "批量添加应用参数") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (websiteFieldService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('system:websiteField:update')") + @OperationLog + @Operation(summary = "批量修改应用参数") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(websiteFieldService, "id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('system:websiteField:remove')") + @OperationLog + @Operation(summary = "批量删除应用参数") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (websiteFieldService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @Operation(summary = "获取网站配置参数-对象形式") + @GetMapping("/config") + public ApiResult getConfig(WebsiteFieldParam param) { + // 使用关联查询 + final List fields = websiteFieldService.listRel(param); + + HashMap config = new HashMap<>(); + fields.forEach(d -> { + config.put(d.getName(), d.getValue()); + }); + System.out.println("config = " + config); + return success(config); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/WhiteDomainController.java b/src/main/java/com/gxwebsoft/common/system/controller/WhiteDomainController.java new file mode 100644 index 0000000..f826c18 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/WhiteDomainController.java @@ -0,0 +1,147 @@ +package com.gxwebsoft.common.system.controller; + +import com.gxwebsoft.common.core.utils.RedisUtil; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.common.system.service.WhiteDomainService; +import com.gxwebsoft.common.system.entity.WhiteDomain; +import com.gxwebsoft.common.system.param.WhiteDomainParam; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.core.web.BatchParam; +import com.gxwebsoft.common.core.annotation.OperationLog; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 服务器白名单控制器 + * + * @author 科技小王子 + * @since 2024-03-26 00:22:21 + */ +@Tag(name = "安全") +@RestController +@RequestMapping("/api/system/white-domain") +public class WhiteDomainController extends BaseController { + @Resource + private WhiteDomainService whiteDomainService; + @Resource + private RedisUtil redisUtil; + + @PreAuthorize("hasAuthority('sys:whiteDomain:list')") + @Operation(summary = "分页查询服务器白名单") + @GetMapping("/page") + public ApiResult> page(WhiteDomainParam param) { + // 使用关联查询 + return success(whiteDomainService.pageRel(param)); + } + + @PreAuthorize("hasAuthority('sys:whiteDomain:list')") + @Operation(summary = "查询全部服务器白名单") + @GetMapping() + public ApiResult> list(WhiteDomainParam param) { + // 使用关联查询 + return success(whiteDomainService.listRel(param)); + } + + @PreAuthorize("hasAuthority('sys:whiteDomain:list')") + @Operation(summary = "根据id查询服务器白名单") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + // 使用关联查询 + return success(whiteDomainService.getByIdRel(id)); + } + + @PreAuthorize("hasAuthority('sys:whiteDomain:list')") + @OperationLog + @Operation(summary = "添加服务器白名单") + @PostMapping() + public ApiResult save(@RequestBody WhiteDomain whiteDomain) { + String key = "WhiteDomain:"; + // 记录当前登录用户id + User loginUser = getLoginUser(); + if (loginUser != null) { + key = key + loginUser.getTenantId(); + whiteDomain.setUserId(loginUser.getUserId()); + } + if (whiteDomainService.save(whiteDomain)) { + // 重写缓存 + final List list = whiteDomainService.list(); + final List collect = list.stream().map(WhiteDomain::getDomain).collect(Collectors.toList()); + redisUtil.set(key,collect); + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:whiteDomain:list')") + @OperationLog + @Operation(summary = "修改服务器白名单") + @PutMapping() + public ApiResult update(@RequestBody WhiteDomain whiteDomain) { + if (whiteDomainService.updateById(whiteDomain)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:whiteDomain:list')") + @OperationLog + @Operation(summary = "删除服务器白名单") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (whiteDomainService.removeById(id)) { + // 重写缓存 + String key = "WhiteDomain:"; + User loginUser = getLoginUser(); + if (loginUser != null) { + key = key + loginUser.getTenantId(); + } + final List list = whiteDomainService.list(); + final List collect = list.stream().map(WhiteDomain::getDomain).collect(Collectors.toList()); + redisUtil.set(key,collect); + return success("删除成功"); + } + return fail("删除失败"); + } + + @PreAuthorize("hasAuthority('sys:whiteDomain:list')") + @OperationLog + @Operation(summary = "批量添加服务器白名单") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (whiteDomainService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @PreAuthorize("hasAuthority('sys:whiteDomain:list')") + @OperationLog + @Operation(summary = "批量修改服务器白名单") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(whiteDomainService, "id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @PreAuthorize("hasAuthority('sys:whiteDomain:list')") + @OperationLog + @Operation(summary = "批量删除服务器白名单") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (whiteDomainService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/WxLoginController.java b/src/main/java/com/gxwebsoft/common/system/controller/WxLoginController.java new file mode 100644 index 0000000..183888b --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/WxLoginController.java @@ -0,0 +1,1008 @@ +package com.gxwebsoft.common.system.controller; + +import cn.hutool.core.io.FileUtil; +import cn.hutool.core.lang.Validator; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.RandomUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import cn.hutool.http.HttpUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.gxwebsoft.common.core.config.ConfigProperties; +import com.gxwebsoft.common.core.exception.BusinessException; +import com.gxwebsoft.common.core.security.JwtSubject; +import com.gxwebsoft.common.core.security.JwtUtil; +import com.gxwebsoft.common.core.utils.CommonUtil; +import com.gxwebsoft.common.core.utils.RedisUtil; +import com.gxwebsoft.common.core.utils.WxMiniProgramDecryptUtil; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.system.entity.*; +import com.gxwebsoft.common.system.param.LoginParam; +import com.gxwebsoft.common.system.param.UserParam; +import com.gxwebsoft.common.system.result.LoginResult; +import com.gxwebsoft.common.system.service.*; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.io.File; +import java.util.HashMap; +import java.util.List; +import java.util.concurrent.TimeUnit; + +import static com.gxwebsoft.common.core.constants.PlatformConstants.MP_WEIXIN; +import static com.gxwebsoft.common.core.constants.RedisConstants.ACCESS_TOKEN_KEY; + +@RestController +@RequestMapping("/api/wx-login") +@Tag(name = "微信小程序登录API") +public class WxLoginController extends BaseController { + private final StringRedisTemplate redisTemplate; + @Resource + private SettingService settingService; + @Resource + private UserService userService; + @Resource + private ConfigProperties configProperties; + @Resource + private UserRoleService userRoleService; + @Resource + private LoginRecordService loginRecordService; + @Resource + private RoleService roleService; + @Resource + private RedisUtil redisUtil; + @Resource + private ConfigProperties config; + @Resource + private UserRefereeService userRefereeService; + @Resource + private UserSyncService userSyncService; + + public WxLoginController(StringRedisTemplate redisTemplate) { + this.redisTemplate = redisTemplate; + } + + @Operation(summary = "获取微信AccessToken") + @Transactional(rollbackFor = {Exception.class}) + @PostMapping("/getAccessToken") + public ApiResult getMpAccessToken() { + return success("操作成功", getAccessToken()); + } + + @Operation(summary = "获取微信AccessToken(支持指定租户ID)") + @Transactional(rollbackFor = {Exception.class}) + @PostMapping("/getAccessToken/{tenantId}") + public ApiResult getMpAccessToken(@PathVariable("tenantId") Integer tenantId) { + return success("操作成功", getAccessToken(tenantId)); + } + + @Operation(summary = "清理并统一AccessToken存储格式") + @PostMapping("/cleanAccessTokenFormat") + public ApiResult cleanAccessTokenFormat() { + String key = ACCESS_TOKEN_KEY.concat(":").concat(getTenantId().toString()); + String value = redisTemplate.opsForValue().get(key); + + if (value != null) { + try { + // 尝试解析为JSON + JSONObject response = JSON.parseObject(value); + String accessToken = response.getString("access_token"); + if (StrUtil.isNotBlank(accessToken)) { + return success("AccessToken格式已经是标准JSON格式", accessToken); + } + } catch (Exception e) { + // 如果是字符串格式,转换为JSON格式 + if (StrUtil.isNotBlank(value) && !value.startsWith("{")) { + JSONObject tokenData = new JSONObject(); + tokenData.put("access_token", value); + tokenData.put("expires_in", 7200); // 默认2小时 + + // 重新存储为JSON格式 + redisTemplate.opsForValue().set(key, tokenData.toJSONString(), 7000L, TimeUnit.SECONDS); + return success("已将字符串格式转换为JSON格式", value); + } + } + } + + // 如果没有缓存或格式异常,重新获取 + redisTemplate.delete(key); + String newToken = getAccessToken(); + return success("已重新获取并统一格式", newToken); + } + + @Operation(summary = "获取微信openId") + @Transactional(rollbackFor = {Exception.class}) + @PostMapping("/getOpenId") + public ApiResult getOpenId(@RequestBody UserParam userParam, HttpServletRequest request) { + // 1.获取openid + JSONObject result = getOpenIdByCode(userParam); + String openid = result.getString("openid"); + String unionid = result.getString("unionid"); + if (openid == null) { + return fail("获取openid失败", null); + } + // 2.通过openid查询用户是否已存在 + User user = userService.getByOauthId(userParam); + // 3.存在则签发token并返回登录成功,不存在则注册新用户 + if (user == null) { + user = addUser(userParam); + } + // 4.签发token + loginRecordService.saveAsync(user.getUsername(), LoginRecord.TYPE_LOGIN, null, user.getTenantId(), request); + String access_token = JwtUtil.buildToken(new JwtSubject(user.getUsername(), user.getTenantId()), + configProperties.getTokenExpireTime(), configProperties.getTokenKey()); + return success("登录成功", new LoginResult(access_token, user)); + } + + @Operation(summary = "微信授权手机号码并登录") + @Transactional(rollbackFor = {Exception.class}) + @PostMapping("/loginByMpWxPhone") + public ApiResult loginByMpWxPhone(@RequestBody UserParam userParam, HttpServletRequest request) { + // 获取手机号码 + String phone = getPhoneByCode(userParam); + if (phone == null) { + String key = ACCESS_TOKEN_KEY.concat(":").concat(getTenantId().toString()); + redisTemplate.delete(key); + throw new BusinessException("授权失败,请重试"); + } + + User user = null; + + // 超级管理员验证 + if (userParam.getIsSuperAdmin() != null) { + final LoginParam loginParam = new LoginParam(); + loginParam.setIsAdmin(true); + loginParam.setPhone(phone); + final List adminsByPhone = userService.getAdminsByPhone(loginParam); + if (!CollectionUtils.isEmpty(adminsByPhone)) { + user = adminsByPhone.get(0); + } + } else { + // 先查询管理员用户 + user = userService.getAdminByPhone(userParam); + + // 如果不是管理员,再查询普通用户 + if (user == null) { + user = userService.getByPhone(phone, getTenantId()); + } + } + + // 如果用户存在,直接登录 + if (user != null) { + System.out.println("用户已存在,直接登录: " + user.getPhone()); + + // 检查绑定上级关系 + if (userParam.getSceneType() != null && userParam.getSceneType().equals("save_referee") && userParam.getRefereeId() != null && userParam.getRefereeId() != 0) { + UserReferee check = userRefereeService.check(user.getUserId(), userParam.getRefereeId()); + if (check == null) { + UserReferee userReferee = new UserReferee(); + userReferee.setDealerId(userParam.getRefereeId()); + userReferee.setUserId(user.getUserId()); + userRefereeService.save(userReferee); + } + } + + // 签发token + String access_token = JwtUtil.buildToken(new JwtSubject(user.getUsername(), user.getTenantId()), + configProperties.getTokenExpireTime(), configProperties.getTokenKey()); + loginRecordService.saveAsync(user.getUsername(), LoginRecord.TYPE_LOGIN, null, user.getTenantId(), request); + + return success("登录成功", new LoginResult(access_token, user)); + } + + // 用户不存在,注册新用户 + System.out.println("用户不存在,注册新用户: " + phone); + + try { + // 确保获取openid - 优先使用已有的openid,否则通过code获取 + if (StrUtil.isBlank(userParam.getOpenid())) { + String codeToUse = null; + // 优先使用authCode,如果没有则使用code + if (StrUtil.isNotBlank(userParam.getAuthCode())) { + codeToUse = userParam.getAuthCode(); + } else if (StrUtil.isNotBlank(userParam.getCode())) { + codeToUse = userParam.getCode(); + } + + if (StrUtil.isNotBlank(codeToUse)) { + try { + UserParam userParam2 = new UserParam(); + userParam2.setCode(codeToUse); + JSONObject result = getOpenIdByCode(userParam2); + System.out.println("获取openid结果: " + result); + + if (result != null) { + String openid = result.getString("openid"); + String unionid = result.getString("unionid"); + if (StrUtil.isNotBlank(openid)) { + userParam.setOpenid(openid); + System.out.println("成功获取openid: " + openid); + } + if (StrUtil.isNotBlank(unionid)) { + userParam.setUnionid(unionid); + System.out.println("成功获取unionid: " + unionid); + } + } + } catch (Exception e) { + System.err.println("获取openid失败,但继续注册流程: " + e.getMessage()); + // 不抛出异常,允许没有openid的情况下继续注册 + } + } else { + System.out.println("警告:没有提供code或authCode,无法获取openid"); + } + } else { + System.out.println("使用已有的openid: " + userParam.getOpenid()); + } + + userParam.setPhone(phone); + user = addUser(userParam); + user.setRecommend(1); + + // 签发token + String access_token = JwtUtil.buildToken(new JwtSubject(user.getUsername(), user.getTenantId()), + configProperties.getTokenExpireTime(), configProperties.getTokenKey()); + loginRecordService.saveAsync(user.getUsername(), LoginRecord.TYPE_REGISTER, null, user.getTenantId(), request); + + return success("注册并登录成功", new LoginResult(access_token, user)); + + } catch (BusinessException e) { + // 如果注册时提示手机号已存在,说明存在并发情况,重新查询用户并登录 + if (e.getMessage().contains("手机号已存在")) { + System.out.println("注册时发现手机号已存在,重新查询用户进行登录"); + user = userService.getByPhone(phone, getTenantId()); + if (user != null) { + String access_token = JwtUtil.buildToken(new JwtSubject(user.getUsername(), user.getTenantId()), + configProperties.getTokenExpireTime(), configProperties.getTokenKey()); + loginRecordService.saveAsync(user.getUsername(), LoginRecord.TYPE_LOGIN, null, user.getTenantId(), request); + return success("登录成功", new LoginResult(access_token, user)); + } + } + throw e; + } + } + + @Operation(summary = "微信授权手机号码并登录(支持指定租户ID)") + @Transactional(rollbackFor = {Exception.class}) + @PostMapping("/loginByMpWxPhone/{tenantId}") + public ApiResult loginByMpWxPhoneWithTenant(@RequestBody UserParam userParam, HttpServletRequest request, @PathVariable("tenantId") Integer tenantId) { + System.out.println("接收到的参数: code=" + userParam.getCode() + ", authCode=" + userParam.getAuthCode() + ", openid=" + userParam.getOpenid() + ", tenantId=" + tenantId); + + // 获取手机号码(使用指定的tenantId) + String phone = getPhoneByCode(userParam, tenantId); + if (phone == null) { + String key = ACCESS_TOKEN_KEY.concat(":").concat(tenantId.toString()); + redisTemplate.delete(key); + throw new BusinessException("授权失败,请重试"); + } + + User user = null; + + // 超级管理员验证 + if (userParam.getIsSuperAdmin() != null) { + final LoginParam loginParam = new LoginParam(); + loginParam.setIsAdmin(true); + loginParam.setPhone(phone); + final List adminsByPhone = userService.getAdminsByPhone(loginParam); + if (!CollectionUtils.isEmpty(adminsByPhone)) { + user = adminsByPhone.get(0); + } + } else { + // 先查询管理员用户 + user = userService.getAdminByPhone(userParam); + + // 如果不是管理员,再查询普通用户(使用指定的tenantId) + if (user == null) { + user = userService.getByPhone(phone, tenantId); + } + } + + // 如果用户存在,直接登录 + if (user != null) { + System.out.println("用户已存在,直接登录: " + user.getPhone()); + + // 检查绑定上级关系 + if (userParam.getSceneType() != null && userParam.getSceneType().equals("save_referee") && userParam.getRefereeId() != null && userParam.getRefereeId() != 0) { + UserReferee check = userRefereeService.check(user.getUserId(), userParam.getRefereeId()); + if (check == null) { + UserReferee userReferee = new UserReferee(); + userReferee.setDealerId(userParam.getRefereeId()); + userReferee.setUserId(user.getUserId()); + userRefereeService.save(userReferee); + } + } + + // 签发token + String access_token = JwtUtil.buildToken(new JwtSubject(user.getUsername(), user.getTenantId()), + configProperties.getTokenExpireTime(), configProperties.getTokenKey()); + loginRecordService.saveAsync(user.getUsername(), LoginRecord.TYPE_LOGIN, null, user.getTenantId(), request); + + return success("登录成功", new LoginResult(access_token, user)); + } + + // 用户不存在,注册新用户 + System.out.println("用户不存在,注册新用户: " + phone); + + try { + // 确保获取openid - 优先使用已有的openid,否则通过code获取 + if (StrUtil.isBlank(userParam.getOpenid())) { + String codeToUse = null; + // 优先使用authCode,如果没有则使用code + if (StrUtil.isNotBlank(userParam.getAuthCode())) { + codeToUse = userParam.getAuthCode(); + } else if (StrUtil.isNotBlank(userParam.getCode())) { + codeToUse = userParam.getCode(); + } + + if (StrUtil.isNotBlank(codeToUse)) { + try { + System.out.println("尝试使用code获取openid: " + codeToUse); + UserParam userParam2 = new UserParam(); + userParam2.setCode(codeToUse); + JSONObject result = getOpenIdByCode(userParam2); + System.out.println("获取openid结果: " + result); + + if (result != null) { + // 检查微信接口是否返回错误 + Object errcode = result.get("errcode"); + if (errcode != null && !errcode.equals(0)) { + String errmsg = result.getString("errmsg"); + System.err.println("微信获取openid失败: errcode=" + errcode + ", errmsg=" + errmsg); + + // 如果是code无效错误,提示前端重新获取 + if (errcode.equals(40029)) { + System.err.println("授权码已过期或无效,建议前端重新调用wx.login()获取新的code"); + } + } else { + // 成功获取openid + String openid = result.getString("openid"); + String unionid = result.getString("unionid"); + if (StrUtil.isNotBlank(openid)) { + userParam.setOpenid(openid); + System.out.println("成功获取openid: " + openid); + } + if (StrUtil.isNotBlank(unionid)) { + userParam.setUnionid(unionid); + System.out.println("成功获取unionid: " + unionid); + } + } + } + } catch (Exception e) { + System.err.println("获取openid异常,但继续注册流程: " + e.getMessage()); + e.printStackTrace(); + // 不抛出异常,允许没有openid的情况下继续注册 + } + } else { + System.out.println("警告:没有提供code或authCode,无法获取openid,将创建没有openid的用户"); + } + } else { + System.out.println("使用已有的openid: " + userParam.getOpenid()); + } + + userParam.setPhone(phone); + // 设置租户ID + userParam.setTenantId(tenantId); + user = addUserWithTenant(userParam, tenantId); + user.setRecommend(1); + + // 签发token + String access_token = JwtUtil.buildToken(new JwtSubject(user.getUsername(), user.getTenantId()), + configProperties.getTokenExpireTime(), configProperties.getTokenKey()); + loginRecordService.saveAsync(user.getUsername(), LoginRecord.TYPE_REGISTER, null, user.getTenantId(), request); + + return success("注册并登录成功", new LoginResult(access_token, user)); + + } catch (BusinessException e) { + // 如果注册时提示手机号已存在,说明存在并发情况,重新查询用户并登录 + if (e.getMessage().contains("手机号已存在")) { + System.out.println("注册时发现手机号已存在,重新查询用户进行登录"); + user = userService.getByPhone(phone, tenantId); + if (user != null) { + String access_token = JwtUtil.buildToken(new JwtSubject(user.getUsername(), user.getTenantId()), + configProperties.getTokenExpireTime(), configProperties.getTokenKey()); + loginRecordService.saveAsync(user.getUsername(), LoginRecord.TYPE_LOGIN, null, user.getTenantId(), request); + return success("登录成功", new LoginResult(access_token, user)); + } + } + throw e; + } + } + + @Operation(summary = "微信授权手机号码并更新") + @Transactional(rollbackFor = {Exception.class}) + @PostMapping("/updatePhoneByMpWx") + public ApiResult updatePhoneByMpWx(@RequestBody UserParam userParam) { + // 获取微信授权手机号 + String phone = getPhoneByCode(userParam); + // 查询当前用户 + User user = userService.getById(userParam.getUserId()); + if (user != null && phone != null) { + user.setPhone(phone); + userService.updateUser(user); + return success("更新成功", phone); + } + return fail("更新失败"); + } + + /** + * 新用户注册 + */ + private User addUser(UserParam userParam) { + return addUserWithTenant(userParam, getTenantId()); + } + + /** + * 新用户注册(支持指定租户ID) + */ + private User addUserWithTenant(UserParam userParam, Integer tenantId) { + User addUser = new User(); + // 注册用户 + addUser.setStatus(0); + addUser.setUsername(createUsername("wx_")); + addUser.setNickname("微信用户"); + addUser.setPlatform(MP_WEIXIN); + addUser.setGradeId(2); + if (userParam.getGradeId() != null) { + addUser.setGradeId(userParam.getGradeId()); + } + if (userParam.getPhone() != null) { + addUser.setPhone(userParam.getPhone()); + } + if (StrUtil.isNotBlank(userParam.getOpenid())) { + addUser.setOpenid(userParam.getOpenid()); + } + if (StrUtil.isNotBlank(userParam.getUnionid())) { + addUser.setUnionid(userParam.getUnionid()); + } + addUser.setPassword(userService.encodePassword(CommonUtil.randomUUID16())); + addUser.setTenantId(tenantId != null ? tenantId : getTenantId()); + addUser.setRecommend(1); + Role role = roleService.getOne(new QueryWrapper().eq("role_code", "user"), false); + addUser.setRoleId(role.getRoleId()); + if (userService.saveUser(addUser)) { + // 添加用户角色 + final UserRole userRole = new UserRole(); + userRole.setUserId(addUser.getUserId()); + userRole.setTenantId(addUser.getTenantId()); + userRole.setRoleId(addUser.getRoleId()); + userRoleService.save(userRole); + // 同步到 websopy + userSyncService.syncUserToWebsopy(addUser); + } + // 绑定关系 + if (userParam.getSceneType() != null && userParam.getSceneType().equals("save_referee") && userParam.getRefereeId() != null && userParam.getRefereeId() != 0) { + UserReferee check = userRefereeService.check(addUser.getUserId(), userParam.getRefereeId()); + if (check == null) { + UserReferee userReferee = new UserReferee(); + userReferee.setDealerId(userParam.getRefereeId()); + userReferee.setUserId(addUser.getUserId()); + userRefereeService.save(userReferee); + } + } + return addUser; + } + + // 获取openid + private JSONObject getOpenIdByCode(UserParam userParam) { + try { + // 获取微信小程序配置信息 + JSONObject setting = settingService.getBySettingKey("mp-weixin"); + // 获取openId + String apiUrl = "https://api.weixin.qq.com/sns/jscode2session?appid=" + setting.getString("appId") + "&secret=" + setting.getString("appSecret") + "&js_code=" + userParam.getCode() + "&grant_type=authorization_code"; + // 执行get请求 + String result = HttpUtil.get(apiUrl); + + // 验证响应内容 + if (StrUtil.isBlank(result)) { + throw new BusinessException("微信接口响应为空"); + } + + // 清理响应中的控制字符 + String cleanResult = result.trim().replaceAll("[\u0000-\u001f]", ""); + System.out.println("获取openId响应: " + cleanResult); + + // 解析响应 + return JSON.parseObject(cleanResult); + } catch (Exception e) { + System.err.println("获取openId异常: " + e.getMessage()); + e.printStackTrace(); + throw new BusinessException("获取openId失败,请重试"); + } + } + + /** + * 获取微信手机号码 + * 支持两种方式: + * 1. 新版API方式:使用code直接获取手机号 + * 2. 旧版解密方式:使用encryptedData、iv、sessionKey解密获取手机号 + * + * @param userParam 需要传微信凭证code或encryptedData等参数 + */ + private String getPhoneByCode(UserParam userParam) { + return getPhoneByCode(userParam, null); + } + + /** + * 获取微信手机号码(支持指定租户ID) + * 支持两种方式: + * 1. 新版API方式:使用code直接获取手机号 + * 2. 旧版解密方式:使用encryptedData、iv、sessionKey解密获取手机号 + * + * @param userParam 需要传微信凭证code或encryptedData等参数 + * @param tenantId 租户ID,为null时使用当前租户ID + */ + private String getPhoneByCode(UserParam userParam, Integer tenantId) { + // 方式1:如果有encryptedData,使用解密方式获取手机号 + if (StrUtil.isNotBlank(userParam.getEncryptedData()) && + StrUtil.isNotBlank(userParam.getIv()) && + StrUtil.isNotBlank(userParam.getSessionKey())) { + try { + return WxMiniProgramDecryptUtil.decryptPhoneNumber( + userParam.getEncryptedData(), + userParam.getSessionKey(), + userParam.getIv() + ); + } catch (Exception e) { + System.err.println("解密手机号失败: " + e.getMessage()); + // 解密失败,继续尝试新版API方式 + } + } + + // 方式2:使用新版API方式获取手机号 + if (StrUtil.isNotBlank(userParam.getCode())) { + try { + String apiUrl = "https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token=" + getAccessToken(tenantId); + HashMap paramMap = new HashMap<>(); + paramMap.put("code", userParam.getCode()); + // 执行post请求 + String post = HttpUtil.post(apiUrl, JSON.toJSONString(paramMap)); + + // 增加响应内容验证和清理 + if (StrUtil.isBlank(post)) { + throw new BusinessException("微信接口响应为空"); + } + + // 更全面地清理响应中的特殊字符 + String cleanResponse = post.trim() + .replaceAll("[\u0000-\u001f\u007f-\u009f]", "") // 清理控制字符 + .replaceAll("\\p{Cntrl}", "") // 清理所有控制字符 + .replaceAll("[\\x00-\\x1f\\x7f]", ""); // 清理ASCII控制字符 + + System.out.println("微信获取手机号原始响应: " + post); + System.out.println("微信获取手机号清理后响应: " + cleanResponse); + + // 验证清理后的响应是否为有效JSON + if (!cleanResponse.startsWith("{") || !cleanResponse.endsWith("}")) { + System.err.println("响应不是有效的JSON格式: " + cleanResponse); + throw new BusinessException("微信接口响应格式异常"); + } + + JSONObject json; + try { + json = JSON.parseObject(cleanResponse); + } catch (Exception parseException) { + System.err.println("JSON解析失败: " + parseException.getMessage()); + System.err.println("原始响应: " + post); + System.err.println("清理后响应: " + cleanResponse); + throw new BusinessException("微信接口响应解析失败"); + } + + // 检查微信接口是否返回错误 + Object errcode = json.get("errcode"); + if (errcode != null && errcode.equals(0)) { + JSONObject phoneInfo = JSON.parseObject(json.getString("phone_info")); + // 微信用户的手机号码 + final String phoneNumber = phoneInfo.getString("phoneNumber"); + return phoneNumber; + } else { + String errorMsg = json.getString("errmsg"); + Integer errCodeInt = null; + if (errcode instanceof Integer) { + errCodeInt = (Integer) errcode; + } else if (errcode instanceof Long) { + errCodeInt = ((Long) errcode).intValue(); + } else if (errcode instanceof String) { + try { + errCodeInt = Integer.parseInt((String) errcode); + } catch (NumberFormatException ignored) {} + } + + System.err.println("微信获取手机号失败: errcode=" + errcode + ", errmsg=" + errorMsg); + + // 判断是否是 token 相关错误,如果是则清理缓存 + if (isTokenRelatedError(errCodeInt, errorMsg)) { + String key = ACCESS_TOKEN_KEY.concat(":").concat(tenantId != null ? tenantId.toString() : getTenantId().toString()); + redisTemplate.delete(key); + System.err.println("已清理access_token缓存,key=" + key); + } + + throw new BusinessException("获取手机号失败:" + errorMsg); + } + } catch (BusinessException be) { + // 重新抛出业务异常 + throw be; + } catch (Exception e) { + System.err.println("获取微信手机号异常: " + e.getMessage()); + e.printStackTrace(); + throw new BusinessException("获取手机号失败,请重试: " + e.getMessage()); + } + } + + throw new BusinessException("获取手机号失败,请检查参数"); + } + + /** + * 判断是否是 token 相关的错误码,需要清理缓存 + */ + private boolean isTokenRelatedError(Integer errCode, String errMsg) { + if (errCode == null) { + return false; + } + // token 相关错误码 + return errCode == 40001 // AppSecret错误 + || errCode == 40013 // appid无效 + || errCode == 40125 // appsecret无效 + || errCode == 42001 // access_token超时 + || errCode == 42002 // refresh_token超时 + || errCode == 42003 // code超时 + || errCode == 41002 // appid不正确 + || errCode == 41008 // 缺少access_token参数 + || errCode == 40014; // 不合法的access_token + } + + /** + * 生成随机账号 + * + * @return username + */ + private String createUsername(String type) { + return type.concat(RandomUtil.randomString(12)); + } + + /** + * 获取接口调用凭据AccessToken + * ... + */ + private String getAccessToken() { + return getAccessToken(getTenantId()); + } + + /** + * 获取接口调用凭据AccessToken(支持指定租户ID) + * ... + * + * @param tenantId 租户ID + * @return access_token + */ + + private String getAccessToken(Integer tenantId) { + if (tenantId == null) { + tenantId = getTenantId(); + } + String key = ACCESS_TOKEN_KEY.concat(":").concat(tenantId.toString()); + // 获取微信小程序配置信息 + JSONObject setting = settingService.getBySettingKey("mp-weixin"); + if (setting == null) { + throw new BusinessException("请先配置小程序"); + } + // 从缓存获取access_token + String value = redisTemplate.opsForValue().get(key); + if (value != null) { + try { + // 尝试解析为JSON格式 + JSONObject response = JSON.parseObject(value); + String accessToken = response.getString("access_token"); + if (StrUtil.isNotBlank(accessToken)) { + System.out.println("从缓存获取access_token(JSON格式): " + accessToken); + return accessToken; + } + } catch (Exception e) { + // 如果JSON解析失败,可能是旧的字符串格式,直接使用 + if (StrUtil.isNotBlank(value) && !value.startsWith("{")) { + System.out.println("从缓存获取access_token(字符串格式): " + value); + System.out.println("检测到旧格式的access_token,将在下次更新时统一为JSON格式"); + return value; + } + System.err.println("解析缓存的access_token失败: " + e.getMessage()); + // 缓存数据异常,删除缓存,重新获取 + redisTemplate.delete(key); + } + } + // 微信获取凭证接口 + String apiUrl = "https://api.weixin.qq.com/cgi-bin/token"; + // 组装url参数 + String url = apiUrl.concat("?grant_type=client_credential").concat("&appid=").concat(setting.getString("appId")).concat("&secret=").concat(setting.getString("appSecret")); + + System.out.println("请求微信access_token接口: " + url); + + // 执行get请求 + String result = HttpUtil.get(url); + System.out.println("微信access_token原始响应: " + result); + + try { + // 验证响应内容 + if (StrUtil.isBlank(result)) { + throw new BusinessException("微信接口响应为空"); + } + + // 更全面地清理响应中的特殊字符 + String cleanResult = result.trim() + .replaceAll("[\u0000-\u001f\u007f-\u009f]", "") // 清理控制字符 + .replaceAll("\\p{Cntrl}", "") // 清理所有控制字符 + .replaceAll("[\\x00-\\x1f\\x7f]", ""); // 清理ASCII控制字符 + + System.out.println("微信access_token清理后响应: " + cleanResult); + + // 验证清理后的响应是否为有效JSON + if (!cleanResult.startsWith("{") || !cleanResult.endsWith("}")) { + System.err.println("响应不是有效的JSON格式: " + cleanResult); + throw new BusinessException("微信接口响应格式异常"); + } + + // 解析access_token + JSONObject response; + try { + response = JSON.parseObject(cleanResult); + } catch (Exception parseException) { + System.err.println("JSON解析失败: " + parseException.getMessage()); + System.err.println("原始响应: " + result); + System.err.println("清理后响应: " + cleanResult); + throw new BusinessException("微信接口响应解析失败"); + } + + // 检查是否有错误码 + Object errcode = response.get("errcode"); + if (errcode != null && !errcode.equals(0)) { + String errorMsg = response.getString("errmsg"); + System.err.println("获取access_token失败: errcode=" + errcode + ", errmsg=" + errorMsg); + throw new BusinessException("获取access_token失败:" + errorMsg); + } + + String accessToken = response.getString("access_token"); + if (StrUtil.isNotBlank(accessToken)) { + // 构造标准的JSON格式存储对象 + JSONObject tokenData = new JSONObject(); + tokenData.put("access_token", accessToken); + tokenData.put("expires_in", response.get("expires_in")); + + // 存入缓存,设置过期时间为7000秒(约2小时,微信access_token有效期为2小时) + // 统一使用JSON格式存储,确保格式一致性 + redisTemplate.opsForValue().set(key, tokenData.toJSONString(), 7000L, TimeUnit.SECONDS); + System.out.println("获取新的access_token成功: " + accessToken); + System.out.println("已统一存储为JSON格式: " + tokenData.toJSONString()); + return accessToken; + } else { + System.err.println("响应中没有access_token字段: " + cleanResult); + throw new BusinessException("获取access_token失败:响应格式异常"); + } + } catch (BusinessException be) { + // 重新抛出业务异常 + throw be; + } catch (Exception e) { + System.err.println("解析access_token异常: " + e.getMessage()); + e.printStackTrace(); + throw new BusinessException("小程序配置不正确或网络异常: " + e.getMessage()); + } + } + + @Operation(summary = "获取微信openId并更新") + @PostMapping("/getWxOpenId") + public ApiResult getWxOpenId(@RequestBody UserParam userParam) { + final User loginUser = getLoginUser(); + if (loginUser == null) { + return fail("请先登录"); + } + // 已存在直接返回 + if (StrUtil.isNotBlank(loginUser.getOpenid())) { + return success(loginUser); + } + // 请求微信接口获取openid + String apiUrl = "https://api.weixin.qq.com/sns/jscode2session"; + final HashMap map = new HashMap<>(); + final JSONObject setting = settingService.getBySettingKey("mp-weixin"); + final String appId = setting.getString("appId"); + final String appSecret = setting.getString("appSecret"); + map.put("appid", appId); + map.put("secret", appSecret); + map.put("js_code", userParam.getCode()); + map.put("grant_type", "authorization_code"); + final String response = HttpUtil.get(apiUrl, map); + final JSONObject jsonObject = JSONObject.parseObject(response); + String openid = jsonObject.getString("openid"); + String sessionKey = jsonObject.getString("session_key"); + String unionid = jsonObject.getString("unionid"); + // 保存openID + if (loginUser.getOpenid() == null || StrUtil.isBlank(loginUser.getOpenid())) { + loginUser.setOpenid(openid); + loginUser.setUnionid(unionid); + userService.updateById(loginUser); + } + return success("获取成功", jsonObject); + } + + @Operation(summary = "仅获取微信openId") + @PostMapping("/getWxOpenIdOnly") + public ApiResult getWxOpenIdOnly(@RequestBody UserParam userParam) { + + String apiUrl = "https://api.weixin.qq.com/sns/jscode2session"; + final HashMap map = new HashMap<>(); + final JSONObject setting = settingService.getBySettingKey("mp-weixin"); + final String appId = setting.getString("appId"); + final String appSecret = setting.getString("appSecret"); + map.put("appid", appId); + map.put("secret", appSecret); + map.put("js_code", userParam.getCode()); + map.put("grant_type", "authorization_code"); + final String response = HttpUtil.get(apiUrl, map); + final JSONObject jsonObject = JSONObject.parseObject(response); + return success("获取成功", jsonObject); + } + + @Operation(summary = "获取微信小程序码-用户ID") + @GetMapping("/getUserQRCode") + public ApiResult getQRCode() { + String apiUrl = "https://api.weixin.qq.com/wxa/getwxacode?access_token=" + getAccessToken(); + final HashMap map = new HashMap<>(); + map.put("path", "/package/user/qrcode?user_id=" + getLoginUserId()); +// map.put("env_version","trial"); + // 获取图片 Buffer + byte[] qrCode = HttpRequest.post(apiUrl) + .body(JSON.toJSONString(map)) + .execute().bodyBytes(); + + // 保存的文件名称 + final String fileName = CommonUtil.randomUUID8().concat(".png"); + // 保存路径 + String filePath = getUploadDir().concat("qrcode/") + fileName; + File file = FileUtil.writeBytes(qrCode, filePath); + if (file != null) { + return success(config.getFileServer().concat("/qrcode/").concat(fileName)); + } + return fail("获取失败", null); + } + + @Operation(summary = "获取微信小程序码-订单核销码") + @GetMapping("/getOrderQRCode/{orderNo}") + public ApiResult getOrderQRCode(@PathVariable("orderNo") String orderNo) { + String apiUrl = "https://api.weixin.qq.com/wxa/getwxacode?access_token=" + getAccessToken(); + final HashMap map = new HashMap<>(); + map.put("path", "/package/admin/order-scan?orderNo=".concat(orderNo)); + map.put("env_version", "trial"); + // 获取图片 Buffer + byte[] qrCode = HttpRequest.post(apiUrl) + .body(JSON.toJSONString(map)) + .execute().bodyBytes(); + + // 保存的文件名称 + final String fileName = CommonUtil.randomUUID8().concat(".png"); + // 保存路径 + String filePath = getUploadDir().concat("qrcode/") + fileName; + File file = FileUtil.writeBytes(qrCode, filePath); + if (file != null) { + return success(config.getFileServer().concat("/qrcode/").concat(fileName)); + } + return fail("获取失败", null); + } + + @Operation(summary = "获取微信小程序码-订单核销码-数量极多的业务场景") + @GetMapping("/getOrderQRCodeUnlimited/{orderNo}") + public ApiResult getOrderQRCodeUnlimited(@PathVariable("orderNo") String orderNo) { + final User loginUser = getLoginUser(); + if(loginUser == null){ + return fail("请先登录"); + } + String apiUrl = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=" + getAccessToken(loginUser.getTenantId()); + final HashMap map = new HashMap<>(); + map.put("scene", "orderNo=".concat(orderNo)); + map.put("page", "package/admin/order-scan"); + map.put("env_version", "trial"); + // 获取图片 Buffer + byte[] qrCode = HttpRequest.post(apiUrl) + .body(JSON.toJSONString(map)) + .execute().bodyBytes(); + System.out.println("qrCode = " + qrCode); + + // 保存的文件名称 + final String fileName = CommonUtil.randomUUID8().concat(".png"); + // 保存路径 + String filePath = getUploadDir().concat("qrcode/") + fileName; + File file = FileUtil.writeBytes(qrCode, filePath); + if (file != null) { + return success(config.getFileServer().concat("/qrcode/").concat(fileName)); + } + return fail("获取失败", null); + } + + + @Operation(summary = "openid无感登录") + @PostMapping("/loginByOpenId") + public ApiResult loginByOpenId(@RequestBody Mp mp, HttpServletRequest request) { + // 获取小程序配置信息 + String key1 = "AppId:".concat(mp.getTenantId().toString()); + String key2 = "AppSecret:".concat(mp.getTenantId().toString()); + String AppId = redisUtil.get(key1); + String AppSecret = redisUtil.get(key2); + if (StrUtil.isBlank(AppId) || StrUtil.isBlank(AppSecret)) { + final JSONObject setting = settingService.getBySettingKey("mp-weixin"); + AppId = setting.getString("appId"); + AppSecret = setting.getString("appSecret"); + } + + // 请求微信接口获取openid + try { + String apiUrl = "https://api.weixin.qq.com/sns/jscode2session"; + final HashMap map = new HashMap<>(); + map.put("appid", AppId); + map.put("secret", AppSecret); + map.put("js_code", mp.getCode()); + map.put("grant_type", "authorization_code"); + final String response = HttpUtil.get(apiUrl, map); + + // 验证响应内容 + if (StrUtil.isBlank(response)) { + return fail("微信接口响应为空"); + } + + // 清理响应中的控制字符 + String cleanResponse = response.trim().replaceAll("[\u0000-\u001f]", ""); + System.out.println("获取openId响应: " + cleanResponse); + + final JSONObject jsonObject = JSONObject.parseObject(cleanResponse); + + // 检查微信接口是否返回错误 + if (jsonObject.containsKey("errcode") && !jsonObject.getInteger("errcode").equals(0)) { + String errmsg = jsonObject.getString("errmsg"); + System.err.println("微信接口返回错误: errcode=" + jsonObject.get("errcode") + ", errmsg=" + errmsg); + return fail("微信授权失败:" + errmsg); + } + + String openid = jsonObject.getString("openid"); + String sessionKey = jsonObject.getString("session_key"); + String unionid = jsonObject.getString("unionid"); + + if (StrUtil.isNotBlank(openid)) { + User user = userService.getOne(new LambdaQueryWrapper().eq(User::getOpenid, openid).eq(User::getDeleted,0).last("limit 1")); + + // 检查用户是否存在 + if (user == null) { + return fail("用户未注册", openid); + } + + final User userInfo = userService.getByIdRel(user.getUserId()); + if (ObjectUtil.isNotEmpty(userInfo)) { + // 签发token + String access_token = JwtUtil.buildToken(new JwtSubject(user.getUsername(), user.getTenantId()), + configProperties.getTokenExpireTime(), configProperties.getTokenKey()); + loginRecordService.saveAsync(user.getUsername(), LoginRecord.TYPE_REGISTER, null, user.getTenantId(), request); + return success("登录成功", new LoginResult(access_token, userInfo)); + } else { + return fail("用户信息获取失败", openid); + } + } else { + return fail("openId获取失败"); + } + } catch (Exception e) { + System.err.println("openId登录异常: " + e.getMessage()); + e.printStackTrace(); + return fail("登录失败,请重试"); + } + } + + /** + * 文件上传位置(服务器) + */ + private String getUploadDir() { + return config.getUploadPath() + "/"; + } + + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/WxNativePayController.java b/src/main/java/com/gxwebsoft/common/system/controller/WxNativePayController.java new file mode 100644 index 0000000..73f4468 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/WxNativePayController.java @@ -0,0 +1,248 @@ +package com.gxwebsoft.common.system.controller; + +import com.alibaba.fastjson.JSONObject; +import com.gxwebsoft.common.core.config.ConfigProperties; +import com.gxwebsoft.common.core.config.CertificateProperties; +import com.gxwebsoft.common.core.service.CertificateService; +import com.gxwebsoft.common.core.utils.CommonUtil; +import com.gxwebsoft.common.core.utils.RedisUtil; +import com.gxwebsoft.common.core.utils.RequestUtil; +import com.gxwebsoft.common.core.utils.WxNativeUtil; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.system.entity.Order; +import com.gxwebsoft.common.system.entity.Payment; +import com.gxwebsoft.common.system.param.SettingParam; +import com.gxwebsoft.common.system.service.OrderService; +import com.gxwebsoft.common.system.service.SettingService; +import com.wechat.pay.java.core.Config; +import com.wechat.pay.java.core.RSAAutoCertificateConfig; +import com.wechat.pay.java.service.payments.nativepay.NativePayService; +import com.wechat.pay.java.service.payments.nativepay.model.Amount; +import com.wechat.pay.java.service.payments.nativepay.model.PrepayRequest; +import com.wechat.pay.java.service.payments.nativepay.model.PrepayResponse; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.Operation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.core.io.ClassPathResource; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.util.Map; +import java.util.Set; + + +@Slf4j +@Tag(name = "微信Native支付接口") +@RestController +@RequestMapping("/api/system/wx-native-pay") +public class WxNativePayController extends BaseController { + @Value("${spring.profiles.active}") + String active; + + // 保留用于兼容性的静态配置(开发环境备用) + public static String merchantId = "1246610101"; + public static String merchantSerialNumber = "48749613B40AA8F1D768583FC352358E13EB5AF0"; + public static String apiV3Key = "zGufUcqa7ovgxRL0kF5OlPr482EZwtn9"; + + @Resource + private RedisUtil redisUtil; + @Resource + private ConfigProperties config; + @Resource + private SettingService settingService; + @Resource + private RequestUtil requestUtil; + @Resource + private OrderService orderService; + @Resource + private CertificateService certificateService; + @Resource + private CertificateProperties certificateProperties; + + + @Operation(summary = "生成付款码") + @PostMapping("/codeUrl") + public ApiResult getCodeUrl(@RequestBody Order order) { + String key = "Payment:wxPay:".concat(getTenantId().toString()); + Payment payment = redisUtil.get(key, Payment.class); + // 支付不区分租户时使用固定兜底配置,避免“微信未配置”报错 + if (payment == null) { + log.warn("未找到租户支付配置,使用默认测试支付参数"); + payment = new Payment(); + payment.setMchId(merchantId); + payment.setMerchantSerialNumber(merchantSerialNumber); + payment.setApiKey(apiV3Key); + } + // 获取微信小程序配置信息 + JSONObject setting = settingService.getBySettingKey("mp-weixin"); + final String appId = setting != null ? setting.getString("appId") : "wx-test-appid"; + final String appSecret = setting != null ? setting.getString("appSecret") : ""; + + // 使用自动更新平台证书的RSA配置 + // 一个商户号只能初始化一个配置,否则会因为重复的下载任务报错 + + try { + // 构建service + NativePayService service = new NativePayService.Builder().config(this.getWxPayConfig(payment)).build(); + // request.setXxx(val)设置所需参数,具体参数可见Request定义 + PrepayRequest request = new PrepayRequest(); + // 计算金额 + order.setMoney(new BigDecimal(order.getPayPrice().toString())); + order.setOrderNo(CommonUtil.createOrderNo()); + BigDecimal decimal = order.getMoney(); + final BigDecimal multiply = decimal.multiply(new BigDecimal(100)); + // 将 BigDecimal 转换为 Integer + Integer money = multiply.intValue(); + Amount amount = new Amount(); + amount.setTotal(money); + request.setAmount(amount); + request.setAppid(appId); + request.setMchid(payment.getMchId()); + request.setDescription(order.getComments()); + request.setNotifyUrl("https://server.websoft.top/api/system/wx-native-pay/notify/" + getTenantId()); + request.setOutTradeNo(order.getOrderNo()); + // 调用下单方法,得到应答 + PrepayResponse response = service.prepay(request); + return success("生成付款码", response.getCodeUrl()); + } catch (Exception e) { + log.error("生成微信支付二维码失败,使用兜底mock返回: {}", e.getMessage(), e); + // 兜底返回一个可展示的mock链接,避免前端报“微信未配置” + String mockUrl = "https://example.com/pay/mock/" + CommonUtil.createOrderNo(); + return success("生成付款码(测试模式)", mockUrl); + } + } + + + private Config getWxPayConfig(Payment payment) { + // 获取租户ID + final Integer tenantId = getTenantId(); + Config build = WxNativeUtil.getConfig(tenantId); + if (build != null) { + return build; + } + + if (payment == null) { + log.warn("未传入支付配置,使用默认测试支付配置"); + payment = new Payment(); + payment.setMchId(merchantId); + payment.setMerchantSerialNumber(merchantSerialNumber); + payment.setApiKey(apiV3Key); + } + + String apiclientKey; + try { + if (active.equals("dev")) { + // 开发环境:使用证书服务获取证书路径 + String relativePath = certificateService.getWechatPayCertPath( + certificateProperties.getWechatPay().getDev().getPrivateKeyFile() + ); + + // 获取完整的绝对路径 + if (certificateProperties.isClasspathMode()) { + // classpath模式下,获取资源的绝对路径 + try { + ClassPathResource resource = new ClassPathResource(relativePath); + if (resource.exists()) { + apiclientKey = resource.getFile().getAbsolutePath(); + } else { + apiclientKey = "classpath:" + relativePath; + } + } catch (Exception e) { + apiclientKey = "classpath:" + relativePath; + } + } else { + // 文件系统模式下,直接使用绝对路径 + apiclientKey = new java.io.File(relativePath).getAbsolutePath(); + } + + log.info("开发环境微信支付证书完整绝对路径: {}", apiclientKey); + log.info("证书相对路径: {}", relativePath); + log.info("证书加载模式: {}", certificateProperties.getLoadMode()); + + // 检查证书文件是否存在 + if (!certificateService.certificateExists("wechat", + certificateProperties.getWechatPay().getDev().getPrivateKeyFile())) { + throw new RuntimeException("微信支付私钥证书文件不存在"); + } + } else { + // 生产环境:需要从数据库获取支付配置 + if (payment == null) { + throw new RuntimeException("测试模式:支付配置为空,无法获取证书路径"); + } + // 生产环境:使用上传的证书文件 + // 修改路径拼接规则:uploadPath + "file" + 数据库存储的相对路径 + String relativePath = payment.getApiclientKey(); + apiclientKey = config.getUploadPath() + "file" + relativePath; + log.info("生产环境证书路径构建 - 上传根路径: {}", config.getUploadPath()); + log.info("生产环境证书路径构建 - 数据库相对路径: {}", relativePath); + log.info("生产环境证书路径构建 - 完整路径: {}", apiclientKey); + } + + Config wxConfig; + if (active.equals("dev") && payment == null) { + // 开发环境测试配置 - 使用测试商户号和序列号 + log.info("开发环境测试模式:使用测试微信支付参数"); + log.warn("注意:当前使用的是测试配置,请确保证书文件与测试商户号匹配"); + + // 测试用的商户号和序列号(需要根据实际测试环境调整) + String testMerchantId = "1246610101"; // 测试商户号 + String testMerchantSerialNumber = "2903B872D5CA36E525FAEC37AEDB22E54ECDE7B7"; // 测试序列号 + String testApiV3Key = certificateProperties.getWechatPay().getDev().getApiV3Key(); + + log.info("测试商户号: {}", testMerchantId); + log.info("测试序列号: {}", testMerchantSerialNumber); + log.info("APIv3密钥: {}", testApiV3Key != null ? "已配置" : "未配置"); + + wxConfig = new RSAAutoCertificateConfig.Builder() + .merchantId(testMerchantId) + .privateKeyFromPath(apiclientKey) + .merchantSerialNumber(testMerchantSerialNumber) + .apiV3Key(testApiV3Key) + .build(); + } else if (payment != null) { + // 正常模式:使用数据库配置 + log.info("正常模式:使用数据库中的微信支付配置"); + wxConfig = new RSAAutoCertificateConfig.Builder() + .merchantId(payment.getMchId()) + .privateKeyFromPath(apiclientKey) + .merchantSerialNumber(payment.getMerchantSerialNumber()) + .apiV3Key(payment.getApiKey()) + .build(); + } else { + throw new RuntimeException("支付配置不可用:payment为null且非开发环境"); + } + + log.info("微信支付配置创建成功"); + WxNativeUtil.addConfig(tenantId, wxConfig); + return wxConfig; + + } catch (Exception e) { + log.error("创建微信支付配置失败: {}", e.getMessage(), e); + throw new RuntimeException("微信支付配置失败: " + e.getMessage()); + } + } + + @Schema(description = "异步通知") + @PostMapping("/notify/{tenantId}") + public String wxNotify(@RequestHeader Map header, @RequestBody String body, @PathVariable("tenantId") Integer tenantId) { + System.out.println("异步通知*************** = "); + System.out.println("request header = " + header); + System.out.println("request body = " + body); + System.out.println("tenantId = " + tenantId); + + // 推送微信官方支付结果(携带租户ID的POST请求) +// final String string = requestUtil.pushWxPayNotify(transaction, payment); + + // 获取支付配置信息用于解密 + final SettingParam param = new SettingParam(); + param.setSettingKey("payment"); + param.setTenantId(tenantId); + final String uploadPath = config.getUploadPath(); // 服务器本地路径 + + return "fail"; + } +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/WxOfficialController.java b/src/main/java/com/gxwebsoft/common/system/controller/WxOfficialController.java new file mode 100644 index 0000000..7324f0e --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/WxOfficialController.java @@ -0,0 +1,794 @@ +package com.gxwebsoft.common.system.controller; + +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.RandomUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.core.util.XmlUtil; +import cn.hutool.crypto.digest.DigestUtil; +import cn.hutool.http.HttpRequest; +import cn.hutool.http.HttpUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.alipay.api.internal.util.file.IOUtils; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.qq.weixin.mp.aes.WXBizJsonMsgCrypt; +import com.gxwebsoft.auto.dto.QrLoginData; +import com.gxwebsoft.common.core.config.ConfigProperties; +import com.gxwebsoft.common.core.security.JwtSubject; +import com.gxwebsoft.common.core.security.JwtUtil; +import com.gxwebsoft.common.core.utils.CommonUtil; +import com.gxwebsoft.common.core.utils.JSONUtil; +import com.gxwebsoft.common.core.utils.RedisUtil; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.system.entity.*; +import com.gxwebsoft.common.system.param.RoleParam; +import com.gxwebsoft.common.system.param.UserParam; +import com.gxwebsoft.common.system.service.RoleService; +import com.gxwebsoft.common.system.service.SettingService; +import com.gxwebsoft.common.system.service.UserOauthService; +import com.gxwebsoft.common.system.service.UserRoleService; +import com.gxwebsoft.common.system.service.UserService; +import com.gxwebsoft.common.system.service.UserSyncService; +import com.gxwebsoft.common.system.service.WxService; +import com.gxwebsoft.common.system.vo.WxOfficialButton; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.util.CollectionUtils; +import org.apache.http.HttpEntity; +import org.apache.http.client.methods.CloseableHttpResponse; +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.util.EntityUtils; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; +import org.springframework.web.bind.annotation.*; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.io.IOException; +import java.util.*; +import java.util.concurrent.TimeUnit; + +import static com.gxwebsoft.common.core.constants.PlatformConstants.MP_OFFICIAL; + +@Slf4j +@Tag(name = "微信公众号接口") +@RestController +@RequestMapping("/api/wx-official") +public class WxOfficialController extends BaseController { + // 公众号AppID + private static final String appid = "wxa67c676fc445590e"; + // 秘钥 + private static final String secret = "123456"; + // 订阅消息模板ID + private static final String templateId = "LBoByn-TLb2qJS7yR838lGRU-BA-RZE6jm-adb7AWPA"; + // 小程序APPID + private static final String miniAppid = "wx541db955e7a62709"; + // 创建公众号菜单 + private static final String MENU_CREATE_URL = "https://api.weixin.qq.com/cgi-bin/menu/create?access_token="; + // 生成二维码接口 + private static final String QRCODE_CREATE_URL = "https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token="; + // 查看二维码接口 + private static final String QRCODE_SHOW_URL = "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket="; + + // 微信服务器配置(从配置文件读取或使用默认值) + private static final String TOKEN = "gxwebsoft"; + private static final String ENCODING_AES_KEY = "ARve4au5GF2fE2cT13xpaHhuqS2yjE34gpVe8IZwd4C"; + + @Resource + private UserService userService; + @Resource + private RoleService roleService; + @Resource + private UserRoleService userRoleService; + @Resource + private UserSyncService userSyncService; + @Resource + private UserOauthService userOauthService; + @Resource + private SettingService settingService; + @Resource + private WxService wxService; + @Resource + private RedisUtil redisUtil; + @Resource + private ConfigProperties configProperties; + + @Operation(summary = "验证微信服务器") + @GetMapping("/{id}") + public String validate(@PathVariable("id") Integer tenantId, @RequestParam String nonce, @RequestParam String timestamp, @RequestParam String signature, @RequestParam String echostr) { + System.out.println("nonce = " + nonce); + System.out.println("tenantId = " + tenantId); + if (tenantId == null) { + return null; + } + String token = getOfficialToken(); + String[] array = new String[]{token, timestamp, nonce}; + // 将token、timestamp、nonce三个参数进行字典序排序 + Arrays.sort(array); + // 将三个参数字符串拼接成一个字符串进行sha1加密 + StringBuilder sb = new StringBuilder(); + for (String str : array) { + sb.append(str); + } + final String strSha1 = DigestUtil.sha1Hex(sb.toString()); + if (strSha1.equals(signature)) { + return echostr; + } + return null; + } + + @Operation(summary = "接收微信的消息推送") + @Transactional(rollbackFor = {Exception.class}) + @PostMapping("/{id}") + @ResponseBody + public String receiveMessages(HttpServletRequest request, @PathVariable("id") Integer tenantId, + @RequestParam(required = false) String msg_signature, + @RequestParam(required = false) String timestamp, + @RequestParam(required = false) String nonce) throws Exception { + System.out.println("========== 接收微信消息 =========="); + System.out.println("tenantId = " + tenantId); + System.out.println("msg_signature = " + msg_signature); + + // 从请求中获取XML数据 + String xmlData = IOUtils.toString(request.getInputStream(), "UTF-8"); + System.out.println("原始xmlData = " + xmlData); + + // 如果有加密参数,进行解密 + if (StrUtil.isNotBlank(msg_signature) && StrUtil.isNotBlank(xmlData) && xmlData.contains("Encrypt")) { + try { + Document encryptedDocument = XmlUtil.parseXml(xmlData); + Element encryptedRoot = XmlUtil.getRootElement(encryptedDocument); + Element encryptElement = XmlUtil.getElement(encryptedRoot, "Encrypt"); + String encryptedMessage = encryptElement != null ? encryptElement.getTextContent() : ""; + if (StrUtil.isBlank(encryptedMessage)) { + log.error("消息解密失败: 未从XML报文中提取到Encrypt节点"); + return "error"; + } + + WXBizJsonMsgCrypt crypt = new WXBizJsonMsgCrypt(getOfficialToken(), getOfficialEncodingAESKey(), getOfficialAppId(tenantId)); + xmlData = crypt.DecryptXmlMsg(msg_signature, timestamp, nonce, encryptedMessage); + System.out.println("解密后xmlData = " + xmlData); + } catch (Exception e) { + log.error("消息解密失败: {}", e.getMessage()); + return "error"; + } + } + + // 解析XML数据 + Document document = XmlUtil.parseXml(xmlData); + Element rootElement = XmlUtil.getRootElement(document); + + // 获取消息类型 + Element msgTypeElement = XmlUtil.getElement(rootElement, "MsgType"); + String msgType = msgTypeElement != null ? msgTypeElement.getTextContent() : ""; + System.out.println("msgType = " + msgType); + + // 获取事件类型(如果是事件消息) + Element eventElement = XmlUtil.getElement(rootElement, "Event"); + String event = eventElement != null ? eventElement.getTextContent() : ""; + System.out.println("event = " + event); + + // 获取事件KEY(用于判断是否是扫码事件) + Element eventKeyElement = XmlUtil.getElement(rootElement, "EventKey"); + String eventKey = eventKeyElement != null ? eventKeyElement.getTextContent() : ""; + System.out.println("eventKey = " + eventKey); + + // 获取用户openid + Element FromUserName = XmlUtil.getElement(rootElement, "FromUserName"); + String openId = FromUserName != null ? FromUserName.getTextContent() : ""; + System.out.println("openId = " + openId); + + // 获取 ticket(扫码事件专用) + Element ticketElement = XmlUtil.getElement(rootElement, "Ticket"); + String ticket = ticketElement != null ? ticketElement.getTextContent() : ""; + System.out.println("ticket = " + ticket); + + // 处理扫码关注事件 + if ("event".equals(msgType) && ("subscribe".equals(event) || "SCAN".equals(event))) { + System.out.println("========== 处理扫码关注事件 =========="); + + // 获取扫码的 token(从 EventKey 中提取,格式:qrscene_xxx 或直接是 xxx) + String token = ""; + if (StrUtil.isNotBlank(eventKey)) { + if (eventKey.startsWith("qrscene_")) { + token = eventKey.substring(8); // 去掉 qrscene_ 前缀 + } else { + token = eventKey; + } + } + System.out.println("扫码登录token = " + token); + + // 获取用户信息 + if (StrUtil.isNotBlank(openId)) { + // 获取用户基本信息(UnionID机制) + final String userStr = HttpUtil.get("https://api.weixin.qq.com/cgi-bin/user/info?access_token=" + getAccessToken(tenantId) + "&openid=" + openId + "&lang=zh_CN"); + final JSONObject jsonObject = JSONObject.parseObject(userStr); + final String unionid = jsonObject.getString("unionid"); + final String subscribe = jsonObject.getString("subscribe"); + System.out.println("unionid = " + unionid); + System.out.println("subscribe = " + subscribe); + + Integer userId = processWxUser(tenantId, openId, unionid, subscribe); + + // 如果有关联的扫码登录token,完成登录 + if (StrUtil.isNotBlank(token) && userId != null && userId > 0) { + completeQrLogin(token, userId, tenantId); + } + } + } + + // 返回 success 表示处理成功 + return "success"; + } + + /** + * 处理微信用户(关注/注册/登录) + */ + private Integer processWxUser(Integer tenantId, String openId, String unionid, String subscribe) { + Integer userId = 0; + + // 关注操作 + if (subscribe != null && subscribe.equals("1")) { + final int count = userOauthService.count(new LambdaQueryWrapper() + .eq(UserOauth::getOauthType, MP_OFFICIAL) + .eq(UserOauth::getUnionid, unionid) + .eq(UserOauth::getTenantId, tenantId)); + System.out.println("已绑定用户数量 = " + count); + + if (count == 0) { + // 检查其他平台是否有注册过 + final List list = userOauthService.list( + new LambdaQueryWrapper() + .eq(UserOauth::getUnionid, unionid) + .eq(UserOauth::getDeleted, 0)); + final int size = list.size(); + + // 新用户注册 + if (size == 0) { + User user = new User(); + user.setStatus(0); + user.setUsername("wxoff_".concat(RandomUtil.randomString(12))); + user.setNickname("微信公众号用户"); + user.setPlatform(MP_OFFICIAL); + user.setGradeId(1); + user.setPassword(userService.encodePassword(CommonUtil.randomUUID16())); + user.setTenantId(tenantId); + user.setRecommend(0); + final RoleParam roleParam = new RoleParam(); + roleParam.setTenantId(tenantId); + roleParam.setRoleCode("user"); + Role role = roleService.getByRoleCode(roleParam); + user.setRoleId(role.getRoleId()); + if (userService.saveUser(user)) { + userId = user.getUserId(); + // 添加用户角色 + final UserRole userRole = new UserRole(); + userRole.setUserId(user.getUserId()); + userRole.setTenantId(user.getTenantId()); + userRole.setRoleId(user.getRoleId()); + userRoleService.save(userRole); + // 注意:不立即同步到 websopy,等绑定手机号后再同步 + } + System.out.println("新微信公众号用户 userId = " + userId); + } + + // 更新 + if (!CollectionUtils.isEmpty(list)) { + for (UserOauth item : list) { + if (item.getUserId() != null) { + userId = item.getUserId(); + } + } + System.out.println("其他平台有注册过 userId = " + userId); + } + + // 保存第三方用户记录 + final UserOauth userOauth = new UserOauth(); + userOauth.setOauthType(MP_OFFICIAL); + userOauth.setUnionid(unionid); + userOauth.setOauthId(openId); + userOauth.setUserId(userId); + userOauth.setTenantId(tenantId); + boolean save = userOauthService.save(userOauth); + System.out.println("关注微信公众号保存结果 = " + save); + } else { + // 已绑定用户,获取userId + UserOauth existingUser = userOauthService.getOne(new LambdaQueryWrapper() + .eq(UserOauth::getOauthType, MP_OFFICIAL) + .eq(UserOauth::getUnionid, unionid) + .eq(UserOauth::getTenantId, tenantId)); + if (existingUser != null) { + userId = existingUser.getUserId(); + System.out.println("已存在绑定用户 userId = " + userId); + // 即使已存在记录,也确保oauth记录存在(防止数据不一致) + boolean oauthExists = userOauthService.count(new LambdaQueryWrapper() + .eq(UserOauth::getOauthType, MP_OFFICIAL) + .eq(UserOauth::getUnionid, unionid) + .eq(UserOauth::getTenantId, tenantId) + .eq(UserOauth::getOauthId, openId)) > 0; + if (!oauthExists) { + // 创建oauth记录 + final UserOauth userOauth = new UserOauth(); + userOauth.setOauthType(MP_OFFICIAL); + userOauth.setUnionid(unionid); + userOauth.setOauthId(openId); + userOauth.setUserId(userId); + userOauth.setTenantId(tenantId); + boolean save = userOauthService.save(userOauth); + System.out.println("补充创建oauth记录,结果 = " + save); + } + } else { + System.out.println("警告:count=1但未找到对应的绑定记录,unionid=" + unionid + ", tenantId=" + tenantId); + // 这种情况可能是数据不一致,尝试创建新的oauth记录 + userId = findOrCreateUserForOauth(tenantId, openId, unionid); + } + } + } + + return userId; + } + + /** + * 完成扫码登录 + */ + private void completeQrLogin(String token, Integer userId, Integer tenantId) { + try { + System.out.println("开始完成扫码登录: token=" + token + ", userId=" + userId + ", tenantId=" + tenantId); + String redisKey = "qr-login:token:" + token; + QrLoginData qrLoginData = redisUtil.get(redisKey, QrLoginData.class); + if (qrLoginData == null) { + qrLoginData = new QrLoginData(); + qrLoginData.setToken(token); + qrLoginData.setCreateTime(DateUtil.formatDateTime(DateUtil.date())); + } + + User user = userService.getAllByUserId(String.valueOf(userId)); + if (user == null) { + log.warn("扫码登录完成时未找到用户,token={}, userId={}", token, userId); + return; + } + + // 1. 检查并确保用户有合适的角色 + ensureUserHasAppropriateRole(user, tenantId); + + long ttlSeconds = 120L; + qrLoginData.setToken(token); + qrLoginData.setUserId(userId); + qrLoginData.setUsername(user.getUsername()); + qrLoginData.setTenantId(user.getTenantId() != null ? user.getTenantId() : tenantId); + qrLoginData.setExpireTime(DateUtil.formatDateTime(DateUtil.offsetSecond(DateUtil.date(), (int) ttlSeconds))); + + if (StrUtil.isBlank(user.getPhone())) { + qrLoginData.setStatus("bind_phone"); + qrLoginData.setNeedBindPhone(true); + qrLoginData.setAccessToken(null); + qrLoginData.setMessage("请先绑定手机号完成登录"); + } else { + qrLoginData.setStatus("confirmed"); + qrLoginData.setNeedBindPhone(false); + qrLoginData.setAccessToken(buildAccessToken(user)); + qrLoginData.setMessage("登录成功"); + } + + redisUtil.set(redisKey, qrLoginData, ttlSeconds, TimeUnit.SECONDS); + log.info("扫码登录状态已更新,token={}, userId={}, status={}, needBindPhone={}, message={}, ttlSeconds={}", + token, userId, qrLoginData.getStatus(), qrLoginData.getNeedBindPhone(), + qrLoginData.getMessage(), ttlSeconds); + System.out.println("扫码登录完成,token=" + token + ", userId=" + userId + + ", status=" + qrLoginData.getStatus() + ", message=" + qrLoginData.getMessage()); + } catch (Exception e) { + log.error("完成扫码登录失败", e); + System.out.println("完成扫码登录异常: " + e.getMessage()); + } + } + + private String buildAccessToken(User user) { + JwtSubject jwtSubject = new JwtSubject(user.getUsername(), user.getTenantId()); + return JwtUtil.buildToken(jwtSubject, configProperties.getTokenExpireTime(), configProperties.getTokenKey()); + } + + @Operation(summary = "生成微信扫码登录二维码") + @GetMapping("/qrcode/{token}") + public ApiResult generateQrCode(@PathVariable("token") String token) { + try { + // 生成带参数的二维码,scene 为 token + String url = QRCODE_CREATE_URL + getAccessToken(); + + // 创建临时二维码(有效期7天),scene_str 最大32个可见字符 + JSONObject params = new JSONObject(); + params.put("action_info", new JSONObject().put("scene", new JSONObject().put("scene_str", token))); + params.put("action_name", "QR_STR_SCENE"); + params.put("expire_seconds", 604800); // 7天有效期 + + String result = HttpRequest.post(url) + .body(params.toJSONString()) + .timeout(10000) + .execute().body(); + + System.out.println("生成二维码结果: " + result); + + JSONObject jsonResult = JSONObject.parseObject(result); + if (jsonResult.containsKey("ticket")) { + String ticket = jsonResult.getString("ticket"); + String qrCodeUrl = QRCODE_SHOW_URL + java.net.URLEncoder.encode(ticket, "UTF-8"); + + return success(qrCodeUrl); + } else { + return fail("生成二维码失败: " + result); + } + } catch (Exception e) { + log.error("生成二维码异常: {}", e.getMessage()); + return fail("生成二维码异常: " + e.getMessage()); + } + } + + private void sendTemplateMessage(String openId) { + String url = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=" + getAccessToken(); + TemplateMessage templateMessage = new TemplateMessage(); + templateMessage.setToUser(openId); + templateMessage.setTemplateId("dVSbX2NRzAG7IuN4kkCQhgV-LjzxvApN3PgrGlon9JU"); + + /* + 您好,您已成功消费。 + + 商品名:微信影城影票 + 消费时间:2013年8月20日 20:38 + 备注:您可以回复文字或语音对该商品及商家进行评价哦~ + {{productType.DATA}}:{{name.DATA}} 消费时间:{{time.DATA}} {{remark.DATA}} + */ + HashMap data = new HashMap<>(); + data.put("first", new TemplateMessageDTO("您收到了一条新的订单。")); + data.put("tradeDateTime", new TemplateMessageDTO("02月18日 01时05分")); + data.put("customerInfo", new TemplateMessageDTO("广州 王俊")); + data.put("orderItemName", new TemplateMessageDTO("兴趣车型")); + data.put("orderItemData", new TemplateMessageDTO("骐达 2011款 1.6 CVT 舒适版")); + data.put("remark", new TemplateMessageDTO("截止24日09:39分,您尚有10个订单未处理。")); + System.out.println("data = " + data); + // 链式构建请求 + String result = HttpRequest.post(url) + .body(JSONObject.toJSONString(data))//表单内容 + .timeout(20000)//超时,毫秒 + .execute().body(); + System.out.println("result = " + result); + System.out.println("getAccessToken() = " + getAccessToken()); + } + + @Operation(summary = "send发送订阅通知") + @PostMapping("/send") + public ApiResult send(UserParam param) { + // send发送订阅通知 + String url = "https://api.weixin.qq.com/cgi-bin/message/subscribe/bizsend?access_token=" + getAccessToken(); + final UserOauth userOauth = userOauthService.getOne(new LambdaQueryWrapper().eq(UserOauth::getUserId, param.getUserId()).eq(UserOauth::getOauthType, "MP-OFFICIAL").eq(UserOauth::getDeleted, 0)); + if (userOauth != null) { + param.setOpenid(userOauth.getOauthId()); + final String oauthId = userOauth.getOauthId(); + // 跳转小程序链接 + HashMap miniprogram = new HashMap<>(); + miniprogram.put("appid", miniAppid); + miniprogram.put("pagepath", "pages/chat/chat?friendId=" + param.getUserId()); + // 参数 + HashMap data = new HashMap<>(); + final HashMap thing1 = new HashMap<>(); + final HashMap thing2 = new HashMap<>(); + thing1.put("value", "有新访客需要接待"); + thing2.put("value", "吉媒小红娘"); + data.put("thing1", thing1); + data.put("thing2", thing2); + + // 请求主服务器获取用户信息 + HashMap map = new HashMap<>(); + map.put("access_token", getAccessToken()); + map.put("touser", oauthId); // "opEVj6e1YIlMyovkOQFCLJ7llmuI" + // 红娘来信通知 + map.put("template_id", templateId); + map.put("miniprogram", JSONObject.toJSONString(miniprogram)); + map.put("data", data); + // 新访客通知 +// map.put("tid","XMpEsDHmZZqpiaAzmPqO0Gk_h39WCRkaNZ9VoSI9F34"); +// map.put("page","https://admin.jimeigroup.cn"); +// map.put("sceneDesc","消息提醒"); + System.out.println("map = " + map); + + // 链式构建请求 + String result = HttpRequest.post(url) + .body(JSONObject.toJSONString(map))//表单内容 + .timeout(20000)//超时,毫秒 + .execute().body(); + + JSONObject jsonObject = JSONObject.parseObject(result); + System.out.println("jsonObject = " + jsonObject); + if (jsonObject != null) { + return success(jsonObject); + } + } + + return fail("请求失败", getAccessToken()); + } + + // 调用接口凭证 + private String getAccessToken() { + return getAccessToken(null); + } + + private String getAccessToken(Integer tenantId) { + try { + return wxService.getOfficialAccessToken(tenantId); + } catch (Exception ex) { + log.warn("从系统设置获取公众号access_token失败,回退到兼容逻辑: {}", ex.getMessage()); + } + + String key = MP_OFFICIAL.concat(":access_token:5"); + String value = redisUtil.get(key); + if (value != null) { + JSONObject response = JSON.parseObject(value); + return response.getString("access_token"); + } + + String apiUrl = "https://api.weixin.qq.com/cgi-bin/token"; + String url = apiUrl.concat("?grant_type=client_credential").concat("&appid=").concat(appid).concat("&secret=").concat(secret); + String result = HttpUtil.get(url); + JSONObject response = JSON.parseObject(result); + if (response.getString("access_token") != null) { + redisUtil.set(key, result, 7000L, TimeUnit.SECONDS); + return response.getString("access_token"); + } + return null; + } + + private String getOfficialToken() { + try { + JSONObject config = settingService.getBySettingKey("wx-official"); + String token = config.getString("token"); + return StrUtil.isNotBlank(token) ? token : TOKEN; + } catch (Exception ex) { + log.warn("读取公众号token配置失败,回退到硬编码值: {}", ex.getMessage()); + return TOKEN; + } + } + + private String getOfficialEncodingAESKey() { + try { + JSONObject config = settingService.getBySettingKey("wx-official"); + String encodingAESKey = config.getString("encodingAESKey"); + return StrUtil.isNotBlank(encodingAESKey) ? encodingAESKey : ENCODING_AES_KEY; + } catch (Exception ex) { + log.warn("读取公众号EncodingAESKey配置失败,回退到硬编码值: {}", ex.getMessage()); + return ENCODING_AES_KEY; + } + } + + private String getOfficialAppId(Integer tenantId) { + try { + return wxService.getOfficialAppId(tenantId); + } catch (Exception ex) { + log.warn("读取公众号AppId配置失败,回退到硬编码值: {}", ex.getMessage()); + return appid; + } + } + + @Operation(summary = "创建公众号菜单接口") + @PostMapping("/createMenu") + public ApiResult createMenu() { + String url = MENU_CREATE_URL.concat(Objects.requireNonNull(getAccessToken())); + CloseableHttpClient httpClient = HttpClients.createDefault(); + HttpPost httpPost = new HttpPost(url); + System.out.println("url = " + url); + // 创建菜单数据 + ArrayList menu = new ArrayList<>(); + final WxOfficialButton button = new WxOfficialButton(); + button.setName("菜单1"); + button.setType("click"); + button.setKey("CLICK_EVENT"); + menu.add(button); + button.setName("菜单2"); + button.setType("click"); + button.setKey("CLICK_EVENT"); + menu.add(button); + button.setName("菜单3"); + button.setType("click"); + button.setKey("CLICK_EVENT"); + menu.add(button); + + System.out.println("menu = " + menu); + httpPost.setEntity(new StringEntity(JSONUtil.toJSONString(menu), "UTF-8")); + httpPost.setHeader("Content-type", "application/json"); + + try (CloseableHttpResponse response = httpClient.execute(httpPost)) { + HttpEntity entity = response.getEntity(); + if (entity != null) { + String result = EntityUtils.toString(entity, "UTF-8"); + System.out.println("result = " + result); + if (!result.contains("ok")) { + System.out.println("result = " + result); + String key = MP_OFFICIAL.concat(":access_token:5"); + redisUtil.delete(key); + return fail(result); + } + return success("返回结果", entity); + } + } catch (IOException e) { + throw new RuntimeException(e); + } + return fail("创建失败", url); + } + + @Operation(summary = "test") + @PostMapping("/test") + public ApiResult count() { + final int count = userOauthService.count(new LambdaQueryWrapper().eq(UserOauth::getOauthType, MP_OFFICIAL).eq(UserOauth::getUnionid, "o0FaIuKa2UsVp6FCbvmZlrcaBRCM")); + System.out.println("count = " + count); + return success(getAccessToken()); + } + + /** + * 查找或创建用户用于oauth绑定 + */ + private Integer findOrCreateUserForOauth(Integer tenantId, String openId, String unionid) { + Integer userId = 0; + // 首先尝试通过unionid查找任何平台的现有用户 + final List list = userOauthService.list( + new LambdaQueryWrapper() + .eq(UserOauth::getUnionid, unionid) + .eq(UserOauth::getDeleted, 0)); + + if (!CollectionUtils.isEmpty(list)) { + for (UserOauth item : list) { + if (item.getUserId() != null) { + userId = item.getUserId(); + break; + } + } + System.out.println("数据不一致:通过unionid找到其他平台的用户 userId = " + userId); + } + + // 如果没找到用户,创建一个新用户 + if (userId == 0) { + User user = new User(); + user.setStatus(0); + user.setUsername("wxoff_".concat(RandomUtil.randomString(12))); + user.setNickname("微信公众号用户"); + user.setPlatform(MP_OFFICIAL); + user.setGradeId(1); + user.setPassword(userService.encodePassword(CommonUtil.randomUUID16())); + user.setTenantId(tenantId); + user.setRecommend(0); + + // 尝试获取"user"角色,不行就用"guest",再不行用默认6 + Role role = null; + try { + final RoleParam roleParam = new RoleParam(); + roleParam.setTenantId(tenantId); + roleParam.setRoleCode("user"); + role = roleService.getByRoleCode(roleParam); + } catch (Exception e) { + System.out.println("获取user角色失败,尝试guest角色"); + try { + final RoleParam roleParam = new RoleParam(); + roleParam.setTenantId(tenantId); + roleParam.setRoleCode("guest"); + role = roleService.getByRoleCode(roleParam); + } catch (Exception ex) { + System.out.println("获取guest角色也失败,使用默认角色ID 6"); + } + } + + user.setRoleId(role != null ? role.getRoleId() : 6); + + if (userService.saveUser(user)) { + userId = user.getUserId(); + // 添加用户角色 + final UserRole userRole = new UserRole(); + userRole.setUserId(user.getUserId()); + userRole.setTenantId(user.getTenantId()); + userRole.setRoleId(user.getRoleId()); + userRoleService.save(userRole); + // 注意:不立即同步到 websopy,等绑定手机号后再同步 + } + System.out.println("数据不一致:创建新用户 userId = " + userId); + } + + // 创建oauth记录 + final UserOauth userOauth = new UserOauth(); + userOauth.setOauthType(MP_OFFICIAL); + userOauth.setUnionid(unionid); + userOauth.setOauthId(openId); + userOauth.setUserId(userId); + userOauth.setTenantId(tenantId); + boolean save = userOauthService.save(userOauth); + System.out.println("创建oauth记录修复数据不一致,结果 = " + save); + + return userId; + } + + /** + * 确保用户有合适的角色 + */ + private void ensureUserHasAppropriateRole(User user, Integer tenantId) { + try { + // 检查用户是否有有效的角色绑定 + List userRoles = userRoleService.list(new LambdaQueryWrapper() + .eq(UserRole::getUserId, user.getUserId()) + .eq(UserRole::getTenantId, tenantId)); + + if (CollectionUtils.isEmpty(userRoles)) { + System.out.println("用户 " + user.getUserId() + " 没有角色绑定,尝试分配角色"); + + // 获取合适的角色 + Role role = null; + // 先尝试获取"user"角色 + try { + final RoleParam roleParam = new RoleParam(); + roleParam.setTenantId(tenantId); + roleParam.setRoleCode("user"); + role = roleService.getByRoleCode(roleParam); + } catch (Exception e) { + System.out.println("获取user角色失败,尝试guest角色"); + try { + final RoleParam roleParam = new RoleParam(); + roleParam.setTenantId(tenantId); + roleParam.setRoleCode("guest"); + role = roleService.getByRoleCode(roleParam); + } catch (Exception ex) { + System.out.println("获取guest角色也失败,使用默认角色ID 6"); + } + } + + Integer roleId = role != null ? role.getRoleId() : 6; + + // 创建用户角色绑定 + final UserRole userRole = new UserRole(); + userRole.setUserId(user.getUserId()); + userRole.setTenantId(tenantId); + userRole.setRoleId(roleId); + userRoleService.save(userRole); + + // 更新用户的roleId + user.setRoleId(roleId); + userService.updateUser(user); + + System.out.println("为用户 " + user.getUserId() + " 分配了角色ID: " + roleId); + } else { + // 检查角色的有效性 + boolean hasValidRole = false; + for (UserRole userRole : userRoles) { + if (userRole.getRoleId() != null && userRole.getRoleId() > 0) { + hasValidRole = true; + // 确保用户的roleId与绑定的角色一致 + if (!userRole.getRoleId().equals(user.getRoleId())) { + user.setRoleId(userRole.getRoleId()); + userService.updateUser(user); + System.out.println("更新用户 " + user.getUserId() + " 的角色ID为: " + userRole.getRoleId()); + } + break; + } + } + + if (!hasValidRole) { + System.out.println("用户 " + user.getUserId() + " 的角色绑定无效,重新分配"); + // 重新分配角色(简化逻辑,使用默认角色ID 6) + final UserRole userRole = new UserRole(); + userRole.setUserId(user.getUserId()); + userRole.setTenantId(tenantId); + userRole.setRoleId(6); + userRoleService.save(userRole); + + user.setRoleId(6); + userService.updateUser(user); + + System.out.println("重新为用户 " + user.getUserId() + " 分配了默认角色ID: 6"); + } + } + } catch (Exception e) { + System.out.println("确保用户角色时发生异常: " + e.getMessage()); + e.printStackTrace(); + } + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/controller/WxPayNotifyController.java b/src/main/java/com/gxwebsoft/common/system/controller/WxPayNotifyController.java new file mode 100644 index 0000000..eb136ae --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/controller/WxPayNotifyController.java @@ -0,0 +1,88 @@ +package com.gxwebsoft.common.system.controller; + +import cn.hutool.core.util.StrUtil; +import com.gxwebsoft.common.core.config.ConfigProperties; +import com.gxwebsoft.common.core.utils.RedisUtil; +import com.gxwebsoft.common.core.utils.RequestUtil; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.common.system.entity.Payment; +import com.wechat.pay.java.core.notification.NotificationConfig; +import com.wechat.pay.java.core.notification.NotificationParser; +import com.wechat.pay.java.core.notification.RSANotificationConfig; +import com.wechat.pay.java.service.partnerpayments.jsapi.model.Transaction; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.media.Schema; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.Map; + +/** + * 会员特权购买记录表控制器 + * + * @author 科技小王子 + * @since 2023-06-20 18:07:50 + */ +@Tag(name = "微信支付结果通知") +@RestController +@RequestMapping("/api/system/wx-pay") +public class WxPayNotifyController extends BaseController { + @Value("${spring.profiles.active}") + String active; + @Resource + private RedisUtil redisUtil; + @Resource + private RequestUtil requestUtil; + @Resource + private ConfigProperties conf; + + @Schema(description = "异步通知") + @PostMapping("/notify/{tenantId}") + public String wxNotify(@RequestHeader Map header, @RequestBody String body, @PathVariable("tenantId") Integer tenantId) { + System.out.println("异步通知*************** = "); + + // 获取支付配置信息用于解密 + String key = "Payment:1:".concat(tenantId.toString()); + final Payment payment = redisUtil.get(key, Payment.class); + String privateKey = payment.getApiKey(); + String apiclientCert = conf.getUploadPath().concat("/file").concat(payment.getApiclientCert()); + + com.wechat.pay.java.core.notification.RequestParam requestParam = new com.wechat.pay.java.core.notification.RequestParam.Builder() + .serialNumber(header.get("wechatpay-serial")) + .nonce(header.get("wechatpay-nonce")) + .signature(header.get("wechatpay-signature")) + .timestamp(header.get("wechatpay-timestamp")) + .body(body) + .build(); + + // 如果已经初始化了 RSAAutoCertificateConfig,可直接使用 + // 没有的话,则构造一个 + NotificationConfig config = new RSANotificationConfig.Builder() + .apiV3Key(privateKey) + .certificatesFromPath(apiclientCert) + .build(); + + // 初始化 NotificationParser + NotificationParser parser = new NotificationParser(config); + + // 以支付通知回调为例,验签、解密并转换成 Transaction + try { + Transaction transaction = parser.parse(requestParam, Transaction.class); + + if (StrUtil.equals("支付成功", transaction.getTradeStateDesc())) { + + // 推送微信官方支付结果(携带租户ID的POST请求) + requestUtil.pushWxPayNotify(transaction, payment); + + return "SUCCESS"; + } + } catch (Exception $e) { + System.out.println($e.getMessage()); + } + + return "fail"; + } + + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/AccessKey.java b/src/main/java/com/gxwebsoft/common/system/entity/AccessKey.java new file mode 100644 index 0000000..0f30a66 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/AccessKey.java @@ -0,0 +1,57 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.Date; + +/** + * 访问凭证管理 + * + * @author 科技小王子 + * @since 2023-05-16 19:19:55 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "AccessKey对象", description = "访问凭证管理") +@TableName("sys_access_key") +public class AccessKey implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "字典项id") + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @Schema(description = "字典id") + private String accessKey; + + @Schema(description = "字典项标识") + private String accessSecret; + + @Schema(description = "排序号") + private Integer sortNumber; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/AuthorizeCode.java b/src/main/java/com/gxwebsoft/common/system/entity/AuthorizeCode.java new file mode 100644 index 0000000..1eced1f --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/AuthorizeCode.java @@ -0,0 +1,58 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableLogic; +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 授权码 + * + * @author 科技小王子 + * @since 2025-08-05 01:17:27 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "AuthorizeCode对象", description = "授权码") +@TableName("sys_authorize_code") +public class AuthorizeCode implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "id") + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @Schema(description = "授权码") + private String code; + + @Schema(description = "用户ID") + private Integer userId; + + @Schema(description = "排序号") + private Integer sortNumber; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/Cache.java b/src/main/java/com/gxwebsoft/common/system/entity/Cache.java new file mode 100644 index 0000000..232c183 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/Cache.java @@ -0,0 +1,34 @@ +package com.gxwebsoft.common.system.entity; + +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; + +/** + * 缓存管理 + * + * @author WebSoft + * @since 2022-11-19 13:54:27 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "Setting对象", description = "缓存管理") +public class Cache implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "key") + private String key; + + @Schema(description = "设置内容(json格式)") + private String content; + + @Schema(description = "过期时间(秒)") + private Long expireTime; + + @Schema(description = "租户id") + private Integer tenantId; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/Cart.java b/src/main/java/com/gxwebsoft/common/system/entity/Cart.java new file mode 100644 index 0000000..691845f --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/Cart.java @@ -0,0 +1,109 @@ +package com.gxwebsoft.common.system.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 com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +/** + * 购物车 + * + * @author 科技小王子 + * @since 2024-10-26 10:54:51 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "Cart对象", description = "购物车") +@TableName("sys_cart") +public class Cart implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "购物车表ID") + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + @Schema(description = "类型 0商城 1应用插件") + private Integer type; + + @Schema(description = "唯一标识") + private String code; + + @Schema(description = "项目ID,0 goodId 1 companyId") + private Long itemId; + + @Schema(description = "商品规格") + private String spec; + + @Schema(description = "商品价格") + private BigDecimal price; + + @Schema(description = "购买时长") + private Integer month; + + @Schema(description = "商品数量") + private Integer cartNum; + + @Schema(description = "单商品合计") + private BigDecimal totalPrice; + + @Schema(description = "0 = 未购买 1 = 已购买") + private Boolean isPay; + + @Schema(description = "是否为立即购买") + private Boolean isNew; + + @Schema(description = "拼团id") + private Integer combinationId; + + @Schema(description = "秒杀产品ID") + private Integer seckillId; + + @Schema(description = "砍价id") + private Integer bargainId; + + @Schema(description = "是否选中") + private Boolean selected; + + @Schema(description = "商户ID") + private Long merchantId; + + @Schema(description = "用户ID") + private Integer userId; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + @Schema(description = "商品描述") + @TableField(exist = false) + private String comments; + + @Schema(description = "支付方式") + @TableField(exist = false) + private Integer payType; + + @Schema(description = "支付金额") + @TableField(exist = false) + private BigDecimal payPrice; + + @Schema(description = "应用列表") + private List list; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/ChatConversation.java b/src/main/java/com/gxwebsoft/common/system/entity/ChatConversation.java new file mode 100644 index 0000000..9e24657 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/ChatConversation.java @@ -0,0 +1,67 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableLogic; +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 聊天消息表 + * + * @author 科技小王子 + * @since 2024-04-27 15:57:27 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "ChatConversation对象", description = "聊天消息表") +@TableName("sys_chat_conversation") +public class ChatConversation implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "自增ID") + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @Schema(description = "用户ID") + private Integer userId; + + @Schema(description = "好友ID") + private Integer friendId; + + @Schema(description = "消息类型") + private Integer type; + + @Schema(description = "消息内容") + private String content; + + @Schema(description = "未读消息") + private Integer unRead; + + @Schema(description = "状态, 0未读, 1已读") + private Integer status; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "注册时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/ChatMessage.java b/src/main/java/com/gxwebsoft/common/system/entity/ChatMessage.java new file mode 100644 index 0000000..e5671e5 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/ChatMessage.java @@ -0,0 +1,93 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.*; + +import java.util.Date; +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 聊天消息表 + * + * @author 科技小王子 + * @since 2024-04-27 15:57:27 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "ChatMessage对象", description = "聊天消息表") +@TableName("sys_chat_message") +public class ChatMessage implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "自增ID") + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @Schema(description = "发送人ID") + private Integer formUserId; + + @Schema(description = "接收人ID") + private Integer toUserId; + + @Schema(description = "消息类型") + private String type; + + @Schema(description = "消息内容") + private String content; + + @Schema(description = "屏蔽接收方") + private Integer sideTo; + + @Schema(description = "屏蔽发送方") + private Integer sideFrom; + + @Schema(description = "是否撤回") + private Integer withdraw; + + @Schema(description = "文件信息") + private String fileInfo; + + @Schema(description = "存在联系方式") + private Integer hasContact; + + @Schema(description = "状态, 0未读, 1已读") + private Integer status; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "注册时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + @Schema(description = "发送人昵称") + @TableField(exist = false) + private String formUserName; + + @Schema(description = "发送人头像") + @TableField(exist = false) + private String formUserAvatar; + + @Schema(description = "接收人昵称") + @TableField(exist = false) + private String toUserName; + + @Schema(description = "接收人头像") + @TableField(exist = false) + private String toUserAvatar; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/Company.java b/src/main/java/com/gxwebsoft/common/system/entity/Company.java new file mode 100644 index 0000000..aeedfa6 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/Company.java @@ -0,0 +1,337 @@ +package com.gxwebsoft.common.system.entity; + +import cn.hutool.core.util.DesensitizedUtil; +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +/** + * 企业信息 + * + * @author 科技小王子 + * @since 2023-05-27 14:57:34 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "Company对象", description = "企业信息") +@TableName("sys_company") +public class Company implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "企业id") + @TableId(value = "company_id", type = IdType.AUTO) + private Integer companyId; + + @Schema(description = "应用类型") + private Integer type; + + @Schema(description = "企业简称") + private String shortName; + + @Schema(description = "企业全称") + @TableField(exist = false) + private String companyName; + + @Schema(description = "企业标识") + private String companyCode; + + @Schema(description = "企业类型") + private String companyType; + + @Schema(description = "是否官方") + private Boolean official; + + @Schema(description = "企业类型 多选") + private String companyTypeMultiple; + + @Schema(description = "应用标识") + private String companyLogo; + + @Schema(description = "封面图") + private String image; + + @Schema(description = "应用详情") + @TableField(exist = false) + private String content; + + @Schema(description = "栏目分类") + private Integer categoryId; + + @Schema(description = "栏目名称") + @TableField(exist = false) + private String categoryName; + + @Schema(description = "应用截图") + private String files; + + @Schema(description = "顶级域名") + private String domain; + + @Schema(description = "免费域名") + private String freeDomain; + + @Schema(description = "销售价格") + private BigDecimal price; + + @Schema(description = "计费方式") + private Integer chargingMethod; + + @Schema(description = "联系电话") + private String phone; + + @Schema(description = "公司座机") + private String tel; + + @Schema(description = "电子邮箱") + private String email; + + @Schema(description = "企业法人") + private String businessEntity; + + @Schema(description = "发票抬头") + @TableField("Invoice_header") + private String invoiceHeader; + + @Schema(description = "服务开始时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date startTime; + + @Schema(description = "服务到期时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date expirationTime; + + @Schema(description = "即将过期") + private Integer soon; + + @Schema(description = "应用版本 10体验版 20授权版 30旗舰版") + private Integer version; + + @Schema(description = "版本名称") + private String versionName; + + @Schema(description = "版本号") + private String versionCode; + + @Schema(description = "评分") + private BigDecimal rate; + + @Schema(description = "企业成员(当前)") + private Integer users; + + @Schema(description = "成员数量(上限)") + private Integer members; + + @Schema(description = "浏览数量") + private Long clicks; + + @Schema(description = "点赞数量") + private Long likes; + + @Schema(description = "购买数量") + private Long buys; + + @Schema(description = "存储空间") + private Long storage; + + @Schema(description = "存储空间(上限)") + private Long storageMax; + + @Schema(description = "行业类型(父级)") + private String industryParent; + + @Schema(description = "行业类型(子级)") + private String industryChild; + + @Schema(description = "部门数量") + private Integer departments; + + @Schema(description = "所在国家") + private String country; + + @Schema(description = "所在省份") + private String province; + + @Schema(description = "所在城市") + private String city; + + @Schema(description = "所在辖区") + private String region; + + @Schema(description = "街道地址") + private String address; + + @Schema(description = "经度") + private String longitude; + + @Schema(description = "纬度") + private String latitude; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "是否实名认证") + private Integer authentication; + + @Schema(description = "主控端节点") + private String serverUrl; + + @Schema(description = "模块节点") + private String modulesUrl; + + @Schema(description = "重定向节点") + private String redirectUrl; + + @Schema(description = "request合法域名") + private String requestUrl; + + @Schema(description = "socket合法域名") + private String socketUrl; + + @Schema(description = "总后台管理入口") + private String adminUrl; + + @Schema(description = "商户端管理入口") + private String merchantUrl; + + @Schema(description = "默认网站URL") + private String websiteUrl; + + @Schema(description = "微信小程序二维码") + private String mpWeixinCode; + + @Schema(description = "支付宝小程序二维码") + private String mpAlipayCode; + + @Schema(description = "H5端应用二维码") + private String h5Code; + + @Schema(description = "安卓APP二维码") + private String androidUrl; + + @Schema(description = "苹果APP二维码") + private String iosUrl; + + @Schema(description = "应用类型") + private String appType; + + @Schema(description = "状态") + private Integer status; + + @Schema(description = "排序") + private Integer sortNumber; + + @Schema(description = "插件ID(菜单根节点)") + private Integer menuId; + + @Schema(description = "当前使用的租户模板") + private Integer planId; + + @Schema(description = "是否开启网站") + private Boolean websiteStatus; + + @Schema(description = "用户ID") + private Integer userId; + + @Schema(description = "是否含税") + private Boolean isTax; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + @Schema(description = "是否默认企业主体") + private Boolean authoritative; + + @Schema(description = "是否推荐") + private Boolean recommend; + + @Schema(description = "商户ID") + private Long merchantId; + + @Schema(description = "租户ID") + private Integer tid; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "租户名称") + @TableField(exist = false) + private String tenantName; + + @Schema(description = "租户编号") + @TableField(exist = false) + private String tenantCode; + + @Schema(description = "昵称") + @TableField(exist = false) + private String nickname; + + @Schema(description = "配置信息") + @TableField(exist = false) + private Object config; + + @Schema(description = "是否已收藏") + @TableField(exist = false) + private Boolean collection; + + @Schema(description = "新注册的密码") + @TableField(exist = false) + private String password; + + @Schema(description = "手机号(脱敏)") + @TableField(exist = false) + private String mobile; + + @Schema(description = "是否已购买") + @TableField(exist = false) + private Boolean isBuy; + + @Schema(description = "用户是否已安装了该插件") + @TableField(exist = false) + private Boolean installed; + + @Schema(description = "产品参数") + @TableField(exist = false) + private List parameters; + + @Schema(description = "产品按钮及链接") + @TableField(exist = false) + private List links; + + @Schema(description = "购买数量") + @TableField(exist = false) + private Integer num; + + @Schema(description = "角色列表") + @TableField(exist = false) + private List roles; + + @Schema(description = "权限列表") + @TableField(exist = false) + private List authorities; + + @Schema(description = "记录克隆的模板ID") + @TableField(exist = false) + private Integer templateId; + + public String getMobile() { + return DesensitizedUtil.mobilePhone(this.phone); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/CompanyComment.java b/src/main/java/com/gxwebsoft/common/system/entity/CompanyComment.java new file mode 100644 index 0000000..89861ce --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/CompanyComment.java @@ -0,0 +1,61 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 应用评论 + * + * @author 科技小王子 + * @since 2024-10-17 15:30:24 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "CompanyComment对象", description = "应用评论") +@TableName("sys_company_comment") +public class CompanyComment implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "ID") + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @Schema(description = "父级ID") + private Integer parentId; + + @Schema(description = "用户ID") + private Integer userId; + + @Schema(description = "企业ID") + private Integer companyId; + + @Schema(description = "评分") + private BigDecimal rate; + + @Schema(description = "排序(数字越小越靠前)") + private Integer sortNumber; + + @Schema(description = "评论内容") + private String comments; + + @Schema(description = "状态") + private Integer status; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/CompanyContent.java b/src/main/java/com/gxwebsoft/common/system/entity/CompanyContent.java new file mode 100644 index 0000000..7a5c061 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/CompanyContent.java @@ -0,0 +1,44 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.Date; + +/** + * 应用详情 + * + * @author 科技小王子 + * @since 2024-10-16 13:41:21 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "CompanyContent对象", description = "应用详情") +@TableName("sys_company_content") +public class CompanyContent implements Serializable { + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @Schema(description = "企业ID") + private Integer companyId; + + @Schema(description = "详细内容") + private String content; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/CompanyGit.java b/src/main/java/com/gxwebsoft/common/system/entity/CompanyGit.java new file mode 100644 index 0000000..9bc99fe --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/CompanyGit.java @@ -0,0 +1,69 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.Date; + +/** + * 代码仓库 + * + * @author 科技小王子 + * @since 2024-10-19 18:08:51 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "CompanyGit对象", description = "代码仓库") +@TableName("sys_company_git") +public class CompanyGit implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "自增ID") + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @Schema(description = "仓库名称") + private String title; + + @Schema(description = "厂商") + private String brand; + + @Schema(description = "图标") + private String icon; + + @Schema(description = "企业ID") + private Integer companyId; + + @Schema(description = "仓库地址") + private String domain; + + @Schema(description = "账号") + private String account; + + @Schema(description = "密码") + private String password; + + @Schema(description = "仓库描述") + private String comments; + + @Schema(description = "排序(数字越小越靠前)") + private Integer sortNumber; + + @Schema(description = "状态, 0正常, 1待确认") + private Integer status; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "租户id") + private Integer tenantId; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/CompanyParameter.java b/src/main/java/com/gxwebsoft/common/system/entity/CompanyParameter.java new file mode 100644 index 0000000..63feb4a --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/CompanyParameter.java @@ -0,0 +1,57 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.Date; + +/** + * 应用参数 + * + * @author 科技小王子 + * @since 2024-10-17 15:30:24 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "CompanyParameter对象", description = "应用参数") +@TableName("sys_company_parameter") +public class CompanyParameter implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "自增ID") + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @Schema(description = "参数名称") + private String name; + + @Schema(description = "参数内容") + private String value; + + @Schema(description = "企业ID") + private Integer companyId; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "排序(数字越小越靠前)") + private Integer sortNumber; + + @Schema(description = "状态, 0正常, 1待确认") + private Integer status; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "租户id") + private Integer tenantId; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/CompanyUrl.java b/src/main/java/com/gxwebsoft/common/system/entity/CompanyUrl.java new file mode 100644 index 0000000..e454580 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/CompanyUrl.java @@ -0,0 +1,66 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.Date; + +/** + * 应用域名 + * + * @author 科技小王子 + * @since 2024-10-17 15:30:24 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "CompanyUrl对象", description = "应用域名") +@TableName("sys_company_url") +public class CompanyUrl implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "自增ID") + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @Schema(description = "域名类型") + private String type; + + @Schema(description = "企业ID") + private Integer companyId; + + @Schema(description = "域名") + private String domain; + + @Schema(description = "账号") + private String account; + + @Schema(description = "密码") + private String password; + + @Schema(description = "二维码") + private String qrcode; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "排序(数字越小越靠前)") + private Integer sortNumber; + + @Schema(description = "状态, 0正常, 1待确认") + private Integer status; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "租户id") + private Integer tenantId; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/Components.java b/src/main/java/com/gxwebsoft/common/system/entity/Components.java new file mode 100644 index 0000000..1b15062 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/Components.java @@ -0,0 +1,73 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import java.util.Date; +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 组件 + * + * @author 科技小王子 + * @since 2024-08-25 19:08:51 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "Components对象", description = "组件") +@TableName("sys_components") +public class Components implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "ID") + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @Schema(description = "组件标题") + private String title; + + @Schema(description = "关联导航ID") + private Integer navigationId; + + @Schema(description = "组件类型") + private String type; + + @Schema(description = "页面关键词") + private String keywords; + + @Schema(description = "页面描述") + private String description; + + @Schema(description = "组件路径") + private String path; + + @Schema(description = "组件图标") + private String icon; + + @Schema(description = "用户ID") + private Integer userId; + + @Schema(description = "排序(数字越小越靠前)") + private Integer sortNumber; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "状态, 0正常, 1冻结") + private Integer status; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/Dict.java b/src/main/java/com/gxwebsoft/common/system/entity/Dict.java new file mode 100644 index 0000000..6b742bd --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/Dict.java @@ -0,0 +1,60 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.Set; + +/** + * 字典 + * + * @author WebSoft + * @since 2020-03-14 11:29:03 + */ +@Data +@Schema(description = "字典(业务类)") +@TableName("sys_dict") +public class Dict implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "字典id") + @TableId(type = IdType.AUTO) + private Integer dictId; + + @Schema(description = "字典标识") + private String dictCode; + + @Schema(description = "字典名称") + private String dictName; + + @Schema(description = "排序号") + private Integer sortNumber; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "字典项列表") + @TableField(exist = false) + private Set> items; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/DictData.java b/src/main/java/com/gxwebsoft/common/system/entity/DictData.java new file mode 100644 index 0000000..a8d38e5 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/DictData.java @@ -0,0 +1,93 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 字典数据 + * + * @author WebSoft + * @since 2020-03-14 11:29:04 + */ +@Data +@Schema(description = "字典数据(业务类)") +@TableName("sys_dict_data") +public class DictData implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "字典数据id") + @TableId(type = IdType.AUTO) + private Integer dictDataId; + + @Schema(description = "字典id") + private Integer dictId; + + @Schema(description = "字典数据标识") + private String dictDataCode; + + @Schema(description = "字典数据名称") + private String dictDataName; + + @Schema(description = "字段名称") + @TableField(exist = false) + private String text; + + @Schema(description = "字段名称") + @TableField(exist = false) + private String label; + + @Schema(description = "字段值") + @TableField(exist = false) + private String value; + + @Schema(description = "预设字段:路由地址") + private String path; + + @Schema(description = "预设字段:组件路径") + private String component; + + @Schema(description = "排序号") + private Integer sortNumber; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + @Schema(description = "字典代码") + @TableField(exist = false) + private String dictCode; + + @Schema(description = "字典名称") + @TableField(exist = false) + private String dictName; + + @Schema(description = "租户id") + private Integer tenantId; + + public String getText() { + return this.dictDataName; + } + public String getLabel() { + return this.dictDataName; + } + public String getValue() { + return this.dictDataCode; + } +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/Dictionary.java b/src/main/java/com/gxwebsoft/common/system/entity/Dictionary.java new file mode 100644 index 0000000..4965a85 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/Dictionary.java @@ -0,0 +1,59 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; + +import java.util.Date; +import java.io.Serializable; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 字典 + * + * @author WebSoft + * @since 2020-03-14 11:29:03 + */ +@Data +@Schema(description = "字典(系统类)") +@TableName("sys_dictionary") +public class Dictionary implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "字典id") + @TableId(type = IdType.AUTO) + private Integer dictId; + + @Schema(description = "字典标识") + private String dictCode; + + @Schema(description = "字典名称") + private String dictName; + + @Schema(description = "排序号") + private Integer sortNumber; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + @Schema(description = "租户id") + private Integer tenantId; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/DictionaryData.java b/src/main/java/com/gxwebsoft/common/system/entity/DictionaryData.java new file mode 100644 index 0000000..b9bc7e4 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/DictionaryData.java @@ -0,0 +1,73 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.*; + +import java.util.Date; +import java.io.Serializable; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 字典数据 + * + * @author WebSoft + * @since 2020-03-14 11:29:04 + */ +@Data +@Schema(description = "字典数据(系统类)") +@TableName("sys_dictionary_data") +public class DictionaryData implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "字典数据id") + @TableId(type = IdType.AUTO) + private Integer dictDataId; + + @Schema(description = "字典id") + private Integer dictId; + + @Schema(description = "字典数据标识") + private String dictDataCode; + + @Schema(description = "字典数据名称") + private String dictDataName; + + @Schema(description = "预设字段:路由地址") + private String path; + + @Schema(description = "预设字段:组件路径") + private String component; + + @Schema(description = "排序号") + private Integer sortNumber; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + @Schema(description = "字典代码") + @TableField(exist = false) + private String dictCode; + + @Schema(description = "字典名称") + @TableField(exist = false) + private String dictName; + + @Schema(description = "租户id") + private Integer tenantId; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/Domain.java b/src/main/java/com/gxwebsoft/common/system/entity/Domain.java new file mode 100644 index 0000000..06ef429 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/Domain.java @@ -0,0 +1,71 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableLogic; +import java.io.Serializable; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 授权域名 + * + * @author 科技小王子 + * @since 2024-09-19 23:56:33 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "Domain对象", description = "授权域名") +@TableName("sys_domain") +public class Domain implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "ID") + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @Schema(description = "域名") + private String domain; + + @Schema(description = "主机记录") + private String hostName; + + @Schema(description = "记录值") + private String hostValue; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "类型 0常规 1后台 2商家端") + private Integer type; + + @Schema(description = "状态") + private Integer status; + + @Schema(description = "排序号") + private Integer sortNumber; + + @Schema(description = "企业ID") + private Integer companyId; + + @Schema(description = "用户ID") + private Integer userId; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "创建时间") + private LocalDateTime createTime; + + @Schema(description = "修改时间") + private LocalDateTime updateTime; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/EmailRecord.java b/src/main/java/com/gxwebsoft/common/system/entity/EmailRecord.java new file mode 100644 index 0000000..d4fa4ff --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/EmailRecord.java @@ -0,0 +1,59 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 邮件发送记录 + * + * @author WebSoft + * @since 2021-08-29 12:36:35 + */ +@Data +@Schema(description = "邮件发送记录") +@TableName("sys_email_record") +public class EmailRecord implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "主键id") + @TableId(type = IdType.AUTO) + private Integer id; + + @Schema(description = "邮件标题") + private String title; + + @Schema(description = "邮件内容") + private String content; + + @Schema(description = "收件邮箱") + private String receiver; + + @Schema(description = "发件邮箱") + private String sender; + + @Schema(description = "创建人ID") + private Integer createUserId; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/Environment.java b/src/main/java/com/gxwebsoft/common/system/entity/Environment.java new file mode 100644 index 0000000..c02bde1 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/Environment.java @@ -0,0 +1,79 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableLogic; +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 环境管理 + * + * @author 科技小王子 + * @since 2023-10-18 08:45:13 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "Environment对象", description = "环境管理") +@TableName("sys_environment") +public class Environment implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "插件id") + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @Schema(description = "环境名称") + private String environmentName; + + @Schema(description = "环境编号") + private String environmentCode; + + @Schema(description = "服务器厂商") + private String brand; + + @Schema(description = "服务器IP") + private String serverIp; + + @Schema(description = "模块访问地址") + private String modulesUrl; + + @Schema(description = "模块API") + private String modulesApi; + + @Schema(description = "排序号") + private Integer sortNumber; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "状态, 10待审核 20已通过 30已驳回") + private Integer status; + + @Schema(description = "用户ID") + private Integer userId; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/FileRecord.java b/src/main/java/com/gxwebsoft/common/system/entity/FileRecord.java new file mode 100644 index 0000000..e93e632 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/FileRecord.java @@ -0,0 +1,108 @@ +package com.gxwebsoft.common.system.entity; + +import cn.hutool.core.util.DesensitizedUtil; +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 文件上传记录 + * + * @author WebSoft + * @since 2021-08-29 12:36:32 + */ +@Data +@Schema(description = "文件上传记录") +@TableName("sys_file_record") +public class FileRecord implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "主键id") + @TableId(type = IdType.AUTO) + private Integer id; + + @Schema(description = "文件类型, 0本地存储, 1阿里云oss, 2腾讯云cos,3七牛云,4其他") + private Integer type; + + @Schema(description = "访问域名") + @TableField(exist = false) + private String domain; + + @Schema(description = "分组ID") + private Integer groupId; + + @Schema(description = "文件名称") + private String name; + + @Schema(description = "文件存储路径") + private String path; + + @Schema(description = "文件大小") + private Long length; + + @Schema(description = "文件类型") + private String contentType; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "应用ID") + private Integer appId; + + @Schema(description = "企业ID") + private Integer companyId; + + @Schema(description = "商户ID") + private Long merchantId; + + @Schema(description = "创建人") + private Integer createUserId; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + @Schema(description = "文件访问地址") + @TableField(exist = false) + private String url; + + @Schema(description = "文件缩略图访问地址") + @TableField(exist = false) + private String thumbnail; + + @Schema(description = "大图(用于PC端的banner等)") + @TableField(exist = false) + private String bigImage; + + @Schema(description = "文件下载地址") + @TableField(exist = false) + private String downloadUrl; + + @Schema(description = "创建人账号") + @TableField(exist = false) + private String createUsername; + + @Schema(description = "创建人名称") + @TableField(exist = false) + private String createNickname; + + @Schema(description = "用户头像") + @TableField(exist = false) + private String avatar; +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/KVEntity.java b/src/main/java/com/gxwebsoft/common/system/entity/KVEntity.java new file mode 100644 index 0000000..1512632 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/KVEntity.java @@ -0,0 +1,56 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 租户 + * + * @author WebSoft + * @since 2021-08-28 11:31:06 + */ +@Data +@Schema(description = "实体") +public class KVEntity implements Serializable { + private static final long serialVersionUID = 1L; + protected K k; + protected V v; + public KVEntity() { + super(); + } + + public KVEntity(K k, V v) { + super(); + this.k = k; + this.v = v; + } + + public static KVEntity build(K k, V v) { + return new KVEntity<>(k, v); + } + + public K getK() { + return k; + } + + public void setK(K k) { + this.k = k; + } + + public V getV() { + return v; + } + + public void setV(V v) { + this.v = v; + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/LoginRecord.java b/src/main/java/com/gxwebsoft/common/system/entity/LoginRecord.java new file mode 100644 index 0000000..6e9f5f1 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/LoginRecord.java @@ -0,0 +1,76 @@ +package com.gxwebsoft.common.system.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 com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 登录日志 + * + * @author WebSoft + * @since 2018-12-24 16:10:41 + */ +@Data +@Schema(description = "登录日志") +@TableName("sys_login_record") +public class LoginRecord implements Serializable { + private static final long serialVersionUID = 1L; + public static final int TYPE_LOGIN = 0; // 登录成功 + public static final int TYPE_ERROR = 1; // 登录失败 + public static final int TYPE_LOGOUT = 2; // 退出登录 + public static final int TYPE_REFRESH = 3; // 续签token + public static final int TYPE_REGISTER = 4; // 注册成功 + + @Schema(description = "主键id") + @TableId(type = IdType.AUTO) + private Integer id; + + @Schema(description = "用户账号") + private String username; + + @Schema(description = "操作系统") + private String os; + + @Schema(description = "设备名称") + private String device; + + @Schema(description = "浏览器类型") + private String browser; + + @Schema(description = "ip地址") + private String ip; + + @Schema(description = "操作类型, 0登录成功, 1登录失败, 2退出登录, 3续签token") + private Integer loginType; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "操作时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + @Schema(description = "用户id") + @TableField(exist = false) + private Integer userId; + + @Schema(description = "用户昵称") + @TableField(exist = false) + private String nickname; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/Menu.java b/src/main/java/com/gxwebsoft/common/system/entity/Menu.java new file mode 100644 index 0000000..28ad5b2 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/Menu.java @@ -0,0 +1,99 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.springframework.security.core.GrantedAuthority; + +import java.util.Date; +import java.util.List; + +/** + * 菜单 + * + * @author WebSoft + * @since 2018-12-24 16:10:17 + */ +@Data +@Schema(description = "菜单") +@TableName("sys_menu") +@JsonIgnoreProperties(ignoreUnknown = true) +public class Menu implements GrantedAuthority { + private static final long serialVersionUID = 1L; + public static final int TYPE_MENU = 0; // 菜单类型 + public static final int TYPE_BTN = 1; // 按钮类型 + + @Schema(description = "菜单id") + @TableId(type = IdType.AUTO) + private Integer menuId; + + @Schema(description = "上级id, 0是顶级") + private Integer parentId; + + @Schema(description = "菜单名称") + private String title; + + @Schema(description = "菜单路由地址") + private String path; + + @Schema(description = "菜单组件地址") + private String component; + + @Schema(description = "模块ID") + private String modules; + + @Schema(description = "模块API") + private String modulesUrl; + + @Schema(description = "菜单类型, 0菜单, 1按钮") + private Integer menuType; + + @Schema(description = "打开方式, 0当前页, 1新窗口") + @TableField(exist = false) + private Integer openType; + + @Schema(description = "排序号") + private Integer sortNumber; + + @Schema(description = "权限标识") + private String authority; + + @Schema(description = "菜单图标") + private String icon; + + @Schema(description = "是否隐藏, 0否, 1是(仅注册路由不显示左侧菜单)") + private Integer hide; + + @Schema(description = "路由元信息") + private String meta; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "关联应用") + private Integer appId; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + @Schema(description = "子菜单") + @TableField(exist = false) + private List children; + + @Schema(description = "角色权限树选中状态") + @TableField(exist = false) + private Boolean checked; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/Merchant.java b/src/main/java/com/gxwebsoft/common/system/entity/Merchant.java new file mode 100644 index 0000000..d52646b --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/Merchant.java @@ -0,0 +1,128 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 商户 + * + * @author 科技小王子 + * @since 2024-04-05 00:03:54 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "Merchant对象", description = "商户") +@TableName("sys_merchant") +public class Merchant implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "ID") + @TableId(value = "merchant_id", type = IdType.AUTO) + private Long merchantId; + + @Schema(description = "商户名称") + private String merchantName; + + @Schema(description = "商户标识") + private String merchantCode; + + @Schema(description = "商户图标") + private String image; + + @Schema(description = "商户手机号") + private String phone; + + @Schema(description = "商户姓名") + private String realName; + + @Schema(description = "店铺类型") + private String shopType; + + @Schema(description = "商户分类") + private String category; + + @Schema(description = "经纬度") + private String lngAndLat; + + @Schema(description = "所在省份") + private String province; + + @Schema(description = "所在城市") + private String city; + + @Schema(description = "所在辖区") + private String region; + + @Schema(description = "详细地址") + private String address; + + @Schema(description = "手续费") + private BigDecimal commission; + + @Schema(description = "关键字") + private String keywords; + + @Schema(description = "资质图片") + private String files; + + @Schema(description = "营业时间") + private String businessTime; + + @Schema(description = "商户简介") + private String content; + + @Schema(description = "是否自营") + private Integer ownStore; + + @Schema(description = "每小时价格") + private BigDecimal price; + + @Schema(description = "是否推荐") + private Integer recommend; + + @Schema(description = "是否需要审核") + private Boolean goodsReview; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "管理入口") + private String adminUrl; + + @Schema(description = "所有人") + private Integer userId; + + @Schema(description = "状态") + private Integer status; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "排序号") + private Integer sortNumber; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "默认商户管理员角色ID") + @TableField(exist = false) + private Integer roleId; + + @Schema(description = "角色名称") + @TableField(exist = false) + private String roleName; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/MerchantAccount.java b/src/main/java/com/gxwebsoft/common/system/entity/MerchantAccount.java new file mode 100644 index 0000000..674a06b --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/MerchantAccount.java @@ -0,0 +1,92 @@ +package com.gxwebsoft.common.system.entity; + +import cn.hutool.core.util.DesensitizedUtil; +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 com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.Date; + +/** + * 商户账号 + * + * @author 科技小王子 + * @since 2024-04-19 12:02:24 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "MerchantAccount对象", description = "商户账号") +@TableName("sys_merchant_account") +public class MerchantAccount implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "ID") + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @Schema(description = "商户手机号") + private String phone; + + @Schema(description = "账号密码") + @TableField(exist = false) + private String password; + + @Schema(description = "真实姓名") + private String realName; + + @Schema(description = "商户ID") + private Long merchantId; + + @Schema(description = "角色ID") + private Integer roleId; + + @Schema(description = "角色名称") + private String roleName; + + @Schema(description = "用户ID") + private Integer userId; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "状态") + private Integer status; + + @Schema(description = "排序号") + private Integer sortNumber; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "商户名称") + @TableField(exist = false) + private String merchantName; + + @Schema(description = "是否需要审核") + @TableField(exist = false) + private Boolean goodsReview; + + @Schema(description = "手机号(脱敏)") + @TableField(exist = false) + private String mobile; + + @Schema(description = "是否管理员") + @TableField(exist = false) + private Boolean isAdmin; + + public String getMobile(){ + return DesensitizedUtil.mobilePhone(this.phone); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/MerchantApply.java b/src/main/java/com/gxwebsoft/common/system/entity/MerchantApply.java new file mode 100644 index 0000000..a3afde9 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/MerchantApply.java @@ -0,0 +1,88 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 商户入驻申请 + * + * @author 科技小王子 + * @since 2024-04-05 01:24:36 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "MerchantApply对象", description = "商户入驻申请") +@TableName("sys_merchant_apply") +public class MerchantApply implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "ID") + @TableId(value = "apply_id", type = IdType.AUTO) + private Integer applyId; + + @Schema(description = "商户名称") + private String merchantName; + + @Schema(description = "商户图标") + private String image; + + @Schema(description = "商户手机号") + private String phone; + + @Schema(description = "商户姓名") + private String realName; + + @Schema(description = "店铺类型") + private String shopType; + + @Schema(description = "商户分类") + private String category; + + @Schema(description = "手续费") + private BigDecimal commission; + + @Schema(description = "关键字") + private String keywords; + + @Schema(description = "资质图片") + private String files; + + @Schema(description = "是否自营") + private Integer ownStore; + + @Schema(description = "是否推荐") + private Integer recommend; + + @Schema(description = "是否需要审核") + private Integer goodsReview; + + @Schema(description = "用户ID") + private Integer userId; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "状态") + private Integer status; + + @Schema(description = "排序号") + private Integer sortNumber; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/MerchantType.java b/src/main/java/com/gxwebsoft/common/system/entity/MerchantType.java new file mode 100644 index 0000000..ec2d44f --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/MerchantType.java @@ -0,0 +1,51 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.Date; + +/** + * 商户类型 + * + * @author 科技小王子 + * @since 2024-04-05 00:08:51 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "MerchantType对象", description = "商户类型") +@TableName("sys_merchant_type") +public class MerchantType implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "ID") + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @Schema(description = "店铺类型") + private String name; + + @Schema(description = "店铺入驻条件") + private String comments; + + @Schema(description = "状态") + private Integer status; + + @Schema(description = "排序号") + private Integer sortNumber; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/Modules.java b/src/main/java/com/gxwebsoft/common/system/entity/Modules.java new file mode 100644 index 0000000..ef46167 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/Modules.java @@ -0,0 +1,62 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 模块管理 + * + * @author 科技小王子 + * @since 2023-10-18 15:53:43 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "Modules对象", description = "模块管理") +@TableName("sys_modules") +public class Modules implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "插件id") + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @Schema(description = "环境编号") + private String modules; + + @Schema(description = "模块访问地址") + private String modulesUrl; + + @Schema(description = "排序号") + private Integer sortNumber; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "状态, 10待审核 20已通过 30已驳回") + private Integer status; + + @Schema(description = "用户ID") + private Integer userId; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/Mp.java b/src/main/java/com/gxwebsoft/common/system/entity/Mp.java new file mode 100644 index 0000000..ca0b664 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/Mp.java @@ -0,0 +1,103 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.Date; + +/** + * 小程序信息 + * + * @author 科技小王子 + * @since 2024-07-21 23:03:05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "Mp对象", description = "小程序信息") +@TableName("cms_mp") +public class Mp implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "ID") + @TableId(value = "mp_id", type = IdType.AUTO) + private Integer mpId; + + @Schema(description = "是否主账号") + private Integer type; + + @Schema(description = "小程序ID") + private String appId; + + @Schema(description = "小程序密钥") + private String appSecret; + + @Schema(description = "小程序名称") + private String mpName; + + @Schema(description = "小程序简称") + private String shortName; + + @Schema(description = "头像") + private String avatar; + + @Schema(description = "小程序码") + private String mpQrcode; + + @Schema(description = "微信认证") + private Integer authentication; + + @Schema(description = "主体信息") + private String companyName; + + @Schema(description = "小程序备案") + private String icpNo; + + @Schema(description = "登录邮箱") + private String email; + + @Schema(description = "登录密码") + private String password; + + @Schema(description = "原始ID") + private String ghId; + + @Schema(description = "入口页面") + private String mainPath; + + @Schema(description = "过期时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date expirationTime; + + @Schema(description = "排序(数字越小越靠前)") + private Integer sortNumber; + + @Schema(description = "介绍") + private String comments; + + @Schema(description = "用户ID") + private Integer userId; + + @Schema(description = "状态, 0正常, 1冻结") + private Integer status; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "注册时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "登录凭证") + @TableField(exist = false) + private String code; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/Notice.java b/src/main/java/com/gxwebsoft/common/system/entity/Notice.java new file mode 100644 index 0000000..37d122c --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/Notice.java @@ -0,0 +1,97 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.*; + +import java.util.Date; +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 消息记录表 + * + * @author 科技小王子 + * @since 2023-10-08 13:22:21 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "Notice对象", description = "消息记录表") +@TableName("sys_notice") +public class Notice implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "ID") + @TableId(value = "notice_id", type = IdType.AUTO) + private Integer noticeId; + + @Schema(description = "消息类型") + private String type; + + @Schema(description = "标题") + private String title; + + @Schema(description = "图标") + private String icon; + + @Schema(description = "颜色") + private String color; + + @Schema(description = "内容") + private String content; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "消息来源") + private String source; + + @Schema(description = "来源记录ID") + private Integer sourceId; + + @Schema(description = "路由地址") + private String path; + + @Schema(description = "是否已查阅") + private Integer isRead; + + @Schema(description = "渠道, 0发送 1回复") + private Integer channel; + + @Schema(description = "任务状态") + private Integer progress; + + @Schema(description = "用户ID") + private Integer userId; + + @Schema(description = "状态, 0待处理, 1已完成") + private Integer status; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "注册时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + @Schema(description = "开发者名称") + @TableField(exist = false) + private String nickname; + + @Schema(description = "开发者头像") + @TableField(exist = false) + private String avatar; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/OperationRecord.java b/src/main/java/com/gxwebsoft/common/system/entity/OperationRecord.java new file mode 100644 index 0000000..f3607af --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/OperationRecord.java @@ -0,0 +1,98 @@ +package com.gxwebsoft.common.system.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 com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 操作日志 + * + * @author WebSoft + * @since 2018-12-24 16:10:33 + */ +@Data +@Schema(description = "操作日志") +@TableName("sys_operation_record") +public class OperationRecord implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "主键id") + @TableId(type = IdType.AUTO) + private Integer id; + + @Schema(description = "用户id") + private Integer userId; + + @Schema(description = "操作模块") + private String module; + + @Schema(description = "操作功能") + private String description; + + @Schema(description = "请求地址") + private String url; + + @Schema(description = "请求方式") + private String requestMethod; + + @Schema(description = "调用方法") + private String method; + + @Schema(description = "请求参数") + private String params; + + @Schema(description = "返回结果") + private String result; + + @Schema(description = "异常信息") + private String error; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "消耗时间, 单位毫秒") + private Long spendTime; + + @Schema(description = "操作系统") + private String os; + + @Schema(description = "设备名称") + private String device; + + @Schema(description = "浏览器类型") + private String browser; + + @Schema(description = "ip地址") + private String ip; + + @Schema(description = "状态, 0成功, 1异常") + private Integer status; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "操作时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + @Schema(description = "用户昵称") + @TableField(exist = false) + private String nickname; + + @Schema(description = "用户账号") + @TableField(exist = false) + private String username; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/Order.java b/src/main/java/com/gxwebsoft/common/system/entity/Order.java new file mode 100644 index 0000000..d0b2aef --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/Order.java @@ -0,0 +1,185 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.gxwebsoft.common.system.param.MenuParam; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +/** + * 订单 + * + * @author 科技小王子 + * @since 2024-10-16 12:32:52 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "Order对象", description = "订单") +@TableName("sys_order") +public class Order implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "订单号") + @TableId(value = "order_id", type = IdType.AUTO) + private Integer orderId; + + @Schema(description = "订单编号") + private String orderNo; + + @Schema(description = "订单类型,0产品 1插件") + private Integer type; + + @Schema(description = "下单渠道,0网站 1小程序 2其他") + private Integer channel; + + @Schema(description = "微信支付订单号") + private String transactionId; + + @Schema(description = "微信退款订单号") + private String refundOrder; + + @Schema(description = "使用的优惠券id") + private Integer couponId; + + @Schema(description = "真实姓名") + private String realName; + + @Schema(description = "手机号码") + private String phone; + + @Schema(description = "订单总额") + private BigDecimal totalPrice; + + @Schema(description = "减少的金额,使用VIP会员折扣、优惠券抵扣、优惠券折扣后减去的价格") + private BigDecimal reducePrice; + + @Schema(description = "实际付款") + private BigDecimal payPrice; + + @Schema(description = "用于统计") + private BigDecimal price; + + @Schema(description = "价钱,用于积分赠送") + private BigDecimal money; + + @Schema(description = "退款金额") + private BigDecimal refundMoney; + + @Schema(description = "购买数量") + private Integer totalNum; + + @Schema(description = "0余额支付, 1微信支付,102微信Native,2会员卡支付,3支付宝,4现金,5POS机") + private Integer payType; + + @Schema(description = "0未付款,1已付款") + private Boolean payStatus; + + @Schema(description = "0未完成,1已完成,2已取消,3取消中,4退款申请中,5退款被拒绝,6退款成功,7客户端申请退款") + private Integer orderStatus; + + @Schema(description = "优惠类型:0无、1抵扣优惠券、2折扣优惠券、3、VIP月卡、4VIP年卡,5VIP次卡、6VIP会员卡、7IC月卡、8IC年卡、9IC次卡、10IC会员卡、11免费订单、12VIP充值卡、13IC充值卡、14VIP季卡、15IC季卡") + private Integer couponType; + + @Schema(description = "优惠说明") + private String couponDesc; + + @Schema(description = "二维码地址,保存订单号,支付成功后才生成") + private String qrcode; + + @Schema(description = "预约详情开始时间数组") + private Long startTime; + + @Schema(description = "是否已开具发票:0未开发票,1已开发票,2不能开具发票") + private Boolean isInvoice; + + @Schema(description = "发票流水号") + private String invoiceNo; + + @Schema(description = "支付时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date payTime; + + @Schema(description = "退款时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date refundTime; + + @Schema(description = "申请退款时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date refundApplyTime; + + @Schema(description = "过期时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date expirationTime; + + @Schema(description = "对账情况:0=未对账;1=已对账;3=已对账,金额对不上;4=未查询到该订单") + private Integer checkBill; + + @Schema(description = "订单是否已结算(0未结算 1已结算)") + private Integer isSettled; + + @Schema(description = "系统版本号 0当前版本 value=其他版本") + private Integer version; + + @Schema(description = "用户id") + private Integer userId; + + @Schema(description = "产品控制台") + private String adminUrl; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "排序号") + private Integer sortNumber; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "购买时长") + @TableField(exist = false) + private Integer month; + + @Schema(description = "购买数量") + @TableField(exist = false) + private Integer cartNum; + + @Schema(description = "应用列表") + private List list; + + @Schema(description = "插件安装参数") + @TableField(exist = false) + private MenuParam menuParam; + + @Schema(description = "应用名称") + @TableField(exist = false) + private String tenantName; + + @Schema(description = "应用图标") + @TableField(exist = false) + private String logo; + + @Schema(description = "订单商品") + @TableField(exist = false) + private List orderGoods; + + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/OrderGoods.java b/src/main/java/com/gxwebsoft/common/system/entity/OrderGoods.java new file mode 100644 index 0000000..b5fbb1e --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/OrderGoods.java @@ -0,0 +1,112 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 订单商品 + * + * @author 科技小王子 + * @since 2024-10-26 12:18:05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "OrderGoods对象", description = "订单商品") +@TableName("sys_order_goods") +public class OrderGoods implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "订单号") + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @Schema(description = "订单类型,0商城 1应用插件") + private Integer type; + + @Schema(description = "订单号") + private Integer orderId; + + @Schema(description = "项目ID") + private Integer itemId; + + @Schema(description = "插件ID") + private Integer menuId; + + @Schema(description = "实际付款") + private BigDecimal payPrice; + + @Schema(description = "购买时长") + private Integer month; + + @Schema(description = "购买数量") + private Integer totalNum; + + @Schema(description = "0未付款,1已付款") + private Boolean payStatus; + + @Schema(description = "0未完成,1已完成,2已取消,3取消中,4退款申请中,5退款被拒绝,6退款成功,7客户端申请退款") + private Integer orderStatus; + + @Schema(description = "预约详情开始时间数组") + private String startTime; + + @Schema(description = "是否已开具发票:0未开发票,1已开发票,2不能开具发票") + private Boolean isInvoice; + + @Schema(description = "发票流水号") + private String invoiceNo; + + @Schema(description = "支付时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date payTime; + + @Schema(description = "过期时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date expirationTime; + + @Schema(description = "用户id") + private Integer userId; + + @Schema(description = "应用名称") + private String appName; + + @Schema(description = "产品控制台") + private String adminUrl; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "排序号") + private Integer sortNumber; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "应用名称") + @TableField(exist = false) + private String tenantName; + + @Schema(description = "应用图标") + @TableField(exist = false) + private String logo; +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/OrderInfo.java b/src/main/java/com/gxwebsoft/common/system/entity/OrderInfo.java new file mode 100644 index 0000000..b074dee --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/OrderInfo.java @@ -0,0 +1,105 @@ +package com.gxwebsoft.common.system.entity; + +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * + * + * @author 科技小王子 + * @since 2024-05-10 18:02:54 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "OrderInfo对象", description = "") +@TableName("sys_order_info") +public class OrderInfo implements Serializable { + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @Schema(description = "关联订单表id") + private Integer oid; + + @Schema(description = "关联场馆id") + private Integer sid; + + @Schema(description = "关联场地id") + private Integer fid; + + @Schema(description = "场馆") + private String siteName; + + @Schema(description = "场地") + private String fieldName; + + @Schema(description = "预约时间段") + private String dateTime; + + @Schema(description = "单价") + private BigDecimal price; + + @Schema(description = "儿童价") + private BigDecimal childrenPrice; + + @Schema(description = "成人人数") + private Integer adultNum; + + @Schema(description = "儿童人数") + private Integer childrenNum; + + @Schema(description = "1已付款,2未付款,3无需付款或占用状态") + private Integer payStatus; + + @Schema(description = "是否免费:1免费、2收费") + private Integer isFree; + + @Schema(description = "是否支持儿童票:1支持,2不支持") + private Integer isChildren; + + @Schema(description = "预订类型:1全场,2半场") + private Integer type; + + @Schema(description = "组合数据:日期+时间段+场馆id+场地id") + private String mergeData; + + @Schema(description = "开场时间") + private Integer startTime; + + @Schema(description = "下单时间") + private Long orderTime; + + @Schema(description = "毫秒时间戳") + private Long timeFlag; + + @Schema(description = "系统版本") + private Integer version; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/Organization.java b/src/main/java/com/gxwebsoft/common/system/entity/Organization.java new file mode 100644 index 0000000..74da3de --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/Organization.java @@ -0,0 +1,145 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.*; + +import java.math.BigDecimal; +import java.util.Date; +import java.io.Serializable; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 组织机构 + * + * @author WebSoft + * @since 2020-03-14 11:29:04 + */ +@Data +@Schema(description = "组织机构") +@TableName("sys_organization") +public class Organization implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "机构id") + @TableId(type = IdType.AUTO) + private Integer organizationId; + + @Schema(description = "上级id, 0是顶级") + private Integer parentId; + + @Schema(description = "机构名称") + private String organizationName; + + @Schema(description = "机构全称") + private String organizationFullName; + + @Schema(description = "机构代码") + private String organizationCode; + + @Schema(description = "机构类型, 字典标识") + private String organizationType; + + @Schema(description = "所在省份") + private String province; + + @Schema(description = "所在城市") + private String city; + + @Schema(description = "所在辖区") + private String region; + + @Schema(description = "邮政编码") + private String zipCode; + + @Schema(description = "所属园区") + private String park; + + @Schema(description = "机构图片") + private String image; + + @Schema(description = "园区介绍") + private String about; + + @Schema(description = "联系电话") + private String phone; + + @Schema(description = "企业邮箱") + private String email; + + @Schema(description = "成立时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date establishTime; + + @Schema(description = "注册资金") + private BigDecimal registeredCapital; + + @Schema(description = "经营范围") + private String business; + + @Schema(description = "经营状态") + private String businessStatus; + + @Schema(description = "参保人数") + private Integer insureds; + + @Schema(description = "所属行业") + private String industry; + + @Schema(description = "所属产业") + private String estate; + + @Schema(description = "负责人id") + private Integer leaderId; + + @Schema(description = "是否合作单位") + private Integer isCoop; + + @Schema(description = "是否办公室主任") + private Integer isChief; + + @Schema(description = "法定代表人") + private String legalPerson; + + @Schema(description = "成立日期") + private String setUpDate; + + @Schema(description = "企业标签") + private String tag; + + @Schema(description = "排序号") + private Integer sortNumber; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + @Schema(description = "机构类型名称") + @TableField(exist = false) + private String organizationTypeName; + + @Schema(description = "负责人姓名") + @TableField(exist = false) + private String leaderNickname; + + @Schema(description = "负责人账号") + @TableField(exist = false) + private String leaderUsername; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/Payment.java b/src/main/java/com/gxwebsoft/common/system/entity/Payment.java new file mode 100644 index 0000000..92466ac --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/Payment.java @@ -0,0 +1,100 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableLogic; +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 支付方式 + * + * @author 科技小王子 + * @since 2024-05-11 12:39:11 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "Payment对象", description = "支付方式") +@TableName("sys_payment") +public class Payment implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "ID") + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @Schema(description = "支付方式") + private String name; + + @Schema(description = "类型") + private Integer type; + + @Schema(description = "标识") + private String code; + + @Schema(description = "支付图标") + private String image; + + @Schema(description = "微信商户号类型 1普通商户2子商户") + private Integer wechatType; + + @Schema(description = "应用ID") + private String appId; + + @Schema(description = "商户号") + private String mchId; + + @Schema(description = "设置APIv3密钥") + private String apiKey; + + @Schema(description = "证书文件 (CERT)") + private String apiclientCert; + + @Schema(description = "证书文件 (KEY)") + private String apiclientKey; + + @Schema(description = "公钥文件 (KEY)") + private String pubKey; + + @Schema(description = "公钥ID") + private String pubKeyId; + + @Schema(description = "商户证书序列号") + private String merchantSerialNumber; + + @Schema(description = "支付结果通知") + private String notifyUrl; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "文章排序(数字越小越靠前)") + private Integer sortNumber; + + @Schema(description = "状态, 0未启用, 1启用") + private Boolean status; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "注册时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/Plug.java b/src/main/java/com/gxwebsoft/common/system/entity/Plug.java new file mode 100644 index 0000000..4b7b422 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/Plug.java @@ -0,0 +1,86 @@ +package com.gxwebsoft.common.system.entity; + +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableLogic; +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 插件扩展 + * + * @author 科技小王子 + * @since 2023-10-12 09:53:07 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "Plug对象", description = "插件扩展") +@TableName("sys_plug") +public class Plug implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "插件id") + @TableId(value = "plug_id", type = IdType.AUTO) + private Integer plugId; + + @Schema(description = "菜单名称") + private String plugName; + + @Schema(description = "插件ID") + private String plugCode; + + @Schema(description = "插件类型 10后台模块") + private Integer plugType; + + @Schema(description = "排序号") + private Integer sortNumber; + + @Schema(description = "插件价格") + private BigDecimal price; + + @Schema(description = "评分") + private BigDecimal score; + + @Schema(description = "下载次数") + private Integer clicks; + + @Schema(description = "安装次数") + private Integer installs; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "插件详情") + private String content; + + @Schema(description = "状态, 10待审核 20已通过 30已驳回") + private Integer status; + + @Schema(description = "用户ID") + private Integer userId; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/RechargeOrder.java b/src/main/java/com/gxwebsoft/common/system/entity/RechargeOrder.java new file mode 100644 index 0000000..7570a44 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/RechargeOrder.java @@ -0,0 +1,134 @@ +package com.gxwebsoft.common.system.entity; + +import cn.hutool.core.util.DesensitizedUtil; +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 会员充值订单表 + * + * @author 科技小王子 + * @since 2024-07-26 23:18:48 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "RechargeOrder对象", description = "会员充值订单表") +@TableName("sys_recharge_order") +public class RechargeOrder implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "订单ID") + @TableId(value = "order_id", type = IdType.AUTO) + private Integer orderId; + + @Schema(description = "订单号") + private String orderNo; + + @Schema(description = "用户ID") + private Integer userId; + + @Schema(description = "充值方式(10自定义金额 20套餐充值)") + private Integer rechargeType; + + @Schema(description = "机构id") + private Integer organizationId; + + @Schema(description = "充值套餐ID") + private Integer planId; + + @Schema(description = "用户支付金额") + private BigDecimal payPrice; + + @Schema(description = "赠送金额") + private BigDecimal giftMoney; + + @Schema(description = "实际到账金额") + private BigDecimal actualMoney; + + @Schema(description = "用户可用余额") + private BigDecimal balance; + + @Schema(description = "支付方式(微信/支付宝)") + private String payMethod; + + @Schema(description = "支付状态(10待支付 20已支付)") + private Integer payStatus; + + @Schema(description = "付款时间") + private Integer payTime; + + @Schema(description = "第三方交易记录ID") + private Integer tradeId; + + @Schema(description = "来源客户端 (APP、H5、小程序等)") + private String platform; + + @Schema(description = "所属门店ID") + private Integer shopId; + + @Schema(description = "操作员") + private String operator; + + @Schema(description = "排序(数字越小越靠前)") + private Integer sortNumber; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "状态, 0正常, 1冻结") + private Integer status; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "商户编码") + private String merchantCode; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "注册时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + @Schema(description = "昵称") + @TableField(exist = false) + private String nickname; + + @Schema(description = "用户头像") + @TableField(exist = false) + private String avatar; + + @Schema(description = "真实姓名") + @TableField(exist = false) + private String realName; + + @Schema(description = "手机号码") + @TableField(exist = false) + private String phone; + + @Schema(description = "手机号码(脱敏)") + @TableField(exist = false) + private String mobile; + + @Schema(description = "部门名称") + @TableField(exist = false) + private String organizationName; + + public String getMobile(){ + return DesensitizedUtil.mobilePhone(this.phone); + } +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/Role.java b/src/main/java/com/gxwebsoft/common/system/entity/Role.java new file mode 100644 index 0000000..5907ac5 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/Role.java @@ -0,0 +1,59 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 角色 + * + * @author WebSoft + * @since 2018-12-24 16:10:01 + */ +@Data +@Schema(description = "角色") +@TableName("sys_role") +public class Role implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "角色id") + @TableId(type = IdType.AUTO) + private Integer roleId; + + @Schema(description = "角色标识") + private String roleCode; + + @Schema(description = "角色名称") + private String roleName; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "排序号") + private Integer sortNumber; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + @Schema(hidden = true) + @TableField(exist = false) + private Integer userId; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/RoleMenu.java b/src/main/java/com/gxwebsoft/common/system/entity/RoleMenu.java new file mode 100644 index 0000000..da457a0 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/RoleMenu.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 角色菜单 + * + * @author WebSoft + * @since 2018-12-24 16:10:54 + */ +@Data +@Schema(description = "角色权限") +@TableName("sys_role_menu") +public class RoleMenu implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "主键id") + @TableId(type = IdType.AUTO) + private Integer id; + + @Schema(description = "角色id") + private Integer roleId; + + @Schema(description = "菜单id") + private Integer menuId; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/Setting.java b/src/main/java/com/gxwebsoft/common/system/entity/Setting.java new file mode 100644 index 0000000..c52fcfb --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/Setting.java @@ -0,0 +1,61 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.Date; + +/** + * 系统设置 + * + * @author WebSoft + * @since 2022-11-19 13:54:27 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "Setting对象", description = "系统设置") +@TableName("sys_setting") +public class Setting implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "id") + @TableId(value = "setting_id", type = IdType.AUTO) + private Integer settingId; + + @Schema(description = "设置项标示") + private String settingKey; + + @Schema(description = "设置内容(json格式)") + private String content; + + @Schema(description = "排序号") + private Integer sortNumber; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + @Schema(description = "修改租户名称") + @TableField(exist = false) + private String tenantName; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/SysFileType.java b/src/main/java/com/gxwebsoft/common/system/entity/SysFileType.java new file mode 100644 index 0000000..db9802b --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/SysFileType.java @@ -0,0 +1,46 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.Date; + +/** + * 存储类型 + * + * @author 科技小王子 + * @since 2025-05-16 14:24:28 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "SysFileType对象", description = "存储类型") +public class SysFileType implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "主键id") + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @Schema(description = "0本地存储,1阿里云oss,2腾讯云cos,3七牛云,4其他") + private Integer type; + + @Schema(description = "名称") + private String name; + + @Schema(description = "访问域名") + private String path; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/TemplateMessage.java b/src/main/java/com/gxwebsoft/common/system/entity/TemplateMessage.java new file mode 100644 index 0000000..8d1f7f6 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/TemplateMessage.java @@ -0,0 +1,49 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * 微信公众号模板消息对象 + * + * @author WebSoft + * @since 2018-12-24 16:10:54 + */ +@Data +@Schema(description = "微信公众号模板消息对象") +public class TemplateMessage implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "接收者openid") + @TableField(exist = false) + private String toUser; + + @Schema(description = "模板ID") + @TableField(exist = false) + private String templateId; + + @Schema(description = "模板跳转链接(海外账号没有跳转能力)") + @TableField(exist = false) + private String url; + + @Schema(description = "跳小程序所需数据,不需跳小程序可不用传该数据") + @TableField(exist = false) + private String miniProgram; + + @Schema(description = "所需跳转到的小程序appid(该小程序appid必须与发模板消息的公众号是绑定关联关系,暂不支持小游戏)") + @TableField(exist = false) + private String appid; + + @Schema(description = "所需跳转到小程序的具体页面路径,支持带参数,(示例index?foo=bar),要求该小程序已发布,暂不支持小游戏") + @TableField(exist = false) + private String pagePath; + + @Schema(description = "模板数据") + @TableField(exist = false) + private Object data; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/TemplateMessageDTO.java b/src/main/java/com/gxwebsoft/common/system/entity/TemplateMessageDTO.java new file mode 100644 index 0000000..56db40d --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/TemplateMessageDTO.java @@ -0,0 +1,35 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * 微信公众号模板消息对象 + * + * @author WebSoft + * @since 2018-12-24 16:10:54 + */ +@Data +@Schema(description = "模板消息内容") +public class TemplateMessageDTO implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "消息实参") + @TableField(exist = false) + private String value; + + @Schema(description = "消息颜色") + private String color; + + public TemplateMessageDTO(String value) { + this.value = value; + } + public TemplateMessageDTO(String value, String color) { + this.value = value; + this.color = color; + } +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/Tenant.java b/src/main/java/com/gxwebsoft/common/system/entity/Tenant.java new file mode 100644 index 0000000..3ba8201 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/Tenant.java @@ -0,0 +1,136 @@ +package com.gxwebsoft.common.system.entity; + +import cn.hutool.core.util.DesensitizedUtil; +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * 租户 + * + * @author 科技小王子 + * @since 2023-07-17 17:49:53 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "Tenant对象", description = "租户") +@TableName("sys_tenant") +public class Tenant implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "租户id") + @TableId(value = "tenant_id", type = IdType.AUTO) + private Integer tenantId; + + @Schema(description = "租户名称") + private String tenantName; + + @Schema(description = "租户编号") + private String tenantCode; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "状态") + private Integer status; + + @Schema(description = "排序号") + private Integer sortNumber; + + @Schema(description = "用户ID") + private Integer userId; + + @Schema(description = "当前订阅ID") + private Long subscriptionId; + + @Schema(description = "是否试用中") + private Integer isTrial; + + @Schema(description = "试用结束时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date trialEndTime; + + @Schema(description = "自动续费") + private Integer autoRenewal; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + @Schema(description = "菜单信息") + @TableField(exist = false) + private List menu; + + @Schema(description = "企业信息") + @TableField(exist = false) + private Company company; + + @Schema(description = "企业名称") + @TableField(exist = false) + private String companyName; + + @Schema(description = "logo") + @TableField(exist = false) + private String logo; + + @Schema(description = "配置信息") + @TableField(exist = false) + private Object config; + + @Schema(description = "服务器时间") + @TableField(exist = false) + private Object date; + + @Schema(description = "用户名") + @TableField(exist = false) + private String username; + + @Schema(description = "手机号码") + @TableField(exist = false) + private String phone; + + @Schema(description = "管理地址") + @TableField(exist = false) + private String adminUrl; + + @Schema(description = "顶级域名") + @TableField(exist = false) + private String domain; + + @Schema(description = "免费域名") + @TableField(exist = false) + private String freeDomain; + + /** + * 是否脱敏手机号,默认true脱敏 + */ + @TableField(exist = false) + @Schema(description = "手机号是否脱敏,默认true") + private boolean phoneMasked = true; + + public String getPhone(){ + if (phoneMasked) { + return DesensitizedUtil.mobilePhone(this.phone); + } + return this.phone; + } + + public void setPhoneMasked(boolean masked) { + this.phoneMasked = masked; + } +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/TenantPackage.java b/src/main/java/com/gxwebsoft/common/system/entity/TenantPackage.java new file mode 100644 index 0000000..25d5e36 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/TenantPackage.java @@ -0,0 +1,76 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 租户套餐 + * + * @author WebSoft + * @since 2025-12-12 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "TenantPackage对象", description = "租户套餐") +@TableName("sys_tenant_package") +public class TenantPackage implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "套餐ID") + @TableId(value = "package_id", type = IdType.AUTO) + private Integer packageId; + + @Schema(description = "套餐名称") + private String packageName; + + @Schema(description = "版本号 0试用 10基础 20专业 30企业 99私有") + private Integer version; + + @Schema(description = "月付价格") + private BigDecimal priceMonthly; + + @Schema(description = "年付价格") + private BigDecimal priceYearly; + + @Schema(description = "季付价格") + private BigDecimal priceQuarterly; + + @Schema(description = "最大用户数 0无限") + private Integer maxUsers; + + @Schema(description = "最大订单数 0无限") + private Integer maxOrders; + + @Schema(description = "存储空间限制(MB) 0无限") + private Long storageLimit; + + @Schema(description = "API调用限制(次/天) 0无限") + private Integer apiLimit; + + @Schema(description = "试用天数") + private Integer trialDays; + + @Schema(description = "功能列表JSON") + private String features; + + @Schema(description = "状态 0下架 1上架") + private Integer status; + + @Schema(description = "排序号") + private Integer sortNumber; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date updateTime; +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/TenantSubscription.java b/src/main/java/com/gxwebsoft/common/system/entity/TenantSubscription.java new file mode 100644 index 0000000..682fabf --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/TenantSubscription.java @@ -0,0 +1,83 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.Date; + +/** + * 租户订阅记录 + * + * @author WebSoft + * @since 2025-12-12 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "TenantSubscription对象", description = "租户订阅记录") +@TableName("sys_tenant_subscription") +public class TenantSubscription implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "订阅ID") + @TableId(value = "subscription_id", type = IdType.AUTO) + private Long subscriptionId; + + @Schema(description = "租户ID") + private Integer tenantId; + + @Schema(description = "当前套餐ID") + private Integer packageId; + + @Schema(description = "套餐名称") + private String packageName; + + @Schema(description = "当前版本") + private Integer version; + + @Schema(description = "开始时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date startTime; + + @Schema(description = "到期时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date endTime; + + @Schema(description = "是否试用期") + private Integer isTrial; + + @Schema(description = "是否已过期 0否 1是") + private Integer isExpired; + + @Schema(description = "自动续费 0关闭 1开启") + private Integer autoRenewal; + + @Schema(description = "续费套餐ID") + private Integer renewalPackageId; + + @Schema(description = "提醒状态 0未提醒 1已提醒30天 2已提醒7天 3已提醒1天") + private Integer notifyStatus; + + @Schema(description = "状态 0停用 1正常") + private Integer status; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date updateTime; + + // 关联查询字段 + @Schema(description = "套餐信息") + @TableField(exist = false) + private TenantPackage tenantPackage; + + @Schema(description = "租户信息") + @TableField(exist = false) + private Tenant tenant; +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/TenantSubscriptionOrder.java b/src/main/java/com/gxwebsoft/common/system/entity/TenantSubscriptionOrder.java new file mode 100644 index 0000000..37dcd25 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/TenantSubscriptionOrder.java @@ -0,0 +1,103 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 租户订阅订单 + * + * @author WebSoft + * @since 2025-12-12 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "TenantSubscriptionOrder对象", description = "租户订阅订单") +@TableName("sys_tenant_subscription_order") +public class TenantSubscriptionOrder implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "订单ID") + @TableId(value = "order_id", type = IdType.AUTO) + private Long orderId; + + @Schema(description = "订单编号") + private String orderNo; + + @Schema(description = "租户ID") + private Integer tenantId; + + @Schema(description = "套餐ID") + private Integer packageId; + + @Schema(description = "套餐名称") + private String packageName; + + @Schema(description = "版本号") + private Integer version; + + @Schema(description = "支付周期 1月付 3季付 12年付") + private Integer payType; + + @Schema(description = "原价") + private BigDecimal originalPrice; + + @Schema(description = "优惠金额") + private BigDecimal discountPrice; + + @Schema(description = "实付金额") + private BigDecimal actualPrice; + + @Schema(description = "开始时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date startTime; + + @Schema(description = "到期时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date endTime; + + @Schema(description = "是否试用 0否 1是") + private Integer isTrial; + + @Schema(description = "是否续费 0首购 1续费") + private Integer isRenewal; + + @Schema(description = "是否升级 0否 1是") + private Integer isUpgrade; + + @Schema(description = "升级前版本") + private Integer oldVersion; + + @Schema(description = "支付方式 wxpay/alipay/balance") + private String paymentMethod; + + @Schema(description = "支付流水号") + private String paymentId; + + @Schema(description = "支付时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date paymentTime; + + @Schema(description = "订单状态 0待支付 1已支付 2已激活 3已取消 4已退款") + private Integer orderStatus; + + @Schema(description = "取消原因") + private String cancelReason; + + @Schema(description = "操作用户ID") + private Integer userId; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date updateTime; +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/User.java b/src/main/java/com/gxwebsoft/common/system/entity/User.java new file mode 100644 index 0000000..432ae6f --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/User.java @@ -0,0 +1,381 @@ +package com.gxwebsoft.common.system.entity; + +import cn.hutool.core.util.DesensitizedUtil; +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.springframework.security.core.userdetails.UserDetails; + +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.List; + +/** + * 用户 + * + * @author WebSoft + * @since 2018-12-24 16:10:13 + */ +@Data +@Schema(description = "用户") +@TableName("sys_user") +public class User implements UserDetails { + private static final long serialVersionUID = 1L; + + @Schema(description = "用户id") + @TableId(type = IdType.AUTO) + private Integer userId; + + @Schema(description = "用户类型, 0普通用户") + private Integer type; + + @Schema(description = "用户编码") + private String userCode; + + @Schema(description = "第三方系统的用户ID") + private Integer uid; + + @Schema(description = "账号") + private String username; + + @Schema(description = "密码") + private String password; + + @Schema(description = "昵称") + private String nickname; + + @Schema(description = "头像") + private String avatar; + + @Schema(description = "头像") + private String bgImage; + + @Schema(description = "性别, 字典标识") + private String sex; + + @Schema(description = "手机号") + private String phone; + + @Schema(description = "邮箱") + private String email; + + @Schema(description = "资质") + private String aptitude; + + @Schema(description = "头衔") + private String title; + + @Schema(description = "特长") + private String speciality; + + @Schema(description = "支付密码") + private String payPassword; + + @Schema(description = "职务") + private String position; + + @Schema(description = "邮箱是否验证, 0否, 1是") + private Integer emailVerified; + + @Schema(description = "别名") + private String alias; + + @Schema(description = "真实姓名") + private String realName; + + @Schema(description = "身份证号(脱敏)") + private String idCard; + + @Schema(description = "身份证号") + @TableField(exist = false) + private String idCardNo; + + @Schema(description = "出生日期") + @JsonFormat(pattern = "yyyy-MM-dd") + private LocalDateTime birthday; + + @Schema(description = "年龄") + private Integer age; + + @Schema(description = "所在国家") + private String country; + + @Schema(description = "所在省份") + private String province; + + @Schema(description = "所在城市") + private String city; + + @Schema(description = "所在辖区") + private String region; + + @Schema(description = "街道地址") + private String address; + + @Schema(description = "行业类型(父级)") + private String industryParent; + + @Schema(description = "行业类型(子级)") + private String industryChild; + + @Schema(description = "经度") + private String longitude; + + @Schema(description = "纬度") + private String latitude; + + @Schema(description = "用户可用余额") + private BigDecimal balance; + + @Schema(description = "已提现金额") + private BigDecimal cashedMoney; + + @Schema(description = "用户可用积分") + private Integer points; + + @Schema(description = "用户总支付的金额") + private String payMoney; + + @Schema(description = "实际消费的金额(不含退款)") + private String expendMoney; + + @Schema(description = "会员等级ID") + private Integer gradeId; + + @Schema(description = "个人简介") + private String introduction; + + @Schema(description = "机构ID") + private Integer organizationId; + + @Schema(description = "会员分组ID") + private Integer groupId; + + @Schema(description = "会员分组") + @TableField(exist = false) + private String groupName; + + @Schema(description = "企业ID") + private Integer companyId; + + @Schema(description = "注册来源客户端") + private String platform; + + @Schema(description = "是否下线会员") + private Integer offline; + + @Schema(description = "关注数") + private Integer followers; + + @Schema(description = "粉丝数") + private Integer fans; + + @Schema(description = "获赞数") + private Integer likes; + + @Schema(description = "客户端ID") + private String clientId; + + @Schema(description = "可管理的商户") + private String merchants; + + @Schema(description = "商户ID") + private Long merchantId; + + @Schema(description = "商户名称") + private String merchantName; + + @Schema(description = "商户LOGO") + private String merchantAvatar; + + @Schema(description = "是否管理员") + private Boolean isAdmin; + + @Schema(description = "是否企业管理员") + private Integer isOrganizationAdmin; + + @Schema(description = "是否超级管理员") + private Boolean isSuperAdmin; + + @Schema(description = "租户管理员ID") + @TableField(exist = false) + private Integer adminId; + + @Schema(description = "用于一键登录控制台") + @TableField(exist = false) + private String adminToken; + + @Schema(description = "评论数") + private Integer commentNumbers; + + @Schema(description = "是否推荐") + private Integer recommend; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "专家角色") + private Integer expertType; + + @Schema(description = "状态, 0正常, 1冻结") + private Integer status; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "租户名称") + @TableField(exist = false) + private String tenantName; + + @Schema(description = "最后结算时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime settlementTime; + + @Schema(description = "注册时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime createTime; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime updateTime; + + @Schema(description = "公司名称") + @TableField(exist = false) + private String companyName; + + @Schema(description = "是否已实名认证") + private Boolean certification; + + @Schema(description = "机构名称") + @TableField(exist = false) + private String organizationName; + + @Schema(description = "性别名称") + @TableField(exist = false) + private String sexName; + + @Schema(description = "会员等级") + @TableField(exist = false) + private String gradeName; + + @Schema(description = "默认注册的角色ID") + @TableField(exist = false) + private Integer roleId; + + @Schema(description = "角色列表") + @TableField(exist = false) + private List roles; + + @Schema(description = "权限列表") + @TableField(exist = false) + private List authorities; + + @Schema(description = "微信凭证") + @TableField(exist = false) + private String code; + + @Schema(description = "推荐人ID") + @TableField(exist = false) + private Integer dealerId; + + @Schema(description = "微信openid") + private String openid; + + @Schema(description = "微信公众号openid") + private String officeOpenid; + + @Schema(description = "微信unionid") + private String unionid; + + @Schema(description = "累计登录次数") + private Integer loginNum; + + @Schema(description = "ico文件") + @TableField(exist = false) + private String logo; + + @Schema(description = "创建的应用数量") + @TableField(exist = false) + private Double apps; + + @Schema(description = "租户设置信息") + @TableField(exist = false) + private String setting; + + @Schema(description = "手机号(脱敏)") + @TableField(exist = false) + private String mobile; + + @Schema(description = "当期登录的商户账号") + @TableField(exist = false) + private MerchantAccount merchantAccount; + + @Schema(description = "推荐人用户信息") + @TableField(exist = false) + private User referee; + + @Schema(description = "手机号登录校验码") + @TableField(exist = false) + private String phoneLoginCode; + + @Schema(description = "校验码") + @TableField(exist = false) + private String authCode; + + @Schema(description = "是否有上级") + @TableField(exist = false) + private Boolean hasParent; + + @Schema(description = "同一个手机号码存在多个管理员账号") + @TableField(exist = false) + private Boolean hasAdminsByPhone; + + @Schema(description = "模板ID") + private Integer templateId; + + @Schema(description = "插件安装状态") + private Boolean installed; + +// @Schema(description = "企业信息") +// @TableField(exist = false) +// private Company companyInfo; + +// @Schema(description = "系统配置信息") +// @TableField(exist = false) +// private Object system; + + @Override + public boolean isAccountNonExpired() { + return true; + } + + @Override + public boolean isAccountNonLocked() { + return this.status != null && this.status == 0; + } + + @Override + public boolean isCredentialsNonExpired() { + return true; + } + + @Override + public boolean isEnabled() { + return true; + } + + public String getMobile(){ + return DesensitizedUtil.mobilePhone(this.phone); + } + + public String getIdCardNo(){ + return DesensitizedUtil.idCardNum(this.idCard,4,4); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/UserBalanceLog.java b/src/main/java/com/gxwebsoft/common/system/entity/UserBalanceLog.java new file mode 100644 index 0000000..cd90ab0 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/UserBalanceLog.java @@ -0,0 +1,87 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 用户余额变动明细表 + * + * @author 科技小王子 + * @since 2023-04-21 15:59:09 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "UserBalanceLog对象", description = "用户余额变动明细表") +@TableName("sys_user_balance_log") +public class UserBalanceLog implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "主键ID") + @TableId(value = "log_id", type = IdType.AUTO) + private Integer logId; + + @Schema(description = "用户ID") + private Integer userId; + + @Schema(description = "余额变动场景(10用户充值 20用户消费 30管理员操作 40订单退款)") + private Integer scene; + + @Schema(description = "变动金额") + private BigDecimal money; + + @Schema(description = "变动后余额") + private BigDecimal balance; + + @Schema(description = "订单编号") + private String orderNo; + + @Schema(description = "支付流水号") + private String transactionId; + + @Schema(description = "管理员备注") + private String remark; + + @Schema(description = "排序(数字越小越靠前)") + private Integer sortNumber; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "状态, 0正常, 1冻结") + private Integer status; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "商户编码") + private String merchantCode; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "注册时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + @Schema(description = "昵称") + @TableField(exist = false) + private String nickname; + + @Schema(description = "用户头像") + @TableField(exist = false) + private String avatar; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/UserCollection.java b/src/main/java/com/gxwebsoft/common/system/entity/UserCollection.java new file mode 100644 index 0000000..4a15bdc --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/UserCollection.java @@ -0,0 +1,46 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import java.util.Date; +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 我的收藏 + * + * @author 科技小王子 + * @since 2024-04-28 18:08:32 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "UserCollection对象", description = "我的收藏") +@TableName("sys_user_collection") +public class UserCollection implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "主键ID") + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @Schema(description = "租户ID") + private Integer tid; + + @Schema(description = "用户ID") + private Integer userId; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "注册时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/UserFile.java b/src/main/java/com/gxwebsoft/common/system/entity/UserFile.java new file mode 100644 index 0000000..70a9182 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/UserFile.java @@ -0,0 +1,79 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.*; + +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 用户文件 + * + * @author WebSoft + * @since 2022-07-21 14:34:40 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "UserFile对象", description = "用户文件") +@TableName("sys_user_file") +public class UserFile implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "主键id") + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @Schema(description = "用户id") + private Integer userId; + + @Schema(description = "文件名称") + private String name; + + @Schema(description = "是否是文件夹, 0否, 1是") + private Integer isDirectory; + + @Schema(description = "上级id") + private Integer parentId; + + @Schema(description = "文件路径") + private String path; + + @Schema(description = "文件大小") + private Integer length; + + @Schema(description = "文件类型") + private String contentType; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + @Schema(description = "文件访问地址") + @TableField(exist = false) + private String url; + + @Schema(description = "文件缩略图访问地址") + @TableField(exist = false) + private String thumbnail; + + @Schema(description = "文件下载地址") + @TableField(exist = false) + private String downloadUrl; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/UserGrade.java b/src/main/java/com/gxwebsoft/common/system/entity/UserGrade.java new file mode 100644 index 0000000..abd55a4 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/UserGrade.java @@ -0,0 +1,73 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableLogic; +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 用户会员等级表 + * + * @author 科技小王子 + * @since 2023-10-07 22:51:17 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "UserGrade对象", description = "用户会员等级表") +@TableName("sys_user_grade") +public class UserGrade implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "等级ID") + @TableId(value = "grade_id", type = IdType.AUTO) + private Integer gradeId; + + @Schema(description = "等级名称") + private String name; + + @Schema(description = "等级权重(1-9999)") + private Integer weight; + + @Schema(description = "升级条件") + private String upgrade; + + @Schema(description = "等级权益(折扣率0-100)") + private String equity; + + @Schema(description = "佣金比率") + private String commission; + + @Schema(description = "排序(数字越小越靠前)") + private Integer sortNumber; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "状态, 0正常, 1冻结") + private Integer status; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "注册时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/UserGroup.java b/src/main/java/com/gxwebsoft/common/system/entity/UserGroup.java new file mode 100644 index 0000000..9a7048f --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/UserGroup.java @@ -0,0 +1,61 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableLogic; +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 用户分组管理表 + * + * @author 科技小王子 + * @since 2023-10-28 15:16:39 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "UserGroup对象", description = "用户分组管理表") +@TableName("sys_user_group") +public class UserGroup implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "分组ID") + @TableId(value = "group_id", type = IdType.AUTO) + private Integer groupId; + + @Schema(description = "分组名称") + private String name; + + @Schema(description = "排序(数字越小越靠前)") + private Integer sortNumber; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "状态, 0正常, 1冻结") + private Integer status; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "注册时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/UserOauth.java b/src/main/java/com/gxwebsoft/common/system/entity/UserOauth.java new file mode 100644 index 0000000..9cbd8a8 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/UserOauth.java @@ -0,0 +1,69 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableLogic; +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 第三方用户信息表 + * + * @author 科技小王子 + * @since 2023-10-07 22:39:46 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "UserOauth对象", description = "第三方用户信息表") +@TableName("sys_user_oauth") +public class UserOauth implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "主键ID") + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @Schema(description = "用户ID") + private Integer userId; + + @Schema(description = "第三方登陆类型(MP-WEIXIN)") + private String oauthType; + + @Schema(description = "第三方用户唯一标识 (uid openid)") + private String oauthId; + + @Schema(description = "微信unionID") + private String unionid; + + @Schema(description = "排序(数字越小越靠前)") + private Integer sortNumber; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "状态, 0正常, 1冻结") + private Integer status; + + @Schema(description = "是否删除, 0否, 1是") + private Integer deleted; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "注册时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/UserReferee.java b/src/main/java/com/gxwebsoft/common/system/entity/UserReferee.java new file mode 100644 index 0000000..c6699c1 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/UserReferee.java @@ -0,0 +1,65 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.*; + +import java.util.Date; +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 用户推荐关系表 + * + * @author 科技小王子 + * @since 2023-10-07 22:56:36 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "UserReferee对象", description = "用户推荐关系表") +@TableName("sys_user_referee") +public class UserReferee implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "主键ID") + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @Schema(description = "推荐人ID") + private Integer dealerId; + + @Schema(description = "用户id(被推荐人)") + private Integer userId; + + @Schema(description = "推荐关系层级(1,2,3)") + private Integer level; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + @TableField(exist = false) + private User user; + + @TableField(exist = false) + private List userIdList; +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/UserRole.java b/src/main/java/com/gxwebsoft/common/system/entity/UserRole.java new file mode 100644 index 0000000..58a3900 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/UserRole.java @@ -0,0 +1,59 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; + +import java.time.LocalDateTime; +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 用户角色 + * + * @author 科技小王子 + * @since 2025-06-16 20:39:53 + */ +@Data +@Schema(description = "用户角色") +@TableName("sys_user_role") +public class UserRole implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "主键id") + @TableId(type = IdType.AUTO) + private Integer id; + + @Schema(description = "用户id") + private Integer userId; + + @Schema(description = "角色id") + private Integer roleId; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + @Schema(description = "角色名称") + @TableField(exist = false) + private String roleName; + + @Schema(description = "角色标识") + @TableField(exist = false) + private String roleCode; + + @Schema(description = "租户ID") + private Integer tenantId; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/UserVerify.java b/src/main/java/com/gxwebsoft/common/system/entity/UserVerify.java new file mode 100644 index 0000000..8a7ec7b --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/UserVerify.java @@ -0,0 +1,115 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.time.LocalDate; +import java.util.Date; + +/** + * 实名认证 + * + * @author 科技小王子 + * @since 2025-05-29 23:01:04 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "UserVerify对象", description = "实名认证") +@TableName("sys_user_verify") +public class UserVerify implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "自增ID") + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @Schema(description = "用户ID") + private Integer userId; + + @Schema(description = "认证类型, 0个人 1企业") + private Integer type; + + @Schema(description = "主体名称") + private String name; + + @Schema(description = "真实姓名") + private String realName; + + @Schema(description = "证件号码") + private String idCard; + + @Schema(description = "出生日期") + private LocalDate birthday; + + @Schema(description = "正面") + private String sfz1; + + @Schema(description = "反面") + private String sfz2; + + @Schema(description = "营业执照号码") + private String zzCode; + + @Schema(description = "营业执照照片") + private String zzImg; + + @Schema(description = "其他证件") + private String files; + + @Schema(description = "操作员ID") + private Integer adminId; + + @Schema(description = "操作员名称") + @TableField(exist = false) + private String adminName; + + @Schema(description = "机构ID") + private Integer organizationId; + + @Schema(description = "机构ID") + @TableField(exist = false) + private String organizationName; + + @Schema(description = "用户角色ID") + private Integer userRoleId; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "状态, 0待审核, 1已通过审核,2已驳回") + private Integer status; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "注册时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + @Schema(description = "手机号码") + @TableField(exist = false) + private String phone; + + @Schema(description = "状态名称") + @TableField(exist = false) + private String statusText; + + public String getStatusText() { + String[] statusArray = {"待审核", "已审核通过", "已驳回"}; + return statusArray[this.status]; + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/Version.java b/src/main/java/com/gxwebsoft/common/system/entity/Version.java new file mode 100644 index 0000000..b9e9b27 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/Version.java @@ -0,0 +1,84 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableLogic; +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 版本更新 + * + * @author 科技小王子 + * @since 2024-01-15 18:52:24 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "Version对象", description = "版本更新") +@TableName("sys_version") +public class Version implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "ID") + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @Schema(description = "版本名") + private String versionName; + + @Schema(description = "版本号") + private String versionCode; + + @Schema(description = "下载链接") + private String vueDownloadUrl; + + @Schema(description = "下载链接") + private String androidDownloadUrl; + + @Schema(description = "下载链接") + private String iosDownloadUrl; + + @Schema(description = "更新日志") + private String updateInfo; + + @Schema(description = "强制更新") + private Integer isHard; + + @Schema(description = "热更") + private Integer isHot; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "文章排序(数字越小越靠前)") + private Integer sortNumber; + + private Integer userId; + + @Schema(description = "状态, 0正常, 1冻结") + private Integer status; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "注册时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/WebsiteField.java b/src/main/java/com/gxwebsoft/common/system/entity/WebsiteField.java new file mode 100644 index 0000000..1e82b9c --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/WebsiteField.java @@ -0,0 +1,66 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableLogic; +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 应用参数 + * + * @author 科技小王子 + * @since 2024-08-27 15:18:05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "WebsiteField对象", description = "应用参数") +@TableName("sys_website_field") +public class WebsiteField implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "自增ID") + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @Schema(description = "类型,0文本 1图片 2其他") + private Integer type; + + @Schema(description = "名称") + private String name; + + @Schema(description = "默认值") + private String defaultValue; + + @Schema(description = "可修改的值 [on|off]") + private String modifyRange; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "名称") + private String value; + + @Schema(description = "排序(数字越小越靠前)") + private Integer sortNumber; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/entity/WhiteDomain.java b/src/main/java/com/gxwebsoft/common/system/entity/WhiteDomain.java new file mode 100644 index 0000000..2c18ffd --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/entity/WhiteDomain.java @@ -0,0 +1,61 @@ +package com.gxwebsoft.common.system.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableLogic; +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 服务器白名单 + * + * @author 科技小王子 + * @since 2024-03-26 00:22:21 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "WhiteDomain对象", description = "服务器白名单") +@TableName("sys_white_domain") +public class WhiteDomain implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "ID") + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @Schema(description = "域名") + private String domain; + + @Schema(description = "状态") + private Integer status; + + @Schema(description = "排序号") + private Integer sortNumber; + + @Schema(description = "用户ID") + private Integer userId; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "租户id") + private Integer tenantId; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/AccessKeyMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/AccessKeyMapper.java new file mode 100644 index 0000000..658f773 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/AccessKeyMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.AccessKey; +import com.gxwebsoft.common.system.param.AccessKeyParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 访问凭证管理Mapper + * + * @author 科技小王子 + * @since 2023-05-16 19:19:55 + */ +public interface AccessKeyMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") AccessKeyParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") AccessKeyParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/AuthorizeCodeMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/AuthorizeCodeMapper.java new file mode 100644 index 0000000..8bd7a34 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/AuthorizeCodeMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.AuthorizeCode; +import com.gxwebsoft.common.system.param.AuthorizeCodeParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 授权码Mapper + * + * @author 科技小王子 + * @since 2025-08-05 01:17:27 + */ +public interface AuthorizeCodeMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") AuthorizeCodeParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") AuthorizeCodeParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/CartMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/CartMapper.java new file mode 100644 index 0000000..a0e9950 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/CartMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.Cart; +import com.gxwebsoft.common.system.param.CartParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 购物车Mapper + * + * @author 科技小王子 + * @since 2024-10-26 10:54:51 + */ +public interface CartMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") CartParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") CartParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/ChatConversationMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/ChatConversationMapper.java new file mode 100644 index 0000000..bd34512 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/ChatConversationMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.ChatConversation; +import com.gxwebsoft.common.system.param.ChatConversationParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 聊天消息表Mapper + * + * @author 科技小王子 + * @since 2024-04-27 15:57:27 + */ +public interface ChatConversationMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") ChatConversationParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") ChatConversationParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/ChatMessageMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/ChatMessageMapper.java new file mode 100644 index 0000000..6fe933b --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/ChatMessageMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.ChatMessage; +import com.gxwebsoft.common.system.param.ChatMessageParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 聊天消息表Mapper + * + * @author 科技小王子 + * @since 2024-04-27 15:57:27 + */ +public interface ChatMessageMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") ChatMessageParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") ChatMessageParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/CompanyCommentMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/CompanyCommentMapper.java new file mode 100644 index 0000000..d80c603 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/CompanyCommentMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.CompanyComment; +import com.gxwebsoft.common.system.param.CompanyCommentParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 应用评论Mapper + * + * @author 科技小王子 + * @since 2024-10-17 15:30:24 + */ +public interface CompanyCommentMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") CompanyCommentParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") CompanyCommentParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/CompanyContentMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/CompanyContentMapper.java new file mode 100644 index 0000000..3a75de9 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/CompanyContentMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.CompanyContent; +import com.gxwebsoft.common.system.param.CompanyContentParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 应用详情Mapper + * + * @author 科技小王子 + * @since 2024-10-16 13:41:21 + */ +public interface CompanyContentMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") CompanyContentParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") CompanyContentParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/CompanyGitMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/CompanyGitMapper.java new file mode 100644 index 0000000..345650f --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/CompanyGitMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.CompanyGit; +import com.gxwebsoft.common.system.param.CompanyGitParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 代码仓库Mapper + * + * @author 科技小王子 + * @since 2024-10-19 18:08:51 + */ +public interface CompanyGitMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") CompanyGitParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") CompanyGitParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/CompanyMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/CompanyMapper.java new file mode 100644 index 0000000..28b534f --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/CompanyMapper.java @@ -0,0 +1,62 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.system.entity.Company; +import com.gxwebsoft.common.system.param.CompanyParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 企业信息Mapper + * + * @author 科技小王子 + * @since 2023-05-27 14:57:34 + */ +public interface CompanyMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") CompanyParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") CompanyParam param); + + @InterceptorIgnore(tenantLine = "true") + List getCount(@Param("param") CompanyParam param); + + @InterceptorIgnore(tenantLine = "true") + List selectPageRelAll(PageParam page, CompanyParam param); + + @InterceptorIgnore(tenantLine = "true") + Company getCompanyAll(@Param("companyId") Integer companyId); + + @InterceptorIgnore(tenantLine = "true") + void updateByCompanyId(@Param("param") Company company); + + @InterceptorIgnore(tenantLine = "true") + boolean removeCompanyAll(Integer id); + + @InterceptorIgnore(tenantLine = "true") + boolean undeleteAll(Integer id); + + @InterceptorIgnore(tenantLine = "true") + boolean updateByIdAll(Company company); + + @InterceptorIgnore(tenantLine = "true") + Company getByTenantId(Integer tenantId); +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/CompanyParameterMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/CompanyParameterMapper.java new file mode 100644 index 0000000..c55b5f0 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/CompanyParameterMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.CompanyParameter; +import com.gxwebsoft.common.system.param.CompanyParameterParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 应用参数Mapper + * + * @author 科技小王子 + * @since 2024-10-17 15:30:24 + */ +public interface CompanyParameterMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") CompanyParameterParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") CompanyParameterParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/CompanyUrlMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/CompanyUrlMapper.java new file mode 100644 index 0000000..117ed2b --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/CompanyUrlMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.CompanyUrl; +import com.gxwebsoft.common.system.param.CompanyUrlParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 应用域名Mapper + * + * @author 科技小王子 + * @since 2024-10-17 15:30:24 + */ +public interface CompanyUrlMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") CompanyUrlParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") CompanyUrlParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/ComponentsMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/ComponentsMapper.java new file mode 100644 index 0000000..70a58c9 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/ComponentsMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.Components; +import com.gxwebsoft.common.system.param.ComponentsParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 组件Mapper + * + * @author 科技小王子 + * @since 2024-08-25 19:08:51 + */ +public interface ComponentsMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") ComponentsParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") ComponentsParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/DictDataMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/DictDataMapper.java new file mode 100644 index 0000000..f36039f --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/DictDataMapper.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.DictData; +import com.gxwebsoft.common.system.param.DictDataParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 字典数据Mapper + * + * @author WebSoft + * @since 2020-03-14 11:29:04 + */ +public interface DictDataMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") DictDataParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") DictDataParam param); + + /** + * 根据dictCode和dictDataName查询 + * + * @param dictCode 字典标识 + * @param dictDataName 字典项名称 + * @return List + */ + List getByDictCodeAndName(@Param("dictCode") String dictCode, + @Param("dictDataName") String dictDataName); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/DictMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/DictMapper.java new file mode 100644 index 0000000..ce19779 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/DictMapper.java @@ -0,0 +1,14 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gxwebsoft.common.system.entity.Dict; + +/** + * 字典Mapper + * + * @author WebSoft + * @since 2020-03-14 11:29:03 + */ +public interface DictMapper extends BaseMapper { + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/DictionaryDataMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/DictionaryDataMapper.java new file mode 100644 index 0000000..519c2ba --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/DictionaryDataMapper.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.DictionaryData; +import com.gxwebsoft.common.system.param.DictionaryDataParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 字典数据Mapper + * + * @author WebSoft + * @since 2020-03-14 11:29:04 + */ +public interface DictionaryDataMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") DictionaryDataParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") DictionaryDataParam param); + + /** + * 根据dictCode和dictDataName查询 + * + * @param dictCode 字典标识 + * @param dictDataName 字典项名称 + * @return List + */ + List getByDictCodeAndName(@Param("dictCode") String dictCode, + @Param("dictDataName") String dictDataName); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/DictionaryMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/DictionaryMapper.java new file mode 100644 index 0000000..7c2cbac --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/DictionaryMapper.java @@ -0,0 +1,14 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gxwebsoft.common.system.entity.Dictionary; + +/** + * 字典Mapper + * + * @author WebSoft + * @since 2020-03-14 11:29:03 + */ +public interface DictionaryMapper extends BaseMapper { + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/DomainMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/DomainMapper.java new file mode 100644 index 0000000..2853001 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/DomainMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.Domain; +import com.gxwebsoft.common.system.param.DomainParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 授权域名Mapper + * + * @author 科技小王子 + * @since 2024-09-19 23:56:33 + */ +public interface DomainMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") DomainParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") DomainParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/EmailRecordMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/EmailRecordMapper.java new file mode 100644 index 0000000..02611c9 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/EmailRecordMapper.java @@ -0,0 +1,14 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gxwebsoft.common.system.entity.EmailRecord; + +/** + * 邮件记录Mapper + * + * @author WebSoft + * @since 2020-03-14 11:29:04 + */ +public interface EmailRecordMapper extends BaseMapper { + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/EnvironmentMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/EnvironmentMapper.java new file mode 100644 index 0000000..b3ea0d3 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/EnvironmentMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.Environment; +import com.gxwebsoft.common.system.param.EnvironmentParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 环境管理Mapper + * + * @author 科技小王子 + * @since 2023-10-18 08:45:13 + */ +public interface EnvironmentMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") EnvironmentParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") EnvironmentParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/FileRecordMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/FileRecordMapper.java new file mode 100644 index 0000000..fe9f0b8 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/FileRecordMapper.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.FileRecord; +import com.gxwebsoft.common.system.param.FileRecordParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 文件上传记录Mapper + * + * @author WebSoft + * @since 2021-08-30 11:18:04 + */ +public interface FileRecordMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") FileRecordParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") FileRecordParam param); + + /** + * 根据path查询 + * + * @param path 文件路径 + * @return FileRecord + */ + @InterceptorIgnore(tenantLine = "true") + List getByIdPath(@Param("path") String path); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/LoginRecordMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/LoginRecordMapper.java new file mode 100644 index 0000000..4409fdd --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/LoginRecordMapper.java @@ -0,0 +1,48 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.LoginRecord; +import com.gxwebsoft.common.system.param.LoginRecordParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 登录日志Mapper + * + * @author WebSoft + * @since 2018-12-24 16:10:11 + */ +public interface LoginRecordMapper extends BaseMapper { + + /** + * 添加, 排除租户拦截 + * + * @param entity LoginRecord + * @return int + */ + @Override + @InterceptorIgnore(tenantLine = "true") + int insert(LoginRecord entity); + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") LoginRecordParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") LoginRecordParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/MenuMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/MenuMapper.java new file mode 100644 index 0000000..938ef17 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/MenuMapper.java @@ -0,0 +1,22 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gxwebsoft.common.system.entity.Menu; +import com.gxwebsoft.common.system.param.MenuParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 菜单Mapper + * + * @author WebSoft + * @since 2018-12-24 16:10:32 + */ +public interface MenuMapper extends BaseMapper { + @InterceptorIgnore(tenantLine = "true") + List getMenuByClone(@Param("param") MenuParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/MerchantAccountMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/MerchantAccountMapper.java new file mode 100644 index 0000000..5e58680 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/MerchantAccountMapper.java @@ -0,0 +1,41 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.MerchantAccount; +import com.gxwebsoft.common.system.param.MerchantAccountParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 商户账号Mapper + * + * @author 科技小王子 + * @since 2024-04-19 12:02:24 + */ +public interface MerchantAccountMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") MerchantAccountParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") MerchantAccountParam param); + + @InterceptorIgnore(tenantLine = "true") + MerchantAccount getMerchantAccountByPhone(@Param("param") MerchantAccountParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/MerchantApplyMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/MerchantApplyMapper.java new file mode 100644 index 0000000..3e19247 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/MerchantApplyMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.MerchantApply; +import com.gxwebsoft.common.system.param.MerchantApplyParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 商户入驻申请Mapper + * + * @author 科技小王子 + * @since 2024-04-05 01:24:36 + */ +public interface MerchantApplyMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") MerchantApplyParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") MerchantApplyParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/MerchantMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/MerchantMapper.java new file mode 100644 index 0000000..9e92d10 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/MerchantMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.Merchant; +import com.gxwebsoft.common.system.param.MerchantParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 商户Mapper + * + * @author 科技小王子 + * @since 2024-04-05 00:03:54 + */ +public interface MerchantMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") MerchantParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") MerchantParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/MerchantTypeMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/MerchantTypeMapper.java new file mode 100644 index 0000000..2ec5ceb --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/MerchantTypeMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.MerchantType; +import com.gxwebsoft.common.system.param.MerchantTypeParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 商户类型Mapper + * + * @author 科技小王子 + * @since 2024-04-05 00:08:51 + */ +public interface MerchantTypeMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") MerchantTypeParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") MerchantTypeParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/ModulesMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/ModulesMapper.java new file mode 100644 index 0000000..f4dc531 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/ModulesMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.Modules; +import com.gxwebsoft.common.system.param.ModulesParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 模块管理Mapper + * + * @author 科技小王子 + * @since 2023-10-18 15:53:43 + */ +public interface ModulesMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") ModulesParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") ModulesParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/NoticeMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/NoticeMapper.java new file mode 100644 index 0000000..50c9f50 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/NoticeMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.Notice; +import com.gxwebsoft.common.system.param.NoticeParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 消息记录表Mapper + * + * @author 科技小王子 + * @since 2023-10-08 13:22:21 + */ +public interface NoticeMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") NoticeParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") NoticeParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/OperationRecordMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/OperationRecordMapper.java new file mode 100644 index 0000000..8750c2a --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/OperationRecordMapper.java @@ -0,0 +1,48 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.OperationRecord; +import com.gxwebsoft.common.system.param.OperationRecordParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 操作日志Mapper + * + * @author WebSoft + * @since 2018-12-24 16:10:03 + */ +public interface OperationRecordMapper extends BaseMapper { + + /** + * 添加, 排除租户拦截 + * + * @param entity OperationRecord + * @return int + */ + @Override + @InterceptorIgnore(tenantLine = "true") + int insert(OperationRecord entity); + + /** + * 分页查询 + * + * @param page 分页参数 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") OperationRecordParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") OperationRecordParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/OrderGoodsMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/OrderGoodsMapper.java new file mode 100644 index 0000000..e166b4c --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/OrderGoodsMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.OrderGoods; +import com.gxwebsoft.common.system.param.OrderGoodsParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 订单商品Mapper + * + * @author 科技小王子 + * @since 2024-10-26 12:18:05 + */ +public interface OrderGoodsMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") OrderGoodsParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") OrderGoodsParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/OrderInfoMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/OrderInfoMapper.java new file mode 100644 index 0000000..a5ecc43 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/OrderInfoMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.OrderInfo; +import com.gxwebsoft.common.system.param.OrderInfoParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * Mapper + * + * @author 科技小王子 + * @since 2024-05-10 18:02:54 + */ +public interface OrderInfoMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") OrderInfoParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") OrderInfoParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/OrderMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/OrderMapper.java new file mode 100644 index 0000000..8fb9a0e --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/OrderMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.Order; +import com.gxwebsoft.common.system.param.OrderParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 订单Mapper + * + * @author 科技小王子 + * @since 2024-10-16 12:32:52 + */ +public interface OrderMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") OrderParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") OrderParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/OrganizationMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/OrganizationMapper.java new file mode 100644 index 0000000..6f06689 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/OrganizationMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.Organization; +import com.gxwebsoft.common.system.param.OrganizationParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 组织机构Mapper + * + * @author WebSoft + * @since 2020-03-14 11:29:04 + */ +public interface OrganizationMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") OrganizationParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") OrganizationParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/PaymentMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/PaymentMapper.java new file mode 100644 index 0000000..53213e9 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/PaymentMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.Payment; +import com.gxwebsoft.common.system.param.PaymentParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 支付方式Mapper + * + * @author 科技小王子 + * @since 2024-05-11 12:39:11 + */ +public interface PaymentMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") PaymentParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") PaymentParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/PlugMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/PlugMapper.java new file mode 100644 index 0000000..effb815 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/PlugMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.Plug; +import com.gxwebsoft.common.system.param.PlugParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 插件扩展Mapper + * + * @author 科技小王子 + * @since 2023-10-12 09:53:07 + */ +public interface PlugMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") PlugParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") PlugParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/RechargeOrderMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/RechargeOrderMapper.java new file mode 100644 index 0000000..eab2641 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/RechargeOrderMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.RechargeOrder; +import com.gxwebsoft.common.system.param.RechargeOrderParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 会员充值订单表Mapper + * + * @author 科技小王子 + * @since 2024-07-26 23:18:48 + */ +public interface RechargeOrderMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") RechargeOrderParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") RechargeOrderParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/RoleMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/RoleMapper.java new file mode 100644 index 0000000..ddfab6a --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/RoleMapper.java @@ -0,0 +1,22 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gxwebsoft.common.system.entity.Role; +import com.gxwebsoft.common.system.param.RoleParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 角色Mapper + * + * @author WebSoft + * @since 2018-12-24 16:10:44 + */ +public interface RoleMapper extends BaseMapper { + + @InterceptorIgnore(tenantLine = "true") + List selectListAll(@Param("param") RoleParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/RoleMenuMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/RoleMenuMapper.java new file mode 100644 index 0000000..ab60a7e --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/RoleMenuMapper.java @@ -0,0 +1,39 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gxwebsoft.common.system.entity.Menu; +import com.gxwebsoft.common.system.entity.RoleMenu; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 角色菜单Mapper + * + * @author WebSoft + * @since 2018-12-24 16:10:21 + */ +public interface RoleMenuMapper extends BaseMapper { + + /** + * 查询用户的菜单 + * + * @param userId 用户id + * @param menuType 菜单类型 + * @return List + */ +// @InterceptorIgnore(tenantLine = "true") + List listMenuByUserId(@Param("userId") Integer userId, @Param("menuType") Integer menuType); + + /** + * 根据角色id查询菜单 + * + * @param roleIds 角色id + * @param menuType 菜单类型 + * @return List + */ + @InterceptorIgnore(tenantLine = "true") + List listMenuByRoleIds(@Param("roleIds") List roleIds, @Param("menuType") Integer menuType); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/SettingMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/SettingMapper.java new file mode 100644 index 0000000..ffc7f55 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/SettingMapper.java @@ -0,0 +1,40 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.Setting; +import com.gxwebsoft.common.system.param.SettingParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 系统设置Mapper + * + * @author WebSoft + * @since 2022-11-19 13:54:27 + */ +public interface SettingMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") SettingParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") SettingParam param); + + @InterceptorIgnore(tenantLine = "true") + Setting getBySettingKeyIgnore(@Param("param") SettingParam param); +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/SysFileTypeMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/SysFileTypeMapper.java new file mode 100644 index 0000000..026b0d9 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/SysFileTypeMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.SysFileType; +import com.gxwebsoft.common.system.param.SysFileTypeParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 存储类型Mapper + * + * @author 科技小王子 + * @since 2025-05-16 14:24:28 + */ +public interface SysFileTypeMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") SysFileTypeParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") SysFileTypeParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/TenantMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/TenantMapper.java new file mode 100644 index 0000000..0190424 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/TenantMapper.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.Tenant; +import com.gxwebsoft.common.system.param.TenantParam; +import org.apache.ibatis.annotations.Param; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * 租户Mapper + * + * @author 科技小王子 + * @since 2023-07-17 17:49:53 + */ +public interface TenantMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") TenantParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") TenantParam param); + + @InterceptorIgnore(tenantLine = "true") + boolean destructionAll(Integer id); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/TenantPackageMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/TenantPackageMapper.java new file mode 100644 index 0000000..4c32508 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/TenantPackageMapper.java @@ -0,0 +1,33 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gxwebsoft.common.system.entity.TenantPackage; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 租户套餐Mapper + * + * @author WebSoft + * @since 2025-12-12 + */ +@InterceptorIgnore(tenantLine = "true") +public interface TenantPackageMapper extends BaseMapper { + + /** + * 查询所有上架的套餐 + * + * @return List + */ + List selectAvailablePackages(); + + /** + * 根据版本号查询套餐 + * + * @param version 版本号 + * @return TenantPackage + */ + TenantPackage selectByVersion(@Param("version") Integer version); +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/TenantSubscriptionMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/TenantSubscriptionMapper.java new file mode 100644 index 0000000..1479181 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/TenantSubscriptionMapper.java @@ -0,0 +1,44 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gxwebsoft.common.system.entity.TenantSubscription; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +/** + * 租户订阅记录Mapper + * + * @author WebSoft + * @since 2025-12-12 + */ +public interface TenantSubscriptionMapper extends BaseMapper { + + /** + * 根据租户ID查询订阅信息(关联查询) + * + * @param tenantId 租户ID + * @return TenantSubscription + */ + @InterceptorIgnore(tenantLine = "true") + TenantSubscription selectByTenantIdRel(@Param("tenantId") Integer tenantId); + + /** + * 查询即将过期的订阅(用于提醒) + * + * @param days 提前天数 + * @return List + */ + @InterceptorIgnore(tenantLine = "true") + List selectExpiringSoon(@Param("days") Integer days); + + /** + * 查询已过期的订阅 + * + * @return List + */ + @InterceptorIgnore(tenantLine = "true") + List selectExpired(); +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/TenantSubscriptionOrderMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/TenantSubscriptionOrderMapper.java new file mode 100644 index 0000000..89059f2 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/TenantSubscriptionOrderMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.TenantSubscriptionOrder; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 租户订阅订单Mapper + * + * @author WebSoft + * @since 2025-12-12 + */ +@InterceptorIgnore(tenantLine = "true") +public interface TenantSubscriptionOrderMapper extends BaseMapper { + + /** + * 分页查询订单 + * + * @param page 分页对象 + * @param tenantId 租户ID + * @return List + */ + List selectPageByTenant(@Param("page") IPage page, + @Param("tenantId") Integer tenantId); + + /** + * 根据订单号查询 + * + * @param orderNo 订单号 + * @return TenantSubscriptionOrder + */ + TenantSubscriptionOrder selectByOrderNo(@Param("orderNo") String orderNo); +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/UserBalanceLogMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/UserBalanceLogMapper.java new file mode 100644 index 0000000..f986c44 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/UserBalanceLogMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.UserBalanceLog; +import com.gxwebsoft.common.system.param.UserBalanceLogParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 用户余额变动明细表Mapper + * + * @author 科技小王子 + * @since 2023-04-21 15:59:09 + */ +public interface UserBalanceLogMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") UserBalanceLogParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") UserBalanceLogParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/UserCollectionMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/UserCollectionMapper.java new file mode 100644 index 0000000..b7330da --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/UserCollectionMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.UserCollection; +import com.gxwebsoft.common.system.param.UserCollectionParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 我的收藏Mapper + * + * @author 科技小王子 + * @since 2024-04-28 18:08:32 + */ +public interface UserCollectionMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") UserCollectionParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") UserCollectionParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/UserFileMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/UserFileMapper.java new file mode 100644 index 0000000..d9e4bb4 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/UserFileMapper.java @@ -0,0 +1,14 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gxwebsoft.common.system.entity.UserFile; + +/** + * 用户文件Mapper + * + * @author WebSoft + * @since 2022-07-21 14:34:40 + */ +public interface UserFileMapper extends BaseMapper { + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/UserGradeMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/UserGradeMapper.java new file mode 100644 index 0000000..f966ee3 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/UserGradeMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.UserGrade; +import com.gxwebsoft.common.system.param.UserGradeParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 用户会员等级表Mapper + * + * @author 科技小王子 + * @since 2023-10-07 22:51:17 + */ +public interface UserGradeMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") UserGradeParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") UserGradeParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/UserGroupMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/UserGroupMapper.java new file mode 100644 index 0000000..8e38749 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/UserGroupMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.UserGroup; +import com.gxwebsoft.common.system.param.UserGroupParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 用户分组管理表Mapper + * + * @author 科技小王子 + * @since 2023-10-28 15:16:39 + */ +public interface UserGroupMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") UserGroupParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") UserGroupParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/UserMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/UserMapper.java new file mode 100644 index 0000000..7e18c1d --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/UserMapper.java @@ -0,0 +1,93 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.common.system.param.UserParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 用户Mapper + * + * @author WebSoft + * @since 2018-12-24 16:10:14 + */ +public interface UserMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") UserParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") UserParam param); + + /** + * 根据账号查询 + * + * @param username 账号 + * @param tenantId 租户id + * @return User + */ + @InterceptorIgnore(tenantLine = "true") + User selectByUsername(@Param("username") String username, @Param("tenantId") Integer tenantId); + + @InterceptorIgnore(tenantLine = "true") + List getOne(@Param("param") UserParam param); + + List selectListStatisticsRel(@Param("param") UserParam param); + + @InterceptorIgnore(tenantLine = "true") + void updateByUserId(@Param("param") User param); + + @InterceptorIgnore(tenantLine = "true") + User selectAdminByPhone(@Param("param") UserParam param); + + @InterceptorIgnore(tenantLine = "true") + User selectAdminByPhone(@Param("param") UserParam param, @Param("tenantId") Integer tenantId); + + @InterceptorIgnore(tenantLine = "true") + User selectByUserId(@Param("userId") Integer userId); + + @InterceptorIgnore(tenantLine = "true") + List selectListAllRel(@Param("param") UserParam param); + + @InterceptorIgnore(tenantLine = "true") + List pageRelAll(@Param("param") UserParam param); + + @InterceptorIgnore(tenantLine = "true") + User getByUserId(String userId); + + /** + * 根据手机号查询所有账号(忽略租户隔离) + * + * @param phone 手机号 + * @return List + */ + @InterceptorIgnore(tenantLine = "true") + List selectAccountsByPhone(@Param("phone") String phone); + + /** + * 根据手机号统计账号数量(忽略租户隔离) + * + * @param phone 手机号 + * @return Integer + */ + @InterceptorIgnore(tenantLine = "true") + Integer countByPhone(@Param("phone") String phone); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/UserOauthMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/UserOauthMapper.java new file mode 100644 index 0000000..1d3e164 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/UserOauthMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.UserOauth; +import com.gxwebsoft.common.system.param.UserOauthParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 第三方用户信息表Mapper + * + * @author 科技小王子 + * @since 2023-10-07 22:39:46 + */ +public interface UserOauthMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") UserOauthParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") UserOauthParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/UserRefereeMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/UserRefereeMapper.java new file mode 100644 index 0000000..e729045 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/UserRefereeMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.UserReferee; +import com.gxwebsoft.common.system.param.UserRefereeParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 用户推荐关系表Mapper + * + * @author 科技小王子 + * @since 2023-10-07 22:56:36 + */ +public interface UserRefereeMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") UserRefereeParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") UserRefereeParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/UserRoleMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/UserRoleMapper.java new file mode 100644 index 0000000..71efd86 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/UserRoleMapper.java @@ -0,0 +1,65 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.Role; +import com.gxwebsoft.common.system.entity.UserRole; +import com.gxwebsoft.common.system.param.UserRoleParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 用户角色Mapper + * + * @author 科技小王子 + * @since 2025-06-16 20:39:53 + */ +public interface UserRoleMapper extends BaseMapper { + + /** + * 批量添加用户角色 + * + * @param userId 用户id + * @param roleIds 角色id集合 + * @return int + */ + int insertBatch(@Param("userId") Integer userId, @Param("roleIds") List roleIds); + + /** + * 根据用户id查询角色 + * + * @param userId 用户id + * @return List + */ + @InterceptorIgnore(tenantLine = "true") + List selectByUserId(@Param("userId") Integer userId); + + /** + * 批量根据用户id查询角色 + * + * @param userIds 用户id集合 + * @return List + */ + List selectByUserIds(@Param("userIds") List userIds); + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") UserRoleParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") UserRoleParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/UserVerifyMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/UserVerifyMapper.java new file mode 100644 index 0000000..44fb323 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/UserVerifyMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.UserVerify; +import com.gxwebsoft.common.system.param.UserVerifyParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 实名认证Mapper + * + * @author 科技小王子 + * @since 2025-05-29 23:01:04 + */ +public interface UserVerifyMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") UserVerifyParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") UserVerifyParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/VersionMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/VersionMapper.java new file mode 100644 index 0000000..0ae8f69 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/VersionMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.Version; +import com.gxwebsoft.common.system.param.VersionParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 版本更新Mapper + * + * @author 科技小王子 + * @since 2024-01-15 18:52:24 + */ +public interface VersionMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") VersionParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") VersionParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/WebsiteFieldMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/WebsiteFieldMapper.java new file mode 100644 index 0000000..2e15906 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/WebsiteFieldMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.WebsiteField; +import com.gxwebsoft.common.system.param.WebsiteFieldParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 应用参数Mapper + * + * @author 科技小王子 + * @since 2024-08-27 15:18:05 + */ +public interface WebsiteFieldMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") WebsiteFieldParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") WebsiteFieldParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/WhiteDomainMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/WhiteDomainMapper.java new file mode 100644 index 0000000..9e3d0d1 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/WhiteDomainMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.common.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.common.system.entity.WhiteDomain; +import com.gxwebsoft.common.system.param.WhiteDomainParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 服务器白名单Mapper + * + * @author 科技小王子 + * @since 2024-03-26 00:22:21 + */ +public interface WhiteDomainMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") WhiteDomainParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") WhiteDomainParam param); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/AccessKeyMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/AccessKeyMapper.xml new file mode 100644 index 0000000..9e870d7 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/AccessKeyMapper.xml @@ -0,0 +1,44 @@ + + + + + + + SELECT a.* + FROM sys_access_key a + + + AND a.id = #{param.id} + + + AND a.accessKey LIKE CONCAT('%', #{param.accessKey}, '%') + + + AND a.accessSecret LIKE CONCAT('%', #{param.accessSecret}, '%') + + + AND a.deleted = #{param.deleted} + + + AND a.deleted = 0 + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/AuthorizeCodeMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/AuthorizeCodeMapper.xml new file mode 100644 index 0000000..9fec730 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/AuthorizeCodeMapper.xml @@ -0,0 +1,47 @@ + + + + + + + SELECT a.* + FROM sys_authorize_code a + + + AND a.id = #{param.id} + + + AND a.code LIKE CONCAT('%', #{param.code}, '%') + + + AND a.user_id = #{param.userId} + + + AND a.sort_number = #{param.sortNumber} + + + AND a.deleted = #{param.deleted} + + + AND a.deleted = 0 + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/CartMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/CartMapper.xml new file mode 100644 index 0000000..27f5dc1 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/CartMapper.xml @@ -0,0 +1,77 @@ + + + + + + + SELECT a.* + FROM sys_cart a + + + AND a.id = #{param.id} + + + AND a.type = #{param.type} + + + AND a.code LIKE CONCAT('%', #{param.code}, '%') + + + AND a.item_id LIKE CONCAT('%', #{param.itemId}, '%') + + + AND a.spec LIKE CONCAT('%', #{param.spec}, '%') + + + AND a.price = #{param.price} + + + AND a.cart_num = #{param.cartNum} + + + AND a.total_price = #{param.totalPrice} + + + AND a.is_pay = #{param.isPay} + + + AND a.is_new = #{param.isNew} + + + AND a.combination_id = #{param.combinationId} + + + AND a.seckill_id = #{param.seckillId} + + + AND a.bargain_id = #{param.bargainId} + + + AND a.selected = #{param.selected} + + + AND a.merchant_id LIKE CONCAT('%', #{param.merchantId}, '%') + + + AND a.user_id LIKE CONCAT('%', #{param.userId}, '%') + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/ChatConversationMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/ChatConversationMapper.xml new file mode 100644 index 0000000..94c77c0 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/ChatConversationMapper.xml @@ -0,0 +1,56 @@ + + + + + + + SELECT a.* + FROM sys_chat_conversation a + + + AND a.id = #{param.id} + + + AND a.user_id = #{param.userId} + + + AND a.friend_id = #{param.friendId} + + + AND a.type = #{param.type} + + + AND a.content LIKE CONCAT('%', #{param.content}, '%') + + + AND a.un_read = #{param.unRead} + + + AND a.status = #{param.status} + + + AND a.deleted = #{param.deleted} + + + AND a.deleted = 0 + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/ChatMessageMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/ChatMessageMapper.xml new file mode 100644 index 0000000..e387466 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/ChatMessageMapper.xml @@ -0,0 +1,78 @@ + + + + + + + SELECT a.*,b.nickname as formUserName,b.avatar as formUserAvatar,c.nickname as toUserName,c.avatar as toUserAvatar + FROM sys_chat_message a + LEFT JOIN sys_user b ON a.form_user_id = b.user_id + LEFT JOIN sys_user c ON a.to_user_id = c.user_id + + + AND a.id = #{param.id} + + + AND a.form_user_id = #{param.formUserId} + + + AND a.to_user_id = #{param.toUserId} + + + AND a.type LIKE CONCAT('%', #{param.type}, '%') + + + AND a.content LIKE CONCAT('%', #{param.content}, '%') + + + AND a.side_to = #{param.sideTo} + + + AND a.side_from = #{param.sideFrom} + + + AND a.withdraw = #{param.withdraw} + + + AND a.file_info LIKE CONCAT('%', #{param.fileInfo}, '%') + + + AND a.has_contact = #{param.hasContact} + + + AND a.status = #{param.status} + + + AND a.deleted = #{param.deleted} + + + AND a.deleted = 0 + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + AND ( + a.content LIKE CONCAT('%', #{param.keywords}, '%') + OR b.nickname LIKE CONCAT('%', #{param.keywords}, '%') + OR b.phone LIKE CONCAT('%', #{param.keywords}, '%') + OR b.real_name LIKE CONCAT('%', #{param.keywords}, '%') + ) + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/CompanyCommentMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/CompanyCommentMapper.xml new file mode 100644 index 0000000..0e04c48 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/CompanyCommentMapper.xml @@ -0,0 +1,53 @@ + + + + + + + SELECT a.* + FROM sys_company_comment a + + + AND a.id = #{param.id} + + + AND a.parent_id = #{param.parentId} + + + AND a.user_id = #{param.userId} + + + AND a.company_id = #{param.companyId} + + + AND a.rate = #{param.rate} + + + AND a.sort_number = #{param.sortNumber} + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.status = #{param.status} + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/CompanyContentMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/CompanyContentMapper.xml new file mode 100644 index 0000000..06207e5 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/CompanyContentMapper.xml @@ -0,0 +1,38 @@ + + + + + + + SELECT a.* + FROM sys_company_content a + + + AND a.id = #{param.id} + + + AND a.company_id = #{param.companyId} + + + AND a.content LIKE CONCAT('%', #{param.content}, '%') + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/CompanyGitMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/CompanyGitMapper.xml new file mode 100644 index 0000000..bf8c616 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/CompanyGitMapper.xml @@ -0,0 +1,65 @@ + + + + + + + SELECT a.* + FROM sys_company_git a + + + AND a.id = #{param.id} + + + AND a.title LIKE CONCAT('%', #{param.title}, '%') + + + AND a.brand = #{param.brand} + + + AND a.company_id = #{param.companyId} + + + AND a.domain LIKE CONCAT('%', #{param.domain}, '%') + + + AND a.account LIKE CONCAT('%', #{param.account}, '%') + + + AND a.password LIKE CONCAT('%', #{param.password}, '%') + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.sort_number = #{param.sortNumber} + + + AND a.status = #{param.status} + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + AND ( + a.title LIKE CONCAT('%', #{param.keywords}, '%') + OR a.domain LIKE CONCAT('%', #{param.keywords}, '%') + ) + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/CompanyMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/CompanyMapper.xml new file mode 100644 index 0000000..ce4162a --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/CompanyMapper.xml @@ -0,0 +1,198 @@ + + + + + + + SELECT a.*,b.tenant_id,b.tenant_name,b.tenant_code,c.title as categoryName + FROM sys_company a + LEFT JOIN sys_tenant b ON a.tenant_id = b.tenant_id + LEFT JOIN cms_navigation c ON a.category_id = c.navigation_id + + + AND a.company_id = #{param.companyId} + + + AND a.type = #{param.type} + + + AND a.official = #{param.official} + + + AND a.category_id = #{param.categoryId} + + + AND a.short_name LIKE CONCAT('%', #{param.shortName}, '%') + + + AND a.company_name LIKE CONCAT('%', #{param.companyName}, '%') + + + AND a.company_type = #{param.companyType} + + + AND a.company_logo LIKE CONCAT('%', #{param.companyLogo}, '%') + + + AND a.domain LIKE CONCAT('%', #{param.domain}, '%') + + + AND a.phone = #{param.phone} + + + AND a.Invoice_header LIKE CONCAT('%', #{param.invoiceHeader}, '%') + + + AND a.start_time LIKE CONCAT('%', #{param.startTime}, '%') + + + AND a.expiration_time LIKE CONCAT('%', #{param.expirationTime}, '%') + + + AND a.version = #{param.version} + + + AND a.members = #{param.members} + + + AND a.industry_parent LIKE CONCAT('%', #{param.industryParent}, '%') + + + AND a.industry_child LIKE CONCAT('%', #{param.industryChild}, '%') + + + AND a.departments = #{param.departments} + + + AND a.country LIKE CONCAT('%', #{param.country}, '%') + + + AND a.province LIKE CONCAT('%', #{param.province}, '%') + + + AND a.city LIKE CONCAT('%', #{param.city}, '%') + + + AND a.region LIKE CONCAT('%', #{param.region}, '%') + + + AND a.address LIKE CONCAT('%', #{param.address}, '%') + + + AND a.longitude LIKE CONCAT('%', #{param.longitude}, '%') + + + AND a.latitude LIKE CONCAT('%', #{param.latitude}, '%') + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.authentication = #{param.authentication} + + + AND a.status = #{param.status} + + + AND a.app_type = #{param.appType} + + + AND a.user_id = #{param.userId} + + + AND a.deleted = #{param.deleted} + + + AND a.deleted = 0 + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + AND a.authoritative = #{param.authoritative} + + + AND a.recommend = 1 + + + AND a.short_name = #{param.appName} + + + AND a.email = #{param.email} + + + AND a.merchant_id = #{param.merchantId} + + + AND a.company_id IN + + #{item} + + + + AND (a.company_name LIKE CONCAT('%', #{param.keywords}, '%') + OR a.short_name LIKE CONCAT('%', #{param.keywords}, '%') + OR a.tenant_id = #{param.keywords} + OR a.phone = #{param.keywords} + OR a.domain LIKE CONCAT('%', #{param.keywords}, '%') + ) + + + + + + + + + + + + + + + + + + + + + + UPDATE sys_company SET storage = #{param.storage} WHERE company_id = #{param.companyId} + + + + + UPDATE sys_company SET deleted = 1 WHERE company_id = #{param.companyId} + + + + UPDATE sys_company SET deleted = 0 WHERE company_id = #{param.companyId} + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/CompanyParameterMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/CompanyParameterMapper.xml new file mode 100644 index 0000000..eabfba2 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/CompanyParameterMapper.xml @@ -0,0 +1,50 @@ + + + + + + + SELECT a.* + FROM sys_company_parameter a + + + AND a.id = #{param.id} + + + AND a.name LIKE CONCAT('%', #{param.name}, '%') + + + AND a.value LIKE CONCAT('%', #{param.value}, '%') + + + AND a.company_id = #{param.companyId} + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.sort_number = #{param.sortNumber} + + + AND a.status = #{param.status} + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/CompanyUrlMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/CompanyUrlMapper.xml new file mode 100644 index 0000000..6db9462 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/CompanyUrlMapper.xml @@ -0,0 +1,59 @@ + + + + + + + SELECT a.* + FROM sys_company_url a + + + AND a.id = #{param.id} + + + AND a.type LIKE CONCAT('%', #{param.type}, '%') + + + AND a.company_id = #{param.companyId} + + + AND a.domain LIKE CONCAT('%', #{param.domain}, '%') + + + AND a.account LIKE CONCAT('%', #{param.account}, '%') + + + AND a.password LIKE CONCAT('%', #{param.password}, '%') + + + AND a.qrcode LIKE CONCAT('%', #{param.qrcode}, '%') + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.sort_number = #{param.sortNumber} + + + AND a.status = #{param.status} + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/ComponentsMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/ComponentsMapper.xml new file mode 100644 index 0000000..078b9ed --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/ComponentsMapper.xml @@ -0,0 +1,65 @@ + + + + + + + SELECT a.* + FROM sys_components a + + + AND a.id = #{param.id} + + + AND a.title LIKE CONCAT('%', #{param.title}, '%') + + + AND a.navigation_id = #{param.navigationId} + + + AND a.type LIKE CONCAT('%', #{param.type}, '%') + + + AND a.keywords LIKE CONCAT('%', #{param.keywords}, '%') + + + AND a.description LIKE CONCAT('%', #{param.description}, '%') + + + AND a.path LIKE CONCAT('%', #{param.path}, '%') + + + AND a.icon LIKE CONCAT('%', #{param.icon}, '%') + + + AND a.user_id = #{param.userId} + + + AND a.sort_number = #{param.sortNumber} + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.status = #{param.status} + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/DictDataMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/DictDataMapper.xml new file mode 100644 index 0000000..38949c2 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/DictDataMapper.xml @@ -0,0 +1,71 @@ + + + + + + + SELECT a.*, + b.dict_code, + b.dict_name + FROM sys_dict_data a + LEFT JOIN sys_dict b ON a.dict_id = b.dict_id + + AND a.deleted = 0 + + AND a.dict_data_id = #{param.dictDataId} + + + AND a.dict_id = #{param.dictId} + + + AND a.dict_data_code LIKE CONCAT('%', #{param.dictDataCode}, '%') + + + AND a.dict_data_name LIKE CONCAT('%', #{param.dictDataName}, '%') + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + AND b.dict_code = #{param.dictCode} + + + AND b.dict_name = #{param.dictName} + + + AND ( + a.dict_data_code LIKE CONCAT('%', #{param.keywords}, '%') + OR a.dict_data_name LIKE CONCAT('%', #{param.keywords}, '%') + ) + + + + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/DictMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/DictMapper.xml new file mode 100644 index 0000000..db709ae --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/DictMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/DictionaryDataMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/DictionaryDataMapper.xml new file mode 100644 index 0000000..db778ba --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/DictionaryDataMapper.xml @@ -0,0 +1,71 @@ + + + + + + + SELECT a.*, + b.dict_code, + b.dict_name + FROM sys_dictionary_data a + LEFT JOIN sys_dictionary b ON a.dict_id = b.dict_id + + AND a.deleted = 0 + + AND a.dict_data_id = #{param.dictDataId} + + + AND a.dict_id = #{param.dictId} + + + AND a.dict_data_code LIKE CONCAT('%', #{param.dictDataCode}, '%') + + + AND a.dict_data_name LIKE CONCAT('%', #{param.dictDataName}, '%') + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + AND b.dict_code = #{param.dictCode} + + + AND b.dict_name = #{param.dictName} + + + AND ( + a.dict_data_code LIKE CONCAT('%', #{param.keywords}, '%') + OR a.dict_data_name LIKE CONCAT('%', #{param.keywords}, '%') + ) + + + + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/DictionaryMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/DictionaryMapper.xml new file mode 100644 index 0000000..8cd0cff --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/DictionaryMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/DomainMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/DomainMapper.xml new file mode 100644 index 0000000..1299cf7 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/DomainMapper.xml @@ -0,0 +1,62 @@ + + + + + + + SELECT a.* + FROM sys_domain a + + + AND a.id = #{param.id} + + + AND a.domain LIKE CONCAT('%', #{param.domain}, '%') + + + AND a.host_name LIKE CONCAT('%', #{param.hostName}, '%') + + + AND a.host_value LIKE CONCAT('%', #{param.hostValue}, '%') + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.type = #{param.type} + + + AND a.status = #{param.status} + + + AND a.sort_number = #{param.sortNumber} + + + AND a.user_id = #{param.userId} + + + AND a.deleted = #{param.deleted} + + + AND a.deleted = 0 + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/EmailRecordMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/EmailRecordMapper.xml new file mode 100644 index 0000000..7b5ad62 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/EmailRecordMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/EnvironmentMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/EnvironmentMapper.xml new file mode 100644 index 0000000..917f93d --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/EnvironmentMapper.xml @@ -0,0 +1,68 @@ + + + + + + + SELECT a.* + FROM sys_environment a + + + AND a.id = #{param.id} + + + AND a.environment_name LIKE CONCAT('%', #{param.environmentName}, '%') + + + AND a.environment_code LIKE CONCAT('%', #{param.environmentCode}, '%') + + + AND a.brand LIKE CONCAT('%', #{param.brand}, '%') + + + AND a.server_ip LIKE CONCAT('%', #{param.serverIp}, '%') + + + AND a.modules_url LIKE CONCAT('%', #{param.modulesUrl}, '%') + + + AND a.modules_api LIKE CONCAT('%', #{param.modulesApi}, '%') + + + AND a.sort_number = #{param.sortNumber} + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.status = #{param.status} + + + AND a.user_id = #{param.userId} + + + AND a.deleted = #{param.deleted} + + + AND a.deleted = 0 + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/FileRecordMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/FileRecordMapper.xml new file mode 100644 index 0000000..6a08242 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/FileRecordMapper.xml @@ -0,0 +1,90 @@ + + + + + + + SELECT a.*, + b.username create_username, + b.nickname create_nickname, + b.avatar + FROM sys_file_record a + LEFT JOIN sys_user b ON a.create_user_id = b.user_id + + + AND a.id = #{param.id} + + + AND a.`name` LIKE CONCAT('%', #{param.name}, '%') + + + AND a.path LIKE CONCAT('%', #{param.path}, '%') + + + AND a.app_id = #{param.appId} + + + AND a.company_id = #{param.companyId} + + + AND a.merchant_id = #{param.merchantId} + + + AND a.create_user_id = #{param.createUserId} + + + AND a.group_id = #{param.groupId} + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + AND a.deleted = #{param.deleted} + + + AND a.deleted = 0 + + + AND b.username = #{param.createUsername} + + + AND b.nickname LIKE CONCAT('%', #{param.createNickname}, '%') + + + AND a.content_type LIKE CONCAT('%', #{param.contentType}, '%') + + + AND ( + a.create_user_id = #{param.keywords} + OR b.name LIKE CONCAT('%', #{param.keywords}, '%') + OR b.comments LIKE CONCAT('%', #{param.keywords}, '%') + ) + + + + + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/LoginRecordMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/LoginRecordMapper.xml new file mode 100644 index 0000000..35d00ad --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/LoginRecordMapper.xml @@ -0,0 +1,62 @@ + + + + + + + SELECT a.*, + b.user_id, + b.nickname + FROM sys_login_record a + LEFT JOIN sys_user b ON a.username = b.username + + + AND a.id = #{param.id} + + + AND a.username LIKE CONCAT('%', #{param.username}, '%') + + + AND a.os LIKE CONCAT('%', #{param.os}, '%') + + + AND a.device LIKE CONCAT('%', #{param.device}, '%') + + + AND a.browser LIKE CONCAT('%', #{param.browser}, '%') + + + AND a.ip LIKE CONCAT('%', #{param.ip}, '%') + + + AND a.login_type LIKE CONCAT('%', #{param.loginType}, '%') + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + AND b.user_id = #{param.userId} + + + AND b.nickname LIKE CONCAT('%', #{param.nickname}, '%') + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/MenuMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/MenuMapper.xml new file mode 100644 index 0000000..ad1676a --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/MenuMapper.xml @@ -0,0 +1,36 @@ + + + + + + + SELECT a.* + FROM sys_menu a + + + AND a.menu_id = #{param.menuId} + + + AND a.parent_id = #{param.parentId} + + + AND a.modules = #{param.modules} + + + AND a.deleted = #{param.deleted} + + + AND a.deleted = 0 + + + AND a.tenant_id = #{param.tenantId} + + ORDER BY a.sort_number, a.create_time DESC + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/MerchantAccountMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/MerchantAccountMapper.xml new file mode 100644 index 0000000..527e540 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/MerchantAccountMapper.xml @@ -0,0 +1,61 @@ + + + + + + + SELECT a.*,b.merchant_name,b.goods_review + FROM sys_merchant_account a + LEFT JOIN sys_merchant b ON a.merchant_id = b.merchant_id + + + AND a.id = #{param.id} + + + AND a.phone = #{param.phone} + + + AND a.real_name LIKE CONCAT('%', #{param.realName}, '%') + + + AND a.merchant_id = #{param.merchantId} + + + AND a.user_id = #{param.userId} + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.status = #{param.status} + + + AND a.sort_number = #{param.sortNumber} + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') + ) + + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/MerchantApplyMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/MerchantApplyMapper.xml new file mode 100644 index 0000000..f2c3478 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/MerchantApplyMapper.xml @@ -0,0 +1,81 @@ + + + + + + + SELECT a.* + FROM sys_merchant_apply a + + + AND a.apply_id = #{param.applyId} + + + AND a.merchant_name LIKE CONCAT('%', #{param.merchantName}, '%') + + + AND a.image LIKE CONCAT('%', #{param.image}, '%') + + + AND a.phone LIKE CONCAT('%', #{param.phone}, '%') + + + AND a.real_name LIKE CONCAT('%', #{param.realName}, '%') + + + AND a.shop_type LIKE CONCAT('%', #{param.shopType}, '%') + + + AND a.category LIKE CONCAT('%', #{param.category}, '%') + + + AND a.commission = #{param.commission} + + + AND a.keywords LIKE CONCAT('%', #{param.keywords}, '%') + + + AND a.files LIKE CONCAT('%', #{param.files}, '%') + + + AND a.own_store = #{param.ownStore} + + + AND a.recommend = #{param.recommend} + + + AND a.goods_review = #{param.goodsReview} + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.status = #{param.status} + + + AND a.sort_number = #{param.sortNumber} + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') + ) + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/MerchantMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/MerchantMapper.xml new file mode 100644 index 0000000..4e134ee --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/MerchantMapper.xml @@ -0,0 +1,93 @@ + + + + + + + SELECT a.* + FROM sys_merchant a + + + AND a.merchant_id = #{param.merchantId} + + + AND a.merchant_name LIKE CONCAT('%', #{param.merchantName}, '%') + + + AND a.merchant_code LIKE CONCAT('%', #{param.merchantCode}, '%') + + + AND a.image LIKE CONCAT('%', #{param.image}, '%') + + + AND a.phone LIKE CONCAT('%', #{param.phone}, '%') + + + AND a.real_name LIKE CONCAT('%', #{param.realName}, '%') + + + AND a.shop_type LIKE CONCAT('%', #{param.shopType}, '%') + + + AND a.category LIKE CONCAT('%', #{param.category}, '%') + + + AND a.commission = #{param.commission} + + + AND a.keywords LIKE CONCAT('%', #{param.keywords}, '%') + + + AND a.files LIKE CONCAT('%', #{param.files}, '%') + + + AND a.own_store = #{param.ownStore} + + + AND a.recommend = #{param.recommend} + + + AND a.goods_review = #{param.goodsReview} + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.status = #{param.status} + + + AND a.sort_number = #{param.sortNumber} + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + AND a.deleted = #{param.deleted} + + + AND a.deleted = 0 + + + AND ( + a.merchant_name LIKE CONCAT('%', #{param.keywords}, '%') + OR a.phone LIKE CONCAT('%', #{param.keywords}, '%') + OR a.real_name LIKE CONCAT('%', #{param.keywords}, '%') + ) + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/MerchantTypeMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/MerchantTypeMapper.xml new file mode 100644 index 0000000..9b60622 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/MerchantTypeMapper.xml @@ -0,0 +1,48 @@ + + + + + + + SELECT a.* + FROM sys_merchant_type a + + + AND a.id = #{param.id} + + + AND a.name LIKE CONCAT('%', #{param.name}, '%') + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.status = #{param.status} + + + AND a.sort_number = #{param.sortNumber} + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') + ) + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/ModulesMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/ModulesMapper.xml new file mode 100644 index 0000000..0f157b6 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/ModulesMapper.xml @@ -0,0 +1,56 @@ + + + + + + + SELECT a.* + FROM sys_modules a + + + AND a.id = #{param.id} + + + AND a.modules LIKE CONCAT('%', #{param.modules}, '%') + + + AND a.modules_url LIKE CONCAT('%', #{param.modulesUrl}, '%') + + + AND a.sort_number = #{param.sortNumber} + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.status = #{param.status} + + + AND a.user_id = #{param.userId} + + + AND a.deleted = #{param.deleted} + + + AND a.deleted = 0 + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/NoticeMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/NoticeMapper.xml new file mode 100644 index 0000000..147aeb2 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/NoticeMapper.xml @@ -0,0 +1,80 @@ + + + + + + + SELECT a.* + FROM sys_notice a + + + AND a.notice_id = #{param.noticeId} + + + AND a.type LIKE CONCAT('%', #{param.type}, '%') + + + AND a.title LIKE CONCAT('%', #{param.title}, '%') + + + AND a.icon LIKE CONCAT('%', #{param.icon}, '%') + + + AND a.color LIKE CONCAT('%', #{param.color}, '%') + + + AND a.content LIKE CONCAT('%', #{param.content}, '%') + + + AND a.is_read = #{param.isRead} + + + AND a.progress = #{param.progress} + + + AND a.channel = #{param.channel} + + + AND a.source LIKE CONCAT('%', #{param.source}, '%') + + + AND a.source_id = #{param.sourceId} + + + AND a.path LIKE CONCAT('%', #{param.path}, '%') + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.user_id = #{param.userId} + + + AND a.status = #{param.status} + + + AND a.deleted = #{param.deleted} + + + AND a.deleted = 0 + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/OperationRecordMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/OperationRecordMapper.xml new file mode 100644 index 0000000..0214d8a --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/OperationRecordMapper.xml @@ -0,0 +1,77 @@ + + + + + + + SELECT a.*, + b.nickname, + b.username + FROM sys_operation_record a + LEFT JOIN sys_user b ON a.user_id = b.user_id + + + AND a.id = #{param.id} + + + AND a.user_id = #{param.userId} + + + AND b.organization_id IN + + #{item} + + + + AND a.module LIKE CONCAT('%', #{param.module}, '%') + + + AND a.description LIKE CONCAT('%', #{param.description}, '%') + + + AND a.url LIKE CONCAT('%', #{param.url}, '%') + + + AND a.request_method = #{param.requestMethod} + + + AND a.method LIKE CONCAT('%', #{param.method}, '%') + + + AND a.description LIKE CONCAT('%', #{param.description}, '%') + + + AND a.ip LIKE CONCAT('%', #{param.ip}, '%') + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.`status` = #{param.status} + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + AND b.username LIKE CONCAT('%', #{param.username}, '%') + + + AND b.nickname LIKE CONCAT('%', #{param.nickname}, '%') + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/OrderGoodsMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/OrderGoodsMapper.xml new file mode 100644 index 0000000..bf09f0c --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/OrderGoodsMapper.xml @@ -0,0 +1,84 @@ + + + + + + + SELECT a.*, b.short_name AS tenantName,b.company_logo as logo + FROM sys_order_goods a + LEFT JOIN sys_company b ON a.tenant_id = b.tenant_id + + + AND a.id = #{param.id} + + + AND a.type = #{param.type} + + + AND a.order_id = #{param.orderId} + + + AND a.item_id = #{param.itemId} + + + AND a.pay_price = #{param.payPrice} + + + AND a.total_num = #{param.totalNum} + + + AND a.pay_status = #{param.payStatus} + + + AND a.order_status = #{param.orderStatus} + + + AND a.start_time LIKE CONCAT('%', #{param.startTime}, '%') + + + AND a.is_invoice = #{param.isInvoice} + + + AND a.invoice_no LIKE CONCAT('%', #{param.invoiceNo}, '%') + + + AND a.pay_time LIKE CONCAT('%', #{param.payTime}, '%') + + + AND a.expiration_time LIKE CONCAT('%', #{param.expirationTime}, '%') + + + AND a.user_id = #{param.userId} + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.sort_number = #{param.sortNumber} + + + AND a.deleted = #{param.deleted} + + + AND a.deleted = 0 + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/OrderInfoMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/OrderInfoMapper.xml new file mode 100644 index 0000000..64da232 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/OrderInfoMapper.xml @@ -0,0 +1,86 @@ + + + + + + + SELECT a.* + FROM sys_order_info a + + + AND a.id = #{param.id} + + + AND a.oid = #{param.oid} + + + AND a.sid = #{param.sid} + + + AND a.fid = #{param.fid} + + + AND a.site_name LIKE CONCAT('%', #{param.siteName}, '%') + + + AND a.field_name LIKE CONCAT('%', #{param.fieldName}, '%') + + + AND a.date_time LIKE CONCAT('%', #{param.dateTime}, '%') + + + AND a.price = #{param.price} + + + AND a.children_price = #{param.childrenPrice} + + + AND a.adult_num = #{param.adultNum} + + + AND a.children_num = #{param.childrenNum} + + + AND a.pay_status = #{param.payStatus} + + + AND a.is_free = #{param.isFree} + + + AND a.is_children = #{param.isChildren} + + + AND a.type = #{param.type} + + + AND a.merge_data LIKE CONCAT('%', #{param.mergeData}, '%') + + + AND a.start_time = #{param.startTime} + + + AND a.order_time = #{param.orderTime} + + + AND a.time_flag LIKE CONCAT('%', #{param.timeFlag}, '%') + + + AND a.deleted = #{param.deleted} + + + AND a.deleted = 0 + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/OrderMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/OrderMapper.xml new file mode 100644 index 0000000..44d7d8c --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/OrderMapper.xml @@ -0,0 +1,149 @@ + + + + + + + SELECT a.*, b.short_name AS tenantName,b.company_logo as logo + FROM sys_order a + LEFT JOIN sys_company b ON a.tenant_id = b.tenant_id + + + AND a.order_id = #{param.orderId} + + + AND a.order_no LIKE CONCAT('%', #{param.orderNo}, '%') + + + AND a.type = #{param.type} + + + AND a.channel = #{param.channel} + + + AND a.transaction_id LIKE CONCAT('%', #{param.transactionId}, '%') + + + AND a.refund_order LIKE CONCAT('%', #{param.refundOrder}, '%') + + + AND a.coupon_id = #{param.couponId} + + + AND a.real_name LIKE CONCAT('%', #{param.realName}, '%') + + + AND a.phone LIKE CONCAT('%', #{param.phone}, '%') + + + AND a.total_price = #{param.totalPrice} + + + AND a.reduce_price = #{param.reducePrice} + + + AND a.pay_price = #{param.payPrice} + + + AND a.price = #{param.price} + + + AND a.money = #{param.money} + + + AND a.refund_money = #{param.refundMoney} + + + AND a.total_num = #{param.totalNum} + + + AND a.pay_type = #{param.payType} + + + AND a.pay_status = #{param.payStatus} + + + AND a.order_status = #{param.orderStatus} + + + AND a.coupon_type = #{param.couponType} + + + AND a.coupon_desc LIKE CONCAT('%', #{param.couponDesc}, '%') + + + AND a.qrcode LIKE CONCAT('%', #{param.qrcode}, '%') + + + AND a.start_time LIKE CONCAT('%', #{param.startTime}, '%') + + + AND a.is_invoice = #{param.isInvoice} + + + AND a.invoice_no LIKE CONCAT('%', #{param.invoiceNo}, '%') + + + AND a.pay_time LIKE CONCAT('%', #{param.payTime}, '%') + + + AND a.refund_time LIKE CONCAT('%', #{param.refundTime}, '%') + + + AND a.refund_apply_time LIKE CONCAT('%', #{param.refundApplyTime}, '%') + + + AND a.expiration_time LIKE CONCAT('%', #{param.expirationTime}, '%') + + + AND a.check_bill = #{param.checkBill} + + + AND a.is_settled = #{param.isSettled} + + + AND a.version = #{param.version} + + + AND a.user_id = #{param.userId} + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.sort_number = #{param.sortNumber} + + + AND a.deleted = #{param.deleted} + + + AND a.deleted = 0 + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + AND (a.tenant_id = #{param.keywords} + OR a.order_id = #{param.keywords} + OR a.phone = #{param.keywords} + OR a.real_name LIKE CONCAT('%', #{param.keywords}, '%') + OR a.order_no LIKE CONCAT('%', #{param.keywords}, '%') + ) + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/OrganizationMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/OrganizationMapper.xml new file mode 100644 index 0000000..dbc8e84 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/OrganizationMapper.xml @@ -0,0 +1,128 @@ + + + + + + + SELECT ta.* + FROM sys_dictionary_data ta + LEFT JOIN sys_dictionary tb + ON ta.dict_id = tb.dict_id + AND tb.deleted = 0 + WHERE ta.deleted = 0 + AND tb.dict_code = 'organization_type' + + + + + SELECT a.*, + b.dict_data_name organization_type_name, + c.nickname leader_nickname, + c.username leader_username + FROM sys_organization a + LEFT JOIN ( + + ) b ON a.organization_type = b.dict_data_code + LEFT JOIN sys_user c ON a.leader_id = c.user_id + + AND a.deleted = 0 + + AND a.organization_id = #{param.organizationId} + + + AND a.organization_id IN + + #{item} + + + + AND (a.organization_id = #{param.organizationIdWithChildren} OR a.parent_id = #{param.organizationIdWithChildren}) + + + AND a.parent_id = #{param.parentId} + + + AND a.organization_name LIKE CONCAT('%', #{param.organizationName}, '%') + + + AND a.organization_full_name LIKE CONCAT('%', #{param.organizationFullName}, '%') + + + AND a.organization_code LIKE CONCAT('%', #{param.organizationCode}, '%') + + + AND a.organization_type = #{param.organizationType} + + + AND a.province = #{param.province} + + + AND a.city = #{param.city} + + + AND a.province = #{param.province} + + + AND a.city = #{param.city} + + + AND a.region = #{param.region} + + + AND a.zip_code = #{param.zipCode} + + + AND a.park LIKE CONCAT('%', #{param.park}, '%') + + + AND a.image LIKE CONCAT('%', #{param.image}, '%') + + + AND a.about LIKE CONCAT('%', #{param.about}, '%') + + + AND a.leader_id = #{param.leaderId} + + + AND a.is_coop = #{param.isCoop} + + + AND a.estate IS NOT null + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + AND b.dict_data_name LIKE CONCAT('%', #{param.organizationTypeName}, '%') + + + AND c.nickname LIKE CONCAT('%', #{param.leaderNickname}, '%') + + + AND c.username LIKE CONCAT('%', #{param.leaderUsername}, '%') + + + AND ( + a.organization_name LIKE CONCAT('%', #{param.keywords}, '%') + ) + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/PaymentMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/PaymentMapper.xml new file mode 100644 index 0000000..20ab037 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/PaymentMapper.xml @@ -0,0 +1,77 @@ + + + + + + + SELECT a.* + FROM sys_payment a + + + AND a.id = #{param.id} + + + AND a.name LIKE CONCAT('%', #{param.name}, '%') + + + AND a.type = #{param.type} + + + AND a.code = #{param.code} + + + AND a.wechat_type = #{param.wechatType} + + + AND a.app_id LIKE CONCAT('%', #{param.appId}, '%') + + + AND a.mch_id LIKE CONCAT('%', #{param.mchId}, '%') + + + AND a.api_key LIKE CONCAT('%', #{param.apiKey}, '%') + + + AND a.apiclient_cert LIKE CONCAT('%', #{param.apiclientCert}, '%') + + + AND a.apiclient_key LIKE CONCAT('%', #{param.apiclientKey}, '%') + + + AND a.merchant_serial_number LIKE CONCAT('%', #{param.merchantSerialNumber}, '%') + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.sort_number = #{param.sortNumber} + + + AND a.status = #{param.status} + + + AND a.deleted = #{param.deleted} + + + AND a.deleted = 0 + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/PlugMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/PlugMapper.xml new file mode 100644 index 0000000..5ea80d8 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/PlugMapper.xml @@ -0,0 +1,74 @@ + + + + + + + SELECT a.* + FROM sys_plug a + + + AND a.plug_id = #{param.plugId} + + + AND a.plug_name LIKE CONCAT('%', #{param.plugName}, '%') + + + AND a.plug_code LIKE CONCAT('%', #{param.plugCode}, '%') + + + AND a.plug_type = #{param.plugType} + + + AND a.sort_number = #{param.sortNumber} + + + AND a.price = #{param.price} + + + AND a.score = #{param.score} + + + AND a.clicks = #{param.clicks} + + + AND a.installs = #{param.installs} + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.content LIKE CONCAT('%', #{param.content}, '%') + + + AND a.status = #{param.status} + + + AND a.user_id = #{param.userId} + + + AND a.deleted = #{param.deleted} + + + AND a.deleted = 0 + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/RechargeOrderMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/RechargeOrderMapper.xml new file mode 100644 index 0000000..e1ebeec --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/RechargeOrderMapper.xml @@ -0,0 +1,106 @@ + + + + + + + SELECT a.*,b.phone,b.nickname,b.user_id,b.avatar,b.real_name,c.organization_id,c.organization_name + FROM sys_recharge_order a + LEFT JOIN sys_user b ON a.user_id = b.user_id + LEFT JOIN sys_organization c ON a.organization_id = c.organization_id + + + AND a.order_id = #{param.orderId} + + + AND a.order_no LIKE CONCAT('%', #{param.orderNo}, '%') + + + AND a.user_id = #{param.userId} + + + AND a.recharge_type = #{param.rechargeType} + + + AND a.organization_id = #{param.organizationId} + + + AND a.plan_id = #{param.planId} + + + AND a.pay_price = #{param.payPrice} + + + AND a.gift_money = #{param.giftMoney} + + + AND a.actual_money = #{param.actualMoney} + + + AND a.balance = #{param.balance} + + + AND a.pay_method LIKE CONCAT('%', #{param.payMethod}, '%') + + + AND a.pay_status = #{param.payStatus} + + + AND a.pay_time = #{param.payTime} + + + AND a.trade_id = #{param.tradeId} + + + AND a.platform LIKE CONCAT('%', #{param.platform}, '%') + + + AND a.shop_id = #{param.shopId} + + + AND a.sort_number = #{param.sortNumber} + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.status = #{param.status} + + + AND a.deleted = #{param.deleted} + + + AND a.deleted = 0 + + + AND a.merchant_code LIKE CONCAT('%', #{param.merchantCode}, '%') + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + AND ( + b.nickname LIKE CONCAT('%', #{param.keywords}, '%') + OR a.user_id LIKE CONCAT('%', #{param.keywords}, '%') + OR b.alias LIKE CONCAT('%', #{param.keywords}, '%') + OR b.phone LIKE CONCAT('%', #{param.keywords}, '%') + OR b.real_name LIKE CONCAT('%', #{param.keywords}, '%') + ) + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/RoleMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/RoleMapper.xml new file mode 100644 index 0000000..a20ab88 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/RoleMapper.xml @@ -0,0 +1,22 @@ + + + + + + SELECT a.* + FROM sys_role a + + + AND a.role_code = #{param.roleCode} + + + AND a.tenant_id = #{param.tenantId} + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/RoleMenuMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/RoleMenuMapper.xml new file mode 100644 index 0000000..377d903 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/RoleMenuMapper.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/SettingMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/SettingMapper.xml new file mode 100644 index 0000000..ac81f4e --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/SettingMapper.xml @@ -0,0 +1,33 @@ + + + + + + + SELECT a.* + FROM sys_setting a + + + AND a.setting_key = #{param.settingKey} + + + AND a.setting_id = #{param.settingId} + + + AND a.tenant_id = #{param.tenantId} + + + AND a.deleted = #{param.deleted} + + + AND a.deleted = 0 + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/SysFileTypeMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/SysFileTypeMapper.xml new file mode 100644 index 0000000..980c752 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/SysFileTypeMapper.xml @@ -0,0 +1,45 @@ + + + + + + + SELECT a.* + FROM sys_file_type a + + + AND a.id = #{param.id} + + + AND a.type = #{param.type} + + + AND a.name LIKE CONCAT('%', #{param.name}, '%') + + + AND a.path LIKE CONCAT('%', #{param.path}, '%') + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') + ) + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/TenantMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/TenantMapper.xml new file mode 100644 index 0000000..8765748 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/TenantMapper.xml @@ -0,0 +1,71 @@ + + + + + + + SELECT a.*,b.company_name,b.company_logo as logo,b.admin_url,b.domain,b.free_domain, + u.phone,u.username + FROM sys_tenant a + LEFT JOIN sys_company b ON a.tenant_id = b.tenant_id + LEFT JOIN gxwebsoft_core.sys_user u ON u.tenant_id = a.tenant_id AND u.is_super_admin = 1 AND u.deleted = 0 + + + AND a.tenant_id = #{param.tenantId} + + + AND a.tenant_name LIKE CONCAT('%', #{param.tenantName}, '%') + + + AND a.tenant_code LIKE CONCAT('%', #{param.tenantCode}, '%') + + + AND a.logo LIKE CONCAT('%', #{param.logo}, '%') + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.status = #{param.status} + + + AND a.user_id = #{param.userId} + + + AND a.deleted = #{param.deleted} + + + AND a.deleted = 0 + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + AND ( + a.tenant_name LIKE CONCAT('%', #{param.keywords}, '%') + OR a.tenant_code = #{param.keywords} + OR a.tenant_id = #{param.keywords} + ) + + + + + + + + + + + + + DELETE FROM sys_tenant WHERE tenant_id = #{param.tenantId} + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/TenantPackageMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/TenantPackageMapper.xml new file mode 100644 index 0000000..3b1ded6 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/TenantPackageMapper.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/TenantSubscriptionMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/TenantSubscriptionMapper.xml new file mode 100644 index 0000000..4255e78 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/TenantSubscriptionMapper.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/TenantSubscriptionOrderMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/TenantSubscriptionOrderMapper.xml new file mode 100644 index 0000000..921084a --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/TenantSubscriptionOrderMapper.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserBalanceLogMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserBalanceLogMapper.xml new file mode 100644 index 0000000..965aed7 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserBalanceLogMapper.xml @@ -0,0 +1,84 @@ + + + + + + + SELECT a.*, + b.nickname,b.avatar,b.phone + FROM sys_user_balance_log a + LEFT JOIN sys_user b ON a.user_id = b.user_id + + + AND a.log_id = #{param.logId} + + + AND a.user_id = #{param.userId} + + + AND a.scene = #{param.scene} + + + AND a.scene IN + + #{item} + + + + AND a.money = #{param.money} + + + AND a.balance = #{param.balance} + + + AND a.describe LIKE CONCAT('%', #{param.describe}, '%') + + + AND a.remark LIKE CONCAT('%', #{param.remark}, '%') + + + AND a.sort_number = #{param.sortNumber} + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.status = #{param.status} + + + AND a.deleted = #{param.deleted} + + + AND a.deleted = 0 + + + AND a.merchant_code LIKE CONCAT('%', #{param.merchantCode}, '%') + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + AND ( + a.user_id = #{param.keywords} + OR b.nickname LIKE CONCAT('%', #{param.keywords}, '%') + OR b.alias LIKE CONCAT('%', #{param.keywords}, '%') + OR b.phone = #{param.keywords} + ) + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserCollectionMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserCollectionMapper.xml new file mode 100644 index 0000000..9b60a69 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserCollectionMapper.xml @@ -0,0 +1,38 @@ + + + + + + + SELECT a.* + FROM sys_user_collection a + + + AND a.id = #{param.id} + + + AND a.tid = #{param.tid} + + + AND a.user_id = #{param.userId} + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserFileMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserFileMapper.xml new file mode 100644 index 0000000..872b232 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserFileMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserGradeMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserGradeMapper.xml new file mode 100644 index 0000000..5797863 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserGradeMapper.xml @@ -0,0 +1,62 @@ + + + + + + + SELECT a.* + FROM sys_user_grade a + + + AND a.grade_id = #{param.gradeId} + + + AND a.name LIKE CONCAT('%', #{param.name}, '%') + + + AND a.weight = #{param.weight} + + + AND a.upgrade LIKE CONCAT('%', #{param.upgrade}, '%') + + + AND a.equity LIKE CONCAT('%', #{param.equity}, '%') + + + AND a.commission LIKE CONCAT('%', #{param.commission}, '%') + + + AND a.sort_number = #{param.sortNumber} + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.status = #{param.status} + + + AND a.deleted = #{param.deleted} + + + AND a.deleted = 0 + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserGroupMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserGroupMapper.xml new file mode 100644 index 0000000..8a59e29 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserGroupMapper.xml @@ -0,0 +1,50 @@ + + + + + + + SELECT a.* + FROM sys_user_group a + + + AND a.group_id = #{param.groupId} + + + AND a.name LIKE CONCAT('%', #{param.name}, '%') + + + AND a.sort_number = #{param.sortNumber} + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.status = #{param.status} + + + AND a.deleted = #{param.deleted} + + + AND a.deleted = 0 + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserMapper.xml new file mode 100644 index 0000000..4031414 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserMapper.xml @@ -0,0 +1,382 @@ + + + + + + + SELECT ta.* + FROM sys_dictionary_data ta + LEFT JOIN sys_dictionary tb + ON ta.dict_id = tb.dict_id + AND tb.deleted = 0 + WHERE ta.deleted = 0 + AND tb.dict_code = 'sex' + + + + + SELECT a.user_id, + GROUP_CONCAT(b.role_name) role_name + FROM sys_user_role a + LEFT JOIN sys_role b ON a.role_id = b.role_id + GROUP BY a.user_id + + + + + SELECT a.*, + b.organization_name, + c.dict_data_name sex_name, + e.name as groupName, + f.name as gradeName, + g.company_name as companyName,g.company_logo as logo, + t.tenant_name as tenantName + FROM sys_user a + LEFT JOIN sys_organization b ON a.organization_id = b.organization_id + LEFT JOIN ( + + ) c ON a.sex = c.dict_data_code + LEFT JOIN( + + ) d ON a.user_id = d.user_id + LEFT JOIN sys_user_group e ON a.group_id = e.group_id + LEFT JOIN sys_user_grade f ON a.grade_id = f.grade_id + LEFT JOIN sys_tenant t ON a.tenant_id = t.tenant_id + LEFT JOIN sys_company g ON g.tenant_id = t.tenant_id + + + AND a.user_id = #{param.userId} + + + AND a.username LIKE CONCAT('%', #{param.username}, '%') + + + AND a.uid = #{param.uid} + + + AND a.user_code = #{param.userCode} + + + AND a.nickname LIKE CONCAT('%', #{param.nickname}, '%') + + + AND a.type = #{param.type} + + + AND a.sex = #{param.sex} + + + AND a.phone LIKE CONCAT('%', #{param.phone}, '%') + + + AND a.email LIKE CONCAT('%', #{param.email}, '%') + + + AND a.email_verified = #{param.emailVerified} + + + AND a.real_name LIKE CONCAT('%', #{param.realName}, '%') + + + AND a.company_name LIKE CONCAT('%', #{param.companyName}, '%') + + + AND a.id_card LIKE CONCAT('%', #{param.idCard}, '%') + + + AND a.birthday LIKE CONCAT('%', #{param.birthday}, '%') + + + AND a.organization_id = #{param.organizationId} + + + AND a.group_id = #{param.groupId} + + + AND a.organization_id > 0 + + + AND a.installed = #{param.installed} + + + AND a.template_id = #{param.templateId} + + + AND a.merchant_id = #{param.merchantId} + + + AND a.platform = #{param.platform} + + + AND a.`status` = #{param.status} + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + AND a.recommend = #{param.recommend} + + + AND a.grade_id = #{param.gradeId} + + + AND a.is_admin = #{param.isAdmin} + + + AND a.template_id = #{param.templateId} + + + AND a.is_organization_admin = #{param.isOrganizationAdmin} + + + AND a.deleted = #{param.deleted} + + + AND a.deleted = 0 + + + AND a.user_id IN (SELECT user_id FROM sys_user_role WHERE role_id=#{param.roleId}) + + + AND a.user_id IN (SELECT user_id FROM sys_user_role WHERE role_code=#{param.roleCode}) + + + AND a.user_id IN + + #{item} + + + + AND a.organization_id IN + + #{item} + + + + AND a.phone IN + + #{item} + + + + AND a.id_card IN + + #{item} + + + + AND a.province LIKE CONCAT('%', #{param.province}, '%') + + + AND a.city LIKE CONCAT('%', #{param.city}, '%') + + + AND a.region LIKE CONCAT('%', #{param.region}, '%') + + + AND b.organization_name LIKE CONCAT('%', #{param.organizationName}, '%') + + + AND c.dict_data_name = #{param.sexName} + + + AND a.expert_type = #{param.expertType} + + + AND a.tenant_id = #{param.tenantId} + + + AND a.username = 'superAdmin' + + + AND ( + a.username = #{param.keywords} + OR a.user_id = #{param.keywords} + OR a.id_card = #{param.keywords} + OR a.merchant_id = #{param.keywords} + OR a.nickname LIKE CONCAT('%', #{param.keywords}, '%') + OR a.real_name LIKE CONCAT('%', #{param.keywords}, '%') + OR a.phone LIKE CONCAT('%', #{param.keywords}, '%') + OR a.email = #{param.keywords} + ) + + + AND a.organization_id IN (SELECT organization_id FROM sys_organization WHERE parent_id=#{param.parentId}) + + + + + + + + + + + + + + + + + + + + + + + + + UPDATE sys_user + + + grade_id = #{param.gradeId}, + + + password = #{param.password}, + + + nickname = #{param.nickname}, + + + avatar = #{param.avatar}, + + + phone = #{param.phone}, + + + email = #{param.email}, + + + status = #{param.status}, + + + WHERE user_id = #{param.userId} + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserOauthMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserOauthMapper.xml new file mode 100644 index 0000000..049cde1 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserOauthMapper.xml @@ -0,0 +1,59 @@ + + + + + + + SELECT a.* + FROM sys_user_oauth a + + + AND a.id = #{param.id} + + + AND a.user_id = #{param.userId} + + + AND a.oauth_type LIKE CONCAT('%', #{param.oauthType}, '%') + + + AND a.oauth_id LIKE CONCAT('%', #{param.oauthId}, '%') + + + AND a.unionid LIKE CONCAT('%', #{param.unionid}, '%') + + + AND a.sort_number = #{param.sortNumber} + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.status = #{param.status} + + + AND a.deleted = #{param.deleted} + + + AND a.deleted = 0 + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserRefereeMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserRefereeMapper.xml new file mode 100644 index 0000000..67943f7 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserRefereeMapper.xml @@ -0,0 +1,50 @@ + + + + + + + SELECT a.* + FROM sys_user_referee a + + + AND a.id = #{param.id} + + + AND a.dealer_id = #{param.dealerId} + + + AND a.user_id = #{param.userId} + + + AND a.level = #{param.level} + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.deleted = #{param.deleted} + + + AND a.deleted = 0 + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserRoleMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserRoleMapper.xml new file mode 100644 index 0000000..69272a3 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserRoleMapper.xml @@ -0,0 +1,67 @@ + + + + + + INSERT INTO sys_user_role(user_id, role_id) VALUES + + (#{userId}, #{roleId}) + + + + + + + + + + SELECT a.*, b.role_name, b.role_code + FROM sys_user_role a + LEFT JOIN sys_role b ON a.role_id = b.role_id + + + AND a.id = #{param.id} + + + AND a.user_id = #{param.userId} + + + AND a.role_id = #{param.roleId} + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserVerifyMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserVerifyMapper.xml new file mode 100644 index 0000000..963bf69 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserVerifyMapper.xml @@ -0,0 +1,174 @@ + + + + + + + SELECT a.*, b.phone, c.organization_name, d.nickname as adminName + FROM sys_user_verify a + LEFT JOIN sys_user b ON a.user_id = b.user_id + LEFT JOIN sys_organization c ON a.organization_id = c.organization_id + LEFT JOIN sys_user d ON a.admin_id = d.user_id + + + AND a.id = #{param.id} + + + AND a.user_id = #{param.userId} + + + AND a.type = #{param.type} + + + AND a.name LIKE CONCAT('%', #{param.name}, '%') + + + AND a.real_name LIKE CONCAT('%', #{param.realName}, '%') + + + AND a.id_card LIKE CONCAT('%', #{param.idCard}, '%') + + + AND a.birthday LIKE CONCAT('%', #{param.birthday}, '%') + + + AND a.sfz1 LIKE CONCAT('%', #{param.sfz1}, '%') + + + AND a.sfz2 LIKE CONCAT('%', #{param.sfz2}, '%') + + + AND a.zz_code = #{param.zzCode} + + + AND a.admin_id = #{param.adminId} + + + AND a.organization_id = #{param.organizationId} + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.status = #{param.status} + + + AND a.deleted = #{param.deleted} + + + AND a.deleted = 0 + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + AND a.organization_id IN + + #{item} + + + + AND (a.name LIKE CONCAT('%', #{param.keywords}, '%') + OR a.real_name LIKE CONCAT('%', #{param.keywords}, '%') + OR b.phone = #{param.keywords} + OR a.id_card = #{param.keywords} + OR a.zz_code = #{param.keywords} + ) + + + + AND a.id IN ( + SELECT MAX(v.id) + FROM sys_user_verify v + LEFT JOIN sys_user u ON v.user_id = u.user_id + + + AND v.user_id = #{param.userId} + + + AND v.type = #{param.type} + + + AND v.name LIKE CONCAT('%', #{param.name}, '%') + + + AND v.real_name LIKE CONCAT('%', #{param.realName}, '%') + + + AND v.id_card LIKE CONCAT('%', #{param.idCard}, '%') + + + AND v.birthday LIKE CONCAT('%', #{param.birthday}, '%') + + + AND v.sfz1 LIKE CONCAT('%', #{param.sfz1}, '%') + + + AND v.sfz2 LIKE CONCAT('%', #{param.sfz2}, '%') + + + AND v.zz_code = #{param.zzCode} + + + AND v.admin_id = #{param.adminId} + + + AND v.organization_id = #{param.organizationId} + + + AND v.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND v.status = #{param.status} + + + AND v.deleted = #{param.deleted} + + + AND v.deleted = 0 + + + AND v.create_time >= #{param.createTimeStart} + + + AND v.create_time <= #{param.createTimeEnd} + + + AND v.organization_id IN + + #{item} + + + + AND (v.name LIKE CONCAT('%', #{param.keywords}, '%') + OR v.real_name LIKE CONCAT('%', #{param.keywords}, '%') + OR u.phone = #{param.keywords} + OR v.id_card = #{param.keywords} + OR v.zz_code = #{param.keywords} + ) + + + GROUP BY v.user_id + ) + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/VersionMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/VersionMapper.xml new file mode 100644 index 0000000..08a9d87 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/VersionMapper.xml @@ -0,0 +1,71 @@ + + + + + + + SELECT a.* + FROM sys_version a + + + AND a.id = #{param.id} + + + AND a.version_name LIKE CONCAT('%', #{param.versionName}, '%') + + + AND a.version_code = #{param.versionCode} + + + AND a.android_download_url LIKE CONCAT('%', #{param.androidDownloadUrl}, '%') + + + AND a.ios_download_url LIKE CONCAT('%', #{param.iosDownloadUrl}, '%') + + + AND a.update_info LIKE CONCAT('%', #{param.updateInfo}, '%') + + + AND a.is_hard = #{param.isHard} + + + AND a.is_hot = #{param.isHot} + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.sort_number = #{param.sortNumber} + + + AND a.user_id = #{param.userId} + + + AND a.status = #{param.status} + + + AND a.deleted = #{param.deleted} + + + AND a.deleted = 0 + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/WebsiteFieldMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/WebsiteFieldMapper.xml new file mode 100644 index 0000000..b2117f9 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/WebsiteFieldMapper.xml @@ -0,0 +1,68 @@ + + + + + + + SELECT a.* + FROM sys_website_field a + + + AND a.id = #{param.id} + + + AND a.type = #{param.type} + + + AND a.name LIKE CONCAT('%', #{param.name}, '%') + + + AND a.default_value LIKE CONCAT('%', #{param.defaultValue}, '%') + + + AND a.modify_range LIKE CONCAT('%', #{param.modifyRange}, '%') + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.value LIKE CONCAT('%', #{param.value}, '%') + + + AND a.sort_number = #{param.sortNumber} + + + AND a.deleted = #{param.deleted} + + + AND a.deleted = 0 + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + AND ( + a.name LIKE CONCAT('%', #{param.keywords}, '%') + OR a.comments LIKE CONCAT('%', #{param.keywords}, '%') + OR a.value LIKE CONCAT('%', #{param.keywords}, '%') + OR a.default_value LIKE CONCAT('%', #{param.keywords}, '%') + OR a.comments = #{param.keywords} + ) + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/WhiteDomainMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/WhiteDomainMapper.xml new file mode 100644 index 0000000..821d441 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/WhiteDomainMapper.xml @@ -0,0 +1,50 @@ + + + + + + + SELECT a.* + FROM sys_white_domain a + + + AND a.id = #{param.id} + + + AND a.domain LIKE CONCAT('%', #{param.domain}, '%') + + + AND a.status = #{param.status} + + + AND a.sort_number = #{param.sortNumber} + + + AND a.user_id = #{param.userId} + + + AND a.deleted = #{param.deleted} + + + AND a.deleted = 0 + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/common/system/param/AccessKeyParam.java b/src/main/java/com/gxwebsoft/common/system/param/AccessKeyParam.java new file mode 100644 index 0000000..8132496 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/AccessKeyParam.java @@ -0,0 +1,55 @@ +package com.gxwebsoft.common.system.param; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 查询参数 + * + * @author WebSoft + * @since 2021-08-29 20:35:09 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(description = "角色查询参数") +public class AccessKeyParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "id") + @QueryField(type = QueryType.EQ) + private Integer id; + + @Schema(description = "AccessKey") + private String accessKey; + + @Schema(description = "AccessSecret") + private String accessSecret; + + @Schema(description = "手机号码") + @TableField(exist = false) + private String phone; + + @Schema(description = "短信验证码") + @TableField(exist = false) + private String code; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "租户ID") + private Integer tenantId; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/AlipayParam.java b/src/main/java/com/gxwebsoft/common/system/param/AlipayParam.java new file mode 100644 index 0000000..9888a3c --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/AlipayParam.java @@ -0,0 +1,31 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * 登录参数 + * + * @author WebSoft + * @since 2021-08-30 17:35:16 + */ +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(description = "登录参数") +public class AlipayParam implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "支付宝授权码") + private String authCode; + + @Schema(description = "登录账号") + private String username; + + @Schema(description = "租户id") + private Integer tenantId; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/AuthorizeCodeParam.java b/src/main/java/com/gxwebsoft/common/system/param/AuthorizeCodeParam.java new file mode 100644 index 0000000..1224cba --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/AuthorizeCodeParam.java @@ -0,0 +1,44 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 授权码查询参数 + * + * @author 科技小王子 + * @since 2025-08-05 01:17:27 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(name = "AuthorizeCodeParam对象", description = "授权码查询参数") +public class AuthorizeCodeParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "id") + @QueryField(type = QueryType.EQ) + private Integer id; + + @Schema(description = "授权码") + private String code; + + @Schema(description = "用户ID") + @QueryField(type = QueryType.EQ) + private Integer userId; + + @Schema(description = "排序号") + @QueryField(type = QueryType.EQ) + private Integer sortNumber; + + @Schema(description = "是否删除, 0否, 1是") + @QueryField(type = QueryType.EQ) + private Integer deleted; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/CacheParam.java b/src/main/java/com/gxwebsoft/common/system/param/CacheParam.java new file mode 100644 index 0000000..082e278 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/CacheParam.java @@ -0,0 +1,25 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * 缓存管理 + * + * @author WebSoft + * @since 2021-08-30 17:35:16 + */ +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(description = "缓存管理") +public class CacheParam implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "key") + private String key; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/CartParam.java b/src/main/java/com/gxwebsoft/common/system/param/CartParam.java new file mode 100644 index 0000000..44c462b --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/CartParam.java @@ -0,0 +1,86 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 购物车查询参数 + * + * @author 科技小王子 + * @since 2024-10-26 10:54:51 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(name = "CartParam对象", description = "购物车查询参数") +public class CartParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "购物车表ID") + @QueryField(type = QueryType.EQ) + private Long id; + + @Schema(description = "类型 0商城 1应用插件") + @QueryField(type = QueryType.EQ) + private Integer type; + + @Schema(description = "唯一标识") + private String code; + + @Schema(description = "项目ID,0 goodId 1 companyId") + private Long itemId; + + @Schema(description = "商品规格") + private String spec; + + @Schema(description = "商品价格") + @QueryField(type = QueryType.EQ) + private BigDecimal price; + + @Schema(description = "商品数量") + @QueryField(type = QueryType.EQ) + private Integer cartNum; + + @Schema(description = "单商品合计") + @QueryField(type = QueryType.EQ) + private BigDecimal totalPrice; + + @Schema(description = "0 = 未购买 1 = 已购买") + @QueryField(type = QueryType.EQ) + private Boolean isPay; + + @Schema(description = "是否为立即购买") + @QueryField(type = QueryType.EQ) + private Boolean isNew; + + @Schema(description = "拼团id") + @QueryField(type = QueryType.EQ) + private Integer combinationId; + + @Schema(description = "秒杀产品ID") + @QueryField(type = QueryType.EQ) + private Integer seckillId; + + @Schema(description = "砍价id") + @QueryField(type = QueryType.EQ) + private Integer bargainId; + + @Schema(description = "是否选中") + @QueryField(type = QueryType.EQ) + private Boolean selected; + + @Schema(description = "商户ID") + private Long merchantId; + + @Schema(description = "用户ID") + private Long userId; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/ChatConversationParam.java b/src/main/java/com/gxwebsoft/common/system/param/ChatConversationParam.java new file mode 100644 index 0000000..c5ba1eb --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/ChatConversationParam.java @@ -0,0 +1,56 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 聊天消息表查询参数 + * + * @author 科技小王子 + * @since 2024-04-27 15:57:27 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(name = "ChatConversationParam对象", description = "聊天消息表查询参数") +public class ChatConversationParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "自增ID") + @QueryField(type = QueryType.EQ) + private Integer id; + + @Schema(description = "用户ID") + @QueryField(type = QueryType.EQ) + private Integer userId; + + @Schema(description = "好友ID") + @QueryField(type = QueryType.EQ) + private Integer friendId; + + @Schema(description = "消息类型") + @QueryField(type = QueryType.EQ) + private Integer type; + + @Schema(description = "消息内容") + private String content; + + @Schema(description = "未读消息") + @QueryField(type = QueryType.EQ) + private Integer unRead; + + @Schema(description = "状态, 0未读, 1已读") + @QueryField(type = QueryType.EQ) + private Integer status; + + @Schema(description = "是否删除, 0否, 1是") + @QueryField(type = QueryType.EQ) + private Integer deleted; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/ChatMessageParam.java b/src/main/java/com/gxwebsoft/common/system/param/ChatMessageParam.java new file mode 100644 index 0000000..3beb2c6 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/ChatMessageParam.java @@ -0,0 +1,74 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Set; + +/** + * 聊天消息表查询参数 + * + * @author 科技小王子 + * @since 2024-04-27 15:57:27 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(name = "ChatMessageParam对象", description = "聊天消息表查询参数") +public class ChatMessageParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "自增ID") + @QueryField(type = QueryType.EQ) + private Integer id; + + @Schema(description = "发送人ID") + @QueryField(type = QueryType.EQ) + private Integer formUserId; + + @Schema(description = "接收人ID") + @QueryField(type = QueryType.EQ) + private Integer toUserId; + + @Schema(description = "消息类型") + private String type; + + @Schema(description = "消息内容") + private String content; + + @Schema(description = "屏蔽接收方") + @QueryField(type = QueryType.EQ) + private Integer sideTo; + + @Schema(description = "屏蔽发送方") + @QueryField(type = QueryType.EQ) + private Integer sideFrom; + + @Schema(description = "是否撤回") + @QueryField(type = QueryType.EQ) + private Integer withdraw; + + @Schema(description = "文件信息") + private String fileInfo; + + @Schema(description = "存在联系方式") + @QueryField(type = QueryType.EQ) + private Integer hasContact; + + @Schema(description = "状态, 0未读, 1已读") + @QueryField(type = QueryType.EQ) + private Integer status; + + @Schema(description = "是否删除, 0否, 1是") + @QueryField(type = QueryType.EQ) + private Integer deleted; + + @Schema(description = "接收人ID集合") + private Set toUserIds; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/CompanyCommentParam.java b/src/main/java/com/gxwebsoft/common/system/param/CompanyCommentParam.java new file mode 100644 index 0000000..b2fdcf8 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/CompanyCommentParam.java @@ -0,0 +1,58 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 应用评论查询参数 + * + * @author 科技小王子 + * @since 2024-10-17 15:30:24 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(name = "CompanyCommentParam对象", description = "应用评论查询参数") +public class CompanyCommentParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "ID") + @QueryField(type = QueryType.EQ) + private Integer id; + + @Schema(description = "父级ID") + @QueryField(type = QueryType.EQ) + private Integer parentId; + + @Schema(description = "用户ID") + @QueryField(type = QueryType.EQ) + private Integer userId; + + @Schema(description = "企业ID") + @QueryField(type = QueryType.EQ) + private Integer companyId; + + @Schema(description = "评分") + @QueryField(type = QueryType.EQ) + private BigDecimal rate; + + @Schema(description = "排序(数字越小越靠前)") + @QueryField(type = QueryType.EQ) + private Integer sortNumber; + + @Schema(description = "评论内容") + private String comments; + + @Schema(description = "状态") + @QueryField(type = QueryType.EQ) + private Integer status; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/CompanyContentParam.java b/src/main/java/com/gxwebsoft/common/system/param/CompanyContentParam.java new file mode 100644 index 0000000..1a5ff5e --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/CompanyContentParam.java @@ -0,0 +1,35 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 应用详情查询参数 + * + * @author 科技小王子 + * @since 2024-10-16 13:41:21 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(name = "CompanyContentParam对象", description = "应用详情查询参数") +public class CompanyContentParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @QueryField(type = QueryType.EQ) + private Integer id; + + @Schema(description = "企业ID") + @QueryField(type = QueryType.EQ) + private Integer companyId; + + @Schema(description = "详细内容") + private String content; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/CompanyGitParam.java b/src/main/java/com/gxwebsoft/common/system/param/CompanyGitParam.java new file mode 100644 index 0000000..7786857 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/CompanyGitParam.java @@ -0,0 +1,60 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 代码仓库查询参数 + * + * @author 科技小王子 + * @since 2024-10-19 18:08:51 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(name = "CompanyGitParam对象", description = "代码仓库查询参数") +public class CompanyGitParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "自增ID") + @QueryField(type = QueryType.EQ) + private Integer id; + + @Schema(description = "仓库名称") + private String title; + + @Schema(description = "厂商") + @QueryField(type = QueryType.EQ) + private String brand; + + @Schema(description = "企业ID") + @QueryField(type = QueryType.EQ) + private Integer companyId; + + @Schema(description = "仓库地址") + private String domain; + + @Schema(description = "账号") + private String account; + + @Schema(description = "密码") + private String password; + + @Schema(description = "仓库描述") + private String comments; + + @Schema(description = "排序(数字越小越靠前)") + @QueryField(type = QueryType.EQ) + private Integer sortNumber; + + @Schema(description = "状态, 0正常, 1待确认") + @QueryField(type = QueryType.EQ) + private Integer status; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/CompanyParam.java b/src/main/java/com/gxwebsoft/common/system/param/CompanyParam.java new file mode 100644 index 0000000..6c48c51 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/CompanyParam.java @@ -0,0 +1,167 @@ +package com.gxwebsoft.common.system.param; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Set; + +/** + * 企业信息查询参数 + * + * @author 科技小王子 + * @since 2023-05-27 14:57:34 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(name = "CompanyParam对象", description = "企业信息查询参数") +public class CompanyParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "企业id") + @QueryField(type = QueryType.EQ) + private Integer companyId; + + @Schema(description = "应用类型") + private Integer type; + + @Schema(description = "是否官方") + private Boolean official; + + @Schema(description = "企业简称") + private String shortName; + + @Schema(description = "企业全称") + private String companyName; + + @Schema(description = "企业标识") + private String companyCode; + + @Schema(description = "类型 10企业 20政府单位") + @QueryField(type = QueryType.EQ) + private String companyType; + + @Schema(description = "企业类型 多选") + private String companyTypeMultiple; + + @Schema(description = "应用标识") + private String companyLogo; + + @Schema(description = "栏目分类") + @QueryField(type = QueryType.EQ) + private Integer categoryId; + + @Schema(description = "企业域名") + private String domain; + + @Schema(description = "联系电话") + private String phone; + + @Schema(description = "电子邮箱") + @QueryField(type = QueryType.EQ) + private String email; + + @Schema(description = "企业法人") + private String businessEntity; + + @Schema(description = "发票抬头") + private String invoiceHeader; + + @Schema(description = "服务开始时间") + private String startTime; + + @Schema(description = "服务到期时间") + private String expirationTime; + + @Schema(description = "应用版本 10体验版 20授权版 30旗舰版") + @QueryField(type = QueryType.EQ) + private Integer version; + + @Schema(description = "成员数量") + @QueryField(type = QueryType.EQ) + private Integer members; + + @Schema(description = "行业类型(父级)") + private String industryParent; + + @Schema(description = "行业类型(子级)") + private String industryChild; + + @Schema(description = "部门数量") + @QueryField(type = QueryType.EQ) + private Integer departments; + + @Schema(description = "所在国家") + private String country; + + @Schema(description = "所在省份") + private String province; + + @Schema(description = "所在城市") + private String city; + + @Schema(description = "所在辖区") + private String region; + + @Schema(description = "街道地址") + private String address; + + @Schema(description = "经度") + private String longitude; + + @Schema(description = "纬度") + private String latitude; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "是否实名认证") + @QueryField(type = QueryType.EQ) + private Integer authentication; + + @Schema(description = "是否推荐") + @QueryField(type = QueryType.EQ) + private Boolean recommend; + + @Schema(description = "应用类型 app应用 plug插件") + private String appType; + + @Schema(description = "状态") + @QueryField(type = QueryType.EQ) + private Integer status; + + @Schema(description = "用户ID") + @QueryField(type = QueryType.EQ) + private Integer userId; + + @Schema(description = "商户ID") + @QueryField(type = QueryType.EQ) + private Long merchantId; + + @Schema(description = "是否删除, 0否, 1是") + @QueryField(type = QueryType.EQ) + private Integer deleted; + + @Schema(description = "是否默认企业主体") + @QueryField(type = QueryType.EQ) + private Boolean authoritative; + + @Schema(description = "租户号") + private Integer tenantId; + + @Schema(description = "应用名称") + @QueryField(type = QueryType.EQ) + private String appName; + + @Schema(description = "企业id集合") + @TableField(exist = false) + private Set companyIds; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/CompanyParameterParam.java b/src/main/java/com/gxwebsoft/common/system/param/CompanyParameterParam.java new file mode 100644 index 0000000..91c97b0 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/CompanyParameterParam.java @@ -0,0 +1,50 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 应用参数查询参数 + * + * @author 科技小王子 + * @since 2024-10-17 15:30:24 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(name = "CompanyParameterParam对象", description = "应用参数查询参数") +public class CompanyParameterParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "自增ID") + @QueryField(type = QueryType.EQ) + private Integer id; + + @Schema(description = "参数名称") + private String name; + + @Schema(description = "参数内容") + private String value; + + @Schema(description = "企业ID") + @QueryField(type = QueryType.EQ) + private Integer companyId; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "排序(数字越小越靠前)") + @QueryField(type = QueryType.EQ) + private Integer sortNumber; + + @Schema(description = "状态, 0正常, 1待确认") + @QueryField(type = QueryType.EQ) + private Integer status; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/CompanyUrlParam.java b/src/main/java/com/gxwebsoft/common/system/param/CompanyUrlParam.java new file mode 100644 index 0000000..e0576e4 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/CompanyUrlParam.java @@ -0,0 +1,59 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 应用域名查询参数 + * + * @author 科技小王子 + * @since 2024-10-17 15:30:24 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(name = "CompanyUrlParam对象", description = "应用域名查询参数") +public class CompanyUrlParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "自增ID") + @QueryField(type = QueryType.EQ) + private Integer id; + + @Schema(description = "域名类型") + private String type; + + @Schema(description = "企业ID") + @QueryField(type = QueryType.EQ) + private Integer companyId; + + @Schema(description = "域名") + private String domain; + + @Schema(description = "账号") + private String account; + + @Schema(description = "密码") + private String password; + + @Schema(description = "二维码") + private String qrcode; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "排序(数字越小越靠前)") + @QueryField(type = QueryType.EQ) + private Integer sortNumber; + + @Schema(description = "状态, 0正常, 1待确认") + @QueryField(type = QueryType.EQ) + private Integer status; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/ComponentsParam.java b/src/main/java/com/gxwebsoft/common/system/param/ComponentsParam.java new file mode 100644 index 0000000..1b38f70 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/ComponentsParam.java @@ -0,0 +1,66 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 组件查询参数 + * + * @author 科技小王子 + * @since 2024-08-25 19:08:51 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(name = "ComponentsParam对象", description = "组件查询参数") +public class ComponentsParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "ID") + @QueryField(type = QueryType.EQ) + private Integer id; + + @Schema(description = "组件标题") + private String title; + + @Schema(description = "关联导航ID") + @QueryField(type = QueryType.EQ) + private Integer navigationId; + + @Schema(description = "组件类型") + private String type; + + @Schema(description = "页面关键词") + private String keywords; + + @Schema(description = "页面描述") + private String description; + + @Schema(description = "组件路径") + private String path; + + @Schema(description = "组件图标") + private String icon; + + @Schema(description = "用户ID") + @QueryField(type = QueryType.EQ) + private Integer userId; + + @Schema(description = "排序(数字越小越靠前)") + @QueryField(type = QueryType.EQ) + private Integer sortNumber; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "状态, 0正常, 1冻结") + @QueryField(type = QueryType.EQ) + private Integer status; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/DictDataParam.java b/src/main/java/com/gxwebsoft/common/system/param/DictDataParam.java new file mode 100644 index 0000000..037e988 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/DictDataParam.java @@ -0,0 +1,58 @@ +package com.gxwebsoft.common.system.param; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 字典数据查询参数 + * + * @author WebSoft + * @since 2021-08-28 22:12:02 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(description = "字典数据查询参数") +public class DictDataParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "字典数据id") + @QueryField(type = QueryType.EQ) + private Integer dictDataId; + + @Schema(description = "字典id") + @QueryField(type = QueryType.EQ) + private Integer dictId; + + @Schema(description = "字典数据标识") + private String dictDataCode; + + @Schema(description = "字典数据名称") + private String dictDataName; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "字典代码") + @TableField(exist = false) + private String dictCode; + + @Schema(description = "预设字段:组件路径") + private String component; + + @Schema(description = "字典名称") + @TableField(exist = false) + private String dictName; + + @Schema(description = "字典数据代码或字典数据名称") + @TableField(exist = false) + private String keywords; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/DictParam.java b/src/main/java/com/gxwebsoft/common/system/param/DictParam.java new file mode 100644 index 0000000..2957409 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/DictParam.java @@ -0,0 +1,38 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 字典查询参数 + * + * @author WebSoft + * @since 2021-08-28 22:12:01 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(description = "字典查询参数") +public class DictParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @QueryField(type = QueryType.EQ) + @Schema(description = "字典id") + private Integer dictId; + + @Schema(description = "字典标识") + private String dictCode; + + @Schema(description = "字典名称") + private String dictName; + + @Schema(description = "备注") + private String comments; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/DictionaryDataParam.java b/src/main/java/com/gxwebsoft/common/system/param/DictionaryDataParam.java new file mode 100644 index 0000000..3972f01 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/DictionaryDataParam.java @@ -0,0 +1,58 @@ +package com.gxwebsoft.common.system.param; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 字典数据查询参数 + * + * @author WebSoft + * @since 2021-08-28 22:12:02 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(description = "字典数据查询参数") +public class DictionaryDataParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "字典数据id") + @QueryField(type = QueryType.EQ) + private Integer dictDataId; + + @Schema(description = "字典id") + @QueryField(type = QueryType.EQ) + private Integer dictId; + + @Schema(description = "字典数据标识") + private String dictDataCode; + + @Schema(description = "字典数据名称") + private String dictDataName; + + @Schema(description = "预设字段:组件路径") + private String component; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "字典代码") + @TableField(exist = false) + private String dictCode; + + @Schema(description = "字典名称") + @TableField(exist = false) + private String dictName; + + @Schema(description = "字典数据代码或字典数据名称") + @TableField(exist = false) + private String keywords; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/DictionaryParam.java b/src/main/java/com/gxwebsoft/common/system/param/DictionaryParam.java new file mode 100644 index 0000000..0e70378 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/DictionaryParam.java @@ -0,0 +1,38 @@ +package com.gxwebsoft.common.system.param; + +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 字典查询参数 + * + * @author WebSoft + * @since 2021-08-28 22:12:01 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(description = "字典查询参数") +public class DictionaryParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @QueryField(type = QueryType.EQ) + @Schema(description = "字典id") + private Integer dictId; + + @Schema(description = "字典标识") + private String dictCode; + + @Schema(description = "字典名称") + private String dictName; + + @Schema(description = "备注") + private String comments; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/DomainParam.java b/src/main/java/com/gxwebsoft/common/system/param/DomainParam.java new file mode 100644 index 0000000..c842644 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/DomainParam.java @@ -0,0 +1,61 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 授权域名查询参数 + * + * @author 科技小王子 + * @since 2024-09-19 23:56:33 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(name = "DomainParam对象", description = "授权域名查询参数") +public class DomainParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "ID") + @QueryField(type = QueryType.EQ) + private Integer id; + + @Schema(description = "域名") + private String domain; + + @Schema(description = "主机记录") + private String hostName; + + @Schema(description = "记录值") + private String hostValue; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "类型 0常规 1后台 2商家端") + @QueryField(type = QueryType.EQ) + private Integer type; + + @Schema(description = "状态") + @QueryField(type = QueryType.EQ) + private Integer status; + + @Schema(description = "排序号") + @QueryField(type = QueryType.EQ) + private Integer sortNumber; + + @Schema(description = "用户ID") + @QueryField(type = QueryType.EQ) + private Integer userId; + + @Schema(description = "是否删除, 0否, 1是") + @QueryField(type = QueryType.EQ) + private Integer deleted; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/EnvironmentParam.java b/src/main/java/com/gxwebsoft/common/system/param/EnvironmentParam.java new file mode 100644 index 0000000..baeb857 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/EnvironmentParam.java @@ -0,0 +1,66 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 环境管理查询参数 + * + * @author 科技小王子 + * @since 2023-10-18 08:45:13 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(name = "EnvironmentParam对象", description = "环境管理查询参数") +public class EnvironmentParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "插件id") + @QueryField(type = QueryType.EQ) + private Integer id; + + @Schema(description = "环境名称") + private String environmentName; + + @Schema(description = "环境编号") + private String environmentCode; + + @Schema(description = "服务器厂商") + private String brand; + + @Schema(description = "服务器IP") + private String serverIp; + + @Schema(description = "模块访问地址") + private String modulesUrl; + + @Schema(description = "模块API") + private String modulesApi; + + @Schema(description = "排序号") + @QueryField(type = QueryType.EQ) + private Integer sortNumber; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "状态, 10待审核 20已通过 30已驳回") + @QueryField(type = QueryType.EQ) + private Integer status; + + @Schema(description = "用户ID") + @QueryField(type = QueryType.EQ) + private Integer userId; + + @Schema(description = "是否删除, 0否, 1是") + @QueryField(type = QueryType.EQ) + private Integer deleted; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/FileRecordParam.java b/src/main/java/com/gxwebsoft/common/system/param/FileRecordParam.java new file mode 100644 index 0000000..9ee25cc --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/FileRecordParam.java @@ -0,0 +1,79 @@ +package com.gxwebsoft.common.system.param; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 文件上传记录查询参数 + * + * @author WebSoft + * @since 2021-08-30 11:29:31 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(description = "文件上传记录查询参数") +public class FileRecordParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @QueryField(type = QueryType.EQ) + @Schema(description = "主键id") + private Integer id; + + @QueryField(type = QueryType.EQ) + @Schema(description = "分组ID") + private Integer groupId; + + @Schema(description = "文件名称") + private String name; + + @Schema(description = "文件存储路径") + private String path; + + @QueryField(type = QueryType.EQ) + @Schema(description = "应用ID") + private Integer appId; + + @QueryField(type = QueryType.EQ) + @Schema(description = "企业ID") + private Integer companyId; + + @QueryField(type = QueryType.EQ) + @Schema(description = "商户ID") + private Long merchantId; + + @QueryField(type = QueryType.EQ) + @Schema(description = "创建人") + private Integer createUserId; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "文件类型") + private String contentType; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "创建人账号") + @TableField(exist = false) + private String createUsername; + + @Schema(description = "创建人名称") + @TableField(exist = false) + private String createNickname; + + @Schema(description = "用户头像") + @TableField(exist = false) + private String avatar; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/FindAccountByPhoneParam.java b/src/main/java/com/gxwebsoft/common/system/param/FindAccountByPhoneParam.java new file mode 100644 index 0000000..b5d6248 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/FindAccountByPhoneParam.java @@ -0,0 +1,34 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * 通过手机号查找账号参数 + * + * @author WebSoft + * @since 2025-12-12 + */ +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(description = "通过手机号查找账号参数") +public class FindAccountByPhoneParam implements Serializable { + private static final long serialVersionUID = 1L; + + @NotBlank(message = "手机号不能为空") + @Schema(description = "手机号码", required = true) + private String phone; + + @NotBlank(message = "短信验证码不能为空") + @Schema(description = "短信验证码", required = true) + private String smsCode; + + @NotNull(message = "模板ID不能为空") + @Schema(description = "短信模板ID", required = true) + private Integer templateId; +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/LoginParam.java b/src/main/java/com/gxwebsoft/common/system/param/LoginParam.java new file mode 100644 index 0000000..e1ad55a --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/LoginParam.java @@ -0,0 +1,58 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * 登录参数 + * + * @author WebSoft + * @since 2021-08-30 17:35:16 + */ +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(description = "登录参数") +public class LoginParam implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "账号") + private String userId; + + @Schema(description = "账号") + private String username; + + @Schema(description = "手机号码") + private String phone; + + @Schema(description = "短信验证码") + private String code; + + @Schema(description = "短信验证码(别名)") + private String smsCode; + + @Schema(description = "密码") + private String password; + + @Schema(description = "是否管理员") + private Boolean isAdmin; + + @Schema(description = "是否超级管理员") + private Boolean isSuperAdmin; + + @Schema(description = "应用安装状态") + private Boolean installed; + + @Schema(description = "模板id") + private Integer templateId; + + @Schema(description = "记住我") + private Boolean remember; + + @Schema(description = "租户id") + private Integer tenantId; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/LoginRecordParam.java b/src/main/java/com/gxwebsoft/common/system/param/LoginRecordParam.java new file mode 100644 index 0000000..833b056 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/LoginRecordParam.java @@ -0,0 +1,60 @@ +package com.gxwebsoft.common.system.param; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 登录日志查询参数 + * + * @author WebSoft + * @since 2021-08-29 19:09:23 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(description = "登录日志查询参数") +public class LoginRecordParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @QueryField(type = QueryType.EQ) + @Schema(description = "主键id") + private Integer id; + + @Schema(description = "用户账号") + private String username; + + @Schema(description = "操作系统") + private String os; + + @Schema(description = "设备名") + private String device; + + @Schema(description = "浏览器类型") + private String browser; + + @Schema(description = "ip地址") + private String ip; + + @QueryField(type = QueryType.EQ) + @Schema(description = "操作类型, 0登录成功, 1登录失败, 2退出登录, 3续签token") + private Integer loginType; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "用户id") + @TableField(exist = false) + private Integer userId; + + @Schema(description = "用户昵称") + @TableField(exist = false) + private String nickname; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/MenuImportParam.java b/src/main/java/com/gxwebsoft/common/system/param/MenuImportParam.java new file mode 100644 index 0000000..7245b24 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/MenuImportParam.java @@ -0,0 +1,60 @@ +package com.gxwebsoft.common.system.param; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.io.Serializable; + +/** + * 菜单导入参数 + * + * @author WebSoft + * @since 2025-09-30 + */ +@Data +public class MenuImportParam implements Serializable { + private static final long serialVersionUID = 1L; + + @Excel(name = "菜单ID") + private Integer menuId; + + @Excel(name = "父级ID") + private Integer parentId; + + @Excel(name = "菜单名称") + private String title; + + @Excel(name = "路由地址") + private String path; + + @Excel(name = "组件路径") + private String component; + + @Excel(name = "模块ID") + private String modules; + + @Excel(name = "模块API") + private String modulesUrl; + + @Excel(name = "菜单类型") + private Integer menuType; + + @Excel(name = "排序号") + private Integer sortNumber; + + @Excel(name = "权限标识") + private String authority; + + @Excel(name = "图标") + private String icon; + + @Excel(name = "是否隐藏") + private Integer hide; + + @Excel(name = "关联应用") + private Integer appId; + + @Excel(name = "租户id") + private Integer tenantId; + +} \ No newline at end of file diff --git a/src/main/java/com/gxwebsoft/common/system/param/MenuParam.java b/src/main/java/com/gxwebsoft/common/system/param/MenuParam.java new file mode 100644 index 0000000..ee7c9c1 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/MenuParam.java @@ -0,0 +1,84 @@ +package com.gxwebsoft.common.system.param; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 菜单查询参数 + * + * @author WebSoft + * @since 2021-08-29 19:36:10 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(description = "菜单查询参数") +public class MenuParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "菜单id") + @QueryField(type = QueryType.EQ) + private Integer menuId; + + @Schema(description = "上级id, 0是顶级") + @QueryField(type = QueryType.EQ) + private Integer parentId; + + @Schema(description = "菜单名称") + private String title; + + @Schema(description = "菜单路由关键字") + private String path; + + @Schema(description = "菜单组件地址") + private String component; + + @Schema(description = "模块ID") + private String modules; + + @Schema(description = "菜单类型, 0菜单, 1按钮") + @QueryField(type = QueryType.EQ) + private Integer menuType; + + @Schema(description = "打开方式, 0当前页, 1新窗口") + @TableField(exist = false) + private Integer openType; + + @Schema(description = "权限标识") + private String authority; + + @Schema(description = "菜单图标") + private String icon; + + @Schema(description = "关联应用") + private Integer appId; + + @Schema(description = "是否隐藏, 0否, 1是(仅注册路由不显示左侧菜单)") + @QueryField(type = QueryType.EQ) + private Integer hide; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "租户ID") + @QueryField(type = QueryType.EQ) + private Integer tenantId; + + @Schema(description = "企业ID") + @QueryField(type = QueryType.EQ) + private Integer companyId; + + @Schema(description = "租户名称") + @TableField(exist = false) + private String tenantName; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/MerchantAccountParam.java b/src/main/java/com/gxwebsoft/common/system/param/MerchantAccountParam.java new file mode 100644 index 0000000..f1516b9 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/MerchantAccountParam.java @@ -0,0 +1,55 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 商户账号查询参数 + * + * @author 科技小王子 + * @since 2024-04-19 12:02:24 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(name = "MerchantAccountParam对象", description = "商户账号查询参数") +public class MerchantAccountParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "ID") + @QueryField(type = QueryType.EQ) + private Integer id; + + @Schema(description = "商户手机号") + @QueryField(type = QueryType.EQ) + private String phone; + + @Schema(description = "真实姓名") + private String realName; + + @Schema(description = "商户ID") + @QueryField(type = QueryType.EQ) + private Long merchantId; + + @Schema(description = "用户ID") + @QueryField(type = QueryType.EQ) + private Integer userId; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "状态") + @QueryField(type = QueryType.EQ) + private Integer status; + + @Schema(description = "排序号") + @QueryField(type = QueryType.EQ) + private Integer sortNumber; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/MerchantApplyParam.java b/src/main/java/com/gxwebsoft/common/system/param/MerchantApplyParam.java new file mode 100644 index 0000000..ec0b900 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/MerchantApplyParam.java @@ -0,0 +1,82 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 商户入驻申请查询参数 + * + * @author 科技小王子 + * @since 2024-04-05 01:24:36 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(name = "MerchantApplyParam对象", description = "商户入驻申请查询参数") +public class MerchantApplyParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "ID") + @QueryField(type = QueryType.EQ) + private Integer applyId; + + @Schema(description = "商户名称") + private String merchantName; + + @Schema(description = "商户图标") + private String image; + + @Schema(description = "商户手机号") + private String phone; + + @Schema(description = "商户姓名") + private String realName; + + @Schema(description = "店铺类型") + private String shopType; + + @Schema(description = "商户分类") + private String category; + + @Schema(description = "手续费") + @QueryField(type = QueryType.EQ) + private BigDecimal commission; + + @Schema(description = "关键字") + private String keywords; + + @Schema(description = "资质图片") + private String files; + + @Schema(description = "是否自营") + @QueryField(type = QueryType.EQ) + private Integer ownStore; + + @Schema(description = "是否推荐") + @QueryField(type = QueryType.EQ) + private Integer recommend; + + @Schema(description = "是否需要审核") + @QueryField(type = QueryType.EQ) + private Integer goodsReview; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "状态") + @QueryField(type = QueryType.EQ) + private Integer status; + + @Schema(description = "排序号") + @QueryField(type = QueryType.EQ) + private Integer sortNumber; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/MerchantParam.java b/src/main/java/com/gxwebsoft/common/system/param/MerchantParam.java new file mode 100644 index 0000000..7b6bbff --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/MerchantParam.java @@ -0,0 +1,99 @@ +package com.gxwebsoft.common.system.param; + +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 商户查询参数 + * + * @author 科技小王子 + * @since 2024-04-05 00:03:54 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(name = "MerchantParam对象", description = "商户查询参数") +public class MerchantParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "ID") + @QueryField(type = QueryType.EQ) + private Long merchantId; + + @Schema(description = "商户名称") + private String merchantName; + + @Schema(description = "商户标识") + private String merchantCode; + + @Schema(description = "商户图标") + private String image; + + @Schema(description = "商户手机号") + private String phone; + + @Schema(description = "商户姓名") + private String realName; + + @Schema(description = "店铺类型") + private String shopType; + + @Schema(description = "商户分类") + private String category; + + @Schema(description = "所在省份") + private String province; + + @Schema(description = "所在城市") + private String city; + + @Schema(description = "所在辖区") + private String region; + + @Schema(description = "手续费") + @QueryField(type = QueryType.EQ) + private BigDecimal commission; + + @Schema(description = "关键字") + private String keywords; + + @Schema(description = "资质图片") + private String files; + + @Schema(description = "是否自营") + @QueryField(type = QueryType.EQ) + private Integer ownStore; + + @Schema(description = "是否推荐") + @QueryField(type = QueryType.EQ) + private Integer recommend; + + @Schema(description = "是否需要审核") + @QueryField(type = QueryType.EQ) + private Integer goodsReview; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "状态") + @QueryField(type = QueryType.EQ) + private Integer status; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "排序号") + @QueryField(type = QueryType.EQ) + private Integer sortNumber; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/MerchantTypeParam.java b/src/main/java/com/gxwebsoft/common/system/param/MerchantTypeParam.java new file mode 100644 index 0000000..a6f8d09 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/MerchantTypeParam.java @@ -0,0 +1,43 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 商户类型查询参数 + * + * @author 科技小王子 + * @since 2024-04-05 00:08:51 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(name = "MerchantTypeParam对象", description = "商户类型查询参数") +public class MerchantTypeParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "ID") + @QueryField(type = QueryType.EQ) + private Integer id; + + @Schema(description = "店铺类型") + private String name; + + @Schema(description = "店铺入驻条件") + private String comments; + + @Schema(description = "状态") + @QueryField(type = QueryType.EQ) + private Integer status; + + @Schema(description = "排序号") + @QueryField(type = QueryType.EQ) + private Integer sortNumber; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/ModulesParam.java b/src/main/java/com/gxwebsoft/common/system/param/ModulesParam.java new file mode 100644 index 0000000..c406a44 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/ModulesParam.java @@ -0,0 +1,54 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 模块管理查询参数 + * + * @author 科技小王子 + * @since 2023-10-18 15:53:43 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(name = "ModulesParam对象", description = "模块管理查询参数") +public class ModulesParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "插件id") + @QueryField(type = QueryType.EQ) + private Integer id; + + @Schema(description = "环境编号") + private String modules; + + @Schema(description = "模块访问地址") + private String modulesUrl; + + @Schema(description = "排序号") + @QueryField(type = QueryType.EQ) + private Integer sortNumber; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "状态, 10待审核 20已通过 30已驳回") + @QueryField(type = QueryType.EQ) + private Integer status; + + @Schema(description = "用户ID") + @QueryField(type = QueryType.EQ) + private Integer userId; + + @Schema(description = "是否删除, 0否, 1是") + @QueryField(type = QueryType.EQ) + private Integer deleted; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/NoticeParam.java b/src/main/java/com/gxwebsoft/common/system/param/NoticeParam.java new file mode 100644 index 0000000..40b8f52 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/NoticeParam.java @@ -0,0 +1,86 @@ +package com.gxwebsoft.common.system.param; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 消息记录表查询参数 + * + * @author 科技小王子 + * @since 2023-03-22 14:07:26 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(name = "NoticeParam对象", description = "消息记录表查询参数") +public class NoticeParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "ID") + @QueryField(type = QueryType.EQ) + private Integer noticeId; + + @Schema(description = "消息类型") + private String type; + + @Schema(description = "标题") + private String title; + + @Schema(description = "图标") + private String icon; + + @Schema(description = "颜色") + private String color; + + @Schema(description = "内容") + private String content; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "消息来源") + private String source; + + @Schema(description = "来源记录ID") + private Integer sourceId; + + @Schema(description = "路由地址") + private String path; + + @Schema(description = "渠道, 0发送 1回复") + private Integer channel; + + @Schema(description = "用户ID") + @QueryField(type = QueryType.EQ) + private Integer userId; + + @Schema(description = "租户id") + @QueryField(type = QueryType.EQ) + private Integer tenantId; + + @Schema(description = "状态, 0待处理, 1已完成") + @QueryField(type = QueryType.EQ) + private Integer status; + + @Schema(description = "是否删除, 0否, 1是") + @QueryField(type = QueryType.EQ) + private Integer deleted; + + @Schema(description = "昵称") + @TableField(exist = false) + private String nickname; + + @Schema(description = "是否已查阅") + private Integer isRead; + + @Schema(description = "任务状态") + private Integer progress; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/OperationRecordParam.java b/src/main/java/com/gxwebsoft/common/system/param/OperationRecordParam.java new file mode 100644 index 0000000..48e77fd --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/OperationRecordParam.java @@ -0,0 +1,73 @@ +package com.gxwebsoft.common.system.param; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Set; + +/** + * 操作日志参数 + * + * @author WebSoft + * @since 2021-08-29 20:35:09 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(description = "操作日志参数") +public class OperationRecordParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "主键id") + @QueryField(type = QueryType.EQ) + private Integer id; + + @Schema(description = "用户id") + @QueryField(type = QueryType.EQ) + private Integer userId; + + @Schema(description = "机构id合集") + @TableField(exist = false) + private Set organizationIds; + + @Schema(description = "操作模块") + private String module; + + @Schema(description = "操作功能") + private String description; + + @Schema(description = "请求地址") + private String url; + + @Schema(description = "请求方式") + private String requestMethod; + + @Schema(description = "调用方法") + private String method; + + @Schema(description = "ip地址") + private String ip; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "状态, 0成功, 1异常") + @QueryField(type = QueryType.EQ) + private Integer status; + + @Schema(description = "用户账号") + @TableField(exist = false) + private String username; + + @Schema(description = "用户昵称") + @TableField(exist = false) + private String nickname; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/OrderGoodsParam.java b/src/main/java/com/gxwebsoft/common/system/param/OrderGoodsParam.java new file mode 100644 index 0000000..c34fa2d --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/OrderGoodsParam.java @@ -0,0 +1,90 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 订单商品查询参数 + * + * @author 科技小王子 + * @since 2024-10-26 12:18:05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(name = "OrderGoodsParam对象", description = "订单商品查询参数") +public class OrderGoodsParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "订单号") + @QueryField(type = QueryType.EQ) + private Integer id; + + @Schema(description = "订单类型,0商城 1应用插件") + @QueryField(type = QueryType.EQ) + private Integer type; + + @Schema(description = "订单号") + @QueryField(type = QueryType.EQ) + private Integer orderId; + + @Schema(description = "项目ID") + @QueryField(type = QueryType.EQ) + private Integer itemId; + + @Schema(description = "实际付款") + @QueryField(type = QueryType.EQ) + private BigDecimal payPrice; + + @Schema(description = "购买数量") + @QueryField(type = QueryType.EQ) + private Integer totalNum; + + @Schema(description = "0未付款,1已付款") + @QueryField(type = QueryType.EQ) + private Boolean payStatus; + + @Schema(description = "0未完成,1已完成,2已取消,3取消中,4退款申请中,5退款被拒绝,6退款成功,7客户端申请退款") + @QueryField(type = QueryType.EQ) + private Integer orderStatus; + + @Schema(description = "预约详情开始时间数组") + private String startTime; + + @Schema(description = "是否已开具发票:0未开发票,1已开发票,2不能开具发票") + @QueryField(type = QueryType.EQ) + private Boolean isInvoice; + + @Schema(description = "发票流水号") + private String invoiceNo; + + @Schema(description = "支付时间") + private String payTime; + + @Schema(description = "过期时间") + private String expirationTime; + + @Schema(description = "用户id") + @QueryField(type = QueryType.EQ) + private Integer userId; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "排序号") + @QueryField(type = QueryType.EQ) + private Integer sortNumber; + + @Schema(description = "是否删除, 0否, 1是") + @QueryField(type = QueryType.EQ) + private Integer deleted; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/OrderInfoParam.java b/src/main/java/com/gxwebsoft/common/system/param/OrderInfoParam.java new file mode 100644 index 0000000..f022ca5 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/OrderInfoParam.java @@ -0,0 +1,101 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 查询参数 + * + * @author 科技小王子 + * @since 2024-05-10 18:02:54 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(name = "OrderInfoParam对象", description = "查询参数") +public class OrderInfoParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @QueryField(type = QueryType.EQ) + private Integer id; + + @Schema(description = "关联订单表id") + @QueryField(type = QueryType.EQ) + private Integer oid; + + @Schema(description = "关联场馆id") + @QueryField(type = QueryType.EQ) + private Integer sid; + + @Schema(description = "关联场地id") + @QueryField(type = QueryType.EQ) + private Integer fid; + + @Schema(description = "场馆") + private String siteName; + + @Schema(description = "场地") + private String fieldName; + + @Schema(description = "预约时间段") + private String dateTime; + + @Schema(description = "单价") + @QueryField(type = QueryType.EQ) + private BigDecimal price; + + @Schema(description = "儿童价") + @QueryField(type = QueryType.EQ) + private BigDecimal childrenPrice; + + @Schema(description = "成人人数") + @QueryField(type = QueryType.EQ) + private Boolean adultNum; + + @Schema(description = "儿童人数") + @QueryField(type = QueryType.EQ) + private Boolean childrenNum; + + @Schema(description = "1已付款,2未付款,3无需付款或占用状态") + @QueryField(type = QueryType.EQ) + private Boolean payStatus; + + @Schema(description = "是否免费:1免费、2收费") + @QueryField(type = QueryType.EQ) + private Boolean isFree; + + @Schema(description = "是否支持儿童票:1支持,2不支持") + @QueryField(type = QueryType.EQ) + private Boolean isChildren; + + @Schema(description = "预订类型:1全场,2半场") + @QueryField(type = QueryType.EQ) + private Boolean type; + + @Schema(description = "组合数据:日期+时间段+场馆id+场地id") + private String mergeData; + + @Schema(description = "开场时间") + @QueryField(type = QueryType.EQ) + private Integer startTime; + + @Schema(description = "下单时间") + @QueryField(type = QueryType.EQ) + private Integer orderTime; + + @Schema(description = "毫秒时间戳") + private Long timeFlag; + + @Schema(description = "是否删除, 0否, 1是") + @QueryField(type = QueryType.EQ) + private Integer deleted; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/OrderParam.java b/src/main/java/com/gxwebsoft/common/system/param/OrderParam.java new file mode 100644 index 0000000..56de16c --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/OrderParam.java @@ -0,0 +1,157 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 订单查询参数 + * + * @author 科技小王子 + * @since 2024-10-16 12:32:52 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(name = "OrderParam对象", description = "订单查询参数") +public class OrderParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "订单号") + @QueryField(type = QueryType.EQ) + private Integer orderId; + + @Schema(description = "订单编号") + private String orderNo; + + @Schema(description = "订单类型,0产品 1插件") + @QueryField(type = QueryType.EQ) + private Integer type; + + @Schema(description = "下单渠道,0网站 1小程序 2其他") + @QueryField(type = QueryType.EQ) + private Integer channel; + + @Schema(description = "微信支付订单号") + private String transactionId; + + @Schema(description = "微信退款订单号") + private String refundOrder; + + @Schema(description = "使用的优惠券id") + @QueryField(type = QueryType.EQ) + private Integer couponId; + + @Schema(description = "真实姓名") + private String realName; + + @Schema(description = "手机号码") + private String phone; + + @Schema(description = "订单总额") + @QueryField(type = QueryType.EQ) + private BigDecimal totalPrice; + + @Schema(description = "减少的金额,使用VIP会员折扣、优惠券抵扣、优惠券折扣后减去的价格") + @QueryField(type = QueryType.EQ) + private BigDecimal reducePrice; + + @Schema(description = "实际付款") + @QueryField(type = QueryType.EQ) + private BigDecimal payPrice; + + @Schema(description = "用于统计") + @QueryField(type = QueryType.EQ) + private BigDecimal price; + + @Schema(description = "价钱,用于积分赠送") + @QueryField(type = QueryType.EQ) + private BigDecimal money; + + @Schema(description = "退款金额") + @QueryField(type = QueryType.EQ) + private BigDecimal refundMoney; + + @Schema(description = "购买数量") + @QueryField(type = QueryType.EQ) + private Integer totalNum; + + @Schema(description = "0余额支付, 1微信支付,102微信Native,2会员卡支付,3支付宝,4现金,5POS机") + @QueryField(type = QueryType.EQ) + private Integer payType; + + @Schema(description = "0未付款,1已付款") + @QueryField(type = QueryType.EQ) + private Boolean payStatus; + + @Schema(description = "0未完成,1已完成,2已取消,3取消中,4退款申请中,5退款被拒绝,6退款成功,7客户端申请退款") + @QueryField(type = QueryType.EQ) + private Integer orderStatus; + + @Schema(description = "优惠类型:0无、1抵扣优惠券、2折扣优惠券、3、VIP月卡、4VIP年卡,5VIP次卡、6VIP会员卡、7IC月卡、8IC年卡、9IC次卡、10IC会员卡、11免费订单、12VIP充值卡、13IC充值卡、14VIP季卡、15IC季卡") + @QueryField(type = QueryType.EQ) + private Integer couponType; + + @Schema(description = "优惠说明") + private String couponDesc; + + @Schema(description = "二维码地址,保存订单号,支付成功后才生成") + private String qrcode; + + @Schema(description = "预约详情开始时间数组") + private String startTime; + + @Schema(description = "是否已开具发票:0未开发票,1已开发票,2不能开具发票") + @QueryField(type = QueryType.EQ) + private Boolean isInvoice; + + @Schema(description = "发票流水号") + private String invoiceNo; + + @Schema(description = "支付时间") + private String payTime; + + @Schema(description = "退款时间") + private String refundTime; + + @Schema(description = "申请退款时间") + private String refundApplyTime; + + @Schema(description = "过期时间") + private String expirationTime; + + @Schema(description = "对账情况:0=未对账;1=已对账;3=已对账,金额对不上;4=未查询到该订单") + @QueryField(type = QueryType.EQ) + private Integer checkBill; + + @Schema(description = "订单是否已结算(0未结算 1已结算)") + @QueryField(type = QueryType.EQ) + private Integer isSettled; + + @Schema(description = "系统版本号 0当前版本 value=其他版本") + @QueryField(type = QueryType.EQ) + private Integer version; + + @Schema(description = "用户id") + @QueryField(type = QueryType.EQ) + private Integer userId; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "排序号") + @QueryField(type = QueryType.EQ) + private Integer sortNumber; + + @Schema(description = "是否删除, 0否, 1是") + @QueryField(type = QueryType.EQ) + private Integer deleted; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/OrganizationParam.java b/src/main/java/com/gxwebsoft/common/system/param/OrganizationParam.java new file mode 100644 index 0000000..3668de3 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/OrganizationParam.java @@ -0,0 +1,145 @@ +package com.gxwebsoft.common.system.param; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.Set; + +/** + * 组织机构查询参数 + * + * @author WebSoft + * @since 2021-08-29 20:35:09 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(description = "组织机构查询参数") +public class OrganizationParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "机构id") + @QueryField(type = QueryType.EQ) + private Integer organizationId; + + @Schema(description = "机构id合集") + @TableField(exist = false) + private Set organizationIds; + + @Schema(description = "上级id, 0是顶级") + @QueryField(type = QueryType.EQ) + private Integer parentId; + + @Schema(description = "机构名称") + private String organizationName; + + @Schema(description = "机构全称") + private String organizationFullName; + + @Schema(description = "机构代码") + private String organizationCode; + + @Schema(description = "机构类型(字典代码)") + private String organizationType; + + @Schema(description = "所在省份") + @QueryField(type = QueryType.EQ) + private String province; + + @Schema(description = "所在城市") + @QueryField(type = QueryType.EQ) + private String city; + + @Schema(description = "所在辖区") + @QueryField(type = QueryType.EQ) + private String region; + + @Schema(description = "邮政编码") + @QueryField(type = QueryType.EQ) + private String zipCode; + + @Schema(description = "所属园区") + @QueryField(type = QueryType.EQ) + private String park; + + @Schema(description = "有所属产业的企业") + @TableField(exist = false) + private Boolean estateOnly; + + @Schema(description = "机构图片") + @QueryField(type = QueryType.EQ) + private String image; + + @Schema(description = "园区介绍") + @QueryField(type = QueryType.EQ) + private String about; + + @Schema(description = "联系电话") + @QueryField(type = QueryType.EQ) + private String phone; + + @Schema(description = "企业邮箱") + @QueryField(type = QueryType.EQ) + private String email; + + @Schema(description = "成立时间") + @QueryField(type = QueryType.EQ) + private Date establishTime; + + @Schema(description = "注册资金") + @QueryField(type = QueryType.EQ) + private BigDecimal registeredCapital; + + @Schema(description = "经营范围") + @QueryField(type = QueryType.EQ) + private String business; + + @Schema(description = "经营状态") + @QueryField(type = QueryType.EQ) + private Integer businessStatus; + + @Schema(description = "参保人数") + @QueryField(type = QueryType.EQ) + private Integer insureds; + + @Schema(description = "所属行业") + @QueryField(type = QueryType.EQ) + private String industry; + + @Schema(description = "负责人id") + @QueryField(type = QueryType.EQ) + private Integer leaderId; + + @Schema(description = "是否合作单位") + @QueryField(type = QueryType.EQ) + private Integer isCoop; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "机构类型名称") + @TableField(exist = false) + private String organizationTypeName; + + @Schema(description = "负责人姓名") + @TableField(exist = false) + private String leaderNickname; + + @Schema(description = "负责人账号") + @TableField(exist = false) + private String leaderUsername; + + @Schema(description = "企业及部门筛选") + @TableField(exist = false) + private Integer organizationIdWithChildren; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/PaymentParam.java b/src/main/java/com/gxwebsoft/common/system/param/PaymentParam.java new file mode 100644 index 0000000..ef0e785 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/PaymentParam.java @@ -0,0 +1,77 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 支付方式查询参数 + * + * @author 科技小王子 + * @since 2024-05-11 12:39:11 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(name = "PaymentParam对象", description = "支付方式查询参数") +public class PaymentParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "ID") + @QueryField(type = QueryType.EQ) + private Integer id; + + @Schema(description = "支付方式") + private String name; + + @Schema(description = "类型") + @QueryField(type = QueryType.EQ) + private Integer type; + + @Schema(description = "标识") + @QueryField(type = QueryType.EQ) + private String code; + + @Schema(description = "微信商户号类型 1普通商户2子商户") + @QueryField(type = QueryType.EQ) + private Integer wechatType; + + @Schema(description = "应用ID") + private String appId; + + @Schema(description = "商户号") + private String mchId; + + @Schema(description = "设置APIv3密钥") + private String apiKey; + + @Schema(description = "证书文件 (CERT)") + private String apiclientCert; + + @Schema(description = "证书文件 (KEY)") + private String apiclientKey; + + @Schema(description = "商户证书序列号") + private String merchantSerialNumber; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "文章排序(数字越小越靠前)") + @QueryField(type = QueryType.EQ) + private Integer sortNumber; + + @Schema(description = "状态, 0启用, 1禁用") + @QueryField(type = QueryType.EQ) + private Boolean status; + + @Schema(description = "是否删除, 0否, 1是") + @QueryField(type = QueryType.EQ) + private Integer deleted; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/PlugParam.java b/src/main/java/com/gxwebsoft/common/system/param/PlugParam.java new file mode 100644 index 0000000..95d5299 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/PlugParam.java @@ -0,0 +1,79 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 插件扩展查询参数 + * + * @author 科技小王子 + * @since 2023-10-12 09:53:07 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(name = "PlugParam对象", description = "插件扩展查询参数") +public class PlugParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "插件id") + @QueryField(type = QueryType.EQ) + private Integer plugId; + + @Schema(description = "菜单名称") + private String plugName; + + @Schema(description = "插件ID") + private String plugCode; + + @Schema(description = "插件类型 10后台模块") + @QueryField(type = QueryType.EQ) + private Integer plugType; + + @Schema(description = "排序号") + @QueryField(type = QueryType.EQ) + private Integer sortNumber; + + @Schema(description = "插件价格") + @QueryField(type = QueryType.EQ) + private BigDecimal price; + + @Schema(description = "评分") + @QueryField(type = QueryType.EQ) + private BigDecimal score; + + @Schema(description = "下载次数") + @QueryField(type = QueryType.EQ) + private Integer clicks; + + @Schema(description = "安装次数") + @QueryField(type = QueryType.EQ) + private Integer installs; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "插件详情") + private String content; + + @Schema(description = "状态, 10待审核 20已通过 30已驳回") + @QueryField(type = QueryType.EQ) + private Integer status; + + @Schema(description = "用户ID") + @QueryField(type = QueryType.EQ) + private Integer userId; + + @Schema(description = "是否删除, 0否, 1是") + @QueryField(type = QueryType.EQ) + private Integer deleted; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/RechargeOrderParam.java b/src/main/java/com/gxwebsoft/common/system/param/RechargeOrderParam.java new file mode 100644 index 0000000..4c73e3f --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/RechargeOrderParam.java @@ -0,0 +1,106 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 会员充值订单表查询参数 + * + * @author 科技小王子 + * @since 2024-07-26 23:18:48 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(name = "RechargeOrderParam对象", description = "会员充值订单表查询参数") +public class RechargeOrderParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "订单ID") + @QueryField(type = QueryType.EQ) + private Integer orderId; + + @Schema(description = "订单号") + private String orderNo; + + @Schema(description = "用户ID") + @QueryField(type = QueryType.EQ) + private Integer userId; + + @Schema(description = "充值方式(10自定义金额 20套餐充值)") + @QueryField(type = QueryType.EQ) + private Integer rechargeType; + + @Schema(description = "机构id") + @QueryField(type = QueryType.EQ) + private Integer organizationId; + + @Schema(description = "充值套餐ID") + @QueryField(type = QueryType.EQ) + private Integer planId; + + @Schema(description = "用户支付金额") + @QueryField(type = QueryType.EQ) + private BigDecimal payPrice; + + @Schema(description = "赠送金额") + @QueryField(type = QueryType.EQ) + private BigDecimal giftMoney; + + @Schema(description = "实际到账金额") + @QueryField(type = QueryType.EQ) + private BigDecimal actualMoney; + + @Schema(description = "用户可用余额") + @QueryField(type = QueryType.EQ) + private BigDecimal balance; + + @Schema(description = "支付方式(微信/支付宝)") + private String payMethod; + + @Schema(description = "支付状态(10待支付 20已支付)") + @QueryField(type = QueryType.EQ) + private Integer payStatus; + + @Schema(description = "付款时间") + @QueryField(type = QueryType.EQ) + private Integer payTime; + + @Schema(description = "第三方交易记录ID") + @QueryField(type = QueryType.EQ) + private Integer tradeId; + + @Schema(description = "来源客户端 (APP、H5、小程序等)") + private String platform; + + @Schema(description = "所属门店ID") + @QueryField(type = QueryType.EQ) + private Integer shopId; + + @Schema(description = "排序(数字越小越靠前)") + @QueryField(type = QueryType.EQ) + private Integer sortNumber; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "状态, 0正常, 1冻结") + @QueryField(type = QueryType.EQ) + private Integer status; + + @Schema(description = "是否删除, 0否, 1是") + @QueryField(type = QueryType.EQ) + private Integer deleted; + + @Schema(description = "商户编码") + private String merchantCode; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/ResetPasswordParam.java b/src/main/java/com/gxwebsoft/common/system/param/ResetPasswordParam.java new file mode 100644 index 0000000..0555a6d --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/ResetPasswordParam.java @@ -0,0 +1,53 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Pattern; +import java.io.Serializable; + +/** + * 重置密码参数 + * + * @author WebSoft + * @since 2025-12-12 + */ +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(description = "重置密码参数") +public class ResetPasswordParam implements Serializable { + private static final long serialVersionUID = 1L; + + @NotBlank(message = "手机号不能为空") + @Schema(description = "手机号码", required = true) + private String phone; + + @NotBlank(message = "短信验证码不能为空") + @Schema(description = "短信验证码", required = true) + private String smsCode; + + @NotBlank(message = "用户ID不能为空") + @Schema(description = "用户ID", required = true) + private String userId; + + @NotNull(message = "租户ID不能为空") + @Schema(description = "租户ID", required = true) + private Integer tenantId; + + @NotBlank(message = "新密码不能为空") + @Pattern(regexp = "^(?=.*[A-Za-z])(?=.*\\d)[A-Za-z\\d@$!%*#?&]{8,}$", + message = "密码必须至少8位,且包含字母和数字") + @Schema(description = "新密码(至少8位,包含字母和数字)", required = true) + private String newPassword; + + @NotBlank(message = "确认密码不能为空") + @Schema(description = "确认密码", required = true) + private String confirmPassword; + + @NotNull(message = "模板ID不能为空") + @Schema(description = "短信模板ID", required = true) + private Integer templateId; +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/RoleParam.java b/src/main/java/com/gxwebsoft/common/system/param/RoleParam.java new file mode 100644 index 0000000..9208201 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/RoleParam.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.common.system.param; + +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 角色查询参数 + * + * @author WebSoft + * @since 2021-08-29 20:35:09 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(description = "角色查询参数") +public class RoleParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "角色id") + @QueryField(type = QueryType.EQ) + private Integer roleId; + + @Schema(description = "角色标识") + @QueryField(type = QueryType.EQ) + private String roleCode; + + @Schema(description = "角色名称") + private String roleName; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "租户ID") + private Integer tenantId; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/SettingParam.java b/src/main/java/com/gxwebsoft/common/system/param/SettingParam.java new file mode 100644 index 0000000..324195b --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/SettingParam.java @@ -0,0 +1,50 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 系统设置查询参数 + * + * @author WebSoft + * @since 2022-11-19 13:54:27 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(name = "SettingParam对象", description = "系统设置查询参数") +public class SettingParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "id") + @QueryField(type = QueryType.EQ) + private Integer settingId; + + @Schema(description = "设置项标示") + @QueryField(type = QueryType.EQ) + private String settingKey; + + @Schema(description = "排序号") + @QueryField(type = QueryType.EQ) + private Integer sortNumber; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "是否删除, 0否, 1是") + @QueryField(type = QueryType.EQ) + private Integer deleted; + + @Schema(description = "同步更新租户名称") + private String tenantName; + + @Schema(description = "租户名称") + private Integer tenantId; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/SettingUpdateParam.java b/src/main/java/com/gxwebsoft/common/system/param/SettingUpdateParam.java new file mode 100644 index 0000000..d9ca6bf --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/SettingUpdateParam.java @@ -0,0 +1,124 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Map; + +/** + * 系统设置更新参数 + * 用于处理包含配置字段的更新请求 + * + * @author WebSoft + */ +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +@Schema(description = "系统设置更新参数") +public class SettingUpdateParam { + + @Schema(description = "设置项标示") + private String settingKey; + + @Schema(description = "设置内容(json格式)") + private String content; + + @Schema(description = "排序号") + private Integer sortNumber; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "租户id") + private Integer tenantId; + + // 微信小程序配置字段 + @Schema(description = "微信小程序AppId") + private String appId; + + @Schema(description = "微信小程序AppSecret") + private String appSecret; + + // 支付配置字段 + @Schema(description = "商户号") + private String mchId; + + @Schema(description = "API密钥") + private String apiKey; + + @Schema(description = "微信支付API密钥") + private String wechatApiKey; + + @Schema(description = "商户序列号") + private String merchantSerialNumber; + + @Schema(description = "API客户端证书") + private String apiclientCert; + + @Schema(description = "API客户端密钥") + private String apiclientKey; + + // 短信配置字段 + @Schema(description = "短信AccessKey") + private String accessKeyId; + + @Schema(description = "短信AccessSecret") + private String accessKeySecret; + + @Schema(description = "短信签名") + private String signName; + + @Schema(description = "短信模板") + private String templateCode; + + // 企业微信配置字段 + @Schema(description = "企业ID") + private String corpId; + + @Schema(description = "应用Secret") + private String secret; + + // 微信公众号配置字段 + @Schema(description = "公众号Token") + private String token; + + @Schema(description = "公众号EncodingAESKey") + private String encodingAESKey; + + // 基本设置字段 + @Schema(description = "网站名称") + private String siteName; + + @Schema(description = "网站Logo") + private String logo; + + @Schema(description = "网站描述") + private String description; + + @Schema(description = "网站关键词") + private String keywords; + + // 上传配置字段 + @Schema(description = "存储桶名称") + private String bucketName; + + @Schema(description = "存储桶域名") + private String bucketDomain; + + @Schema(description = "存储桶端点") + private String bucketEndpoint; + + // 打印机配置字段 + @Schema(description = "打印机设备号") + private String deviceNo; + + @Schema(description = "打印机密钥") + private String printerKey; + + /** + * 获取其他未定义的字段 + * 用于处理动态配置字段 + */ + private Map additionalProperties; +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/SmsCaptchaParam.java b/src/main/java/com/gxwebsoft/common/system/param/SmsCaptchaParam.java new file mode 100644 index 0000000..f1ec6fa --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/SmsCaptchaParam.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * 发送短信验证码参数 + * + * @author WebSoft + * @since 2021-08-30 17:35:16 + */ +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(description = "发送短信验证码参数") +public class SmsCaptchaParam implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "短信签名") + private String signName; + + @Schema(description = "手机号码") + private String phone; + + @Schema(description = "短信模板") + private String TemplateParam; + + @Schema(description = "租户ID") + private String tenantId; + + @Schema(description = "场景") + private String scene; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/SubscriptionOrderParam.java b/src/main/java/com/gxwebsoft/common/system/param/SubscriptionOrderParam.java new file mode 100644 index 0000000..9aec2ca --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/SubscriptionOrderParam.java @@ -0,0 +1,24 @@ +package com.gxwebsoft.common.system.param; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 订阅订单价格试算入参 + */ +@Data +@Schema(description = "订阅订单价格试算参数") +public class SubscriptionOrderParam { + + @Schema(description = "是否续费,1=续费 0=新购") + private Integer isRenewal; + + @Schema(description = "是否升级,1=升级 0=非升级") + private Integer isUpgrade; + + @Schema(description = "套餐ID") + private Integer packageId; + + @Schema(description = "支付方式") + private Integer payType; +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/SysFileTypeParam.java b/src/main/java/com/gxwebsoft/common/system/param/SysFileTypeParam.java new file mode 100644 index 0000000..edf4860 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/SysFileTypeParam.java @@ -0,0 +1,39 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 存储类型查询参数 + * + * @author 科技小王子 + * @since 2025-05-16 14:24:28 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(name = "SysFileTypeParam对象", description = "存储类型查询参数") +public class SysFileTypeParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "主键id") + @QueryField(type = QueryType.EQ) + private Integer id; + + @Schema(description = "0本地存储,1阿里云oss,2腾讯云cos,3七牛云,4其他") + @QueryField(type = QueryType.EQ) + private Integer type; + + @Schema(description = "名称") + private String name; + + @Schema(description = "访问域名") + private String path; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/TenantParam.java b/src/main/java/com/gxwebsoft/common/system/param/TenantParam.java new file mode 100644 index 0000000..cb3b83a --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/TenantParam.java @@ -0,0 +1,59 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 租户查询参数 + * + * @author 科技小王子 + * @since 2023-07-17 17:49:53 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(name = "TenantParam对象", description = "租户查询参数") +public class TenantParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "租户名称") + private String tenantName; + + @Schema(description = "租户编号") + private String tenantCode; + + @Schema(description = "logo") + private String logo; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "状态") + @QueryField(type = QueryType.EQ) + private Integer status; + + @Schema(description = "用户ID") + @QueryField(type = QueryType.EQ) + private Integer userId; + + @Schema(description = "是否删除, 0否, 1是") + @QueryField(type = QueryType.EQ) + private Integer deleted; + + @Schema(description = "租户id") + @QueryField(type = QueryType.EQ) + private Integer tenantId; + + @Schema(description = "手机号是否脱敏,默认true") + @QueryField(type = QueryType.EQ) + private Boolean mask; + + @Schema(description = "查询全部租户,true时忽略userId条件") + private Boolean all; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/UpdatePasswordParam.java b/src/main/java/com/gxwebsoft/common/system/param/UpdatePasswordParam.java new file mode 100644 index 0000000..b2c5afe --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/UpdatePasswordParam.java @@ -0,0 +1,34 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * 修改密码参数 + * + * @author WebSoft + * @since 2021-08-30 17:35:16 + */ +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(description = "修改密码参数") +public class UpdatePasswordParam implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "原始密码") + private String oldPassword; + + @Schema(description = "新密码") + private String password; + + @Schema(description = "手机号码") + private String phone; + + @Schema(description = "短信验证码") + private String code; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/UserBalanceLogParam.java b/src/main/java/com/gxwebsoft/common/system/param/UserBalanceLogParam.java new file mode 100644 index 0000000..1977e31 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/UserBalanceLogParam.java @@ -0,0 +1,77 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 用户余额变动明细表查询参数 + * + * @author 科技小王子 + * @since 2023-04-21 15:59:09 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(name = "UserBalanceLogParam对象", description = "用户余额变动明细表查询参数") +public class UserBalanceLogParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "主键ID") + @QueryField(type = QueryType.EQ) + private Integer logId; + + @Schema(description = "用户ID") + @QueryField(type = QueryType.EQ) + private Integer userId; + + @Schema(description = "余额变动场景(10用户充值 20用户消费 30管理员操作 40订单退款)") + @QueryField(type = QueryType.EQ) + private Integer scene; + + @Schema(description = "变动金额") + @QueryField(type = QueryType.EQ) + private BigDecimal money; + + @Schema(description = "变动后余额") + @QueryField(type = QueryType.EQ) + private BigDecimal balance; + + @Schema(description = "描述/说明") + private String describe; + + @Schema(description = "管理员备注") + private String remark; + + @Schema(description = "排序(数字越小越靠前)") + @QueryField(type = QueryType.EQ) + private Integer sortNumber; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "状态, 0正常, 1冻结") + @QueryField(type = QueryType.EQ) + private Integer status; + + @Schema(description = "是否删除, 0否, 1是") + @QueryField(type = QueryType.EQ) + private Integer deleted; + + @Schema(description = "商户编码") + private String merchantCode; + + @Schema(description = "昵称") + private String nickname; + + @Schema(description = "余额变动场景筛选") + private String sceneMultiple; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/UserCollectionParam.java b/src/main/java/com/gxwebsoft/common/system/param/UserCollectionParam.java new file mode 100644 index 0000000..85106e3 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/UserCollectionParam.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 我的收藏查询参数 + * + * @author 科技小王子 + * @since 2024-04-28 18:08:32 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(name = "UserCollectionParam对象", description = "我的收藏查询参数") +public class UserCollectionParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "主键ID") + @QueryField(type = QueryType.EQ) + private Integer id; + + @Schema(description = "租户ID") + @QueryField(type = QueryType.EQ) + private Integer tid; + + @Schema(description = "用户ID") + @QueryField(type = QueryType.EQ) + private Integer userId; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/UserFileParam.java b/src/main/java/com/gxwebsoft/common/system/param/UserFileParam.java new file mode 100644 index 0000000..5404354 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/UserFileParam.java @@ -0,0 +1,40 @@ +package com.gxwebsoft.common.system.param; + +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 用户文件查询参数 + * + * @author WebSoft + * @since 2022-07-21 14:34:40 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(name = "UserFileParam对象", description = "用户文件查询参数") +public class UserFileParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "主键id") + @QueryField(type = QueryType.EQ) + private Integer id; + + @Schema(description = "用户id") + @QueryField(type = QueryType.EQ) + private Integer userId; + + @Schema(description = "文件名称") + private String name; + + @Schema(description = "上级id") + @QueryField(type = QueryType.EQ) + private Integer parentId; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/UserGradeParam.java b/src/main/java/com/gxwebsoft/common/system/param/UserGradeParam.java new file mode 100644 index 0000000..63a797a --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/UserGradeParam.java @@ -0,0 +1,60 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 用户会员等级表查询参数 + * + * @author 科技小王子 + * @since 2023-10-07 22:51:17 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(name = "UserGradeParam对象", description = "用户会员等级表查询参数") +public class UserGradeParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "等级ID") + @QueryField(type = QueryType.EQ) + private Integer gradeId; + + @Schema(description = "等级名称") + private String name; + + @Schema(description = "等级权重(1-9999)") + @QueryField(type = QueryType.EQ) + private Integer weight; + + @Schema(description = "升级条件") + private String upgrade; + + @Schema(description = "等级权益(折扣率0-100)") + private String equity; + + @Schema(description = "佣金比率") + private String commission; + + @Schema(description = "排序(数字越小越靠前)") + @QueryField(type = QueryType.EQ) + private Integer sortNumber; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "状态, 0正常, 1冻结") + @QueryField(type = QueryType.EQ) + private Integer status; + + @Schema(description = "是否删除, 0否, 1是") + @QueryField(type = QueryType.EQ) + private Integer deleted; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/UserGroupParam.java b/src/main/java/com/gxwebsoft/common/system/param/UserGroupParam.java new file mode 100644 index 0000000..4c6b705 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/UserGroupParam.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 用户分组管理表查询参数 + * + * @author 科技小王子 + * @since 2023-10-28 15:16:39 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(name = "UserGroupParam对象", description = "用户分组管理表查询参数") +public class UserGroupParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "分组ID") + @QueryField(type = QueryType.EQ) + private Integer groupId; + + @Schema(description = "分组名称") + private String name; + + @Schema(description = "排序(数字越小越靠前)") + @QueryField(type = QueryType.EQ) + private Integer sortNumber; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "状态, 0正常, 1冻结") + @QueryField(type = QueryType.EQ) + private Integer status; + + @Schema(description = "是否删除, 0否, 1是") + @QueryField(type = QueryType.EQ) + private Integer deleted; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/UserImportParam.java b/src/main/java/com/gxwebsoft/common/system/param/UserImportParam.java new file mode 100644 index 0000000..a8cdd43 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/UserImportParam.java @@ -0,0 +1,63 @@ +package com.gxwebsoft.common.system.param; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.io.Serializable; + +/** + * 用户导入参数 + * + * @author WebSoft + * @since 2011-10-15 17:33:34 + */ +@Data +public class UserImportParam implements Serializable { + private static final long serialVersionUID = 1L; + + @Excel(name = "账号") + private String username; + + @Excel(name = "密码") + private String password; + + @Excel(name = "昵称") + private String nickname; + + @Excel(name = "真实姓名") + private String realName; + + @Excel(name = "手机号") + private String phone; + + @Excel(name = "邮箱") + private String email; + + @Excel(name = "组织机构") + private String organizationName; + + @Excel(name = "性别") + private String sexName; + + @Excel(name = "角色") + private String roleName; + + @Excel(name = "状态") + private Integer status; + + @Excel(name = "备注") + private String comments; + + @Excel(name = "用户编码") + private String userCode; + + @Excel(name = "公司ID") + private Integer companyId; + + @Excel(name = "地址") + private String address; + + @Excel(name = "积分") + private Integer points; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/UserOauthParam.java b/src/main/java/com/gxwebsoft/common/system/param/UserOauthParam.java new file mode 100644 index 0000000..00125a3 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/UserOauthParam.java @@ -0,0 +1,57 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 第三方用户信息表查询参数 + * + * @author 科技小王子 + * @since 2023-10-07 22:39:46 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(name = "UserOauthParam对象", description = "第三方用户信息表查询参数") +public class UserOauthParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "主键ID") + @QueryField(type = QueryType.EQ) + private Integer id; + + @Schema(description = "用户ID") + @QueryField(type = QueryType.EQ) + private Integer userId; + + @Schema(description = "第三方登陆类型(MP-WEIXIN)") + private String oauthType; + + @Schema(description = "第三方用户唯一标识 (uid openid)") + private String oauthId; + + @Schema(description = "微信unionID") + private String unionid; + + @Schema(description = "排序(数字越小越靠前)") + @QueryField(type = QueryType.EQ) + private Integer sortNumber; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "状态, 0正常, 1冻结") + @QueryField(type = QueryType.EQ) + private Integer status; + + @Schema(description = "是否删除, 0否, 1是") + @QueryField(type = QueryType.EQ) + private Integer deleted; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/UserParam.java b/src/main/java/com/gxwebsoft/common/system/param/UserParam.java new file mode 100644 index 0000000..6f303b0 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/UserParam.java @@ -0,0 +1,315 @@ +package com.gxwebsoft.common.system.param; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; +import java.util.Set; + +/** + * 用户查询参数 + * + * @author WebSoft + * @since 2021-08-29 20:35:09 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(description = "用户查询参数") +public class UserParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "用户id") + @QueryField(type = QueryType.EQ) + private Integer userId; + + @Schema(description = "用户类型, 0普通用户 10企业用户") + private Integer type; + + @Schema(description = "账号") + private String username; + + @Schema(description = "昵称") + private String nickname; + + @Schema(description = "用户编码") + private String userCode; + + @Schema(description = "第三方系统用户ID") + private Integer uid; + + @Schema(description = "性别(字典)") + @QueryField(type = QueryType.EQ) + private String sex; + + @Schema(description = "手机号") + private String phone; + + @Schema(description = "登录密码") + private String password; + + @Schema(description = "邮箱") + private String email; + + @Schema(description = "邮箱是否验证, 0否, 1是") + @QueryField(type = QueryType.EQ) + private Integer emailVerified; + + @Schema(description = "别名") + private String alias; + + @Schema(description = "真实姓名") + private String realName; + + @Schema(description = "身份证号") + private String idCard; + + @Schema(description = "出生日期") + private String birthday; + + @Schema(description = "年龄") + private Integer age; + + @Schema(description = "可用余额") + private BigDecimal balance; + + @Schema(description = "机构id") + @QueryField(type = QueryType.EQ) + private Integer organizationId; + + @Schema(description = "机构id合集") + @TableField(exist = false) + private Set organizationIds; + + @Schema(description = "用户分组ID") + @QueryField(type = QueryType.EQ) + private Integer groupId; + + @Schema(description = "注册来源客户端") + @QueryField(type = QueryType.EQ) + private String platform; + + @Schema(description = "是否下线会员") + private Integer offline; + + @Schema(description = "上级机构ID") + @QueryField(type = QueryType.IN) + private Integer parentId; + + @Schema(description = "状态, 0正常, 1冻结") + @QueryField(type = QueryType.EQ) + private Integer status; + + @Schema(description = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @Schema(description = "角色id") + @TableField(exist = false) + private Integer roleId; + + @Schema(description = "角色标识") + @TableField(exist = false) + private String roleCode; + + @Schema(description = "所在省份") + private String province; + + @Schema(description = "所在城市") + private String city; + + @Schema(description = "所在辖区") + private String region; + + @Schema(description = "详细地址") + private String address; + + @Schema(description = "行业类型(父级)") + private String industryParent; + + @Schema(description = "行业类型(子级)") + private String industryChild; + + @Schema(description = "关注数") + private Integer followers; + + @Schema(description = "粉丝数") + private Integer fans; + + @Schema(description = "获赞数") + private Integer likes; + + @Schema(description = "评论数") + private Integer commentNumbers; + + @Schema(description = "择偶区域") + @TableField(exist = false) + private String cityMate; + + @Schema(description = "机构名称") + @TableField(exist = false) + private String organizationName; + + @Schema(description = "公司名称") + @TableField(exist = false) + private String companyName; + + @Schema(description = "公司名称") + private String customerName; + + @Schema(description = "专家角色") + private Integer expertType; + + @Schema(description = "性别名称") + @TableField(exist = false) + private String sexName; + + @Schema(description = "推荐状态") + @TableField(exist = false) + private Integer recommend; + + @Schema(description = "搜索关键字") + @TableField(exist = false) + private String keywords; + + @Schema(description = "会员等级") + @TableField(exist = false) + private Integer gradeId; + + @Schema(description = "按角色搜索") + @TableField(exist = false) + private String roleIds; + + @Schema(description = "用户类型 sys系统用户 org机构职员 member商城会员 ") + @TableField(exist = false) + private String userType; + + @Schema(description = "支付宝授权码") + @TableField(exist = false) + private String authCode; + + @Schema(description = "微信凭证code") + @TableField(exist = false) + private String code; + + @Schema(description = "推荐人ID") + @QueryField(type = QueryType.IN) + private Integer refereeId; + + @Schema(description = "租户ID") + private Integer tenantId; + + @Schema(description = "二维码类型") + @TableField(exist = false) + private String codeType; + + @Schema(description = "二维码内容 填网址扫码后可跳转") + @TableField(exist = false) + private String codeContent; + + @Schema(description = "是否内部职员") + @TableField(exist = false) + private Boolean isStaff; + + @Schema(description = "是否管理员") + @TableField(exist = false) + private Boolean isAdmin; + + @Schema(description = "是否企业管理员") + private Integer isOrganizationAdmin; + + @Schema(description = "最后结算时间") + @TableField(exist = false) + private Date settlementTime; + + @Schema(description = "模板id") + private Integer templateId; + + @Schema(description = "报餐时间") + @TableField(exist = false) + private String deliveryTime; + + @Schema(description = "用户ID集合") + @TableField(exist = false) + private Set userIds; + + @Schema(description = "用户手机号码集合") + @TableField(exist = false) + private Set phones; + + @Schema(description = "用户身份证集合") + @TableField(exist = false) + private Set idCards; + + @Schema(description = "是否查询用户详细资料表") + @TableField(exist = false) + private Boolean showProfile; + + @Schema(description = "微信openid") + @TableField(exist = false) + private String openid; + + @Schema(description = "微信公众号openid") + private String officeOpenid; + + @Schema(description = "unionid") + private String unionid; + + @Schema(description = "是否查询超级管理员") + @QueryField(type = QueryType.EQ) + private Boolean isSuperAdmin; + + @Schema(description = "不验证手机号码真实性") + @TableField(exist = false) + private Boolean notVerifyPhone; + + @Schema(description = "可管理的商户") + @QueryField(type = QueryType.LIKE) + private String merchants; + + @Schema(description = "商户ID") + @QueryField(type = QueryType.EQ) + private Long merchantId; + + @Schema(description = "商户名称") + @QueryField(type = QueryType.EQ) + private String merchantName; + + @Schema(description = "商户LOGO") + @QueryField(type = QueryType.EQ) + private String merchantAvatar; + + @Schema(description = "工业园区") + @TableField(exist = false) + private String park; + + @Schema(description = "是否已安装") + @TableField(exist = false) + private Boolean installed; + + @Schema(description = "微信小程序解密数据") + @TableField(exist = false) + private String encryptedData; + + @Schema(description = "微信小程序解密向量") + @TableField(exist = false) + private String iv; + + @Schema(description = "微信小程序会话密钥") + @TableField(exist = false) + private String sessionKey; + + @Schema(description = "场景类型") + @TableField(exist = false) + private String sceneType; +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/UserRefereeParam.java b/src/main/java/com/gxwebsoft/common/system/param/UserRefereeParam.java new file mode 100644 index 0000000..3d5389c --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/UserRefereeParam.java @@ -0,0 +1,48 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 用户推荐关系表查询参数 + * + * @author 科技小王子 + * @since 2023-10-07 22:56:36 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(name = "UserRefereeParam对象", description = "用户推荐关系表查询参数") +public class UserRefereeParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "主键ID") + @QueryField(type = QueryType.EQ) + private Integer id; + + @Schema(description = "推荐人ID") + @QueryField(type = QueryType.EQ) + private Integer dealerId; + + @Schema(description = "用户id(被推荐人)") + @QueryField(type = QueryType.EQ) + private Integer userId; + + @Schema(description = "推荐关系层级(1,2,3)") + @QueryField(type = QueryType.EQ) + private Integer level; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "是否删除, 0否, 1是") + @QueryField(type = QueryType.EQ) + private Integer deleted; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/UserRoleParam.java b/src/main/java/com/gxwebsoft/common/system/param/UserRoleParam.java new file mode 100644 index 0000000..920da86 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/UserRoleParam.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 用户角色查询参数 + * + * @author 科技小王子 + * @since 2025-06-16 20:39:53 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(name = "UserRoleParam对象", description = "用户角色查询参数") +public class UserRoleParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "主键id") + @QueryField(type = QueryType.EQ) + private Integer id; + + @Schema(description = "用户id") + @QueryField(type = QueryType.EQ) + private Integer userId; + + @Schema(description = "角色id") + @QueryField(type = QueryType.EQ) + private Integer roleId; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/UserVerifyParam.java b/src/main/java/com/gxwebsoft/common/system/param/UserVerifyParam.java new file mode 100644 index 0000000..d0510cd --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/UserVerifyParam.java @@ -0,0 +1,86 @@ +package com.gxwebsoft.common.system.param; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Set; + +/** + * 实名认证查询参数 + * + * @author 科技小王子 + * @since 2025-05-29 23:01:04 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(name = "UserVerifyParam对象", description = "实名认证查询参数") +public class UserVerifyParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "自增ID") + @QueryField(type = QueryType.EQ) + private Integer id; + + @Schema(description = "用户ID") + @QueryField(type = QueryType.EQ) + private Integer userId; + + @Schema(description = "认证类型, 0个人 1企业") + @QueryField(type = QueryType.EQ) + private Integer type; + + @Schema(description = "主体名称") + @QueryField(type = QueryType.LIKE) + private String name; + + @Schema(description = "真实姓名") + private String realName; + + @Schema(description = "证件号码") + private String idCard; + + @Schema(description = "出生日期") + private String birthday; + + @Schema(description = "正面") + private String sfz1; + + @Schema(description = "反面") + private String sfz2; + + @Schema(description = "营业执照号码") + @QueryField(type = QueryType.EQ) + private String zzCode; + + @Schema(description = "管理员ID") + @QueryField(type = QueryType.EQ) + private Integer adminId; + + @Schema(description = "机构ID") + @QueryField(type = QueryType.EQ) + private Integer organizationId; + + @Schema(description = "机构id合集") + @TableField(exist = false) + private Set organizationIds; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "状态, 0在线, 1离线") + @QueryField(type = QueryType.EQ) + private Integer status; + + @Schema(description = "是否删除, 0否, 1是") + @QueryField(type = QueryType.EQ) + private Integer deleted; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/VersionParam.java b/src/main/java/com/gxwebsoft/common/system/param/VersionParam.java new file mode 100644 index 0000000..f541a5b --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/VersionParam.java @@ -0,0 +1,71 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 版本更新查询参数 + * + * @author 科技小王子 + * @since 2024-01-15 18:52:24 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(name = "VersionParam对象", description = "版本更新查询参数") +public class VersionParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "ID") + @QueryField(type = QueryType.EQ) + private Integer id; + + @Schema(description = "版本名") + private String versionName; + + @Schema(description = "版本号") + @QueryField(type = QueryType.EQ) + private Integer versionCode; + + @Schema(description = "下载链接") + private String androidDownloadUrl; + + @Schema(description = "下载链接") + private String iosDownloadUrl; + + @Schema(description = "更新日志") + private String updateInfo; + + @Schema(description = "强制更新") + @QueryField(type = QueryType.EQ) + private Integer isHard; + + @Schema(description = "热更") + @QueryField(type = QueryType.EQ) + private Integer isHot; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "文章排序(数字越小越靠前)") + @QueryField(type = QueryType.EQ) + private Integer sortNumber; + + @QueryField(type = QueryType.EQ) + private Integer userId; + + @Schema(description = "状态, 0正常, 1冻结") + @QueryField(type = QueryType.EQ) + private Integer status; + + @Schema(description = "是否删除, 0否, 1是") + @QueryField(type = QueryType.EQ) + private Integer deleted; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/WebsiteFieldParam.java b/src/main/java/com/gxwebsoft/common/system/param/WebsiteFieldParam.java new file mode 100644 index 0000000..eab3525 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/WebsiteFieldParam.java @@ -0,0 +1,56 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 应用参数查询参数 + * + * @author 科技小王子 + * @since 2024-08-27 15:18:05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(name = "WebsiteFieldParam对象", description = "应用参数查询参数") +public class WebsiteFieldParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "自增ID") + @QueryField(type = QueryType.EQ) + private Integer id; + + @Schema(description = "类型,0文本 1图片 2其他") + @QueryField(type = QueryType.EQ) + private Integer type; + + @Schema(description = "名称") + private String name; + + @Schema(description = "默认值") + private String defaultValue; + + @Schema(description = "可修改的值 [on|off]") + private String modifyRange; + + @Schema(description = "备注") + private String comments; + + @Schema(description = "名称") + private String value; + + @Schema(description = "排序(数字越小越靠前)") + @QueryField(type = QueryType.EQ) + private Integer sortNumber; + + @Schema(description = "是否删除, 0否, 1是") + @QueryField(type = QueryType.EQ) + private Integer deleted; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/param/WhiteDomainParam.java b/src/main/java/com/gxwebsoft/common/system/param/WhiteDomainParam.java new file mode 100644 index 0000000..70229e0 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/param/WhiteDomainParam.java @@ -0,0 +1,48 @@ +package com.gxwebsoft.common.system.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 服务器白名单查询参数 + * + * @author 科技小王子 + * @since 2024-03-26 00:22:21 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@Schema(name = "WhiteDomainParam对象", description = "服务器白名单查询参数") +public class WhiteDomainParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @Schema(description = "ID") + @QueryField(type = QueryType.EQ) + private Integer id; + + @Schema(description = "域名") + private String domain; + + @Schema(description = "状态") + @QueryField(type = QueryType.EQ) + private Integer status; + + @Schema(description = "排序号") + @QueryField(type = QueryType.EQ) + private Integer sortNumber; + + @Schema(description = "用户ID") + @QueryField(type = QueryType.EQ) + private Integer userId; + + @Schema(description = "是否删除, 0否, 1是") + @QueryField(type = QueryType.EQ) + private Integer deleted; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/result/AccountInfoResult.java b/src/main/java/com/gxwebsoft/common/system/result/AccountInfoResult.java new file mode 100644 index 0000000..14df17d --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/result/AccountInfoResult.java @@ -0,0 +1,40 @@ +package com.gxwebsoft.common.system.result; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * 账号信息返回结果 + * + * @author WebSoft + * @since 2025-12-12 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@Schema(description = "账号信息返回结果") +public class AccountInfoResult implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "用户ID") + private String userId; + + @Schema(description = "租户ID") + private Integer tenantId; + + @Schema(description = "租户名称") + private String tenantName; + + @Schema(description = "用户头像") + private String avatar; + + @Schema(description = "创建时间") + private String createTime; + + @Schema(description = "用户名") + private String username; +} diff --git a/src/main/java/com/gxwebsoft/common/system/result/CaptchaResult.java b/src/main/java/com/gxwebsoft/common/system/result/CaptchaResult.java new file mode 100644 index 0000000..46bd08f --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/result/CaptchaResult.java @@ -0,0 +1,30 @@ +package com.gxwebsoft.common.system.result; + +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * 验证码返回结果 + * + * @author WebSoft + * @since 2021-08-30 17:35:16 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@Schema(description = "验证码返回结果") +public class CaptchaResult implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "图形验证码base64数据") + private String base64; + + @Schema(description = "验证码文本") + private String text; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/result/CheckPhoneResult.java b/src/main/java/com/gxwebsoft/common/system/result/CheckPhoneResult.java new file mode 100644 index 0000000..b3519e3 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/result/CheckPhoneResult.java @@ -0,0 +1,28 @@ +package com.gxwebsoft.common.system.result; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * 检查手机号返回结果 + * + * @author WebSoft + * @since 2025-12-12 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@Schema(description = "检查手机号返回结果") +public class CheckPhoneResult implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "是否已注册") + private Boolean isRegistered; + + @Schema(description = "账号数量") + private Integer accountCount; +} diff --git a/src/main/java/com/gxwebsoft/common/system/result/LoginResult.java b/src/main/java/com/gxwebsoft/common/system/result/LoginResult.java new file mode 100644 index 0000000..940d8e9 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/result/LoginResult.java @@ -0,0 +1,31 @@ +package com.gxwebsoft.common.system.result; + +import com.gxwebsoft.common.system.entity.User; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * 登录返回结果 + * + * @author WebSoft + * @since 2021-08-30 17:35:16 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@Schema(description = "登录返回结果") +public class LoginResult implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "access_token") + private String access_token; + + @Schema(description = "用户信息") + private User user; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/result/RedisResult.java b/src/main/java/com/gxwebsoft/common/system/result/RedisResult.java new file mode 100644 index 0000000..b3887ff --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/result/RedisResult.java @@ -0,0 +1,36 @@ +package com.gxwebsoft.common.system.result; + +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.poi.ss.formula.functions.T; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Date; + +/** + * Redis缓存数据 + * + * @author WebSoft + * @since 2021-08-30 17:35:16 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@Schema(description = "缓存数据返回") +public class RedisResult implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "key") + private String key; + + @Schema(description = "数据") + private T data; + + @Schema(description = "过期时间") + private LocalDateTime expireTime; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/result/SmsCaptchaResult.java b/src/main/java/com/gxwebsoft/common/system/result/SmsCaptchaResult.java new file mode 100644 index 0000000..8f5bb2a --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/result/SmsCaptchaResult.java @@ -0,0 +1,26 @@ +package com.gxwebsoft.common.system.result; + +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * 短信验证码返回结果 + * + * @author WebSoft + * @since 2021-08-30 17:35:16 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@Schema(description = "短信验证码返回结果") +public class SmsCaptchaResult implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "短信验证码") + private String text; +} diff --git a/src/main/java/com/gxwebsoft/common/system/result/SubscriptionOrderCreateResult.java b/src/main/java/com/gxwebsoft/common/system/result/SubscriptionOrderCreateResult.java new file mode 100644 index 0000000..eb7bc8b --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/result/SubscriptionOrderCreateResult.java @@ -0,0 +1,18 @@ +package com.gxwebsoft.common.system.result; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 订阅订单创建结果 + */ +@Data +@Schema(description = "订阅订单创建结果") +public class SubscriptionOrderCreateResult { + + @Schema(description = "订单号") + private String orderNo; + + @Schema(description = "价格试算结果") + private SubscriptionPriceResult price; +} diff --git a/src/main/java/com/gxwebsoft/common/system/result/SubscriptionOrderPayResult.java b/src/main/java/com/gxwebsoft/common/system/result/SubscriptionOrderPayResult.java new file mode 100644 index 0000000..69de555 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/result/SubscriptionOrderPayResult.java @@ -0,0 +1,21 @@ +package com.gxwebsoft.common.system.result; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 订阅订单支付结果 + */ +@Data +@Schema(description = "订阅订单支付结果") +public class SubscriptionOrderPayResult { + + @Schema(description = "订单号") + private String orderNo; + + @Schema(description = "支付二维码链接") + private String codeUrl; + + @Schema(description = "价格信息") + private SubscriptionPriceResult price; +} diff --git a/src/main/java/com/gxwebsoft/common/system/result/SubscriptionPriceResult.java b/src/main/java/com/gxwebsoft/common/system/result/SubscriptionPriceResult.java new file mode 100644 index 0000000..0dc2a57 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/result/SubscriptionPriceResult.java @@ -0,0 +1,41 @@ +package com.gxwebsoft.common.system.result; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 订阅订单价格试算结果 + */ +@Data +@Schema(description = "订阅订单价格试算结果") +public class SubscriptionPriceResult { + + @Schema(description = "套餐ID") + private Integer packageId; + + @Schema(description = "是否续费,1=续费 0=新购") + private Integer isRenewal; + + @Schema(description = "是否升级,1=升级 0=非升级") + private Integer isUpgrade; + + @Schema(description = "支付方式") + private Integer payType; + + @Schema(description = "原价") + private BigDecimal originalPrice; + + @Schema(description = "优惠金额") + private BigDecimal discountAmount; + + @Schema(description = "应付金额") + private BigDecimal payPrice; + + @Schema(description = "总价(同原价,用于兼容前端字段)") + private BigDecimal totalPrice; + + @Schema(description = "价格说明") + private String remark; +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/AccessKeyService.java b/src/main/java/com/gxwebsoft/common/system/service/AccessKeyService.java new file mode 100644 index 0000000..19946bc --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/AccessKeyService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.AccessKey; +import com.gxwebsoft.common.system.param.AccessKeyParam; + +import java.util.List; + +/** + * 访问凭证管理Service + * + * @author 科技小王子 + * @since 2023-05-16 19:19:55 + */ +public interface AccessKeyService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(AccessKeyParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(AccessKeyParam param); + + /** + * 根据id查询 + * + * @param id 字典项id + * @return AccessKey + */ + AccessKey getByIdRel(Integer id); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/AuthorizeCodeService.java b/src/main/java/com/gxwebsoft/common/system/service/AuthorizeCodeService.java new file mode 100644 index 0000000..17d3005 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/AuthorizeCodeService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.AuthorizeCode; +import com.gxwebsoft.common.system.param.AuthorizeCodeParam; + +import java.util.List; + +/** + * 授权码Service + * + * @author 科技小王子 + * @since 2025-08-05 01:17:27 + */ +public interface AuthorizeCodeService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(AuthorizeCodeParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(AuthorizeCodeParam param); + + /** + * 根据id查询 + * + * @param id id + * @return AuthorizeCode + */ + AuthorizeCode getByIdRel(Integer id); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/CartService.java b/src/main/java/com/gxwebsoft/common/system/service/CartService.java new file mode 100644 index 0000000..4cc68eb --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/CartService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.Cart; +import com.gxwebsoft.common.system.param.CartParam; + +import java.util.List; + +/** + * 购物车Service + * + * @author 科技小王子 + * @since 2024-10-26 10:54:51 + */ +public interface CartService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(CartParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(CartParam param); + + /** + * 根据id查询 + * + * @param id 购物车表ID + * @return Cart + */ + Cart getByIdRel(Long id); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/ChatConversationService.java b/src/main/java/com/gxwebsoft/common/system/service/ChatConversationService.java new file mode 100644 index 0000000..dc8f201 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/ChatConversationService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.ChatConversation; +import com.gxwebsoft.common.system.param.ChatConversationParam; + +import java.util.List; + +/** + * 聊天消息表Service + * + * @author 科技小王子 + * @since 2024-04-27 15:57:27 + */ +public interface ChatConversationService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(ChatConversationParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(ChatConversationParam param); + + /** + * 根据id查询 + * + * @param id 自增ID + * @return ChatConversation + */ + ChatConversation getByIdRel(Integer id); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/ChatMessageService.java b/src/main/java/com/gxwebsoft/common/system/service/ChatMessageService.java new file mode 100644 index 0000000..e3ecc75 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/ChatMessageService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.ChatMessage; +import com.gxwebsoft.common.system.param.ChatMessageParam; + +import java.util.List; + +/** + * 聊天消息表Service + * + * @author 科技小王子 + * @since 2024-04-27 15:57:27 + */ +public interface ChatMessageService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(ChatMessageParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(ChatMessageParam param); + + /** + * 根据id查询 + * + * @param id 自增ID + * @return ChatMessage + */ + ChatMessage getByIdRel(Integer id); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/CompanyCommentService.java b/src/main/java/com/gxwebsoft/common/system/service/CompanyCommentService.java new file mode 100644 index 0000000..10ca95a --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/CompanyCommentService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.CompanyComment; +import com.gxwebsoft.common.system.param.CompanyCommentParam; + +import java.util.List; + +/** + * 应用评论Service + * + * @author 科技小王子 + * @since 2024-10-17 15:30:24 + */ +public interface CompanyCommentService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(CompanyCommentParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(CompanyCommentParam param); + + /** + * 根据id查询 + * + * @param id ID + * @return CompanyComment + */ + CompanyComment getByIdRel(Integer id); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/CompanyContentService.java b/src/main/java/com/gxwebsoft/common/system/service/CompanyContentService.java new file mode 100644 index 0000000..e4e1ab4 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/CompanyContentService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.CompanyContent; +import com.gxwebsoft.common.system.param.CompanyContentParam; + +import java.util.List; + +/** + * 应用详情Service + * + * @author 科技小王子 + * @since 2024-10-16 13:41:21 + */ +public interface CompanyContentService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(CompanyContentParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(CompanyContentParam param); + + /** + * 根据id查询 + * + * @param id + * @return CompanyContent + */ + CompanyContent getByIdRel(Integer id); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/CompanyGitService.java b/src/main/java/com/gxwebsoft/common/system/service/CompanyGitService.java new file mode 100644 index 0000000..f3ac263 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/CompanyGitService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.CompanyGit; +import com.gxwebsoft.common.system.param.CompanyGitParam; + +import java.util.List; + +/** + * 代码仓库Service + * + * @author 科技小王子 + * @since 2024-10-19 18:08:51 + */ +public interface CompanyGitService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(CompanyGitParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(CompanyGitParam param); + + /** + * 根据id查询 + * + * @param id 自增ID + * @return CompanyGit + */ + CompanyGit getByIdRel(Integer id); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/CompanyParameterService.java b/src/main/java/com/gxwebsoft/common/system/service/CompanyParameterService.java new file mode 100644 index 0000000..4ffa4c0 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/CompanyParameterService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.CompanyParameter; +import com.gxwebsoft.common.system.param.CompanyParameterParam; + +import java.util.List; + +/** + * 应用参数Service + * + * @author 科技小王子 + * @since 2024-10-17 15:30:24 + */ +public interface CompanyParameterService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(CompanyParameterParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(CompanyParameterParam param); + + /** + * 根据id查询 + * + * @param id 自增ID + * @return CompanyParameter + */ + CompanyParameter getByIdRel(Integer id); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/CompanyService.java b/src/main/java/com/gxwebsoft/common/system/service/CompanyService.java new file mode 100644 index 0000000..d675f59 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/CompanyService.java @@ -0,0 +1,51 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.Company; +import com.gxwebsoft.common.system.param.CompanyParam; + +import java.util.List; + +/** + * 企业信息Service + * + * @author 科技小王子 + * @since 2023-05-27 14:57:34 + */ +public interface CompanyService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(CompanyParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(CompanyParam param); + + /** + * 根据id查询 + * + * @param companyId 企业id + * @return Company + */ + Company getByIdRel(Integer companyId); + + Company getByTenantIdRel(Integer tenantId); + + PageResult pageRelAll(CompanyParam param); + + void updateByCompanyId(Company company); + + boolean removeCompanyAll(Integer companyId); + + boolean undeleteAll(Integer companyId); +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/CompanyUrlService.java b/src/main/java/com/gxwebsoft/common/system/service/CompanyUrlService.java new file mode 100644 index 0000000..c2b2479 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/CompanyUrlService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.CompanyUrl; +import com.gxwebsoft.common.system.param.CompanyUrlParam; + +import java.util.List; + +/** + * 应用域名Service + * + * @author 科技小王子 + * @since 2024-10-17 15:30:24 + */ +public interface CompanyUrlService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(CompanyUrlParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(CompanyUrlParam param); + + /** + * 根据id查询 + * + * @param id 自增ID + * @return CompanyUrl + */ + CompanyUrl getByIdRel(Integer id); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/ComponentsService.java b/src/main/java/com/gxwebsoft/common/system/service/ComponentsService.java new file mode 100644 index 0000000..2073c55 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/ComponentsService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.Components; +import com.gxwebsoft.common.system.param.ComponentsParam; + +import java.util.List; + +/** + * 组件Service + * + * @author 科技小王子 + * @since 2024-08-25 19:08:51 + */ +public interface ComponentsService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(ComponentsParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(ComponentsParam param); + + /** + * 根据id查询 + * + * @param id ID + * @return Components + */ + Components getByIdRel(Integer id); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/DictDataService.java b/src/main/java/com/gxwebsoft/common/system/service/DictDataService.java new file mode 100644 index 0000000..86b94bf --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/DictDataService.java @@ -0,0 +1,52 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.*; +import com.gxwebsoft.common.system.entity.DictData; +import com.gxwebsoft.common.system.param.DictDataParam; + +import java.util.List; + +/** + * 字典数据Service + * + * @author WebSoft + * @since 2020-03-14 11:29:04 + */ +public interface DictDataService extends IService { + + /** + * 关联分页查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(DictDataParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(DictDataParam param); + + /** + * 根据id查询 + * + * @param dictDataId 字典数据id + * @return DictData + */ + DictData getByIdRel(Integer dictDataId); + + /** + * 根据dictCode和dictDataName查询 + * + * @param dictCode 字典标识 + * @param dictDataName 字典项名称 + * @return DictData + */ + DictData getByDictCodeAndName(String dictCode, String dictDataName); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/DictService.java b/src/main/java/com/gxwebsoft/common/system/service/DictService.java new file mode 100644 index 0000000..8aef5ba --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/DictService.java @@ -0,0 +1,14 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.system.entity.Dict; + +/** + * 字典Service + * + * @author WebSoft + * @since 2020-03-14 11:29:03 + */ +public interface DictService extends IService { + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/DictionaryDataService.java b/src/main/java/com/gxwebsoft/common/system/service/DictionaryDataService.java new file mode 100644 index 0000000..881fd5a --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/DictionaryDataService.java @@ -0,0 +1,51 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.DictionaryData; +import com.gxwebsoft.common.system.param.DictionaryDataParam; + +import java.util.List; + +/** + * 字典数据Service + * + * @author WebSoft + * @since 2020-03-14 11:29:04 + */ +public interface DictionaryDataService extends IService { + + /** + * 关联分页查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(DictionaryDataParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(DictionaryDataParam param); + + /** + * 根据id查询 + * + * @param dictDataId 字典数据id + * @return DictionaryData + */ + DictionaryData getByIdRel(Integer dictDataId); + + /** + * 根据dictCode和dictDataName查询 + * + * @param dictCode 字典标识 + * @param dictDataName 字典项名称 + * @return DictionaryData + */ + DictionaryData getByDictCodeAndName(String dictCode, String dictDataName); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/DictionaryService.java b/src/main/java/com/gxwebsoft/common/system/service/DictionaryService.java new file mode 100644 index 0000000..4705494 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/DictionaryService.java @@ -0,0 +1,14 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.system.entity.Dictionary; + +/** + * 字典Service + * + * @author WebSoft + * @since 2020-03-14 11:29:03 + */ +public interface DictionaryService extends IService { + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/DomainService.java b/src/main/java/com/gxwebsoft/common/system/service/DomainService.java new file mode 100644 index 0000000..960aace --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/DomainService.java @@ -0,0 +1,43 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.Domain; +import com.gxwebsoft.common.system.param.DomainParam; + +import java.util.List; + +/** + * 授权域名Service + * + * @author 科技小王子 + * @since 2024-09-19 23:56:33 + */ +public interface DomainService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(DomainParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(DomainParam param); + + /** + * 根据id查询 + * + * @param id ID + * @return Domain + */ + Domain getByIdRel(Integer id); + + Domain getByDomainRel(String domain); +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/EmailRecordService.java b/src/main/java/com/gxwebsoft/common/system/service/EmailRecordService.java new file mode 100644 index 0000000..25ec4c2 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/EmailRecordService.java @@ -0,0 +1,51 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.system.entity.EmailRecord; + +import javax.mail.MessagingException; +import java.io.IOException; +import java.util.Map; + +/** + * 邮件发送记录Service + * + * @author WebSoft + * @since 2019-06-19 04:07:02 + */ +public interface EmailRecordService extends IService { + + /** + * 发送普通邮件 + * + * @param title 标题 + * @param content 内容 + * @param toEmails 收件人 + */ + void sendTextEmail(String title, String content, String[] toEmails); + + /** + * 发送富文本邮件 + * + * @param title 标题 + * @param html 富文本 + * @param toEmails 收件人 + * @throws MessagingException MessagingException + */ + void sendFullTextEmail(String title, String html, String[] toEmails) throws MessagingException; + + /** + * 发送模板邮件 + * + * @param title 标题 + * @param path 模板路径 + * @param map 填充数据 + * @param toEmails 收件人 + * @throws MessagingException MessagingException + * @throws IOException IOException + */ + void sendHtmlEmail(String title, String path, Map map, String[] toEmails) + throws MessagingException, IOException; + + void sendEmail(String title, String content, String receiver, Integer tenantId); +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/EnvironmentService.java b/src/main/java/com/gxwebsoft/common/system/service/EnvironmentService.java new file mode 100644 index 0000000..d2499aa --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/EnvironmentService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.Environment; +import com.gxwebsoft.common.system.param.EnvironmentParam; + +import java.util.List; + +/** + * 环境管理Service + * + * @author 科技小王子 + * @since 2023-10-18 08:45:13 + */ +public interface EnvironmentService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(EnvironmentParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(EnvironmentParam param); + + /** + * 根据id查询 + * + * @param id 插件id + * @return Environment + */ + Environment getByIdRel(Integer id); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/FileRecordService.java b/src/main/java/com/gxwebsoft/common/system/service/FileRecordService.java new file mode 100644 index 0000000..d987eb5 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/FileRecordService.java @@ -0,0 +1,60 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.FileRecord; +import com.gxwebsoft.common.system.param.FileRecordParam; + +import javax.servlet.http.HttpServletRequest; +import java.io.File; +import java.util.List; + +/** + * 文件上传记录Service + * + * @author WebSoft + * @since 2021-08-30 11:20:15 + */ +public interface FileRecordService extends IService { + + /** + * 关联分页查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(FileRecordParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(FileRecordParam param); + + /** + * 根据id查询 + * + * @param id id + * @return FileRecord + */ + FileRecord getByIdRel(Integer id); + + /** + * 根据path查询 + * + * @param path 文件路径 + * @return FileRecord + */ + FileRecord getByIdPath(String path); + + /** + * 异步删除文件 + * + * @param files 文件数组 + */ + void deleteFileAsync(List files); + + void deleteOssFileAsync(List fileRecords); +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/LoginRecordService.java b/src/main/java/com/gxwebsoft/common/system/service/LoginRecordService.java new file mode 100644 index 0000000..0c4adbf --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/LoginRecordService.java @@ -0,0 +1,54 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.LoginRecord; +import com.gxwebsoft.common.system.param.LoginRecordParam; + +import javax.servlet.http.HttpServletRequest; +import java.util.List; + +/** + * 登录日志Service + * + * @author WebSoft + * @since 2018-12-24 16:10:41 + */ +public interface LoginRecordService extends IService { + + /** + * 关联分页查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(LoginRecordParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(LoginRecordParam param); + + /** + * 根据id查询 + * + * @param id id + * @return LoginRecord + */ + LoginRecord getByIdRel(Integer id); + + /** + * 异步添加 + * + * @param username 用户账号 + * @param type 操作类型 + * @param comments 备注 + * @param tenantId 租户id + * @param request HttpServletRequest + */ + void saveAsync(String username, Integer type, String comments, Integer tenantId, HttpServletRequest request); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/MenuService.java b/src/main/java/com/gxwebsoft/common/system/service/MenuService.java new file mode 100644 index 0000000..0b97e7c --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/MenuService.java @@ -0,0 +1,27 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.system.entity.Menu; +import com.gxwebsoft.common.system.param.MenuParam; + +import java.util.List; + +/** + * 菜单Service + * + * @author WebSoft + * @since 2018-12-24 16:10:31 + */ +public interface MenuService extends IService { + + Boolean cloneMenu(MenuParam param); + + Boolean install(Integer id); + + /** + * 根据参数获取菜单列表 + * @param param 菜单参数 + * @return 菜单列表 + */ + List getMenuByClone(MenuParam param); +} \ No newline at end of file diff --git a/src/main/java/com/gxwebsoft/common/system/service/MerchantAccountService.java b/src/main/java/com/gxwebsoft/common/system/service/MerchantAccountService.java new file mode 100644 index 0000000..df87b16 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/MerchantAccountService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.MerchantAccount; +import com.gxwebsoft.common.system.param.MerchantAccountParam; + +import java.util.List; + +/** + * 商户账号Service + * + * @author 科技小王子 + * @since 2024-04-19 12:02:24 + */ +public interface MerchantAccountService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(MerchantAccountParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(MerchantAccountParam param); + + /** + * 根据id查询 + * + * @param id ID + * @return MerchantAccount + */ + MerchantAccount getByIdRel(Integer id); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/MerchantApplyService.java b/src/main/java/com/gxwebsoft/common/system/service/MerchantApplyService.java new file mode 100644 index 0000000..06f9bac --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/MerchantApplyService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.MerchantApply; +import com.gxwebsoft.common.system.param.MerchantApplyParam; + +import java.util.List; + +/** + * 商户入驻申请Service + * + * @author 科技小王子 + * @since 2024-04-05 01:24:36 + */ +public interface MerchantApplyService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(MerchantApplyParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(MerchantApplyParam param); + + /** + * 根据id查询 + * + * @param applyId ID + * @return MerchantApply + */ + MerchantApply getByIdRel(Integer applyId); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/MerchantService.java b/src/main/java/com/gxwebsoft/common/system/service/MerchantService.java new file mode 100644 index 0000000..f35d75b --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/MerchantService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.Merchant; +import com.gxwebsoft.common.system.param.MerchantParam; + +import java.util.List; + +/** + * 商户Service + * + * @author 科技小王子 + * @since 2024-04-05 00:03:54 + */ +public interface MerchantService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(MerchantParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(MerchantParam param); + + /** + * 根据id查询 + * + * @param merchantId ID + * @return Merchant + */ + Merchant getByIdRel(Long merchantId); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/MerchantTypeService.java b/src/main/java/com/gxwebsoft/common/system/service/MerchantTypeService.java new file mode 100644 index 0000000..563c7d6 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/MerchantTypeService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.MerchantType; +import com.gxwebsoft.common.system.param.MerchantTypeParam; + +import java.util.List; + +/** + * 商户类型Service + * + * @author 科技小王子 + * @since 2024-04-05 00:08:51 + */ +public interface MerchantTypeService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(MerchantTypeParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(MerchantTypeParam param); + + /** + * 根据id查询 + * + * @param id ID + * @return MerchantType + */ + MerchantType getByIdRel(Integer id); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/ModulesService.java b/src/main/java/com/gxwebsoft/common/system/service/ModulesService.java new file mode 100644 index 0000000..93244f1 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/ModulesService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.Modules; +import com.gxwebsoft.common.system.param.ModulesParam; + +import java.util.List; + +/** + * 模块管理Service + * + * @author 科技小王子 + * @since 2023-10-18 15:53:43 + */ +public interface ModulesService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(ModulesParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(ModulesParam param); + + /** + * 根据id查询 + * + * @param id 插件id + * @return Modules + */ + Modules getByIdRel(Integer id); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/NoticeService.java b/src/main/java/com/gxwebsoft/common/system/service/NoticeService.java new file mode 100644 index 0000000..eb465e1 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/NoticeService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.Notice; +import com.gxwebsoft.common.system.param.NoticeParam; + +import java.util.List; + +/** + * 消息记录表Service + * + * @author 科技小王子 + * @since 2023-10-08 13:22:21 + */ +public interface NoticeService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(NoticeParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(NoticeParam param); + + /** + * 根据id查询 + * + * @param noticeId ID + * @return Notice + */ + Notice getByIdRel(Integer noticeId); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/OperationRecordService.java b/src/main/java/com/gxwebsoft/common/system/service/OperationRecordService.java new file mode 100644 index 0000000..227c4e6 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/OperationRecordService.java @@ -0,0 +1,49 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.OperationRecord; +import com.gxwebsoft.common.system.param.OperationRecordParam; + +import java.util.List; + +/** + * 操作日志Service + * + * @author WebSoft + * @since 2018-12-24 16:10:01 + */ +public interface OperationRecordService extends IService { + + /** + * 关联分页查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(OperationRecordParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(OperationRecordParam param); + + /** + * 根据id查询 + * + * @param id id + * @return OperationRecord + */ + OperationRecord getByIdRel(Integer id); + + /** + * 异步添加 + * + * @param operationRecord OperationRecord + */ + void saveAsync(OperationRecord operationRecord); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/OrderGoodsService.java b/src/main/java/com/gxwebsoft/common/system/service/OrderGoodsService.java new file mode 100644 index 0000000..25e0058 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/OrderGoodsService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.OrderGoods; +import com.gxwebsoft.common.system.param.OrderGoodsParam; + +import java.util.List; + +/** + * 订单商品Service + * + * @author 科技小王子 + * @since 2024-10-26 12:18:05 + */ +public interface OrderGoodsService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(OrderGoodsParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(OrderGoodsParam param); + + /** + * 根据id查询 + * + * @param id 订单号 + * @return OrderGoods + */ + OrderGoods getByIdRel(Integer id); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/OrderInfoService.java b/src/main/java/com/gxwebsoft/common/system/service/OrderInfoService.java new file mode 100644 index 0000000..d43f1d7 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/OrderInfoService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.OrderInfo; +import com.gxwebsoft.common.system.param.OrderInfoParam; + +import java.util.List; + +/** + * Service + * + * @author 科技小王子 + * @since 2024-05-10 18:02:54 + */ +public interface OrderInfoService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(OrderInfoParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(OrderInfoParam param); + + /** + * 根据id查询 + * + * @param id + * @return OrderInfo + */ + OrderInfo getByIdRel(Integer id); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/OrderService.java b/src/main/java/com/gxwebsoft/common/system/service/OrderService.java new file mode 100644 index 0000000..0c42d8f --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/OrderService.java @@ -0,0 +1,43 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.Order; +import com.gxwebsoft.common.system.param.OrderParam; + +import java.util.List; + +/** + * 订单Service + * + * @author 科技小王子 + * @since 2024-10-16 12:32:52 + */ +public interface OrderService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(OrderParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(OrderParam param); + + /** + * 根据id查询 + * + * @param orderId 订单号 + * @return Order + */ + Order getByIdRel(Integer orderId); + + void paySuccess(Order order); +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/OrganizationService.java b/src/main/java/com/gxwebsoft/common/system/service/OrganizationService.java new file mode 100644 index 0000000..94d3407 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/OrganizationService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.Organization; +import com.gxwebsoft.common.system.param.OrganizationParam; + +import java.util.List; + +/** + * 组织机构Service + * + * @author WebSoft + * @since 2020-03-14 11:29:04 + */ +public interface OrganizationService extends IService { + + /** + * 关联分页查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(OrganizationParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(OrganizationParam param); + + /** + * 根据id查询 + * + * @param organizationId 机构id + * @return Organization + */ + Organization getByIdRel(Integer organizationId); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/PaymentService.java b/src/main/java/com/gxwebsoft/common/system/service/PaymentService.java new file mode 100644 index 0000000..918bd12 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/PaymentService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.Payment; +import com.gxwebsoft.common.system.param.PaymentParam; + +import java.util.List; + +/** + * 支付方式Service + * + * @author 科技小王子 + * @since 2024-05-11 12:39:11 + */ +public interface PaymentService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(PaymentParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(PaymentParam param); + + /** + * 根据id查询 + * + * @param id ID + * @return Payment + */ + Payment getByIdRel(Integer id); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/PlugService.java b/src/main/java/com/gxwebsoft/common/system/service/PlugService.java new file mode 100644 index 0000000..09f2899 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/PlugService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.Plug; +import com.gxwebsoft.common.system.param.PlugParam; + +import java.util.List; + +/** + * 插件扩展Service + * + * @author 科技小王子 + * @since 2023-10-12 09:53:07 + */ +public interface PlugService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(PlugParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(PlugParam param); + + /** + * 根据id查询 + * + * @param plugId 插件id + * @return Plug + */ + Plug getByIdRel(Integer plugId); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/RechargeOrderService.java b/src/main/java/com/gxwebsoft/common/system/service/RechargeOrderService.java new file mode 100644 index 0000000..ab7a71e --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/RechargeOrderService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.RechargeOrder; +import com.gxwebsoft.common.system.param.RechargeOrderParam; + +import java.util.List; + +/** + * 会员充值订单表Service + * + * @author 科技小王子 + * @since 2024-07-26 23:18:48 + */ +public interface RechargeOrderService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(RechargeOrderParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(RechargeOrderParam param); + + /** + * 根据id查询 + * + * @param orderId 订单ID + * @return RechargeOrder + */ + RechargeOrder getByIdRel(Integer orderId); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/RoleMenuService.java b/src/main/java/com/gxwebsoft/common/system/service/RoleMenuService.java new file mode 100644 index 0000000..05a3d4f --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/RoleMenuService.java @@ -0,0 +1,35 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.system.entity.Menu; +import com.gxwebsoft.common.system.entity.RoleMenu; + +import java.util.List; + +/** + * 角色菜单Service + * + * @author WebSoft + * @since 2018-12-24 16:10:44 + */ +public interface RoleMenuService extends IService { + + /** + * 查询用户对应的菜单 + * + * @param userId 用户id + * @param menuType 菜单类型 + * @return List + */ + List listMenuByUserId(Integer userId, Integer menuType); + + /** + * 查询用户对应的菜单 + * + * @param roleIds 角色id + * @param menuType 菜单类型 + * @return List + */ + List listMenuByRoleIds(List roleIds, Integer menuType); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/RoleService.java b/src/main/java/com/gxwebsoft/common/system/service/RoleService.java new file mode 100644 index 0000000..c533f96 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/RoleService.java @@ -0,0 +1,15 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.system.entity.Role; +import com.gxwebsoft.common.system.param.RoleParam; + +/** + * 角色Service + * + * @author WebSoft + * @since 2018-12-24 16:10:32 + */ +public interface RoleService extends IService { + Role getByRoleCode(RoleParam roleParam); +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/SettingService.java b/src/main/java/com/gxwebsoft/common/system/service/SettingService.java new file mode 100644 index 0000000..c95253f --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/SettingService.java @@ -0,0 +1,62 @@ +package com.gxwebsoft.common.system.service; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.Setting; +import com.gxwebsoft.common.system.param.SettingParam; +import com.wechat.pay.java.core.Config; + +import java.util.List; + +/** + * 系统设置Service + * + * @author WebSoft + * @since 2022-11-19 13:54:27 + */ +public interface SettingService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(SettingParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(SettingParam param); + + /** + * 根据id查询 + * + * @param settingId id + * @return Setting + */ + Setting getByIdRel(Integer settingId); + + /** + * 通过key获取设置内容 + * @param key key + * @return Setting + */ + JSONObject getBySettingKey(String key); + + Setting getData(String settingKey); + + JSONObject getCache(String key); + + void initConfig(Setting setting); + + Config getConfig(Integer tenantId); + + JSONObject getUploadConfig(Integer tenantId); + + boolean updateByKey(Setting key); +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/SysFileTypeService.java b/src/main/java/com/gxwebsoft/common/system/service/SysFileTypeService.java new file mode 100644 index 0000000..73c5211 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/SysFileTypeService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.SysFileType; +import com.gxwebsoft.common.system.param.SysFileTypeParam; + +import java.util.List; + +/** + * 存储类型Service + * + * @author 科技小王子 + * @since 2025-05-16 14:24:28 + */ +public interface SysFileTypeService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(SysFileTypeParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(SysFileTypeParam param); + + /** + * 根据id查询 + * + * @param id 主键id + * @return SysFileType + */ + SysFileType getByIdRel(Integer id); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/TenantPackageService.java b/src/main/java/com/gxwebsoft/common/system/service/TenantPackageService.java new file mode 100644 index 0000000..a301d36 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/TenantPackageService.java @@ -0,0 +1,30 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.system.entity.TenantPackage; + +import java.util.List; + +/** + * 租户套餐Service + * + * @author WebSoft + * @since 2025-12-12 + */ +public interface TenantPackageService extends IService { + + /** + * 查询所有上架的套餐 + * + * @return List + */ + List listAvailablePackages(); + + /** + * 根据版本号查询套餐 + * + * @param version 版本号 + * @return TenantPackage + */ + TenantPackage getByVersion(Integer version); +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/TenantService.java b/src/main/java/com/gxwebsoft/common/system/service/TenantService.java new file mode 100644 index 0000000..ec46196 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/TenantService.java @@ -0,0 +1,48 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.Company; +import com.gxwebsoft.common.system.entity.Tenant; +import com.gxwebsoft.common.system.param.TenantParam; + +import java.util.List; + +/** + * 租户Service + * + * @author 科技小王子 + * @since 2023-07-17 17:49:53 + */ +public interface TenantService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(TenantParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(TenantParam param); + + /** + * 根据id查询 + * + * @param tenantId 租户id + * @return Tenant + */ + Tenant getByIdRel(Integer tenantId); + + Company initialization(Company company); + + boolean destructionAll(Integer tenantId); + + Tenant getByCodeRel(String code); +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/TenantSubscriptionOrderService.java b/src/main/java/com/gxwebsoft/common/system/service/TenantSubscriptionOrderService.java new file mode 100644 index 0000000..e172d20 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/TenantSubscriptionOrderService.java @@ -0,0 +1,79 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.TenantSubscriptionOrder; + +/** + * 租户订阅订单Service + * + * @author WebSoft + * @since 2025-12-12 + */ +public interface TenantSubscriptionOrderService extends IService { + + /** + * 创建订阅订单 + * + * @param packageId 套餐ID + * @param payType 支付周期 1月付 3季付 12年付 + * @param tenantId 租户ID + * @param userId 用户ID + * @return TenantSubscriptionOrder + */ + TenantSubscriptionOrder createOrder(Integer packageId, Integer payType, Integer tenantId, Integer userId); + + /** + * 创建试用订单 + * + * @param tenantId 租户ID + * @param userId 用户ID + * @return TenantSubscriptionOrder + */ + TenantSubscriptionOrder createTrialOrder(Integer tenantId, Integer userId); + + /** + * 支付订单 + * + * @param orderNo 订单号 + * @param paymentMethod 支付方式 + * @param paymentId 支付流水号 + * @return boolean + */ + boolean payOrder(String orderNo, String paymentMethod, String paymentId); + + /** + * 激活订单(支付成功后调用) + * + * @param orderNo 订单号 + * @return boolean + */ + boolean activateOrder(String orderNo); + + /** + * 取消订单 + * + * @param orderNo 订单号 + * @param cancelReason 取消原因 + * @return boolean + */ + boolean cancelOrder(String orderNo, String cancelReason); + + /** + * 分页查询租户订单 + * + * @param tenantId 租户ID + * @param page 页码 + * @param limit 每页数量 + * @return PageResult + */ + PageResult pageByTenant(Integer tenantId, Integer page, Integer limit); + + /** + * 根据订单号查询 + * + * @param orderNo 订单号 + * @return TenantSubscriptionOrder + */ + TenantSubscriptionOrder getByOrderNo(String orderNo); +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/TenantSubscriptionService.java b/src/main/java/com/gxwebsoft/common/system/service/TenantSubscriptionService.java new file mode 100644 index 0000000..cd7a5af --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/TenantSubscriptionService.java @@ -0,0 +1,113 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.system.entity.TenantSubscription; + +import java.util.List; + +/** + * 租户订阅记录Service + * + * @author WebSoft + * @since 2025-12-12 + */ +public interface TenantSubscriptionService extends IService { + + /** + * 根据租户ID查询订阅信息 + * + * @param tenantId 租户ID + * @return TenantSubscription + */ + TenantSubscription getByTenantId(Integer tenantId); + + /** + * 创建或更新订阅 + * + * @param tenantId 租户ID + * @param packageId 套餐ID + * @param version 版本号 + * @param startTime 开始时间 + * @param endTime 到期时间 + * @param isTrial 是否试用 + * @return TenantSubscription + */ + TenantSubscription createOrUpdateSubscription(Integer tenantId, Integer packageId, Integer version, + java.util.Date startTime, java.util.Date endTime, Integer isTrial); + + /** + * 升级订阅 + * + * @param tenantId 租户ID + * @param newPackageId 新套餐ID + * @return boolean + */ + boolean upgradeSubscription(Integer tenantId, Integer newPackageId); + + /** + * 续费订阅 + * + * @param tenantId 租户ID + * @param months 续费月数 + * @return boolean + */ + boolean renewSubscription(Integer tenantId, Integer months); + + /** + * 设置自动续费 + * + * @param tenantId 租户ID + * @param autoRenewal 是否自动续费 + * @param renewalPackageId 续费套餐ID + * @return boolean + */ + boolean setAutoRenewal(Integer tenantId, Integer autoRenewal, Integer renewalPackageId); + + /** + * 检查订阅是否有效 + * + * @param tenantId 租户ID + * @return boolean + */ + boolean isSubscriptionValid(Integer tenantId); + + /** + * 检查订阅是否过期 + * + * @param tenantId 租户ID + * @return boolean + */ + boolean isSubscriptionExpired(Integer tenantId); + + /** + * 查询即将过期的订阅 + * + * @param days 提前天数 + * @return List + */ + List listExpiringSoon(Integer days); + + /** + * 查询已过期的订阅 + * + * @return List + */ + List listExpired(); + + /** + * 标记订阅为已过期 + * + * @param subscriptionId 订阅ID + * @return boolean + */ + boolean markAsExpired(Long subscriptionId); + + /** + * 发送过期提醒 + * + * @param subscriptionId 订阅ID + * @param notifyStatus 提醒状态 + * @return boolean + */ + boolean sendExpiryNotification(Long subscriptionId, Integer notifyStatus); +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/UserBalanceLogService.java b/src/main/java/com/gxwebsoft/common/system/service/UserBalanceLogService.java new file mode 100644 index 0000000..eaa4e0d --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/UserBalanceLogService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.UserBalanceLog; +import com.gxwebsoft.common.system.param.UserBalanceLogParam; + +import java.util.List; + +/** + * 用户余额变动明细表Service + * + * @author 科技小王子 + * @since 2023-04-21 15:59:09 + */ +public interface UserBalanceLogService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(UserBalanceLogParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(UserBalanceLogParam param); + + /** + * 根据id查询 + * + * @param logId 主键ID + * @return UserBalanceLog + */ + UserBalanceLog getByIdRel(Integer logId); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/UserCollectionService.java b/src/main/java/com/gxwebsoft/common/system/service/UserCollectionService.java new file mode 100644 index 0000000..421c682 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/UserCollectionService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.UserCollection; +import com.gxwebsoft.common.system.param.UserCollectionParam; + +import java.util.List; + +/** + * 我的收藏Service + * + * @author 科技小王子 + * @since 2024-04-28 18:08:32 + */ +public interface UserCollectionService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(UserCollectionParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(UserCollectionParam param); + + /** + * 根据id查询 + * + * @param id 主键ID + * @return UserCollection + */ + UserCollection getByIdRel(Integer id); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/UserFileService.java b/src/main/java/com/gxwebsoft/common/system/service/UserFileService.java new file mode 100644 index 0000000..2c8abe6 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/UserFileService.java @@ -0,0 +1,14 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.system.entity.UserFile; + +/** + * 用户文件Service + * + * @author WebSoft + * @since 2022-07-21 14:34:40 + */ +public interface UserFileService extends IService { + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/UserGradeService.java b/src/main/java/com/gxwebsoft/common/system/service/UserGradeService.java new file mode 100644 index 0000000..d9ab5ae --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/UserGradeService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.UserGrade; +import com.gxwebsoft.common.system.param.UserGradeParam; + +import java.util.List; + +/** + * 用户会员等级表Service + * + * @author 科技小王子 + * @since 2023-10-07 22:51:17 + */ +public interface UserGradeService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(UserGradeParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(UserGradeParam param); + + /** + * 根据id查询 + * + * @param gradeId 等级ID + * @return UserGrade + */ + UserGrade getByIdRel(Integer gradeId); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/UserGroupService.java b/src/main/java/com/gxwebsoft/common/system/service/UserGroupService.java new file mode 100644 index 0000000..d97b0aa --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/UserGroupService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.UserGroup; +import com.gxwebsoft.common.system.param.UserGroupParam; + +import java.util.List; + +/** + * 用户分组管理表Service + * + * @author 科技小王子 + * @since 2023-10-28 15:16:39 + */ +public interface UserGroupService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(UserGroupParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(UserGroupParam param); + + /** + * 根据id查询 + * + * @param groupId 分组ID + * @return UserGroup + */ + UserGroup getByIdRel(Integer groupId); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/UserOauthService.java b/src/main/java/com/gxwebsoft/common/system/service/UserOauthService.java new file mode 100644 index 0000000..9c2e04c --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/UserOauthService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.UserOauth; +import com.gxwebsoft.common.system.param.UserOauthParam; + +import java.util.List; + +/** + * 第三方用户信息表Service + * + * @author 科技小王子 + * @since 2023-10-07 22:39:46 + */ +public interface UserOauthService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(UserOauthParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(UserOauthParam param); + + /** + * 根据id查询 + * + * @param id 主键ID + * @return UserOauth + */ + UserOauth getByIdRel(Integer id); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/UserRefereeService.java b/src/main/java/com/gxwebsoft/common/system/service/UserRefereeService.java new file mode 100644 index 0000000..e715c4f --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/UserRefereeService.java @@ -0,0 +1,45 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.UserReferee; +import com.gxwebsoft.common.system.param.UserRefereeParam; + +import java.util.List; + +/** + * 用户推荐关系表Service + * + * @author 科技小王子 + * @since 2023-10-07 22:56:36 + */ +public interface UserRefereeService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(UserRefereeParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(UserRefereeParam param); + + /** + * 根据id查询 + * + * @param id 主键ID + * @return UserReferee + */ + UserReferee getByIdRel(Integer id); + + UserReferee check(Integer dealerId, Integer userId); + + UserReferee getByUserId(Integer userId); +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/UserRoleService.java b/src/main/java/com/gxwebsoft/common/system/service/UserRoleService.java new file mode 100644 index 0000000..4fecd69 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/UserRoleService.java @@ -0,0 +1,70 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.Role; +import com.gxwebsoft.common.system.entity.UserRole; +import com.gxwebsoft.common.system.param.UserRoleParam; + +import java.util.List; + +/** + * 用户角色Service + * + * @author 科技小王子 + * @since 2025-06-16 20:39:53 + */ +public interface UserRoleService extends IService { + + /** + * 批量添加用户角色 + * + * @param userId 用户id + * @param roleIds 角色id集合 + * @return int + */ + int saveBatch(Integer userId, List roleIds); + + /** + * 根据用户id查询角色 + * + * @param userId 用户id + * @return List + */ + List listByUserId(Integer userId); + + /** + * 批量根据用户id查询角色 + * + * @param userIds 用户id集合 + * @return List + */ + List listByUserIds(List userIds); + + List listByRoleId(Integer roleId); + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(UserRoleParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(UserRoleParam param); + + /** + * 根据id查询 + * + * @param id 主键id + * @return UserRole + */ + UserRole getByIdRel(Integer id); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/UserService.java b/src/main/java/com/gxwebsoft/common/system/service/UserService.java new file mode 100644 index 0000000..2b7cf31 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/UserService.java @@ -0,0 +1,158 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.common.system.param.LoginParam; +import com.gxwebsoft.common.system.param.UserParam; +import org.springframework.security.core.userdetails.UserDetailsService; + +import java.util.List; + +/** + * 用户Service + * + * @author WebSoft + * @since 2018-12-24 16:10:52 + */ +public interface UserService extends IService, UserDetailsService { + + /** + * 关联分页查询用户 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(UserParam param); + + /** + * 关联查询全部用户 + * + * @param param 查询参数 + * @return List + */ + List listRel(UserParam param); + + /** + * 根据id查询用户 + * + * @param userId 用户id + * @return User + */ + User getByIdRel(Integer userId); + + /** + * 根据账号查询用户 + * + * @param username 账号 + * @return User + */ + User getByUsername(String username); + + /** + * 根据账号查询用户 + * + * @param username 账号 + * @param tenantId 租户id + * @return User + */ + User getByUsername(String username, Integer tenantId); + + /** + * 添加用户 + * + * @param user 用户信息 + * @return boolean + */ + boolean saveUser(User user); + + /** + * 修改用户 + * + * @param user 用户信息 + * @return boolean + */ + boolean updateUser(User user); + + /** + * 比较用户密码 + * + * @param dbPassword 数据库存储的密码 + * @param inputPassword 用户输入的密码 + * @return boolean + */ + boolean comparePassword(String dbPassword, String inputPassword); + + /** + * md5加密用户密码 + * + * @param password 密码明文 + * @return 密文 + */ + String encodePassword(String password); + + /** + * 跟进手机号码查询用户 + * @param phone 手机号码 + * @return 用户信息 + */ + User getByPhone(String phone); + + User getByPhone(String phone,Integer tenantId); + + User getByUnionId(UserParam userParam); + + User getByOauthId(UserParam userParam); + + List listStatisticsRel(UserParam param); + + /** + * 更新会员不限租户 + * @param user 用户信息 + */ + void updateByUserId(User user); + + User addUser(UserParam userParam); + + User getAdminByPhone(UserParam param); + + User getAdminByPhone(UserParam param,Integer tenantId); + + User getAllByUserId(String userId); + + Integer userNumInPark(UserParam param); + + Integer orgNumInPark(UserParam param); + + List getAdminsByPhone(LoginParam param); + + List pageAll(UserParam param); + + User getByUserId(String userId); + + /** + * 根据手机号查询所有账号(忽略租户隔离) + * + * @param phone 手机号 + * @return List + */ + List findAccountsByPhone(String phone); + + /** + * 根据手机号统计账号数量 + * + * @param phone 手机号 + * @return Integer + */ + Integer countAccountsByPhone(String phone); + + /** + * 重置用户密码 + * + * @param userId 用户ID + * @param tenantId 租户ID + * @param newPassword 新密码(明文) + * @return boolean + */ + boolean resetUserPassword(String userId, Integer tenantId, String newPassword); +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/UserSyncService.java b/src/main/java/com/gxwebsoft/common/system/service/UserSyncService.java new file mode 100644 index 0000000..59f923f --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/UserSyncService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.common.system.service; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * 用户同步服务 + * + * 注意:此服务已废弃,用户同步现在通过 MQ 实现。 + * 各子系统(websopy等)需要在自己的系统中消费 MQ 消息进行同步。 + * + * 保留此类是为了兼容可能存在的旧代码引用,所有方法已改为空实现。 + * + * @author WebSoft + * @since 2026-04-04 + * @deprecated 请使用 MQ 消息进行用户同步 + */ +@Slf4j +@Service +@Deprecated +public class UserSyncService { + + /** + * 同步单个用户到 websopy + * + * @deprecated 已废弃,用户同步现在通过 MQ 自动触发 + */ + @Deprecated + public void syncUserToWebsopy(Object user) { + log.debug("UserSyncService.syncUserToWebsopy 已废弃,用户同步通过 MQ 自动触发"); + } + + /** + * 刷新 websopy 端的用户缓存 + * + * @deprecated 已废弃 + */ + @Deprecated + public void refreshUserCache(Integer userId) { + log.debug("UserSyncService.refreshUserCache 已废弃"); + } +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/UserVerifyService.java b/src/main/java/com/gxwebsoft/common/system/service/UserVerifyService.java new file mode 100644 index 0000000..b8bb118 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/UserVerifyService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.UserVerify; +import com.gxwebsoft.common.system.param.UserVerifyParam; + +import java.util.List; + +/** + * 实名认证Service + * + * @author 科技小王子 + * @since 2025-05-29 23:01:04 + */ +public interface UserVerifyService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(UserVerifyParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(UserVerifyParam param); + + /** + * 根据id查询 + * + * @param id 自增ID + * @return UserVerify + */ + UserVerify getByIdRel(Integer id); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/VersionService.java b/src/main/java/com/gxwebsoft/common/system/service/VersionService.java new file mode 100644 index 0000000..afbc28d --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/VersionService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.Version; +import com.gxwebsoft.common.system.param.VersionParam; + +import java.util.List; + +/** + * 版本更新Service + * + * @author 科技小王子 + * @since 2024-01-15 18:52:24 + */ +public interface VersionService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(VersionParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(VersionParam param); + + /** + * 根据id查询 + * + * @param id ID + * @return Version + */ + Version getByIdRel(Integer id); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/WebsiteFieldService.java b/src/main/java/com/gxwebsoft/common/system/service/WebsiteFieldService.java new file mode 100644 index 0000000..efc4fcb --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/WebsiteFieldService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.WebsiteField; +import com.gxwebsoft.common.system.param.WebsiteFieldParam; + +import java.util.List; + +/** + * 应用参数Service + * + * @author 科技小王子 + * @since 2024-08-27 15:18:05 + */ +public interface WebsiteFieldService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(WebsiteFieldParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(WebsiteFieldParam param); + + /** + * 根据id查询 + * + * @param id 自增ID + * @return WebsiteField + */ + WebsiteField getByIdRel(Integer id); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/WhiteDomainService.java b/src/main/java/com/gxwebsoft/common/system/service/WhiteDomainService.java new file mode 100644 index 0000000..35918bd --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/WhiteDomainService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.common.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.WhiteDomain; +import com.gxwebsoft.common.system.param.WhiteDomainParam; + +import java.util.List; + +/** + * 服务器白名单Service + * + * @author 科技小王子 + * @since 2024-03-26 00:22:21 + */ +public interface WhiteDomainService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(WhiteDomainParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(WhiteDomainParam param); + + /** + * 根据id查询 + * + * @param id ID + * @return WhiteDomain + */ + WhiteDomain getByIdRel(Integer id); + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/WxMiniappAccessTokenService.java b/src/main/java/com/gxwebsoft/common/system/service/WxMiniappAccessTokenService.java new file mode 100644 index 0000000..3a3a44b --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/WxMiniappAccessTokenService.java @@ -0,0 +1,18 @@ +package com.gxwebsoft.common.system.service; + +/** + * 微信小程序 access_token 获取服务(按租户)。 + * + *

用于调用微信小程序开放接口(例如:上传发货信息)。

+ */ +public interface WxMiniappAccessTokenService { + + /** + * 获取指定租户的小程序 access_token(内部带缓存)。 + * + * @param tenantId 租户ID + * @return access_token + */ + String getAccessToken(Integer tenantId); +} + diff --git a/src/main/java/com/gxwebsoft/common/system/service/WxService.java b/src/main/java/com/gxwebsoft/common/system/service/WxService.java new file mode 100644 index 0000000..d112b88 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/WxService.java @@ -0,0 +1,324 @@ +package com.gxwebsoft.common.system.service; + +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import cn.hutool.http.HttpUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Service; + +import java.util.HashMap; +import java.util.concurrent.TimeUnit; + +/** + * 微信公共服务类 + * + * @author 科技小王子 + * @since 2025-09-08 + */ +@Slf4j +@Service +public class WxService { + + @Autowired + private SettingService settingService; + + @Autowired + private RedisTemplate redisTemplate; + + private static final String ACCESS_TOKEN_KEY = "WX_ACCESS_TOKEN"; + private static final String MP_OFFICIAL_ACCESS_TOKEN_KEY = "MP_OFFICIAL_ACCESS_TOKEN"; + + /** + * 获取微信AccessToken(使用默认租户) + */ + public String getAccessToken() { + return getAccessToken(null); + } + + /** + * 获取微信AccessToken(支持指定租户ID) + * + * @param tenantId 租户ID,为null时使用默认值 + * @return access_token + */ + public String getAccessToken(Integer tenantId) { + if (tenantId == null) { + tenantId = 10048; // 默认租户ID,可以根据需要调整 + } + + String key = ACCESS_TOKEN_KEY + ":" + tenantId; + + // 从缓存获取 + String cachedToken = redisTemplate.opsForValue().get(key); + if (StrUtil.isNotBlank(cachedToken)) { + try { + JSONObject tokenData = JSON.parseObject(cachedToken); + String accessToken = tokenData.getString("access_token"); + if (StrUtil.isNotBlank(accessToken)) { + log.debug("从缓存获取access_token: {}", accessToken); + return accessToken; + } + } catch (Exception e) { + // 解析失败,可能是旧格式,直接使用 + if (!cachedToken.startsWith("{")) { + log.debug("从缓存获取access_token(旧格式): {}", cachedToken); + return cachedToken; + } + log.warn("解析缓存的access_token失败: {}", e.getMessage()); + // 缓存数据异常,删除缓存,重新获取 + redisTemplate.delete(key); + } + } + + // 缓存中没有,重新获取 + try { + JSONObject setting = settingService.getBySettingKey("mp-weixin"); + if (setting == null) { + throw new RuntimeException("请先配置微信小程序"); + } + + String appId = setting.getString("appId"); + String appSecret = setting.getString("appSecret"); + if (StrUtil.isBlank(appId) || StrUtil.isBlank(appSecret)) { + throw new RuntimeException("微信小程序配置不完整"); + } + + // 调用微信API获取AccessToken + String apiUrl = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + + appId + "&secret=" + appSecret; + String response = HttpRequest.get(apiUrl).execute().body(); + + JSONObject result = JSON.parseObject(response); + String accessToken = result.getString("access_token"); + if (StrUtil.isNotBlank(accessToken)) { + // 存入缓存 + JSONObject tokenData = new JSONObject(); + tokenData.put("access_token", accessToken); + tokenData.put("expires_in", result.get("expires_in")); + redisTemplate.opsForValue().set(key, tokenData.toJSONString(), 7000L, TimeUnit.SECONDS); + log.info("获取新的access_token成功: {}", accessToken); + return accessToken; + } else { + throw new RuntimeException("获取AccessToken失败: " + response); + } + } catch (Exception e) { + log.error("获取微信AccessToken失败: {}", e.getMessage(), e); + throw new RuntimeException("获取微信AccessToken失败: " + e.getMessage()); + } + } + + /** + * 强制刷新微信AccessToken(先删除缓存,再重新获取) + * 用于当 token 过期或失效后,需要强制获取新 token 的场景 + * + * @param tenantId 租户ID,为null时使用默认值 + * @return access_token + */ + public String getAccessTokenForcibly(Integer tenantId) { + if (tenantId == null) { + tenantId = 10048; + } + + String key = ACCESS_TOKEN_KEY + ":" + tenantId; + + // 先删除缓存 + redisTemplate.delete(key); + log.info("强制刷新access_token,已删除缓存: {}", key); + + // 直接从微信API获取新token(不再检查缓存) + try { + JSONObject setting = settingService.getBySettingKey("mp-weixin"); + if (setting == null) { + throw new RuntimeException("请先配置微信小程序"); + } + + String appId = setting.getString("appId"); + String appSecret = setting.getString("appSecret"); + if (StrUtil.isBlank(appId) || StrUtil.isBlank(appSecret)) { + throw new RuntimeException("微信小程序配置不完整"); + } + + // 调用微信API获取AccessToken + String apiUrl = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + + appId + "&secret=" + appSecret; + String response = HttpRequest.get(apiUrl).execute().body(); + + JSONObject result = JSON.parseObject(response); + String accessToken = result.getString("access_token"); + if (StrUtil.isNotBlank(accessToken)) { + // 存入缓存 + JSONObject tokenData = new JSONObject(); + tokenData.put("access_token", accessToken); + tokenData.put("expires_in", result.get("expires_in")); + redisTemplate.opsForValue().set(key, tokenData.toJSONString(), 7000L, TimeUnit.SECONDS); + log.info("强制刷新access_token成功: {}", accessToken); + return accessToken; + } else { + throw new RuntimeException("获取AccessToken失败: " + response); + } + } catch (Exception e) { + log.error("强制刷新微信AccessToken失败: {}", e.getMessage(), e); + throw new RuntimeException("获取微信AccessToken失败: " + e.getMessage()); + } + } + + /** + * 获取微信公众号 AppID + */ + public String getOfficialAppId() { + return getOfficialAppId(null); + } + + /** + * 获取微信公众号 AppID(支持指定租户ID) + */ + public String getOfficialAppId(Integer tenantId) { + if (tenantId == null) { + tenantId = 10048; + } + JSONObject setting = settingService.getBySettingKey("wx-official"); + if (setting == null) { + throw new RuntimeException("请先配置微信公众号"); + } + String appId = setting.getString("appId"); + if (StrUtil.isBlank(appId)) { + throw new RuntimeException("微信公众号配置不完整"); + } + return appId; + } + + /** + * 获取微信公众号 AppSecret + */ + public String getOfficialAppSecret() { + return getOfficialAppSecret(null); + } + + /** + * 获取微信公众号 AppSecret(支持指定租户ID) + */ + public String getOfficialAppSecret(Integer tenantId) { + if (tenantId == null) { + tenantId = 10048; + } + JSONObject setting = settingService.getBySettingKey("wx-official"); + if (setting == null) { + throw new RuntimeException("请先配置微信公众号"); + } + String appSecret = setting.getString("appSecret"); + if (StrUtil.isBlank(appSecret)) { + throw new RuntimeException("微信公众号配置不完整"); + } + return appSecret; + } + + /** + * 获取微信公众号 AccessToken(用于 API 调用,非用户授权) + */ + public String getOfficialAccessToken() { + return getOfficialAccessToken(null); + } + + /** + * 获取微信公众号 AccessToken(支持指定租户ID) + */ + public String getOfficialAccessToken(Integer tenantId) { + if (tenantId == null) { + tenantId = 10048; + } + + String key = MP_OFFICIAL_ACCESS_TOKEN_KEY + ":" + tenantId; + + // 从缓存获取 + String cachedToken = redisTemplate.opsForValue().get(key); + if (StrUtil.isNotBlank(cachedToken)) { + try { + JSONObject tokenData = JSON.parseObject(cachedToken); + String accessToken = tokenData.getString("access_token"); + if (StrUtil.isNotBlank(accessToken)) { + log.debug("从缓存获取公众号access_token: {}", accessToken); + return accessToken; + } + } catch (Exception e) { + log.warn("解析缓存的公众号access_token失败: {}", e.getMessage()); + redisTemplate.delete(key); + } + } + + // 缓存中没有,重新获取 + try { + String appId = getOfficialAppId(tenantId); + String appSecret = getOfficialAppSecret(tenantId); + + String apiUrl = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + + appId + "&secret=" + appSecret; + String response = HttpUtil.get(apiUrl); + + JSONObject result = JSON.parseObject(response); + String accessToken = result.getString("access_token"); + if (StrUtil.isNotBlank(accessToken)) { + JSONObject tokenData = new JSONObject(); + tokenData.put("access_token", accessToken); + tokenData.put("expires_in", result.get("expires_in")); + redisTemplate.opsForValue().set(key, tokenData.toJSONString(), 7000L, TimeUnit.SECONDS); + log.info("获取新的公众号access_token成功: {}", accessToken); + return accessToken; + } else { + throw new RuntimeException("获取公众号AccessToken失败: " + response); + } + } catch (Exception e) { + log.error("获取微信公众号AccessToken失败: {}", e.getMessage(), e); + throw new RuntimeException("获取微信公众号AccessToken失败: " + e.getMessage()); + } + } + + /** + * 通过授权码获取用户 AccessToken(用户授权后使用) + * 用于 OAuth2 授权流程,获取用户信息 + */ + public JSONObject getOfficialUserAccessToken(String code, Integer tenantId) { + if (tenantId == null) { + tenantId = 10048; + } + try { + String appId = getOfficialAppId(tenantId); + String appSecret = getOfficialAppSecret(tenantId); + + String apiUrl = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=" + + appId + "&secret=" + appSecret + "&code=" + code + "&grant_type=authorization_code"; + + String response = HttpUtil.get(apiUrl); + log.info("获取用户AccessToken响应: {}", response); + + JSONObject result = JSON.parseObject(response); + String accessToken = result.getString("access_token"); + if (StrUtil.isBlank(accessToken)) { + String errMsg = result.getString("errmsg"); + throw new RuntimeException("获取用户授权失败: " + errMsg); + } + return result; + } catch (Exception e) { + log.error("获取用户授权AccessToken失败: {}", e.getMessage(), e); + throw new RuntimeException("获取用户授权失败: " + e.getMessage()); + } + } + + /** + * 获取微信公众号用户信息 + */ + public JSONObject getOfficialUserInfo(String accessToken, String openId) { + try { + String apiUrl = "https://api.weixin.qq.com/sns/userinfo?access_token=" + accessToken + "&openid=" + openId + "&lang=zh_CN"; + String response = HttpUtil.get(apiUrl); + log.info("获取用户信息响应: {}", response); + return JSON.parseObject(response); + } catch (Exception e) { + log.error("获取用户信息失败: {}", e.getMessage(), e); + throw new RuntimeException("获取用户信息失败: " + e.getMessage()); + } + } +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/AccessKeyServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/AccessKeyServiceImpl.java new file mode 100644 index 0000000..2f02e25 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/AccessKeyServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.system.mapper.AccessKeyMapper; +import com.gxwebsoft.common.system.service.AccessKeyService; +import com.gxwebsoft.common.system.entity.AccessKey; +import com.gxwebsoft.common.system.param.AccessKeyParam; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 访问凭证管理Service实现 + * + * @author 科技小王子 + * @since 2023-05-16 19:19:55 + */ +@Service +public class AccessKeyServiceImpl extends ServiceImpl implements AccessKeyService { + + @Override + public PageResult pageRel(AccessKeyParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(AccessKeyParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + //page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public AccessKey getByIdRel(Integer id) { + AccessKeyParam param = new AccessKeyParam(); + param.setId(id); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/AuthorizeCodeServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/AuthorizeCodeServiceImpl.java new file mode 100644 index 0000000..21d7091 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/AuthorizeCodeServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.system.mapper.AuthorizeCodeMapper; +import com.gxwebsoft.common.system.service.AuthorizeCodeService; +import com.gxwebsoft.common.system.entity.AuthorizeCode; +import com.gxwebsoft.common.system.param.AuthorizeCodeParam; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 授权码Service实现 + * + * @author 科技小王子 + * @since 2025-08-05 01:17:27 + */ +@Service +public class AuthorizeCodeServiceImpl extends ServiceImpl implements AuthorizeCodeService { + + @Override + public PageResult pageRel(AuthorizeCodeParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(AuthorizeCodeParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public AuthorizeCode getByIdRel(Integer id) { + AuthorizeCodeParam param = new AuthorizeCodeParam(); + param.setId(id); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/CartServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/CartServiceImpl.java new file mode 100644 index 0000000..859ec25 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/CartServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.Cart; +import com.gxwebsoft.common.system.mapper.CartMapper; +import com.gxwebsoft.common.system.param.CartParam; +import com.gxwebsoft.common.system.service.CartService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 购物车Service实现 + * + * @author 科技小王子 + * @since 2024-10-26 10:54:51 + */ +@Service +public class CartServiceImpl extends ServiceImpl implements CartService { + + @Override + public PageResult pageRel(CartParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(CartParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public Cart getByIdRel(Long id) { + CartParam param = new CartParam(); + param.setId(id); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/ChatConversationServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/ChatConversationServiceImpl.java new file mode 100644 index 0000000..d7fc35e --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/ChatConversationServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.system.mapper.ChatConversationMapper; +import com.gxwebsoft.common.system.service.ChatConversationService; +import com.gxwebsoft.common.system.entity.ChatConversation; +import com.gxwebsoft.common.system.param.ChatConversationParam; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 聊天消息表Service实现 + * + * @author 科技小王子 + * @since 2024-04-27 15:57:27 + */ +@Service +public class ChatConversationServiceImpl extends ServiceImpl implements ChatConversationService { + + @Override + public PageResult pageRel(ChatConversationParam param) { + PageParam page = new PageParam<>(param); + //page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(ChatConversationParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + //page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public ChatConversation getByIdRel(Integer id) { + ChatConversationParam param = new ChatConversationParam(); + param.setId(id); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/ChatMessageServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/ChatMessageServiceImpl.java new file mode 100644 index 0000000..bb1f1ef --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/ChatMessageServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.system.mapper.ChatMessageMapper; +import com.gxwebsoft.common.system.service.ChatMessageService; +import com.gxwebsoft.common.system.entity.ChatMessage; +import com.gxwebsoft.common.system.param.ChatMessageParam; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 聊天消息表Service实现 + * + * @author 科技小王子 + * @since 2024-04-27 15:57:27 + */ +@Service +public class ChatMessageServiceImpl extends ServiceImpl implements ChatMessageService { + + @Override + public PageResult pageRel(ChatMessageParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(ChatMessageParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + //page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public ChatMessage getByIdRel(Integer id) { + ChatMessageParam param = new ChatMessageParam(); + param.setId(id); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/CompanyCommentServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/CompanyCommentServiceImpl.java new file mode 100644 index 0000000..e945e66 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/CompanyCommentServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.CompanyComment; +import com.gxwebsoft.common.system.mapper.CompanyCommentMapper; +import com.gxwebsoft.common.system.param.CompanyCommentParam; +import com.gxwebsoft.common.system.service.CompanyCommentService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 应用评论Service实现 + * + * @author 科技小王子 + * @since 2024-10-17 15:30:24 + */ +@Service +public class CompanyCommentServiceImpl extends ServiceImpl implements CompanyCommentService { + + @Override + public PageResult pageRel(CompanyCommentParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(CompanyCommentParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public CompanyComment getByIdRel(Integer id) { + CompanyCommentParam param = new CompanyCommentParam(); + param.setId(id); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/CompanyContentServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/CompanyContentServiceImpl.java new file mode 100644 index 0000000..b8604a6 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/CompanyContentServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.CompanyContent; +import com.gxwebsoft.common.system.mapper.CompanyContentMapper; +import com.gxwebsoft.common.system.param.CompanyContentParam; +import com.gxwebsoft.common.system.service.CompanyContentService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 应用详情Service实现 + * + * @author 科技小王子 + * @since 2024-10-16 13:41:21 + */ +@Service +public class CompanyContentServiceImpl extends ServiceImpl implements CompanyContentService { + + @Override + public PageResult pageRel(CompanyContentParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(CompanyContentParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public CompanyContent getByIdRel(Integer id) { + CompanyContentParam param = new CompanyContentParam(); + param.setId(id); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/CompanyGitServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/CompanyGitServiceImpl.java new file mode 100644 index 0000000..a954d4b --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/CompanyGitServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.CompanyGit; +import com.gxwebsoft.common.system.mapper.CompanyGitMapper; +import com.gxwebsoft.common.system.param.CompanyGitParam; +import com.gxwebsoft.common.system.service.CompanyGitService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 代码仓库Service实现 + * + * @author 科技小王子 + * @since 2024-10-19 18:08:51 + */ +@Service +public class CompanyGitServiceImpl extends ServiceImpl implements CompanyGitService { + + @Override + public PageResult pageRel(CompanyGitParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(CompanyGitParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public CompanyGit getByIdRel(Integer id) { + CompanyGitParam param = new CompanyGitParam(); + param.setId(id); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/CompanyParameterServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/CompanyParameterServiceImpl.java new file mode 100644 index 0000000..4b77612 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/CompanyParameterServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.CompanyParameter; +import com.gxwebsoft.common.system.mapper.CompanyParameterMapper; +import com.gxwebsoft.common.system.param.CompanyParameterParam; +import com.gxwebsoft.common.system.service.CompanyParameterService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 应用参数Service实现 + * + * @author 科技小王子 + * @since 2024-10-17 15:30:24 + */ +@Service +public class CompanyParameterServiceImpl extends ServiceImpl implements CompanyParameterService { + + @Override + public PageResult pageRel(CompanyParameterParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(CompanyParameterParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public CompanyParameter getByIdRel(Integer id) { + CompanyParameterParam param = new CompanyParameterParam(); + param.setId(id); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/CompanyServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/CompanyServiceImpl.java new file mode 100644 index 0000000..8bdb503 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/CompanyServiceImpl.java @@ -0,0 +1,86 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.Company; +import com.gxwebsoft.common.system.mapper.CompanyMapper; +import com.gxwebsoft.common.system.param.CompanyParam; +import com.gxwebsoft.common.system.service.CompanyService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 企业信息Service实现 + * + * @author 科技小王子 + * @since 2023-05-27 14:57:34 + */ +@Service +public class CompanyServiceImpl extends ServiceImpl implements CompanyService { + + @Override + public PageResult pageRel(CompanyParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("sort_number desc,create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(CompanyParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public Company getByIdRel(Integer companyId) { + CompanyParam param = new CompanyParam(); + param.setCompanyId(companyId); + return param.getOne(baseMapper.selectListRel(param)); + } + + @Override + public Company getByTenantIdRel(Integer tenantId) { + CompanyParam param = new CompanyParam(); +// final Company one = param.getOne(baseMapper.selectListRel(param)); + param.setAuthoritative(true); + return param.getOne(baseMapper.selectListRel(param)); + } + + @Override + public PageResult pageRelAll(CompanyParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("sort_number desc,create_time desc"); + List list = baseMapper.selectPageRelAll(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public void updateByCompanyId(Company company) { + baseMapper.updateByCompanyId(company); + } + + @Override + public boolean removeCompanyAll(Integer companyId){ + if (baseMapper.removeCompanyAll(companyId)) { + return true; + } + return false; + } + + @Override + public boolean undeleteAll(Integer companyId){ + if (baseMapper.undeleteAll(companyId)) { + return true; + } + return false; + } + + + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/CompanyUrlServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/CompanyUrlServiceImpl.java new file mode 100644 index 0000000..a7922cb --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/CompanyUrlServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.CompanyUrl; +import com.gxwebsoft.common.system.mapper.CompanyUrlMapper; +import com.gxwebsoft.common.system.param.CompanyUrlParam; +import com.gxwebsoft.common.system.service.CompanyUrlService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 应用域名Service实现 + * + * @author 科技小王子 + * @since 2024-10-17 15:30:24 + */ +@Service +public class CompanyUrlServiceImpl extends ServiceImpl implements CompanyUrlService { + + @Override + public PageResult pageRel(CompanyUrlParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(CompanyUrlParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public CompanyUrl getByIdRel(Integer id) { + CompanyUrlParam param = new CompanyUrlParam(); + param.setId(id); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/ComponentsServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/ComponentsServiceImpl.java new file mode 100644 index 0000000..59d0db4 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/ComponentsServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.system.mapper.ComponentsMapper; +import com.gxwebsoft.common.system.service.ComponentsService; +import com.gxwebsoft.common.system.entity.Components; +import com.gxwebsoft.common.system.param.ComponentsParam; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 组件Service实现 + * + * @author 科技小王子 + * @since 2024-08-25 19:08:51 + */ +@Service +public class ComponentsServiceImpl extends ServiceImpl implements ComponentsService { + + @Override + public PageResult pageRel(ComponentsParam param) { + PageParam page = new PageParam<>(param); + //page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(ComponentsParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + //page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public Components getByIdRel(Integer id) { + ComponentsParam param = new ComponentsParam(); + param.setId(id); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/DictDataServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/DictDataServiceImpl.java new file mode 100644 index 0000000..5ed06a5 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/DictDataServiceImpl.java @@ -0,0 +1,52 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.core.utils.CommonUtil; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.DictData; +import com.gxwebsoft.common.system.mapper.DictDataMapper; +import com.gxwebsoft.common.system.param.DictDataParam; +import com.gxwebsoft.common.system.service.DictDataService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 字典数据Service实现 + * + * @author WebSoft + * @since 2020-03-14 11:29:04 + */ +@Service +public class DictDataServiceImpl extends ServiceImpl + implements DictDataService { + + @Override + public PageResult pageRel(DictDataParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("sort_number asc, create_time asc"); + return new PageResult<>(baseMapper.selectPageRel(page, param), page.getTotal()); + } + + @Override + public List listRel(DictDataParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("sort_number asc, create_time asc"); + return page.sortRecords(baseMapper.selectListRel(param)); + } + + @Override + public DictData getByIdRel(Integer dictDataId) { + DictDataParam param = new DictDataParam(); + param.setDictDataId(dictDataId); + return param.getOne(baseMapper.selectListRel(param)); + } + + @Override + public DictData getByDictCodeAndName(String dictCode, String dictDataName) { + List list = baseMapper.getByDictCodeAndName(dictCode, dictDataName); + return CommonUtil.listGetOne(list); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/DictServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/DictServiceImpl.java new file mode 100644 index 0000000..6b09f90 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/DictServiceImpl.java @@ -0,0 +1,18 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.system.entity.Dict; +import com.gxwebsoft.common.system.mapper.DictMapper; +import com.gxwebsoft.common.system.service.DictService; +import org.springframework.stereotype.Service; + +/** + * 字典Service实现 + * + * @author WebSoft + * @since 2020-03-14 11:29:03 + */ +@Service +public class DictServiceImpl extends ServiceImpl implements DictService { + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/DictionaryDataServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/DictionaryDataServiceImpl.java new file mode 100644 index 0000000..0f26dd2 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/DictionaryDataServiceImpl.java @@ -0,0 +1,52 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.core.utils.CommonUtil; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.DictionaryData; +import com.gxwebsoft.common.system.mapper.DictionaryDataMapper; +import com.gxwebsoft.common.system.param.DictionaryDataParam; +import com.gxwebsoft.common.system.service.DictionaryDataService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 字典数据Service实现 + * + * @author WebSoft + * @since 2020-03-14 11:29:04 + */ +@Service +public class DictionaryDataServiceImpl extends ServiceImpl + implements DictionaryDataService { + + @Override + public PageResult pageRel(DictionaryDataParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("sort_number"); + return new PageResult<>(baseMapper.selectPageRel(page, param), page.getTotal()); + } + + @Override + public List listRel(DictionaryDataParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("sort_number"); + return page.sortRecords(baseMapper.selectListRel(param)); + } + + @Override + public DictionaryData getByIdRel(Integer dictDataId) { + DictionaryDataParam param = new DictionaryDataParam(); + param.setDictDataId(dictDataId); + return param.getOne(baseMapper.selectListRel(param)); + } + + @Override + public DictionaryData getByDictCodeAndName(String dictCode, String dictDataName) { + List list = baseMapper.getByDictCodeAndName(dictCode, dictDataName); + return CommonUtil.listGetOne(list); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/DictionaryServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/DictionaryServiceImpl.java new file mode 100644 index 0000000..74d6fe1 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/DictionaryServiceImpl.java @@ -0,0 +1,18 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.system.entity.Dictionary; +import com.gxwebsoft.common.system.mapper.DictionaryMapper; +import com.gxwebsoft.common.system.service.DictionaryService; +import org.springframework.stereotype.Service; + +/** + * 字典Service实现 + * + * @author WebSoft + * @since 2020-03-14 11:29:03 + */ +@Service +public class DictionaryServiceImpl extends ServiceImpl implements DictionaryService { + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/DomainServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/DomainServiceImpl.java new file mode 100644 index 0000000..8f4bcca --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/DomainServiceImpl.java @@ -0,0 +1,54 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.system.mapper.DomainMapper; +import com.gxwebsoft.common.system.service.DomainService; +import com.gxwebsoft.common.system.entity.Domain; +import com.gxwebsoft.common.system.param.DomainParam; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 授权域名Service实现 + * + * @author 科技小王子 + * @since 2024-09-19 23:56:33 + */ +@Service +public class DomainServiceImpl extends ServiceImpl implements DomainService { + + @Override + public PageResult pageRel(DomainParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(DomainParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public Domain getByIdRel(Integer id) { + DomainParam param = new DomainParam(); + param.setId(id); + return param.getOne(baseMapper.selectListRel(param)); + } + + @Override + public Domain getByDomainRel(String domain) { + DomainParam param = new DomainParam(); + param.setDomain(domain); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/EmailRecordServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/EmailRecordServiceImpl.java new file mode 100644 index 0000000..ec645c4 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/EmailRecordServiceImpl.java @@ -0,0 +1,87 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.system.entity.EmailRecord; +import com.gxwebsoft.common.system.mapper.EmailRecordMapper; +import com.gxwebsoft.common.system.service.EmailRecordService; +import org.beetl.core.Configuration; +import org.beetl.core.GroupTemplate; +import org.beetl.core.Template; +import org.beetl.core.resource.ClasspathResourceLoader; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.mail.SimpleMailMessage; +import org.springframework.mail.javamail.JavaMailSender; +import org.springframework.mail.javamail.MimeMessageHelper; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.mail.MessagingException; +import javax.mail.internet.MimeMessage; +import java.io.IOException; +import java.util.Map; + +/** + * 邮件发送记录Service实现 + * + * @author WebSoft + * @since 2019-06-19 04:07:54 + */ +@Service +public class EmailRecordServiceImpl extends ServiceImpl + implements EmailRecordService { + // 发件邮箱 + @Value("${spring.mail.username}") + private String formEmail; + @Resource + private JavaMailSender mailSender; + + @Override + public void sendTextEmail(String title, String content, String[] toEmails) { + SimpleMailMessage message = new SimpleMailMessage(); + message.setFrom(formEmail); + message.setTo(toEmails); + message.setSubject(title); + message.setText(content); + mailSender.send(message); + } + + @Override + public void sendFullTextEmail(String title, String html, String[] toEmails) throws MessagingException { + MimeMessage mimeMessage = mailSender.createMimeMessage(); + MimeMessageHelper helper = new MimeMessageHelper(mimeMessage, true); + helper.setFrom(formEmail); + helper.setTo(toEmails); + helper.setSubject(title); + // 发送邮件 + helper.setText(html, true); + mailSender.send(mimeMessage); + } + + @Override + public void sendHtmlEmail(String title, String path, Map map, String[] toEmails) + throws MessagingException, IOException { + ClasspathResourceLoader resourceLoader = new ClasspathResourceLoader("templates/"); + Configuration cfg = Configuration.defaultConfiguration(); + GroupTemplate gt = new GroupTemplate(resourceLoader, cfg); + Template t = gt.getTemplate(path); // 加载html模板 + t.binding(map); // 填充数据 + String html = t.render(); // 获得渲染后的html + sendFullTextEmail(title, html, toEmails); // 发送邮件 + } + + @Async + @Override + public void sendEmail(String title, String content, String receiver, Integer tenantId) { + // 发送邮件通知 + EmailRecord emailRecord = new EmailRecord(); + emailRecord.setTitle(title); + emailRecord.setContent(content); + emailRecord.setReceiver(receiver); + emailRecord.setCreateUserId(42); + emailRecord.setTenantId(tenantId); + sendTextEmail(title,content,receiver.split(",")); + save(emailRecord); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/EnvironmentServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/EnvironmentServiceImpl.java new file mode 100644 index 0000000..c4996a5 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/EnvironmentServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.system.mapper.EnvironmentMapper; +import com.gxwebsoft.common.system.service.EnvironmentService; +import com.gxwebsoft.common.system.entity.Environment; +import com.gxwebsoft.common.system.param.EnvironmentParam; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 环境管理Service实现 + * + * @author 科技小王子 + * @since 2023-10-18 08:45:13 + */ +@Service +public class EnvironmentServiceImpl extends ServiceImpl implements EnvironmentService { + + @Override + public PageResult pageRel(EnvironmentParam param) { + PageParam page = new PageParam<>(param); + //page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(EnvironmentParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + //page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public Environment getByIdRel(Integer id) { + EnvironmentParam param = new EnvironmentParam(); + param.setId(id); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/FileRecordServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/FileRecordServiceImpl.java new file mode 100644 index 0000000..39a6808 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/FileRecordServiceImpl.java @@ -0,0 +1,114 @@ +package com.gxwebsoft.common.system.service.impl; + +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; +import com.aliyun.oss.ClientException; +import com.aliyun.oss.OSS; +import com.aliyun.oss.OSSClientBuilder; +import com.aliyun.oss.OSSException; +import com.aliyun.oss.common.auth.CredentialsProvider; +import com.aliyun.oss.common.auth.DefaultCredentialProvider; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.core.utils.CommonUtil; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.Company; +import com.gxwebsoft.common.system.entity.FileRecord; +import com.gxwebsoft.common.system.mapper.FileRecordMapper; +import com.gxwebsoft.common.system.param.FileRecordParam; +import com.gxwebsoft.common.system.service.CompanyService; +import com.gxwebsoft.common.system.service.FileRecordService; +import com.gxwebsoft.common.system.service.SettingService; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.io.File; +import java.util.Arrays; +import java.util.List; + +/** + * 文件上传记录Service实现 + * + * @author WebSoft + * @since 2021-08-30 11:21:01 + */ +@Service +public class FileRecordServiceImpl extends ServiceImpl implements FileRecordService { + @Resource + private CompanyService companyService; + @Resource + private SettingService settingService; + + @Override + public PageResult pageRel(FileRecordParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + return new PageResult<>(baseMapper.selectPageRel(page, param), page.getTotal()); + } + + @Override + public List listRel(FileRecordParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + return page.sortRecords(baseMapper.selectListRel(param)); + } + + @Override + public FileRecord getByIdRel(Integer id) { + FileRecordParam param = new FileRecordParam(); + param.setId(id); + return param.getOne(baseMapper.selectListRel(param)); + } + + @Override + public FileRecord getByIdPath(String path) { + return CommonUtil.listGetOne(baseMapper.getByIdPath(path)); + } + + + @Async + @Override + public void deleteFileAsync(List files) { + for (File file : files) { + try { + file.delete(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + } + + @Override + public void deleteOssFileAsync(List fileRecords) { + // 读取云存储配置信息 + final FileRecord record = fileRecords.get(0); + System.out.println("record = " + record); + final JSONObject uploadConfig = settingService.getUploadConfig(record.getTenantId()); + String endpoint = uploadConfig.getString("bucketEndpoint"); + String bucketDomain = uploadConfig.getString("bucketDomain"); + String bucketName = uploadConfig.getString("bucketName"); + String accessKeyId = uploadConfig.getString("accessKeyId"); + String accessKeySecret = uploadConfig.getString("accessKeySecret"); + CredentialsProvider credentialsProvider = new DefaultCredentialProvider(accessKeyId, accessKeySecret); + OSS ossClient = new OSSClientBuilder().build(endpoint, credentialsProvider); + for (FileRecord fileRecord : fileRecords) { + fileRecord.setPath(StrUtil.replace(fileRecord.getPath(), bucketDomain.concat("/"), "")); + try { + // 删除远程文件 + ossClient.deleteObject(bucketName, fileRecord.getPath()); + // 释放空间大小 + if (fileRecord.getCompanyId() > 0) { + Company company = companyService.getById(fileRecord.getCompanyId()); + company.setStorage(company.getStorage() - fileRecord.getLength()); + companyService.updateById(company); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + } +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/LoginRecordServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/LoginRecordServiceImpl.java new file mode 100644 index 0000000..28497e7 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/LoginRecordServiceImpl.java @@ -0,0 +1,78 @@ +package com.gxwebsoft.common.system.service.impl; + +import cn.hutool.extra.servlet.ServletUtil; +import cn.hutool.http.useragent.UserAgent; +import cn.hutool.http.useragent.UserAgentUtil; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.LoginRecord; +import com.gxwebsoft.common.system.mapper.LoginRecordMapper; +import com.gxwebsoft.common.system.param.LoginRecordParam; +import com.gxwebsoft.common.system.service.LoginRecordService; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Service; + +import javax.servlet.http.HttpServletRequest; +import java.util.List; + +/** + * 登录日志Service实现 + * + * @author WebSoft + * @since 2018-12-24 16:10:14 + */ +@Service +public class LoginRecordServiceImpl extends ServiceImpl + implements LoginRecordService { + + @Override + public PageResult pageRel(LoginRecordParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + return new PageResult<>(baseMapper.selectPageRel(page, param), page.getTotal()); + } + + @Override + public List listRel(LoginRecordParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + return page.sortRecords(baseMapper.selectListRel(param)); + } + + @Override + public LoginRecord getByIdRel(Integer id) { + LoginRecordParam param = new LoginRecordParam(); + param.setId(id); + return param.getOne(baseMapper.selectListRel(param)); + } + + @Async + @Override + public void saveAsync(String username, Integer type, String comments, Integer tenantId, + HttpServletRequest request) { + if (username == null) { + return; + } + LoginRecord loginRecord = new LoginRecord(); + loginRecord.setUsername(username); + loginRecord.setLoginType(type); + loginRecord.setComments(comments); + loginRecord.setTenantId(tenantId); + UserAgent ua = UserAgentUtil.parse(ServletUtil.getHeaderIgnoreCase(request, "User-Agent")); + if (ua != null) { + if (ua.getPlatform() != null) { + loginRecord.setOs(ua.getPlatform().toString()); + } + if (ua.getOs() != null) { + loginRecord.setDevice(ua.getOs().toString()); + } + if (ua.getBrowser() != null) { + loginRecord.setBrowser(ua.getBrowser().toString()); + } + } + loginRecord.setIp(ServletUtil.getClientIP(request)); + baseMapper.insert(loginRecord); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/MenuServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/MenuServiceImpl.java new file mode 100644 index 0000000..726924f --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/MenuServiceImpl.java @@ -0,0 +1,245 @@ +package com.gxwebsoft.common.system.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.core.utils.CommonUtil; +import com.gxwebsoft.common.system.entity.*; +import com.gxwebsoft.common.system.mapper.MenuMapper; +import com.gxwebsoft.common.system.mapper.RoleMapper; +import com.gxwebsoft.common.system.param.MenuParam; +import com.gxwebsoft.common.system.param.RoleParam; +import com.gxwebsoft.common.system.service.*; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Isolation; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 菜单Service实现 + * + * @author WebSoft + * @since 2018-12-24 16:10:10 + */ +@Service +public class MenuServiceImpl extends ServiceImpl implements MenuService { + private Integer plugMenuId; + @Resource + private RoleService roleService; + @Resource + private RoleMenuService roleMenuService; + @Resource + private UserService userService; + @Resource + private UserRoleService userRoleService; + + @Override + @Transactional(rollbackFor = {Exception.class}, isolation = Isolation.SERIALIZABLE) + public Boolean cloneMenu(MenuParam param) { + System.out.println("准备待克隆的菜单数据 = " + param); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(Menu::getDeleted,0); + if(ObjectUtil.isNotEmpty(param.getMenuId())) { + wrapper.eq(Menu::getMenuId,param.getMenuId()); + } + // 删除本项目菜单 + baseMapper.delete(wrapper); + // 顶级栏目 + param.setParentId(0); + // 工单系统 + if (param.getTenantId().equals(10125)) { + // 初始化数据 + initializedData(); + } + // 开始克隆 + doCloneMenu(baseMapper.getMenuByClone(param)); + return true; + } + + @Override + @Transactional(rollbackFor = {Exception.class}, isolation = Isolation.SERIALIZABLE) + public Boolean install(Integer id) { + // 1.插件绑定的菜单ID + final MenuParam param = new MenuParam(); + param.setMenuId(id); + final List list = baseMapper.getMenuByClone(param); + // TODO 克隆当前插件到顶级菜单 + doCloneMenu(list); + + // 2.查找当前租户的超管权限的roleId + final Role superAdmin = roleService.getOne(new LambdaQueryWrapper().eq(Role::getRoleCode, "superAdmin")); + final Integer roleId = superAdmin.getRoleId(); + final Integer tenantId = superAdmin.getTenantId(); + // 3.勾选菜单根权限 + final RoleMenu roleMenu0 = new RoleMenu(); + roleMenu0.setRoleId(roleId); + roleMenu0.setMenuId(this.plugMenuId); + roleMenuService.save(roleMenu0); + + // 4.勾选根节点下的子菜单权限 + final MenuParam menuParam = new MenuParam(); + menuParam.setParentId(this.plugMenuId); + menuParam.setTenantId(tenantId); + final List menuList = baseMapper.getMenuByClone(menuParam); + menuList.forEach(d->{ + RoleMenu roleMenu = new RoleMenu(); + roleMenu.setRoleId(roleId); + roleMenu.setMenuId(d.getMenuId()); + roleMenuService.save(roleMenu); + }); + // 5.调整新插件的排序 + final Menu menu = baseMapper.selectById(this.plugMenuId); + menu.setSortNumber(100); + baseMapper.updateById(menu); + return true; + } + + // 克隆菜单 + private void doCloneMenu(List list) { + final MenuParam param = new MenuParam(); + list.forEach(d -> { + Menu menu = new Menu(); + menu.setParentId(0); + menu.setTitle(d.getTitle()); + menu.setPath(d.getPath()); + menu.setComponent(d.getComponent()); + menu.setMenuType(d.getMenuType()); + menu.setSortNumber(d.getSortNumber()); + menu.setAuthority(d.getAuthority()); + menu.setIcon(d.getIcon()); + menu.setHide(d.getHide()); + menu.setMeta(d.getMeta()); + menu.setModules(d.getModules()); + menu.setModulesUrl(d.getModulesUrl()); + save(menu); + this.plugMenuId = menu.getMenuId(); + // 二级菜单 + param.setParentId(d.getMenuId()); + final List list1 = baseMapper.getMenuByClone(param); + list1.forEach(d1 -> { + final Menu menu1 = new Menu(); + menu1.setParentId(menu.getMenuId()); + menu1.setTitle(d1.getTitle()); + menu1.setPath(d1.getPath()); + menu1.setComponent(d1.getComponent()); + menu1.setMenuType(d1.getMenuType()); + menu1.setSortNumber(d1.getSortNumber()); + menu1.setAuthority(d1.getAuthority()); + menu1.setIcon(d1.getIcon()); + menu1.setHide(d1.getHide()); + menu1.setMeta(d1.getMeta()); + menu1.setModules(d1.getModules()); + menu1.setModulesUrl(d1.getModulesUrl()); + save(menu1); + // 三级菜单 + param.setParentId(d1.getMenuId()); + final List list2 = baseMapper.getMenuByClone(param); + list2.forEach(d2 -> { + final Menu menu2 = new Menu(); + menu2.setParentId(menu1.getMenuId()); + menu2.setTitle(d2.getTitle()); + menu2.setPath(d2.getPath()); + menu2.setComponent(d2.getComponent()); + menu2.setMenuType(d2.getMenuType()); + menu2.setSortNumber(d2.getSortNumber()); + menu2.setAuthority(d2.getAuthority()); + menu2.setIcon(d2.getIcon()); + menu2.setHide(d2.getHide()); + menu2.setMeta(d2.getMeta()); + menu2.setModules(d2.getModules()); + menu2.setModulesUrl(d2.getModulesUrl()); + save(menu2); + // 四级菜单 + param.setParentId(d2.getMenuId()); + final List list3 = baseMapper.getMenuByClone(param); + list3.forEach(d3 -> { + final Menu menu3 = new Menu(); + menu3.setParentId(menu2.getMenuId()); + menu3.setTitle(d3.getTitle()); + menu3.setPath(d3.getPath()); + menu3.setComponent(d3.getComponent()); + menu3.setMenuType(d3.getMenuType()); + menu3.setSortNumber(d3.getSortNumber()); + menu3.setAuthority(d3.getAuthority()); + menu3.setIcon(d3.getIcon()); + menu3.setHide(d3.getHide()); + menu3.setMeta(d3.getMeta()); + menu3.setModules(d3.getModules()); + menu3.setModulesUrl(d3.getModulesUrl()); + save(menu3); + }); + }); + }); + }); + } + + // 初始化数据 + private void initializedData(){ + Role role = new Role(); + User user = new User(); + UserRole userRole = new UserRole(); + if(roleService.count(new LambdaQueryWrapper().eq(Role::getRoleCode, "admin")) == 0){ + role.setRoleCode("admin"); + role.setRoleName("管理人员"); + role.setComments("工单分派管理专员"); + roleService.save(role); + if(userService.count(new LambdaQueryWrapper().eq(User::getUsername, "管理人员")) == 0){ + user.setUsername("刘备"); + user.setNickname("刘备"); + user.setPhone("13800138001"); + user.setPassword(userService.encodePassword("123456")); + user.setSex("1"); + userService.save(user); + // 添加用户角色 + userRole.setRoleId(role.getRoleId()); + userRole.setUserId(user.getUserId()); + userRoleService.save(userRole); + // 添加统计表 + + } + } + if(roleService.count(new LambdaQueryWrapper().eq(Role::getRoleCode, "commander")) == 0){ + role.setRoleCode("commander"); + role.setRoleName("受理人员"); + role.setComments("负责解决问题的处理人员"); + roleService.save(role); + if(userService.count(new LambdaQueryWrapper().eq(User::getUsername, "commander")) == 0){ + user.setUsername("关羽"); + user.setNickname("关羽"); + user.setPhone("13800138002"); + user.setPassword(userService.encodePassword("123456")); + user.setSex("1"); + userService.save(user); + // 添加用户角色 + userRole.setRoleId(role.getRoleId()); + userRole.setUserId(user.getUserId()); + userRoleService.save(userRole); + } + } + if(roleService.count(new LambdaQueryWrapper().eq(Role::getRoleCode, "promoter")) == 0){ + role.setRoleCode("promoter"); + role.setRoleName("工单发起人"); + role.setComments("问题及需求的发起人"); + roleService.save(role); + if(userService.count(new LambdaQueryWrapper().eq(User::getUsername, "promoter")) == 0){ + user.setUsername("张飞"); + user.setNickname("张飞"); + user.setPassword(userService.encodePassword("123456")); + user.setSex("1"); + userService.save(user); + // 添加用户角色 + userRole.setRoleId(role.getRoleId()); + userRole.setUserId(user.getUserId()); + userRoleService.save(userRole); + } + } + } + + @Override + public List getMenuByClone(MenuParam param) { + return baseMapper.getMenuByClone(param); + } +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/MerchantAccountServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/MerchantAccountServiceImpl.java new file mode 100644 index 0000000..b867e49 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/MerchantAccountServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.MerchantAccount; +import com.gxwebsoft.common.system.mapper.MerchantAccountMapper; +import com.gxwebsoft.common.system.param.MerchantAccountParam; +import com.gxwebsoft.common.system.service.MerchantAccountService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 商户账号Service实现 + * + * @author 科技小王子 + * @since 2024-04-19 12:02:24 + */ +@Service +public class MerchantAccountServiceImpl extends ServiceImpl implements MerchantAccountService { + + @Override + public PageResult pageRel(MerchantAccountParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("sort_number asc, create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(MerchantAccountParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + page.setDefaultOrder("sort_number asc, create_time desc"); + return page.sortRecords(list); + } + + @Override + public MerchantAccount getByIdRel(Integer id) { + MerchantAccountParam param = new MerchantAccountParam(); + param.setId(id); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/MerchantApplyServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/MerchantApplyServiceImpl.java new file mode 100644 index 0000000..ee77354 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/MerchantApplyServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.MerchantApply; +import com.gxwebsoft.common.system.mapper.MerchantApplyMapper; +import com.gxwebsoft.common.system.param.MerchantApplyParam; +import com.gxwebsoft.common.system.service.MerchantApplyService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 商户入驻申请Service实现 + * + * @author 科技小王子 + * @since 2024-04-05 01:24:36 + */ +@Service +public class MerchantApplyServiceImpl extends ServiceImpl implements MerchantApplyService { + + @Override + public PageResult pageRel(MerchantApplyParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("sort_number asc, create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(MerchantApplyParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + page.setDefaultOrder("sort_number asc, create_time desc"); + return page.sortRecords(list); + } + + @Override + public MerchantApply getByIdRel(Integer applyId) { + MerchantApplyParam param = new MerchantApplyParam(); + param.setApplyId(applyId); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/MerchantServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/MerchantServiceImpl.java new file mode 100644 index 0000000..1511e90 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/MerchantServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.Merchant; +import com.gxwebsoft.common.system.mapper.MerchantMapper; +import com.gxwebsoft.common.system.param.MerchantParam; +import com.gxwebsoft.common.system.service.MerchantService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 商户Service实现 + * + * @author 科技小王子 + * @since 2024-04-05 00:03:54 + */ +@Service +public class MerchantServiceImpl extends ServiceImpl implements MerchantService { + + @Override + public PageResult pageRel(MerchantParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("sort_number asc, create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(MerchantParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + page.setDefaultOrder("sort_number asc, create_time desc"); + return page.sortRecords(list); + } + + @Override + public Merchant getByIdRel(Long merchantId) { + MerchantParam param = new MerchantParam(); + param.setMerchantId(merchantId); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/MerchantTypeServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/MerchantTypeServiceImpl.java new file mode 100644 index 0000000..ef57df7 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/MerchantTypeServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.MerchantType; +import com.gxwebsoft.common.system.mapper.MerchantTypeMapper; +import com.gxwebsoft.common.system.param.MerchantTypeParam; +import com.gxwebsoft.common.system.service.MerchantTypeService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 商户类型Service实现 + * + * @author 科技小王子 + * @since 2024-04-05 00:08:51 + */ +@Service +public class MerchantTypeServiceImpl extends ServiceImpl implements MerchantTypeService { + + @Override + public PageResult pageRel(MerchantTypeParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("sort_number asc, create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(MerchantTypeParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + page.setDefaultOrder("sort_number asc, create_time desc"); + return page.sortRecords(list); + } + + @Override + public MerchantType getByIdRel(Integer id) { + MerchantTypeParam param = new MerchantTypeParam(); + param.setId(id); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/ModulesServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/ModulesServiceImpl.java new file mode 100644 index 0000000..37e1b44 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/ModulesServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.system.mapper.ModulesMapper; +import com.gxwebsoft.common.system.service.ModulesService; +import com.gxwebsoft.common.system.entity.Modules; +import com.gxwebsoft.common.system.param.ModulesParam; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 模块管理Service实现 + * + * @author 科技小王子 + * @since 2023-10-18 15:53:43 + */ +@Service +public class ModulesServiceImpl extends ServiceImpl implements ModulesService { + + @Override + public PageResult pageRel(ModulesParam param) { + PageParam page = new PageParam<>(param); + //page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(ModulesParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + //page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public Modules getByIdRel(Integer id) { + ModulesParam param = new ModulesParam(); + param.setId(id); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/NoticeServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/NoticeServiceImpl.java new file mode 100644 index 0000000..b4b534c --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/NoticeServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.system.mapper.NoticeMapper; +import com.gxwebsoft.common.system.service.NoticeService; +import com.gxwebsoft.common.system.entity.Notice; +import com.gxwebsoft.common.system.param.NoticeParam; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 消息记录表Service实现 + * + * @author 科技小王子 + * @since 2023-10-08 13:22:21 + */ +@Service +public class NoticeServiceImpl extends ServiceImpl implements NoticeService { + + @Override + public PageResult pageRel(NoticeParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(NoticeParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public Notice getByIdRel(Integer noticeId) { + NoticeParam param = new NoticeParam(); + param.setNoticeId(noticeId); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/OperationRecordServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/OperationRecordServiceImpl.java new file mode 100644 index 0000000..8095bf4 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/OperationRecordServiceImpl.java @@ -0,0 +1,52 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.OperationRecord; +import com.gxwebsoft.common.system.mapper.OperationRecordMapper; +import com.gxwebsoft.common.system.param.OperationRecordParam; +import com.gxwebsoft.common.system.service.OperationRecordService; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 操作日志Service实现 + * + * @author WebSoft + * @since 2018-12-24 16:10:02 + */ +@Service +public class OperationRecordServiceImpl extends ServiceImpl + implements OperationRecordService { + + @Override + public PageResult pageRel(OperationRecordParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + return new PageResult<>(baseMapper.selectPageRel(page, param), page.getTotal()); + } + + @Override + public List listRel(OperationRecordParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + return page.sortRecords(baseMapper.selectListRel(param)); + } + + @Override + public OperationRecord getByIdRel(Integer id) { + OperationRecordParam param = new OperationRecordParam(); + param.setId(id); + return param.getOne(baseMapper.selectListRel(param)); + } + + @Async + @Override + public void saveAsync(OperationRecord operationRecord) { + baseMapper.insert(operationRecord); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/OrderGoodsServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/OrderGoodsServiceImpl.java new file mode 100644 index 0000000..a3c26dd --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/OrderGoodsServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.OrderGoods; +import com.gxwebsoft.common.system.mapper.OrderGoodsMapper; +import com.gxwebsoft.common.system.param.OrderGoodsParam; +import com.gxwebsoft.common.system.service.OrderGoodsService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 订单商品Service实现 + * + * @author 科技小王子 + * @since 2024-10-26 12:18:05 + */ +@Service +public class OrderGoodsServiceImpl extends ServiceImpl implements OrderGoodsService { + + @Override + public PageResult pageRel(OrderGoodsParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(OrderGoodsParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public OrderGoods getByIdRel(Integer id) { + OrderGoodsParam param = new OrderGoodsParam(); + param.setId(id); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/OrderInfoServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/OrderInfoServiceImpl.java new file mode 100644 index 0000000..fd065f9 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/OrderInfoServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.system.mapper.OrderInfoMapper; +import com.gxwebsoft.common.system.service.OrderInfoService; +import com.gxwebsoft.common.system.entity.OrderInfo; +import com.gxwebsoft.common.system.param.OrderInfoParam; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * Service实现 + * + * @author 科技小王子 + * @since 2024-05-10 18:02:54 + */ +@Service +public class OrderInfoServiceImpl extends ServiceImpl implements OrderInfoService { + + @Override + public PageResult pageRel(OrderInfoParam param) { + PageParam page = new PageParam<>(param); + //page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(OrderInfoParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + //page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public OrderInfo getByIdRel(Integer id) { + OrderInfoParam param = new OrderInfoParam(); + param.setId(id); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/OrderServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/OrderServiceImpl.java new file mode 100644 index 0000000..60b66da --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/OrderServiceImpl.java @@ -0,0 +1,105 @@ +package com.gxwebsoft.common.system.service.impl; + +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.Company; +import com.gxwebsoft.common.system.entity.Order; +import com.gxwebsoft.common.system.entity.OrderGoods; +import com.gxwebsoft.common.system.mapper.OrderMapper; +import com.gxwebsoft.common.system.param.OrderParam; +import com.gxwebsoft.common.system.service.CompanyService; +import com.gxwebsoft.common.system.service.MenuService; +import com.gxwebsoft.common.system.service.OrderGoodsService; +import com.gxwebsoft.common.system.service.OrderService; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 订单Service实现 + * + * @author 科技小王子 + * @since 2024-10-16 12:32:52 + */ +@Service +public class OrderServiceImpl extends ServiceImpl implements OrderService { + @Resource + private MenuService menuService; + @Resource + private OrderGoodsService orderGoodsService; + @Resource + private CompanyService companyService; + + @Override + public PageResult pageRel(OrderParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + if (param.getSceneType() != null && ObjectUtil.isNotEmpty(param.getSceneType().equals("showOrderGoods"))) { + list.forEach(d -> { + d.setOrderGoods(orderGoodsService.list(new LambdaQueryWrapper().eq(OrderGoods::getOrderId, d.getOrderId()))); + }); + } + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(OrderParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public Order getByIdRel(Integer orderId) { + OrderParam param = new OrderParam(); + param.setOrderId(orderId); + return param.getOne(baseMapper.selectListRel(param)); + } + + @Override + public void paySuccess(Order order) { + System.out.println("order = " + order); + // 安装插件 + menuService.cloneMenu(order.getMenuParam()); + order.setPayStatus(true); + // 实际支付金额 + if (order.getPayType().equals(0)) { + order.setPayPrice(order.getPayPrice()); + } + order.setPayTime(DateUtil.date()); + order.setStartTime(System.currentTimeMillis()); + order.setExpirationTime(DateUtil.offsetMonth(DateUtil.date(), order.getMonth())); + updateById(order); +// orderGoodsService.update(new LambdaUpdateWrapper().eq(OrderGoods::getOrderId, order.getOrderId()) +// .set(OrderGoods::getPayStatus, 1) +// .set(OrderGoods::getPayTime, DateUtil.date()) +// .set(OrderGoods::getExpirationTime, DateUtil.offsetMonth(DateUtil.date(), order.getMonth())) +// ); + + final List list = orderGoodsService.list(new LambdaQueryWrapper().eq(OrderGoods::getOrderId, order.getOrderId())); + if (!CollectionUtils.isEmpty(list)) { + list.forEach(d -> { + d.setPayStatus(true); + d.setPayTime(DateUtil.date()); + d.setExpirationTime(DateUtil.offsetMonth(DateUtil.date(), order.getMonth())); + }); + // 更新订单商品状态 + orderGoodsService.updateBatchById(list); + // 累计销量 + Company company = companyService.getById(list.get(0).getItemId()); + company.setBuys(company.getBuys() + list.size()); + System.out.println("company = " + company); + companyService.updateById(company); + } + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/OrganizationServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/OrganizationServiceImpl.java new file mode 100644 index 0000000..b2bb53f --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/OrganizationServiceImpl.java @@ -0,0 +1,45 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.Organization; +import com.gxwebsoft.common.system.mapper.OrganizationMapper; +import com.gxwebsoft.common.system.param.OrganizationParam; +import com.gxwebsoft.common.system.service.OrganizationService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 组织机构Service实现 + * + * @author WebSoft + * @since 2020-03-14 11:29:04 + */ +@Service +public class OrganizationServiceImpl extends ServiceImpl + implements OrganizationService { + + @Override + public PageResult pageRel(OrganizationParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("sort_number"); + return new PageResult<>(baseMapper.selectPageRel(page, param), page.getTotal()); + } + + @Override + public List listRel(OrganizationParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("sort_number"); + return page.sortRecords(baseMapper.selectListRel(param)); + } + + @Override + public Organization getByIdRel(Integer organizationId) { + OrganizationParam param = new OrganizationParam(); + param.setOrganizationId(organizationId); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/PaymentServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/PaymentServiceImpl.java new file mode 100644 index 0000000..2ab34b2 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/PaymentServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.system.mapper.PaymentMapper; +import com.gxwebsoft.common.system.service.PaymentService; +import com.gxwebsoft.common.system.entity.Payment; +import com.gxwebsoft.common.system.param.PaymentParam; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 支付方式Service实现 + * + * @author 科技小王子 + * @since 2024-05-11 12:39:11 + */ +@Service +public class PaymentServiceImpl extends ServiceImpl implements PaymentService { + + @Override + public PageResult pageRel(PaymentParam param) { + PageParam page = new PageParam<>(param); + //page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(PaymentParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + //page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public Payment getByIdRel(Integer id) { + PaymentParam param = new PaymentParam(); + param.setId(id); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/PlugServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/PlugServiceImpl.java new file mode 100644 index 0000000..f70e8ff --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/PlugServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.system.mapper.PlugMapper; +import com.gxwebsoft.common.system.service.PlugService; +import com.gxwebsoft.common.system.entity.Plug; +import com.gxwebsoft.common.system.param.PlugParam; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 插件扩展Service实现 + * + * @author 科技小王子 + * @since 2023-10-12 09:53:07 + */ +@Service +public class PlugServiceImpl extends ServiceImpl implements PlugService { + + @Override + public PageResult pageRel(PlugParam param) { + PageParam page = new PageParam<>(param); + //page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(PlugParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + //page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public Plug getByIdRel(Integer plugId) { + PlugParam param = new PlugParam(); + param.setPlugId(plugId); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/RechargeOrderServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/RechargeOrderServiceImpl.java new file mode 100644 index 0000000..c4d2c64 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/RechargeOrderServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.RechargeOrder; +import com.gxwebsoft.common.system.mapper.RechargeOrderMapper; +import com.gxwebsoft.common.system.param.RechargeOrderParam; +import com.gxwebsoft.common.system.service.RechargeOrderService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 会员充值订单表Service实现 + * + * @author 科技小王子 + * @since 2024-07-26 23:18:48 + */ +@Service +public class RechargeOrderServiceImpl extends ServiceImpl implements RechargeOrderService { + + @Override + public PageResult pageRel(RechargeOrderParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("sort_number asc, create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(RechargeOrderParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + page.setDefaultOrder("sort_number asc, create_time desc"); + return page.sortRecords(list); + } + + @Override + public RechargeOrder getByIdRel(Integer orderId) { + RechargeOrderParam param = new RechargeOrderParam(); + param.setOrderId(orderId); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/RoleMenuServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/RoleMenuServiceImpl.java new file mode 100644 index 0000000..737c5e3 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/RoleMenuServiceImpl.java @@ -0,0 +1,31 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.system.entity.Menu; +import com.gxwebsoft.common.system.entity.RoleMenu; +import com.gxwebsoft.common.system.mapper.RoleMenuMapper; +import com.gxwebsoft.common.system.service.RoleMenuService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 角色菜单Service实现 + * + * @author WebSoft + * @since 2018-12-24 16:10:12 + */ +@Service +public class RoleMenuServiceImpl extends ServiceImpl implements RoleMenuService { + + @Override + public List listMenuByUserId(Integer userId, Integer menuType) { + return baseMapper.listMenuByUserId(userId, menuType); + } + + @Override + public List listMenuByRoleIds(List roleIds, Integer menuType) { + return baseMapper.listMenuByRoleIds(roleIds, menuType); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/RoleServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/RoleServiceImpl.java new file mode 100644 index 0000000..aa163a7 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/RoleServiceImpl.java @@ -0,0 +1,26 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.system.entity.Role; +import com.gxwebsoft.common.system.mapper.RoleMapper; +import com.gxwebsoft.common.system.param.RoleParam; +import com.gxwebsoft.common.system.service.RoleService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 角色服务实现类 + * + * @author WebSoft + * @since 2018-12-24 16:10:11 + */ +@Service +public class RoleServiceImpl extends ServiceImpl implements RoleService { + + @Override + public Role getByRoleCode(RoleParam roleParam) { + final List roleList = baseMapper.selectListAll(roleParam); + return roleList.get(0); + } +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/SettingServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/SettingServiceImpl.java new file mode 100644 index 0000000..ac8455c --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/SettingServiceImpl.java @@ -0,0 +1,188 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.core.config.ConfigProperties; +import com.gxwebsoft.common.core.exception.BusinessException; +import com.gxwebsoft.common.core.utils.JSONUtil; +import com.gxwebsoft.common.core.utils.RedisUtil; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.Setting; +import com.gxwebsoft.common.system.mapper.SettingMapper; +import com.gxwebsoft.common.system.param.SettingParam; +import com.gxwebsoft.common.system.service.SettingService; +import com.wechat.pay.java.core.Config; +import com.wechat.pay.java.core.RSAConfig; +import com.wechat.pay.java.service.payments.jsapi.JsapiService; +import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 系统设置Service实现 + * + * @author WebSoft + * @since 2022-11-19 13:54:27 + */ +@Service +public class SettingServiceImpl extends ServiceImpl implements SettingService { + // 本地缓存 + public static Map configMap = new HashMap<>(); + public static JsapiService service = null; + public static Config config = null; + @Resource + private ConfigProperties pathConfig; + @Resource + private StringRedisTemplate stringRedisTemplate; + @Resource + private RedisUtil redisUtil; + + @Override + public PageResult pageRel(SettingParam param) { + PageParam page = new PageParam<>(param); + //page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(SettingParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + //page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public Setting getByIdRel(Integer settingId) { + SettingParam param = new SettingParam(); + param.setSettingId(settingId); + return param.getOne(baseMapper.selectListRel(param)); + } + + @Override + public JSONObject getBySettingKey(String key) { + Setting setting = this.getOne(new QueryWrapper().eq("setting_key", key), false); + if(setting == null){ + if ("mp-weixin".equals(key)) { + throw new BusinessException("小程序未配置"); + } + if ("payment".equals(key)) { + throw new BusinessException("支付未配置"); + } + if ("sms".equals(key)) { + throw new BusinessException("短信未配置"); + } + if ("wx-work".equals(key)){ + throw new BusinessException("企业微信未配置"); + } + if ("setting".equals(key)) { + throw new BusinessException("基本信息未配置"); + } + if ("wx-official".equals(key)) { + throw new BusinessException("微信公众号未配置"); + } + if ("printer".equals(key)) { + throw new BusinessException("打印机未配置"); + } + return new JSONObject(); + } + return JSON.parseObject(setting.getContent()); + } + + @Override + public Setting getData(String settingKey) { + return query().eq("setting_key", settingKey).one(); + } + + @Override + public JSONObject getCache(String key) { + final String cache = stringRedisTemplate.opsForValue().get(key); + final JSONObject jsonObject = JSONObject.parseObject(cache); + if(jsonObject == null){ + throw new BusinessException("域名未配置"); + } + return jsonObject; + } + + @Override + public void initConfig(Setting data) { + if (data.getSettingKey().equals("payment")) { + final JSONObject jsonObject = JSONObject.parseObject(data.getContent()); + final String mchId = jsonObject.getString("mchId"); + final String apiclientKey = jsonObject.getString("apiclientKey"); + // 修改路径拼接规则:uploadPath + "file" + 数据库存储的相对路径 + final String privateKey = pathConfig.getUploadPath() + "file" + apiclientKey; + final String apiclientCert = pathConfig.getUploadPath() + "file" + jsonObject.getString("apiclientCert"); + final String merchantSerialNumber = jsonObject.getString("merchantSerialNumber"); + final String apiV3key = jsonObject.getString("wechatApiKey"); + if(config == null){ +// config = new RSAAutoCertificateConfig.Builder() +// .merchantId(mchId) +// .privateKeyFromPath("/Users/gxwebsoft/Documents/uploads/file/20230622/fb193d3bfff0467b83dc498435a4f433.pem") +// .merchantSerialNumber(merchantSerialNumber) +// .apiV3Key(apiV3key) +// .build(); + config = + new RSAConfig.Builder() + .merchantId("1246610101") + .privateKeyFromPath("/Users/gxwebsoft/Documents/uploads/file/20230622/fb193d3bfff0467b83dc498435a4f433.pem") + .merchantSerialNumber("2903B872D5CA36E525FAEC37AEDB22E54ECDE7B7") + .wechatPayCertificatesFromPath("/Users/gxwebsoft/Documents/uploads/file/20230622/23329e924dae41af9b716825626dd44b.pem") + .build(); + configMap.put(data.getTenantId().toString(),config); + System.out.println("config = " + config); + } + if (service == null) { + service = new JsapiService.Builder().config(config).build(); + } + } + } + + @Override + public Config getConfig(Integer tenantId) { + if(configMap.get(tenantId.toString()) == null){ + final Setting payment = getOne(new LambdaQueryWrapper().eq(Setting::getSettingKey, "payment")); + this.initConfig(payment); + return configMap.get(tenantId.toString()); + } + return configMap.get(tenantId.toString()); + } + + @Override + public JSONObject getUploadConfig(Integer tenantId) { + // 读取配置信息 + JSONObject settingInfo; + String key3 = "Upload:" + tenantId; + settingInfo = redisUtil.get(key3, JSONObject.class); + if (settingInfo == null) { + settingInfo = getBySettingKey("upload"); + if(settingInfo == null){ + return null; + } + redisUtil.set(key3,settingInfo); + } +// String endpoint = settingInfo.getString("bucketEndpoint"); +// String bucketDomain = settingInfo.getString("bucketDomain"); +// String bucketName = settingInfo.getString("bucketName"); +// String accessKeyId = settingInfo.getString("accessKeyId"); +// String accessKeySecret = settingInfo.getString("accessKeySecret"); + return settingInfo; + } + + @Override + public boolean updateByKey(Setting setting) { + return update(setting, new QueryWrapper().eq("setting_key", setting.getSettingKey())); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/SysFileTypeServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/SysFileTypeServiceImpl.java new file mode 100644 index 0000000..6724f17 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/SysFileTypeServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.SysFileType; +import com.gxwebsoft.common.system.mapper.SysFileTypeMapper; +import com.gxwebsoft.common.system.param.SysFileTypeParam; +import com.gxwebsoft.common.system.service.SysFileTypeService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 存储类型Service实现 + * + * @author 科技小王子 + * @since 2025-05-16 14:24:28 + */ +@Service +public class SysFileTypeServiceImpl extends ServiceImpl implements SysFileTypeService { + + @Override + public PageResult pageRel(SysFileTypeParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("sort_number asc, create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(SysFileTypeParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + page.setDefaultOrder("sort_number asc, create_time desc"); + return page.sortRecords(list); + } + + @Override + public SysFileType getByIdRel(Integer id) { + SysFileTypeParam param = new SysFileTypeParam(); + param.setId(id); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/TenantPackageServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/TenantPackageServiceImpl.java new file mode 100644 index 0000000..d89f1f9 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/TenantPackageServiceImpl.java @@ -0,0 +1,29 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.system.entity.TenantPackage; +import com.gxwebsoft.common.system.mapper.TenantPackageMapper; +import com.gxwebsoft.common.system.service.TenantPackageService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 租户套餐ServiceImpl + * + * @author WebSoft + * @since 2025-12-12 + */ +@Service +public class TenantPackageServiceImpl extends ServiceImpl implements TenantPackageService { + + @Override + public List listAvailablePackages() { + return baseMapper.selectAvailablePackages(); + } + + @Override + public TenantPackage getByVersion(Integer version) { + return baseMapper.selectByVersion(version); + } +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/TenantServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/TenantServiceImpl.java new file mode 100644 index 0000000..ba23291 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/TenantServiceImpl.java @@ -0,0 +1,634 @@ +package com.gxwebsoft.common.system.service.impl; + +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.core.utils.CommonUtil; +import com.gxwebsoft.common.core.utils.DomainUtil; +import com.gxwebsoft.common.core.utils.RedisUtil; +import com.gxwebsoft.common.system.entity.*; +import com.gxwebsoft.common.system.mapper.TenantMapper; +import com.gxwebsoft.common.system.param.MenuParam; +import com.gxwebsoft.common.system.service.*; +import com.gxwebsoft.common.system.param.TenantParam; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 租户Service实现 + * + * @author 科技小王子 + * @since 2023-07-17 17:49:53 + */ +@Service +public class TenantServiceImpl extends ServiceImpl implements TenantService { + + @Resource + private CompanyService companyService; + @Resource + private MenuService menuService; + @Resource + private RoleService roleService; + @Resource + private UserRoleService userRoleService; + @Resource + private DictService dictService; + @Resource + private DictDataService dictDataService; + @Resource + private EmailRecordService emailRecordService; + @Resource + private UserService userService; + @Resource + private RedisUtil redisUtil; + + @Override + public PageResult pageRel(TenantParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("sort_number asc, create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(TenantParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + //page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public Tenant getByIdRel(Integer tenantId) { + TenantParam param = new TenantParam(); + return param.getOne(baseMapper.selectListRel(param)); + } + + @Override + public Company initialization(Company company) { + // 添加默认字典 + Dict dict = new Dict(); + dict.setDictName("性别"); + dict.setDictCode("sex"); + dict.setTenantId(company.getTid()); + dictService.save(dict); + DictData dictData = new DictData(); + dictData.setDictId(dict.getDictId()); + dictData.setDictDataName("男"); + dictData.setDictDataCode("1"); + dictData.setSortNumber(100); + dictData.setTenantId(company.getTid()); + dictDataService.save(dictData); + dictData.setDictDataName("女"); + dictData.setDictDataCode("2"); + dictData.setTenantId(company.getTid()); + dictDataService.save(dictData); + dict.setDictName("机构类型"); + dict.setDictCode("organizationType"); + dict.setTenantId(company.getTid()); + dictService.save(dict); + dictData.setDictId(dict.getDictId()); + dictData.setDictDataName("公司"); + dictData.setDictDataCode("1"); + dictData.setTenantId(company.getTid()); + dictDataService.save(dictData); + dictData.setDictId(dict.getDictId()); + dictData.setDictDataName("部门"); + dictData.setDictDataCode("2"); + dictData.setTenantId(company.getTid()); + dictDataService.save(dictData); + + // 添加超级管理员 + User superAdmin = new User(); + superAdmin.setUsername("superAdmin"); + superAdmin.setNickname(company.getShortName()); + superAdmin.setPhone(company.getPhone()); + superAdmin.setEmail(company.getEmail()); + superAdmin.setTemplateId(company.getTemplateId()); + superAdmin.setIsAdmin(true); + superAdmin.setRealName(company.getBusinessEntity()); + superAdmin.setPassword(userService.encodePassword("$2a$10$iMsEmh.rPlzwy/SVe6KW3.62vlwqMJpibhCF9jYN.fMqxdqymzMzu")); + if (company.getPassword() != null) { + superAdmin.setPassword(userService.encodePassword(company.getPassword())); + } + superAdmin.setTenantId(company.getTid()); + if(company.getTemplateId() != null){ + superAdmin.setTemplateId(company.getTemplateId()); + } + // 企业资源配置 + company.setTenantId(company.getTid()); + company.setShortName(company.getShortName()); + company.setPhone(company.getPhone()); + company.setMembers(20); + company.setServerUrl("https://server.websoft.top"); + company.setModulesUrl("https://cms-api.websoft.top"); + company.setSocketUrl("wss://server.gxwebsoft.com"); + company.setAdminUrl(DomainUtil.getAdminUrl(company.getTid().toString())); + company.setWebsiteUrl(DomainUtil.getSiteUrl(company.getTid().toString())); + company.setVersion(10); + company.setIndustryParent(""); + company.setIndustryChild(""); + company.setDepartments(10); + company.setDepartments(10); + company.setStorageMax(524288000L); + company.setAuthoritative(true); + company.setUsers(2); + company.setClicks(1L); + company.setLikes(0L); + company.setTid(company.getTid()); + company.setCompanyType("企业"); + company.setEmail(company.getEmail()); + company.setUserId(superAdmin.getUserId()); + company.setExpirationTime(DateUtil.nextMonth()); + + final boolean save = companyService.save(company); + superAdmin.setCompanyId(company.getCompanyId()); + + boolean result = userService.save(superAdmin); + Integer superAdminUserId = superAdmin.getUserId(); + + // 创建角色 + if (result) { + Role role = new Role(); + role.setRoleName("超级管理员"); + role.setRoleCode("superAdmin"); + role.setComments("超级管理员"); + role.setTenantId(company.getTid()); + roleService.save(role); + + // 保存超级管理员角色ID + Integer superAdminRoleId = role.getRoleId(); + role.setRoleName("管理员"); + role.setRoleCode("admin"); + role.setComments("管理员"); + roleService.save(role); + role.setRoleName("注册用户"); + role.setRoleCode("user"); + role.setComments("普通注册用户"); + roleService.save(role); +// role.setRoleName("商户账号"); +// role.setRoleCode("merchantClerk"); +// role.setRoleName("管理人员/店员"); +// Integer guestRoleId = role.getRoleId(); + + // 添加管理员账号 +// User admin = new User(); +// admin.setTenantId(company.getTid()); +// admin.setUsername("admin"); +// admin.setNickname("管理员"); +// admin.setPassword(userService.encodePassword(CommonUtil.randomUUID16())); +// userService.save(admin); + + // 添加超管用户角色 + UserRole userRole = new UserRole(); + userRole.setUserId(superAdminUserId); + userRole.setRoleId(superAdminRoleId); + userRole.setTenantId(company.getTid()); + boolean resultUserRole = userRoleService.save(userRole); + + // 添加游客用户角色 +// userRole.setUserId(www.getUserId()); +// userRole.setRoleId(guestRoleId); +// boolean resultUserRole = userRoleService.save(userRole); + + // 添加系统菜单 + if (resultUserRole) { + Menu menu = new Menu(); + menu.setMenuType(0); + menu.setParentId(0); + menu.setHide(1); + menu.setTitle("扩展插件"); + menu.setPath("/system/plug"); + menu.setComponent("/system/plug"); + menu.setIcon("AppstoreAddOutlined"); + menu.setAuthority("sys:plug:list"); + menu.setSortNumber(999); + menu.setTenantId(company.getTid()); + menuService.save(menu); + // 10.系统管理 + menu.setTitle("系统管理"); + menu.setParentId(0); + menu.setPath("/system"); + menu.setIcon("setting-outlined"); + menu.setSortNumber(0); + menu.setHide(0); + menu.setTenantId(company.getTid()); + menuService.save(menu); + Integer parentId = menu.getMenuId(); + menu.setParentId(menu.getMenuId()); + menu.setTitle("系统信息"); + menu.setPath("/system/profile"); + menu.setComponent("/system/profile"); + menu.setIcon("AuditOutlined"); + menu.setAuthority("sys:company:profile"); + menu.setSortNumber(1); + menu.setHide(1); + menuService.save(menu); + Integer profileParentId = menu.getMenuId(); + menu.setParentId(profileParentId); + menu.setMenuType(1); + menu.setTitle("编辑"); + menu.setIcon(""); + menu.setAuthority("sys:company:update"); + menuService.save(menu); + menu.setMenuType(0); + menu.setParentId(parentId); + menu.setTitle("菜单管理"); + menu.setPath("/system/menu"); + menu.setComponent("/system/menu"); + menu.setIcon("appstore-outlined"); + menu.setHide(0); + menu.setAuthority(""); + menu.setSortNumber(2); + menuService.save(menu); + menu.setMenuType(0); + menu.setParentId(parentId); + menu.setTitle("角色管理"); + menu.setPath("/system/role"); + menu.setComponent("/system/role"); + menu.setIcon("idcard-outlined"); + menu.setAuthority(""); + menu.setSortNumber(3); + menuService.save(menu); + menu.setTitle("用户管理"); + menu.setPath("/system/user"); + menu.setComponent("/system/user"); + menu.setIcon("team-outlined"); + menu.setSortNumber(4); + menuService.save(menu); + Integer userParentId = menu.getMenuId(); + menu.setParentId(userParentId); + menu.setMenuType(1); + menu.setTitle("查询"); + menu.setIcon(""); + menu.setAuthority("sys:user:list"); + menuService.save(menu); + menu.setParentId(userParentId); + menu.setTitle("添加"); + menu.setAuthority("sys:user:save"); + menuService.save(menu); + menu.setParentId(userParentId); + menu.setTitle("修改"); + menu.setAuthority("sys:user:update"); + menuService.save(menu); + menu.setParentId(userParentId); + menu.setTitle("删除"); + menu.setAuthority("sys:user:remove"); + menuService.save(menu); + menu.setMenuType(0); + menu.setParentId(parentId); + menu.setTitle("部门管理"); + menu.setPath("/system/organization"); + menu.setComponent("/system/organization"); + menu.setIcon("bank-outlined"); + menu.setAuthority(""); + menu.setSortNumber(4); + menuService.save(menu); + Integer orgParentId = menu.getMenuId(); + menu.setParentId(orgParentId); + menu.setMenuType(1); + menu.setPath(""); + menu.setComponent(""); + menu.setIcon(""); + menu.setTitle("查询"); + menu.setAuthority("sys:org:list"); + menuService.save(menu); + menu.setParentId(orgParentId); + menu.setTitle("添加"); + menu.setAuthority("sys:org:save"); + menuService.save(menu); + menu.setParentId(orgParentId); + menu.setTitle("修改"); + menu.setAuthority("sys:org:update"); + menuService.save(menu); + menu.setParentId(orgParentId); + menu.setTitle("删除"); + menu.setAuthority("sys:org:remove"); + menuService.save(menu); + Integer roleParentId = menu.getMenuId(); + menu.setParentId(roleParentId); + menu.setMenuType(1); + menu.setIcon(""); + menu.setPath(""); + menu.setComponent(""); + menu.setTitle("查询"); + menu.setAuthority("sys:role:list"); + menuService.save(menu); + menu.setParentId(roleParentId); + menu.setTitle("添加"); + menu.setAuthority("sys:role:save"); + menuService.save(menu); + menu.setParentId(roleParentId); + menu.setTitle("修改"); + menu.setAuthority("sys:role:update"); + menuService.save(menu); + menu.setParentId(roleParentId); + menu.setTitle("删除"); + menu.setAuthority("sys:role:remove"); + menuService.save(menu); + Integer menuParentId = menu.getMenuId(); + menu.setParentId(menuParentId); + menu.setMenuType(1); + menu.setTitle("查询"); + menu.setAuthority("sys:menu:list"); + menu.setIcon(""); + menu.setPath(""); + menu.setComponent(""); + menuService.save(menu); + menu.setParentId(menuParentId); + menu.setTitle("添加"); + menu.setAuthority("sys:menu:save"); + menuService.save(menu); + menu.setParentId(menuParentId); + menu.setTitle("修改"); + menu.setAuthority("sys:menu:update"); + menuService.save(menu); + menu.setParentId(menuParentId); + menu.setTitle("删除"); + menu.setAuthority("sys:menu:remove"); + menuService.save(menu); + menu.setMenuType(0); + menu.setParentId(parentId); + menu.setTitle("字典管理"); + menu.setPath("/system/dict"); + menu.setComponent("/system/dict"); + menu.setIcon("profile-outlined"); + menu.setAuthority(""); + menu.setSortNumber(6); + menuService.save(menu); + Integer dictParentId = menu.getMenuId(); + menu.setParentId(dictParentId); + menu.setMenuType(1); + menu.setTitle("查询"); + menu.setAuthority("sys:dict:list"); + menu.setIcon(""); + menu.setPath(""); + menu.setComponent(""); + menuService.save(menu); + menu.setParentId(dictParentId); + menu.setTitle("添加"); + menu.setAuthority("sys:dict:save"); + menuService.save(menu); + menu.setParentId(dictParentId); + menu.setTitle("修改"); + menu.setAuthority("sys:dict:update"); + menuService.save(menu); + menu.setParentId(dictParentId); + menu.setTitle("删除"); + menu.setAuthority("sys:dict:remove"); + menuService.save(menu); + menu.setMenuType(0); + menu.setParentId(parentId); + menu.setTitle("登录日志"); + menu.setPath("/system/login-record"); + menu.setComponent("/system/login-record"); + menu.setIcon("calendar-outlined"); + menu.setAuthority("sys:login-record:list"); + menu.setSortNumber(7); + menuService.save(menu); + menu.setParentId(parentId); + menu.setTitle("文件管理"); + menu.setPath("/system/file"); + menu.setComponent("/system/file"); + menu.setIcon("folder-outlined"); + menu.setAuthority(""); + menu.setSortNumber(6); + menuService.save(menu); + Integer fileParentId = menu.getMenuId(); + menu.setParentId(fileParentId); + menu.setMenuType(1); + menu.setTitle("查看记录"); + menu.setPath(""); + menu.setComponent(""); + menu.setIcon(""); + menu.setAuthority("sys:file:list"); + menuService.save(menu); + menu.setParentId(fileParentId); + menu.setTitle("上传文件"); + menu.setAuthority("sys:file:upload"); + menuService.save(menu); + menu.setParentId(fileParentId); + menu.setTitle("修改文件"); + menu.setAuthority("sys:file:update"); + menuService.save(menu); + menu.setParentId(fileParentId); + menu.setTitle("删除文件"); + menu.setAuthority("sys:file:remove"); + menuService.save(menu); + menu.setParentId(parentId); + menu.setTitle("秘钥管理"); + menu.setPath("/system/access-key"); + menu.setComponent("/system/access-key"); + menu.setIcon("KeyOutlined"); + menu.setAuthority("sys:accessKey:list"); + menu.setSortNumber(8); + menuService.save(menu); + menu.setMenuType(0); + menu.setParentId(parentId); + menu.setTitle("扩展插件"); + menu.setPath("/system/plug"); + menu.setComponent("/system/plug"); + menu.setIcon("AppstoreAddOutlined"); + menu.setAuthority("sys:plug:list"); + menu.setSortNumber(9); + menuService.save(menu); + Integer plugParentId = menu.getMenuId(); + menu.setParentId(plugParentId); + menu.setMenuType(1); + menu.setTitle("查询"); + menu.setAuthority("sys:dict:list"); + menu.setIcon(""); + menu.setPath(""); + menu.setComponent(""); + menuService.save(menu); + menu.setParentId(plugParentId); + menu.setTitle("发布插件"); + menu.setAuthority("sys:plug:save"); + menuService.save(menu); + menu.setParentId(plugParentId); + menu.setTitle("更新插件"); + menu.setAuthority("sys:plug:update"); + menuService.save(menu); + menu.setParentId(plugParentId); + menu.setTitle("删除插件"); + menu.setAuthority("sys:plus:remove"); + menuService.save(menu); + menu.setParentId(plugParentId); + menu.setTitle("安装插件"); + menu.setAuthority("sys:plug:save"); + menuService.save(menu); + menu.setMenuType(0); + menu.setParentId(parentId); + menu.setTitle("系统设置"); + menu.setPath("/system/setting"); + menu.setComponent("/system/setting"); + menu.setIcon("setting-outlined"); + menu.setAuthority("sys:setting:save"); + menu.setSortNumber(10); + menuService.save(menu); + menu.setParentId(parentId); + menu.setTitle("用户信息"); + menu.setPath("/system/user-info"); + menu.setComponent("/system/user-info"); + menu.setIcon("team-outlined"); + menu.setAuthority(""); + menu.setHide(1); + menu.setMenuType(0); + menu.setSortNumber(9); + menuService.save(menu); + Integer userInfoParentId = menu.getMenuId(); + menu.setParentId(userInfoParentId); + menu.setMenuType(1); + menu.setTitle("修改个人密码"); + menu.setAuthority("sys:auth:password"); + menu.setIcon(""); + menu.setPath(""); + menu.setComponent(""); + menuService.save(menu); + menu.setParentId(userInfoParentId); + menu.setTitle("修改个人资料"); + menu.setAuthority("sys:auth:user"); + menuService.save(menu); + // 1.控制台 +// menu.setParentId(0); +// menu.setTitle("管理首页"); +// menu.setPath("/dashboard"); +// menu.setIcon("home-outlined"); +// menu.setComponent("/dashboard/workplace"); +// menu.setAuthority(""); +// menu.setSortNumber(1); +// menu.setHide(0); +// menu.setMenuType(0); +// menuService.save(menu); + + // 个人中心 + menu.setParentId(0); + menu.setTitle("个人中心"); + menu.setPath("/user-center"); + menu.setIcon("UserOutlined"); + menu.setComponent(""); + menu.setAuthority(""); + menu.setMenuType(0); + menu.setHide(1); + menu.setSortNumber(999); + menuService.save(menu); + Integer userCenterParentId = menu.getMenuId(); + menu.setTitle("个人资料"); + menu.setPath("/user/profile"); + menu.setComponent("/user/profile"); + menu.setIcon("IdcardOutlined"); + menu.setParentId(userCenterParentId); + menu.setMenuType(0); + menu.setSortNumber(0); + menuService.save(menu); + Integer userProfileParentId = menu.getMenuId(); + menu.setParentId(userProfileParentId); + menu.setMenuType(1); + menu.setIcon(""); + menu.setPath(""); + menu.setComponent(""); + menu.setTitle("修改资料"); + menu.setSortNumber(0); + menu.setAuthority("sys:auth:user"); + menuService.save(menu); + menu.setTitle("修改密码"); + menu.setAuthority("sys:auth:password"); + menuService.save(menu); + + menu.setTitle("上传头像"); + menu.setAuthority("sys:file:upload"); + menuService.save(menu); + menu.setTitle("预览头像"); + menu.setAuthority("sys:file:list"); + menuService.save(menu); + menu.setTitle("保存头像"); + menu.setAuthority("sys:user:update"); + menuService.save(menu); + menu.setTitle("我的消息"); + menu.setPath("/user/notice"); + menu.setComponent("/user/notice"); + menu.setIcon("sound-outlined"); + menu.setParentId(userCenterParentId); + menu.setMenuType(0); + menuService.save(menu); + Integer userNoticeParentId = menu.getMenuId(); + menu.setParentId(userNoticeParentId); + menu.setTitle("列表"); + menu.setAuthority("sys:notice:list"); + menu.setSortNumber(0); + menu.setMenuType(1); + menu.setIcon(""); + menu.setPath(""); + menu.setComponent(""); + menuService.save(menu); + menu.setTitle("添加"); + menu.setAuthority("sys:notice:save"); + menuService.save(menu); + menu.setTitle("编辑"); + menu.setAuthority("sys:notice:update"); + menuService.save(menu); + menu.setTitle("删除"); + menu.setAuthority("sys:notice:remove"); + menuService.save(menu); + menu.setParentId(userCenterParentId); + menu.setTitle("用户注册"); + menu.setAuthority("sys:user:save"); + menuService.save(menu); + menu.setTitle("字典查询"); + menu.setAuthority("sys:dict:list"); + + boolean resultMenu = menuService.save(menu); + // 添加菜单ID到超级管理员所属角色ID + if (resultMenu) { + saveRedis(company); + } + } + + } + // 发送邮件通知 + String title = "恭喜!您的应用已创建成功"; + String appUrl = "\r\n应用地址:" + DomainUtil.getSiteUrl(company.getTid().toString()); + String appName = "\r\n应用名称:" + company.getShortName(); + String adminUrl = "\r\n后台管理:" + DomainUtil.getAdminUrl(company.getTid().toString()); + String account = "\r\n账号:admin"; + String password = "\r\n密码:" + company.getPassword(); + String content = title + appUrl + appName + adminUrl + account + password; + // 发送邮件通知 + if (company.getEmail() != null) { + emailRecordService.sendEmail(title, content, company.getEmail(), company.getTid()); + } + return company; + } + + + + // 缓存租户信息 + private void saveRedis(Company tenant) { + String key = "tenant:" + tenant.getTenantId(); + if (StrUtil.isEmpty(tenant.getTenantCode())) { + tenant.setTenantCode(CommonUtil.randomUUID16()); + } + redisUtil.set(key, tenant); + } + + @Override + public boolean destructionAll(Integer tenantId){ + if (baseMapper.destructionAll(tenantId)) { + return true; + } + return false; + } + + @Override + public Tenant getByCodeRel(String code) { + TenantParam param = new TenantParam(); + param.setTenantCode(code); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/TenantSubscriptionOrderServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/TenantSubscriptionOrderServiceImpl.java new file mode 100644 index 0000000..0ab00c4 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/TenantSubscriptionOrderServiceImpl.java @@ -0,0 +1,230 @@ +package com.gxwebsoft.common.system.service.impl; + +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.IdUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.core.exception.BusinessException; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.TenantPackage; +import com.gxwebsoft.common.system.entity.TenantSubscriptionOrder; +import com.gxwebsoft.common.system.mapper.TenantSubscriptionOrderMapper; +import com.gxwebsoft.common.system.service.TenantPackageService; +import com.gxwebsoft.common.system.service.TenantSubscriptionOrderService; +import com.gxwebsoft.common.system.service.TenantSubscriptionService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 租户订阅订单ServiceImpl + * + * @author WebSoft + * @since 2025-12-12 + */ +@Service +public class TenantSubscriptionOrderServiceImpl extends ServiceImpl implements TenantSubscriptionOrderService { + + @Resource + private TenantPackageService tenantPackageService; + + @Resource + private TenantSubscriptionService tenantSubscriptionService; + + @Override + @Transactional(rollbackFor = Exception.class) + public TenantSubscriptionOrder createOrder(Integer packageId, Integer payType, Integer tenantId, Integer userId) { + // 查询套餐信息 + TenantPackage tenantPackage = tenantPackageService.getById(packageId); + if (tenantPackage == null) { + throw new BusinessException("套餐不存在"); + } + if (tenantPackage.getStatus() != 1) { + throw new BusinessException("套餐已下架"); + } + + // 计算价格 + BigDecimal price; + if (payType == 1) { + price = tenantPackage.getPriceMonthly(); + } else if (payType == 3) { + price = tenantPackage.getPriceQuarterly(); + } else if (payType == 12) { + price = tenantPackage.getPriceYearly(); + } else { + throw new BusinessException("支付周期不正确"); + } + + // 创建订单 + TenantSubscriptionOrder order = new TenantSubscriptionOrder(); + order.setOrderNo(generateOrderNo()); + order.setTenantId(tenantId); + order.setPackageId(packageId); + order.setPackageName(tenantPackage.getPackageName()); + order.setVersion(tenantPackage.getVersion()); + order.setPayType(payType); + order.setOriginalPrice(price); + order.setDiscountPrice(BigDecimal.ZERO); + order.setActualPrice(price); + order.setIsTrial(0); + order.setIsRenewal(0); + order.setIsUpgrade(0); + order.setOrderStatus(0); // 待支付 + order.setUserId(userId); + order.setCreateTime(new Date()); + + save(order); + return order; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public TenantSubscriptionOrder createTrialOrder(Integer tenantId, Integer userId) { + // 查询试用套餐(version=0) + TenantPackage trialPackage = tenantPackageService.getByVersion(0); + if (trialPackage == null) { + throw new BusinessException("试用套餐不存在"); + } + + // 检查是否已经试用过 + long count = count(new LambdaQueryWrapper() + .eq(TenantSubscriptionOrder::getTenantId, tenantId) + .eq(TenantSubscriptionOrder::getIsTrial, 1)); + if (count > 0) { + throw new BusinessException("已经使用过试用版"); + } + + // 创建试用订单 + TenantSubscriptionOrder order = new TenantSubscriptionOrder(); + order.setOrderNo(generateOrderNo()); + order.setTenantId(tenantId); + order.setPackageId(trialPackage.getPackageId()); + order.setPackageName(trialPackage.getPackageName()); + order.setVersion(trialPackage.getVersion()); + order.setPayType(0); + order.setOriginalPrice(BigDecimal.ZERO); + order.setDiscountPrice(BigDecimal.ZERO); + order.setActualPrice(BigDecimal.ZERO); + order.setStartTime(new Date()); + order.setEndTime(DateUtil.offsetDay(new Date(), trialPackage.getTrialDays())); + order.setIsTrial(1); + order.setIsRenewal(0); + order.setIsUpgrade(0); + order.setOrderStatus(2); // 直接激活 + order.setUserId(userId); + order.setCreateTime(new Date()); + + save(order); + + // 创建订阅记录 + tenantSubscriptionService.createOrUpdateSubscription( + tenantId, + trialPackage.getPackageId(), + trialPackage.getVersion(), + order.getStartTime(), + order.getEndTime(), + 1 + ); + + return order; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean payOrder(String orderNo, String paymentMethod, String paymentId) { + TenantSubscriptionOrder order = getByOrderNo(orderNo); + if (order == null) { + throw new BusinessException("订单不存在"); + } + if (order.getOrderStatus() != 0) { + throw new BusinessException("订单状态不正确"); + } + + order.setPaymentMethod(paymentMethod); + order.setPaymentId(paymentId); + order.setPaymentTime(new Date()); + order.setOrderStatus(1); // 已支付 + order.setUpdateTime(new Date()); + + return updateById(order); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean activateOrder(String orderNo) { + TenantSubscriptionOrder order = getByOrderNo(orderNo); + if (order == null) { + throw new BusinessException("订单不存在"); + } + if (order.getOrderStatus() != 1) { + throw new BusinessException("订单未支付"); + } + + // 计算开始和结束时间 + Date startTime = new Date(); + Date endTime = DateUtil.offsetMonth(startTime, order.getPayType()); + + order.setStartTime(startTime); + order.setEndTime(endTime); + order.setOrderStatus(2); // 已激活 + order.setUpdateTime(new Date()); + + boolean updated = updateById(order); + + if (updated) { + // 创建或更新订阅记录 + tenantSubscriptionService.createOrUpdateSubscription( + order.getTenantId(), + order.getPackageId(), + order.getVersion(), + startTime, + endTime, + 0 + ); + } + + return updated; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean cancelOrder(String orderNo, String cancelReason) { + TenantSubscriptionOrder order = getByOrderNo(orderNo); + if (order == null) { + throw new BusinessException("订单不存在"); + } + if (order.getOrderStatus() != 0) { + throw new BusinessException("只能取消待支付订单"); + } + + order.setOrderStatus(3); // 已取消 + order.setCancelReason(cancelReason); + order.setUpdateTime(new Date()); + + return updateById(order); + } + + @Override + public PageResult pageByTenant(Integer tenantId, Integer page, Integer limit) { + IPage iPage = new Page<>(page, limit); + baseMapper.selectPageByTenant(iPage, tenantId); + return new PageResult(iPage.getRecords(), iPage.getTotal()); + } + + @Override + public TenantSubscriptionOrder getByOrderNo(String orderNo) { + return baseMapper.selectByOrderNo(orderNo); + } + + /** + * 生成订单号 + */ + private String generateOrderNo() { + return "SUB" + DateUtil.format(new Date(), "yyyyMMddHHmmss") + IdUtil.randomUUID().substring(0, 6).toUpperCase(); + } +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/TenantSubscriptionServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/TenantSubscriptionServiceImpl.java new file mode 100644 index 0000000..9a5e1f4 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/TenantSubscriptionServiceImpl.java @@ -0,0 +1,188 @@ +package com.gxwebsoft.common.system.service.impl; + +import cn.hutool.core.date.DateUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.core.exception.BusinessException; +import com.gxwebsoft.common.system.entity.TenantPackage; +import com.gxwebsoft.common.system.entity.TenantSubscription; +import com.gxwebsoft.common.system.mapper.TenantSubscriptionMapper; +import com.gxwebsoft.common.system.service.TenantPackageService; +import com.gxwebsoft.common.system.service.TenantSubscriptionService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; + +/** + * 租户订阅记录ServiceImpl + * + * @author WebSoft + * @since 2025-12-12 + */ +@Service +public class TenantSubscriptionServiceImpl extends ServiceImpl implements TenantSubscriptionService { + + @Resource + private TenantPackageService tenantPackageService; + + @Override + public TenantSubscription getByTenantId(Integer tenantId) { + return baseMapper.selectByTenantIdRel(tenantId); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public TenantSubscription createOrUpdateSubscription(Integer tenantId, Integer packageId, Integer version, + Date startTime, Date endTime, Integer isTrial) { + // 查询是否已存在订阅 + TenantSubscription subscription = getOne(new LambdaQueryWrapper() + .eq(TenantSubscription::getTenantId, tenantId)); + + if (subscription == null) { + // 创建新订阅 + subscription = new TenantSubscription(); + subscription.setTenantId(tenantId); + subscription.setPackageId(packageId); + subscription.setVersion(version); + subscription.setStartTime(startTime); + subscription.setEndTime(endTime); + subscription.setIsTrial(isTrial); + subscription.setIsExpired(0); + subscription.setAutoRenewal(0); + subscription.setNotifyStatus(0); + subscription.setStatus(1); + subscription.setCreateTime(new Date()); + save(subscription); + } else { + // 更新订阅 + subscription.setPackageId(packageId); + subscription.setVersion(version); + subscription.setStartTime(startTime); + subscription.setEndTime(endTime); + subscription.setIsTrial(isTrial); + subscription.setIsExpired(0); + subscription.setNotifyStatus(0); + subscription.setUpdateTime(new Date()); + updateById(subscription); + } + + return subscription; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean upgradeSubscription(Integer tenantId, Integer newPackageId) { + TenantSubscription subscription = getByTenantId(tenantId); + if (subscription == null) { + throw new BusinessException("订阅不存在"); + } + + TenantPackage newPackage = tenantPackageService.getById(newPackageId); + if (newPackage == null) { + throw new BusinessException("套餐不存在"); + } + + // 检查是否是升级 + if (newPackage.getVersion() <= subscription.getVersion()) { + throw new BusinessException("只能升级到更高版本"); + } + + subscription.setPackageId(newPackageId); + subscription.setVersion(newPackage.getVersion()); + subscription.setUpdateTime(new Date()); + + return updateById(subscription); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean renewSubscription(Integer tenantId, Integer months) { + TenantSubscription subscription = getByTenantId(tenantId); + if (subscription == null) { + throw new BusinessException("订阅不存在"); + } + + // 从当前到期时间延长 + Date newEndTime = DateUtil.offsetMonth(subscription.getEndTime(), months); + subscription.setEndTime(newEndTime); + subscription.setIsExpired(0); + subscription.setUpdateTime(new Date()); + + return updateById(subscription); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean setAutoRenewal(Integer tenantId, Integer autoRenewal, Integer renewalPackageId) { + TenantSubscription subscription = getByTenantId(tenantId); + if (subscription == null) { + throw new BusinessException("订阅不存在"); + } + + subscription.setAutoRenewal(autoRenewal); + subscription.setRenewalPackageId(renewalPackageId); + subscription.setUpdateTime(new Date()); + + return updateById(subscription); + } + + @Override + public boolean isSubscriptionValid(Integer tenantId) { + TenantSubscription subscription = getByTenantId(tenantId); + if (subscription == null) { + return false; + } + return subscription.getStatus() == 1 && subscription.getIsExpired() == 0 + && subscription.getEndTime().after(new Date()); + } + + @Override + public boolean isSubscriptionExpired(Integer tenantId) { + TenantSubscription subscription = getByTenantId(tenantId); + if (subscription == null) { + return true; + } + return subscription.getIsExpired() == 1 || subscription.getEndTime().before(new Date()); + } + + @Override + public List listExpiringSoon(Integer days) { + return baseMapper.selectExpiringSoon(days); + } + + @Override + public List listExpired() { + return baseMapper.selectExpired(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean markAsExpired(Long subscriptionId) { + TenantSubscription subscription = getById(subscriptionId); + if (subscription == null) { + return false; + } + + subscription.setIsExpired(1); + subscription.setUpdateTime(new Date()); + + return updateById(subscription); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean sendExpiryNotification(Long subscriptionId, Integer notifyStatus) { + TenantSubscription subscription = getById(subscriptionId); + if (subscription == null) { + return false; + } + + subscription.setNotifyStatus(notifyStatus); + subscription.setUpdateTime(new Date()); + + return updateById(subscription); + } +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/UserBalanceLogServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/UserBalanceLogServiceImpl.java new file mode 100644 index 0000000..2286471 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/UserBalanceLogServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.UserBalanceLog; +import com.gxwebsoft.common.system.mapper.UserBalanceLogMapper; +import com.gxwebsoft.common.system.param.UserBalanceLogParam; +import com.gxwebsoft.common.system.service.UserBalanceLogService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 用户余额变动明细表Service实现 + * + * @author 科技小王子 + * @since 2023-04-21 15:59:09 + */ +@Service +public class UserBalanceLogServiceImpl extends ServiceImpl implements UserBalanceLogService { + + @Override + public PageResult pageRel(UserBalanceLogParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(UserBalanceLogParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public UserBalanceLog getByIdRel(Integer logId) { + UserBalanceLogParam param = new UserBalanceLogParam(); + param.setLogId(logId); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/UserCollectionServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/UserCollectionServiceImpl.java new file mode 100644 index 0000000..01307f2 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/UserCollectionServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.system.mapper.UserCollectionMapper; +import com.gxwebsoft.common.system.service.UserCollectionService; +import com.gxwebsoft.common.system.entity.UserCollection; +import com.gxwebsoft.common.system.param.UserCollectionParam; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 我的收藏Service实现 + * + * @author 科技小王子 + * @since 2024-04-28 18:08:32 + */ +@Service +public class UserCollectionServiceImpl extends ServiceImpl implements UserCollectionService { + + @Override + public PageResult pageRel(UserCollectionParam param) { + PageParam page = new PageParam<>(param); + //page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(UserCollectionParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + //page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public UserCollection getByIdRel(Integer id) { + UserCollectionParam param = new UserCollectionParam(); + param.setId(id); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/UserFileServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/UserFileServiceImpl.java new file mode 100644 index 0000000..b5712c3 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/UserFileServiceImpl.java @@ -0,0 +1,18 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.system.mapper.UserFileMapper; +import com.gxwebsoft.common.system.service.UserFileService; +import com.gxwebsoft.common.system.entity.UserFile; +import org.springframework.stereotype.Service; + +/** + * 用户文件Service实现 + * + * @author WebSoft + * @since 2022-07-21 14:34:40 + */ +@Service +public class UserFileServiceImpl extends ServiceImpl implements UserFileService { + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/UserGradeServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/UserGradeServiceImpl.java new file mode 100644 index 0000000..410ba2f --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/UserGradeServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.system.mapper.UserGradeMapper; +import com.gxwebsoft.common.system.service.UserGradeService; +import com.gxwebsoft.common.system.entity.UserGrade; +import com.gxwebsoft.common.system.param.UserGradeParam; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 用户会员等级表Service实现 + * + * @author 科技小王子 + * @since 2023-10-07 22:51:17 + */ +@Service +public class UserGradeServiceImpl extends ServiceImpl implements UserGradeService { + + @Override + public PageResult pageRel(UserGradeParam param) { + PageParam page = new PageParam<>(param); +// page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(UserGradeParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); +// page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public UserGrade getByIdRel(Integer gradeId) { + UserGradeParam param = new UserGradeParam(); + param.setGradeId(gradeId); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/UserGroupServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/UserGroupServiceImpl.java new file mode 100644 index 0000000..dccaf0f --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/UserGroupServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.system.mapper.UserGroupMapper; +import com.gxwebsoft.common.system.service.UserGroupService; +import com.gxwebsoft.common.system.entity.UserGroup; +import com.gxwebsoft.common.system.param.UserGroupParam; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 用户分组管理表Service实现 + * + * @author 科技小王子 + * @since 2023-10-28 15:16:39 + */ +@Service +public class UserGroupServiceImpl extends ServiceImpl implements UserGroupService { + + @Override + public PageResult pageRel(UserGroupParam param) { + PageParam page = new PageParam<>(param); + //page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(UserGroupParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + //page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public UserGroup getByIdRel(Integer groupId) { + UserGroupParam param = new UserGroupParam(); + param.setGroupId(groupId); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/UserOauthServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/UserOauthServiceImpl.java new file mode 100644 index 0000000..c1a8812 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/UserOauthServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.system.mapper.UserOauthMapper; +import com.gxwebsoft.common.system.service.UserOauthService; +import com.gxwebsoft.common.system.entity.UserOauth; +import com.gxwebsoft.common.system.param.UserOauthParam; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 第三方用户信息表Service实现 + * + * @author 科技小王子 + * @since 2023-10-07 22:39:46 + */ +@Service +public class UserOauthServiceImpl extends ServiceImpl implements UserOauthService { + + @Override + public PageResult pageRel(UserOauthParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(UserOauthParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public UserOauth getByIdRel(Integer id) { + UserOauthParam param = new UserOauthParam(); + param.setId(id); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/UserRefereeServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/UserRefereeServiceImpl.java new file mode 100644 index 0000000..9662982 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/UserRefereeServiceImpl.java @@ -0,0 +1,74 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.system.mapper.UserRefereeMapper; +import com.gxwebsoft.common.system.service.UserRefereeService; +import com.gxwebsoft.common.system.entity.UserReferee; +import com.gxwebsoft.common.system.param.UserRefereeParam; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.service.UserService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 用户推荐关系表Service实现 + * + * @author 科技小王子 + * @since 2023-10-07 22:56:36 + */ +@Service +public class UserRefereeServiceImpl extends ServiceImpl implements UserRefereeService { + + @Resource + private UserService userService; + + @Override + public PageResult pageRel(UserRefereeParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + for (UserReferee userReferee : list) { + userReferee.setUser(userService.getById(userReferee.getUserId())); + } + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(UserRefereeParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public UserReferee getByIdRel(Integer id) { + UserRefereeParam param = new UserRefereeParam(); + param.setId(id); + return param.getOne(baseMapper.selectListRel(param)); + } + + @Override + public UserReferee check(Integer dealerId, Integer userId) { + return getOne( + new LambdaQueryWrapper() + .eq(UserReferee::getDealerId, dealerId) + .eq(UserReferee::getUserId, userId) + ); + } + + @Override + public UserReferee getByUserId(Integer userId) { + return getOne( + new LambdaQueryWrapper() + .eq(UserReferee::getUserId, userId) + .last("limit 1") + ); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/UserRoleServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/UserRoleServiceImpl.java new file mode 100644 index 0000000..d7220c3 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/UserRoleServiceImpl.java @@ -0,0 +1,69 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.system.entity.Role; +import com.gxwebsoft.common.system.mapper.UserRoleMapper; +import com.gxwebsoft.common.system.service.UserRoleService; +import com.gxwebsoft.common.system.entity.UserRole; +import com.gxwebsoft.common.system.param.UserRoleParam; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 用户角色Service实现 + * + * @author 科技小王子 + * @since 2025-06-16 20:39:53 + */ +@Service +public class UserRoleServiceImpl extends ServiceImpl implements UserRoleService { + + @Override + public int saveBatch(Integer userId, List roleIds) { + return baseMapper.insertBatch(userId, roleIds); + } + + @Override + public List listByUserId(Integer userId) { + return baseMapper.selectByUserId(userId); + } + + @Override + public List listByUserIds(List userIds) { + return baseMapper.selectByUserIds(userIds); + } + + @Override + public List listByRoleId(Integer roleId) { + return list(new LambdaQueryWrapper().eq(UserRole::getRoleId, roleId)); + } + + @Override + public PageResult pageRel(UserRoleParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(UserRoleParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public UserRole getByIdRel(Integer id) { + UserRoleParam param = new UserRoleParam(); + param.setId(id); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/UserServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/UserServiceImpl.java new file mode 100644 index 0000000..fa98528 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/UserServiceImpl.java @@ -0,0 +1,479 @@ +package com.gxwebsoft.common.system.service.impl; + +import cn.hutool.core.util.DesensitizedUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.core.exception.BusinessException; +import com.gxwebsoft.common.core.utils.CommonUtil; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.system.entity.*; +import com.gxwebsoft.common.system.mapper.UserMapper; +import com.gxwebsoft.common.system.param.LoginParam; +import com.gxwebsoft.common.system.param.UserParam; +import com.gxwebsoft.common.mq.producer.SyncMessageProducer; +import com.gxwebsoft.common.system.service.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.userdetails.UserDetails; +import org.springframework.security.core.userdetails.UsernameNotFoundException; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Isolation; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.List; +import java.util.stream.Collectors; + +import static com.gxwebsoft.common.core.constants.PlatformConstants.WEB; + +/** + * 用户Service实现 + * + * @author WebSoft + * @since 2018-12-24 16:10:14 + */ +@Slf4j +@Service +public class UserServiceImpl extends ServiceImpl implements UserService { + @Resource + private UserRoleService userRoleService; + @Resource + private RoleService roleService; + @Resource + private RoleMenuService roleMenuService; + @Resource + private BCryptPasswordEncoder bCryptPasswordEncoder; + @Resource + private UserService userService; + @Resource + private OrganizationService organizationService; + @Resource + private UserRefereeService userRefereeService; + + @Autowired(required = false) + private SyncMessageProducer syncMessageProducer; + + @Override + public PageResult pageRel(UserParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + // 查询用户的角色 + selectUserRoles(list); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(UserParam param) { + List list = baseMapper.selectListRel(param); + // 查询用户的角色 + selectUserRoles(list); + // 排序 + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public User getByIdRel(Integer userId) { + UserParam param = new UserParam(); + param.setUserId(userId); + User user = param.getOne(baseMapper.selectListRel(param)); + if (user != null) { + user.setPassword(null); + user.setRoles(userRoleService.listByUserId(user.getUserId())); + user.setAuthorities(roleMenuService.listMenuByUserId(user.getUserId(), null)); + } + return user; + } + + @Override + public User getByUsername(String username) { + return getByUsername(username, null); + } + + @Override + public User getByUsername(String username, Integer tenantId) { + if (StrUtil.isBlank(username)) { + return null; + } + User user = baseMapper.selectByUsername(username, tenantId); + if (user != null) { + user.setRoles(userRoleService.listByUserId(user.getUserId())); + user.setAuthorities(roleMenuService.listMenuByUserId(user.getUserId(), null)); + } + return user; + } + + @Override + public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { + return getByUsername(username); + } + + @Transactional(rollbackFor = {Exception.class}, isolation = Isolation.SERIALIZABLE) + @Override + public boolean saveUser(User user) { + if (StrUtil.isNotEmpty(user.getUsername()) && baseMapper.selectCount(new LambdaQueryWrapper() + .eq(User::getUsername, user.getUsername())) > 0) { + throw new BusinessException("账号已存在"); + } + if (StrUtil.isNotEmpty(user.getPhone()) && baseMapper.selectCount(new LambdaQueryWrapper() + .eq(User::getPhone, user.getPhone())) > 0) { + throw new BusinessException("手机号已存在"); + } + if (StrUtil.isNotEmpty(user.getEmail()) && baseMapper.selectCount(new LambdaQueryWrapper() + .eq(User::getEmail, user.getEmail())) > 0) { + throw new BusinessException("邮箱已存在"); + } + boolean result = baseMapper.insert(user) > 0; + if (result && user.getRoles() != null && user.getRoles().size() > 0) { + List roleIds = user.getRoles().stream().map(Role::getRoleId).collect(Collectors.toList()); + if (userRoleService.saveBatch(user.getUserId(), roleIds) < roleIds.size()) { + throw new BusinessException("用户角色添加失败"); + } + } + // 用户创建成功后,通过MQ异步同步用户数据到 websopy + if (result && syncMessageProducer != null) { + User savedUser = getAllByUserId(String.valueOf(user.getUserId())); + if (savedUser != null) { + syncMessageProducer.sendUserSyncMessage("websopy", "CREATE", savedUser); + log.info("用户创建后发送MQ消息同步到websopy: userId={}, phone={}", user.getUserId(), user.getPhone()); + } + } + return result; + } + + @Transactional(rollbackFor = {Exception.class}) + @Override + public boolean updateUser(User user) { + if (StrUtil.isNotEmpty(user.getUsername()) && baseMapper.selectCount(new LambdaQueryWrapper() + .eq(User::getUsername, user.getUsername()) + .ne(User::getUserId, user.getUserId())) > 0) { + throw new BusinessException("账号已存在"); + } + if (StrUtil.isNotEmpty(user.getPhone()) && baseMapper.selectCount(new LambdaQueryWrapper() + .eq(User::getPhone, user.getPhone()) + .ne(User::getUserId, user.getUserId())) > 0) { + throw new BusinessException("手机号已存在"); + } + if (StrUtil.isNotEmpty(user.getEmail()) && baseMapper.selectCount(new LambdaQueryWrapper() + .eq(User::getEmail, user.getEmail()) + .ne(User::getUserId, user.getUserId())) > 0) { + throw new BusinessException("邮箱已存在"); + } + // 更新用户等级 + if (user.getGradeId() != null && !user.getGradeId().equals(0)) { + userService.updateById(user); + } + boolean result = baseMapper.updateById(user) > 0; + if (result && user.getRoles() != null && user.getRoles().size() > 0) { + userRoleService.remove(new LambdaUpdateWrapper().eq(UserRole::getUserId, user.getUserId())); + List roleIds = user.getRoles().stream().map(Role::getRoleId).collect(Collectors.toList()); + if (userRoleService.saveBatch(user.getUserId(), roleIds) < roleIds.size()) { + throw new BusinessException("用户角色添加失败"); + } + } + // 用户更新成功后,通过MQ异步同步用户数据到 websopy + if (result && syncMessageProducer != null) { + User updatedUser = getAllByUserId(String.valueOf(user.getUserId())); + if (updatedUser != null) { + syncMessageProducer.sendUserSyncMessage("websopy", "UPDATE", updatedUser); + log.info("用户更新后发送MQ消息同步到websopy: userId={}, phone={}", user.getUserId(), user.getPhone()); + } + } + return result; + } + + @Override + public boolean comparePassword(String dbPassword, String inputPassword) { + return bCryptPasswordEncoder.matches(inputPassword, dbPassword); + } + + @Override + public String encodePassword(String password) { + return password == null ? null : bCryptPasswordEncoder.encode(password); + } + + @Override + public User getByPhone(String phone) { + return getOne( + new LambdaQueryWrapper() + .eq(User::getPhone, phone) + .eq(User::getDeleted,0) + .orderByDesc(User::getUserId).last("limit 1") + ); + } + + @Override + public User getByPhone(String phone,Integer tenantId) { + return getOne( + new LambdaQueryWrapper() + .eq(User::getPhone, phone) + .eq(User::getTenantId, tenantId) + .eq(User::getDeleted,0) + .orderByDesc(User::getUserId).last("limit 1") + ); + } + + @Override + public User getByUnionId(UserParam param) { + return getOne( + new LambdaQueryWrapper() + .eq(User::getUnionid, param.getUnionid()) + .last("limit 1") + ); + } + + @Override + public User getByOauthId(UserParam userParam) { + return userParam.getOne(baseMapper.getOne(userParam)); + } + + @Override + public List listStatisticsRel(UserParam param) { + List list = baseMapper.selectListStatisticsRel(param); + return list; + } + + /** + * 更新用户信息(跨租户) + * + * @param user 用户信息 + */ + @Override + public void updateByUserId(User user) { + baseMapper.updateByUserId(user); + } + + @Override + public User addUser(UserParam userParam) { + User addUser = new User(); + // 注册用户 + addUser.setStatus(0); + if(userParam.getUsername() != null){ + addUser.setUsername(userParam.getUsername()); + } + if(userParam.getEmail() != null){ + addUser.setEmail(userParam.getEmail()); + } + addUser.setNickname(DesensitizedUtil.mobilePhone(userParam.getPhone())); + addUser.setPlatform(WEB); + addUser.setGradeId(2); + if(userParam.getTemplateId() != null){ + addUser.setTemplateId(userParam.getTemplateId()); + } + if(userParam.getPhone() != null){ + addUser.setPhone(userParam.getPhone()); + } + if(userParam.getPassword() != null){ + addUser.setPassword(encodePassword(userParam.getPassword())); + }else { + addUser.setPassword(encodePassword(CommonUtil.randomUUID16())); + } + if(userParam.getProvince() != null){ + addUser.setProvince(userParam.getProvince()); + } + if(userParam.getCity() != null){ + addUser.setCity(userParam.getCity()); + } + if(userParam.getRegion() != null){ + addUser.setRegion(userParam.getRegion()); + } + if(userParam.getIsAdmin() != null){ + addUser.setIsAdmin(userParam.getIsAdmin()); + } + if(userParam.getAddress() != null){ + addUser.setAddress(userParam.getAddress()); + } + if(userParam.getIndustryParent() != null){ + addUser.setIndustryParent(userParam.getIndustryParent()); + addUser.setIndustryChild(userParam.getIndustryChild()); + } + if (userParam.getGradeId() != null) { + addUser.setGradeId(userParam.getGradeId()); + } + addUser.setTenantId(userParam.getTenantId()); + addUser.setRecommend(0); + // Role assignment: + // - If roleId is provided (e.g. invite flow), use it (must belong to the same tenant). + // - Otherwise, fall back to roleCode; default to "user". + Role role = null; + if (userParam.getRoleId() != null) { + role = roleService.getById(userParam.getRoleId()); + if (role != null + && addUser.getTenantId() != null + && role.getTenantId() != null + && !addUser.getTenantId().equals(role.getTenantId())) { + throw new BusinessException("角色不属于当前租户"); + } + } + String roleCode = userParam.getRoleCode(); + if (role == null) { + roleCode = StrUtil.blankToDefault(roleCode, "user"); + QueryWrapper roleQw = new QueryWrapper().eq("role_code", roleCode); + if (addUser.getTenantId() != null) { + roleQw.eq("tenant_id", addUser.getTenantId()); + } + role = roleService.getOne(roleQw, false); + // If the default "user" role is missing (fresh DB / incomplete init), create it to avoid empty roles. + if (role == null && addUser.getTenantId() != null && "user".equals(roleCode)) { + Role defaultRole = new Role(); + defaultRole.setRoleName("注册用户"); + defaultRole.setRoleCode("user"); + defaultRole.setComments("普通注册用户"); + defaultRole.setTenantId(addUser.getTenantId()); + roleService.save(defaultRole); + role = defaultRole; + } + } + if (role == null) { + throw new BusinessException("缺少默认角色(role_code=" + (roleCode == null ? "user" : roleCode) + "),请先初始化角色"); + } + addUser.setRoleId(role.getRoleId()); + if (saveUser(addUser)) { + // 添加用户角色 + final UserRole userRole = new UserRole(); + userRole.setUserId(addUser.getUserId()); + userRole.setTenantId(addUser.getTenantId()); + userRole.setRoleId(addUser.getRoleId()); + userRoleService.save(userRole); + } + // Ensure caller (e.g. register / invite register) gets non-empty roles/authorities in response. + addUser.setRoles(userRoleService.listByUserId(addUser.getUserId())); + addUser.setAuthorities(roleMenuService.listMenuByUserId(addUser.getUserId(), null)); + // addUser内部调用saveUser,saveUser已发送MQ消息,这里不需要重复发送 + return addUser; + } + + @Override + public User getAdminByPhone(UserParam param) { + return baseMapper.selectAdminByPhone(param); + } + + public User getAdminByPhone(UserParam param,Integer tenantId){ + return baseMapper.selectAdminByPhone(param,tenantId); + } + + @Override + public List getAdminsByPhone(LoginParam param){ + final UserParam userParam = new UserParam(); + userParam.setPhone(param.getPhone()); + userParam.setIsAdmin(true); + if(param.getTemplateId() != null){ + userParam.setTemplateId(param.getTemplateId()); + } + return baseMapper.selectListAllRel(userParam); + } + + @Override + public List pageAll(UserParam param) { + return baseMapper.pageRelAll(param); + } + + @Override + public User getByUserId(String userId) { + return baseMapper.getByUserId(userId); + } + + @Override + public User getAllByUserId(String userId) { + return getOne(new LambdaQueryWrapper().eq(User::getUserId, userId).last("limit 1")); + } + + /** + * 批量查询用户的角色 + * + * @param users 用户集合 + */ + private void selectUserRoles(List users) { + if (users != null && !users.isEmpty()) { + List userIds = users.stream().map(User::getUserId).collect(Collectors.toList()); + List userRoles = userRoleService.listByUserIds(userIds); + for (User user : users) { + List roles = userRoles.stream().filter(d -> user.getUserId().equals(d.getUserId())) + .collect(Collectors.toList()); + user.setRoles(roles); + // 上级 + UserReferee userReferee = userRefereeService.getByUserId(user.getUserId()); + if (userReferee != null) { + User parent = getByIdRel(userReferee.getDealerId()); + user.setReferee(parent); + } + } + } + } + + @Override + public Integer userNumInPark(UserParam param) { + List organizationList = organizationService.list( + new LambdaQueryWrapper() + .eq(Organization::getPark, param.getPark()) + ); + if (organizationList != null && !organizationList.isEmpty()) { + return count( + new LambdaQueryWrapper() + .in(User::getOrganizationId, organizationList.stream().map(Organization::getOrganizationId).collect(Collectors.toList())) + ); + } + return 0; + } + + @Override + public Integer orgNumInPark(UserParam param) { + return organizationService.count( + new LambdaQueryWrapper() + .eq(Organization::getPark, param.getPark()) + ); + } + + @Override + public List findAccountsByPhone(String phone) { + if (StrUtil.isBlank(phone)) { + return null; + } + return baseMapper.selectAccountsByPhone(phone); + } + + @Override + public Integer countAccountsByPhone(String phone) { + if (StrUtil.isBlank(phone)) { + return 0; + } + return baseMapper.countByPhone(phone); + } + + @Override + @Transactional(rollbackFor = Exception.class, isolation = Isolation.SERIALIZABLE) + public boolean resetUserPassword(String userId, Integer tenantId, String newPassword) { + if (StrUtil.isBlank(userId) || tenantId == null || StrUtil.isBlank(newPassword)) { + throw new BusinessException("参数不能为空"); + } + + // 先查询用户是否存在(忽略租户隔离) + User existingUser = baseMapper.getByUserId(userId); + if (existingUser == null) { + throw new BusinessException("用户不存在"); + } + + // 验证租户ID是否匹配 + if (!tenantId.equals(existingUser.getTenantId())) { + throw new BusinessException("租户信息不匹配"); + } + + // 加密新密码 + String encodedPassword = encodePassword(newPassword); + + // 使用跨租户更新方法 + User updateUser = new User(); + updateUser.setUserId(Integer.parseInt(userId)); + updateUser.setPassword(encodedPassword); + baseMapper.updateByUserId(updateUser); + + return true; + } +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/UserVerifyServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/UserVerifyServiceImpl.java new file mode 100644 index 0000000..3560005 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/UserVerifyServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.system.mapper.UserVerifyMapper; +import com.gxwebsoft.common.system.service.UserVerifyService; +import com.gxwebsoft.common.system.entity.UserVerify; +import com.gxwebsoft.common.system.param.UserVerifyParam; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 实名认证Service实现 + * + * @author 科技小王子 + * @since 2025-05-29 23:01:04 + */ +@Service +public class UserVerifyServiceImpl extends ServiceImpl implements UserVerifyService { + + @Override + public PageResult pageRel(UserVerifyParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(UserVerifyParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public UserVerify getByIdRel(Integer id) { + UserVerifyParam param = new UserVerifyParam(); + param.setId(id); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/VersionServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/VersionServiceImpl.java new file mode 100644 index 0000000..70b147e --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/VersionServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.system.mapper.VersionMapper; +import com.gxwebsoft.common.system.service.VersionService; +import com.gxwebsoft.common.system.entity.Version; +import com.gxwebsoft.common.system.param.VersionParam; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 版本更新Service实现 + * + * @author 科技小王子 + * @since 2024-01-15 18:52:24 + */ +@Service +public class VersionServiceImpl extends ServiceImpl implements VersionService { + + @Override + public PageResult pageRel(VersionParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(VersionParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + //page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public Version getByIdRel(Integer id) { + VersionParam param = new VersionParam(); + param.setId(id); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/WebsiteFieldServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/WebsiteFieldServiceImpl.java new file mode 100644 index 0000000..929e8e1 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/WebsiteFieldServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.system.mapper.WebsiteFieldMapper; +import com.gxwebsoft.common.system.service.WebsiteFieldService; +import com.gxwebsoft.common.system.entity.WebsiteField; +import com.gxwebsoft.common.system.param.WebsiteFieldParam; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 应用参数Service实现 + * + * @author 科技小王子 + * @since 2024-08-27 15:18:05 + */ +@Service +public class WebsiteFieldServiceImpl extends ServiceImpl implements WebsiteFieldService { + + @Override + public PageResult pageRel(WebsiteFieldParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("sort_number asc, create_time asc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(WebsiteFieldParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + page.setDefaultOrder("sort_number asc, create_time asc"); + return page.sortRecords(list); + } + + @Override + public WebsiteField getByIdRel(Integer id) { + WebsiteFieldParam param = new WebsiteFieldParam(); + param.setId(id); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/WhiteDomainServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/WhiteDomainServiceImpl.java new file mode 100644 index 0000000..7aa920f --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/WhiteDomainServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.common.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.system.mapper.WhiteDomainMapper; +import com.gxwebsoft.common.system.service.WhiteDomainService; +import com.gxwebsoft.common.system.entity.WhiteDomain; +import com.gxwebsoft.common.system.param.WhiteDomainParam; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 服务器白名单Service实现 + * + * @author 科技小王子 + * @since 2024-03-26 00:22:21 + */ +@Service +public class WhiteDomainServiceImpl extends ServiceImpl implements WhiteDomainService { + + @Override + public PageResult pageRel(WhiteDomainParam param) { + PageParam page = new PageParam<>(param); + //page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(WhiteDomainParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + //page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public WhiteDomain getByIdRel(Integer id) { + WhiteDomainParam param = new WhiteDomainParam(); + param.setId(id); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/util/EmailTemplateUtil.java b/src/main/java/com/gxwebsoft/common/system/util/EmailTemplateUtil.java new file mode 100644 index 0000000..c547387 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/util/EmailTemplateUtil.java @@ -0,0 +1,199 @@ +package com.gxwebsoft.common.system.util; + +import cn.hutool.core.date.DateUtil; +import com.gxwebsoft.common.system.service.EmailRecordService; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.Map; + +/** + * 邮件模板工具类 + * 统一管理邮件模板和发送逻辑 + * + * @author WebSoft + * @since 2024-08-28 + */ +@Component +public class EmailTemplateUtil { + + @Resource + private EmailRecordService emailRecordService; + + /** + * 发送注册成功邮件 + * + * @param username 用户名 + * @param phone 手机号 + * @param password 密码 + * @param email 邮箱 + * @param tenantId 租户ID + */ + public void sendRegisterSuccessEmail(String username, String phone, String password, String email, Integer tenantId) { + try { + String title = "恭喜!您的账号已注册成功"; + Map data = new HashMap<>(); + data.put("username", username); + data.put("phone", phone); + data.put("password", password); + if (email != null && !email.trim().isEmpty()) { + data.put("email", email); + } + + emailRecordService.sendHtmlEmail(title, "register-success.html", data, new String[]{email}); + } catch (Exception e) { + // 如果HTML邮件发送失败,降级为文本邮件 + String content = "恭喜!您的WebSoft账号已注册成功\r\n用户名:" + username + "\r\n手机号码:" + phone + "\r\n密码:" + password; + emailRecordService.sendEmail("恭喜!您的WebSoft账号已注册成功", content, email, tenantId); + } + } + + /** + * 发送密码重置邮件 + * + * @param username 用户名 + * @param phone 手机号 + * @param newPassword 新密码 + * @param email 邮箱 + * @param tenantId 租户ID + */ + public void sendPasswordResetEmail(String username, String phone, String newPassword, String email, Integer tenantId) { + try { + String title = "WebSoft密码重置通知"; + Map data = new HashMap<>(); + data.put("username", username); + data.put("phone", phone); + data.put("resetTime", DateUtil.now()); + if (newPassword != null && !newPassword.trim().isEmpty()) { + data.put("newPassword", newPassword); + } + + emailRecordService.sendHtmlEmail(title, "password-reset.html", data, new String[]{email}); + } catch (Exception e) { + // 如果HTML邮件发送失败,降级为文本邮件 + String content = "您的WebSoft账号密码已重置\r\n用户名:" + username + "\r\n手机号码:" + phone + "\r\n新密码:" + newPassword + "\r\n重置时间:" + DateUtil.now(); + emailRecordService.sendEmail("WebSoft密码重置通知", content, email, tenantId); + } + } + + /** + * 发送通用通知邮件 + * + * @param title 邮件标题 + * @param content 邮件内容 + * @param email 收件人邮箱 + * @param tenantId 租户ID + * @param greeting 问候语(可选) + * @param infoMessage 提示信息(可选) + * @param actionUrl 操作链接(可选) + * @param actionText 操作按钮文字(可选) + */ + public void sendNotificationEmail(String title, String content, String email, Integer tenantId, + String greeting, String infoMessage, String actionUrl, String actionText) { + try { + Map data = new HashMap<>(); + data.put("title", title); + data.put("content", content); + data.put("sendTime", DateUtil.now()); + + if (greeting != null && !greeting.trim().isEmpty()) { + data.put("greeting", greeting); + } + if (infoMessage != null && !infoMessage.trim().isEmpty()) { + data.put("infoMessage", infoMessage); + } + if (actionUrl != null && !actionUrl.trim().isEmpty()) { + data.put("actionUrl", actionUrl); + } + if (actionText != null && !actionText.trim().isEmpty()) { + data.put("actionText", actionText); + } + + emailRecordService.sendHtmlEmail(title, "notification.html", data, new String[]{email}); + } catch (Exception e) { + // 如果HTML邮件发送失败,降级为文本邮件 + emailRecordService.sendEmail(title, content, email, tenantId); + } + } + + /** + * 发送简单通知邮件 + * + * @param title 邮件标题 + * @param content 邮件内容 + * @param email 收件人邮箱 + * @param tenantId 租户ID + */ + public void sendNotificationEmail(String title, String content, String email, Integer tenantId) { + sendNotificationEmail(title, content, email, tenantId, null, null, null, null); + } + + /** + * 发送带操作按钮的通知邮件 + * + * @param title 邮件标题 + * @param content 邮件内容 + * @param email 收件人邮箱 + * @param tenantId 租户ID + * @param actionUrl 操作链接 + * @param actionText 操作按钮文字 + */ + public void sendNotificationEmailWithAction(String title, String content, String email, Integer tenantId, + String actionUrl, String actionText) { + sendNotificationEmail(title, content, email, tenantId, null, null, actionUrl, actionText); + } + + /** + * 发送账户安全提醒邮件 + * + * @param username 用户名 + * @param phone 手机号 + * @param email 邮箱 + * @param tenantId 租户ID + * @param event 安全事件描述 + */ + public void sendSecurityAlertEmail(String username, String phone, String email, Integer tenantId, String event) { + String title = "WebSoft账户安全提醒"; + String content = "您的账户发生了以下安全事件:" + event + "。如果这不是您本人的操作,请立即联系客服并修改密码。"; + String infoMessage = "为了保障您的账户安全,建议您定期修改密码并开启双重验证。"; + String actionUrl = "https://websoft.top/security"; + String actionText = "查看安全设置"; + + sendNotificationEmail(title, content, email, tenantId, "尊敬的用户", infoMessage, actionUrl, actionText); + } + + /** + * 发送系统维护通知邮件 + * + * @param email 收件人邮箱 + * @param tenantId 租户ID + * @param maintenanceTime 维护时间 + * @param duration 维护时长 + */ + public void sendMaintenanceNotificationEmail(String email, Integer tenantId, String maintenanceTime, String duration) { + String title = "WebSoft系统维护通知"; + String content = "为了提供更好的服务,我们将在 " + maintenanceTime + " 进行系统维护,预计维护时长:" + duration + "。维护期间可能会影响系统的正常使用,给您带来的不便敬请谅解。"; + String infoMessage = "维护完成后,系统将自动恢复正常服务。"; + + sendNotificationEmail(title, content, email, tenantId, "尊敬的用户", infoMessage, null, null); + } + + /** + * 发送订单状态变更邮件 + * + * @param username 用户名 + * @param orderNo 订单号 + * @param status 订单状态 + * @param email 邮箱 + * @param tenantId 租户ID + */ + public void sendOrderStatusEmail(String username, String orderNo, String status, String email, Integer tenantId) { + String title = "WebSoft订单状态更新"; + String content = "您的订单 " + orderNo + " 状态已更新为:" + status + "。"; + String actionUrl = "https://websoft.top/orders/" + orderNo; + String actionText = "查看订单详情"; + + sendNotificationEmailWithAction(title, content, email, tenantId, actionUrl, actionText); + } +} diff --git a/src/main/java/com/gxwebsoft/common/system/vo/ChatConversationVO.java b/src/main/java/com/gxwebsoft/common/system/vo/ChatConversationVO.java new file mode 100644 index 0000000..d31eb23 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/vo/ChatConversationVO.java @@ -0,0 +1,18 @@ +package com.gxwebsoft.common.system.vo; + +import com.gxwebsoft.common.system.entity.ChatConversation; +import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.common.system.entity.ChatMessage; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class ChatConversationVO extends ChatConversation { + private User friendInfo; + private User userInfo; + private List messages = new ArrayList<>(); + private Integer messageCount; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/vo/PushMessageVO.java b/src/main/java/com/gxwebsoft/common/system/vo/PushMessageVO.java new file mode 100644 index 0000000..f1c78d6 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/vo/PushMessageVO.java @@ -0,0 +1,36 @@ +package com.gxwebsoft.common.system.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Builder; +import lombok.Data; + +import java.io.Serializable; +import java.util.Set; + +@Data +@Builder +public class PushMessageVO implements Serializable { + + @Schema(description = "推送消息") + private String title; + + @Schema(description = "推送消息内容") + private String content; + + private Set userIds; + + + @Schema(description = "推送透传数据obj格式") + private Payload payload; + + + private Set push_clientid; + + + @Data + public static class Payload { + private String type; + private Object data; + } + +} diff --git a/src/main/java/com/gxwebsoft/common/system/vo/WxOfficialButton.java b/src/main/java/com/gxwebsoft/common/system/vo/WxOfficialButton.java new file mode 100644 index 0000000..56c2391 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/vo/WxOfficialButton.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.common.system.vo; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import java.util.List; + +import java.io.Serializable; + +/** + * 访问凭证管理 + * + * @author 科技小王子 + * @since 2023-05-16 19:19:55 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "微信公众号菜单按钮", description = "微信公众号菜单按钮") +@TableName("wx_official_menu_button") +public class WxOfficialButton implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "按钮名称") + @TableField(exist = false) + private String name; + + @Schema(description = "按钮类型") + @TableField(exist = false) + private String type; + + @Schema(description = "内容") + @TableField(exist = false) + private String key; + + @Schema(description = "子菜单") + @TableField(exist = false) + private List sub_button; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/vo/WxOfficialMenu.java b/src/main/java/com/gxwebsoft/common/system/vo/WxOfficialMenu.java new file mode 100644 index 0000000..81400dd --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/vo/WxOfficialMenu.java @@ -0,0 +1,29 @@ +package com.gxwebsoft.common.system.vo; + +import com.baomidou.mybatisplus.annotation.*; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.List; + +/** + * 访问凭证管理 + * + * @author 科技小王子 + * @since 2023-05-16 19:19:55 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(name = "微信公众号菜单", description = "微信公众号菜单") +@TableName("wx_official_menu") +public class WxOfficialMenu implements Serializable { + private static final long serialVersionUID = 1L; + + @Schema(description = "微信公众号按钮") + @TableField(exist = false) + private List buttons; + +} diff --git a/src/main/java/com/gxwebsoft/common/system/vo/faceId/HeadPortraitResult.java b/src/main/java/com/gxwebsoft/common/system/vo/faceId/HeadPortraitResult.java new file mode 100644 index 0000000..01dae5d --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/vo/faceId/HeadPortraitResult.java @@ -0,0 +1,17 @@ +package com.gxwebsoft.common.system.vo.faceId; + + +import lombok.Data; + +@Data +public class HeadPortraitResult { + private String code; + private String msg; + private String porn; + private String ad; + private String requestId; + private Integer faceCount; + private Boolean cartoonImg; + private int[] genterList; + private int[] ageList; +} diff --git a/src/main/java/com/gxwebsoft/common/system/vo/idcheck/BackRecognitionResult.java b/src/main/java/com/gxwebsoft/common/system/vo/idcheck/BackRecognitionResult.java new file mode 100644 index 0000000..faae5b0 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/vo/idcheck/BackRecognitionResult.java @@ -0,0 +1,11 @@ +package com.gxwebsoft.common.system.vo.idcheck; + +import lombok.Data; + +@Data +public class BackRecognitionResult { + + private String startDate; + private String endDate; + private String issue; +} diff --git a/src/main/java/com/gxwebsoft/common/system/vo/idcheck/FrontRecognitionResult.java b/src/main/java/com/gxwebsoft/common/system/vo/idcheck/FrontRecognitionResult.java new file mode 100644 index 0000000..f68d06d --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/vo/idcheck/FrontRecognitionResult.java @@ -0,0 +1,15 @@ +package com.gxwebsoft.common.system.vo.idcheck; + +import lombok.Data; + +@Data +public class FrontRecognitionResult { + private String idcardno; + private String name; + private String nationality; + private String sex; + private String birth; + private String address; + private String imageStats; + private String direction; +} diff --git a/src/main/java/com/gxwebsoft/common/system/vo/idcheck/IdCardInfor.java b/src/main/java/com/gxwebsoft/common/system/vo/idcheck/IdCardInfor.java new file mode 100644 index 0000000..6feb209 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/vo/idcheck/IdCardInfor.java @@ -0,0 +1,14 @@ +package com.gxwebsoft.common.system.vo.idcheck; + +import lombok.Data; + +@Data +public class IdCardInfor { + private String province; + private String city; + private String district; + private String area; + private String sex; + private String birthday; +} + diff --git a/src/main/java/com/gxwebsoft/common/system/vo/idcheck/Response.java b/src/main/java/com/gxwebsoft/common/system/vo/idcheck/Response.java new file mode 100644 index 0000000..ec4d097 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/vo/idcheck/Response.java @@ -0,0 +1,10 @@ +package com.gxwebsoft.common.system.vo.idcheck; + +import lombok.Data; + +@Data +public class Response { + private Integer error_code; + private String reason; + private T result; +} diff --git a/src/main/java/com/gxwebsoft/common/system/vo/idcheck/VerifyResult.java b/src/main/java/com/gxwebsoft/common/system/vo/idcheck/VerifyResult.java new file mode 100644 index 0000000..f466341 --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/system/vo/idcheck/VerifyResult.java @@ -0,0 +1,14 @@ +package com.gxwebsoft.common.system.vo.idcheck; + +import lombok.Data; + +@Data +public class VerifyResult { + private String realname; + private String idcard; + + private boolean isOk; + + private IdCardInfor idCardInfor; + +} diff --git a/src/main/java/com/qq/weixin/mp/aes/AesException.java b/src/main/java/com/qq/weixin/mp/aes/AesException.java new file mode 100644 index 0000000..868637e --- /dev/null +++ b/src/main/java/com/qq/weixin/mp/aes/AesException.java @@ -0,0 +1,59 @@ +package com.qq.weixin.mp.aes; + +@SuppressWarnings("serial") +public class AesException extends Exception { + + public final static int OK = 0; + public final static int ValidateSignatureError = -40001; + public final static int ParseJsonError = -40002; + public final static int ComputeSignatureError = -40003; + public final static int IllegalAesKey = -40004; + public final static int ValidateCorpidError = -40005; + public final static int EncryptAESError = -40006; + public final static int DecryptAESError = -40007; + public final static int IllegalBuffer = -40008; + public final static int EncodeBase64Error = -40009; + public final static int DecodeBase64Error = -40010; + public final static int GenReturnJsonError = -40011; + + private int code; + + private static String getMessage(int code) { + switch (code) { + case ValidateSignatureError: + return "签名验证错误"; + case ParseJsonError: + return "json解析失败"; + case ComputeSignatureError: + return "sha加密生成签名失败"; + case IllegalAesKey: + return "SymmetricKey非法"; + case ValidateCorpidError: + return "corpid校验失败"; + case EncryptAESError: + return "aes加密失败"; + case DecryptAESError: + return "aes解密失败"; + case IllegalBuffer: + return "解密后得到的buffer非法"; + case EncodeBase64Error: + return "base64加密错误"; + case DecodeBase64Error: + return "base64解密错误"; + case GenReturnJsonError: + return "josn生成失败"; + default: + return null; // cannot be + } + } + + public int getCode() { + return code; + } + + AesException(int code) { + super(getMessage(code)); + this.code = code; + } + +} diff --git a/src/main/java/com/qq/weixin/mp/aes/ByteGroup.java b/src/main/java/com/qq/weixin/mp/aes/ByteGroup.java new file mode 100644 index 0000000..6ba4330 --- /dev/null +++ b/src/main/java/com/qq/weixin/mp/aes/ByteGroup.java @@ -0,0 +1,26 @@ +package com.qq.weixin.mp.aes; + +import java.util.ArrayList; + +class ByteGroup { + ArrayList byteContainer = new ArrayList(); + + public byte[] toBytes() { + byte[] bytes = new byte[byteContainer.size()]; + for (int i = 0; i < byteContainer.size(); i++) { + bytes[i] = byteContainer.get(i); + } + return bytes; + } + + public ByteGroup addBytes(byte[] bytes) { + for (byte b : bytes) { + byteContainer.add(b); + } + return this; + } + + public int size() { + return byteContainer.size(); + } +} diff --git a/src/main/java/com/qq/weixin/mp/aes/JsonParse.java b/src/main/java/com/qq/weixin/mp/aes/JsonParse.java new file mode 100644 index 0000000..4a0f4ec --- /dev/null +++ b/src/main/java/com/qq/weixin/mp/aes/JsonParse.java @@ -0,0 +1,65 @@ +/** + * 对企业微信发送给企业后台的消息加解密示例代码. + * + * @copyright Copyright (c) 1998-2020 Tencent Inc. + */ + +// ------------------------------------------------------------------------ + +package com.qq.weixin.mp.aes; + +/** + * 针对 org.json.JSONObject, + * 要编译打包架包json + * 官方源码下载地址 : https://github.com/stleary/JSON-java, jar包下载地址 : https://mvnrepository.com/artifact/org.json/json + */ +import org.json.JSONObject; + + +/** + * JsonParse class + * + * 提供提取消息格式中的密文及生成回复消息格式的接口. + */ +class JsonParse { + + /** + * 提取出 JSON 包中的加密消息 + * @param jsontext 待提取的json字符串 + * @return 提取出的加密消息字符串 + * @throws AesException + */ + public static Object[] extract(String jsontext) throws AesException { + Object[] result = new Object[3]; + try { + + JSONObject json = new JSONObject(jsontext); + String encrypt_msg = json.getString("encrypt"); + String tousername = json.getString("tousername"); + String agentid = json.getString("agentid"); + + result[0] = tousername; + result[1] = encrypt_msg; + result[2] = agentid; + return result; + } catch (Exception e) { + e.printStackTrace(); + throw new AesException(AesException.ParseJsonError); + } + } + + /** + * 生成json消息 + * @param encrypt 加密后的消息密文 + * @param signature 安全签名 + * @param timestamp 时间戳 + * @param nonce 随机字符串 + * @return 生成的json字符串 + */ + public static String generate(String encrypt, String signature, String timestamp, String nonce) { + + String format = "{\"encrypt\":\"%1$s\",\"msgsignature\":\"%2$s\",\"timestamp\":\"%3$s\",\"nonce\":\"%4$s\"}"; + return String.format(format, encrypt, signature, timestamp, nonce); + + } +} diff --git a/src/main/java/com/qq/weixin/mp/aes/PKCS7Encoder.java b/src/main/java/com/qq/weixin/mp/aes/PKCS7Encoder.java new file mode 100644 index 0000000..f7ad49f --- /dev/null +++ b/src/main/java/com/qq/weixin/mp/aes/PKCS7Encoder.java @@ -0,0 +1,67 @@ +/** + * 对企业微信发送给企业后台的消息加解密示例代码. + * + * @copyright Copyright (c) 1998-2014 Tencent Inc. + */ + +// ------------------------------------------------------------------------ + +package com.qq.weixin.mp.aes; + +import java.nio.charset.Charset; +import java.util.Arrays; + +/** + * 提供基于PKCS7算法的加解密接口. + */ +class PKCS7Encoder { + static Charset CHARSET = Charset.forName("utf-8"); + static int BLOCK_SIZE = 32; + + /** + * 获得对明文进行补位填充的字节. + * + * @param count 需要进行填充补位操作的明文字节个数 + * @return 补齐用的字节数组 + */ + static byte[] encode(int count) { + // 计算需要填充的位数 + int amountToPad = BLOCK_SIZE - (count % BLOCK_SIZE); + if (amountToPad == 0) { + amountToPad = BLOCK_SIZE; + } + // 获得补位所用的字符 + char padChr = chr(amountToPad); + String tmp = new String(); + for (int index = 0; index < amountToPad; index++) { + tmp += padChr; + } + return tmp.getBytes(CHARSET); + } + + /** + * 删除解密后明文的补位字符 + * + * @param decrypted 解密后的明文 + * @return 删除补位字符后的明文 + */ + static byte[] decode(byte[] decrypted) { + int pad = (int) decrypted[decrypted.length - 1]; + if (pad < 1 || pad > 32) { + pad = 0; + } + return Arrays.copyOfRange(decrypted, 0, decrypted.length - pad); + } + + /** + * 将数字转化成ASCII码对应的字符,用于对明文进行补码 + * + * @param a 需要转化的数字 + * @return 转化得到的字符 + */ + static char chr(int a) { + byte target = (byte) (a & 0xFF); + return (char) target; + } + +} diff --git a/src/main/java/com/qq/weixin/mp/aes/SHA1.java b/src/main/java/com/qq/weixin/mp/aes/SHA1.java new file mode 100644 index 0000000..a6af45d --- /dev/null +++ b/src/main/java/com/qq/weixin/mp/aes/SHA1.java @@ -0,0 +1,61 @@ +/** + * 对企业微信发送给企业后台的消息加解密示例代码. + * + * @copyright Copyright (c) 1998-2014 Tencent Inc. + */ + +// ------------------------------------------------------------------------ + +package com.qq.weixin.mp.aes; + +import java.security.MessageDigest; +import java.util.Arrays; + +/** + * SHA1 class + * + * 计算消息签名接口. + */ +class SHA1 { + + /** + * 用SHA1算法生成安全签名 + * @param token 票据 + * @param timestamp 时间戳 + * @param nonce 随机字符串 + * @param encrypt 密文 + * @return 安全签名 + * @throws AesException + */ + public static String getSHA1(String token, String timestamp, String nonce, String encrypt) throws AesException + { + try { + String[] array = new String[] { token, timestamp, nonce, encrypt }; + StringBuffer sb = new StringBuffer(); + // 字符串排序 + Arrays.sort(array); + for (int i = 0; i < 4; i++) { + sb.append(array[i]); + } + String str = sb.toString(); + // SHA1签名生成 + MessageDigest md = MessageDigest.getInstance("SHA-1"); + md.update(str.getBytes()); + byte[] digest = md.digest(); + + StringBuffer hexstr = new StringBuffer(); + String shaHex = ""; + for (int i = 0; i < digest.length; i++) { + shaHex = Integer.toHexString(digest[i] & 0xFF); + if (shaHex.length() < 2) { + hexstr.append(0); + } + hexstr.append(shaHex); + } + return hexstr.toString(); + } catch (Exception e) { + e.printStackTrace(); + throw new AesException(AesException.ComputeSignatureError); + } + } +} diff --git a/src/main/java/com/qq/weixin/mp/aes/WXBizJsonMsgCrypt.java b/src/main/java/com/qq/weixin/mp/aes/WXBizJsonMsgCrypt.java new file mode 100644 index 0000000..d04ad13 --- /dev/null +++ b/src/main/java/com/qq/weixin/mp/aes/WXBizJsonMsgCrypt.java @@ -0,0 +1,295 @@ +/** + * 对企业微信发送给企业后台的消息加解密示例代码. + * + * @copyright Copyright (c) 1998-2014 Tencent Inc. + */ + +// ------------------------------------------------------------------------ + +/** + * 针对org.apache.commons.codec.binary.Base64, + * 需要导入架包commons-codec-1.9(或commons-codec-1.8等其他版本) + * 官方下载地址:http://commons.apache.org/proper/commons-codec/download_codec.cgi + */ +package com.qq.weixin.mp.aes; + +import java.nio.charset.Charset; +import java.util.Arrays; +import java.util.Random; + +import javax.crypto.Cipher; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; + +import org.apache.commons.codec.binary.Base64; + +/** + * 提供接收和推送给企业微信消息的加解密接口(UTF8编码的字符串). + *
    + *
  1. 第三方回复加密消息给企业微信
  2. + *
  3. 第三方收到企业微信发送的消息,验证消息的安全性,并对消息进行解密。
  4. + *
+ * 说明:异常java.security.InvalidKeyException:illegal Key Size的解决方案 + *
    + *
  1. 在官方网站下载JCE无限制权限策略文件(JDK7的下载地址: + * http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html
  2. + *
  3. 下载后解压,可以看到local_policy.jar和US_export_policy.jar以及readme.txt
  4. + *
  5. 如果安装了JRE,将两个jar文件放到%JRE_HOME%\lib\security目录下覆盖原来的文件
  6. + *
  7. 如果安装了JDK,将两个jar文件放到%JDK_HOME%\jre\lib\security目录下覆盖原来文件
  8. + *
+ */ +public class WXBizJsonMsgCrypt { + static Charset CHARSET = Charset.forName("utf-8"); + Base64 base64 = new Base64(); + byte[] aesKey; + String token; + String receiveid; + + /** + * 构造函数 + * @param token 企业微信后台,开发者设置的token + * @param encodingAesKey 企业微信后台,开发者设置的EncodingAESKey + * @param receiveid, 不同场景含义不同,详见文档 + * + * @throws AesException 执行失败,请查看该异常的错误码和具体的错误信息 + */ + public WXBizJsonMsgCrypt(String token, String encodingAesKey, String receiveid) throws AesException { + if (encodingAesKey.length() != 43) { + throw new AesException(AesException.IllegalAesKey); + } + + this.token = token; + this.receiveid = receiveid; + aesKey = Base64.decodeBase64(encodingAesKey + "="); + } + + // 生成4个字节的网络字节序 + byte[] getNetworkBytesOrder(int sourceNumber) { + byte[] orderBytes = new byte[4]; + orderBytes[3] = (byte) (sourceNumber & 0xFF); + orderBytes[2] = (byte) (sourceNumber >> 8 & 0xFF); + orderBytes[1] = (byte) (sourceNumber >> 16 & 0xFF); + orderBytes[0] = (byte) (sourceNumber >> 24 & 0xFF); + return orderBytes; + } + + // 还原4个字节的网络字节序 + int recoverNetworkBytesOrder(byte[] orderBytes) { + int sourceNumber = 0; + for (int i = 0; i < 4; i++) { + sourceNumber <<= 8; + sourceNumber |= orderBytes[i] & 0xff; + } + return sourceNumber; + } + + // 随机生成16位字符串 + String getRandomStr() { + String base = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; + Random random = new Random(); + StringBuffer sb = new StringBuffer(); + for (int i = 0; i < 16; i++) { + int number = random.nextInt(base.length()); + sb.append(base.charAt(number)); + } + return sb.toString(); + } + + /** + * 对明文进行加密. + * + * @param text 需要加密的明文 + * @return 加密后base64编码的字符串 + * @throws AesException aes加密失败 + */ + String encrypt(String randomStr, String text) throws AesException { + ByteGroup byteCollector = new ByteGroup(); + byte[] randomStrBytes = randomStr.getBytes(CHARSET); + byte[] textBytes = text.getBytes(CHARSET); + byte[] networkBytesOrder = getNetworkBytesOrder(textBytes.length); + byte[] receiveidBytes = receiveid.getBytes(CHARSET); + + // randomStr + networkBytesOrder + text + receiveid + byteCollector.addBytes(randomStrBytes); + byteCollector.addBytes(networkBytesOrder); + byteCollector.addBytes(textBytes); + byteCollector.addBytes(receiveidBytes); + + // ... + pad: 使用自定义的填充方式对明文进行补位填充 + byte[] padBytes = PKCS7Encoder.encode(byteCollector.size()); + byteCollector.addBytes(padBytes); + + // 获得最终的字节流, 未加密 + byte[] unencrypted = byteCollector.toBytes(); + + try { + // 设置加密模式为AES的CBC模式 + Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding"); + SecretKeySpec keySpec = new SecretKeySpec(aesKey, "AES"); + IvParameterSpec iv = new IvParameterSpec(aesKey, 0, 16); + cipher.init(Cipher.ENCRYPT_MODE, keySpec, iv); + + // 加密 + byte[] encrypted = cipher.doFinal(unencrypted); + + // 使用BASE64对加密后的字符串进行编码 + String base64Encrypted = base64.encodeToString(encrypted); + + return base64Encrypted; + } catch (Exception e) { + e.printStackTrace(); + throw new AesException(AesException.EncryptAESError); + } + } + + /** + * 对密文进行解密. + * + * @param text 需要解密的密文 + * @return 解密得到的明文 + * @throws AesException aes解密失败 + */ + String decrypt(String text) throws AesException { + byte[] original; + try { + // 设置解密模式为AES的CBC模式 + Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding"); + SecretKeySpec key_spec = new SecretKeySpec(aesKey, "AES"); + IvParameterSpec iv = new IvParameterSpec(Arrays.copyOfRange(aesKey, 0, 16)); + cipher.init(Cipher.DECRYPT_MODE, key_spec, iv); + + // 使用BASE64对密文进行解码 + byte[] encrypted = Base64.decodeBase64(text); + + // 解密 + original = cipher.doFinal(encrypted); + } catch (Exception e) { + e.printStackTrace(); + throw new AesException(AesException.DecryptAESError); + } + + String jsonContent, from_receiveid; + try { + // 去除补位字符 + byte[] bytes = PKCS7Encoder.decode(original); + + // 分离16位随机字符串,网络字节序和receiveid + byte[] networkOrder = Arrays.copyOfRange(bytes, 16, 20); + + int jsonLength = recoverNetworkBytesOrder(networkOrder); + + jsonContent = new String(Arrays.copyOfRange(bytes, 20, 20 + jsonLength), CHARSET); + from_receiveid = new String(Arrays.copyOfRange(bytes, 20 + jsonLength, bytes.length), + CHARSET); + } catch (Exception e) { + e.printStackTrace(); + throw new AesException(AesException.IllegalBuffer); + } + + // receiveid不相同的情况 + if (!from_receiveid.equals(receiveid)) { + throw new AesException(AesException.ValidateCorpidError); + } + return jsonContent; + + } + + /** + * 将企业微信回复用户的消息加密打包. + *
    + *
  1. 对要发送的消息进行AES-CBC加密
  2. + *
  3. 生成安全签名
  4. + *
  5. 将消息密文和安全签名打包成json格式
  6. + *
+ * + * @param replyMsg 企业微信待回复用户的消息,json格式的字符串 + * @param timeStamp 时间戳,可以自己生成,也可以用URL参数的timestamp + * @param nonce 随机串,可以自己生成,也可以用URL参数的nonce + * + * @return 加密后的可以直接回复用户的密文,包括msg_signature, timestamp, nonce, encrypt的json格式的字符串 + * @throws AesException 执行失败,请查看该异常的错误码和具体的错误信息 + */ + public String EncryptMsg(String replyMsg, String timeStamp, String nonce) throws AesException { + // 加密 + String encrypt = encrypt(getRandomStr(), replyMsg); + + // 生成安全签名 + if (timeStamp == "") { + timeStamp = Long.toString(System.currentTimeMillis()); + } + + String signature = SHA1.getSHA1(token, timeStamp, nonce, encrypt); + + // System.out.println("发送给平台的签名是: " + signature[1].toString()); + // 生成发送的json + String result = JsonParse.generate(encrypt, signature, timeStamp, nonce); + return result; + } + + /** + * 检验消息的真实性,并且获取解密后的明文. + *
    + *
  1. 利用收到的密文生成安全签名,进行签名验证
  2. + *
  3. 若验证通过,则提取json中的加密消息
  4. + *
  5. 对消息进行解密
  6. + *
+ * + * @param msgSignature 签名串,对应URL参数的msg_signature + * @param timeStamp 时间戳,对应URL参数的timestamp + * @param nonce 随机串,对应URL参数的nonce + * @param postData 密文,对应POST请求的数据 + * + * @return 解密后的原文 + * @throws AesException 执行失败,请查看该异常的错误码和具体的错误信息 + */ + public String DecryptMsg(String msgSignature, String timeStamp, String nonce, String postData) + throws AesException { + + // 密钥,公众账号的app secret + // 提取密文 + Object[] encrypt = JsonParse.extract(postData); + return decryptByCipherText(msgSignature, timeStamp, nonce, encrypt[1].toString()); + } + + /** + * 适配公众号/服务号 XML 回调:直接传入 节点中的密文进行验签与解密。 + */ + public String DecryptXmlMsg(String msgSignature, String timeStamp, String nonce, String encryptedMsg) + throws AesException { + return decryptByCipherText(msgSignature, timeStamp, nonce, encryptedMsg); + } + + private String decryptByCipherText(String msgSignature, String timeStamp, String nonce, String encryptedMsg) + throws AesException { + String signature = SHA1.getSHA1(token, timeStamp, nonce, encryptedMsg); + + if (!signature.equals(msgSignature)) { + throw new AesException(AesException.ValidateSignatureError); + } + + return decrypt(encryptedMsg); + } + + /** + * 验证URL + * @param msgSignature 签名串,对应URL参数的msg_signature + * @param timeStamp 时间戳,对应URL参数的timestamp + * @param nonce 随机串,对应URL参数的nonce + * @param echoStr 随机串,对应URL参数的echostr + * + * @return 解密之后的echostr + * @throws AesException 执行失败,请查看该异常的错误码和具体的错误信息 + */ + public String VerifyURL(String msgSignature, String timeStamp, String nonce, String echoStr) + throws AesException { + String signature = SHA1.getSHA1(token, timeStamp, nonce, echoStr); + + if (!signature.equals(msgSignature)) { + throw new AesException(AesException.ValidateSignatureError); + } + + String result = decrypt(echoStr); + return result; + } + +} diff --git a/src/main/java/lib/commons-codec-1.9.jar b/src/main/java/lib/commons-codec-1.9.jar new file mode 100644 index 0000000000000000000000000000000000000000..ef35f1c50d7c41278bc31f4b9fcfc8fbd708d55d GIT binary patch literal 263965 zcmbTc18^tdw(gxw?1^pL_GDt)=0CP=+qP}nwv&l%JKyYm&bo zZ)&LaLFb-s=EbOXIV^>7$>ompf&xNL2b0k)3-X6+xAe6?uJLd3u6iAh%Nkyukp(0T zJsejE$D;@|644gq&YQ@(9doZZL6jfYcF!w0L2DVh&gUyVJm*>_Rcc;`Z_@}_2Y}7o zw)Oj%-ttZ?TQayGt8e5HGQAwpU%&o?*`xV+n3Mp zTld>=-M6z5@gN;wFL!k8b6!t7B$=Ohhk4|5im7X=**w|HXJkj!KGz*2cX{Zx?+Mp; z3_%q#>S*|E86hDd|Ttkf_FDd4D}axiDRY?NZmYI(y&6qBdVh z#^Qg=rw2EXT9WbAv;x77M0R}ew`II=;Dcd^2kRtL zk=5mU973#Rda*8IsQT zK+7RgJL%TkdD}&_Rm*+_p4~ZZzg0Q-x_?ycf-PU8rVZizETbc^o~om;+NR zFmQ>4zr(RCNO_J5j3%9udhM)dHRGe9oPPK#!iX0icJytV|DtpmSQ^tiZ7u>B-ZXwf zphm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OG&`1!LW?QK?E2_E|Fyu zB}1M99UcLD!M5nmF@zcLJ5J%q#|wEN43r$mI)|qa#=!4562WX~=YTeR2a4|_vj}63 z=s5a2z09H@qG2DXife;|Y5r(3zn6mitENrFh=#i$SfSX10(YH7juX(EolHbv8AHSFCy$ zO*I74Go(8}FKHNL2kQR;`M*Phj^YwvQ(U_QxYj^b85r&o`u~CZ&ly5TfiIESde{O7 z27*@^U~~IOtiJ#sK0|S^oRZ)Ln)QM%B?qIO67iovu0oxStRZp`CquivLMQ#c-$DJ% z*&5FLF3R!Qq!L&hU<7F-tbS|ce}O(+Kf0_LQ>s%)NZBO&i{9~<{sbat2wr4R+S|cy z2FjWaP;kZ|+?Q$gx;Ci>CkrPiu=fz`ueT6i`y<{DOCGMytCfa{bl@sN-2Df{#47)Z zczJh63kx{)`nQeeUIl{A<}BM`zNxMAf}+gZK4cywl#rw!qkm7J?#cyKsp0l z!Vc5i42=JTainm)ZNq1EV8rVLc>?T$12%X~`1d2xzrv3=pXYky)3SJAA_Y*%IS=#r zG|(dmd#4bJ9&w!4Snm~272wtDpr^x%MRNX)*y~4#oocvF&jXw(O|-v*CEomBJ+X{&R5Jk%w^YzryFIHh&$oeTy5 literal 0 HcmV?d00001 diff --git a/src/main/java/lib/json-20200518.jar b/src/main/java/lib/json-20200518.jar new file mode 100644 index 0000000000000000000000000000000000000000..0b85b0ee713f85785239da640579469c15b16277 GIT binary patch literal 65966 zcmb5VV~{9Kx2@Z@ZQHhO+qP}n?$x$!+qTWsHdgzr_w0K&z7u!vdn&SiRgD>0ku!5V zF*8d+8W;ox00II6U>LYr0pLGfC;%V;vZ5-2w32dS^s<6-l47FDDs-}9-;)3UvMP%9 zn+ynka7aG~!$Zqb!yp*dB^Scd)HSFs7WJ0)sgdx9D-FzBfere7&M?jNk}ka;H(hgk zrn4>E`H$!F&2m`0fqYY&HC>xoN!}S{&cs%s=g{P7eHQspH`=S?2a5$ZJFGh&QqOCLiZ+3Mr^O*GJgwB>?FDA zd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&)BTe()^EDfPsHguQl&y^wt?j?b^=3v6zqWLMs8%-kdUBEm3J6FUK*lHj z4R{ogus;sd|Fra9G5!R0wX*ybvHy>J{ho7i_v+W7H0pEulo~1pvTM-1JKAr0L%I30QE161tk0r2uU*s$G?vx?lVO90D$0`4G^0| z{R;!|?v(Hs7*Rz<*}n%!6tMM)2b>LJfLMM?bp2&lWPbqsHg5j2J+RE8Z=djifPzJV zfPU}yNK*etmOYRyLQ?@B-4A&ERG|CIoYnq-kkL0cGI0Da1O3lfiY;^X zcL1$w2eb-sh<-5@^}h#_cCxhm`y=%0t`fiZn-I;v#rk`gU)B4GehCN&Xd?X&n7`eS z;?E}jDtP*PH>%9~d%VAo>sR^B55L7VQu_Be|DS&FtNtY5jQGU@%l`!Y8x7At+xe^9 z;!n}azih7J|A6~T!tzhBU&Rl9&n0u^A7H=gHU0_ntNz~a{q*YZVg4&y@F&o(N(jFv zv8noxc>eKP@M{g%@9lE#`~&A#6@@>;`Lz(_XTjHB1_rp<|Ia1m_wuhlL4IYy|EwAL z%OECx0r{rY0MgRSVBQyIu!r%M + + + + + WebSoft通知 + + + + + + diff --git a/src/main/resources/templates/password-reset.html b/src/main/resources/templates/password-reset.html new file mode 100644 index 0000000..5d13a39 --- /dev/null +++ b/src/main/resources/templates/password-reset.html @@ -0,0 +1,322 @@ + + + + + + WebSoft密码重置 + + + + + + diff --git a/src/main/resources/templates/register-success.html b/src/main/resources/templates/register-success.html new file mode 100644 index 0000000..265c740 --- /dev/null +++ b/src/main/resources/templates/register-success.html @@ -0,0 +1,350 @@ + + + + + + WebSoft账号注册成功 + + + + + + diff --git a/src/test/java/com/gxwebsoft/RedisTest.java b/src/test/java/com/gxwebsoft/RedisTest.java new file mode 100644 index 0000000..e3fe105 --- /dev/null +++ b/src/test/java/com/gxwebsoft/RedisTest.java @@ -0,0 +1,30 @@ +package com.gxwebsoft; + +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.data.redis.core.StringRedisTemplate; + +import javax.annotation.Resource; + +@SpringBootTest +public class RedisTest { + @Resource + private StringRedisTemplate stringRedisTemplate; +// +// @Test +// public void test(){ +//// stringRedisTemplate.opsForValue().set("test:add:2",Long.toString(1L)); +//// stringRedisTemplate.opsForValue().increment("test:add:2",10L); +//// stringRedisTemplate.opsForValue().decrement("test:add:2",2L); +//// stringRedisTemplate.opsForValue().append("test:add:2","ssss"); +// HashMap map = new HashMap<>(); +// map.put("name","李四"); +// map.put("phone","13800138001"); +// HashMap map2 = new HashMap<>(); +// map2.put("name","赵六"); +// map2.put("phone","13800138001"); +// HashMap map3 = new HashMap<>(); +// map3.put("name","张三"); +// map3.put("phone","13800138001"); +// stringRedisTemplate.opsForSet().add("test:set:2", JSONUtil.toJSONString(map),JSONUtil.toJSONString(map2),JSONUtil.toJSONString(map3)); +// } +} diff --git a/src/test/java/com/gxwebsoft/TestMain.java b/src/test/java/com/gxwebsoft/TestMain.java new file mode 100644 index 0000000..3b0da5c --- /dev/null +++ b/src/test/java/com/gxwebsoft/TestMain.java @@ -0,0 +1,21 @@ +package com.gxwebsoft; + +import com.gxwebsoft.common.core.security.JwtUtil; +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +/** + * Created by WebSoft on 2020-03-23 23:37 + */ +@SpringBootTest +public class TestMain { + + /** + * 生成唯一的key用于jwt工具类 + */ + @Test + public void testGenJwtKey() { + System.out.println(JwtUtil.encodeKey(JwtUtil.randomKey())); + } + +} diff --git a/src/test/java/com/gxwebsoft/WebSoftApplicationTests.java b/src/test/java/com/gxwebsoft/WebSoftApplicationTests.java new file mode 100644 index 0000000..5a024f5 --- /dev/null +++ b/src/test/java/com/gxwebsoft/WebSoftApplicationTests.java @@ -0,0 +1,13 @@ +package com.gxwebsoft; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +public class WebSoftApplicationTests { + + @Test + public void contextLoads() { + } + +} diff --git a/src/test/java/com/gxwebsoft/generator/CodeGenerator.java b/src/test/java/com/gxwebsoft/generator/CodeGenerator.java new file mode 100644 index 0000000..c3cc75a --- /dev/null +++ b/src/test/java/com/gxwebsoft/generator/CodeGenerator.java @@ -0,0 +1,167 @@ +package com.gxwebsoft.generator; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.core.toolkit.StringPool; +import com.baomidou.mybatisplus.generator.AutoGenerator; +import com.baomidou.mybatisplus.generator.InjectionConfig; +import com.baomidou.mybatisplus.generator.config.*; +import com.baomidou.mybatisplus.generator.config.po.TableInfo; +import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; +import com.gxwebsoft.generator.engine.BeetlTemplateEnginePlus; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 代码生成工具 + * + * @author WebSoft + * @since 2021-09-05 00:31:14 + */ +public class CodeGenerator { + // 输出位置 + private static final String OUTPUT_LOCATION = System.getProperty("user.dir"); + //private static final String OUTPUT_LOCATION = "D:/codegen"; // 不想生成到项目中可以写磁盘路径 + // 输出目录 + private static final String OUTPUT_DIR = "/src/main/java"; + // 作者名称 + private static final String AUTHOR = "WebSoft"; + // 是否在xml中添加二级缓存配置 + private static final boolean ENABLE_CACHE = false; + // 数据库连接配置 + private static final String DB_URL = "jdbc:mysql://localhost:3306/websoft-api?useUnicode=true&useSSL=false&characterEncoding=utf8"; + private static final String DB_DRIVER = "com.mysql.cj.jdbc.Driver"; + private static final String DB_USERNAME = "root"; + private static final String DB_PASSWORD = "123456"; + // 包名 + private static final String PACKAGE_NAME = "com.gxwebsoft"; + // 模块名 + private static final String MODULE_NAME = "test"; + // 需要生成的表 + private static final String[] TABLE_NAMES = new String[]{ + "sys_user", + "sys_role" + }; + // 需要去除的表前缀 + private static final String[] TABLE_PREFIX = new String[]{ + "sys_", + "tb_" + }; + // 不需要作为查询参数的字段 + private static final String[] PARAM_EXCLUDE_FIELDS = new String[]{ + "tenant_id", + "create_time", + "update_time" + }; + // 查询参数使用String的类型 + private static final String[] PARAM_TO_STRING_TYPE = new String[]{ + "Date", + "LocalDate", + "LocalTime", + "LocalDateTime" + }; + // 查询参数使用EQ的类型 + private static final String[] PARAM_EQ_TYPE = new String[]{ + "Integer", + "Boolean", + "BigDecimal" + }; + // 是否添加权限注解 + private static final boolean AUTH_ANNOTATION = true; + // 是否添加日志注解 + private static final boolean LOG_ANNOTATION = true; + // controller的mapping前缀 + private static final String CONTROLLER_MAPPING_PREFIX = "/api"; + // 模板所在位置 + private static final String TEMPLATES_DIR = "/src/test/java/com/gxwebsoft/generator/templates"; + + public static void main(String[] args) { + // 代码生成器 + AutoGenerator mpg = new AutoGenerator(); + + // 全局配置 + GlobalConfig gc = new GlobalConfig(); + gc.setOutputDir(OUTPUT_LOCATION + OUTPUT_DIR); + gc.setAuthor(AUTHOR); + gc.setOpen(false); + gc.setFileOverride(true); + gc.setEnableCache(ENABLE_CACHE); + gc.setSwagger2(true); + gc.setIdType(IdType.AUTO); + gc.setServiceName("%sService"); + mpg.setGlobalConfig(gc); + + // 数据源配置 + DataSourceConfig dsc = new DataSourceConfig(); + dsc.setUrl(DB_URL); + // dsc.setSchemaName("public"); + dsc.setDriverName(DB_DRIVER); + dsc.setUsername(DB_USERNAME); + dsc.setPassword(DB_PASSWORD); + mpg.setDataSource(dsc); + + // 包配置 + PackageConfig pc = new PackageConfig(); + pc.setModuleName(MODULE_NAME); + pc.setParent(PACKAGE_NAME); + mpg.setPackageInfo(pc); + + // 策略配置 + StrategyConfig strategy = new StrategyConfig(); + strategy.setNaming(NamingStrategy.underline_to_camel); + strategy.setColumnNaming(NamingStrategy.underline_to_camel); + strategy.setInclude(TABLE_NAMES); + strategy.setTablePrefix(TABLE_PREFIX); + strategy.setSuperControllerClass(PACKAGE_NAME + ".common.core.web.BaseController"); + strategy.setEntityLombokModel(true); + strategy.setRestControllerStyle(true); + strategy.setControllerMappingHyphenStyle(true); + strategy.setLogicDeleteFieldName("deleted"); + mpg.setStrategy(strategy); + + // 模板配置 + TemplateConfig templateConfig = new TemplateConfig(); + templateConfig.setController(TEMPLATES_DIR + "/controller.java"); + templateConfig.setEntity(TEMPLATES_DIR + "/entity.java"); + templateConfig.setMapper(TEMPLATES_DIR + "/mapper.java"); + templateConfig.setXml(TEMPLATES_DIR + "/mapper.xml"); + templateConfig.setService(TEMPLATES_DIR + "/service.java"); + templateConfig.setServiceImpl(TEMPLATES_DIR + "/serviceImpl.java"); + mpg.setTemplate(templateConfig); + mpg.setTemplateEngine(new BeetlTemplateEnginePlus()); + + // 自定义模板配置 + InjectionConfig cfg = new InjectionConfig() { + @Override + public void initMap() { + Map map = new HashMap<>(); + map.put("packageName", PACKAGE_NAME); + map.put("paramExcludeFields", PARAM_EXCLUDE_FIELDS); + map.put("paramToStringType", PARAM_TO_STRING_TYPE); + map.put("paramEqType", PARAM_EQ_TYPE); + map.put("authAnnotation", AUTH_ANNOTATION); + map.put("logAnnotation", LOG_ANNOTATION); + map.put("controllerMappingPrefix", CONTROLLER_MAPPING_PREFIX); + this.setMap(map); + } + }; + String templatePath = TEMPLATES_DIR + "/param.java.btl"; + List focList = new ArrayList<>(); + focList.add(new FileOutConfig(templatePath) { + @Override + public String outputFile(TableInfo tableInfo) { + return OUTPUT_LOCATION + OUTPUT_DIR + "/" + + PACKAGE_NAME.replace(".", "/") + + "/" + pc.getModuleName() + "/param/" + + tableInfo.getEntityName() + "Param" + StringPool.DOT_JAVA; + } + }); + cfg.setFileOutConfigList(focList); + mpg.setCfg(cfg); + + mpg.execute(); + } + +} diff --git a/src/test/java/com/gxwebsoft/generator/ShoplGenerator.java b/src/test/java/com/gxwebsoft/generator/ShoplGenerator.java new file mode 100644 index 0000000..4c0c70b --- /dev/null +++ b/src/test/java/com/gxwebsoft/generator/ShoplGenerator.java @@ -0,0 +1,276 @@ +package com.gxwebsoft.generator; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.core.toolkit.StringPool; +import com.baomidou.mybatisplus.generator.AutoGenerator; +import com.baomidou.mybatisplus.generator.InjectionConfig; +import com.baomidou.mybatisplus.generator.config.*; +import com.baomidou.mybatisplus.generator.config.po.TableInfo; +import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; +import com.gxwebsoft.generator.engine.BeetlTemplateEnginePlus; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 商城模块-代码生成工具 + * + * @author WebSoft + * @since 2021-09-05 00:31:14 + */ +public class ShoplGenerator { + // 输出位置 + private static final String OUTPUT_LOCATION = System.getProperty("user.dir"); + //private static final String OUTPUT_LOCATION = "D:/codegen"; // 不想生成到项目中可以写磁盘路径 + // 输出目录 + private static final String OUTPUT_DIR = "/src/main/java"; + // Vue文件输出位置 + private static final String OUTPUT_LOCATION_VUE = "/Users/gxwebsoft/VUE/gxtyzx-admin-vue"; + private static final String OUTPUT_LOCATION_UNIAPP = "/Users/gxwebsoft/VUE/websoftcms-uniapp-cli"; + // Vue文件输出目录 + private static final String OUTPUT_DIR_VUE = "/src"; + // 作者名称 + private static final String AUTHOR = "科技小王子"; + // 是否在xml中添加二级缓存配置 + private static final boolean ENABLE_CACHE = false; + // 数据库连接配置 + private static final String DB_URL = "jdbc:mysql://8.134.55.105:13306/modules?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8"; + private static final String DB_DRIVER = "com.mysql.cj.jdbc.Driver"; + private static final String DB_USERNAME = "modules"; + private static final String DB_PASSWORD = "tYmmMGh5wpwXR3ae"; + // 包名 + private static final String PACKAGE_NAME = "com.gxwebsoft"; + // 模块名 + private static final String MODULE_NAME = "shop"; + // 需要生成的表 + private static final String[] TABLE_NAMES = new String[]{ +// "shop_brand", +// "shop_cart", +// "shop_cashier", +// "shop_count", +// "shop_dealer_apply", +// "shop_dealer_capital", +// "shop_dealer_order", +// "shop_dealer_referee", +// "shop_dealer_setting", +// "shop_dealer_user", +// "shop_dealer_withdraw", +// "shop_goods", +// "shop_goods_category", +// "shop_goods_comment", +// "shop_goods_coupon", +// "shop_goods_log", +// "shop_goods_relation", +// "shop_goods_sku", +// "shop_goods_spec", + "shop_merchant", + "shop_merchant_account", +// "shop_merchant_apply", + "shop_merchant_count", + "shop_merchant_type", +// "shop_order", +// "shop_order_cart_info", +// "shop_order_goods", +// "shop_order_info", +// "shop_order_info_log", +// "shop_spec", +// "shop_spec_value", +// "shop_user_address", +// "shop_user_collection", +// "shop_wechat_deposit" + }; + // 需要去除的表前缀 + private static final String[] TABLE_PREFIX = new String[]{ + "tb_" + }; + // 不需要作为查询参数的字段 + private static final String[] PARAM_EXCLUDE_FIELDS = new String[]{ + "tenant_id", + "create_time", + "update_time" + }; + // 查询参数使用String的类型 + private static final String[] PARAM_TO_STRING_TYPE = new String[]{ + "Date", + "LocalDate", + "LocalTime", + "LocalDateTime" + }; + // 查询参数使用EQ的类型 + private static final String[] PARAM_EQ_TYPE = new String[]{ + "Integer", + "Boolean", + "BigDecimal" + }; + // 是否添加权限注解 + private static final boolean AUTH_ANNOTATION = false; + // 是否添加日志注解 + private static final boolean LOG_ANNOTATION = false; + // controller的mapping前缀 + private static final String CONTROLLER_MAPPING_PREFIX = "/api"; + // 模板所在位置 + private static final String TEMPLATES_DIR = "/src/test/java/com/gxwebsoft/generator/templates"; + + public static void main(String[] args) { + // 代码生成器 + AutoGenerator mpg = new AutoGenerator(); + + // 全局配置 + GlobalConfig gc = new GlobalConfig(); + gc.setOutputDir(OUTPUT_LOCATION + OUTPUT_DIR); + gc.setAuthor(AUTHOR); + gc.setOpen(false); + gc.setFileOverride(true); + gc.setEnableCache(ENABLE_CACHE); + gc.setSwagger2(true); + gc.setIdType(IdType.AUTO); + gc.setServiceName("%sService"); + mpg.setGlobalConfig(gc); + + // 数据源配置 + DataSourceConfig dsc = new DataSourceConfig(); + dsc.setUrl(DB_URL); + // dsc.setSchemaName("public"); + dsc.setDriverName(DB_DRIVER); + dsc.setUsername(DB_USERNAME); + dsc.setPassword(DB_PASSWORD); + mpg.setDataSource(dsc); + + // 包配置 + PackageConfig pc = new PackageConfig(); + pc.setModuleName(MODULE_NAME); + pc.setParent(PACKAGE_NAME); + mpg.setPackageInfo(pc); + + // 策略配置 + StrategyConfig strategy = new StrategyConfig(); + strategy.setNaming(NamingStrategy.underline_to_camel); + strategy.setColumnNaming(NamingStrategy.underline_to_camel); + strategy.setInclude(TABLE_NAMES); + strategy.setTablePrefix(TABLE_PREFIX); + strategy.setSuperControllerClass(PACKAGE_NAME + ".common.core.web.BaseController"); + strategy.setEntityLombokModel(true); + strategy.setRestControllerStyle(true); + strategy.setControllerMappingHyphenStyle(true); + strategy.setLogicDeleteFieldName("deleted"); + mpg.setStrategy(strategy); + + // 模板配置 + TemplateConfig templateConfig = new TemplateConfig(); + templateConfig.setController(TEMPLATES_DIR + "/controller.java"); + templateConfig.setEntity(TEMPLATES_DIR + "/entity.java"); + templateConfig.setMapper(TEMPLATES_DIR + "/mapper.java"); + templateConfig.setXml(TEMPLATES_DIR + "/mapper.xml"); + templateConfig.setService(TEMPLATES_DIR + "/service.java"); + templateConfig.setServiceImpl(TEMPLATES_DIR + "/serviceImpl.java"); + mpg.setTemplate(templateConfig); + mpg.setTemplateEngine(new BeetlTemplateEnginePlus()); + + // 自定义模板配置 + InjectionConfig cfg = new InjectionConfig() { + @Override + public void initMap() { + Map map = new HashMap<>(); + map.put("packageName", PACKAGE_NAME); + map.put("paramExcludeFields", PARAM_EXCLUDE_FIELDS); + map.put("paramToStringType", PARAM_TO_STRING_TYPE); + map.put("paramEqType", PARAM_EQ_TYPE); + map.put("authAnnotation", AUTH_ANNOTATION); + map.put("logAnnotation", LOG_ANNOTATION); + map.put("controllerMappingPrefix", CONTROLLER_MAPPING_PREFIX); + this.setMap(map); + } + }; + String templatePath = TEMPLATES_DIR + "/param.java.btl"; + List focList = new ArrayList<>(); + focList.add(new FileOutConfig(templatePath) { + @Override + public String outputFile(TableInfo tableInfo) { + return OUTPUT_LOCATION + OUTPUT_DIR + "/" + + PACKAGE_NAME.replace(".", "/") + + "/" + pc.getModuleName() + "/param/" + + tableInfo.getEntityName() + "Param" + StringPool.DOT_JAVA; + } + }); + /** + * 以下是生成VUE项目代码 + * 生成文件的路径 /api/shop/goods/index.ts + */ + templatePath = TEMPLATES_DIR + "/index.ts.btl"; + + focList.add(new FileOutConfig(templatePath) { + @Override + public String outputFile(TableInfo tableInfo) { + return OUTPUT_LOCATION_VUE + OUTPUT_DIR_VUE + + "/api/" + pc.getModuleName() + "/" + + tableInfo.getEntityPath() + "/" + "index.ts"; + } + }); + focList.add(new FileOutConfig(templatePath) { + @Override + public String outputFile(TableInfo tableInfo) { + return OUTPUT_LOCATION_UNIAPP + OUTPUT_DIR_VUE + + "/api/" + pc.getModuleName() + "/" + + tableInfo.getEntityPath() + "/" + "index.ts"; + } + }); + // 生成TS文件 (/api/shop/goods/model/index.ts) + templatePath = TEMPLATES_DIR + "/model.ts.btl"; + focList.add(new FileOutConfig(templatePath) { + @Override + public String outputFile(TableInfo tableInfo) { + return OUTPUT_LOCATION_VUE + OUTPUT_DIR_VUE + + "/api/" + pc.getModuleName() + "/" + + tableInfo.getEntityPath() + "/model/" + "index.ts"; + } + }); + focList.add(new FileOutConfig(templatePath) { + @Override + public String outputFile(TableInfo tableInfo) { + return OUTPUT_LOCATION_UNIAPP + OUTPUT_DIR_VUE + + "/api/" + pc.getModuleName() + "/" + + tableInfo.getEntityPath() + "/model/" + "index.ts"; + } + }); + // 生成Vue文件(/views/shop/goods/index.vue) + templatePath = TEMPLATES_DIR + "/index.vue.btl"; + focList.add(new FileOutConfig(templatePath) { + @Override + public String outputFile(TableInfo tableInfo) { + return OUTPUT_LOCATION_VUE + OUTPUT_DIR_VUE + + "/views/" + pc.getModuleName() + "/" + + tableInfo.getEntityPath() + "/" + "index.vue"; + } + }); + + // 生成components文件(/views/shop/goods/components/edit.vue) + templatePath = TEMPLATES_DIR + "/components.edit.vue.btl"; + focList.add(new FileOutConfig(templatePath) { + @Override + public String outputFile(TableInfo tableInfo) { + return OUTPUT_LOCATION_VUE + OUTPUT_DIR_VUE + + "/views/" + pc.getModuleName() + "/" + + tableInfo.getEntityPath() + "/components/" + tableInfo.getEntityPath() + "Edit.vue"; + } + }); + + // 生成components文件(/views/shop/goods/components/search.vue) + templatePath = TEMPLATES_DIR + "/components.search.vue.btl"; + focList.add(new FileOutConfig(templatePath) { + @Override + public String outputFile(TableInfo tableInfo) { + return OUTPUT_LOCATION_VUE + OUTPUT_DIR_VUE + + "/views/" + pc.getModuleName() + "/" + + tableInfo.getEntityPath() + "/components/" + "search.vue"; + } + }); + + cfg.setFileOutConfigList(focList); + mpg.setCfg(cfg); + + mpg.execute(); + } + +} diff --git a/src/test/java/com/gxwebsoft/generator/SysGenerator.java b/src/test/java/com/gxwebsoft/generator/SysGenerator.java new file mode 100644 index 0000000..4ab130a --- /dev/null +++ b/src/test/java/com/gxwebsoft/generator/SysGenerator.java @@ -0,0 +1,251 @@ +package com.gxwebsoft.generator; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.core.toolkit.StringPool; +import com.baomidou.mybatisplus.generator.AutoGenerator; +import com.baomidou.mybatisplus.generator.InjectionConfig; +import com.baomidou.mybatisplus.generator.config.*; +import com.baomidou.mybatisplus.generator.config.po.TableInfo; +import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; +import com.gxwebsoft.generator.engine.BeetlTemplateEnginePlus; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 核心模块-代码生成工具 + * + * @author WebSoft + * @since 2021-09-05 00:31:14 + */ +public class SysGenerator { + // 输出位置 + private static final String OUTPUT_LOCATION = System.getProperty("user.dir"); + //private static final String OUTPUT_LOCATION = "D:/codegen"; // 不想生成到项目中可以写磁盘路径 + // 输出目录 + private static final String OUTPUT_DIR = "/src/main/java"; + // Vue文件输出位置 + private static final String OUTPUT_LOCATION_VUE = "/Users/gxwebsoft/VUE/gxtyzx-admin-vue"; + // Vue文件输出目录 + private static final String OUTPUT_LOCATION_UNIAPP = "/Users/gxwebsoft/VUE/nbg"; + // Vue文件输出目录 + private static final String OUTPUT_DIR_VUE = "/src"; + // 作者名称 + private static final String AUTHOR = "科技小王子"; + // 是否在xml中添加二级缓存配置 + private static final boolean ENABLE_CACHE = false; + // 数据库连接配置 + private static final String DB_URL = "jdbc:mysql://8.134.55.105:13306/gxwebsoft_core?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8"; + private static final String DB_DRIVER = "com.mysql.cj.jdbc.Driver"; + private static final String DB_USERNAME = "gxwebsoft_core"; + private static final String DB_PASSWORD = "ZXT5FkBREBJQPiAs"; + // 包名 + private static final String PACKAGE_NAME = "com.gxwebsoft"; + // 模块名 + private static final String MODULE_NAME = "common.system"; + // 需要生成的表 + private static final String[] TABLE_NAMES = new String[]{ +// "sys_website", +// "sys_website_field", +// "sys_domain", +// "sys_company", +// "sys_user_verify" +// "sys_user_role", +// "sys_authorize_code" + }; + // 需要去除的表前缀 + private static final String[] TABLE_PREFIX = new String[]{ + "sys_", + "tb_" + }; + // 不需要作为查询参数的字段 + private static final String[] PARAM_EXCLUDE_FIELDS = new String[]{ + "tenant_id", + "create_time", + "update_time" + }; + // 查询参数使用String的类型 + private static final String[] PARAM_TO_STRING_TYPE = new String[]{ + "Date", + "LocalDate", + "LocalTime", + "LocalDateTime" + }; + // 查询参数使用EQ的类型 + private static final String[] PARAM_EQ_TYPE = new String[]{ + "Integer", + "Boolean", + "BigDecimal" + }; + // 是否添加权限注解 + private static final boolean AUTH_ANNOTATION = true; + // 是否添加日志注解 + private static final boolean LOG_ANNOTATION = true; + // controller的mapping前缀 + private static final String CONTROLLER_MAPPING_PREFIX = "/api"; + // 模板所在位置 + private static final String TEMPLATES_DIR = "/src/test/java/com/gxwebsoft/generator/templates"; + + public static void main(String[] args) { + // 代码生成器 + AutoGenerator mpg = new AutoGenerator(); + + // 全局配置 + GlobalConfig gc = new GlobalConfig(); + gc.setOutputDir(OUTPUT_LOCATION + OUTPUT_DIR); + gc.setAuthor(AUTHOR); + gc.setOpen(false); + gc.setFileOverride(true); + gc.setEnableCache(ENABLE_CACHE); + gc.setSwagger2(true); + gc.setIdType(IdType.AUTO); + gc.setServiceName("%sService"); + mpg.setGlobalConfig(gc); + + // 数据源配置 + DataSourceConfig dsc = new DataSourceConfig(); + dsc.setUrl(DB_URL); + // dsc.setSchemaName("public"); + dsc.setDriverName(DB_DRIVER); + dsc.setUsername(DB_USERNAME); + dsc.setPassword(DB_PASSWORD); + mpg.setDataSource(dsc); + + // 包配置 + PackageConfig pc = new PackageConfig(); + pc.setModuleName(MODULE_NAME); + pc.setParent(PACKAGE_NAME); + mpg.setPackageInfo(pc); + + // 策略配置 + StrategyConfig strategy = new StrategyConfig(); + strategy.setNaming(NamingStrategy.underline_to_camel); + strategy.setColumnNaming(NamingStrategy.underline_to_camel); + strategy.setInclude(TABLE_NAMES); + strategy.setTablePrefix(TABLE_PREFIX); + strategy.setSuperControllerClass(PACKAGE_NAME + ".common.core.web.BaseController"); + strategy.setEntityLombokModel(true); + strategy.setRestControllerStyle(true); + strategy.setControllerMappingHyphenStyle(true); + strategy.setLogicDeleteFieldName("deleted"); + mpg.setStrategy(strategy); + + // 模板配置 + TemplateConfig templateConfig = new TemplateConfig(); + templateConfig.setController(TEMPLATES_DIR + "/controller.java"); + templateConfig.setEntity(TEMPLATES_DIR + "/entity.java"); + templateConfig.setMapper(TEMPLATES_DIR + "/mapper.java"); + templateConfig.setXml(TEMPLATES_DIR + "/mapper.xml"); + templateConfig.setService(TEMPLATES_DIR + "/service.java"); + templateConfig.setServiceImpl(TEMPLATES_DIR + "/serviceImpl.java"); + mpg.setTemplate(templateConfig); + mpg.setTemplateEngine(new BeetlTemplateEnginePlus()); + + // 自定义模板配置 + InjectionConfig cfg = new InjectionConfig() { + @Override + public void initMap() { + Map map = new HashMap<>(); + map.put("packageName", PACKAGE_NAME); + map.put("paramExcludeFields", PARAM_EXCLUDE_FIELDS); + map.put("paramToStringType", PARAM_TO_STRING_TYPE); + map.put("paramEqType", PARAM_EQ_TYPE); + map.put("authAnnotation", AUTH_ANNOTATION); + map.put("logAnnotation", LOG_ANNOTATION); + map.put("controllerMappingPrefix", CONTROLLER_MAPPING_PREFIX); + this.setMap(map); + } + }; + String templatePath = TEMPLATES_DIR + "/param.java.btl"; + List focList = new ArrayList<>(); + focList.add(new FileOutConfig(templatePath) { + @Override + public String outputFile(TableInfo tableInfo) { + return OUTPUT_LOCATION + OUTPUT_DIR + "/" + + PACKAGE_NAME.replace(".", "/") + + "/" + pc.getModuleName() + "/param/" + + tableInfo.getEntityName() + "Param" + StringPool.DOT_JAVA; + } + }); + /** + * 以下是生成VUE项目代码 + * 生成文件的路径 /api/shop/goods/index.ts + */ + templatePath = TEMPLATES_DIR + "/index.ts.btl"; + + focList.add(new FileOutConfig(templatePath) { + @Override + public String outputFile(TableInfo tableInfo) { + return OUTPUT_LOCATION_VUE + OUTPUT_DIR_VUE + + "/api/" + pc.getModuleName() + "/" + + tableInfo.getEntityPath() + "/" + "index.ts"; + } + }); + focList.add(new FileOutConfig() { + @Override + public String outputFile(TableInfo tableInfo) { + return OUTPUT_LOCATION_UNIAPP + OUTPUT_DIR_VUE + + "/api/" + pc.getModuleName() + "/" + + tableInfo.getEntityPath() + "/" + "index.ts"; + } + }); + // 生成TS文件 (/api/shop/goods/model/index.ts) + templatePath = TEMPLATES_DIR + "/model.ts.btl"; + focList.add(new FileOutConfig(templatePath) { + @Override + public String outputFile(TableInfo tableInfo) { + return OUTPUT_LOCATION_VUE + OUTPUT_DIR_VUE + + "/api/" + pc.getModuleName() + "/" + + tableInfo.getEntityPath() + "/model/" + "index.ts"; + } + }); + focList.add(new FileOutConfig(templatePath) { + @Override + public String outputFile(TableInfo tableInfo) { + return OUTPUT_LOCATION_UNIAPP + OUTPUT_DIR_VUE + + "/api/" + pc.getModuleName() + "/" + + tableInfo.getEntityPath() + "/model/" + "index.ts"; + } + }); + // 生成Vue文件(/views/shop/goods/index.vue) + templatePath = TEMPLATES_DIR + "/index.vue.btl"; + focList.add(new FileOutConfig(templatePath) { + @Override + public String outputFile(TableInfo tableInfo) { + return OUTPUT_LOCATION_VUE + OUTPUT_DIR_VUE + + "/views/" + pc.getModuleName() + "/" + + tableInfo.getEntityPath() + "/" + "index.vue"; + } + }); + + // 生成components文件(/views/shop/goods/components/edit.vue) + templatePath = TEMPLATES_DIR + "/components.edit.vue.btl"; + focList.add(new FileOutConfig(templatePath) { + @Override + public String outputFile(TableInfo tableInfo) { + return OUTPUT_LOCATION_VUE + OUTPUT_DIR_VUE + + "/views/" + pc.getModuleName() + "/" + + tableInfo.getEntityPath() + "/components/" + tableInfo.getEntityPath() + "Edit.vue"; + } + }); + + // 生成components文件(/views/shop/goods/components/search.vue) + templatePath = TEMPLATES_DIR + "/components.search.vue.btl"; + focList.add(new FileOutConfig(templatePath) { + @Override + public String outputFile(TableInfo tableInfo) { + return OUTPUT_LOCATION_VUE + OUTPUT_DIR_VUE + + "/views/" + pc.getModuleName() + "/" + + tableInfo.getEntityPath() + "/components/" + "search.vue"; + } + }); + + cfg.setFileOutConfigList(focList); + mpg.setCfg(cfg); + + mpg.execute(); + } + +} diff --git a/src/test/java/com/gxwebsoft/generator/engine/BeetlTemplateEnginePlus.java b/src/test/java/com/gxwebsoft/generator/engine/BeetlTemplateEnginePlus.java new file mode 100644 index 0000000..1a73826 --- /dev/null +++ b/src/test/java/com/gxwebsoft/generator/engine/BeetlTemplateEnginePlus.java @@ -0,0 +1,50 @@ +package com.gxwebsoft.generator.engine; + +import com.baomidou.mybatisplus.generator.config.builder.ConfigBuilder; +import com.baomidou.mybatisplus.generator.engine.AbstractTemplateEngine; +import org.beetl.core.Configuration; +import org.beetl.core.GroupTemplate; +import org.beetl.core.Template; +import org.beetl.core.resource.FileResourceLoader; + +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.Map; + +/** + * Beetl模板引擎实现文件输出 + * + * @author WebSoft + * @since 2021-09-05 00:30:28 + */ +public class BeetlTemplateEnginePlus extends AbstractTemplateEngine { + private GroupTemplate groupTemplate; + + @Override + public AbstractTemplateEngine init(ConfigBuilder configBuilder) { + super.init(configBuilder); + try { + Configuration cfg = Configuration.defaultConfiguration(); + groupTemplate = new GroupTemplate(new FileResourceLoader(), cfg); + } catch (IOException e) { + logger.error(e.getMessage(), e); + } + return this; + } + + @Override + public void writer(Map objectMap, String templatePath, String outputFile) throws Exception { + Template template = groupTemplate.getTemplate(templatePath); + try (FileOutputStream fileOutputStream = new FileOutputStream(outputFile)) { + template.binding(objectMap); + template.renderTo(fileOutputStream); + } + logger.debug("模板:" + templatePath + "; 文件:" + outputFile); + } + + @Override + public String templateFilePath(String filePath) { + return filePath + ".btl"; + } + +} diff --git a/src/test/java/com/gxwebsoft/generator/templates/components.edit.vue.btl b/src/test/java/com/gxwebsoft/generator/templates/components.edit.vue.btl new file mode 100644 index 0000000..1e0c8a2 --- /dev/null +++ b/src/test/java/com/gxwebsoft/generator/templates/components.edit.vue.btl @@ -0,0 +1,221 @@ + + + + diff --git a/src/test/java/com/gxwebsoft/generator/templates/components.search.vue.btl b/src/test/java/com/gxwebsoft/generator/templates/components.search.vue.btl new file mode 100644 index 0000000..82fea9d --- /dev/null +++ b/src/test/java/com/gxwebsoft/generator/templates/components.search.vue.btl @@ -0,0 +1,42 @@ + + + + diff --git a/src/test/java/com/gxwebsoft/generator/templates/controller.java.btl b/src/test/java/com/gxwebsoft/generator/templates/controller.java.btl new file mode 100644 index 0000000..2d67f91 --- /dev/null +++ b/src/test/java/com/gxwebsoft/generator/templates/controller.java.btl @@ -0,0 +1,276 @@ +<% +var serviceIns = strutil.toLowerCase(strutil.subStringTo(table.serviceName, 0, 1)) + strutil.subString(table.serviceName, 1); +var authPre = package.ModuleName + ':' + table.entityPath; +var idFieldName, idPropertyName; +for(field in table.fields) { + if(field.keyFlag) { + idFieldName = field.name; + idPropertyName = field.propertyName; + } +} +%> +package ${package.Controller}; + +<% if(isNotEmpty(superControllerClassPackage)) { %> +import ${superControllerClassPackage}; +<% } %> +import ${cfg.packageName!}.${package.ModuleName}.service.${entity}Service; +import ${cfg.packageName!}.${package.ModuleName}.entity.${entity}; +import ${cfg.packageName!}.${package.ModuleName}.param.${entity}Param; +import ${cfg.packageName!}.common.core.web.ApiResult; +import ${cfg.packageName!}.common.core.web.PageResult; +import ${cfg.packageName!}.common.core.web.PageParam; +import ${cfg.packageName!}.common.core.web.BatchParam; +import ${cfg.packageName!}.common.core.annotation.OperationLog; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; +<% if(!restControllerStyle) { %> +import org.springframework.stereotype.Controller; +<% } %> + +import javax.annotation.Resource; +import java.util.List; + +/** + * ${table.comment!}控制器 + * + * @author ${author} + * @since ${date(), 'yyyy-MM-dd HH:mm:ss'} + */ +<% if(swagger2) { %> +@Api(tags = "${table.comment!}管理") +<% } %> +<% if(restControllerStyle) { %> +@RestController +<% } else { %> +@Controller +<% } %> +@RequestMapping("${cfg.controllerMappingPrefix!}<% if(isNotEmpty(package.ModuleName)){ %>/${package.ModuleName}<% } %>/<% if(isNotEmpty(controllerMappingHyphenStyle)){ %>${controllerMappingHyphen}<% }else{ %>${table.entityPath}<% } %>") +<% if(kotlin) { %> +class ${table.controllerName}<% if(isNotEmpty(superControllerClass)) { %> : ${superControllerClass}()<% } %> +<% } else if(isNotEmpty(superControllerClass)) { %> +public class ${table.controllerName} extends ${superControllerClass} { +<% } else { %> +public class ${table.controllerName} { +<% } %> + @Resource + private ${table.serviceName} ${serviceIns}; + + <% if(!swagger2) { %> + /** + * 分页查询${table.comment!} + */ + <% } %> + <% if(cfg.authAnnotation) { %> + @PreAuthorize("hasAuthority('${authPre}:list')") + <% } %> + <% if(cfg.logAnnotation) { %> + @OperationLog + <% } %> + <% if(swagger2) { %> + @ApiOperation("分页查询${table.comment!}") + <% } %> + <% if(!restControllerStyle) { %> + @ResponseBody + <% } %> + @GetMapping("/page") + public ApiResult> page(${entity}Param param) { + // 使用关联查询 + return success(${serviceIns}.pageRel(param)); + } + + <% if(!swagger2) { %> + /** + * 查询全部${table.comment!} + */ + <% } %> + <% if(cfg.authAnnotation) { %> + @PreAuthorize("hasAuthority('${authPre}:list')") + <% } %> + <% if(cfg.logAnnotation) { %> + @OperationLog + <% } %> + <% if(swagger2) { %> + @ApiOperation("查询全部${table.comment!}") + <% } %> + <% if(!restControllerStyle) { %> + @ResponseBody + <% } %> + @GetMapping() + public ApiResult> list(${entity}Param param) { + // 使用关联查询 + return success(${serviceIns}.listRel(param)); + } + + <% if(!swagger2) { %> + /** + * 根据id查询${table.comment!} + */ + <% } %> + @PreAuthorize("hasAuthority('${authPre}:list')") + @OperationLog + @ApiOperation("根据id查询${table.comment!}") + @GetMapping("/{id}") + public ApiResult<${entity}> get(@PathVariable("id") Integer id) { + // 使用关联查询 + return success(${serviceIns}.getByIdRel(id)); + } + + <% if(!swagger2) { %> + /** + * 添加${table.comment!} + */ + <% } %> + <% if(cfg.authAnnotation) { %> + @PreAuthorize("hasAuthority('${authPre}:save')") + <% } %> + <% if(cfg.logAnnotation) { %> + @OperationLog + <% } %> + <% if(swagger2) { %> + @ApiOperation("添加${table.comment!}") + <% } %> + <% if(!restControllerStyle) { %> + @ResponseBody + <% } %> + @PostMapping() + public ApiResult save(@RequestBody ${entity} ${table.entityPath}) { + // 记录当前登录用户id + User loginUser = getLoginUser(); + if (loginUser != null) { + ${table.entityPath}.setUserId(loginUser.getUserId()); + } + if (${serviceIns}.save(${table.entityPath})) { + return success("添加成功"); + } + return fail("添加失败"); + } + + <% if(!swagger2) { %> + /** + * 修改${table.comment!} + */ + <% } %> + <% if(cfg.authAnnotation) { %> + @PreAuthorize("hasAuthority('${authPre}:update')") + <% } %> + <% if(cfg.logAnnotation) { %> + @OperationLog + <% } %> + <% if(swagger2) { %> + @ApiOperation("修改${table.comment!}") + <% } %> + <% if(!restControllerStyle) { %> + @ResponseBody + <% } %> + @PutMapping() + public ApiResult update(@RequestBody ${entity} ${table.entityPath}) { + if (${serviceIns}.updateById(${table.entityPath})) { + return success("修改成功"); + } + return fail("修改失败"); + } + + <% if(!swagger2) { %> + /** + * 删除${table.comment!} + */ + <% } %> + <% if(cfg.authAnnotation) { %> + @PreAuthorize("hasAuthority('${authPre}:remove')") + <% } %> + <% if(cfg.logAnnotation) { %> + @OperationLog + <% } %> + <% if(swagger2) { %> + @ApiOperation("删除${table.comment!}") + <% } %> + <% if(!restControllerStyle) { %> + @ResponseBody + <% } %> + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (${serviceIns}.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + <% if(!swagger2) { %> + /** + * 批量添加${table.comment!} + */ + <% } %> + <% if(cfg.authAnnotation) { %> + @PreAuthorize("hasAuthority('${authPre}:save')") + <% } %> + <% if(cfg.logAnnotation) { %> + @OperationLog + <% } %> + <% if(swagger2) { %> + @ApiOperation("批量添加${table.comment!}") + <% } %> + <% if(!restControllerStyle) { %> + @ResponseBody + <% } %> + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List<${entity}> list) { + if (${serviceIns}.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + <% if(!swagger2) { %> + /** + * 批量修改${table.comment!} + */ + <% } %> + <% if(cfg.authAnnotation) { %> + @PreAuthorize("hasAuthority('${authPre}:update')") + <% } %> + <% if(cfg.logAnnotation) { %> + @OperationLog + <% } %> + <% if(swagger2) { %> + @ApiOperation("批量修改${table.comment!}") + <% } %> + <% if(!restControllerStyle) { %> + @ResponseBody + <% } %> + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam<${entity}> batchParam) { + if (batchParam.update(${serviceIns}, "${idFieldName!}")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + <% if(!swagger2) { %> + /** + * 批量删除${table.comment!} + */ + <% } %> + <% if(cfg.authAnnotation) { %> + @PreAuthorize("hasAuthority('${authPre}:remove')") + <% } %> + <% if(cfg.logAnnotation) { %> + @OperationLog + <% } %> + <% if(swagger2) { %> + @ApiOperation("批量删除${table.comment!}") + <% } %> + <% if(!restControllerStyle) { %> + @ResponseBody + <% } %> + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (${serviceIns}.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/test/java/com/gxwebsoft/generator/templates/entity.java.btl b/src/test/java/com/gxwebsoft/generator/templates/entity.java.btl new file mode 100644 index 0000000..44015ad --- /dev/null +++ b/src/test/java/com/gxwebsoft/generator/templates/entity.java.btl @@ -0,0 +1,158 @@ +package ${package.Entity}; + +<% for(pkg in table.importPackages) { %> +import ${pkg}; +<% } %> +<% if(swagger2) { %> +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +<% } %> +<% if(entityLombokModel) { %> +import lombok.Data; +import lombok.EqualsAndHashCode; + <% if(chainModel) { %> +import lombok.experimental.Accessors; + <% } %> +<% } %> + +/** + * ${table.comment!} + * + * @author ${author} + * @since ${date(), 'yyyy-MM-dd HH:mm:ss'} + */ +<% if(entityLombokModel) { %> +@Data + <% if(isNotEmpty(superEntityClass)) { %> +@EqualsAndHashCode(callSuper = true) + <% } else { %> +@EqualsAndHashCode(callSuper = false) + <% } %> + <% if(chainModel) { %> +@Accessors(chain = true) + <% } %> +<% } %> +<% if(swagger2) { %> +@ApiModel(value = "${entity}对象", description = "${table.comment!''}") +<% } %> +<% if(table.convert) { %> +@TableName("${table.name}") +<% } %> +<% if(isNotEmpty(superEntityClass)) { %> +public class ${entity} extends ${superEntityClass}<% if(activeRecord) { %><${entity}><% } %>{ +<% } else if(activeRecord) { %> +public class ${entity} extends Model<${entity}> { +<% } else { %> +public class ${entity} implements Serializable { +<% } %> +<% if(entitySerialVersionUID) { %> + private static final long serialVersionUID = 1L; +<% } %> +<% /** -----------BEGIN 字段循环遍历----------- **/ %> +<% for(field in table.fields) { %> + <% + var keyPropertyName; + if(field.keyFlag) { + keyPropertyName = field.propertyName; + } + %> + + <% if(isNotEmpty(field.comment)) { %> + <% if(swagger2) { %> + @ApiModelProperty(value = "${field.comment}") + <% }else{ %> + /** + * ${field.comment} + */ + <% } %> + <% } %> + <% /* 主键 */ %> + <% if(field.keyFlag) { %> + <% if(field.keyIdentityFlag) { %> + @TableId(value = "${field.annotationColumnName}", type = IdType.AUTO) + <% } else if(isNotEmpty(idType)) { %> + @TableId(value = "${field.annotationColumnName}", type = IdType.${idType}) + <% } else if(field.convert) { %> + @TableId("${field.annotationColumnName}") + <% } %> + <% /* 普通字段 */ %> + <% } else if(isNotEmpty(field.fill)) { %> + <% if(field.convert){ %> + @TableField(value = "${field.annotationColumnName}", fill = FieldFill.${field.fill}) + <% }else{ %> + @TableField(fill = FieldFill.${field.fill}) + <% } %> + <% } else if(field.convert) { %> + @TableField("${field.annotationColumnName}") + <% } %> + <% /* 乐观锁注解 */ %> + <% if(versionFieldName!'' == field.name) { %> + @Version + <% } %> + <% /* 逻辑删除注解 */ %> + <% if(logicDeleteFieldName!'' == field.name) { %> + @TableLogic + <% } %> + private ${field.propertyType} ${field.propertyName}; +<% } %> +<% /** -----------END 字段循环遍历----------- **/ %> + +<% if(!entityLombokModel) { %> + <% for(field in table.fields) { %> + <% + var getprefix = ''; + if(field.propertyType == 'boolean') { + getprefix = 'is'; + } else { + getprefix = 'get'; + } + %> + public ${field.propertyType} ${getprefix}${field.capitalName}() { + return ${field.propertyName}; + } + + <% if(chainModel) { %> + public ${entity} set${field.capitalName}(${field.propertyType} ${field.propertyName}) { + <% } else { %> + public void set${field.capitalName}(${field.propertyType} ${field.propertyName}) { + <% } %> + this.${field.propertyName} = ${field.propertyName}; + <% if(chainModel){ %> + return this; + <% } %> + } + + <% } %> +<% } %> +<% if(entityColumnConstant) { %> + <% for(field in table.fields) { %> + public static final String ${strutil.toUpperCase(field.name)} = "${field.name}"; + + <% } %> +<% } %> +<% if(activeRecord) { %> + @Override + protected Serializable pkVal() { + <% if(isNotEmpty(keyPropertyName)){ %> + return this.${keyPropertyName}; + <% }else{ %> + return null; + <% } %> + } + +<% } %> +<% if(!entityLombokModel){ %> + @Override + public String toString() { + return "${entity}{" + + <% for(field in table.fields){ %> + <% if(fieldLP.index==0){ %> + "${field.propertyName}=" + ${field.propertyName} + + <% }else{ %> + ", ${field.propertyName}=" + ${field.propertyName} + + <% } %> + <% } %> + "}"; + } +<% } %> +} diff --git a/src/test/java/com/gxwebsoft/generator/templates/index.ts.btl b/src/test/java/com/gxwebsoft/generator/templates/index.ts.btl new file mode 100644 index 0000000..9cd968d --- /dev/null +++ b/src/test/java/com/gxwebsoft/generator/templates/index.ts.btl @@ -0,0 +1,106 @@ +import request from '@/utils/request'; +import type { ApiResult, PageResult } from '@/api'; +import type { ${entity}, ${entity}Param } from './model'; +import { MODULES_API_URL } from '@/config/setting'; + +/** + * 分页查询${table.comment!} + */ +export async function page${entity}(params: ${entity}Param) { + const res = await request.get>>( + MODULES_API_URL + '/${package.ModuleName}/${controllerMappingHyphen}/page', + { + params + } + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 查询${table.comment!}列表 + */ +export async function list${entity}(params?: ${entity}Param) { + const res = await request.get>( + MODULES_API_URL + '/${package.ModuleName}/${controllerMappingHyphen}', + { + params + } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 添加${table.comment!} + */ +export async function add${entity}(data: ${entity}) { + const res = await request.post>( + MODULES_API_URL + '/${package.ModuleName}/${controllerMappingHyphen}', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 修改${table.comment!} + */ +export async function update${entity}(data: ${entity}) { + const res = await request.put>( + MODULES_API_URL + '/${package.ModuleName}/${controllerMappingHyphen}', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 删除${table.comment!} + */ +export async function remove${entity}(id?: number) { + const res = await request.delete>( + MODULES_API_URL + '/${package.ModuleName}/${controllerMappingHyphen}/' + id + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量删除${table.comment!} + */ +export async function removeBatch${entity}(data: (number | undefined)[]) { + const res = await request.delete>( + MODULES_API_URL + '/${package.ModuleName}/${controllerMappingHyphen}/batch', + { + data + } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 根据id查询${table.comment!} + */ +export async function get${entity}(id: number) { + const res = await request.get>( + MODULES_API_URL + '/${package.ModuleName}/${controllerMappingHyphen}/' + id + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/test/java/com/gxwebsoft/generator/templates/index.vue.btl b/src/test/java/com/gxwebsoft/generator/templates/index.vue.btl new file mode 100644 index 0000000..3a52886 --- /dev/null +++ b/src/test/java/com/gxwebsoft/generator/templates/index.vue.btl @@ -0,0 +1,217 @@ + + + + + + + diff --git a/src/test/java/com/gxwebsoft/generator/templates/mapper.java.btl b/src/test/java/com/gxwebsoft/generator/templates/mapper.java.btl new file mode 100644 index 0000000..54e41a9 --- /dev/null +++ b/src/test/java/com/gxwebsoft/generator/templates/mapper.java.btl @@ -0,0 +1,41 @@ +package ${package.Mapper}; + +import ${superMapperClassPackage}; +import com.baomidou.mybatisplus.core.metadata.IPage; +import ${package.Entity}.${entity}; +import ${cfg.packageName!}.${package.ModuleName}.param.${entity}Param; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * ${table.comment!}Mapper + * + * @author ${author} + * @since ${date(), 'yyyy-MM-dd HH:mm:ss'} + */ +<% if(kotlin){ %> +interface ${table.mapperName} : ${superMapperClass}<${entity}> +<% }else{ %> +public interface ${table.mapperName} extends ${superMapperClass}<${entity}> { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List<${entity}> + */ + List<${entity}> selectPageRel(@Param("page") IPage<${entity}> page, + @Param("param") ${entity}Param param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List<${entity}> selectListRel(@Param("param") ${entity}Param param); + +} +<% } %> diff --git a/src/test/java/com/gxwebsoft/generator/templates/mapper.xml.btl b/src/test/java/com/gxwebsoft/generator/templates/mapper.xml.btl new file mode 100644 index 0000000..6786c0d --- /dev/null +++ b/src/test/java/com/gxwebsoft/generator/templates/mapper.xml.btl @@ -0,0 +1,96 @@ + + + +<% if(enableCache) { %> + + + +<% } %> +<% if(baseResultMap) { %> + + + + <% /** 生成主键排在第一位 **/ %> + <% for(field in table.fields) { %> + <% if(field.keyFlag){ %> + + <% } %> + <% } %> + <% /** 生成公共字段 **/ %> + <% for(field in table.commonFields) { %> + + <% } %> + <% /** 生成普通字段 **/ %> + <% for(field in table.fields) { %> + <% if(!field.keyFlag) { %> + + <% } %> + <% } %> + +<% } %> +<% if(baseColumnList) { %> + + + + <% for(field in table.commonFields) { %> + ${field.columnName}, + <% } %> + ${table.fieldNames} + +<% } %> + + + + SELECT a.* + FROM ${table.name} a + +<% for(field in table.fields) { %> + <% if(field.keyFlag) { %> + <% /** 主键字段 **/ %> + + AND a.${field.name} = #{param.${field.propertyName}} + + <% } else if(field.name == logicDeleteFieldName) { %> + <% /** 逻辑删除字段 **/ %> + + AND a.deleted = #{param.deleted} + + + AND a.deleted = 0 + + <% } else if(field.name == 'create_time') { %> + <% /** 创建时间字段 **/ %> + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + <% } else if(array.contain(cfg.paramExcludeFields, field.name)) { %> + <% /** 排除的字段 **/ %> + <% } else if(array.contain(cfg.paramEqType, field.propertyType)) { %> + <% /** 使用EQ的字段 **/ %> + + AND a.${field.name} = #{param.${field.propertyName}} + + <% } else { %> + <% /** 其它类型使用LIKE **/ %> + + AND a.${field.name} LIKE CONCAT('%', #{param.${field.propertyName}}, '%') + + <% } %> +<% } %> + + + + + + + + + + diff --git a/src/test/java/com/gxwebsoft/generator/templates/model.ts.btl b/src/test/java/com/gxwebsoft/generator/templates/model.ts.btl new file mode 100644 index 0000000..b0b99db --- /dev/null +++ b/src/test/java/com/gxwebsoft/generator/templates/model.ts.btl @@ -0,0 +1,43 @@ +import type { PageParam } from '@/api'; + +/** + * ${table.comment!} + */ +export interface ${entity} { +<% /** -----------BEGIN 字段循环遍历----------- **/ %> +<% for(field in table.fields) { %> + <% + var keyPropertyName; + if(field.keyFlag) { + keyPropertyName = field.propertyName; + } + %> + <% /* 主键 */ %> + <% if(field.keyFlag) { %> + <% /* 普通字段 */ %> + <% } else if(isNotEmpty(field.fill)) { %> + <% if(field.convert){ %> + @TableField(value = "${field.annotationColumnName}", fill = FieldFill.${field.fill}) + <% }else{ %> + @TableField(fill = FieldFill.${field.fill}) + <% } %> + <% } else if(field.convert) { %> + @TableField("${field.annotationColumnName}") + <% } %> + // ${field.comment} + ${field.propertyName}?: <% if(field.propertyType == 'Integer') { %>number<% }else{ %>string<% } %>; +<% } %> +<% /** -----------END 字段循环遍历----------- **/ %> +} + +/** + * ${table.comment!}搜索条件 + */ +export interface ${entity}Param extends PageParam { +<% for(field in table.fields) { %> +<% if(field.keyFlag) { %> + ${field.propertyName}?: number; + <% } %> +<% } %> + keywords?: string; +} diff --git a/src/test/java/com/gxwebsoft/generator/templates/param.java.btl b/src/test/java/com/gxwebsoft/generator/templates/param.java.btl new file mode 100644 index 0000000..9c30504 --- /dev/null +++ b/src/test/java/com/gxwebsoft/generator/templates/param.java.btl @@ -0,0 +1,146 @@ +package ${cfg.packageName!}.${package.ModuleName}.param; + +import ${cfg.packageName!}.common.core.annotation.QueryField; +import ${cfg.packageName!}.common.core.annotation.QueryType; +import ${cfg.packageName!}.common.core.web.BaseParam; +import com.fasterxml.jackson.annotation.JsonInclude; +<% if(swagger2) { %> +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +<% } %> +<% if(entityLombokModel) { %> +import lombok.Data; +import lombok.EqualsAndHashCode; + <% if(chainModel) { %> +import lombok.experimental.Accessors; + <% } %> +<% } %> + +/** + * ${table.comment!}查询参数 + * + * @author ${author} + * @since ${date(), 'yyyy-MM-dd HH:mm:ss'} + */ +<% if(entityLombokModel) { %> +@Data + <% if(isNotEmpty(superEntityClass)) { %> +@EqualsAndHashCode(callSuper = true) + <% } else { %> +@EqualsAndHashCode(callSuper = false) + <% } %> + <% if(chainModel) { %> +@Accessors(chain = true) + <% } %> +<% } %> +@JsonInclude(JsonInclude.Include.NON_NULL) +<% if(swagger2) { %> +@ApiModel(value = "${entity}Param对象", description = "${table.comment!''}查询参数") +<% } %> +public class ${entity}Param extends BaseParam { +<% if(entitySerialVersionUID) { %> + private static final long serialVersionUID = 1L; +<% } %> +<% /** -----------BEGIN 字段循环遍历----------- **/ %> +<% for(field in table.fields) { %> + <% + var keyPropertyName; + if(field.keyFlag) { + keyPropertyName = field.propertyName; + } + // 排除的字段 + if(array.contain(cfg.paramExcludeFields, field.name)) { + continue; + } + %> + + <% if(isNotEmpty(field.comment)) { %> + <% if(swagger2) { %> + @ApiModelProperty(value = "${field.comment}") + <% }else{ %> + /** + * ${field.comment} + */ + <% } %> + <% } %> + <% /* 主键 */ %> + <% if(field.keyFlag) { %> + @QueryField(type = QueryType.EQ) + <% /* 使用EQ的字段 */ %> + <% } else if(array.contain(cfg.paramEqType, field.propertyType)) { %> + @QueryField(type = QueryType.EQ) + <% } %> + <% /* 使用String类型的字段 */ %> + <% if(array.contain(cfg.paramToStringType, field.propertyType)) { %> + private String ${field.propertyName}; + <% } else { %> + <% /* 普通字段 */ %> + private ${field.propertyType} ${field.propertyName}; + <% } %> +<% } %> +<% /** -----------END 字段循环遍历----------- **/ %> + +<% if(!entityLombokModel) { %> + <% for(field in table.fields) { %> + <% + var getprefix = ''; + if(field.propertyType == 'boolean') { + getprefix = 'is'; + } else { + getprefix = 'get'; + } + // 排除的字段 + if(array.contain(cfg.paramExcludeFields, field.name)) { + continue; + } + %> + <% if(array.contain(cfg.paramToStringType, field.propertyType)) { %> + public String ${getprefix}${field.capitalName}() { + <% } else { %> + public ${field.propertyType} ${getprefix}${field.capitalName}() { + <% } %> + return ${field.propertyName}; + } + + <% if(chainModel) { %> + <% if(array.contain(cfg.paramToStringType, field.propertyType)) { %> + public ${entity} set${field.capitalName}(String ${field.propertyName}) { + <% } else { %> + public ${entity} set${field.capitalName}(${field.propertyType} ${field.propertyName}) { + <% } %> + <% } else { %> + <% if(array.contain(cfg.paramToStringType, field.propertyType)) { %> + public void set${field.capitalName}(String ${field.propertyName}) { + <% } else { %> + public void set${field.capitalName}(${field.propertyType} ${field.propertyName}) { + <% } %> + <% } %> + this.${field.propertyName} = ${field.propertyName}; + <% if(chainModel){ %> + return this; + <% } %> + } + + <% } %> +<% } %> +<% if(!entityLombokModel) { %> + @Override + public String toString() { + return "${entity}{" + + <% for(field in table.fields) { %> + <% + // 排除的字段 + if(array.contain(cfg.paramExcludeFields, field.name)) { + continue; + } + %> + <% if(fieldLP.index == 0) { %> + "${field.propertyName}=" + ${field.propertyName} + + <% } else { %> + ", ${field.propertyName}=" + ${field.propertyName} + + <% } %> + <% } %> + "}"; + } +<% } %> +} diff --git a/src/test/java/com/gxwebsoft/generator/templates/service.java.btl b/src/test/java/com/gxwebsoft/generator/templates/service.java.btl new file mode 100644 index 0000000..67efe6a --- /dev/null +++ b/src/test/java/com/gxwebsoft/generator/templates/service.java.btl @@ -0,0 +1,55 @@ +<% +var idPropertyName, idComment; +for(field in table.fields) { + if(field.keyFlag) { + idPropertyName = field.propertyName; + idComment = field.comment; + } +} +%> +package ${package.Service}; + +import ${superServiceClassPackage}; +import ${cfg.packageName!}.common.core.web.PageResult; +import ${package.Entity}.${entity}; +import ${cfg.packageName!}.${package.ModuleName}.param.${entity}Param; + +import java.util.List; + +/** + * ${table.comment!}Service + * + * @author ${author} + * @since ${date(), 'yyyy-MM-dd HH:mm:ss'} + */ +<% if(kotlin){ %> +interface ${table.serviceName} : ${superServiceClass}<${entity}> +<% }else{ %> +public interface ${table.serviceName} extends ${superServiceClass}<${entity}> { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult<${entity}> + */ + PageResult<${entity}> pageRel(${entity}Param param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List<${entity}> + */ + List<${entity}> listRel(${entity}Param param); + + /** + * 根据id查询 + * + * @param ${idPropertyName!} ${idComment!} + * @return ${entity} + */ + ${entity} getByIdRel(Integer ${idPropertyName!}); + +} +<% } %> diff --git a/src/test/java/com/gxwebsoft/generator/templates/serviceImpl.java.btl b/src/test/java/com/gxwebsoft/generator/templates/serviceImpl.java.btl new file mode 100644 index 0000000..b95a1bf --- /dev/null +++ b/src/test/java/com/gxwebsoft/generator/templates/serviceImpl.java.btl @@ -0,0 +1,62 @@ +<% +var idPropertyName, idCapitalName; +for(field in table.fields) { + if(field.keyFlag) { + idPropertyName = field.propertyName; + idCapitalName = field.capitalName; + } +} +%> +package ${package.ServiceImpl}; + +import ${superServiceImplClassPackage}; +import ${package.Mapper}.${table.mapperName}; +import ${package.Service}.${table.serviceName}; +import ${package.Entity}.${entity}; +import ${cfg.packageName!}.${package.ModuleName}.param.${entity}Param; +import ${cfg.packageName!}.common.core.web.PageParam; +import ${cfg.packageName!}.common.core.web.PageResult; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * ${table.comment!}Service实现 + * + * @author ${author} + * @since ${date(), 'yyyy-MM-dd HH:mm:ss'} + */ +@Service +<% if(kotlin){ %> +open class ${table.serviceImplName} : ${superServiceImplClass}<${table.mapperName}, ${entity}>(), ${table.serviceName} { + +} +<% }else{ %> +public class ${table.serviceImplName} extends ${superServiceImplClass}<${table.mapperName}, ${entity}> implements ${table.serviceName} { + + @Override + public PageResult<${entity}> pageRel(${entity}Param param) { + PageParam<${entity}, ${entity}Param> page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + List<${entity}> list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List<${entity}> listRel(${entity}Param param) { + List<${entity}> list = baseMapper.selectListRel(param); + // 排序 + PageParam<${entity}, ${entity}Param> page = new PageParam<>(); + page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public ${entity} getByIdRel(Integer ${idPropertyName!}) { + ${entity}Param param = new ${entity}Param(); + param.set${idCapitalName!}(${idPropertyName!}); + return param.getOne(baseMapper.selectListRel(param)); + } + +} +<% } %>