Browse Source

视频说明书

home 2 years ago
parent
commit
cbf33ad699

+ 5 - 0
hx-common/common-file/src/main/java/com/fjhx/entity/FileInfo.java

@@ -60,6 +60,11 @@ public class FileInfo extends BaseEntity {
     private String applicationName;
 
     /**
+     * 排序
+     */
+    private Integer sort;
+
+    /**
      * 逻辑删除 0未删除 1已删除
      */
     @TableField(fill = FieldFill.INSERT)

+ 14 - 17
hx-common/common-file/src/main/java/com/fjhx/service/impl/FileInfoServiceImpl.java

@@ -98,16 +98,19 @@ public class FileInfoServiceImpl extends ServiceImpl<FileInfoMapper, FileInfo> i
             return;
         }
 
-        List<FileInfo> collect = paramList.stream().map(item -> {
+        List<FileInfo> fileInfoList = new ArrayList<>();
+        for (int i = 0; i < paramList.size(); i++) {
+            FileInfoParam fileInfoParam = paramList.get(i);
             FileInfo fileInfo = new FileInfo();
-            fileInfo.setId(item.getId());
+            fileInfo.setId(fileInfoParam.getId());
             fileInfo.setBusinessId(businessId);
             fileInfo.setBusinessType(businessType);
             fileInfo.setApplicationName(applicationName);
-            return fileInfo;
-        }).collect(Collectors.toList());
+            fileInfo.setSort(i);
+            fileInfoList.add(fileInfo);
+        }
 
-        updateBatchById(collect);
+        updateBatchById(fileInfoList);
     }
 
     @Transactional(rollbackFor = Exception.class)
@@ -133,20 +136,14 @@ public class FileInfoServiceImpl extends ServiceImpl<FileInfoMapper, FileInfo> i
             return fileInfo;
         }).collect(Collectors.toList());
 
-        // 如果排除的id数等于提交文件编辑数,则不执行删除逻辑
+        // 如果排除的id数等于提交文件数,则不执行删除逻辑
         int excludeIdSize = excludeIdList.size();
-        if (paramList.size() != excludeIdSize) {
-            remove(Wrappers.<FileInfo>lambdaQuery()
-                    .eq(FileInfo::getBusinessId, businessId)
-                    .eq(FileInfo::getBusinessType, businessType)
-                    .notIn(excludeIdSize > 0, BaseEntity::getId, collect));
-        }
-
-        // 如果需要添加业务id的文件数为0,跳过提交
-        if (collect.size() > 0) {
-            updateBatchById(collect);
-        }
+        remove(Wrappers.<FileInfo>lambdaQuery()
+                .eq(FileInfo::getBusinessId, businessId)
+                .eq(FileInfo::getBusinessType, businessType)
+                .notIn(excludeIdSize > 0, BaseEntity::getId, excludeIdSize));
 
+        updateBatchById(collect);
     }
 
     @Override

+ 20 - 1
hx-common/common-video/pom.xml

@@ -3,7 +3,7 @@
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <parent>
-        <artifactId>fjhx-cloud</artifactId>
+        <artifactId>hx-common</artifactId>
         <groupId>com.fjhx</groupId>
         <version>3.2.0</version>
     </parent>
@@ -16,4 +16,23 @@
         <maven.compiler.target>8</maven.compiler.target>
     </properties>
 
+    <dependencies>
+
+        <dependency>
+            <groupId>com.fjhx</groupId>
+            <artifactId>common-client-util</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.fjhx</groupId>
+            <artifactId>common-tool</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>ws.schild</groupId>
+            <artifactId>jave-all-deps</artifactId>
+        </dependency>
+
+    </dependencies>
+
 </project>

+ 20 - 0
hx-common/common-video/src/main/java/com/fjhx/ServiceVideoApplication.java

@@ -0,0 +1,20 @@
+package com.fjhx;
+
+import org.springblade.core.cloud.feign.EnableBladeFeign;
+import org.springblade.core.launch.BladeApplication;
+import org.springframework.cloud.client.SpringCloudApplication;
+
+/**
+ * 针筒物联网管理模块启动器
+ */
+@EnableBladeFeign
+@SpringCloudApplication
+public class ServiceVideoApplication {
+
+    private static final String APP_NAME = "service-video";
+
+    public static void main(String[] args) {
+        BladeApplication.run(APP_NAME, ServiceVideoApplication.class, args);
+    }
+
+}

+ 13 - 0
hx-common/common-video/src/main/resources/application-dev.yml

@@ -0,0 +1,13 @@
+# 服务器端口
+server:
+  port: 8200
+logging:
+  level:
+    org.springframework.data.mongodb.core: DEBUG
+# 数据源配置
+spring:
+  # 数据库
+  datasource:
+    url: ${blade.datasource.service_video.dev.url}
+    username: ${blade.datasource.service_video.dev.username}
+    password: ${blade.datasource.service_video.dev.password}

+ 12 - 0
hx-common/common-video/src/main/resources/application-prod.yml

@@ -0,0 +1,12 @@
+# 服务器端口
+server:
+  port: 8200
+
+# 数据源配置
+spring:
+  # 数据库
+  datasource:
+    url: ${blade.datasource.service_video.prod.url}
+    username: ${blade.datasource.service_video.prod.username}
+    password: ${blade.datasource.service_video.prod.password}
+

+ 11 - 0
hx-common/common-video/src/main/resources/application-test.yml

@@ -0,0 +1,11 @@
+# 服务器端口
+server:
+  port: 8200
+
+# 数据源配置
+spring:
+  # 数据库
+  datasource:
+    url: ${blade.datasource.service_video.test.url}
+    username: ${blade.datasource.service_video.test.username}
+    password: ${blade.datasource.service_video.test.password}

+ 12 - 0
hx-common/pom.xml

@@ -101,6 +101,18 @@
                 <version>${hx.version}</version>
             </dependency>
 
+            <dependency>
+                <groupId>com.fjhx</groupId>
+                <artifactId>common-client-util</artifactId>
+                <version>${hx.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>ws.schild</groupId>
+                <artifactId>jave-all-deps</artifactId>
+                <version>2.5.1</version>
+            </dependency>
+
         </dependencies>
     </dependencyManagement>