Commit 37db99e20bd685059f1e3647fda3892155c68ee4
1 parent
c4c45132
feat:【IoT 物联网】新版本同步
Showing
7 changed files
with
18 additions
and
11 deletions
pom.xml
| @@ -24,7 +24,7 @@ | @@ -24,7 +24,7 @@ | ||
| 24 | <!-- <module>yudao-module-crm</module>--> | 24 | <!-- <module>yudao-module-crm</module>--> |
| 25 | <!-- <module>yudao-module-erp</module>--> | 25 | <!-- <module>yudao-module-erp</module>--> |
| 26 | <!-- <module>yudao-module-ai</module>--> | 26 | <!-- <module>yudao-module-ai</module>--> |
| 27 | - <module>yudao-module-iot</module> | 27 | +<!-- <module>yudao-module-iot</module>--> |
| 28 | </modules> | 28 | </modules> |
| 29 | 29 | ||
| 30 | <name>${project.artifactId}</name> | 30 | <name>${project.artifactId}</name> |
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/json/JsonUtils.java
| @@ -13,6 +13,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; | @@ -13,6 +13,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; | ||
| 13 | import com.fasterxml.jackson.databind.SerializationFeature; | 13 | import com.fasterxml.jackson.databind.SerializationFeature; |
| 14 | import com.fasterxml.jackson.databind.module.SimpleModule; | 14 | import com.fasterxml.jackson.databind.module.SimpleModule; |
| 15 | import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; | 15 | import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; |
| 16 | +import lombok.Getter; | ||
| 16 | import lombok.SneakyThrows; | 17 | import lombok.SneakyThrows; |
| 17 | import lombok.extern.slf4j.Slf4j; | 18 | import lombok.extern.slf4j.Slf4j; |
| 18 | 19 | ||
| @@ -30,6 +31,7 @@ import java.util.List; | @@ -30,6 +31,7 @@ import java.util.List; | ||
| 30 | @Slf4j | 31 | @Slf4j |
| 31 | public class JsonUtils { | 32 | public class JsonUtils { |
| 32 | 33 | ||
| 34 | + @Getter | ||
| 33 | private static ObjectMapper objectMapper = new ObjectMapper(); | 35 | private static ObjectMapper objectMapper = new ObjectMapper(); |
| 34 | 36 | ||
| 35 | static { | 37 | static { |
yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/config/YudaoMybatisAutoConfiguration.java
| @@ -2,6 +2,7 @@ package cn.iocoder.yudao.framework.mybatis.config; | @@ -2,6 +2,7 @@ package cn.iocoder.yudao.framework.mybatis.config; | ||
| 2 | 2 | ||
| 3 | import cn.hutool.core.collection.CollUtil; | 3 | import cn.hutool.core.collection.CollUtil; |
| 4 | import cn.hutool.core.util.StrUtil; | 4 | import cn.hutool.core.util.StrUtil; |
| 5 | +import cn.iocoder.yudao.framework.common.util.json.JsonUtils; | ||
| 5 | import cn.iocoder.yudao.framework.mybatis.core.handler.DefaultDBFieldHandler; | 6 | import cn.iocoder.yudao.framework.mybatis.core.handler.DefaultDBFieldHandler; |
| 6 | import com.baomidou.mybatisplus.annotation.DbType; | 7 | import com.baomidou.mybatisplus.annotation.DbType; |
| 7 | import com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration; | 8 | import com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration; |
| @@ -82,7 +83,11 @@ public class YudaoMybatisAutoConfiguration { | @@ -82,7 +83,11 @@ public class YudaoMybatisAutoConfiguration { | ||
| 82 | @Bean | 83 | @Bean |
| 83 | public JacksonTypeHandler jacksonTypeHandler(List<ObjectMapper> objectMappers) { | 84 | public JacksonTypeHandler jacksonTypeHandler(List<ObjectMapper> objectMappers) { |
| 84 | // 特殊:设置 JacksonTypeHandler 的 ObjectMapper! | 85 | // 特殊:设置 JacksonTypeHandler 的 ObjectMapper! |
| 85 | - JacksonTypeHandler.setObjectMapper(CollUtil.getFirst(objectMappers)); | 86 | + ObjectMapper objectMapper = CollUtil.getFirst(objectMappers); |
| 87 | + if (objectMapper == null) { | ||
| 88 | + objectMapper = JsonUtils.getObjectMapper(); | ||
| 89 | + } | ||
| 90 | + JacksonTypeHandler.setObjectMapper(objectMapper); | ||
| 86 | return new JacksonTypeHandler(Object.class); | 91 | return new JacksonTypeHandler(Object.class); |
| 87 | } | 92 | } |
| 88 | 93 |
yudao-module-bpm/src/main/java/cn/iocoder/yudao/module/bpm/service/task/BpmProcessInstanceServiceImpl.java
| @@ -958,7 +958,7 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService | @@ -958,7 +958,7 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService | ||
| 958 | // 1.3.1 获取父流程实例 并标记为不通过 | 958 | // 1.3.1 获取父流程实例 并标记为不通过 |
| 959 | Execution execution = runtimeService.createExecutionQuery().executionId(instance.getSuperExecutionId()).singleResult(); | 959 | Execution execution = runtimeService.createExecutionQuery().executionId(instance.getSuperExecutionId()).singleResult(); |
| 960 | ProcessInstance parentProcessInstance = getProcessInstance(execution.getProcessInstanceId()); | 960 | ProcessInstance parentProcessInstance = getProcessInstance(execution.getProcessInstanceId()); |
| 961 | - updateProcessInstanceReject(parentProcessInstance, REJECT_CHILD_PROCESS.getReason()); | 961 | + updateProcessInstanceReject(parentProcessInstance, BpmReasonEnum.REJECT_CHILD_PROCESS.getReason()); |
| 962 | 962 | ||
| 963 | // 1.3.2 结束父流程。需要在子流程结束事务提交后执行 | 963 | // 1.3.2 结束父流程。需要在子流程结束事务提交后执行 |
| 964 | TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() { | 964 | TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() { |
| @@ -969,7 +969,7 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService | @@ -969,7 +969,7 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService | ||
| 969 | if (ObjectUtil.equal(transactionStatus, TransactionSynchronization.STATUS_ROLLED_BACK)) { | 969 | if (ObjectUtil.equal(transactionStatus, TransactionSynchronization.STATUS_ROLLED_BACK)) { |
| 970 | return; | 970 | return; |
| 971 | } | 971 | } |
| 972 | - taskService.moveTaskToEnd(parentProcessInstance.getId(),REJECT_CHILD_PROCESS.getReason()); | 972 | + taskService.moveTaskToEnd(parentProcessInstance.getId(), BpmReasonEnum.REJECT_CHILD_PROCESS.getReason()); |
| 973 | } | 973 | } |
| 974 | }); | 974 | }); |
| 975 | } | 975 | } |
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/ota/IotOtaTaskRecordController.java
| 1 | package cn.iocoder.yudao.module.iot.controller.admin.ota; | 1 | package cn.iocoder.yudao.module.iot.controller.admin.ota; |
| 2 | 2 | ||
| 3 | +4import cn.hutool.core.collection.CollUtil; | ||
| 3 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; | 4 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 4 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 5 | import cn.iocoder.yudao.framework.common.util.collection.MapUtils; | 6 | import cn.iocoder.yudao.framework.common.util.collection.MapUtils; |
| @@ -18,7 +19,6 @@ import io.swagger.v3.oas.annotations.Parameters; | @@ -18,7 +19,6 @@ import io.swagger.v3.oas.annotations.Parameters; | ||
| 18 | import io.swagger.v3.oas.annotations.tags.Tag; | 19 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 19 | import jakarta.annotation.Resource; | 20 | import jakarta.annotation.Resource; |
| 20 | import jakarta.validation.Valid; | 21 | import jakarta.validation.Valid; |
| 21 | -import org.dromara.hutool.core.collection.CollUtil; | ||
| 22 | import org.springframework.security.access.prepost.PreAuthorize; | 22 | import org.springframework.security.access.prepost.PreAuthorize; |
| 23 | import org.springframework.validation.annotation.Validated; | 23 | import org.springframework.validation.annotation.Validated; |
| 24 | import org.springframework.web.bind.annotation.GetMapping; | 24 | import org.springframework.web.bind.annotation.GetMapping; |
yudao-module-iot/yudao-module-iot-gateway/src/main/resources/application.yaml
| @@ -48,7 +48,7 @@ yudao: | @@ -48,7 +48,7 @@ yudao: | ||
| 48 | # 针对引入的 HTTP 组件的配置 | 48 | # 针对引入的 HTTP 组件的配置 |
| 49 | # ==================================== | 49 | # ==================================== |
| 50 | http: | 50 | http: |
| 51 | - enabled: false | 51 | + enabled: true |
| 52 | server-port: 8092 | 52 | server-port: 8092 |
| 53 | # ==================================== | 53 | # ==================================== |
| 54 | # 针对引入的 EMQX 组件的配置 | 54 | # 针对引入的 EMQX 组件的配置 |
yudao-server/pom.xml
| @@ -109,11 +109,11 @@ | @@ -109,11 +109,11 @@ | ||
| 109 | <!-- </dependency>--> | 109 | <!-- </dependency>--> |
| 110 | 110 | ||
| 111 | <!-- IoT 物联网相关模块。默认注释,保证编译速度 --> | 111 | <!-- IoT 物联网相关模块。默认注释,保证编译速度 --> |
| 112 | - <dependency> | ||
| 113 | - <groupId>cn.iocoder.boot</groupId> | ||
| 114 | - <artifactId>yudao-module-iot-biz</artifactId> | ||
| 115 | - <version>${revision}</version> | ||
| 116 | - </dependency> | 112 | +<!-- <dependency>--> |
| 113 | +<!-- <groupId>cn.iocoder.boot</groupId>--> | ||
| 114 | +<!-- <artifactId>yudao-module-iot-biz</artifactId>--> | ||
| 115 | +<!-- <version>${revision}</version>--> | ||
| 116 | +<!-- </dependency>--> | ||
| 117 | 117 | ||
| 118 | <!-- spring boot 配置所需依赖 --> | 118 | <!-- spring boot 配置所需依赖 --> |
| 119 | <dependency> | 119 | <dependency> |