You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

227 lines
8.0 KiB
XML

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-modules</artifactId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>hwmom-dms</artifactId>
<description>
hwmom-dms设备模块
</description>
<dependencies>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-nacos</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-sentinel</artifactId>
</dependency>
<!-- RuoYi Common Log -->
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-log</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-dict</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-doc</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-web</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-mybatis</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-dubbo</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-seata</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-idempotent</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-tenant</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-security</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-translation</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-sensitive</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-encrypt</artifactId>
</dependency>
<!-- RuoYi Api System -->
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-api-system</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-api-resource</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.mysql</groupId>-->
<!-- <artifactId>mysql-connector-j</artifactId>-->
<!-- </dependency>-->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
</dependency>
<!-- jxls poi -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.15</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.15</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>3.15</version>
</dependency>
<dependency>
<groupId>net.sf.jxls</groupId>
<artifactId>jxls-core</artifactId>
<version>1.0.3</version>
</dependency>
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
</dependency>
<!-- <dependency>
<groupId>com.aizuda</groupId>
<artifactId>snail-job-server-common</artifactId>
<version>${snailjob.version}</version>
</dependency>
&lt;!&ndash; snail-job 重试相关依赖 &ndash;&gt;
<dependency>
<groupId>com.aizuda</groupId>
<artifactId>snail-job-client-retry-core</artifactId>
<version>${snailjob.version}</version>
</dependency>
&lt;!&ndash; snail-job 客户端核心依赖 &ndash;&gt;
<dependency>
<groupId>com.aizuda</groupId>
<artifactId>snail-job-client-job-core</artifactId>
<version>${snailjob.version}</version>
</dependency>-->
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-api-job</artifactId>
<version>${revision}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>hwmom-api-dms</artifactId>
<version>${revision}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>hwmom-api-workflow</artifactId>
<version>2.2.2</version>
<scope>compile</scope>
<exclusions>
<!-- 排除消息总线依赖DMS模块不需要 -->
<exclusion>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-bus</artifactId>
</exclusion>
</exclusions>
</dependency>
<!--通过 Dubbo 远程调用 workflow 服务的 completeTask 方法时。
原因分析:该调用是在一个由 CompletableFuture.runAsync() 创建的异步线程中执行的。在 ruoyi-cloud-plus (以及类似的微服务架构) 中,用户认证信息(如 Sa-Token通常是存储在 ThreadLocal 变量中的,它与当前请求线程绑定。当您创建一个新的子线程时,父线程的 ThreadLocal 变量默认不会传递给子线程。因此在异步线程中Sa-Token 的上下文丢失,导致 StpUtil.getTokenValue() 等方法无法获取到 token当 Dubbo 客户端过滤器尝试将 token 放入 RPC 上下文时失败,或者说,在 workflow 服务端Sa-Token 的服务端过滤器无法从 RPC 上下文中获取到 token最终导致依赖用户身份认证的 FlwTaskServiceImpl.completeTask 方法抛出 "未能读取到有效 token" 的业务异常。
解决方案ruoyi-cloud-plus 框架集成了阿里巴巴的 TransmittableThreadLocal (TTL) 库来解决此问题。TTL可以实现父子线程之间的 ThreadLocal 数据传递。为了让 CompletableFuture 与 TTL 协同工作,需要将提交给它的 Runnable 或 Callable 任务用 TtlRunnable 或 TtlCallable 进行包装。这样在任务执行前TTL 会捕获父线程的上下文(包括 Sa-Token 的信息),并在子线程中恢复它。-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>transmittable-thread-local</artifactId>
<version>2.14.4</version>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>