Browse Source

Merge branch 'system-165' of uskycloud/usky-cloud into master

gez 1 year ago
parent
commit
2bb88b6424

+ 24 - 0
base-modules/service-system/service-system-api/src/main/java/com/usky/system/RemoteDeptService.java

@@ -0,0 +1,24 @@
+package com.usky.system;
+
+import com.usky.system.factory.RemoteTenantFallbackFactory;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author han
+ * @date 2023/12/08 10:51
+ */
+@FeignClient(contextId = "remoteDeptService", value = "usky-system", fallbackFactory = RemoteTenantFallbackFactory.class)
+public interface RemoteDeptService {
+    /**
+     * 获得所有部门
+     *
+     * @return 部门数组
+     */
+    @GetMapping("/getDeptList")
+    List<Map<String, Object>> getDeptList(@RequestParam("tenantId") Integer tenantId);
+}

+ 33 - 0
base-modules/service-system/service-system-api/src/main/java/com/usky/system/factory/RemoteDeptFallbackFactory.java

@@ -0,0 +1,33 @@
+package com.usky.system.factory;
+
+import com.usky.common.core.exception.FeignBadRequestException;
+import com.usky.system.RemoteDeptService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.cloud.openfeign.FallbackFactory;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author han
+ * @date 2023/12/08 11:07
+ */
+@Component
+public class RemoteDeptFallbackFactory implements FallbackFactory<RemoteDeptService> {
+    private static final Logger log = LoggerFactory.getLogger(RemoteUserFallbackFactory.class);
+
+    @Override
+    public RemoteDeptService create(Throwable throwable)
+    {
+        log.error("部门服务调用失败:{}", throwable.getMessage());
+        return new RemoteDeptService()
+        {
+            @Override
+            public List<Map<String, Object>> getDeptList(Integer tenantId) {
+                throw new FeignBadRequestException(500,"获取部门异常"+throwable.getMessage());
+            }
+        };
+    }
+}

+ 30 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/controller/api/SysDeptControllerApi.java

@@ -0,0 +1,30 @@
+package com.usky.system.controller.api;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.usky.system.RemoteDeptService;
+import com.usky.system.domain.SysDept;
+import com.usky.system.service.ISysDeptService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author han
+ * @date 2023/12/08 11:21
+ */
+@RestController
+public class SysDeptControllerApi implements RemoteDeptService {
+    @Autowired
+    private ISysDeptService iSysDeptService;
+    @Override
+    public List<Map<String, Object>> getDeptList(Integer tenantId) {
+       QueryWrapper<SysDept> queryWrapper = Wrappers.query();;
+        queryWrapper.select("dept_id","dept_name")
+                .eq("tenant_id",tenantId)
+                .eq("del_flag",0);
+        return iSysDeptService.listMaps(queryWrapper);
+    }
+}

+ 11 - 1
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/domain/SysTenantConfig.java

@@ -93,7 +93,7 @@ public class SysTenantConfig implements Serializable {
     /**
      * 主页导航布局
      */
-    private String homeLayout;
+    private Integer homeLayout;
 
     /**
      * 主页主题样式
@@ -135,5 +135,15 @@ public class SysTenantConfig implements Serializable {
      */
     private String largeScreenUrl;
 
+    /**
+     * 综合云图底图类型:1 地图 2 图片
+     */
+    private Integer cloudType;
+
+    /**
+     * 综合云图底图地址
+     */
+    private String cloudUrl;
+
 
 }

+ 2 - 0
base-modules/service-system/service-system-biz/src/main/resources/mapper/system/SysTenantConfigMapper.xml

@@ -26,6 +26,8 @@
         <result column="label_icon" property="labelIcon"/>
         <result column="middle_status" property="middleStatus"/>
         <result column="large_screen_url" property="largeScreenUrl"/>
+        <result column="cloud_type" property="cloudType"/>
+        <result column="cloud_url" property="cloudUrl"/>
     </resultMap>
     <select id="getTenantConfig" resultType="com.usky.system.service.vo.SysTenantConfigVo">
         SELECT

+ 49 - 49
pom.xml

@@ -7,12 +7,12 @@
     <artifactId>uskycloud</artifactId>
     <version>0.0.1</version>
 
-<!--    <parent>-->
-<!--        <groupId>org.springframework.boot</groupId>-->
-<!--        <artifactId>spring-boot-starter-parent</artifactId>-->
-<!--        <version>2.1.3.RELEASE</version>-->
-<!--        <relativePath/>-->
-<!--    </parent>-->
+    <!--    <parent>-->
+    <!--        <groupId>org.springframework.boot</groupId>-->
+    <!--        <artifactId>spring-boot-starter-parent</artifactId>-->
+    <!--        <version>2.1.3.RELEASE</version>-->
+    <!--        <relativePath/>-->
+    <!--    </parent>-->
 
     <description>微服务系统</description>
 
@@ -59,7 +59,7 @@
         <mybatis-plus-boot-starter.version>3.4.0</mybatis-plus-boot-starter.version>
         <mybatis-plus-generator.version>3.4.0</mybatis-plus-generator.version>
         <orika-core.version>1.5.4</orika-core.version>
-<!--        <commons-lang3.version>3.11</commons-lang3.version>-->
+        <!--        <commons-lang3.version>3.11</commons-lang3.version>-->
         <commons-beanutils.version>1.9.4</commons-beanutils.version>
         <guava.version>29.0-jre</guava.version>
         <hutool.version>5.6.1</hutool.version>
@@ -283,11 +283,11 @@
             </dependency>
 
             <!-- io常用工具类 -->
-<!--            <dependency>-->
-<!--                <groupId>org.apache.commons</groupId>-->
-<!--                <artifactId>commons-lang3</artifactId>-->
-<!--                <version>${commons-lang3.version}</version>-->
-<!--            </dependency>-->
+            <!--            <dependency>-->
+            <!--                <groupId>org.apache.commons</groupId>-->
+            <!--                <artifactId>commons-lang3</artifactId>-->
+            <!--                <version>${commons-lang3.version}</version>-->
+            <!--            </dependency>-->
 
             <dependency>
                 <groupId>commons-beanutils</groupId>
@@ -386,45 +386,45 @@
                     <encoding>${project.build.sourceEncoding}</encoding>
                 </configuration>
             </plugin>
-<!--            <plugin>-->
-<!--                <groupId>org.apache.maven.plugins</groupId>-->
-<!--                <artifactId>maven-resources-plugin</artifactId>-->
-<!--                <configuration>-->
-<!--                    <delimiters>-->
-<!--                        <delimiter>@</delimiter>-->
-<!--                    </delimiters>-->
-<!--                    <useDefaultDelimiters>false</useDefaultDelimiters>-->
-<!--                </configuration>-->
-<!--            </plugin>-->
+            <!--            <plugin>-->
+            <!--                <groupId>org.apache.maven.plugins</groupId>-->
+            <!--                <artifactId>maven-resources-plugin</artifactId>-->
+            <!--                <configuration>-->
+            <!--                    <delimiters>-->
+            <!--                        <delimiter>@</delimiter>-->
+            <!--                    </delimiters>-->
+            <!--                    <useDefaultDelimiters>false</useDefaultDelimiters>-->
+            <!--                </configuration>-->
+            <!--            </plugin>-->
         </plugins>
-<!--        <resources>-->
-<!--            <resource>-->
-<!--                <directory>src/main/resources</directory>-->
-<!--                <filtering>true</filtering>-->
-<!--            </resource>-->
-<!--        </resources>-->
+        <!--        <resources>-->
+        <!--            <resource>-->
+        <!--                <directory>src/main/resources</directory>-->
+        <!--                <filtering>true</filtering>-->
+        <!--            </resource>-->
+        <!--        </resources>-->
     </build>
-<!--    <profiles>-->
-<!--        <profile>-->
-<!--            <id>dev</id>-->
-<!--            <activation>-->
-<!--                &lt;!&ndash; 是否默认 true表示默认&ndash;&gt;-->
-<!--                <activeByDefault>true</activeByDefault>-->
-<!--            </activation>-->
-<!--            <properties>-->
-<!--                &lt;!&ndash; 配置文件名字后缀 &ndash;&gt;-->
-<!--                <profiles.active>dev</profiles.active>-->
-<!--            </properties>-->
-<!--        </profile>-->
-
-<!--        &lt;!&ndash; 生产环境 &ndash;&gt;-->
-<!--        <profile>-->
-<!--            <id>prod</id>-->
-<!--            <properties>-->
-<!--                <profiles.active>prod</profiles.active>-->
-<!--            </properties>-->
-<!--        </profile>-->
-<!--    </profiles>-->
+    <!--    <profiles>-->
+    <!--        <profile>-->
+    <!--            <id>dev</id>-->
+    <!--            <activation>-->
+    <!--                &lt;!&ndash; 是否默认 true表示默认&ndash;&gt;-->
+    <!--                <activeByDefault>true</activeByDefault>-->
+    <!--            </activation>-->
+    <!--            <properties>-->
+    <!--                &lt;!&ndash; 配置文件名字后缀 &ndash;&gt;-->
+    <!--                <profiles.active>dev</profiles.active>-->
+    <!--            </properties>-->
+    <!--        </profile>-->
+
+    <!--        &lt;!&ndash; 生产环境 &ndash;&gt;-->
+    <!--        <profile>-->
+    <!--            <id>prod</id>-->
+    <!--            <properties>-->
+    <!--                <profiles.active>prod</profiles.active>-->
+    <!--            </properties>-->
+    <!--        </profile>-->
+    <!--    </profiles>-->
 
     <distributionManagement>
         <repository>