diff --git a/README.md b/README.md index 871f59d0..2e3f922f 100644 --- a/README.md +++ b/README.md @@ -282,7 +282,7 @@ | [Spring MVC](https://github.com/spring-projects/spring-framework/tree/master/spring-webmvc) | MVC 框架 | 6.1.10 | [文档](http://www.iocoder.cn/SpringMVC/MVC/?zt) | | [Spring Security](https://github.com/spring-projects/spring-security) | Spring 安全框架 | 6.3.1 | [文档](http://www.iocoder.cn/Spring-Boot/Spring-Security/?zt) | | [Hibernate Validator](https://github.com/hibernate/hibernate-validator) | 参数校验组件 | 8.0.1 | [文档](http://www.iocoder.cn/Spring-Boot/Validation/?zt) | -| [Flowable](https://github.com/flowable/flowable-engine) | 工作流引擎 | 7.0.0 | [文档](https://doc.iocoder.cn/bpm/) | +| [Flowable](https://github.com/flowable/flowable-engine) | 工作流引擎 | 7.0.0 | [文档](http://172.16.46.63:30888/bpm/) | | [Knife4j](https://gitee.com/xiaoym/knife4j) | Swagger 增强 UI 实现 | 4.5.0 | [文档](http://www.iocoder.cn/Spring-Boot/Swagger/?zt) | | [SkyWalking](https://skywalking.apache.org/) | 分布式应用追踪系统 | 9.0.0 | [文档](http://www.iocoder.cn/Spring-Boot/SkyWalking/?zt) | | [Spring Boot Admin](https://github.com/codecentric/spring-boot-admin) | Spring Boot 监控平台 | 3.6.1 | [文档](http://www.iocoder.cn/Spring-Boot/Admin/?zt) | diff --git a/sql/dm/ruoyi-vue-pro-dm8.sql b/sql/dm/ruoyi-vue-pro-dm8.sql index 845c7c99..aa082349 100644 --- a/sql/dm/ruoyi-vue-pro-dm8.sql +++ b/sql/dm/ruoyi-vue-pro-dm8.sql @@ -2800,7 +2800,7 @@ COMMENT ON TABLE system_oauth2_client IS 'OAuth2 客户端表'; -- ---------------------------- -- @formatter:off -- SET IDENTITY_INSERT system_oauth2_client ON; -INSERT INTO system_oauth2_client (id, client_id, secret, name, logo, description, status, access_token_validity_seconds, refresh_token_validity_seconds, redirect_uris, authorized_grant_types, scopes, auto_approve_scopes, authorities, resource_ids, additional_information, creator, create_time, updater, update_time, deleted) VALUES (1, 'default', 'admin123', '后台管理', 'http://test.zt.iocoder.cn/20250502/sort2_1746189740718.png', '我是描述', 0, 1800, 2592000, '["https://www.iocoder.cn","https://doc.iocoder.cn"]', '["password","authorization_code","implicit","refresh_token"]', '["user.read","user.write"]', '[]', '["user.read","user.write"]', '[]', '{}', '1', '2022-05-11 21:47:12', '1', '2025-05-02 20:42:22', '0'); +INSERT INTO system_oauth2_client (id, client_id, secret, name, logo, description, status, access_token_validity_seconds, refresh_token_validity_seconds, redirect_uris, authorized_grant_types, scopes, auto_approve_scopes, authorities, resource_ids, additional_information, creator, create_time, updater, update_time, deleted) VALUES (1, 'default', 'admin123', '后台管理', 'http://test.zt.iocoder.cn/20250502/sort2_1746189740718.png', '我是描述', 0, 1800, 2592000, '["https://www.iocoder.cn","http://172.16.46.63:30888"]', '["password","authorization_code","implicit","refresh_token"]', '["user.read","user.write"]', '[]', '["user.read","user.write"]', '[]', '{}', '1', '2022-05-11 21:47:12', '1', '2025-05-02 20:42:22', '0'); INSERT INTO system_oauth2_client (id, client_id, secret, name, logo, description, status, access_token_validity_seconds, refresh_token_validity_seconds, redirect_uris, authorized_grant_types, scopes, auto_approve_scopes, authorities, resource_ids, additional_information, creator, create_time, updater, update_time, deleted) VALUES (40, 'test', 'test2', 'biubiu', 'http://test.zt.iocoder.cn/xx/20250502/ed07110a37464b5299f8bd7c67ad65c7_1746187077009.jpg', '啦啦啦啦', 0, 1800, 43200, '["https://www.iocoder.cn"]', '["password","authorization_code","implicit"]', '["user_info","projects"]', '["user_info"]', '[]', '[]', '{}', '1', '2022-05-12 00:28:20', '1', '2025-05-02 19:58:08', '0'); INSERT INTO system_oauth2_client (id, client_id, secret, name, logo, description, status, access_token_validity_seconds, refresh_token_validity_seconds, redirect_uris, authorized_grant_types, scopes, auto_approve_scopes, authorities, resource_ids, additional_information, creator, create_time, updater, update_time, deleted) VALUES (41, 'zt-sso-demo-by-code', 'test', '基于授权码模式,如何实现 SSO 单点登录?', 'http://test.zt.iocoder.cn/it/20250502/sign_1746181948685.png', NULL, 0, 1800, 43200, '["http://127.0.0.1:18080"]', '["authorization_code","refresh_token"]', '["user.read","user.write"]', '[]', '[]', '[]', NULL, '1', '2022-09-29 13:28:31', '1', '2025-05-02 18:32:30', '0'); INSERT INTO system_oauth2_client (id, client_id, secret, name, logo, description, status, access_token_validity_seconds, refresh_token_validity_seconds, redirect_uris, authorized_grant_types, scopes, auto_approve_scopes, authorities, resource_ids, additional_information, creator, create_time, updater, update_time, deleted) VALUES (42, 'zt-sso-demo-by-password', 'test', '基于密码模式,如何实现 SSO 单点登录?', 'http://test.zt.iocoder.cn/604bdc695e13b3b22745be704d1f2aa8ee05c5f26f9fead6d1ca49005afbc857.jpeg', NULL, 0, 1800, 43200, '["http://127.0.0.1:18080"]', '["password","refresh_token"]', '["user.read","user.write"]', '[]', '[]', '[]', NULL, '1', '2022-10-04 17:40:16', '1', '2025-05-04 16:00:46', '0'); diff --git a/sql/mysql/ruoyi-vue-pro.sql b/sql/mysql/ruoyi-vue-pro.sql index 6fdd4399..2e036edc 100644 --- a/sql/mysql/ruoyi-vue-pro.sql +++ b/sql/mysql/ruoyi-vue-pro.sql @@ -2450,7 +2450,7 @@ CREATE TABLE `system_oauth2_client` ( -- Records of system_oauth2_client -- ---------------------------- BEGIN; -INSERT INTO `system_oauth2_client` (`id`, `client_id`, `secret`, `name`, `logo`, `description`, `status`, `access_token_validity_seconds`, `refresh_token_validity_seconds`, `redirect_uris`, `authorized_grant_types`, `scopes`, `auto_approve_scopes`, `authorities`, `resource_ids`, `additional_information`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1, 'default', 'admin123', '后台管理', 'http://test.zt.iocoder.cn/20250502/sort2_1746189740718.png', '我是描述', 0, 1800, 2592000, '[\"https://www.iocoder.cn\",\"https://doc.iocoder.cn\"]', '[\"password\",\"authorization_code\",\"implicit\",\"refresh_token\"]', '[\"user.read\",\"user.write\"]', '[]', '[\"user.read\",\"user.write\"]', '[]', '{}', '1', '2022-05-11 21:47:12', '1', '2025-05-02 20:42:22', b'0'); +INSERT INTO `system_oauth2_client` (`id`, `client_id`, `secret`, `name`, `logo`, `description`, `status`, `access_token_validity_seconds`, `refresh_token_validity_seconds`, `redirect_uris`, `authorized_grant_types`, `scopes`, `auto_approve_scopes`, `authorities`, `resource_ids`, `additional_information`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1, 'default', 'admin123', '后台管理', 'http://test.zt.iocoder.cn/20250502/sort2_1746189740718.png', '我是描述', 0, 1800, 2592000, '[\"https://www.iocoder.cn\",\"http://172.16.46.63:30888\"]', '[\"password\",\"authorization_code\",\"implicit\",\"refresh_token\"]', '[\"user.read\",\"user.write\"]', '[]', '[\"user.read\",\"user.write\"]', '[]', '{}', '1', '2022-05-11 21:47:12', '1', '2025-05-02 20:42:22', b'0'); INSERT INTO `system_oauth2_client` (`id`, `client_id`, `secret`, `name`, `logo`, `description`, `status`, `access_token_validity_seconds`, `refresh_token_validity_seconds`, `redirect_uris`, `authorized_grant_types`, `scopes`, `auto_approve_scopes`, `authorities`, `resource_ids`, `additional_information`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (40, 'test', 'test2', 'biubiu', 'http://test.zt.iocoder.cn/xx/20250502/ed07110a37464b5299f8bd7c67ad65c7_1746187077009.jpg', '啦啦啦啦', 0, 1800, 43200, '[\"https://www.iocoder.cn\"]', '[\"password\",\"authorization_code\",\"implicit\"]', '[\"user_info\",\"projects\"]', '[\"user_info\"]', '[]', '[]', '{}', '1', '2022-05-12 00:28:20', '1', '2025-05-02 19:58:08', b'0'); INSERT INTO `system_oauth2_client` (`id`, `client_id`, `secret`, `name`, `logo`, `description`, `status`, `access_token_validity_seconds`, `refresh_token_validity_seconds`, `redirect_uris`, `authorized_grant_types`, `scopes`, `auto_approve_scopes`, `authorities`, `resource_ids`, `additional_information`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (41, 'zt-sso-demo-by-code', 'test', '基于授权码模式,如何实现 SSO 单点登录?', 'http://test.zt.iocoder.cn/it/20250502/sign_1746181948685.png', NULL, 0, 1800, 43200, '[\"http://127.0.0.1:18080\"]', '[\"authorization_code\",\"refresh_token\"]', '[\"user.read\",\"user.write\"]', '[]', '[]', '[]', NULL, '1', '2022-09-29 13:28:31', '1', '2025-05-02 18:32:30', b'0'); INSERT INTO `system_oauth2_client` (`id`, `client_id`, `secret`, `name`, `logo`, `description`, `status`, `access_token_validity_seconds`, `refresh_token_validity_seconds`, `redirect_uris`, `authorized_grant_types`, `scopes`, `auto_approve_scopes`, `authorities`, `resource_ids`, `additional_information`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (42, 'zt-sso-demo-by-password', 'test', '基于密码模式,如何实现 SSO 单点登录?', 'http://test.zt.iocoder.cn/604bdc695e13b3b22745be704d1f2aa8ee05c5f26f9fead6d1ca49005afbc857.jpeg', NULL, 0, 1800, 43200, '[\"http://127.0.0.1:18080\"]', '[\"password\",\"refresh_token\"]', '[\"user.read\",\"user.write\"]', '[]', '[]', '[]', NULL, '1', '2022-10-04 17:40:16', '1', '2025-05-04 16:00:46', b'0'); diff --git a/zt-framework/zt-common/src/main/java/com/zt/plat/framework/common/enums/DocumentEnum.java b/zt-framework/zt-common/src/main/java/com/zt/plat/framework/common/enums/DocumentEnum.java index f7598356..126c2688 100644 --- a/zt-framework/zt-common/src/main/java/com/zt/plat/framework/common/enums/DocumentEnum.java +++ b/zt-framework/zt-common/src/main/java/com/zt/plat/framework/common/enums/DocumentEnum.java @@ -13,7 +13,7 @@ import lombok.Getter; public enum DocumentEnum { REDIS_INSTALL("https://gitee.com/zhijiantianya/ruoyi-vue-pro/issues/I4VCSJ", "Redis 安装文档"), - TENANT("https://doc.iocoder.cn", "SaaS 多租户文档"); + TENANT("http://172.16.46.63:30888", "SaaS 多租户文档"); private final String url; private final String memo; diff --git a/zt-framework/zt-spring-boot-starter-web/src/main/java/com/zt/plat/framework/web/core/handler/GlobalExceptionHandler.java b/zt-framework/zt-spring-boot-starter-web/src/main/java/com/zt/plat/framework/web/core/handler/GlobalExceptionHandler.java index 1d2b8907..edcbfaf9 100644 --- a/zt-framework/zt-spring-boot-starter-web/src/main/java/com/zt/plat/framework/web/core/handler/GlobalExceptionHandler.java +++ b/zt-framework/zt-spring-boot-starter-web/src/main/java/com/zt/plat/framework/web/core/handler/GlobalExceptionHandler.java @@ -6,6 +6,7 @@ import cn.hutool.core.map.MapUtil; import cn.hutool.core.util.ObjUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.extra.servlet.JakartaServletUtil; +import com.fasterxml.jackson.databind.exc.InvalidFormatException; import com.zt.plat.framework.common.biz.infra.logger.ApiErrorLogCommonApi; import com.zt.plat.framework.common.biz.infra.logger.dto.ApiErrorLogCreateReqDTO; import com.zt.plat.framework.common.exception.ServiceException; @@ -16,7 +17,6 @@ import com.zt.plat.framework.common.util.json.JsonUtils; import com.zt.plat.framework.common.util.monitor.TracerUtils; import com.zt.plat.framework.common.util.servlet.ServletUtils; import com.zt.plat.framework.web.core.util.WebFrameworkUtils; -import com.fasterxml.jackson.databind.exc.InvalidFormatException; import jakarta.servlet.http.HttpServletRequest; import jakarta.validation.ConstraintViolation; import jakarta.validation.ConstraintViolationException; @@ -365,42 +365,12 @@ public class GlobalExceptionHandler { return CommonResult.error(NOT_IMPLEMENTED.getCode(), "[微信公众号 zt-module-mp - 表结构未导入][参考 http://172.16.46.63:30888/mp/build/ 开启]"); } - // 4. 商城系统 - if (StrUtil.containsAny(message, "product_", "promotion_", "trade_")) { - log.error("[商城系统 zt-module-mall - 已禁用][参考 http://172.16.46.63:30888/mall/build/ 开启]"); - return CommonResult.error(NOT_IMPLEMENTED.getCode(), - "[商城系统 zt-module-mall - 已禁用][参考 http://172.16.46.63:30888/mall/build/ 开启]"); - } - // 5. ERP 系统 - if (message.contains("erp_")) { - log.error("[ERP 系统 zt-module-erp - 表结构未导入][参考 http://172.16.46.63:30888/erp/build/ 开启]"); - return CommonResult.error(NOT_IMPLEMENTED.getCode(), - "[ERP 系统 zt-module-erp - 表结构未导入][参考 http://172.16.46.63:30888/erp/build/ 开启]"); - } - // 6. CRM 系统 - if (message.contains("crm_")) { - log.error("[CRM 系统 zt-module-crm - 表结构未导入][参考 http://172.16.46.63:30888/crm/build/ 开启]"); - return CommonResult.error(NOT_IMPLEMENTED.getCode(), - "[CRM 系统 zt-module-crm - 表结构未导入][参考 http://172.16.46.63:30888/crm/build/ 开启]"); - } - // 7. 支付平台 - if (message.contains("pay_")) { - log.error("[支付模块 zt-module-pay - 表结构未导入][参考 http://172.16.46.63:30888/pay/build/ 开启]"); - return CommonResult.error(NOT_IMPLEMENTED.getCode(), - "[支付模块 zt-module-pay - 表结构未导入][参考 http://172.16.46.63:30888/pay/build/ 开启]"); - } // 8. AI 大模型 if (message.contains("ai_")) { log.error("[AI 大模型 zt-module-ai - 表结构未导入][参考 http://172.16.46.63:30888/ai/build/ 开启]"); return CommonResult.error(NOT_IMPLEMENTED.getCode(), "[AI 大模型 zt-module-ai - 表结构未导入][参考 http://172.16.46.63:30888/ai/build/ 开启]"); } - // 9. IOT 物联网 - if (message.contains("iot_")) { - log.error("[IoT 物联网 zt-module-iot - 表结构未导入][参考 https://doc.iocoder.cn/iot/build/ 开启]"); - return CommonResult.error(NOT_IMPLEMENTED.getCode(), - "[IoT 物联网 zt-module-iot - 表结构未导入][参考 https://doc.iocoder.cn/iot/build/ 开启]"); - } return null; } diff --git a/zt-module-ai/zt-module-ai-server/src/main/java/com/zt/plat/module/ai/controller/admin/knowledge/vo/document/AiKnowledgeDocumentCreateListReqVO.java b/zt-module-ai/zt-module-ai-server/src/main/java/com/zt/plat/module/ai/controller/admin/knowledge/vo/document/AiKnowledgeDocumentCreateListReqVO.java index 38368f0b..dee17fc4 100644 --- a/zt-module-ai/zt-module-ai-server/src/main/java/com/zt/plat/module/ai/controller/admin/knowledge/vo/document/AiKnowledgeDocumentCreateListReqVO.java +++ b/zt-module-ai/zt-module-ai-server/src/main/java/com/zt/plat/module/ai/controller/admin/knowledge/vo/document/AiKnowledgeDocumentCreateListReqVO.java @@ -33,7 +33,7 @@ public class AiKnowledgeDocumentCreateListReqVO { @NotBlank(message = "文档名称不能为空") private String name; - @Schema(description = "文档 URL", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://doc.iocoder.cn") + @Schema(description = "文档 URL", requiredMode = Schema.RequiredMode.REQUIRED, example = "http://172.16.46.63:30888") @URL(message = "文档 URL 格式不正确") private String url; diff --git a/zt-module-ai/zt-module-ai-server/src/main/java/com/zt/plat/module/ai/controller/admin/knowledge/vo/document/AiKnowledgeDocumentRespVO.java b/zt-module-ai/zt-module-ai-server/src/main/java/com/zt/plat/module/ai/controller/admin/knowledge/vo/document/AiKnowledgeDocumentRespVO.java index 0a4249dc..de3bb07b 100644 --- a/zt-module-ai/zt-module-ai-server/src/main/java/com/zt/plat/module/ai/controller/admin/knowledge/vo/document/AiKnowledgeDocumentRespVO.java +++ b/zt-module-ai/zt-module-ai-server/src/main/java/com/zt/plat/module/ai/controller/admin/knowledge/vo/document/AiKnowledgeDocumentRespVO.java @@ -18,7 +18,7 @@ public class AiKnowledgeDocumentRespVO { @Schema(description = "文档名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "Java 开发手册") private String name; - @Schema(description = "文档 URL", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://doc.iocoder.cn") + @Schema(description = "文档 URL", requiredMode = Schema.RequiredMode.REQUIRED, example = "http://172.16.46.63:30888") private String url; @Schema(description = "文档内容", requiredMode = Schema.RequiredMode.REQUIRED, example = "Java 是一门面向对象的语言.....") diff --git a/zt-module-ai/zt-module-ai-server/src/main/java/com/zt/plat/module/ai/controller/admin/knowledge/vo/knowledge/AiKnowledgeDocumentCreateReqVO.java b/zt-module-ai/zt-module-ai-server/src/main/java/com/zt/plat/module/ai/controller/admin/knowledge/vo/knowledge/AiKnowledgeDocumentCreateReqVO.java index 4da54893..3a1e8fdb 100644 --- a/zt-module-ai/zt-module-ai-server/src/main/java/com/zt/plat/module/ai/controller/admin/knowledge/vo/knowledge/AiKnowledgeDocumentCreateReqVO.java +++ b/zt-module-ai/zt-module-ai-server/src/main/java/com/zt/plat/module/ai/controller/admin/knowledge/vo/knowledge/AiKnowledgeDocumentCreateReqVO.java @@ -19,7 +19,7 @@ public class AiKnowledgeDocumentCreateReqVO { @NotBlank(message = "文档名称不能为空") private String name; - @Schema(description = "文档 URL", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://doc.iocoder.cn") + @Schema(description = "文档 URL", requiredMode = Schema.RequiredMode.REQUIRED, example = "http://172.16.46.63:30888") @URL(message = "文档 URL 格式不正确") private String url; diff --git a/zt-module-infra/zt-module-infra-server/src/test/java/com/zt/plat/module/infra/service/file/FileConfigServiceImplTest.java b/zt-module-infra/zt-module-infra-server/src/test/java/com/zt/plat/module/infra/service/file/FileConfigServiceImplTest.java index 9c572d9d..7d271209 100644 --- a/zt-module-infra/zt-module-infra-server/src/test/java/com/zt/plat/module/infra/service/file/FileConfigServiceImplTest.java +++ b/zt-module-infra/zt-module-infra-server/src/test/java/com/zt/plat/module/infra/service/file/FileConfigServiceImplTest.java @@ -15,13 +15,13 @@ import com.zt.plat.module.infra.framework.file.core.client.FileClientFactory; import com.zt.plat.module.infra.framework.file.core.client.local.LocalFileClient; import com.zt.plat.module.infra.framework.file.core.client.local.LocalFileClientConfig; import com.zt.plat.module.infra.framework.file.core.enums.FileStorageEnum; +import jakarta.annotation.Resource; +import jakarta.validation.Validator; import lombok.Data; import org.junit.jupiter.api.Test; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Import; -import jakarta.annotation.Resource; -import jakarta.validation.Validator; import java.io.Serializable; import java.time.LocalDateTime; import java.util.Map; @@ -92,7 +92,7 @@ public class FileConfigServiceImplTest extends BaseDbUnitTest { o.setId(dbFileConfig.getId()); // 设置更新的 ID o.setStorage(FileStorageEnum.LOCAL.getStorage()); Map config = MapUtil.builder().put("basePath", "/yunai2") - .put("domain", "https://doc.iocoder.cn").build(); + .put("domain", "http://172.16.46.63:30888").build(); o.setConfig(config); }); @@ -102,7 +102,7 @@ public class FileConfigServiceImplTest extends BaseDbUnitTest { FileConfigDO fileConfig = fileConfigMapper.selectById(reqVO.getId()); // 获取最新的 assertPojoEquals(reqVO, fileConfig, "config"); assertEquals("/yunai2", ((LocalFileClientConfig) fileConfig.getConfig()).getBasePath()); - assertEquals("https://doc.iocoder.cn", ((LocalFileClientConfig) fileConfig.getConfig()).getDomain()); + assertEquals("http://172.16.46.63:30888", ((LocalFileClientConfig) fileConfig.getConfig()).getDomain()); // 验证 cache assertNull(fileConfigService.getClientCache().getIfPresent(fileConfig.getId())); } diff --git a/zt-module-iot/zt-module-iot-biz/src/test/java/com/zt/plat/module/iot/service/rule/action/databridge/IotDataBridgeExecuteTest.java b/zt-module-iot/zt-module-iot-biz/src/test/java/com/zt/plat/module/iot/service/rule/action/databridge/IotDataBridgeExecuteTest.java index 9a420944..b940da30 100644 --- a/zt-module-iot/zt-module-iot-biz/src/test/java/com/zt/plat/module/iot/service/rule/action/databridge/IotDataBridgeExecuteTest.java +++ b/zt-module-iot/zt-module-iot-biz/src/test/java/com/zt/plat/module/iot/service/rule/action/databridge/IotDataBridgeExecuteTest.java @@ -143,7 +143,7 @@ public class IotDataBridgeExecuteTest extends BaseMockitoUnitTest { public void testHttpDataBridge() throws Exception { // 创建配置 IotDataBridgeHttpConfig config = new IotDataBridgeHttpConfig(); - config.setUrl("https://doc.iocoder.cn/"); + config.setUrl("http://172.16.46.63:30888/"); config.setMethod(HttpMethod.GET.name()); // 执行测试 diff --git a/zt-module-mp/zt-module-mp-server/src/main/java/com/zt/plat/module/mp/service/account/MpAccountServiceImpl.java b/zt-module-mp/zt-module-mp-server/src/main/java/com/zt/plat/module/mp/service/account/MpAccountServiceImpl.java index 5736b7f3..0dc6b18d 100644 --- a/zt-module-mp/zt-module-mp-server/src/main/java/com/zt/plat/module/mp/service/account/MpAccountServiceImpl.java +++ b/zt-module-mp/zt-module-mp-server/src/main/java/com/zt/plat/module/mp/service/account/MpAccountServiceImpl.java @@ -76,7 +76,7 @@ public class MpAccountServiceImpl implements MpAccountService { if (!ex.getMessage().contains("doesn't exist")) { throw ex; } - log.error("[微信公众号 zt-module-mp - 表结构未导入][参考 https://doc.iocoder.cn/mp/build/ 开启]"); + log.error("[微信公众号 zt-module-mp - 表结构未导入][参考 http://172.16.46.63:30888/mp/build/ 开启]"); } log.info("[initLocalCacheIfUpdate][缓存公众号账号,数量为:{}]", accounts.size()); diff --git a/zt-module-system/zt-module-system-server/src/main/java/com/zt/plat/module/system/controller/admin/integration/iwork/vo/IWorkDetailRecordVO.java b/zt-module-system/zt-module-system-server/src/main/java/com/zt/plat/module/system/controller/admin/integration/iwork/vo/IWorkDetailRecordVO.java deleted file mode 100644 index 7a2dce2d..00000000 --- a/zt-module-system/zt-module-system-server/src/main/java/com/zt/plat/module/system/controller/admin/integration/iwork/vo/IWorkDetailRecordVO.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.zt.plat.module.system.controller.admin.integration.iwork.vo; - -import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.Valid; -import jakarta.validation.constraints.NotEmpty; -import lombok.Data; - -import java.util.List; - -/** - * 传递给 iWork 的单条明细记录。 - */ -@Data -public class IWorkDetailRecordVO { - - @Schema(description = "记录序号,从 0 开始", example = "0") - private Integer recordOrder; - - @Schema(description = "明细字段列表") - @NotEmpty(message = "明细字段不能为空") - @Valid - private List fields; -} diff --git a/zt-module-system/zt-module-system-server/src/main/java/com/zt/plat/module/system/controller/admin/integration/iwork/vo/IWorkDetailTableVO.java b/zt-module-system/zt-module-system-server/src/main/java/com/zt/plat/module/system/controller/admin/integration/iwork/vo/IWorkDetailTableVO.java deleted file mode 100644 index 3d17be66..00000000 --- a/zt-module-system/zt-module-system-server/src/main/java/com/zt/plat/module/system/controller/admin/integration/iwork/vo/IWorkDetailTableVO.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.zt.plat.module.system.controller.admin.integration.iwork.vo; - -import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.Valid; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotEmpty; -import lombok.Data; - -import java.util.List; - -/** - * iWork 流程请求中的明细表定义。 - */ -@Data -public class IWorkDetailTableVO { - - @Schema(description = "表名", example = "formtable_main_26_dt1") - @NotBlank(message = "明细表名不能为空") - private String tableDBName; - - @Schema(description = "明细记录集合") - @NotEmpty(message = "明细记录不能为空") - @Valid - private List records; -} diff --git a/zt-module-system/zt-module-system-server/src/main/java/com/zt/plat/module/system/controller/admin/integration/iwork/vo/IWorkFormFieldVO.java b/zt-module-system/zt-module-system-server/src/main/java/com/zt/plat/module/system/controller/admin/integration/iwork/vo/IWorkFormFieldVO.java deleted file mode 100644 index c40c2f85..00000000 --- a/zt-module-system/zt-module-system-server/src/main/java/com/zt/plat/module/system/controller/admin/integration/iwork/vo/IWorkFormFieldVO.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.zt.plat.module.system.controller.admin.integration.iwork.vo; - -import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.NotBlank; -import lombok.Data; - -/** - * 提交给 iWork 的单个表单字段。 - */ -@Data -public class IWorkFormFieldVO { - - @Schema(description = "字段名", example = "sqr") - @NotBlank(message = "字段名不能为空") - private String fieldName; - - @Schema(description = "字段值", example = "张三") - @NotBlank(message = "字段值不能为空") - private String fieldValue; -} diff --git a/zt-module-system/zt-module-system-server/src/main/java/com/zt/plat/module/system/controller/admin/integration/iwork/vo/IWorkOperationRespVO.java b/zt-module-system/zt-module-system-server/src/main/java/com/zt/plat/module/system/controller/admin/integration/iwork/vo/IWorkOperationRespVO.java index 2b01e0a6..c0b5e043 100644 --- a/zt-module-system/zt-module-system-server/src/main/java/com/zt/plat/module/system/controller/admin/integration/iwork/vo/IWorkOperationRespVO.java +++ b/zt-module-system/zt-module-system-server/src/main/java/com/zt/plat/module/system/controller/admin/integration/iwork/vo/IWorkOperationRespVO.java @@ -1,5 +1,6 @@ package com.zt.plat.module.system.controller.admin.integration.iwork.vo; +import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @@ -11,12 +12,49 @@ import java.util.Map; @Data public class IWorkOperationRespVO { - @Schema(description = "iWork 返回的原始数据") - private Map payload; + @Schema(description = "iWork 返回的原始数据结构") + private Payload payload; @Schema(description = "是否判断为成功") private boolean success; @Schema(description = "返回提示信息") private String message; + + @Data + public static class Payload { + + @Schema(description = "iWork 返回的业务状态码,例如 SUCCESS") + private String code; + + @Schema(description = "iWork 返回的数据体") + private PayloadData data; + + @Schema(description = "错误信息对象,通常为空对象") + private Map errMsg; + + @Schema(description = "返回失败时的详细信息") + private ReqFailMsg reqFailMsg; + } + + @Data + public static class PayloadData { + + @Schema(description = "iWork 生成的请求编号 requestid") + @JsonProperty("requestid") + private Long requestId; + } + + @Data + public static class ReqFailMsg { + + @Schema(description = "失败时的关键参数集合") + private Map keyParameters; + + @Schema(description = "失败消息对象") + private Map msgInfo; + + @Schema(description = "其他附加参数,例如 doAutoApprove") + private Map otherParams; + } } diff --git a/zt-module-system/zt-module-system-server/src/main/java/com/zt/plat/module/system/controller/admin/integration/iwork/vo/IWorkOrgQueryReqVO.java b/zt-module-system/zt-module-system-server/src/main/java/com/zt/plat/module/system/controller/admin/integration/iwork/vo/IWorkOrgQueryReqVO.java deleted file mode 100644 index bd59d628..00000000 --- a/zt-module-system/zt-module-system-server/src/main/java/com/zt/plat/module/system/controller/admin/integration/iwork/vo/IWorkOrgQueryReqVO.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.zt.plat.module.system.controller.admin.integration.iwork.vo; - -import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.NotEmpty; -import lombok.Data; - -import java.util.Map; - -/** - * 查询 iWork 人力组织信息所需的参数。 - */ -@Data -public class IWorkOrgQueryReqVO { - - @Schema(description = "当前页码", example = "1") - private Integer curpage; - - @Schema(description = "每页条数", example = "10") - private Integer pagesize; - - // ================= 分部查询 ================= - - @Schema(description = "分部编码") - private String subcompanyCode; - - @Schema(description = "分部名称") - private String subcompanyName; - - // ================= 部门查询 ================= - - @Schema(description = "部门编码") - private String departmentCode; - - @Schema(description = "部门名称") - private String departmentName; - - @Schema(description = "所属分部ID") - private String subcompanyId; - - // ================= 岗位查询 ================= - - @Schema(description = "岗位编码") - private String jobTitleCode; - - @Schema(description = "岗位名称") - private String jobTitleName; - - // ================= 人员查询 ================= - - @Schema(description = "人员工号") - private String workCode; - - @Schema(description = "人员姓名") - private String lastName; - - @Schema(description = "所属部门ID") - private String departmentId; - - @Schema(description = "所属岗位ID") - private String jobTitleId; - - @Schema(description = "人员状态 (0:试用, 1:正式, 2:临时, 3:试用延期, 4:解聘, 5:离职, 6:退休, 7:无效)") - private String status; - - @Schema(description = "手机号") - private String mobile; - - @Schema(description = "邮箱") - private String email; - - @Schema(description = "查询参数(扩展用),将被序列化为 params 传给 iWork") - private Map params; -} diff --git a/zt-module-system/zt-module-system-server/src/main/java/com/zt/plat/module/system/controller/admin/integration/iwork/vo/IWorkTokenApplyReqVO.java b/zt-module-system/zt-module-system-server/src/main/java/com/zt/plat/module/system/controller/admin/integration/iwork/vo/IWorkTokenApplyReqVO.java deleted file mode 100644 index b3422122..00000000 --- a/zt-module-system/zt-module-system-server/src/main/java/com/zt/plat/module/system/controller/admin/integration/iwork/vo/IWorkTokenApplyReqVO.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.zt.plat.module.system.controller.admin.integration.iwork.vo; - -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 获取 iWork 会话令牌的请求载荷。 - */ -@Data -@EqualsAndHashCode(callSuper = true) -public class IWorkTokenApplyReqVO extends IWorkBaseReqVO { -} diff --git a/zt-module-system/zt-module-system-server/src/main/java/com/zt/plat/module/system/framework/integration/iwork/config/IWorkProperties.java b/zt-module-system/zt-module-system-server/src/main/java/com/zt/plat/module/system/framework/integration/iwork/config/IWorkProperties.java index cadd8b88..9443464e 100644 --- a/zt-module-system/zt-module-system-server/src/main/java/com/zt/plat/module/system/framework/integration/iwork/config/IWorkProperties.java +++ b/zt-module-system/zt-module-system-server/src/main/java/com/zt/plat/module/system/framework/integration/iwork/config/IWorkProperties.java @@ -97,11 +97,6 @@ public class IWorkProperties { */ @Min(value = 1, message = "iWork Token 有效期必须大于 0") private long ttlSeconds; - /** - * Token 过期前提前刷新的秒数。 - */ - @Min(value = 0, message = "iWork Token 提前刷新秒数不能为负数") - private long refreshAheadSeconds; } @Data diff --git a/zt-module-system/zt-module-system-server/src/main/java/com/zt/plat/module/system/service/integration/iwork/impl/IWorkIntegrationServiceImpl.java b/zt-module-system/zt-module-system-server/src/main/java/com/zt/plat/module/system/service/integration/iwork/impl/IWorkIntegrationServiceImpl.java index 3c6885d3..60167296 100644 --- a/zt-module-system/zt-module-system-server/src/main/java/com/zt/plat/module/system/service/integration/iwork/impl/IWorkIntegrationServiceImpl.java +++ b/zt-module-system/zt-module-system-server/src/main/java/com/zt/plat/module/system/service/integration/iwork/impl/IWorkIntegrationServiceImpl.java @@ -20,7 +20,6 @@ import com.zt.plat.module.system.framework.integration.iwork.config.IWorkPropert import com.zt.plat.module.system.service.integration.iwork.IWorkIntegrationService; import lombok.Getter; import lombok.RequiredArgsConstructor; -import lombok.ToString; import lombok.extern.slf4j.Slf4j; import okhttp3.*; import okio.Buffer; @@ -59,10 +58,6 @@ public class IWorkIntegrationServiceImpl implements IWorkIntegrationService { private final FileApi fileApi; private final BusinessFileApi businessFileApi; - private final Cache sessionCache = Caffeine.newBuilder() - .maximumSize(256) - .build(); - private final Cache registrationCache = Caffeine.newBuilder() .maximumSize(32) .build(); @@ -104,7 +99,7 @@ public class IWorkIntegrationServiceImpl implements IWorkIntegrationService { boolean force = forceRegistration || forceToken; ClientKeyPair clientKeyPair = resolveClientKeyPair(appId, forceRegistration); - IWorkSession session = ensureSession(appId, clientKeyPair, operatorUserId, force); + IWorkSession session = createSession(appId, clientKeyPair, operatorUserId, force); IWorkAuthTokenRespVO respVO = new IWorkAuthTokenRespVO(); respVO.setAppId(appId); @@ -124,7 +119,7 @@ public class IWorkIntegrationServiceImpl implements IWorkIntegrationService { String operatorUserId = resolveOperatorUserId(reqVO.getOperatorUserId()); ensureIdentifier(reqVO.getIdentifierKey(), reqVO.getIdentifierValue()); - IWorkSession session = ensureSession(appId, clientKeyPair, operatorUserId, Boolean.TRUE.equals(reqVO.getForceRefreshToken())); + IWorkSession session = createSession(appId, clientKeyPair, operatorUserId, Boolean.TRUE.equals(reqVO.getForceRefreshToken())); Map payload = buildUserPayload(reqVO); String responseBody = executeJsonRequest(properties.getPaths().getUserInfo(), reqVO.getQueryParams(), appId, session, payload); @@ -137,7 +132,7 @@ public class IWorkIntegrationServiceImpl implements IWorkIntegrationService { String appId = resolveAppId(); ClientKeyPair clientKeyPair = resolveClientKeyPair(appId, Boolean.TRUE.equals(reqVO.getForceRefreshToken())); String operatorUserId = resolveOperatorUserId(reqVO.getOperatorUserId()); - IWorkSession session = ensureSession(appId, clientKeyPair, operatorUserId, Boolean.TRUE.equals(reqVO.getForceRefreshToken())); + IWorkSession session = createSession(appId, clientKeyPair, operatorUserId, Boolean.TRUE.equals(reqVO.getForceRefreshToken())); Map payload = buildCreatePayload(reqVO); String responseBody = executeFormRequest(properties.getPaths().getCreateWorkflow(), null, appId, session, payload); @@ -153,7 +148,7 @@ public class IWorkIntegrationServiceImpl implements IWorkIntegrationService { if (!StringUtils.hasText(reqVO.getRequestId())) { throw ServiceExceptionUtil.exception(IWORK_USER_IDENTIFIER_MISSING); } - IWorkSession session = ensureSession(appId, clientKeyPair, operatorUserId, Boolean.TRUE.equals(reqVO.getForceRefreshToken())); + IWorkSession session = createSession(appId, clientKeyPair, operatorUserId, Boolean.TRUE.equals(reqVO.getForceRefreshToken())); Map payload = buildVoidPayload(reqVO); String responseBody = executeJsonRequest(properties.getPaths().getVoidWorkflow(), null, appId, session, payload); @@ -308,26 +303,6 @@ public class IWorkIntegrationServiceImpl implements IWorkIntegrationService { } } - private IWorkSession ensureSession(String appId, ClientKeyPair clientKeyPair, String operatorUserId, boolean forceRefresh) { - SessionKey key = new SessionKey(appId, operatorUserId); - Instant now = Instant.now(); - if (!forceRefresh) { - IWorkSession cached = sessionCache.getIfPresent(key); - if (cached != null && cached.isValid(now, properties.getToken().getRefreshAheadSeconds())) { - return cached; - } - } - synchronized (key.intern()) { - IWorkSession cached = sessionCache.getIfPresent(key); - if (!forceRefresh && cached != null && cached.isValid(now, properties.getToken().getRefreshAheadSeconds())) { - return cached; - } - IWorkSession session = createSession(appId, clientKeyPair, operatorUserId, forceRefresh); - sessionCache.put(key, session); - return session; - } - } - private IWorkSession createSession(String appId, ClientKeyPair clientKeyPair, String operatorUserId, boolean forceRefreshRegistration) { RegistrationState registration = obtainRegistration(appId, clientKeyPair, forceRefreshRegistration); String encryptedSecret = encryptWithPublicKey(registration.secret(), registration.spk()); @@ -651,7 +626,7 @@ public class IWorkIntegrationServiceImpl implements IWorkIntegrationService { return respVO; } JsonNode node = parseJson(responseBody, IWORK_REMOTE_REQUEST_FAILED); - respVO.setPayload(objectMapper.convertValue(node, MAP_TYPE)); + respVO.setPayload(objectMapper.convertValue(node, IWorkOperationRespVO.Payload.class)); respVO.setSuccess(isSuccess(node)); respVO.setMessage(resolveMessage(node)); return respVO; @@ -992,46 +967,5 @@ public class IWorkIntegrationServiceImpl implements IWorkIntegrationService { this.expiresAt = expiresAt; this.spk = spk; } - - private boolean isValid(Instant now, long refreshAheadSeconds) { - Instant refreshThreshold = expiresAt.minusSeconds(Math.max(0L, refreshAheadSeconds)); - return refreshThreshold.isAfter(now) && StringUtils.hasText(token) && StringUtils.hasText(encryptedUserId); - } - } - - @ToString - private static final class SessionKey { - private final String appId; - private final String operatorUserId; - - private SessionKey(String appId, String operatorUserId) { - this.appId = appId; - this.operatorUserId = operatorUserId; - } - - private String cacheKey() { - return appId + "::" + operatorUserId; - } - - private String intern() { - return cacheKey().intern(); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof SessionKey that)) { - return false; - } - return Objects.equals(appId, that.appId) - && Objects.equals(operatorUserId, that.operatorUserId); - } - - @Override - public int hashCode() { - return Objects.hash(appId, operatorUserId); - } } } diff --git a/zt-module-system/zt-module-system-server/src/main/resources/application.yaml b/zt-module-system/zt-module-system-server/src/main/resources/application.yaml index c027e52b..3369dc0d 100644 --- a/zt-module-system/zt-module-system-server/src/main/resources/application.yaml +++ b/zt-module-system/zt-module-system-server/src/main/resources/application.yaml @@ -118,7 +118,6 @@ iwork: void-workflow: /api/workflow/paService/doCancelRequest token: ttl-seconds: 3600 - refresh-ahead-seconds: 60 client: connect-timeout: 60s response-timeout: 60s diff --git a/zt-server/src/main/java/com/zt/plat/server/controller/DefaultController.java b/zt-server/src/main/java/com/zt/plat/server/controller/DefaultController.java index fd7f2f28..1306e0df 100644 --- a/zt-server/src/main/java/com/zt/plat/server/controller/DefaultController.java +++ b/zt-server/src/main/java/com/zt/plat/server/controller/DefaultController.java @@ -23,57 +23,25 @@ public class DefaultController { @RequestMapping("/admin-api/bpm/**") public CommonResult bpm404() { return CommonResult.error(NOT_IMPLEMENTED.getCode(), - "[工作流模块 zt-module-bpm - 已禁用][参考 https://doc.iocoder.cn/bpm/ 开启]"); + "[工作流模块 zt-module-bpm - 已禁用][参考 http://172.16.46.63:30888/bpm/ 开启]"); } @RequestMapping("/admin-api/mp/**") public CommonResult mp404() { return CommonResult.error(NOT_IMPLEMENTED.getCode(), - "[微信公众号 zt-module-mp - 已禁用][参考 https://doc.iocoder.cn/mp/build/ 开启]"); - } - - @RequestMapping(value = { "/admin-api/product/**", // 商品中心 - "/admin-api/trade/**", // 交易中心 - "/admin-api/promotion/**" }) // 营销中心 - public CommonResult mall404() { - return CommonResult.error(NOT_IMPLEMENTED.getCode(), - "[商城系统 zt-module-mall - 已禁用][参考 https://doc.iocoder.cn/mall/build/ 开启]"); - } - - @RequestMapping("/admin-api/erp/**") - public CommonResult erp404() { - return CommonResult.error(NOT_IMPLEMENTED.getCode(), - "[ERP 模块 zt-module-erp - 已禁用][参考 https://doc.iocoder.cn/erp/build/ 开启]"); - } - - @RequestMapping("/admin-api/crm/**") - public CommonResult crm404() { - return CommonResult.error(NOT_IMPLEMENTED.getCode(), - "[CRM 模块 zt-module-crm - 已禁用][参考 https://doc.iocoder.cn/crm/build/ 开启]"); + "[微信公众号 zt-module-mp - 已禁用][参考 http://172.16.46.63:30888/mp/build/ 开启]"); } @RequestMapping(value = { "/admin-api/report/**"}) public CommonResult report404() { return CommonResult.error(NOT_IMPLEMENTED.getCode(), - "[报表模块 zt-module-report - 已禁用][参考 https://doc.iocoder.cn/report/ 开启]"); - } - - @RequestMapping(value = { "/admin-api/pay/**"}) - public CommonResult pay404() { - return CommonResult.error(NOT_IMPLEMENTED.getCode(), - "[支付模块 zt-module-pay - 已禁用][参考 https://doc.iocoder.cn/pay/build/ 开启]"); + "[报表模块 zt-module-report - 已禁用][参考 http://172.16.46.63:30888/report/ 开启]"); } @RequestMapping(value = { "/admin-api/ai/**"}) public CommonResult ai404() { return CommonResult.error(NOT_IMPLEMENTED.getCode(), - "[AI 大模型 zt-module-ai - 已禁用][参考 https://doc.iocoder.cn/ai/build/ 开启]"); - } - - @RequestMapping(value = { "/admin-api/iot/**"}) - public CommonResult iot404() { - return CommonResult.error(NOT_IMPLEMENTED.getCode(), - "[IoT 物联网 zt-module-iot - 已禁用][参考 https://doc.iocoder.cn/iot/build/ 开启]"); + "[AI 大模型 zt-module-ai - 已禁用][参考 http://172.16.46.63:30888/ai/build/ 开启]"); } /** diff --git a/zt-server/src/main/resources/application.yaml b/zt-server/src/main/resources/application.yaml index 2dc6dbbb..da5fa087 100644 --- a/zt-server/src/main/resources/application.yaml +++ b/zt-server/src/main/resources/application.yaml @@ -84,7 +84,6 @@ iwork: void-workflow: /api/workflow/paService/doCancelRequest token: ttl-seconds: 3600 - refresh-ahead-seconds: 60 client: connect-timeout: 5s response-timeout: 30s