ソースを参照

fix:添加批量升级创建时间

荭琪枫 1 年間 前
コミット
f64ebb2814

+ 2 - 0
iot-common/iot-common-dao/iot-common-model/src/main/java/cc/iotkit/model/ota/DeviceOtaInfo.java

@@ -27,4 +27,6 @@ public class DeviceOtaInfo implements Id<Long> {
 
     private String productKey;
 
+    private Long createAt;
+
 }

+ 3 - 0
iot-common/iot-common-dao/iot-data-serviceImpl-rdb/src/main/java/cc/iotkit/data/model/TbDeviceOtaInfo.java

@@ -3,6 +3,7 @@ package cc.iotkit.data.model;
 import cc.iotkit.model.ota.DeviceOtaInfo;
 import io.github.linpeilie.annotations.AutoMapper;
 import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import org.hibernate.annotations.GenericGenerator;
 
@@ -34,4 +35,6 @@ public class TbDeviceOtaInfo {
     private Integer counts;
 
     private String productKey;
+
+    private Long createAt;
 }

+ 84 - 0
iot-components/iot-nb-component/dependency-reduced-pom.xml

@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <parent>
+    <artifactId>iot-components</artifactId>
+    <groupId>cc.iotkit</groupId>
+    <version>${revision}</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>iot-nb-component</artifactId>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-shade-plugin</artifactId>
+        <version>3.2.4</version>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>shade</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <artifactSet>
+            <includes>
+              <include>io.vertx:vertx-core</include>
+              <include>io.vertx:vertx-mqtt</include>
+              <include>io.netty:netty-codec-mqtt</include>
+              <include>org.luaj:luaj-jse</include>
+            </includes>
+          </artifactSet>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>${java.version}</source>
+          <target>${java.version}</target>
+          <forceJavacCompilerUse>true</forceJavacCompilerUse>
+          <useIncrementalCompilation>false</useIncrementalCompilation>
+          <encoding>utf8</encoding>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  <dependencies>
+    <dependency>
+      <groupId>org.projectlombok</groupId>
+      <artifactId>lombok</artifactId>
+      <version>1.18.26</version>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+      <version>1.7.36</version>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>cc.iotkit</groupId>
+      <artifactId>iot-common-core</artifactId>
+      <version>0.4.5-SNAPSHOT</version>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>cc.iotkit</groupId>
+      <artifactId>iot-component-base</artifactId>
+      <version>0.4.5-SNAPSHOT</version>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>cc.iotkit</groupId>
+      <artifactId>iot-data-service</artifactId>
+      <version>0.4.5-SNAPSHOT</version>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>cc.iotkit</groupId>
+      <artifactId>iot-script-engine</artifactId>
+      <version>0.4.5-SNAPSHOT</version>
+      <scope>compile</scope>
+    </dependency>
+  </dependencies>
+</project>

+ 2 - 0
iot-module/iot-manager/src/main/java/cc/iotkit/manager/dto/vo/ota/DeviceOtaInfoVo.java

@@ -30,4 +30,6 @@ public class DeviceOtaInfoVo implements Serializable {
     private Integer counts;
 
     private String productKey;
+
+    private Long createAt;
 }

+ 2 - 1
iot-module/iot-manager/src/main/java/cc/iotkit/manager/service/OtaService.java

@@ -137,7 +137,7 @@ public class OtaService {
      */
     public void startUpgrade(Long otaId, List<String> deviceIds) {
         OtaPackage otaPackage = iOtaPackageData.findById(otaId);
-        if(Objects.isNull(otaPackage)){
+        if (Objects.isNull(otaPackage)) {
             throw new BizException(ErrCode.DATA_NOT_EXIST);
         }
         DeviceOtaInfo deviceOtaInfo = deviceOtaInfoData.save(DeviceOtaInfo.builder()
@@ -146,6 +146,7 @@ public class OtaService {
                 .module(otaPackage.getModule())
                 .desc(otaPackage.getDesc())
                 .version(otaPackage.getVersion())
+                .createAt(System.currentTimeMillis())
                 .build());
 
         List<DeviceOtaDetail> deviceOtaDetails = new ArrayList<>();