فهرست منبع

第一次推送

lym 4 سال پیش
والد
کامیت
8cc75647bd
66فایلهای تغییر یافته به همراه7183 افزوده شده و 0 حذف شده
  1. 287 0
      pom.xml
  2. 26 0
      src/main/java/com/hcloud/microservice/org/OrgManageServiceApplication.java
  3. 42 0
      src/main/java/com/hcloud/microservice/org/bo/BaseAuthBO.java
  4. 53 0
      src/main/java/com/hcloud/microservice/org/bo/BaseOrgAuthBO.java
  5. 57 0
      src/main/java/com/hcloud/microservice/org/bo/BaseRoleAuthBO.java
  6. 74 0
      src/main/java/com/hcloud/microservice/org/bo/BaseRoleUserBO.java
  7. 51 0
      src/main/java/com/hcloud/microservice/org/bo/BaseUserAuthBO.java
  8. 83 0
      src/main/java/com/hcloud/microservice/org/bo/BaseUserBO.java
  9. 167 0
      src/main/java/com/hcloud/microservice/org/config/DruidDBConfig.java
  10. 238 0
      src/main/java/com/hcloud/microservice/org/config/OrgWebMvcConfig.java
  11. 62 0
      src/main/java/com/hcloud/microservice/org/controller/AuthManagerController.java
  12. 171 0
      src/main/java/com/hcloud/microservice/org/controller/OrgManagerController.java
  13. 55 0
      src/main/java/com/hcloud/microservice/org/controller/PositionManagerController.java
  14. 164 0
      src/main/java/com/hcloud/microservice/org/controller/RoleManagerController.java
  15. 304 0
      src/main/java/com/hcloud/microservice/org/controller/UserManagerController.java
  16. 37 0
      src/main/java/com/hcloud/microservice/org/dao/BaseAuthorizationMapper.java
  17. 11 0
      src/main/java/com/hcloud/microservice/org/dao/BaseDictionaryMapper.java
  18. 11 0
      src/main/java/com/hcloud/microservice/org/dao/BaseDictionaryTypeMapper.java
  19. 60 0
      src/main/java/com/hcloud/microservice/org/dao/BaseOrgAuthorizationMapper.java
  20. 17 0
      src/main/java/com/hcloud/microservice/org/dao/BaseOrgMapper.java
  21. 26 0
      src/main/java/com/hcloud/microservice/org/dao/BasePositionMapper.java
  22. 39 0
      src/main/java/com/hcloud/microservice/org/dao/BaseRoleAuthorizationMapper.java
  23. 32 0
      src/main/java/com/hcloud/microservice/org/dao/BaseRoleMapper.java
  24. 31 0
      src/main/java/com/hcloud/microservice/org/dao/BaseRoleUserMapper.java
  25. 38 0
      src/main/java/com/hcloud/microservice/org/dao/BaseUserAuthorizationMapper.java
  26. 32 0
      src/main/java/com/hcloud/microservice/org/dao/BaseUserMapper.java
  27. 115 0
      src/main/java/com/hcloud/microservice/org/entity/BaseDictionary.java
  28. 85 0
      src/main/java/com/hcloud/microservice/org/entity/BaseDictionaryType.java
  29. 30 0
      src/main/java/com/hcloud/microservice/org/service/BaseAuthorizationService.java
  30. 43 0
      src/main/java/com/hcloud/microservice/org/service/BaseOrgAuthorizationService.java
  31. 36 0
      src/main/java/com/hcloud/microservice/org/service/BaseOrgService.java
  32. 28 0
      src/main/java/com/hcloud/microservice/org/service/BasePositionService.java
  33. 64 0
      src/main/java/com/hcloud/microservice/org/service/BaseRoleService.java
  34. 119 0
      src/main/java/com/hcloud/microservice/org/service/BaseUserService.java
  35. 86 0
      src/main/java/com/hcloud/microservice/org/service/impl/BaseAuthorizationServiceImpl.java
  36. 102 0
      src/main/java/com/hcloud/microservice/org/service/impl/BaseOrgAuthorizationServiceImpl.java
  37. 136 0
      src/main/java/com/hcloud/microservice/org/service/impl/BaseOrgServiceImpl.java
  38. 92 0
      src/main/java/com/hcloud/microservice/org/service/impl/BasePositionServiceImpl.java
  39. 224 0
      src/main/java/com/hcloud/microservice/org/service/impl/BaseRoleServiceImpl.java
  40. 487 0
      src/main/java/com/hcloud/microservice/org/service/impl/BaseUserServiceImpl.java
  41. 87 0
      src/main/resources/application-dev.properties
  42. 93 0
      src/main/resources/application-pro.properties
  43. 85 0
      src/main/resources/application-test.properties
  44. 3 0
      src/main/resources/application.properties
  45. 39 0
      src/main/resources/generatorConfig.xml
  46. 285 0
      src/main/resources/mappers/BaseAuthorizationMapper.xml
  47. 164 0
      src/main/resources/mappers/BaseDictionaryMapper.xml
  48. 77 0
      src/main/resources/mappers/BaseDictionaryTypeMapper.xml
  49. 345 0
      src/main/resources/mappers/BaseOrgAuthorizationMapper.xml
  50. 402 0
      src/main/resources/mappers/BaseOrgMapper.xml
  51. 145 0
      src/main/resources/mappers/BasePositionMapper.xml
  52. 80 0
      src/main/resources/mappers/BaseRoleAuthorizationMapper.xml
  53. 185 0
      src/main/resources/mappers/BaseRoleMapper.xml
  54. 131 0
      src/main/resources/mappers/BaseRoleUserMapper.xml
  55. 74 0
      src/main/resources/mappers/BaseUserAuthorizationMapper.xml
  56. 382 0
      src/main/resources/mappers/BaseUserMapper.xml
  57. 54 0
      src/main/resources/swagger-ui.html
  58. 17 0
      src/test/java/com/hcloud/microservice/org/OrgManageServiceApplicationTests.java
  59. 8 0
      src/test/java/com/hcloud/microservice/org/TestInit.java
  60. 47 0
      src/test/java/com/hcloud/microservice/org/controller/AuthManagerControllerTest.java
  61. 93 0
      src/test/java/com/hcloud/microservice/org/controller/UserManagerControllerTest.java
  62. 105 0
      src/test/java/com/hcloud/microservice/org/service/impl/BaseAuthorizationServiceImplTest.java
  63. 113 0
      src/test/java/com/hcloud/microservice/org/service/impl/BaseOrgAuthorizationServiceImplTest.java
  64. 90 0
      src/test/java/com/hcloud/microservice/org/service/impl/BaseOrgServiceImplTest.java
  65. 113 0
      src/test/java/com/hcloud/microservice/org/service/impl/BaseRoleServiceImplTest.java
  66. 151 0
      src/test/java/com/hcloud/microservice/org/service/impl/BaseUserServiceImplTest.java

+ 287 - 0
pom.xml

@@ -0,0 +1,287 @@
+<?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/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>com.hcloud.microserver</groupId>
+        <artifactId>common-parent</artifactId>
+        <version>0.0.1-SNAPSHOT</version>
+        <relativePath>../common-parent/pom.xml</relativePath>
+    </parent>
+    <groupId>com.hcloud.microserver</groupId>
+    <artifactId>org-manage-service</artifactId>
+    <version>${org.managerclient.version}</version>
+    <packaging>jar</packaging>
+    <name>org-manage-service</name>
+    <description>Demo project for Spring Boot</description>
+
+
+    <dependencies>
+        <dependency>
+            <groupId>com.hcloud.microserver</groupId>
+            <artifactId>common-core</artifactId>
+            <version>${common.core.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.hcloud.microserver</groupId>
+            <artifactId>org-manage-client</artifactId>
+            <version>${org.managerclient.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.github.pagehelper</groupId>
+            <artifactId>pagehelper-spring-boot-starter</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.mybatis</groupId>
+            <artifactId>mybatis</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.mybatis.spring.boot</groupId>
+            <artifactId>mybatis-spring-boot-starter</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-eureka</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.github.pagehelper</groupId>
+            <artifactId>pagehelper-spring-boot-starter</artifactId>
+        </dependency>
+        <!--druid -->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-cache</artifactId>
+            <version>1.5.18.RELEASE</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-redis</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-ribbon</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-test-autoconfigure</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <!-- <build>
+        <plugins>
+            打JAR包
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <configuration>
+                    不打包资源文件(配置文件和依赖包分开)
+                    <excludes>
+                        <exclude>*.**</exclude>
+                        <exclude>*/*.xml</exclude>
+                    </excludes>
+                    <archive>
+                        <manifest>
+                            <addClasspath>true</addClasspath>
+                            MANIFEST.MF 中 Class-Path 加入前缀
+                            <classpathPrefix>lib/</classpathPrefix>
+                            jar包不包含唯一版本标识
+                            <useUniqueVersions>false</useUniqueVersions>
+                            指定入口类
+                            <mainClass>com.hcloud.microservice.org.OrgManageServiceApplication</mainClass>
+                        </manifest>
+                        <manifestEntries>
+                            MANIFEST.MF 中 Class-Path 加入资源文件目录
+                            <Class-Path>./resources/</Class-Path>
+                        </manifestEntries>
+                    </archive>
+                    <outputDirectory>${project.build.directory}</outputDirectory>
+                </configuration>
+            </plugin>
+
+            该插件的作用是用于复制依赖的jar包到指定的文件夹里
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>copy-dependencies</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>copy-dependencies</goal>
+                        </goals>
+                        <configuration>
+                            <outputDirectory>${project.build.directory}/lib/</outputDirectory>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+
+            该插件的作用是用于复制指定的文件
+            <plugin>
+                <artifactId>maven-resources-plugin</artifactId>
+                <executions>
+                    <execution> 复制配置文件
+                        <id>copy-resources</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <resources>
+                                <resource>
+                                    <directory>src/main/resources</directory>
+                                    <includes>
+                                        <include>*.properties</include>
+                                    </includes>
+                                </resource>
+                            </resources>
+                            <outputDirectory>${project.build.directory}/resources</outputDirectory>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+
+            SpringBoot 打包插件,把 maven-jar-plugin 打成的jar包重新打成可运行jar包
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <configuration>
+                    重写包含依赖,包含不存在的依赖,jar里没有pom里的依赖
+                    <includes>
+                        <include>
+                            <groupId>null</groupId>
+                            <artifactId>null</artifactId>
+                        </include>
+                    </includes>
+                    <layout>ZIP</layout>
+                    使用外部配置文件,jar包里没有资源文件
+                    <addResources>true</addResources>
+                    <outputDirectory>${project.build.directory}/resources</outputDirectory>
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                        <configuration>
+                            配置jar包特殊标识 配置后,保留原文件,生成新文件 *-run.jar
+                            配置jar包特殊标识 不配置,原文件命名为 *.jar.original,生成新文件 *.jar
+                            <classifier>run</classifier>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <version>2.18.1</version>
+                <configuration>
+                    <skipTests>true</skipTests>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.mybatis.generator</groupId>
+                <artifactId>mybatis-generator-maven-plugin</artifactId>
+                <version>1.3.5</version>
+                <dependencies>
+                    <dependency>
+                        <groupId> mysql</groupId>
+                        <artifactId> mysql-connector-java</artifactId>
+                        <version>5.1.39</version>
+                    </dependency>
+                    <dependency>
+                        <groupId>org.mybatis.generator</groupId>
+                        <artifactId>mybatis-generator-core</artifactId>
+                        <version>1.3.5</version>
+                    </dependency>
+                </dependencies>
+                <executions>
+                    <execution>
+                        <id>Generate MyBatis Artifacts</id>
+                        <phase>deploy</phase>
+                        <goals>
+                            <goal>generate</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    允许移动生成的文件
+                    <verbose>true</verbose>
+                    是否覆盖
+                    <overwrite>true</overwrite>
+                    自动生成的配置
+                    <configurationFile>src/main/resources/generatorConfig.xml</configurationFile>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build> -->
+    
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <version>2.18.1</version>
+                <configuration>
+                    <skipTests>true</skipTests>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.mybatis.generator</groupId>
+                <artifactId>mybatis-generator-maven-plugin</artifactId>
+                <version>1.3.5</version>
+                <dependencies>
+                    <dependency>
+                        <groupId> mysql</groupId>
+                        <artifactId> mysql-connector-java</artifactId>
+                        <version>5.1.39</version>
+                    </dependency>
+                    <dependency>
+                        <groupId>org.mybatis.generator</groupId>
+                        <artifactId>mybatis-generator-core</artifactId>
+                        <version>1.3.5</version>
+                    </dependency>
+                </dependencies>
+                <executions>
+                    <execution>
+                        <id>Generate MyBatis Artifacts</id>
+                        <phase>deploy</phase>
+                        <goals>
+                            <goal>generate</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <!--允许移动生成的文件 -->
+                    <verbose>true</verbose>
+                    <!-- 是否覆盖 -->
+                    <overwrite>true</overwrite>
+                    <!-- 自动生成的配置 -->
+                    <configurationFile>src/main/resources/generatorConfig.xml</configurationFile>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

+ 26 - 0
src/main/java/com/hcloud/microservice/org/OrgManageServiceApplication.java

@@ -0,0 +1,26 @@
+package com.hcloud.microservice.org;
+
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
+import org.springframework.cloud.netflix.feign.EnableFeignClients;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+
+/**
+ * @author xiezt
+ */
+@EnableDiscoveryClient
+@EnableFeignClients(basePackages = {"com.hcloud.microservice.org.facade.client"})
+@EnableTransactionManagement
+@ComponentScan(basePackages = "com.hcloud")
+@MapperScan(basePackages = {"com.hcloud.microservice.org.dao"})
+@SpringBootApplication
+public class OrgManageServiceApplication {
+    public static void main(String[] args) {
+        SpringApplication.run(OrgManageServiceApplication.class, args);
+    }
+}
+

+ 42 - 0
src/main/java/com/hcloud/microservice/org/bo/BaseAuthBO.java

@@ -0,0 +1,42 @@
+package com.hcloud.microservice.org.bo;
+
+import com.hcloud.microserver.commoncore.base.BaseEntity;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class BaseAuthBO extends BaseEntity {
+
+    private String guid;
+
+    private String parentGuid;
+
+    private String fkProductGuid;
+
+    private String funName;
+
+    private String authStr;
+
+    private String fileUrl;
+
+    private String ico;
+
+    private String remark;
+
+    private Integer orderby;
+
+    private Integer nodeType;
+
+    private Integer isForbid;
+
+    private Integer state;
+
+    private String createUser;
+
+    private Date createTime;
+
+    private String modifiedUser;
+
+    private Date modifiedTime;
+}

+ 53 - 0
src/main/java/com/hcloud/microservice/org/bo/BaseOrgAuthBO.java

@@ -0,0 +1,53 @@
+package com.hcloud.microservice.org.bo;
+
+import com.hcloud.microserver.commoncore.base.BaseEntity;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class BaseOrgAuthBO extends BaseEntity {
+
+    private String guid;
+
+    private String fkProductGuid;
+
+    private String fkOrgGuid;
+
+    private String parentGuid;
+
+    private String fkAuthGuid;
+
+    private String funName;
+
+    private String authStr;
+
+    private String fileUrl;
+
+    private String ico;
+
+    private String remark;
+
+    private Integer orderby;
+
+    private Integer nodeType;
+
+    private Integer isForbid;
+
+    private Integer state;
+
+    private String createUser;
+
+    private Date createTime;
+
+    private String modifiedUser;
+
+    private Date modifiedTime;
+
+    /**
+     * 是否勾选权限
+     */
+    private Integer isChecked;
+
+    private String id;
+}

+ 57 - 0
src/main/java/com/hcloud/microservice/org/bo/BaseRoleAuthBO.java

@@ -0,0 +1,57 @@
+package com.hcloud.microservice.org.bo;
+
+import com.hcloud.microserver.commoncore.base.BaseEntity;
+import lombok.Data;
+
+/** 角色权限BO
+ * @author xiezt
+ */
+@Data
+public class BaseRoleAuthBO extends BaseEntity {
+
+
+    /**
+     * 角色guid
+     */
+    private String fkRoleGuid;
+
+    /**
+     * 权限guid
+     */
+    private String fkFunGuid;
+
+    /**
+     * 权限父类guid
+     */
+    private String parentGuid;
+
+    /**
+     * 权限url
+     */
+    private String fileUrl;
+
+    /**
+     * 权限名称
+     */
+    private String funName;
+
+    /**
+     * 权限字符串
+     */
+    private String authStr;
+
+    /**
+     * 权限图标
+     */
+    private String ico;
+
+    /**
+     * 排序信息
+     */
+    private Integer orderBy;
+
+    /**
+     *  组织结构id
+     */
+    private String orgGuid;
+}

+ 74 - 0
src/main/java/com/hcloud/microservice/org/bo/BaseRoleUserBO.java

@@ -0,0 +1,74 @@
+package com.hcloud.microservice.org.bo;
+
+import com.hcloud.microserver.commoncore.base.BaseEntity;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @author xiezt
+ */
+@Data
+public class BaseRoleUserBO extends BaseEntity {
+
+    /**
+     * 用户Id
+     */
+    private String userId;
+
+    /**
+     * 机构guid
+     */
+    private String fkOrgGuid;
+
+    /**
+     * 账号
+     */
+    private String account;
+
+    /**
+     * 用户名
+     */
+    private String userName;
+
+    /**
+     * 昵称
+     */
+    private String nickname;
+
+    /**
+     * 性别编码
+     */
+    private Integer dicSexCode;
+
+    /**
+     * 最后登陆时间
+     */
+    private Date lastLoginTime;
+
+    /**
+     * 是否禁用
+     */
+    private Integer isForbid;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 机构名称
+     */
+    private String orgName;
+
+    /**
+     * 角色名称
+     */
+    private String roleName;
+
+    /**
+     * 角色ID
+     */
+    private String roleId;
+
+}

+ 51 - 0
src/main/java/com/hcloud/microservice/org/bo/BaseUserAuthBO.java

@@ -0,0 +1,51 @@
+package com.hcloud.microservice.org.bo;
+
+import com.hcloud.microserver.commoncore.base.BaseEntity;
+import lombok.Data;
+
+/** 角色权限BO
+ * @author xiezt
+ */
+@Data
+public class BaseUserAuthBO extends BaseEntity {
+
+    /**
+     * 用户guid
+     */
+    private String fkUserGuid;
+
+    /**
+     * 权限guid
+     */
+    private String fkFunGuid;
+
+    /**
+     * 权限父类guid
+     */
+    private String parentGuid;
+
+    /**
+     * 权限url
+     */
+    private String url;
+
+    /**
+     * 权限名称
+     */
+    private String funName;
+
+    /**
+     * 权限字符串
+     */
+    private String authStr;
+
+    /**
+     * 权限图标
+     */
+    private String ico;
+
+    /**
+     * 排序信息
+     */
+    private Integer orderBy;
+}

+ 83 - 0
src/main/java/com/hcloud/microservice/org/bo/BaseUserBO.java

@@ -0,0 +1,83 @@
+package com.hcloud.microservice.org.bo;
+
+import com.hcloud.microserver.commoncore.base.BaseEntity;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @author xiezt
+ */
+@Data
+public class BaseUserBO extends BaseEntity {
+
+    /**
+     * 主键
+     */
+    private String guid;
+
+    /**
+     * 机构guid
+     */
+    private String fkOrgGuid;
+
+    /**
+     * 账号
+     */
+    private String account;
+
+    /**
+     * 密码
+     */
+    private String passwd;
+
+    /**
+     * 用户名
+     */
+    private String userName;
+
+    /**
+     * 昵称
+     */
+    private String nickname;
+
+    /**
+     * 性别编码
+     */
+    private Integer dicSexCode;
+
+    /**
+     * 最后登陆时间
+     */
+    private Date lastLoginTime;
+
+    /**
+     * 是否禁用
+     */
+    private Integer isForbid;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 机构名称
+     */
+    private String orgName;
+
+    /**
+     * 角色名称
+     */
+    private String roleName;
+
+    /**
+     * 角色ID
+     */
+    private String roleId;
+    /**
+     * 联系电话
+     */
+    private String mobileNo;
+
+}

+ 167 - 0
src/main/java/com/hcloud/microservice/org/config/DruidDBConfig.java

@@ -0,0 +1,167 @@
+package com.hcloud.microservice.org.config;
+
+import com.alibaba.druid.filter.Filter;
+import com.alibaba.druid.pool.DruidDataSource;
+import com.alibaba.druid.support.http.StatViewServlet;
+import com.alibaba.druid.support.http.WebStatFilter;
+import com.alibaba.druid.wall.WallConfig;
+import com.alibaba.druid.wall.WallFilter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.web.servlet.FilterRegistrationBean;
+import org.springframework.boot.web.servlet.ServletRegistrationBean;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.DependsOn;
+import org.springframework.context.annotation.Primary;
+
+import javax.sql.DataSource;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by PrimaryKey on 17/2/4.
+ */
+@SuppressWarnings("AlibabaRemoveCommentedCode")
+@Configuration
+public class DruidDBConfig {
+    private Logger logger = LoggerFactory.getLogger(DruidDBConfig.class);
+    @Value("${spring.datasource.url}")
+    private String dbUrl;
+
+    @Value("${spring.datasource.username}")
+    private String username;
+
+    @Value("${spring.datasource.password}")
+    private String password;
+
+    @Value("${spring.datasource.driver-class-name}")
+    private String driverClassName;
+
+    @Value("${spring.datasource.initialSize}")
+    private int initialSize;
+
+    @Value("${spring.datasource.minIdle}")
+    private int minIdle;
+
+    @Value("${spring.datasource.maxActive}")
+    private int maxActive;
+
+    @Value("${spring.datasource.maxWait}")
+    private int maxWait;
+
+    @Value("${spring.datasource.timeBetweenEvictionRunsMillis}")
+    private int timeBetweenEvictionRunsMillis;
+
+    @Value("${spring.datasource.minEvictableIdleTimeMillis}")
+    private int minEvictableIdleTimeMillis;
+
+    @Value("${spring.datasource.validationQuery}")
+    private String validationQuery;
+
+    @Value("${spring.datasource.testWhileIdle}")
+    private boolean testWhileIdle;
+
+    @Value("${spring.datasource.testOnBorrow}")
+    private boolean testOnBorrow;
+
+    @Value("${spring.datasource.testOnReturn}")
+    private boolean testOnReturn;
+
+    @Value("${spring.datasource.poolPreparedStatements}")
+    private boolean poolPreparedStatements;
+
+    @Value("${spring.datasource.maxPoolPreparedStatementPerConnectionSize}")
+    private int maxPoolPreparedStatementPerConnectionSize;
+
+    @Value("${spring.datasource.filters}")
+    private String filters;
+
+    @Value("{spring.datasource.connectionProperties}")
+    private String connectionProperties;
+
+    @Autowired
+    private WallFilter wallFilter;
+
+    @Bean(initMethod = "init", destroyMethod = "close")   //声明其为Bean实例
+    @Primary  //在同样的DataSource中,首先使用被标注的DataSource
+    public DataSource dataSource() {
+        DruidDataSource datasource = new DruidDataSource();
+
+        datasource.setUrl(this.dbUrl);
+        datasource.setUsername(username);
+        datasource.setPassword(password);
+        datasource.setDriverClassName(driverClassName);
+
+        //configuration
+        datasource.setInitialSize(initialSize);
+        datasource.setMinIdle(minIdle);
+        datasource.setMaxActive(maxActive);
+        datasource.setMaxWait(maxWait);
+        datasource.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis);
+        datasource.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis);
+        datasource.setValidationQuery(validationQuery);
+        datasource.setTestWhileIdle(testWhileIdle);
+        datasource.setTestOnBorrow(testOnBorrow);
+        datasource.setTestOnReturn(testOnReturn);
+
+        List<Filter> filterss = new ArrayList<>();
+        filterss.add(wallFilter);
+        datasource.setProxyFilters(filterss);
+
+        datasource.setPoolPreparedStatements(poolPreparedStatements);
+        datasource.setMaxPoolPreparedStatementPerConnectionSize(maxPoolPreparedStatementPerConnectionSize);
+        try {
+            datasource.setFilters(filters);
+        } catch (SQLException e) {
+            logger.error("druid configuration initialization filter", e);
+        }
+        datasource.setConnectionProperties(connectionProperties);
+
+        return datasource;
+    }
+
+    @Bean
+    public ServletRegistrationBean druidServlet() {
+        ServletRegistrationBean reg = new ServletRegistrationBean();
+        reg.setServlet(new StatViewServlet());
+        reg.addUrlMappings("/druid/*");
+        //白名单
+        reg.addInitParameter("allow", "");
+        return reg;
+    }
+
+    @Bean
+    public FilterRegistrationBean filterRegistrationBean() {
+        FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean();
+        filterRegistrationBean.setFilter(new WebStatFilter());
+        filterRegistrationBean.addUrlPatterns("/*");
+        filterRegistrationBean.addInitParameter("exclusions", "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*");
+        filterRegistrationBean.addInitParameter("profileEnable", "true");
+        filterRegistrationBean.addInitParameter("principalCookieName","USER_COOKIE");
+        filterRegistrationBean.addInitParameter("principalSessionName","USER_SESSION");
+        filterRegistrationBean.addInitParameter("DruidWebStatFilter","/*");
+        return filterRegistrationBean;
+    }
+    @Bean(name = "wallFilter")
+    @DependsOn("wallConfig")
+    public WallFilter wallFilter(WallConfig wallConfig){
+        WallFilter wallFilter = new WallFilter();
+        wallFilter.setConfig(wallConfig);
+        return wallFilter;
+    }
+
+    @Bean(name = "wallConfig")
+    public WallConfig wallConfig(){
+        WallConfig wallConfig = new WallConfig();
+        //允许一次执行多条语句
+        wallConfig.setMultiStatementAllow(true);
+        //允许一次执行多条语句
+        wallConfig.setNoneBaseStatementAllow(true);
+        return wallConfig;
+    }
+}
+

+ 238 - 0
src/main/java/com/hcloud/microservice/org/config/OrgWebMvcConfig.java

@@ -0,0 +1,238 @@
+package com.hcloud.microservice.org.config;
+
+import com.hcloud.microserver.commoncore.conf.CurrentUserMethodArgumentResolver;
+import com.hcloud.microserver.commoncore.interceptor.AuthenticationInterceptor;
+import org.springframework.context.annotation.Bean;
+import org.springframework.format.FormatterRegistry;
+import org.springframework.http.converter.HttpMessageConverter;
+import org.springframework.validation.MessageCodesResolver;
+import org.springframework.validation.Validator;
+import org.springframework.validation.beanvalidation.OptionalValidatorFactoryBean;
+import org.springframework.web.method.support.HandlerMethodArgumentResolver;
+import org.springframework.web.method.support.HandlerMethodReturnValueHandler;
+import org.springframework.web.servlet.HandlerExceptionResolver;
+import org.springframework.web.servlet.View;
+import org.springframework.web.servlet.config.annotation.*;
+
+import java.util.List;
+
+
+/**
+ * 自定义mvc配置
+ * @author yys
+ */
+//@Configuration
+public class OrgWebMvcConfig implements WebMvcConfigurer  {
+
+
+    @Override
+    public void configurePathMatch(PathMatchConfigurer configurer) {
+
+    }
+
+    /**
+     * Configure content negotiation options.
+     *
+     * @param configurer
+     */
+    @Override
+    public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
+
+    }
+
+    /**
+     * Configure asynchronous request handling options.
+     *
+     * @param configurer
+     */
+    @Override
+    public void configureAsyncSupport(AsyncSupportConfigurer configurer) {
+
+    }
+
+    /**
+     * Configure a handler to delegate unhandled requests by forwarding to the
+     * Servlet container's "default" servlet. A common use case for this is when
+     * Servlet container's default handling of static resources.
+     *
+     * @param configurer
+     */
+    @Override
+    public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
+
+    }
+
+    /**
+     * registered by default.
+     *
+     * @param registry
+     */
+    @Override
+    public void addFormatters(FormatterRegistry registry) {
+
+    }
+
+    @Override
+    public void addInterceptors(InterceptorRegistry registry) {
+        registry.addInterceptor(authenticationInterceptor())
+                .addPathPatterns("/**")
+                .excludePathPatterns(new String[]{"/public/**","/static/**",
+                        "/resouces/**","/api/problem/images/**","/swagger-resources/**","/v2/api-docs/**"});
+    }
+
+    /**
+     * Add handlers to serve static resources such as images, js, and, css
+     * files from specific locations under web application root, the classpath,
+     * and others.
+     *
+     * @param registry
+     */
+    @Override
+    public void addResourceHandlers(ResourceHandlerRegistry registry) {
+
+    }
+
+    /**
+     * Configure cross origin requests processing.
+     *
+     * @param registry
+     * @since 4.2
+     */
+    @Override
+    public void addCorsMappings(CorsRegistry registry) {
+
+    }
+
+
+    @Override
+    public void addViewControllers(ViewControllerRegistry registry) {
+
+    }
+
+    /**
+     * Configure view resolvers to translate String-based view names returned from
+     * controllers into concrete {@link View}
+     * implementations to perform rendering with.
+     *
+     * @param registry
+     * @since 4.1
+     */
+    @Override
+    public void configureViewResolvers(ViewResolverRegistry registry) {
+
+    }
+
+    @Override
+    public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
+        argumentResolvers.add(currentUserMethodArgumentResolver());
+    }
+
+    /**
+     * Add handlers to support custom controller method return value types.
+     * <p>Using this option does not override the built-in support for handling
+     * return values. To customize the built-in support for handling return
+     * values, configure RequestMappingHandlerAdapter directly.
+     *
+     * @param returnValueHandlers initially an empty list
+     */
+    @Override
+    public void addReturnValueHandlers(List<HandlerMethodReturnValueHandler> returnValueHandlers) {
+
+    }
+
+    /**
+     * Configure the {@link HttpMessageConverter}s to use for reading or writing
+     * to the body of the request or response. If no converters are added, a
+     * default list of converters is registered.
+     * <p><strong>Note</strong> that adding converters to the list, turns off
+     * default converter registration. To simply add a converter without impacting
+     * default registration, consider using the method
+     * {@link #extendMessageConverters(List)} instead.
+     *
+     * @param converters initially an empty list of converters
+     */
+    @Override
+    public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
+
+    }
+
+    /**
+     * A hook for extending or modifying the list of converters after it has been
+     * configured. This may be useful for example to allow default converters to
+     * be registered and then insert a custom converter through this method.
+     *
+     * @param converters the list of configured converters to extend.
+     * @since 4.1.3
+     */
+    @Override
+    public void extendMessageConverters(List<HttpMessageConverter<?>> converters) {
+
+    }
+
+    /**
+     * Configure exception resolvers.
+     * <p>The given list starts out empty. If it is left empty, the framework
+     * configures a default set of resolvers, see
+     * {@link WebMvcConfigurationSupport#addDefaultHandlerExceptionResolvers(List)}.
+     * Or if any exception resolvers are added to the list, then the application
+     * effectively takes over and must provide, fully initialized, exception
+     * resolvers.
+     * <p>Alternatively you can use
+     * {@link #extendHandlerExceptionResolvers(List)} which allows you to extend
+     * or modify the list of exception resolvers configured by default.
+     *
+     * @param exceptionResolvers initially an empty list
+     * @see #extendHandlerExceptionResolvers(List)
+     * @see WebMvcConfigurationSupport#addDefaultHandlerExceptionResolvers(List)
+     */
+    @Override
+    public void configureHandlerExceptionResolvers(List<HandlerExceptionResolver> exceptionResolvers) {
+
+    }
+
+    /**
+     * Extending or modify the list of exception resolvers configured by default.
+     * This can be useful for inserting a custom exception resolver without
+     * interfering with default ones.
+     *
+     * @param exceptionResolvers the list of configured resolvers to extend
+     * @see WebMvcConfigurationSupport#addDefaultHandlerExceptionResolvers(List)
+     * @since 4.3
+     */
+    @Override
+    public void extendHandlerExceptionResolvers(List<HandlerExceptionResolver> exceptionResolvers) {
+
+    }
+
+    /**
+     * Provide a custom {@link Validator} instead of the one created by default.
+     * The default implementation, assuming JSR-303 is on the classpath, is:
+     * {@link OptionalValidatorFactoryBean}.
+     * Leave the return value as {@code null} to keep the default.
+     */
+    @Override
+    public Validator getValidator() {
+        return null;
+    }
+
+    /**
+     * Provide a custom {@link MessageCodesResolver} for building message codes
+     * from data binding and validation error codes. Leave the return value as
+     * {@code null} to keep the default.
+     */
+    @Override
+    public MessageCodesResolver getMessageCodesResolver() {
+        return null;
+    }
+
+
+    @Bean
+    public CurrentUserMethodArgumentResolver currentUserMethodArgumentResolver() {
+        return new CurrentUserMethodArgumentResolver();
+    }
+
+    @Bean
+    public AuthenticationInterceptor authenticationInterceptor() {
+        return new AuthenticationInterceptor();
+    }
+}

+ 62 - 0
src/main/java/com/hcloud/microservice/org/controller/AuthManagerController.java

@@ -0,0 +1,62 @@
+package com.hcloud.microservice.org.controller;
+
+import com.github.pagehelper.PageInfo;
+import com.hcloud.microserver.commoncore.annotation.AuthOrgValidate;
+import com.hcloud.microserver.commoncore.annotation.AuthValidate;
+import com.hcloud.microserver.commoncore.base.BaseController;
+import com.hcloud.microserver.commoncore.base.ResultVO;
+import com.hcloud.microserver.commoncore.enums.ResultEnum;
+import com.hcloud.microservice.org.facade.client.AuthManagerService;
+import com.hcloud.microservice.org.facade.entity.BaseAuthorization;
+import com.hcloud.microservice.org.facade.forms.BaseAuthForm;
+import com.hcloud.microservice.org.service.BaseAuthorizationService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * @author xiezt
+ */
+@RestController
+@RequestMapping("/auth")
+@Slf4j
+public class AuthManagerController extends BaseController implements AuthManagerService {
+
+    @Autowired
+    private BaseAuthorizationService baseAuthorizationService;
+
+    @Override
+    @PostMapping(value = "/searchAuthInfoByPage")
+    @AuthOrgValidate
+    public ResultVO<BaseAuthForm> searchAuthInfoByPage(@RequestBody BaseAuthForm baseAuthForm) {
+        PageInfo pageInfo = baseAuthorizationService.searchBaseAuthInfoByPage(baseAuthForm);
+        return success(pageInfo.getList(),pageInfo.getTotal());
+    }
+
+    @Override
+    @AuthOrgValidate
+    @PostMapping(value = "/addAuthInfo")
+    public ResultVO addAuthInfo(@RequestBody BaseAuthForm baseAuthForm) {
+        BaseAuthorization authorization = new BaseAuthorization();
+        BeanUtils.copyProperties(baseAuthForm,authorization);
+        int i = baseAuthorizationService.saveSelective(authorization);
+        if(i==0){
+            return new ResultVO<>(ResultEnum.SYS_ERROR);
+        }
+        return success();
+    }
+
+    @Override
+    @AuthOrgValidate
+    @PostMapping(value = "/updateAuthInfo")
+    public ResultVO updateAuthInfo( @RequestBody BaseAuthForm baseAuthForm) {
+        BaseAuthorization authorization = new BaseAuthorization();
+        BeanUtils.copyProperties(baseAuthForm,authorization);
+        int i = baseAuthorizationService.modifyByPrimaryKeySelective(authorization);
+        if(i==0){
+            return new ResultVO<>(ResultEnum.SYS_ERROR);
+        }
+        return success();
+    }
+}

+ 171 - 0
src/main/java/com/hcloud/microservice/org/controller/OrgManagerController.java

@@ -0,0 +1,171 @@
+package com.hcloud.microservice.org.controller;
+
+import com.github.pagehelper.PageInfo;
+import com.google.common.collect.Lists;
+import com.hcloud.microserver.commoncore.annotation.AuthOrgValidate;
+import com.hcloud.microserver.commoncore.annotation.AuthValidate;
+import com.hcloud.microserver.commoncore.base.BaseController;
+import com.hcloud.microserver.commoncore.base.ResultVO;
+import com.hcloud.microserver.commoncore.enums.ResultEnum;
+import com.hcloud.microserver.commoncore.util.BeanCopyUtil;
+import com.hcloud.microservice.org.facade.client.OrgManagerService;
+import com.hcloud.microservice.org.facade.entity.BaseOrg;
+import com.hcloud.microservice.org.facade.forms.BaseAuthForm;
+import com.hcloud.microservice.org.facade.forms.BaseOrgAuthForm;
+import com.hcloud.microservice.org.facade.forms.BaseOrgForm;
+import com.hcloud.microservice.org.facade.forms.BaseRoleAuthForm;
+import com.hcloud.microservice.org.service.BaseOrgAuthorizationService;
+import com.hcloud.microservice.org.service.BaseOrgService;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * @author xiezt
+ */
+@RestController
+@RequestMapping("/org")
+public class OrgManagerController extends BaseController implements OrgManagerService {
+
+
+    @Autowired
+    private BaseOrgService baseOrgService;
+
+    @Autowired
+    private BaseOrgAuthorizationService baseOrgAuthorizationService;
+
+    /**
+     * 查询机构信息(分页查询)
+     *
+     * @param baseOrgForm
+     * @return
+     */
+    @AuthOrgValidate
+    @PostMapping("/searchByPage")
+    @Override
+    public ResultVO searchOrgInfoByPage(@RequestBody BaseOrgForm baseOrgForm) {
+       PageInfo pageInfo =  baseOrgService.searchOrgInfoByPage(baseOrgForm);
+        return success(pageInfo.getList(),pageInfo.getTotal());
+    }
+
+    /**
+     * 添加机构信息
+     *
+     * @param baseOrgForm
+     * @return
+     */
+    @AuthOrgValidate
+    @PostMapping("/addOrgInfo")
+    @Override
+    public ResultVO addOrgInfo(@RequestBody BaseOrgForm baseOrgForm) {
+        BaseOrgForm queryForm = new BaseOrgForm();
+        queryForm.setOrgCode(baseOrgForm.getOrgCode());
+       PageInfo pageInfo =  baseOrgService.searchOrgInfoByPage(queryForm);
+       if(null!=pageInfo.getList() && pageInfo.getTotal()==0){
+           BaseOrg baseOrg = new BaseOrg();
+           BeanUtils.copyProperties(baseOrgForm,baseOrg);
+           Integer i = baseOrgService.saveSelective(baseOrg);
+           if(i==0){return new ResultVO(ResultEnum.SYS_ERROR);}
+           return success();
+       }
+        return new ResultVO(ResultEnum.ORG_IS_NOT);
+    }
+
+    /**
+     * 更新机构信息
+     *
+     * @param baseOrgForm
+     * @return
+     */
+    @AuthOrgValidate
+    @PostMapping("/updateOrgInfo")
+    @Override
+    public ResultVO updateOrgInfo(@RequestBody BaseOrgForm baseOrgForm) {
+        BaseOrg baseOrg = new BaseOrg();
+        BeanUtils.copyProperties(baseOrgForm,baseOrg);
+        Integer i =  baseOrgService.modifyByPrimaryKeySelective(baseOrg);
+        if(i==0){return new ResultVO(ResultEnum.SYS_ERROR);}
+        return success();
+    }
+
+    /**
+     * 查询机构明细信息
+     *
+     * @param guid
+     * @return
+     */
+    @AuthOrgValidate
+    @PostMapping("/searchById")
+    @Override
+    public ResultVO searchOrgInfoById(@RequestParam("guid") String guid) {
+        BaseOrg bean = baseOrgService.queryByPrimaryKey(guid);
+        return success(bean);
+    }
+
+    /**
+     * 分配机构权限
+     *
+     * @param orgGuid
+     * @param list
+     * @return
+     */
+    @AuthOrgValidate
+    @PostMapping("/distrOrgAuth")
+    @Override
+    public ResultVO distributionOrgAuthInfo(@RequestParam("orgGuid") String orgGuid,@RequestBody List<BaseOrgAuthForm> list) {
+        int i = baseOrgAuthorizationService.batchOrgAuthInfo(list,orgGuid);
+        if(i==0){return new ResultVO(ResultEnum.SYS_ERROR);}
+        return success();
+    }
+
+    /**
+     * 查询已分配的机构权限
+     *
+     * @param orgGuid
+     * @return
+     */
+    @AuthOrgValidate
+    @GetMapping("/searchOrgAuthInfo")
+    @Override
+    public ResultVO searchOrgAuthDistributioned(@RequestParam("orgGuid") String orgGuid) {
+        List<BaseOrgAuthForm> list = baseOrgService.searchAllOrgAuthInfo(orgGuid);
+        BaseOrgAuthForm baseOrgAuthForm = convertAuthMenu(list);
+         return success(baseOrgAuthForm);
+    }
+
+
+    private BaseOrgAuthForm convertAuthMenu( List<BaseOrgAuthForm> list){
+        BaseOrgAuthForm baseRoleAuthForm = new BaseOrgAuthForm();
+        if(null!= list && list.size()>0){
+            for (BaseOrgAuthForm bean: list) {
+                if("#".equals(bean.getParentGuid())){
+                    BeanCopyUtil.copyBean(bean,baseRoleAuthForm);
+                    baseRoleAuthForm.setSubMenuList(getSubMenuList(bean,list));
+                    break;
+                }
+            }
+        }
+        return baseRoleAuthForm;
+    }
+
+        private List<BaseOrgAuthForm> getSubMenuList(BaseOrgAuthForm baseOrgAuthForm, List<BaseOrgAuthForm> list){
+        List<BaseOrgAuthForm> subList = Lists.newArrayList();
+        List<BaseOrgAuthForm> resultList = Lists.newArrayList();
+        //TODO 查询子菜单
+        for(BaseOrgAuthForm en:list){
+            String parentId = baseOrgAuthForm.getId();
+            if(parentId.equals(en.getParentGuid())){
+                subList.add(en);
+            }
+        }
+        for(BaseOrgAuthForm bean:subList){
+            if(bean.getNodeType()==0){
+                bean.setSubMenuList(getSubMenuList(bean,list));
+            }
+            resultList.add(bean);
+        }
+        return resultList;
+    }
+}

+ 55 - 0
src/main/java/com/hcloud/microservice/org/controller/PositionManagerController.java

@@ -0,0 +1,55 @@
+package com.hcloud.microservice.org.controller;
+
+import com.hcloud.microserver.commoncore.annotation.AuthOrgValidate;
+import com.hcloud.microserver.commoncore.base.BaseController;
+import com.hcloud.microserver.commoncore.base.ResultVO;
+import com.hcloud.microservice.org.facade.client.PositionManagerService;
+import com.hcloud.microservice.org.facade.forms.BasePositionForm;
+import com.hcloud.microservice.org.service.BasePositionService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * @author JYJ
+ */
+@RestController
+@RequestMapping("/position")
+public class PositionManagerController extends BaseController implements PositionManagerService {
+
+
+    @Autowired
+    private BasePositionService basePositionService;
+
+    /**
+     * 通过父码查询子区域信息
+     *
+     * @param parentCode
+     * @return
+     */
+    @GetMapping("/getByParentCode")
+    @AuthOrgValidate
+    @Override
+    public ResultVO getBasePositionByParentCode(@RequestParam("parentCode") String parentCode) {
+        List<BasePositionForm> resultList =  basePositionService.getBasePositionByParentCode(parentCode);
+        return success(resultList);
+    }
+
+    /**
+     * 通过编码码查询子区域信息
+     *
+     * @param code
+     * @return
+     */
+    @GetMapping("/getByCode")
+    @AuthOrgValidate
+    @Override
+    public ResultVO getBasePositionByCode(@RequestParam("code")  String code) {
+        BasePositionForm basePositionForm =  basePositionService.getBasePositionByCode(code);
+        return success(basePositionForm);
+    }
+}

+ 164 - 0
src/main/java/com/hcloud/microservice/org/controller/RoleManagerController.java

@@ -0,0 +1,164 @@
+package com.hcloud.microservice.org.controller;
+
+import com.github.pagehelper.PageInfo;
+import com.google.common.collect.Lists;
+import com.hcloud.microserver.commoncore.annotation.AuthOrgValidate;
+import com.hcloud.microserver.commoncore.annotation.AuthValidate;
+import com.hcloud.microserver.commoncore.base.BaseController;
+import com.hcloud.microserver.commoncore.base.ResultVO;
+import com.hcloud.microserver.commoncore.enums.ResultEnum;
+import com.hcloud.microserver.commoncore.util.BeanCopyUtil;
+import com.hcloud.microservice.org.facade.client.RoleManagerService;
+import com.hcloud.microservice.org.facade.entity.BaseRole;
+import com.hcloud.microservice.org.facade.forms.BaseRoleAuthForm;
+import com.hcloud.microservice.org.facade.forms.BaseRoleForm;
+import com.hcloud.microservice.org.service.BaseRoleService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * @author xiezt
+ */
+@Slf4j
+@RestController
+@RequestMapping("/role")
+public class RoleManagerController extends BaseController implements RoleManagerService {
+
+    @Autowired
+    private BaseRoleService baseRoleService;
+
+    /**
+     * 分页查询角色信息
+     *
+     * @param baseRoleForm
+     * @return
+     */
+    @AuthOrgValidate
+    @PostMapping("/searchByPage")
+    @Override
+    public ResultVO searchRoleInfoByPage(@RequestBody BaseRoleForm baseRoleForm) {
+        PageInfo pageInfo = baseRoleService.searchRoleInfoByPage(baseRoleForm);
+        return success(pageInfo.getList(),pageInfo.getTotal());
+    }
+
+    /**
+     * 添加角色信息
+     *
+     * @param baseRoleForm
+     * @return
+     */
+    @AuthOrgValidate
+    @PostMapping("/addRoleInfo")
+    @Override
+    public ResultVO addRoleInfo(@RequestBody BaseRoleForm baseRoleForm) {
+        BaseRole baseRole = new BaseRole();
+        BeanUtils.copyProperties(baseRoleForm,baseRole);
+        int i =baseRoleService.saveSelective(baseRole);
+        if(i==0){return new ResultVO(ResultEnum.SYS_ERROR);}
+        return success();
+    }
+
+    /**
+     * 更新角色信息
+     *
+     * @param baseRoleForm
+     * @return
+     */
+    @AuthOrgValidate
+    @PostMapping("/updateRoleInfo")
+    @Override
+    public ResultVO updateRoleInfo(@RequestBody BaseRoleForm baseRoleForm) {
+        BaseRole baseRole = new BaseRole();
+        BeanUtils.copyProperties(baseRoleForm,baseRole);
+        int i = baseRoleService.modifyByPrimaryKeySelective(baseRole);
+        if(i==0){return new ResultVO(ResultEnum.SYS_ERROR);}
+        return success();
+    }
+
+    /**
+     * 查询角色明细信息
+     *
+     * @param guid
+     * @return
+     */
+    @AuthOrgValidate
+    @PostMapping("/searchById")
+    @Override
+    public ResultVO searchInfoById(@RequestParam("guid") String guid) {
+        BaseRole baseRole = baseRoleService.queryByPrimaryKey(guid);
+        return success(baseRole);
+    }
+
+    /**
+     * 查询已分配角色权限信息
+     *
+     * @param roleId
+     * @param orgGuid
+     * @return
+     */
+    @AuthOrgValidate
+    @PostMapping("/searchRoleAuthInfo")
+    @Override
+    public ResultVO searchRoleAuthInfo(@RequestParam("roleId") String roleId, @RequestParam("orgGuid") String orgGuid) {
+        List<BaseRoleAuthForm> list = baseRoleService.searchRoleAuthInfo(roleId,orgGuid);
+        return success(convertRoleMenu(list));
+    }
+
+    /**
+     * 分配角色权限
+     *
+     * @param list
+     * @return
+     */
+    @AuthOrgValidate
+    @PostMapping("/distribedRoleAuth")
+    @Override
+    public ResultVO distributionRoleAuth(@RequestParam("roleId") String roleId,
+                                         @RequestParam("orgGuid") String orgGuid,
+                                         @RequestBody List<BaseRoleAuthForm> list) {
+        int i = baseRoleService.batchSaveRoleAuthInfo(list,roleId,orgGuid);
+        if(i==0){return new ResultVO(ResultEnum.SYS_ERROR);}
+        return success();
+    }
+
+
+
+
+    private BaseRoleAuthForm convertRoleMenu(List<BaseRoleAuthForm> list){
+        BaseRoleAuthForm baseRoleAuthForm = new BaseRoleAuthForm();
+        if(null!= list && list.size()>0){
+            for (BaseRoleAuthForm bean: list) {
+                if("#".equals(bean.getParentGuid())){
+                    BeanCopyUtil.copyBean(bean,baseRoleAuthForm);
+                    baseRoleAuthForm.setSubMenuList(getSubMenuList(bean,list));
+                    break;
+                }
+            }
+        }
+        return baseRoleAuthForm;
+    }
+
+        private List<BaseRoleAuthForm> getSubMenuList(BaseRoleAuthForm baseRoleAuthForm,List<BaseRoleAuthForm> list){
+        List<BaseRoleAuthForm> subList = Lists.newArrayList();
+        List<BaseRoleAuthForm> resultList = Lists.newArrayList();
+        //TODO 查询子菜单
+        for(BaseRoleAuthForm en:list){
+            String parentId = baseRoleAuthForm.getId();
+            if(parentId.equals(en.getParentGuid())){
+                subList.add(en);
+            }
+        }
+        for(BaseRoleAuthForm bean:subList){
+            if(bean.getNodeType()==0){
+                bean.setSubMenuList(getSubMenuList(bean,list));
+            }
+            resultList.add(bean);
+        }
+       return resultList;
+    }
+
+}

+ 304 - 0
src/main/java/com/hcloud/microservice/org/controller/UserManagerController.java

@@ -0,0 +1,304 @@
+package com.hcloud.microservice.org.controller;
+
+import com.github.pagehelper.PageInfo;
+import com.google.common.collect.Lists;
+import com.hcloud.microserver.commoncore.annotation.AuthOrgValidate;
+import com.hcloud.microserver.commoncore.annotation.AuthValidate;
+import com.hcloud.microserver.commoncore.base.BaseController;
+import com.hcloud.microserver.commoncore.base.ResultVO;
+import com.hcloud.microserver.commoncore.base.Token;
+import com.hcloud.microserver.commoncore.constant.GlobleConstant;
+import com.hcloud.microserver.commoncore.enums.ResultEnum;
+import com.hcloud.microserver.commoncore.service.RedisUtils;
+import com.hcloud.microserver.commoncore.util.BeanCopyUtil;
+import com.hcloud.microserver.commoncore.util.Md5Util;
+import com.hcloud.microserver.commoncore.util.TokenUtil;
+import com.hcloud.microservice.org.facade.client.UserManagerService;
+import com.hcloud.microservice.org.facade.entity.BaseOrg;
+import com.hcloud.microservice.org.facade.entity.BaseUser;
+import com.hcloud.microservice.org.facade.forms.BaseUserAuthForm;
+import com.hcloud.microservice.org.facade.forms.BaseUserForm;
+import com.hcloud.microservice.org.service.BaseOrgService;
+import com.hcloud.microservice.org.service.BaseUserService;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.net.util.Base64;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.io.UnsupportedEncodingException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @author xiezt
+ */
+@Slf4j
+@RestController
+@RequestMapping("/user")
+public class UserManagerController extends BaseController implements UserManagerService {
+
+    private static final String PERMISSION_KEY = "url";
+
+    private static final String PERMISSION_ID = "perId";
+
+    private static final String PERMISSION_NAME = "perName";
+
+    private static final String PERMISSION_IS_CHECKD="isChecked";
+
+    @Autowired
+    private BaseUserService baseUserService;
+
+    @Autowired
+    private BaseOrgService baseOrgService;
+
+
+    @Autowired
+    private RedisUtils redisUtils;
+
+
+    /**
+     * 分页查询用户信息
+     * @param baseUserForm
+     * @return
+     */
+    @AuthOrgValidate
+    @PostMapping("/searchByPage")
+    @Override
+    public ResultVO searchUserInfoByPage(@RequestBody BaseUserForm baseUserForm) {
+        PageInfo pageInfo =baseUserService.searchUserInfoByPage(baseUserForm);
+        return success(pageInfo.getList(),pageInfo.getTotal());
+    }
+
+    /**
+     * 添加用户
+     * @param baseUserForm
+     * @return
+     */
+    @AuthOrgValidate
+    @PostMapping("/addUserInfo")
+    @Override
+    public ResultVO addUserInfo(@RequestBody BaseUserForm baseUserForm) {
+        log.info("================>{}",baseUserForm);
+        String account = baseUserForm.getAccount();
+        boolean repeatFlag = baseUserService.searchRepeatUserInfo(account);
+        if(!repeatFlag){
+            int i = baseUserService.addUserInfoForAll(baseUserForm);
+            if(i==-2){return new ResultVO(701,"角色未配置权限!");}
+            if(i==0){return new ResultVO(ResultEnum.SYS_ERROR);}
+            return success();
+        }
+        return new ResultVO(609,"账号重复");
+    }
+
+    /**
+     * 更新用户信息
+     * @param baseUserForm
+     * @return
+     */
+    @AuthOrgValidate
+    @PostMapping("/updateUserInfo")
+    @Override
+    public ResultVO updateUserInfo(@RequestBody BaseUserForm baseUserForm) {
+        if (!this.baseUserService.isAccountsValid(baseUserForm)) {
+            return new ResultVO(104, "修改失败, 用户账户已经存在");
+        }
+        if(baseUserForm.getRoleId()==null){
+            BaseUser user  = new BaseUser();
+            BeanCopyUtil.copyBean(baseUserForm,user);
+            String oldPasswd = baseUserForm.getOldPasswd();
+            if(oldPasswd!=null && !"".equals(oldPasswd)){
+                String minOldPasswd = this.checkoutPwd(oldPasswd);
+                BaseUser tmpUser = baseUserService.queryByPrimaryKey(user.getGuid());
+                if(!Md5Util.md5(minOldPasswd).equalsIgnoreCase(tmpUser.getPasswd())){
+                    return new ResultVO(ResultEnum.SYS_PASSWD_ERROR);
+                }
+            }
+            int i = baseUserService.modifyByPrimaryKeySelective(user);
+            if(i==0){return new ResultVO(ResultEnum.SYS_ERROR);}
+        }else{
+            int i = baseUserService.modifyUserInfoForAll(baseUserForm);
+            if(i==0){return new ResultVO(ResultEnum.SYS_ERROR);}
+        }
+        return success();
+    }
+
+    /**
+     * 查询用户权限
+     * @param userId
+     * @param orgGuid
+     * @return
+     */
+    @AuthOrgValidate
+    @GetMapping("/searchUserAuthInfo")
+    @Override
+    public ResultVO searchUserAuthInfo(@RequestParam("userId") String userId, @RequestParam("orgGuid") String orgGuid) {
+       List<BaseUserAuthForm> list = baseUserService.searchUserAuthInfo(userId,orgGuid);
+        return success(list);
+    }
+
+    /**
+     * 分配权限
+     *
+     * @param userId
+     * @param orgGuid
+     * @param list
+     * @return
+     */
+    @AuthOrgValidate
+    @PostMapping("/distribedUserAuthInfo")
+    @Override
+    public ResultVO distributionUserAuthInfo(@RequestParam("userId") String userId,
+                                             @RequestParam("orgGuid") String orgGuid,
+                                             @RequestBody List<BaseUserAuthForm> list) {
+        BaseUserForm baseUserForm = new BaseUserForm();
+        baseUserForm.setGuid(userId);
+        baseUserForm.setFkOrgGuid(orgGuid);
+        baseUserForm.setAuthList(list);
+        baseUserService.distributionUserAuthInfo(baseUserForm);
+        return success();
+    }
+
+    /**
+     * 用户登录系统
+     *
+     * @param account
+     * @param password
+     * @return
+     */
+    @AuthOrgValidate
+    @PostMapping("/loginSys")
+    @Override
+    public ResultVO loginSystem(@RequestParam("account") String account,@RequestParam("password") String password) {
+        Map reslutMap = Collections.emptyMap();
+        Token token = null;
+        BaseUserForm baseUserForm =  baseUserService.searchUserInfoByAccount(account,password);
+        if(null!=baseUserForm){
+            ResultEnum resultEnum = baseUserForm.getResultEnum();
+            if(resultEnum.getCode()!=0){return new ResultVO(resultEnum);}
+            reslutMap =  new HashMap();
+            String userId = baseUserForm.getGuid();
+            String orgGuid = baseUserForm.getFkOrgGuid();
+            BaseOrg baseOrg = baseOrgService.queryByPrimaryKey(orgGuid);
+            List<BaseUserAuthForm> authList = baseUserService.searchUserAuthInfo(userId,baseUserForm.getFkOrgGuid());
+            token = TokenUtil.createJwtToken(userId, GlobleConstant.CURRENT_USER);
+            reslutMap.put(GlobleConstant.ACCESS_TOKEN,token.getAccessToken());
+            reslutMap.put(GlobleConstant.AUTH_LIST, authList);
+            reslutMap.put(GlobleConstant.AUTH_MAP,convertAuthListToMap(authList));
+            reslutMap.put(GlobleConstant.AUTH_MENN_OBJ, convertMenuList(authList));
+            reslutMap.put(GlobleConstant.ORG_GUID,baseUserForm.getFkOrgGuid());
+            reslutMap.put(GlobleConstant.CURRENT_USER, baseUserForm);
+            reslutMap.put(GlobleConstant.USER_GUID,baseUserForm.getGuid());
+            reslutMap.put(GlobleConstant.ORG_OBJECT,baseOrg);
+            redisUtils.setValue(token.getAccessToken(), reslutMap, 2, TimeUnit.HOURS);
+            return success(reslutMap);
+        }
+        return new ResultVO(ResultEnum.FAIL_LOGIN_LOGIN_NAME);
+    }
+
+    /**
+     * 获取用户菜单信息
+     *
+     * @param userId
+     * @param orgGuid
+     * @return
+     */
+    @AuthOrgValidate
+    @PostMapping("/getUserMenus")
+    @Override
+    public ResultVO getUserMenusInfo(@RequestParam("userId") String userId,
+                                     @RequestParam("orgGuid") String orgGuid) {
+        List<BaseUserAuthForm> list = baseUserService.getUserMenusInfo(userId,orgGuid);
+            return success(list);
+    }
+
+    /**
+     * 获取菜单子功能信息
+     *
+     * @param baseUserAuthForm
+     * @return
+     */
+    @AuthOrgValidate
+    @PostMapping("/getUserSubAuth")
+    @Override
+    public ResultVO getSubUserAuthInfo(@RequestBody BaseUserAuthForm baseUserAuthForm) {
+       List<BaseUserAuthForm> list =  baseUserService.getSubAuthById(baseUserAuthForm.getFkUserGuid(),
+                baseUserAuthForm.getFkOrgGuid(),baseUserAuthForm.getFkAuthGuid());
+        return success(list);
+    }
+
+    /**
+     * 转换用户权限变为菜单显示
+     * @param list
+     * @return
+     */
+    private BaseUserAuthForm convertMenuList(List<BaseUserAuthForm> list){
+        BaseUserAuthForm baseUserAuthForm = new BaseUserAuthForm();
+        if(null!= list && list.size()>0){
+            for (BaseUserAuthForm bean:list) {
+                if("#".equalsIgnoreCase(bean.getParentGuid())){
+                    BeanCopyUtil.copyBean(bean,baseUserAuthForm);
+                    baseUserAuthForm.setSubMenuList(getSubMenuListById(bean));
+                    break;
+                  }
+            }
+        }
+        log.info("baseUserAuthForm=====================>{}",baseUserAuthForm);
+        return baseUserAuthForm;
+    }
+
+    private List<BaseUserAuthForm> getSubMenuListById(BaseUserAuthForm bean){
+        List<BaseUserAuthForm> resultList = Lists.newArrayList();
+        List<BaseUserAuthForm> tmpList = baseUserService.getSubAuthById(bean.getFkUserGuid(),
+                bean.getFkOrgGuid(), bean.getId());
+        for (BaseUserAuthForm entity: tmpList) {
+            if(entity.getIsChecked()==1 && entity.getNodeType()==0){
+                entity.setSubMenuList(getSubMenuListById(entity));
+            }
+            resultList.add(entity);
+        }
+        return resultList;
+    }
+
+    private List<Map<String,Object>> convertAuthListToMap(List<BaseUserAuthForm> list){
+        List<Map<String,Object>> resultList = Lists.newArrayList();
+        if(null!=list && list.size()>0){
+            for (BaseUserAuthForm bean:list) {
+                Map<String,Object> map = new HashMap<>();
+                map.put(PERMISSION_KEY,bean.getAuthStr());
+                map.put(PERMISSION_ID,bean.getId());
+                map.put(PERMISSION_NAME,bean.getFunName());
+                map.put(PERMISSION_IS_CHECKD,bean.getIsChecked());
+                resultList.add(map);
+            }
+        }
+        return resultList;
+    }
+
+    /**
+     * 登录解密方式
+     * @param pwd
+     * @return
+     */
+    private String checkoutPwd(String pwd)  {
+        //需要进行对应的接密操作
+        //1.获取盐值
+        String salt = pwd.substring(0, 5);
+        String key = "b8d11ee289394be688ef3a4f6968efed";
+        String time1 = Md5Util.md5((key).substring(0, 8)).substring(0, 5);
+        //做超时判断
+        if (!time1.equalsIgnoreCase(salt)) {
+            throw new RuntimeException();
+        }
+        //2.去除盐值
+        String replace = pwd.replace(salt, "");
+        //3.还原base64前的密码值
+        try {
+            return new String(Base64.decodeBase64(replace), "utf-8");
+        } catch (UnsupportedEncodingException e) {
+            throw new RuntimeException();
+        }
+    }
+}

+ 37 - 0
src/main/java/com/hcloud/microservice/org/dao/BaseAuthorizationMapper.java

@@ -0,0 +1,37 @@
+package com.hcloud.microservice.org.dao;
+
+
+import com.github.pagehelper.Page;
+import com.github.pagehelper.PageInfo;
+import com.hcloud.microserver.commoncore.base.BaseMapper;
+import com.hcloud.microserver.commoncore.base.PageBean;
+import com.hcloud.microservice.org.bo.BaseAuthBO;
+import com.hcloud.microservice.org.facade.entity.BaseAuthorization;
+import com.hcloud.microservice.org.facade.forms.BaseAuthForm;
+
+import java.util.List;
+
+public interface BaseAuthorizationMapper extends BaseMapper<BaseAuthorization,String> {
+
+    /**
+     *分页查询权限信息
+     *
+     * @param pageBean 分页信息
+     * @return 权限分页信息
+     */
+    Page<BaseAuthBO> searchBaseAuthInfoByPage(PageBean<BaseAuthForm> pageBean);
+
+    /**
+     * 查询菜单权限信息(存在url地址的权限)
+     * @return
+     */
+    List<BaseAuthBO> searchMenuAuthInfo();
+
+
+    /**
+     * 查询所有权限信息
+     * @return
+     */
+    Page<BaseAuthBO> searchAllBaseAuthInfo();
+
+}

+ 11 - 0
src/main/java/com/hcloud/microservice/org/dao/BaseDictionaryMapper.java

@@ -0,0 +1,11 @@
+package com.hcloud.microservice.org.dao;
+
+import com.hcloud.microserver.commoncore.base.BaseMapper;
+import com.hcloud.microservice.org.entity.BaseDictionary;
+
+/**
+ * @author JYJ
+ */
+public interface BaseDictionaryMapper extends BaseMapper<BaseDictionary,String> {
+
+}

+ 11 - 0
src/main/java/com/hcloud/microservice/org/dao/BaseDictionaryTypeMapper.java

@@ -0,0 +1,11 @@
+package com.hcloud.microservice.org.dao;
+
+import com.hcloud.microserver.commoncore.base.BaseMapper;
+import com.hcloud.microservice.org.entity.BaseDictionaryType;
+
+/**
+ * @author JYJ
+ */
+public interface BaseDictionaryTypeMapper extends BaseMapper<BaseDictionaryType,String> {
+
+}

+ 60 - 0
src/main/java/com/hcloud/microservice/org/dao/BaseOrgAuthorizationMapper.java

@@ -0,0 +1,60 @@
+package com.hcloud.microservice.org.dao;
+
+
+import com.github.pagehelper.Page;
+import com.hcloud.microserver.commoncore.base.BaseMapper;
+import com.hcloud.microserver.commoncore.base.PageBean;
+import com.hcloud.microservice.org.bo.BaseOrgAuthBO;
+import com.hcloud.microservice.org.facade.entity.BaseOrgAuthorization;
+import com.hcloud.microservice.org.facade.forms.BaseOrgAuthForm;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface BaseOrgAuthorizationMapper extends BaseMapper<BaseOrgAuthorization,String> {
+
+    /**
+     * 批量插入机构权限信息
+     * @param list
+     * @return
+     */
+    int batchOrgAuthInfo(List<BaseOrgAuthForm> list);
+
+
+    /**
+     * 通过机构id查询机构权限
+     * @param pageBean
+     * @return
+     */
+    List<BaseOrgAuthBO> searchOrgAuthInfoByOrgId(PageBean<BaseOrgAuthForm> pageBean);
+
+    /**
+     * 通过机构Id删除机构权限
+     * @param orgGuid
+     * @return
+     */
+    int delOrgAuthInfoByOrgId(@Param("id") String orgGuid);
+
+    /**
+     * 查询机构权限的功能权限guid
+     * @param orgGuid
+     * @return
+     */
+    List<String> searchOrgAuthStringByOrgId(@Param("id") String orgGuid);
+
+
+    /**
+     * 查询机构权限菜单
+     * @return
+     */
+    List<BaseOrgAuthBO> searchOrgMenuInfo();
+
+
+    /**
+     * 查询机构权限信息
+     * @param orgGuid
+     * @return
+     */
+    List<BaseOrgAuthBO> searchAllOrgAuthInfo(@Param("id") String orgGuid);
+
+}

+ 17 - 0
src/main/java/com/hcloud/microservice/org/dao/BaseOrgMapper.java

@@ -0,0 +1,17 @@
+package com.hcloud.microservice.org.dao;
+
+
+import com.github.pagehelper.Page;
+import com.hcloud.microserver.commoncore.base.BaseMapper;
+import com.hcloud.microserver.commoncore.base.PageBean;
+import com.hcloud.microservice.org.facade.entity.BaseOrg;
+import com.hcloud.microservice.org.facade.forms.BaseOrgForm;
+
+public interface BaseOrgMapper extends BaseMapper<BaseOrg,String> {
+    /**
+     * 分页查询机构信息
+     * @param pageBean
+     * @return
+     */
+    Page<BaseOrg> searchOrgInfoByPage(PageBean<BaseOrgForm> pageBean);
+}

+ 26 - 0
src/main/java/com/hcloud/microservice/org/dao/BasePositionMapper.java

@@ -0,0 +1,26 @@
+package com.hcloud.microservice.org.dao;
+
+import com.hcloud.microserver.commoncore.base.BaseMapper;
+import com.hcloud.microservice.org.facade.entity.BasePosition;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @author xiezt
+ */
+public interface BasePositionMapper extends BaseMapper<BasePosition,Integer> {
+    /**
+     * 通过编码查询区域信息
+     * @param code
+     * @return
+     */
+    BasePosition getBasePositionByCode(@Param("areaCode") String code);
+
+    /**
+     * 通过父编码查询区域信息
+     * @param parentCode
+     * @return
+     */
+    List<BasePosition> getBasePositionByParentCode(@Param("parentCode") String parentCode);
+}

+ 39 - 0
src/main/java/com/hcloud/microservice/org/dao/BaseRoleAuthorizationMapper.java

@@ -0,0 +1,39 @@
+package com.hcloud.microservice.org.dao;
+
+
+import com.github.pagehelper.Page;
+import com.hcloud.microserver.commoncore.base.BaseMapper;
+import com.hcloud.microservice.org.facade.entity.BaseRoleAuthorization;
+import com.hcloud.microservice.org.facade.forms.BaseRoleAuthForm;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @author xiezt
+ */
+public interface BaseRoleAuthorizationMapper extends BaseMapper<BaseRoleAuthorization,String> {
+    /**
+     * 批量插入角色权限信息
+     * @param formsList
+     * @return
+     */
+    int batchSaveRoleAuthInfo(List<BaseRoleAuthForm> formsList);
+
+
+    /**
+     * 通过角色Id查询角色权限信息
+     * @param roleId
+     * @param orgGuid
+     * @return
+     */
+    List<String> searchRoleAuthByRoleId(@Param("roleId") String roleId, @Param("orgGuid") String orgGuid);
+
+    /**
+     * 删除角色权限信息通过角色ID
+     * @param roleId
+     * @param orgGuid
+     * @return
+     */
+    int delRoleAuthByRoleId(@Param("id") String roleId,@Param("orgGuid") String orgGuid);
+}

+ 32 - 0
src/main/java/com/hcloud/microservice/org/dao/BaseRoleMapper.java

@@ -0,0 +1,32 @@
+package com.hcloud.microservice.org.dao;
+
+
+import com.github.pagehelper.Page;
+import com.hcloud.microserver.commoncore.base.BaseMapper;
+import com.hcloud.microserver.commoncore.base.PageBean;
+import com.hcloud.microservice.org.bo.BaseRoleUserBO;
+import com.hcloud.microservice.org.facade.entity.BaseRole;
+import com.hcloud.microservice.org.facade.forms.BaseRoleForm;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @author  xiezt
+ */
+public interface BaseRoleMapper extends BaseMapper<BaseRole,String> {
+
+    /**
+     * 分页查询角色信息
+     * @param pageBean
+     * @return
+     */
+    Page<BaseRole> searchRoleInfoByPage(PageBean<BaseRoleForm> pageBean);
+
+    /**
+     * 通过角色Id查询角色下辖用户信息
+     * @param roleId
+     * @return
+     */
+    List<BaseRoleUserBO> searchUserInfoByRoleId(@Param("guid") String roleId);
+}

+ 31 - 0
src/main/java/com/hcloud/microservice/org/dao/BaseRoleUserMapper.java

@@ -0,0 +1,31 @@
+package com.hcloud.microservice.org.dao;
+
+
+import com.github.pagehelper.Page;
+import com.hcloud.microserver.commoncore.base.BaseMapper;
+import com.hcloud.microserver.commoncore.base.PageBean;
+import com.hcloud.microservice.org.bo.BaseRoleUserBO;
+import com.hcloud.microservice.org.facade.entity.BaseRoleUser;
+import com.hcloud.microservice.org.facade.forms.BaseRoleUserForm;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface BaseRoleUserMapper extends BaseMapper<BaseRoleUser,String> {
+
+    /**
+     * 查询角色用户信息(角色下有哪些用户,用户拥有哪些角色)
+     * @param page
+     * @return
+     */
+    Page<BaseRoleUserBO> searchRoleUserInfoByPage(PageBean<BaseRoleUserForm> page);
+
+
+    /**
+     * 通过用户UI移除角色用户信息
+     * @param userId
+     * @param orgGuid
+     * @return
+     */
+    int delRoleUserInfoByUserId(@Param("id") String userId,@Param("oguid") String orgGuid);
+}

+ 38 - 0
src/main/java/com/hcloud/microservice/org/dao/BaseUserAuthorizationMapper.java

@@ -0,0 +1,38 @@
+package com.hcloud.microservice.org.dao;
+
+
+import com.hcloud.microserver.commoncore.base.BaseMapper;
+import com.hcloud.microservice.org.facade.entity.BaseUserAuthorization;
+import com.hcloud.microservice.org.facade.forms.BaseUserAuthForm;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface BaseUserAuthorizationMapper extends BaseMapper<BaseUserAuthorization,String> {
+
+    /**
+     * 批量插入用户权限信息
+     * @param list
+     * @return
+     */
+    int batchSaveUserAuthInfo(List<BaseUserAuthForm> list);
+
+    /**
+     * 删除用户权限通过用户Id
+     * @param userId 用户id
+     * @param orgGuid 机构id
+     * @return
+     */
+    int delUserAuthInfoByUserId(@Param("id") String userId,@Param("oguid") String orgGuid);
+
+
+    /**
+     * 通过用户Id查询用户权限
+     * @param userId 用户id
+     * @param orgGuid 机构id
+     * @return
+     */
+    List<String> searchUserAuthInfoByUserId(@Param("id") String userId,@Param("oguid") String orgGuid);
+
+    
+}

+ 32 - 0
src/main/java/com/hcloud/microservice/org/dao/BaseUserMapper.java

@@ -0,0 +1,32 @@
+package com.hcloud.microservice.org.dao;
+
+
+import com.github.pagehelper.Page;
+import com.hcloud.microserver.commoncore.base.BaseMapper;
+import com.hcloud.microserver.commoncore.base.PageBean;
+import com.hcloud.microservice.org.bo.BaseUserBO;
+import com.hcloud.microservice.org.facade.entity.BaseUser;
+import com.hcloud.microservice.org.facade.forms.BaseUserForm;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * @author xiezt
+ */
+public interface BaseUserMapper extends BaseMapper<BaseUser,String> {
+
+    /**
+     * 分页查询用户基本信息
+     * @param pageBean
+     * @return
+     */
+    Page<BaseUserBO> searchUserInfoByPage(PageBean<BaseUserForm> pageBean);
+
+    /**
+     * 通过用户账号查询用户信息
+     * @param account
+     * @return
+     */
+    BaseUser getUserInfoByAccount(@Param("account") String account);
+
+    BaseUser selectAccountNotSelf(BaseUserForm BaseUserForm);
+}

+ 115 - 0
src/main/java/com/hcloud/microservice/org/entity/BaseDictionary.java

@@ -0,0 +1,115 @@
+package com.hcloud.microservice.org.entity;
+
+import java.util.Date;
+
+public class BaseDictionary {
+    private String guid;
+
+    private String fkOrgGuid;
+
+    private String fkTypeGuid;
+
+    private String dicname;
+
+    private String diccode;
+
+    private Integer isForbiden;
+
+    private Integer orderby;
+
+    private String remark;
+
+    private Integer state;
+
+    private Date createTime;
+
+    private Date modifiedTime;
+
+    public String getGuid() {
+        return guid;
+    }
+
+    public void setGuid(String guid) {
+        this.guid = guid == null ? null : guid.trim();
+    }
+
+    public String getFkOrgGuid() {
+        return fkOrgGuid;
+    }
+
+    public void setFkOrgGuid(String fkOrgGuid) {
+        this.fkOrgGuid = fkOrgGuid == null ? null : fkOrgGuid.trim();
+    }
+
+    public String getFkTypeGuid() {
+        return fkTypeGuid;
+    }
+
+    public void setFkTypeGuid(String fkTypeGuid) {
+        this.fkTypeGuid = fkTypeGuid == null ? null : fkTypeGuid.trim();
+    }
+
+    public String getDicname() {
+        return dicname;
+    }
+
+    public void setDicname(String dicname) {
+        this.dicname = dicname == null ? null : dicname.trim();
+    }
+
+    public String getDiccode() {
+        return diccode;
+    }
+
+    public void setDiccode(String diccode) {
+        this.diccode = diccode == null ? null : diccode.trim();
+    }
+
+    public Integer getIsForbiden() {
+        return isForbiden;
+    }
+
+    public void setIsForbiden(Integer isForbiden) {
+        this.isForbiden = isForbiden;
+    }
+
+    public Integer getOrderby() {
+        return orderby;
+    }
+
+    public void setOrderby(Integer orderby) {
+        this.orderby = orderby;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark == null ? null : remark.trim();
+    }
+
+    public Integer getState() {
+        return state;
+    }
+
+    public void setState(Integer state) {
+        this.state = state;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getModifiedTime() {
+        return modifiedTime;
+    }
+
+    public void setModifiedTime(Date modifiedTime) {
+        this.modifiedTime = modifiedTime;
+    }
+}

+ 85 - 0
src/main/java/com/hcloud/microservice/org/entity/BaseDictionaryType.java

@@ -0,0 +1,85 @@
+package com.hcloud.microservice.org.entity;
+
+import java.util.Date;
+
+public class BaseDictionaryType {
+    private String guid;
+
+    private String fkOrgGuid;
+
+    private String parentTypeId;
+
+    private String typeCode;
+
+    private String typeName;
+
+    private Integer state;
+
+    private Date createTime;
+
+    private Date modifiedTime;
+
+    public String getGuid() {
+        return guid;
+    }
+
+    public void setGuid(String guid) {
+        this.guid = guid == null ? null : guid.trim();
+    }
+
+    public String getFkOrgGuid() {
+        return fkOrgGuid;
+    }
+
+    public void setFkOrgGuid(String fkOrgGuid) {
+        this.fkOrgGuid = fkOrgGuid == null ? null : fkOrgGuid.trim();
+    }
+
+    public String getParentTypeId() {
+        return parentTypeId;
+    }
+
+    public void setParentTypeId(String parentTypeId) {
+        this.parentTypeId = parentTypeId == null ? null : parentTypeId.trim();
+    }
+
+    public String getTypeCode() {
+        return typeCode;
+    }
+
+    public void setTypeCode(String typeCode) {
+        this.typeCode = typeCode == null ? null : typeCode.trim();
+    }
+
+    public String getTypeName() {
+        return typeName;
+    }
+
+    public void setTypeName(String typeName) {
+        this.typeName = typeName == null ? null : typeName.trim();
+    }
+
+    public Integer getState() {
+        return state;
+    }
+
+    public void setState(Integer state) {
+        this.state = state;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getModifiedTime() {
+        return modifiedTime;
+    }
+
+    public void setModifiedTime(Date modifiedTime) {
+        this.modifiedTime = modifiedTime;
+    }
+}

+ 30 - 0
src/main/java/com/hcloud/microservice/org/service/BaseAuthorizationService.java

@@ -0,0 +1,30 @@
+package com.hcloud.microservice.org.service;
+
+import com.github.pagehelper.PageInfo;
+import com.hcloud.microserver.commoncore.base.BaseServie;
+import com.hcloud.microservice.org.bo.BaseAuthBO;
+import com.hcloud.microservice.org.facade.entity.BaseAuthorization;
+import com.hcloud.microservice.org.facade.forms.BaseAuthForm;
+
+import java.util.List;
+
+/**
+ * 权限服务类
+ * @author xiezt
+ */
+public interface BaseAuthorizationService extends BaseServie<BaseAuthorization,String> {
+
+        /**
+         *分页查询权限信息
+         *
+         * @param baseAuthForm 页面交互信息
+         * @return 权限分页信息
+         */
+        PageInfo searchBaseAuthInfoByPage(BaseAuthForm baseAuthForm);
+
+        /**
+         * 查询菜单权限信息(存在url地址的权限)
+         * @return
+         */
+        List<BaseAuthBO> searchMenuAuthInfo();
+}

+ 43 - 0
src/main/java/com/hcloud/microservice/org/service/BaseOrgAuthorizationService.java

@@ -0,0 +1,43 @@
+package com.hcloud.microservice.org.service;
+
+import com.github.pagehelper.Page;
+import com.github.pagehelper.PageInfo;
+import com.hcloud.microserver.commoncore.base.BaseServie;
+import com.hcloud.microserver.commoncore.base.PageBean;
+import com.hcloud.microservice.org.bo.BaseOrgAuthBO;
+import com.hcloud.microservice.org.facade.entity.BaseOrgAuthorization;
+import com.hcloud.microservice.org.facade.forms.BaseOrgAuthForm;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @author xiezt
+ */
+public interface BaseOrgAuthorizationService extends BaseServie<BaseOrgAuthorization,String> {
+
+    /**
+     * 批量插入机构权限信息
+     * @param listForm
+     * @param orgGuid
+     * @return
+     */
+    int batchOrgAuthInfo(List<BaseOrgAuthForm> listForm,String orgGuid);
+
+
+    /**
+     * 通过机构id查询机构权限
+     * @param baseOrgAuthForm
+     * @return
+     */
+    PageInfo searchOrgAuthInfoByOrgId(BaseOrgAuthForm baseOrgAuthForm);
+
+
+
+    /**
+     * 为机构权限分配查询机构所有权限
+     * @param orgGuid
+     * @return
+     */
+    List<BaseOrgAuthBO> searchAllOrgAuthInfoForOrg(String orgGuid);
+}

+ 36 - 0
src/main/java/com/hcloud/microservice/org/service/BaseOrgService.java

@@ -0,0 +1,36 @@
+package com.hcloud.microservice.org.service;
+
+import com.github.pagehelper.PageInfo;
+import com.hcloud.microserver.commoncore.base.BaseServie;
+import com.hcloud.microservice.org.bo.BaseOrgAuthBO;
+import com.hcloud.microservice.org.facade.entity.BaseOrg;
+import com.hcloud.microservice.org.facade.forms.BaseAuthForm;
+import com.hcloud.microservice.org.facade.forms.BaseOrgAuthForm;
+import com.hcloud.microservice.org.facade.forms.BaseOrgForm;
+
+import java.util.List;
+
+public interface BaseOrgService extends BaseServie<BaseOrg,String>  {
+
+    /**
+     * 分页查询机构信息
+     * @param baseOrgForm
+     * @return
+     */
+    PageInfo searchOrgInfoByPage(BaseOrgForm baseOrgForm);
+
+    /**
+     * 机构管理查询中查询机构权限
+     * @param orgGuid
+     * @return
+     */
+    List<BaseOrgAuthForm> searchAllOrgAuthInfo(String orgGuid);
+
+    /**
+     * 获取机构菜单权限
+     * @param orgGuid
+     * @return
+     */
+    List<BaseOrgAuthForm> searchMenuAuthInfo(String orgGuid);
+
+}

+ 28 - 0
src/main/java/com/hcloud/microservice/org/service/BasePositionService.java

@@ -0,0 +1,28 @@
+package com.hcloud.microservice.org.service;
+
+import com.hcloud.microserver.commoncore.base.BaseServie;
+import com.hcloud.microservice.org.facade.entity.BasePosition;
+import com.hcloud.microservice.org.facade.forms.BasePositionForm;
+
+import java.util.List;
+
+/**
+ * @author xiezt
+ */
+public interface BasePositionService extends BaseServie<BasePosition,Integer> {
+
+    /**
+     * 通过编码查询区域信息
+     * @param code
+     * @return
+     */
+    BasePositionForm getBasePositionByCode(String code);
+
+
+    /**
+     * 通过父编码查询区域信息
+     * @param parentCode
+     * @return
+     */
+    List<BasePositionForm> getBasePositionByParentCode(String parentCode);
+}

+ 64 - 0
src/main/java/com/hcloud/microservice/org/service/BaseRoleService.java

@@ -0,0 +1,64 @@
+package com.hcloud.microservice.org.service;
+
+import com.github.pagehelper.Page;
+import com.github.pagehelper.PageInfo;
+import com.hcloud.microserver.commoncore.base.BaseServie;
+import com.hcloud.microserver.commoncore.base.PageBean;
+import com.hcloud.microservice.org.bo.BaseRoleAuthBO;
+import com.hcloud.microservice.org.bo.BaseRoleUserBO;
+import com.hcloud.microservice.org.facade.forms.BaseRoleAuthForm;
+import com.hcloud.microservice.org.facade.entity.BaseRole;
+import com.hcloud.microservice.org.facade.forms.BaseRoleForm;
+
+import java.util.List;
+
+
+/**
+ * @author xiezt
+ */
+public interface BaseRoleService extends BaseServie<BaseRole,String> {
+
+
+    /**
+     * 分页查询角色信息
+     * @param baseRoleForm
+     * @return
+     */
+    PageInfo searchRoleInfoByPage(BaseRoleForm baseRoleForm);
+
+
+
+    /**
+     * 批量插入角色权限信息
+     * @param formsList
+     * @param roleId
+     * @return
+     */
+    int batchSaveRoleAuthInfo(List<BaseRoleAuthForm> formsList,String roleId,String orgGuid);
+
+
+    /**
+     * 通过角色Id删除角色权限信息
+     * @param roleId
+     * @param orgGuid
+     * @return
+     */
+    int delRoleAuthInfoByRoleId(String roleId, String orgGuid);
+
+    /**
+     * 查询角色机构权限信息
+     * @param roleId
+     * @param orgGuid
+     * @return
+     */
+    List<BaseRoleAuthForm> searchRoleAuthInfo(String roleId, String orgGuid);
+
+    /**
+     * 查询角色机构信息(不与机构权限信息比对)
+     * @param roleId
+     * @param orgGuid
+     * @return
+     */
+    List<BaseRoleAuthForm> searchOnlyRoleAuthInfo(String roleId, String orgGuid);
+
+}

+ 119 - 0
src/main/java/com/hcloud/microservice/org/service/BaseUserService.java

@@ -0,0 +1,119 @@
+package com.hcloud.microservice.org.service;
+
+import com.github.pagehelper.PageInfo;
+import com.hcloud.microserver.commoncore.base.BaseServie;
+import com.hcloud.microservice.org.facade.entity.BaseUser;
+import com.hcloud.microservice.org.facade.forms.BaseOrgAuthForm;
+import com.hcloud.microservice.org.facade.forms.BaseRoleUserForm;
+import com.hcloud.microservice.org.facade.forms.BaseUserAuthForm;
+import com.hcloud.microservice.org.facade.forms.BaseUserForm;
+
+import java.util.List;
+
+/**
+ * @author xiezt
+ */
+public interface BaseUserService extends BaseServie<BaseUser,String>  {
+
+    /**
+     * 批量插入用户权限信息
+     * @param list
+     * @param userId
+     * @param orgGuid
+     * @return
+     */
+    int batchSaveUserAuthInfo(String userId,String orgGuid,List<BaseUserAuthForm> list);
+
+    /**
+     * 分页查询用户信息
+     * @param baseUserForm
+     * @return
+     */
+    PageInfo searchUserInfoByPage(BaseUserForm baseUserForm);
+
+    /**
+     * 通过用户id查询用户权限信息
+     * @param userId
+     * @param orgGuid
+     * @return
+     */
+    List<BaseUserAuthForm> searchUserAuthInfo(String userId, String orgGuid);
+
+    /**
+     * 通过用户id删除用户权限信息
+     * @param userId
+     * @param orgGuid
+     * @return
+     */
+    int delUserAuthInfoByUserId(String userId,String orgGuid);
+
+    /**
+     * 查询用户角色信息,通过用户查询角色,通过角色查用户
+     * @param baseRoleUserForm
+     * @return
+     */
+    PageInfo searchRoleUserInfoById(BaseRoleUserForm baseRoleUserForm);
+
+
+    /**
+     * 分配用户角色信息
+     * @param baseUserForm
+     */
+    void distributionUserAuthInfo(BaseUserForm baseUserForm);
+
+    /**
+     * 查询用户信息
+     * @param account
+     * @param password
+     * @return
+     */
+    BaseUserForm searchUserInfoByAccount(String account,String password);
+
+    /**
+     * 查询用户菜单信息
+     * @param userId
+     * @param orgGuid
+     * @return
+     */
+    List<BaseUserAuthForm> getUserMenusInfo(String userId,String orgGuid);
+
+
+    /**
+     * 查询功能权限通过菜单权限
+     * @param userId
+     * @param orgGuid
+     * @param authId
+     * @return
+     */
+    List<BaseUserAuthForm> getSubAuthById(String userId,String orgGuid,String authId);
+
+    /**
+     * 查询重复用户信息
+     * @param account
+     * @return
+     */
+    boolean searchRepeatUserInfo(String account);
+
+
+    /**
+     * 新增用户信息(包含用户属于哪个角色,用户拥有的权限)
+     * @param baseUserForm
+     * @return
+     */
+    int addUserInfoForAll(BaseUserForm baseUserForm);
+
+    /**
+     * 修改用户信息(包含用户属于哪个角色,用户拥有的权限)
+     * @param baseUserForm
+     * @return
+     */
+    int modifyUserInfoForAll(BaseUserForm baseUserForm);
+
+    /**
+     * 查找用户账户是否存在
+     * 排除自身账户 如果没有的accout返回true
+     * @param baseUserForm
+     * @return false
+     */
+    boolean isAccountsValid(BaseUserForm baseUserForm);
+}

+ 86 - 0
src/main/java/com/hcloud/microservice/org/service/impl/BaseAuthorizationServiceImpl.java

@@ -0,0 +1,86 @@
+package com.hcloud.microservice.org.service.impl;
+
+import com.github.pagehelper.Page;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.hcloud.microserver.commoncore.base.PageBean;
+import com.hcloud.microserver.commoncore.util.BeanCopyUtil;
+import com.hcloud.microserver.commoncore.util.GetUUID;
+import com.hcloud.microservice.org.bo.BaseAuthBO;
+import com.hcloud.microservice.org.dao.BaseAuthorizationMapper;
+import com.hcloud.microservice.org.facade.entity.BaseAuthorization;
+import com.hcloud.microservice.org.facade.forms.BaseAuthForm;
+import com.hcloud.microservice.org.service.BaseAuthorizationService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+@Service("baseAuthorizationService")
+public class BaseAuthorizationServiceImpl implements BaseAuthorizationService {
+
+    @Resource
+    private BaseAuthorizationMapper baseAuthorizationMapper;
+
+    @Override
+    public int delByPrimaryKey(String guid) {
+        return baseAuthorizationMapper.deleteByPrimaryKey(guid);
+    }
+
+    @Override
+    public int save(BaseAuthorization record) {
+        record.setGuid(GetUUID.getUUID());
+        return baseAuthorizationMapper.insert(record);
+    }
+
+    @Override
+    public int saveSelective(BaseAuthorization record) {
+        record.setGuid(GetUUID.getUUID());
+        return baseAuthorizationMapper.insertSelective(record);
+    }
+
+    @Override
+    public BaseAuthorization queryByPrimaryKey(String guid) {
+        return baseAuthorizationMapper.selectByPrimaryKey(guid);
+    }
+
+    @Override
+    public int modifyByPrimaryKeySelective(BaseAuthorization record) {
+        return baseAuthorizationMapper.updateByPrimaryKeySelective(record);
+    }
+
+    @Override
+    public int modifyByPrimaryKeyWithBLOBs(BaseAuthorization record) {
+        return 0;
+    }
+
+    @Override
+    public int modifyByPrimaryKey(BaseAuthorization record) {
+        return baseAuthorizationMapper.updateByPrimaryKey(record);
+    }
+
+    /**
+     * 分页查询权限信息
+     *
+     * @param baseAuthForm 页面交互信息
+     * @return 权限分页信息
+     */
+    @Override
+    public PageInfo searchBaseAuthInfoByPage(BaseAuthForm baseAuthForm) {
+        PageBean pageBean = new PageBean(baseAuthForm);
+        PageHelper.offsetPage(baseAuthForm.getPageNo(),baseAuthForm.getPageSize());
+        Page<BaseAuthBO> page =  baseAuthorizationMapper.searchBaseAuthInfoByPage(pageBean);
+        List<BaseAuthForm> list = BeanCopyUtil.convertList(page,BaseAuthForm.class);
+        return new PageInfo(list);
+    }
+
+    /**
+     * 查询菜单权限信息(存在url地址的权限)
+     *
+     * @return
+     */
+    @Override
+    public List<BaseAuthBO> searchMenuAuthInfo() {
+        return baseAuthorizationMapper.searchMenuAuthInfo();
+    }
+}

+ 102 - 0
src/main/java/com/hcloud/microservice/org/service/impl/BaseOrgAuthorizationServiceImpl.java

@@ -0,0 +1,102 @@
+package com.hcloud.microservice.org.service.impl;
+
+import com.github.pagehelper.Page;
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+
+import com.hcloud.microserver.commoncore.base.PageBean;
+import com.hcloud.microserver.commoncore.util.GetUUID;
+import com.hcloud.microservice.org.bo.BaseOrgAuthBO;
+import com.hcloud.microservice.org.dao.BaseOrgAuthorizationMapper;
+import com.hcloud.microservice.org.facade.entity.BaseOrgAuthorization;
+import com.hcloud.microservice.org.facade.forms.BaseOrgAuthForm;
+import com.hcloud.microservice.org.service.BaseOrgAuthorizationService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+@Service("baseOrgAuthorizationService")
+public class BaseOrgAuthorizationServiceImpl implements BaseOrgAuthorizationService {
+
+    @Resource
+    private BaseOrgAuthorizationMapper baseOrgAuthorizationMapper;
+
+    @Override
+    public int delByPrimaryKey(String guid) {
+        return baseOrgAuthorizationMapper.deleteByPrimaryKey(guid);
+    }
+
+    @Override
+    public int save(BaseOrgAuthorization record) {
+        record.setGuid(GetUUID.getUUID());
+        return baseOrgAuthorizationMapper.insert(record);
+    }
+
+    @Override
+    public int saveSelective(BaseOrgAuthorization record) {
+        return baseOrgAuthorizationMapper.insertSelective(record);
+    }
+
+    @Override
+    public BaseOrgAuthorization queryByPrimaryKey(String guid) {
+        return baseOrgAuthorizationMapper.selectByPrimaryKey(guid);
+    }
+
+    @Override
+    public int modifyByPrimaryKeySelective(BaseOrgAuthorization record) {
+        return baseOrgAuthorizationMapper.updateByPrimaryKeySelective(record);
+    }
+
+    @Override
+    public int modifyByPrimaryKeyWithBLOBs(BaseOrgAuthorization record) {
+        return 0;
+    }
+
+    @Override
+    public int modifyByPrimaryKey(BaseOrgAuthorization record) {
+        return baseOrgAuthorizationMapper.updateByPrimaryKey(record);
+    }
+
+    /**
+     * 批量插入机构权限信息
+     *
+     * @param listForm
+     * @return
+     */
+    @Override
+    public int batchOrgAuthInfo(List<BaseOrgAuthForm> listForm,String orgGuid) {
+        if(listForm.size()>0){
+            baseOrgAuthorizationMapper.delOrgAuthInfoByOrgId(orgGuid);
+        }
+        return baseOrgAuthorizationMapper.batchOrgAuthInfo(listForm);
+    }
+
+    /**
+     * 通过机构id查询机构权限
+     *
+     * @param baseOrgAuthForm
+     * @return
+     */
+    @Override
+    public PageInfo searchOrgAuthInfoByOrgId(BaseOrgAuthForm baseOrgAuthForm) {
+        PageBean pageBean = new PageBean(baseOrgAuthForm);
+        PageHelper.startPage(baseOrgAuthForm.getPageNo(),baseOrgAuthForm.getPageSize());
+        List<BaseOrgAuthBO> page = baseOrgAuthorizationMapper.searchOrgAuthInfoByOrgId(pageBean);
+        return new PageInfo(page);
+    }
+
+    /**
+     * 为机构权限分配查询机构所有权限
+     *
+     * @param orgGuid
+     * @return
+     */
+    @Override
+    public List<BaseOrgAuthBO> searchAllOrgAuthInfoForOrg(String orgGuid) {
+        BaseOrgAuthForm baseOrgAuthForm = new BaseOrgAuthForm();
+        baseOrgAuthForm.setFkOrgGuid(orgGuid);
+        return baseOrgAuthorizationMapper.searchOrgAuthInfoByOrgId(new PageBean(baseOrgAuthForm));
+    }
+}

+ 136 - 0
src/main/java/com/hcloud/microservice/org/service/impl/BaseOrgServiceImpl.java

@@ -0,0 +1,136 @@
+package com.hcloud.microservice.org.service.impl;
+
+import com.github.pagehelper.Page;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.hcloud.microserver.commoncore.base.PageBean;
+import com.hcloud.microserver.commoncore.util.GetUUID;
+import com.hcloud.microservice.org.bo.BaseAuthBO;
+import com.hcloud.microservice.org.dao.BaseAuthorizationMapper;
+import com.hcloud.microservice.org.dao.BaseOrgAuthorizationMapper;
+import com.hcloud.microservice.org.dao.BaseOrgMapper;
+import com.hcloud.microservice.org.facade.entity.BaseOrg;
+import com.hcloud.microservice.org.facade.forms.BaseOrgAuthForm;
+import com.hcloud.microservice.org.facade.forms.BaseOrgForm;
+import com.hcloud.microservice.org.service.BaseOrgService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
+@Slf4j
+@Service("baseOrgService")
+public class BaseOrgServiceImpl implements BaseOrgService {
+
+    @Resource
+    private BaseOrgMapper baseOrgMapper;
+
+    @Resource
+    private BaseOrgAuthorizationMapper baseOrgAuthorizationMapper;
+
+    @Resource
+    private BaseAuthorizationMapper baseAuthorizationMapper;
+
+    @Override
+    public int delByPrimaryKey(String guid) {
+        return baseOrgMapper.deleteByPrimaryKey(guid);
+    }
+
+    @Override
+    public int save(BaseOrg record) {
+        record.setGuid(GetUUID.getUUID());
+        return baseOrgMapper.insert(record);
+    }
+
+    @Override
+    public int saveSelective(BaseOrg record) {
+        record.setGuid(GetUUID.getUUID());
+        return baseOrgMapper.insertSelective(record);
+    }
+
+    @Override
+    public BaseOrg queryByPrimaryKey(String guid) {
+        return baseOrgMapper.selectByPrimaryKey(guid);
+    }
+
+    @Override
+    public int modifyByPrimaryKeySelective(BaseOrg record) {
+        return baseOrgMapper.updateByPrimaryKeySelective(record);
+    }
+
+    @Override
+    public int modifyByPrimaryKeyWithBLOBs(BaseOrg record) {
+        return 0;
+    }
+
+    @Override
+    public int modifyByPrimaryKey(BaseOrg record) {
+        return baseOrgMapper.updateByPrimaryKey(record);
+    }
+
+    /**
+     * 分页查询机构信息
+     *
+     * @param baseOrgForm
+     * @return
+     */
+    @Override
+    public PageInfo searchOrgInfoByPage(BaseOrgForm baseOrgForm) {
+        PageBean pageBean = new PageBean(baseOrgForm);
+        PageHelper.startPage(baseOrgForm.getPageNo(),baseOrgForm.getPageSize());
+        Page<BaseOrg> page =  baseOrgMapper.searchOrgInfoByPage(pageBean);
+        return new PageInfo(page);
+    }
+
+    /**
+     * 机构管理查询中查询机构权限
+     *
+     * @param orgGuid
+     * @return
+     */
+    @Override
+    public List<BaseOrgAuthForm> searchAllOrgAuthInfo(String orgGuid) {
+        List<BaseOrgAuthForm> resultList = new ArrayList<>();
+        //TODO 基础权限信息
+        Page<BaseAuthBO> page = baseAuthorizationMapper.searchAllBaseAuthInfo();
+        //TODO 机构权限标记
+        List<String> orgList = baseOrgAuthorizationMapper.searchOrgAuthStringByOrgId(orgGuid);
+        //TODO 处理权限信息
+        if(null!= page && page.size()>0){
+            for (BaseAuthBO bo:page) {
+                String authGuid = bo.getGuid();
+                BaseOrgAuthForm baseOrgAuthForm = new BaseOrgAuthForm();
+                baseOrgAuthForm.setId(authGuid);
+                baseOrgAuthForm.setFkProductGuid(bo.getFkProductGuid());
+                baseOrgAuthForm.setFkOrgGuid(orgGuid);
+                baseOrgAuthForm.setParentGuid(bo.getParentGuid());
+                baseOrgAuthForm.setFkAuthGuid(bo.getGuid());
+                baseOrgAuthForm.setFunName(bo.getFunName());
+                baseOrgAuthForm.setAuthStr(bo.getAuthStr());
+                baseOrgAuthForm.setFileUrl(bo.getFileUrl());
+                baseOrgAuthForm.setIco(bo.getIco());
+                baseOrgAuthForm.setOrderby(bo.getOrderby());
+                baseOrgAuthForm.setNodeType(bo.getNodeType());
+                baseOrgAuthForm.setIsForbid(bo.getIsForbid());
+                if(orgList.contains(authGuid)){
+                    log.info("funName===========================>{}",bo.getFunName());
+                    baseOrgAuthForm.setIsChecked(1);
+                }
+                resultList.add(baseOrgAuthForm);
+            }
+        }
+        return resultList;
+    }
+
+    /**
+     * 获取机构菜单权限
+     *
+     * @param OrgGuid
+     * @return
+     */
+    @Override
+    public List<BaseOrgAuthForm> searchMenuAuthInfo(String OrgGuid) {
+        return null;
+    }
+}

+ 92 - 0
src/main/java/com/hcloud/microservice/org/service/impl/BasePositionServiceImpl.java

@@ -0,0 +1,92 @@
+package com.hcloud.microservice.org.service.impl;
+
+import com.google.common.collect.Lists;
+import com.hcloud.microserver.commoncore.util.BeanCopyUtil;
+import com.hcloud.microservice.org.dao.BasePositionMapper;
+import com.hcloud.microservice.org.facade.entity.BasePosition;
+import com.hcloud.microservice.org.facade.forms.BasePositionForm;
+import com.hcloud.microservice.org.service.BasePositionService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * @author xiezt
+ */
+@Slf4j
+@Service("basePositionService")
+public class BasePositionServiceImpl implements BasePositionService {
+
+
+    @Resource
+    private BasePositionMapper basePositionMapper;
+
+    /**
+     * 通过编码查询区域信息
+     *
+     * @param code
+     * @return
+     */
+    @Override
+    public BasePositionForm getBasePositionByCode(String code) {
+        BasePositionForm basePositionForm = new BasePositionForm();
+        BasePosition basePosition = basePositionMapper.getBasePositionByCode(code);
+        if(null!= basePosition){
+            BeanCopyUtil.copyBean(basePosition,basePosition);
+        }
+        return basePositionForm;
+    }
+
+    /**
+     * 通过父编码查询区域信息
+     *
+     * @param parentCode
+     * @return
+     */
+    @Override
+    public List<BasePositionForm> getBasePositionByParentCode(String parentCode) {
+        List<BasePositionForm> resultList = Lists.newArrayList();
+        List<BasePosition> basePositionList = basePositionMapper.getBasePositionByParentCode(parentCode);
+        if(null!= basePositionList && basePositionList.size()>0){
+            resultList = BeanCopyUtil.convertList(basePositionList,BasePositionForm.class);
+        }
+        return resultList;
+    }
+
+    @Override
+    public int delByPrimaryKey(Integer guid) {
+        return 0;
+    }
+
+    @Override
+    public int save(BasePosition record) {
+        return 0;
+    }
+
+    @Override
+    public int saveSelective(BasePosition record) {
+        return 0;
+    }
+
+    @Override
+    public BasePosition queryByPrimaryKey(Integer guid) {
+        return null;
+    }
+
+    @Override
+    public int modifyByPrimaryKeySelective(BasePosition record) {
+        return 0;
+    }
+
+    @Override
+    public int modifyByPrimaryKeyWithBLOBs(BasePosition record) {
+        return 0;
+    }
+
+    @Override
+    public int modifyByPrimaryKey(BasePosition record) {
+        return 0;
+    }
+}

+ 224 - 0
src/main/java/com/hcloud/microservice/org/service/impl/BaseRoleServiceImpl.java

@@ -0,0 +1,224 @@
+package com.hcloud.microservice.org.service.impl;
+
+import com.github.pagehelper.Page;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.google.common.collect.Lists;
+import com.hcloud.microserver.commoncore.base.PageBean;
+import com.hcloud.microserver.commoncore.constant.GlobleConstant;
+import com.hcloud.microserver.commoncore.util.GetUUID;
+import com.hcloud.microservice.org.bo.BaseOrgAuthBO;
+import com.hcloud.microservice.org.bo.BaseRoleAuthBO;
+import com.hcloud.microservice.org.bo.BaseRoleUserBO;
+import com.hcloud.microservice.org.dao.BaseOrgAuthorizationMapper;
+import com.hcloud.microservice.org.dao.BaseRoleAuthorizationMapper;
+import com.hcloud.microservice.org.dao.BaseRoleMapper;
+import com.hcloud.microservice.org.dao.BaseUserMapper;
+import com.hcloud.microservice.org.facade.entity.BaseOrgAuthorization;
+import com.hcloud.microservice.org.facade.entity.BaseRole;
+import com.hcloud.microservice.org.facade.forms.BaseRoleAuthForm;
+import com.hcloud.microservice.org.facade.forms.BaseRoleForm;
+import com.hcloud.microservice.org.facade.forms.BaseUserAuthForm;
+import com.hcloud.microservice.org.service.BaseRoleService;
+import com.hcloud.microservice.org.service.BaseUserService;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author xiezt
+ */
+@Service("baseRoleService")
+public class BaseRoleServiceImpl implements BaseRoleService {
+
+    @Resource
+    private BaseRoleMapper baseRoleMapper;
+
+    @Resource
+    private BaseRoleAuthorizationMapper baseRoleAuthorizationMapper;
+
+    @Resource
+    private BaseOrgAuthorizationMapper baseOrgAuthorizationMapper;
+
+    @Autowired
+    private BaseUserService baseUserService;
+
+    @Override
+    public int delByPrimaryKey(String guid) {
+        return baseRoleMapper.deleteByPrimaryKey(guid);
+    }
+
+    @Override
+    public int save(BaseRole record) {
+        record.setGuid(GetUUID.getUUID());
+        return baseRoleMapper.insert(record);
+    }
+
+    @Override
+    public int saveSelective(BaseRole record) {
+        record.setGuid(GetUUID.getUUID());
+        return baseRoleMapper.insertSelective(record);
+    }
+
+    @Override
+    public BaseRole queryByPrimaryKey(String guid) {
+        return baseRoleMapper.selectByPrimaryKey(guid);
+    }
+
+    @Override
+    public int modifyByPrimaryKeySelective(BaseRole record) {
+        return baseRoleMapper.updateByPrimaryKeySelective(record);
+    }
+
+    @Override
+    public int modifyByPrimaryKeyWithBLOBs(BaseRole record) {
+        return 0;
+    }
+
+    @Override
+    public int modifyByPrimaryKey(BaseRole record) {
+        return baseRoleMapper.updateByPrimaryKey(record);
+    }
+
+    /**
+     * 分页查询角色信息
+     *
+     * @param baseRoleForm
+     * @return
+     */
+    @Override
+    public PageInfo searchRoleInfoByPage(BaseRoleForm baseRoleForm) {
+        PageBean pageBean = new PageBean(baseRoleForm);
+        PageHelper.startPage(baseRoleForm.getPageNo(),baseRoleForm.getPageSize());
+        Page<BaseRole> page =  baseRoleMapper.searchRoleInfoByPage(pageBean);
+        return new PageInfo(page);
+    }
+
+    /**
+     * 批量插入角色权限信息
+     *
+     * @param formsList
+     * @return
+     */
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public int batchSaveRoleAuthInfo(List<BaseRoleAuthForm> formsList,String roleId,String orgGuid) {
+        List<BaseRoleAuthForm> insertList = Lists.newArrayList();
+        if(formsList.size()>0){
+            baseRoleAuthorizationMapper.delRoleAuthByRoleId(roleId,orgGuid);
+            for(BaseRoleAuthForm bean:formsList){
+                BaseRoleAuthForm authForm = new BaseRoleAuthForm();
+                authForm.setFkOrgGuid(bean.getFkOrgGuid());
+                authForm.setFkProductGuid(bean.getFkProductGuid());
+                authForm.setFkRoleGuid(roleId);
+                authForm.setFkAuthGuid(bean.getId());
+                insertList.add(authForm);
+            }
+        }
+        int i = baseRoleAuthorizationMapper.batchSaveRoleAuthInfo(insertList);
+        if(i>0){
+            //TODO 查询角色对应用户,更新用户权限
+            List<BaseRoleUserBO> userList = baseRoleMapper.searchUserInfoByRoleId(roleId);
+            if(null!=userList && userList.size()>0){
+                for (BaseRoleUserBO bean:userList) {
+                    List<BaseUserAuthForm> userAuthFormList = getUserAuthInfo(bean.getUserId(),insertList);
+                    baseUserService.batchSaveUserAuthInfo(bean.getUserId(),bean.getFkOrgGuid(),userAuthFormList);
+                }
+            }
+
+        }
+        return i;
+    }
+
+    private List<BaseUserAuthForm> getUserAuthInfo(String userId,List<BaseRoleAuthForm> insertList){
+        if(null!=insertList && insertList.size()>0){
+            List<BaseUserAuthForm> list = Lists.newArrayList();
+            for (BaseRoleAuthForm bean:insertList) {
+                BaseUserAuthForm tmp = new BaseUserAuthForm();
+                tmp.setFkOrgGuid(bean.getFkOrgGuid());
+                tmp.setFkUserGuid(userId);
+                tmp.setFkProductGuid(GlobleConstant.PRODUCT_GUID);
+                tmp.setId(bean.getFkAuthGuid());
+                list.add(tmp);
+            }
+            return list;
+        }
+        return null;
+    }
+
+
+    /**
+     * 通过角色Id删除角色权限信息
+     *
+     * @param roleId
+     * @param orgGuid
+     * @return
+     */
+    @Override
+    public int delRoleAuthInfoByRoleId(String roleId, String orgGuid) {
+        return baseRoleAuthorizationMapper.delRoleAuthByRoleId(roleId,orgGuid);
+    }
+
+    /**
+     * 查询机构权限信息
+     *
+     * @param roleId
+     * @param orgGuid
+     * @return
+     */
+    @Override
+    public List<BaseRoleAuthForm> searchRoleAuthInfo(String roleId, String orgGuid) {
+        List<BaseRoleAuthForm> resultList = new ArrayList<>();
+        //TODO 查询机构权限信息
+        List<BaseOrgAuthBO> orgAuthList = baseOrgAuthorizationMapper.searchAllOrgAuthInfo(orgGuid);
+        //TODO 查询角色权限信息
+        List<String> list = baseRoleAuthorizationMapper.searchRoleAuthByRoleId(roleId,orgGuid);
+        if(null!=orgAuthList && orgAuthList.size()>0){
+            for (BaseOrgAuthBO bo:orgAuthList) {
+                String authStr = bo.getId();
+                BaseRoleAuthForm baseRoleAuthForm = new BaseRoleAuthForm();
+                BeanUtils.copyProperties(bo,baseRoleAuthForm);
+                if(list.contains(authStr)){
+                    baseRoleAuthForm.setIsChecked(1);
+                }else{
+                    baseRoleAuthForm.setIsChecked(0);
+                }
+                resultList.add(baseRoleAuthForm);
+            }
+        }
+        return resultList;
+    }
+
+    /**
+     * 查询角色机构信息(不与机构权限信息比对)
+     *
+     * @param roleId
+     * @param orgGuid
+     * @return
+     */
+    @Override
+    public List<BaseRoleAuthForm> searchOnlyRoleAuthInfo(String roleId, String orgGuid) {
+        List<BaseRoleAuthForm> resultList = new ArrayList<>();
+        //TODO 查询机构权限信息
+        List<BaseOrgAuthBO> orgAuthList = baseOrgAuthorizationMapper.searchAllOrgAuthInfo(orgGuid);
+        //TODO 查询角色权限信息
+        List<String> list = baseRoleAuthorizationMapper.searchRoleAuthByRoleId(roleId,orgGuid);
+        if(null!=orgAuthList && orgAuthList.size()>0){
+            for (BaseOrgAuthBO bo:orgAuthList) {
+                String authStr = bo.getId();
+                if(list.contains(authStr)){
+                    BaseRoleAuthForm baseRoleAuthForm = new BaseRoleAuthForm();
+                    BeanUtils.copyProperties(bo,baseRoleAuthForm);
+                    resultList.add(baseRoleAuthForm);
+                }
+            }
+        }
+        return resultList;
+    }
+
+}

+ 487 - 0
src/main/java/com/hcloud/microservice/org/service/impl/BaseUserServiceImpl.java

@@ -0,0 +1,487 @@
+package com.hcloud.microservice.org.service.impl;
+
+import com.github.pagehelper.Page;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.google.common.collect.Lists;
+import com.hcloud.microserver.commoncore.base.PageBean;
+import com.hcloud.microserver.commoncore.constant.GlobleConstant;
+import com.hcloud.microserver.commoncore.enums.ResultEnum;
+import com.hcloud.microserver.commoncore.util.BeanCopyUtil;
+import com.hcloud.microserver.commoncore.util.GetUUID;
+import com.hcloud.microserver.commoncore.util.Md5Util;
+import com.hcloud.microserver.commoncore.util.string.StringUtils;
+import com.hcloud.microservice.org.bo.BaseOrgAuthBO;
+import com.hcloud.microservice.org.bo.BaseRoleUserBO;
+import com.hcloud.microservice.org.bo.BaseUserBO;
+import com.hcloud.microservice.org.dao.BaseOrgAuthorizationMapper;
+import com.hcloud.microservice.org.dao.BaseRoleUserMapper;
+import com.hcloud.microservice.org.dao.BaseUserAuthorizationMapper;
+import com.hcloud.microservice.org.dao.BaseUserMapper;
+import com.hcloud.microservice.org.facade.entity.BaseRole;
+import com.hcloud.microservice.org.facade.entity.BaseRoleUser;
+import com.hcloud.microservice.org.facade.entity.BaseUser;
+import com.hcloud.microservice.org.facade.forms.BaseRoleAuthForm;
+import com.hcloud.microservice.org.facade.forms.BaseRoleUserForm;
+import com.hcloud.microservice.org.facade.forms.BaseUserAuthForm;
+import com.hcloud.microservice.org.facade.forms.BaseUserForm;
+import com.hcloud.microservice.org.service.BaseRoleService;
+import com.hcloud.microservice.org.service.BaseUserService;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.net.util.Base64;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.io.UnsupportedEncodingException;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author xiezt
+ */
+@Slf4j
+@Service("baseUserService")
+public class BaseUserServiceImpl implements BaseUserService {
+
+
+    /**
+     * 角色未分配权限
+     */
+    private static final int SPECIAL_VAL=-2;
+
+    @Resource
+    private BaseUserMapper baseUserMapper;
+
+    @Resource
+    private BaseUserAuthorizationMapper baseUserAuthorizationMapper;
+
+    @Resource
+    private BaseRoleUserMapper baseRoleUserMapper;
+
+    @Resource
+    private BaseOrgAuthorizationMapper baseOrgAuthorizationMapper;
+
+    @Autowired
+    private BaseRoleService baseRoleService;
+
+    @Override
+    public int delByPrimaryKey(String guid) {
+        return baseUserMapper.deleteByPrimaryKey(guid);
+    }
+
+    @Override
+    public int save(BaseUser record) {
+        String mingPWD = record.getPasswd();
+        if(mingPWD!=null && !"".equals(mingPWD)){
+//            String pwd = checkoutPwd(mingPWD);
+//            record.setPasswd(Md5Util.md5(pwd));
+            record.setPasswd(Md5Util.md5(mingPWD));
+        }
+        record.setGuid(GetUUID.getUUID());
+        return baseUserMapper.insert(record);
+    }
+
+    @Override
+    public int saveSelective(BaseUser record) {
+        String mingPWD = record.getPasswd();
+        if(mingPWD!=null && !"".equals(mingPWD)){
+//            String pwd = checkoutPwd(mingPWD);
+//            record.setPasswd(Md5Util.md5(pwd));
+            record.setPasswd(Md5Util.md5(mingPWD));
+        }
+        record.setGuid(GetUUID.getUUID());
+        return baseUserMapper.insertSelective(record);
+    }
+
+    @Override
+    public BaseUser queryByPrimaryKey(String guid) {
+        return baseUserMapper.selectByPrimaryKey(guid);
+    }
+
+    @Override
+    public int modifyByPrimaryKeySelective(BaseUser record) {
+        log.info("BaseUser====================>{}",record);
+        String mingPWD = record.getPasswd();
+        if(mingPWD!=null && !"".equals(mingPWD)){
+//            String pwd = checkoutPwd(mingPWD);
+//            record.setPasswd(Md5Util.md5(pwd));
+            record.setPasswd(Md5Util.md5(mingPWD));
+        }
+        return baseUserMapper.updateByPrimaryKeySelective(record);
+    }
+
+    @Override
+    public int modifyByPrimaryKeyWithBLOBs(BaseUser record) {
+        //TODO empty implements
+        return 0;
+    }
+
+    @Override
+    public int modifyByPrimaryKey(BaseUser record) {
+        return baseUserMapper.updateByPrimaryKey(record);
+    }
+
+    /**
+     * 批量插入用户权限信息
+     *
+     * @param list
+     * @return
+     */
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public int batchSaveUserAuthInfo(String userId,String orgGuid,List<BaseUserAuthForm> list) {
+        List<BaseUserAuthForm> insertList = Lists.newArrayList();
+        if(null!=list && list.size()>0) {
+            baseUserAuthorizationMapper.delUserAuthInfoByUserId(userId, orgGuid);
+            for (BaseUserAuthForm bean : list) {
+                BaseUserAuthForm tmp = new BaseUserAuthForm();
+                BeanCopyUtil.copyBean(bean, tmp);
+                tmp.setFkAuthGuid(bean.getId());
+                insertList.add(tmp);
+            }
+        }
+        return baseUserAuthorizationMapper.batchSaveUserAuthInfo(insertList);
+    }
+
+    /**
+     * 分页查询用户信息
+     *
+     * @param baseUserForm
+     * @return
+     */
+    @Override
+    public PageInfo searchUserInfoByPage(BaseUserForm baseUserForm) {
+        PageBean pageBean = new PageBean(baseUserForm);
+        PageHelper.startPage(baseUserForm.getPageNo(),baseUserForm.getPageSize());
+        Page<BaseUserBO> page = baseUserMapper.searchUserInfoByPage(pageBean);
+        return new PageInfo(page);
+    }
+
+    /**
+     * 通过用户id查询用户权限信息
+     *
+     * @param userId
+     * @param orgGuid
+     * @return
+     */
+    @Override
+    public List<BaseUserAuthForm> searchUserAuthInfo(String userId, String orgGuid) {
+        List<BaseUserAuthForm> resultList = new ArrayList<>();
+        //TODO 查询系统全部权限
+        List<BaseOrgAuthBO> orgAuthList = baseOrgAuthorizationMapper.searchAllOrgAuthInfo(orgGuid);
+        //TODO 查询用户权限信息
+        List<String> list = baseUserAuthorizationMapper.searchUserAuthInfoByUserId(userId,orgGuid);
+        for (BaseOrgAuthBO bo:orgAuthList) {
+            String authStr = bo.getId();
+            BaseUserAuthForm baseUserAuthForm = new BaseUserAuthForm();
+            BeanUtils.copyProperties(bo,baseUserAuthForm);
+            baseUserAuthForm.setFkUserGuid(userId);
+            if(list.contains(authStr)){
+                baseUserAuthForm.setIsChecked(1);
+            }else{
+                baseUserAuthForm.setIsChecked(0);
+            }
+            resultList.add(baseUserAuthForm);
+        }
+        return resultList;
+    }
+
+    /**
+     * 通过用户id删除用户权限信息
+     *
+     * @param userId
+     * @return
+     */
+    @Override
+    public int delUserAuthInfoByUserId(String userId,String orgGuid) {
+        return baseUserAuthorizationMapper.delUserAuthInfoByUserId(userId,orgGuid);
+    }
+
+    /**
+     * 查询用户角色信息,通过用户查询角色,通过角色查用户
+     *
+     * @param baseRoleUserForm
+     * @return
+     */
+    @Override
+    public PageInfo searchRoleUserInfoById(BaseRoleUserForm baseRoleUserForm) {
+        PageBean pageBean = new PageBean(baseRoleUserForm);
+        PageHelper.startPage(baseRoleUserForm.getPageNo(),baseRoleUserForm.getPageSize());
+        Page<BaseRoleUserBO> page = baseRoleUserMapper.searchRoleUserInfoByPage(pageBean);
+        if(null!=page && page.size()>0){
+            List<BaseRoleUserForm> pages = BeanCopyUtil.convertList(page,BaseRoleUserForm.class);
+            return new PageInfo(pages);
+        }
+        return null;
+    }
+
+    /**
+     * 分配用户角色信息
+     *
+     * @param baseUserForm
+     */
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public void distributionUserAuthInfo(BaseUserForm baseUserForm) {
+        String outRoleId = null;
+        //添加企业信息管理员处理流程
+        if(null!=baseUserForm.getLoginOrgGuid() && !"".equals(baseUserForm.getLoginOrgGuid())){
+            BaseRole role =  baseRoleService.queryByPrimaryKey(baseUserForm.getRoleId());
+            if(role!=null){
+                role.setFkOrgGuid(baseUserForm.getFkOrgGuid());
+                role.setGuid(GetUUID.getUUID());
+                role.setCreateUser(baseUserForm.getCreateUser());
+                role.setCreateTime(new Date());
+                role.setModifiedUser(baseUserForm.getModifiedUser());
+                role.setModifiedTime(new Date());
+                int i = baseRoleService.saveSelective(role);
+                if(i>0){
+                    outRoleId = role.getGuid();
+                }
+            }
+        }
+        //添加普通用户角色关联信息
+        BaseRoleUser baseRoleUser = new BaseRoleUser();
+        baseRoleUser.setGuid(GetUUID.getUUID());
+        //添加企业信息管理员处理流程
+        if(null!=baseUserForm.getLoginOrgGuid() && !"".equals(baseUserForm.getLoginOrgGuid())){
+            baseRoleUser.setFkRoleGuid(outRoleId);
+        }else{
+            baseRoleUser.setFkRoleGuid(baseUserForm.getRoleId());
+        }
+        baseRoleUser.setFkUserGuid(baseUserForm.getGuid());
+        baseRoleUser.setFkOrgGuid(baseUserForm.getFkOrgGuid());
+        baseRoleUser.setFkProductGuid(baseUserForm.getFkProductGuid());
+        baseRoleUserMapper.insertSelective(baseRoleUser);
+        //TODO 添加用户权限信息
+        this.batchSaveUserAuthInfo(baseUserForm.getGuid(),baseUserForm.getFkOrgGuid(),baseUserForm.getAuthList());
+    }
+
+    /**
+     * 查询用户信息
+     *
+     * @param account
+     * @return
+     */
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public BaseUserForm searchUserInfoByAccount(String account,String password) {
+        BaseUserForm resultBean = new BaseUserForm();
+        BaseUser baseUsers =  baseUserMapper.getUserInfoByAccount(account);
+        if(null!=baseUsers){
+            log.info("login password===================>{}",checkoutPwd(password));
+            String loginPwd = checkoutPwd(password);
+            String pwd = Md5Util.md5(loginPwd);
+            Integer isForbid = baseUsers.getIsForbid();
+            if(isForbid==1){
+                resultBean.setResultEnum(ResultEnum.LOGIN_FORBIDED);
+                return resultBean;
+            }
+            if(pwd.equalsIgnoreCase(baseUsers.getPasswd())){
+                BeanCopyUtil.copyBean(baseUsers,resultBean);
+                //TODO 更新登录时间
+                BaseUser baseUser = new BaseUser();
+                baseUser.setGuid(baseUsers.getGuid());
+                baseUser.setFkOrgGuid(baseUsers.getFkOrgGuid());
+                baseUser.setLastLoginTime(new Date());
+                baseUserMapper.updateByPrimaryKeySelective(baseUser);
+                log.info("======================>{}",resultBean);
+                resultBean.setResultEnum(ResultEnum.SUCCESS);
+                return resultBean;
+            }
+            resultBean.setResultEnum(ResultEnum.LOGIN_PWD_MISS);
+            return resultBean;
+        }
+        resultBean.setResultEnum(ResultEnum.LOGIN_ACCOUNT_MISS);
+        return resultBean;
+    }
+
+    /**
+     * 查询用户菜单信息
+     *
+     * @param userId
+     * @param orgGuid
+     * @return
+     */
+    @Override
+    public List<BaseUserAuthForm> getUserMenusInfo(String userId, String orgGuid) {
+        List<BaseUserAuthForm> resultList = Lists.newArrayList();
+        List<BaseUserAuthForm> tmpList = this.searchUserAuthInfo(userId,orgGuid);
+        if(null!=tmpList && tmpList.size()>0){
+            for (BaseUserAuthForm bean:tmpList) {
+                if(bean.getNodeType()==0){
+                    resultList.add(bean);
+                }
+            }
+        }
+        return resultList;
+    }
+
+    /**
+     * 查询功能权限通过菜单权限
+     *
+     * @param userId
+     * @param orgGuid
+     * @param authId
+     * @return
+     */
+    @Override
+    public List<BaseUserAuthForm> getSubAuthById(String userId, String orgGuid, String authId) {
+        List<BaseUserAuthForm> resultList = Lists.newArrayList();
+        List<BaseUserAuthForm> tmpList = this.searchUserAuthInfo(userId,orgGuid);
+        if(null!=tmpList && tmpList.size()>0){
+            for (BaseUserAuthForm bean:tmpList) {
+                if(authId.equals(bean.getParentGuid()) && bean.getIsChecked()==1){
+                    resultList.add(bean);
+                }
+            }
+        }
+        return resultList;
+    }
+
+    /**
+     * 查询重复用户信息
+     *
+     * @param account
+     * @return
+     */
+    @Override
+    public boolean searchRepeatUserInfo(String account) {
+        BaseUserForm baseUserForm = new BaseUserForm();
+        baseUserForm.setAccount(account);
+        PageBean pageBean = new PageBean(baseUserForm);
+        Page<BaseUserBO> page = baseUserMapper.searchUserInfoByPage(pageBean);
+        if(null!=page && page.size()>0){
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * 新增用户信息(包含用户属于哪个角色,用户拥有的权限)
+     *
+     * @param baseUserForm
+     * @return
+     */
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public int addUserInfoForAll(BaseUserForm baseUserForm) {
+        if(null!=baseUserForm){
+            //TODO 添加用户信息
+            String orgGuid = baseUserForm.getFkOrgGuid();
+            String roleId = baseUserForm.getRoleId();
+            String loginOrgGuid = baseUserForm.getLoginOrgGuid();
+            //初始化企业管理员用户信息
+            if(null!=loginOrgGuid && !"".equals(loginOrgGuid)){
+                orgGuid = loginOrgGuid;
+            }
+            List<BaseRoleAuthForm> roleAuthList = baseRoleService.searchOnlyRoleAuthInfo(roleId,orgGuid);
+            if(roleAuthList==null || roleAuthList.size()==0){return SPECIAL_VAL;}
+            BaseUser baseUser = new BaseUser();
+            BeanUtils.copyProperties(baseUserForm,baseUser);
+            int i = this.saveSelective(baseUser);
+            //TODO 添加用户角色关系,并添加用户权限信息
+            if(i>0){
+                String guid = baseUser.getGuid();
+                if(roleId!=null){
+                    //TODO 添加用户权限
+                    List<BaseUserAuthForm> userAuthList = BeanCopyUtil.convertList(roleAuthList,BaseUserAuthForm.class);
+                    //添加企业管理员用户
+                    if(null!=loginOrgGuid && !"".equals(loginOrgGuid)){
+                        for (BaseUserAuthForm bean:userAuthList) {
+                            bean.setFkOrgGuid(baseUserForm.getFkOrgGuid());
+                        }
+                    }
+                    //TODO 添加用户Guid
+                    for (BaseUserAuthForm bo: userAuthList) {
+                        bo.setFkUserGuid(guid);
+                    }
+                    baseUserForm.setGuid(guid);
+                    baseUserForm.setFkProductGuid(GlobleConstant.PRODUCT_GUID);
+                    baseUserForm.setAuthList(userAuthList);
+                    this.distributionUserAuthInfo(baseUserForm);
+                }
+               return 1;
+            }
+        }
+        return 0;
+    }
+
+    /**
+     * 修改用户信息(包含用户属于哪个角色,用户拥有的权限)
+     *
+     * @param baseUserForm
+     * @return
+     */
+    @Override
+    public int modifyUserInfoForAll(BaseUserForm baseUserForm) {
+        if(null!=baseUserForm){
+            //TODO 修改用户信息
+            BaseUser baseUser = new BaseUser();
+            BeanUtils.copyProperties(baseUserForm,baseUser);
+            int i = this.modifyByPrimaryKeySelective(baseUser);
+            if(i>0){
+                //TODO 更新用户角色关系
+                String userId = baseUserForm.getGuid();
+                String roleId = baseUserForm.getRoleId();
+                String orgGuid = baseUserForm.getFkOrgGuid();
+                baseRoleUserMapper.delRoleUserInfoByUserId(userId,orgGuid);
+                //TODO 添加用户权限
+                List<BaseRoleAuthForm> roleAuthList = baseRoleService.searchOnlyRoleAuthInfo(roleId,orgGuid);
+                List<BaseUserAuthForm> userAuthList = BeanCopyUtil.convertList(roleAuthList,BaseUserAuthForm.class);
+                //TODO 添加用户Guid
+                for (BaseUserAuthForm bo: userAuthList) {
+                    bo.setFkUserGuid(userId);
+                }
+                baseUserForm.setFkProductGuid(GlobleConstant.PRODUCT_GUID);
+                baseUserForm.setAuthList(userAuthList);
+                this.distributionUserAuthInfo(baseUserForm);
+                return 1;
+            }
+        }
+        return 0;
+    }
+
+    /**
+     * 查看用户账户是否有重复的
+     * @param baseUserForm
+     * @return
+     */
+    @Override
+    public boolean isAccountsValid(BaseUserForm baseUserForm) {
+        if(null!=baseUserForm && StringUtils.isNotEmpty(baseUserForm.getAccount())){
+            BaseUser baseUser = this.baseUserMapper.selectAccountNotSelf(baseUserForm);
+            return baseUser != null ? false : true;
+        }
+        return true;
+    }
+
+    /**
+     * 登录解密方式
+     * @param pwd
+     * @return
+     */
+    private String checkoutPwd(String pwd){
+        //需要进行对应的接密操作
+        //1.获取盐值
+        String salt = pwd.substring(0, 5);
+        String key = "b8d11ee289394be688ef3a4f6968efed";
+        String time1 = Md5Util.md5((key).substring(0, 8)).substring(0, 5);
+        //做超时判断
+        if (!time1.equalsIgnoreCase(salt)) {
+            throw new RuntimeException();
+        }
+        //2.去除盐值
+        String replace = pwd.replace(salt, "");
+        //3.还原base64前的密码值
+        try {
+            return new String(Base64.decodeBase64(replace), "utf-8");
+        } catch (UnsupportedEncodingException e) {
+            throw new RuntimeException();
+        }
+    }
+}

+ 87 - 0
src/main/resources/application-dev.properties

@@ -0,0 +1,87 @@
+server.port=21883
+spring.application.name=org-service
+spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
+spring.jackson.time-zone=GMT+8
+## upload files setting
+spring.http.multipart.maxFileSize=10Mb
+spring.http.multipart.maxRequestSize=10Mb
+#img.location=C:/nginx-1.15.2/html/uploadfile/
+#spring.mvc.static-path-pattern=/images/**
+#spring.resources.static-locations=file:${img.location}
+
+#mysql datasource setting
+spring.datasource.driver-class-name=com.mysql.jdbc.Driver
+spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
+spring.datasource.url=jdbc:mysql://localhost:3306/traced_source?characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&autoReconnect=true&useSSL=false&&allowMultiQueries=true
+#spring.datasource.url=jdbc:mysql://localhost:3306/traced_source?characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull
+spring.datasource.username=root
+spring.datasource.password=123456
+#spring.datasource.password=root
+spring.datasource.initialSize=5
+spring.datasource.minIdle=5
+spring.datasource.maxActive=20
+spring.datasource.maxWait=60000
+spring.datasource.timeBetweenEvictionRunsMillis=60000
+spring.datasource.minEvictableIdleTimeMillis=30000
+spring.datasource.validationQuery=SELECT 1
+spring.datasource.testWhileIdle=true
+spring.datasource.testOnBorrow=false
+spring.datasource.testOnReturn=false
+spring.datasource.poolPreparedStatements=true
+spring.datasource.maxPoolPreparedStatementPerConnectionSize=20
+spring.datasource.filters=stat,wall
+spring.datasource.connectionProperties=druid.stat.mergeSql=true;druid.stat.slowSqlMillis=2000
+#mybatis setting
+mybatis.type-aliases-package=com.hcloud.microservice.org.facade.entity
+mybatis.mapper-locations=classpath:mappers/*.xml
+mybatis.check-config-location=true
+mybatis.executor-type=simple
+
+#pagehelper setting
+pagehelper.helperDialect=mysql
+pagehelper.reasonable=true
+pagehelper.supportMethodsArguments=true
+pagehelper.params=count=countSql
+
+
+#zuul timeout setting
+zuul.host.connect-timeout-millis=10000
+zuul.host.socket-timeout-millis=10000
+
+feign.hystrix.enabled=true
+#feign调用默认是1000毫秒=1秒   应该设置成更长时间1000 * 60 * 5  = 5分钟  add by six-vision
+hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=300000
+hystrix.command.default.circuitBreaker.sleepWindowInMilliseconds=300000
+hystrix.command.default.circuitBreaker.forceClosed=true
+#hystrix.command.default.execution.timeout.enabled=false
+#请求处理的超时时间  add by six-vision
+ribbon.ReadTimeout=300000
+ribbon.SocketTimeout=300000
+#请求连接的超时时间 add by six-vision
+ribbon.ConnectTimeout=30000
+# eureka setting
+eureka.instance.hostname=localhost
+eureka.client.service-url.defaultZone=http://localhost:8761/eureka/
+
+###redis配置#########
+spring.redis.database=0
+spring.redis.host=127.0.0.1
+spring.redis.port=6379
+spring.redis.pool.max-idle=8
+spring.redis.pool.min-idle=0
+spring.redis.pool.max-active=10
+spring.redis.pool.max-wait=-1
+spring.redis.timeout=5000
+
+#wechat setting
+#(一个公众号的appid)
+wx.mp.configs.appId=wx04d471b59982c6ad
+#(公众号的appsecret)
+wx.mp.configs.secret=bd9279851f63af0c67e8bc1ef7e27257
+#(接口配置里的Token值)
+wx.mp.configs.token=123
+#(接口配置里的EncodingAESKey值)
+wx.mp.configs.aesKey=123
+
+
+

+ 93 - 0
src/main/resources/application-pro.properties

@@ -0,0 +1,93 @@
+server.port=21883
+spring.application.name=org-service
+spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
+spring.jackson.time-zone=GMT+8
+## upload files setting
+spring.http.multipart.maxFileSize=10Mb
+spring.http.multipart.maxRequestSize=10Mb
+#img.location=/usr/home/images/
+#spring.mvc.static-path-pattern=/images/**
+#spring.resources.static-locations=file:${img.location}
+
+#mysql datasource setting
+spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
+spring.datasource.url=jdbc:mysql://47.111.224.169:3306/traced_source?characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&autoReconnect=true&useSSL=false&&allowMultiQueries=true
+#spring.datasource.url=jdbc:mysql://localhost:3306/food_security_db?characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull
+spring.datasource.username=trace
+spring.datasource.password=Admin123
+spring.datasource.driver-class-name=com.mysql.jdbc.Driver
+spring.datasource.initialSize=5
+spring.datasource.minIdle=5
+spring.datasource.maxActive=20
+spring.datasource.maxWait=60000
+spring.datasource.timeBetweenEvictionRunsMillis=60000
+spring.datasource.minEvictableIdleTimeMillis=30000
+spring.datasource.validationQuery=SELECT 1
+spring.datasource.testWhileIdle=true
+spring.datasource.testOnBorrow=false
+spring.datasource.testOnReturn=false
+spring.datasource.poolPreparedStatements=true
+spring.datasource.maxPoolPreparedStatementPerConnectionSize=20
+spring.datasource.filters=stat,wall
+spring.datasource.connectionProperties=druid.stat.mergeSql=true;druid.stat.slowSqlMillis=3000
+#mybatis setting
+mybatis.type-aliases-package=com.hcloud.microserver.org.facade.entity
+mybatis.mapper-locations=classpath:mappers/*.xml
+mybatis.check-config-location=true
+mybatis.executor-type=simple
+#pagehelper setting
+pagehelper.helperDialect=mysql
+pagehelper.reasonable=true
+pagehelper.supportMethodsArguments=true
+pagehelper.params=count=countSql
+
+
+# Max number of next servers to retry (excluding the first server)
+system-service.ribbon.MaxAutoRetriesNextServer=1
+
+# Whether all operations can be retried for this client
+system-service.ribbon.OkToRetryOnAllOperations=true
+
+# Interval to refresh the server list from the source
+system-service.ribbon.ServerListRefreshInterval=2000
+
+# Connect timeout used by Apache HttpClient
+system-service.ribbon.ConnectTimeout=50000
+
+# Read timeout used by Apache HttpClient
+system-service.ribbon.ReadTimeout=50000
+#hystix timeout setting
+feign.hystrix.enabled=true
+#feign调用默认是1000毫秒=1秒   应该设置成更长时间1000 * 60 * 5  = 5分钟  add by six-vision
+hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=300000
+hystrix.command.default.circuitBreaker.sleepWindowInMilliseconds=300000
+hystrix.command.default.circuitBreaker.forceClosed=true
+#hystrix.command.default.execution.timeout.enabled=false
+#请求处理的超时时间  add by six-vision
+ribbon.ReadTimeout=300000
+ribbon.SocketTimeout=300000
+#请求连接的超时时间 add by six-vision
+ribbon.ConnectTimeout=30000
+# eureka setting
+eureka.instance.hostname=localhost
+eureka.client.service-url.defaultZone=http://127.0.0.1:8761/eureka/
+
+###redis配置#########
+spring.redis.database=0
+spring.redis.host=127.0.0.1
+spring.redis.port=6379
+spring.redis.pool.max-idle=8
+spring.redis.pool.min-idle=0
+spring.redis.pool.max-active=10
+spring.redis.pool.max-wait=-1
+spring.redis.timeout=5000
+
+#wechat setting
+#(一个公众号的appid)
+wx.mp.configs.appId=wx04d471b59982c6ad
+#(公众号的appsecret)
+wx.mp.configs.secret=bd9279851f63af0c67e8bc1ef7e27257
+#(接口配置里的Token值)
+wx.mp.configs.token=123
+#(接口配置里的EncodingAESKey值)
+wx.mp.configs.aesKey=123

+ 85 - 0
src/main/resources/application-test.properties

@@ -0,0 +1,85 @@
+server.port=21883
+spring.application.name=org-service
+spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
+spring.jackson.time-zone=GMT+8
+## upload files setting
+spring.http.multipart.maxFileSize=10Mb
+spring.http.multipart.maxRequestSize=10Mb
+#img.location=C:/nginx-1.15.2/html/uploadfile/
+#spring.mvc.static-path-pattern=/images/**
+#spring.resources.static-locations=file:${img.location}
+
+#mysql datasource setting
+spring.datasource.driver-class-name=com.mysql.jdbc.Driver
+spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
+#spring.datasource.url=jdbc:mysql://127.0.0.1:3306/traced_source?characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&autoReconnect=true&useSSL=true&&allowMultiQueries=true
+spring.datasource.url=jdbc:mysql://frp.h.gyhywa.com:56524/traced_source?characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&autoReconnect=true&useSSL=false&&allowMultiQueries=true
+#spring.datasource.url=jdbc:mysql://localhost:3306/food_security_db?characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull
+spring.datasource.username=root
+spring.datasource.password=hw123456
+#spring.datasource.password=root
+spring.datasource.initialSize=5
+spring.datasource.minIdle=5
+spring.datasource.maxActive=20
+spring.datasource.maxWait=60000
+spring.datasource.timeBetweenEvictionRunsMillis=60000
+spring.datasource.minEvictableIdleTimeMillis=30000
+spring.datasource.validationQuery=SELECT 1
+spring.datasource.testWhileIdle=true
+spring.datasource.testOnBorrow=false
+spring.datasource.testOnReturn=false
+spring.datasource.poolPreparedStatements=true
+spring.datasource.maxPoolPreparedStatementPerConnectionSize=20
+spring.datasource.filters=stat,wall
+spring.datasource.connectionProperties=druid.stat.mergeSql=true;druid.stat.slowSqlMillis=2000
+#mybatis setting
+mybatis.type-aliases-package=com.hcloud.microservice.org.facade.entity
+mybatis.mapper-locations=classpath:mappers/*.xml
+mybatis.check-config-location=true
+mybatis.executor-type=simple
+
+#pagehelper setting
+pagehelper.helperDialect=mysql
+pagehelper.reasonable=true
+pagehelper.supportMethodsArguments=true
+pagehelper.params=count=countSql
+
+
+#zuul timeout setting
+zuul.host.connect-timeout-millis=10000
+zuul.host.socket-timeout-millis=10000
+
+feign.hystrix.enabled=true
+#feign调用默认是1000毫秒=1秒   应该设置成更长时间1000 * 60 * 5  = 5分钟  add by six-vision
+hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=300000
+hystrix.command.default.circuitBreaker.sleepWindowInMilliseconds=300000
+hystrix.command.default.circuitBreaker.forceClosed=true
+#hystrix.command.default.execution.timeout.enabled=false
+#请求处理的超时时间  add by six-vision
+ribbon.ReadTimeout=300000
+ribbon.SocketTimeout=300000
+#请求连接的超时时间 add by six-vision
+ribbon.ConnectTimeout=30000
+# eureka setting
+eureka.instance.hostname=localhost
+eureka.client.service-url.defaultZone=http://127.0.0.1:8761/eureka/
+
+###redis配置#########
+spring.redis.database=0
+spring.redis.host=127.0.0.1
+spring.redis.port=6379
+spring.redis.pool.max-idle=8
+spring.redis.pool.min-idle=0
+spring.redis.pool.max-active=10
+spring.redis.pool.max-wait=-1
+spring.redis.timeout=5000
+
+#wechat setting
+#(一个公众号的appid)
+wx.mp.configs.appId=wx04d471b59982c6ad
+#(公众号的appsecret)
+wx.mp.configs.secret=bd9279851f63af0c67e8bc1ef7e27257
+#(接口配置里的Token值)
+wx.mp.configs.token=123
+#(接口配置里的EncodingAESKey值)
+wx.mp.configs.aesKey=123

+ 3 - 0
src/main/resources/application.properties

@@ -0,0 +1,3 @@
+spring.profiles.active=pro
+logging.level.com.hcloud=debug
+spring.devtools.restart.enabled=true

+ 39 - 0
src/main/resources/generatorConfig.xml

@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE generatorConfiguration
+        PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
+        "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
+<generatorConfiguration>
+    <context id="DB2Tables" targetRuntime="MyBatis3">
+        <commentGenerator>
+            <property name="suppressDate" value="true"/>
+            <property name="suppressAllComments" value="true"/>
+        </commentGenerator>
+        <!--数据库链接地址账号密码-->
+        <jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://127.0.0.1:3306/smart_store?characterEncoding=UTF-8" userId="root" password="root">
+    </jdbcConnection>
+        <javaTypeResolver>
+            <property name="forceBigDecimals" value="false"/>
+        </javaTypeResolver>
+        <!--生成Model类存放位置-->
+        <javaModelGenerator targetPackage="com.hcloud.microservice.org.entity" targetProject="src/main/java">
+            <property name="enableSubPackages" value="true"/>
+            <property name="trimStrings" value="true"/>
+        </javaModelGenerator>
+        <!--生成映射文件存放位置-->
+        <sqlMapGenerator targetPackage="mappers" targetProject="src/main/resources">
+            <property name="enableSubPackages" value="true"/>
+        </sqlMapGenerator>
+        <!--生成Dao类存放位置-->
+        <!-- 客户端代码,生成易于使用的针对Model对象和XML配置文件 的代码
+                type="ANNOTATEDMAPPER",生成Java Model 和基于注解的Mapper对象
+                type="MIXEDMAPPER",生成基于注解的Java Model 和相应的Mapper对象
+                type="XMLMAPPER",生成SQLMap XML文件和独立的Mapper接口
+        -->
+        <javaClientGenerator type="XMLMAPPER" targetPackage="com.hcloud.microservice.org.dao" targetProject="src/main/java">
+            <property name="enableSubPackages" value="true"/>
+        </javaClientGenerator>
+        <!--生成对应表及类名-->
+        <table tableName="t_base_dictionary"    domainObjectName="BaseDictionary" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
+        <table tableName="t_base_dictionary_type"    domainObjectName="BaseDictionaryType" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
+    </context>
+</generatorConfiguration>

+ 285 - 0
src/main/resources/mappers/BaseAuthorizationMapper.xml

@@ -0,0 +1,285 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.hcloud.microservice.org.dao.BaseAuthorizationMapper">
+  <resultMap id="BaseResultMap" type="com.hcloud.microservice.org.facade.entity.BaseAuthorization">
+    <id column="guid" jdbcType="CHAR" property="guid" />
+    <result column="parent_guid" jdbcType="CHAR" property="parentGuid" />
+    <result column="fk_product_guid" jdbcType="CHAR" property="fkProductGuid" />
+    <result column="fun_name" jdbcType="VARCHAR" property="funName" />
+    <result column="auth_str" jdbcType="VARCHAR" property="authStr" />
+    <result column="file_url" jdbcType="VARCHAR" property="fileUrl" />
+    <result column="ico" jdbcType="VARCHAR" property="ico" />
+    <result column="remark" jdbcType="VARCHAR" property="remark" />
+    <result column="orderby" jdbcType="INTEGER" property="orderby" />
+    <result column="node_type" jdbcType="INTEGER" property="nodeType" />
+    <result column="is_forbid" jdbcType="INTEGER" property="isForbid" />
+    <result column="state" jdbcType="INTEGER" property="state" />
+    <result column="create_user" jdbcType="CHAR" property="createUser" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="modified_user" jdbcType="CHAR" property="modifiedUser" />
+    <result column="modified_time" jdbcType="TIMESTAMP" property="modifiedTime" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    guid, parent_guid, fk_product_guid, fun_name, auth_str, file_url, ico, remark, orderby,
+    node_type,is_forbid, state, create_user, create_time, modified_user, modified_time
+  </sql>
+  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from t_base_authorization
+    where guid = #{guid,jdbcType=CHAR}
+  </select>
+
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+    delete from t_base_authorization
+    where guid = #{guid,jdbcType=CHAR}
+  </delete>
+  <insert id="insert" parameterType="com.hcloud.microservice.org.facade.entity.BaseAuthorization">
+    insert into t_base_authorization (guid, parent_guid, fk_product_guid, 
+      fun_name, auth_str, file_url, 
+      ico, remark, orderby, node_type,
+      is_forbid, state, create_user, 
+      create_time, modified_user, modified_time
+      )
+    values (#{guid,jdbcType=CHAR}, #{parentGuid,jdbcType=CHAR}, #{fkProductGuid,jdbcType=CHAR}, 
+      #{funName,jdbcType=VARCHAR}, #{authStr,jdbcType=VARCHAR}, #{fileUrl,jdbcType=VARCHAR}, 
+      #{ico,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{orderby,jdbcType=INTEGER}, 
+      #{nodeType,jdbcType=INTEGER},#{isForbid,jdbcType=INTEGER}, #{state,jdbcType=INTEGER}, #{createUser,jdbcType=CHAR},
+      #{createTime,jdbcType=TIMESTAMP}, #{modifiedUser,jdbcType=CHAR}, #{modifiedTime,jdbcType=TIMESTAMP}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.hcloud.microservice.org.facade.entity.BaseAuthorization">
+    insert into t_base_authorization
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="guid != null">
+        guid,
+      </if>
+      <if test="parentGuid != null">
+        parent_guid,
+      </if>
+      <if test="fkProductGuid != null">
+        fk_product_guid,
+      </if>
+      <if test="funName != null">
+        fun_name,
+      </if>
+      <if test="authStr != null">
+        auth_str,
+      </if>
+      <if test="fileUrl != null">
+        file_url,
+      </if>
+      <if test="ico != null">
+        ico,
+      </if>
+      <if test="remark != null">
+        remark,
+      </if>
+      <if test="orderby != null">
+        orderby,
+      </if>
+      <if test="nodeType != null">
+        node_type,
+      </if>
+      <if test="isForbid != null">
+        is_forbid,
+      </if>
+      <if test="state != null">
+        state,
+      </if>
+      <if test="createUser != null">
+        create_user,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="modifiedUser != null">
+        modified_user,
+      </if>
+      <if test="modifiedTime != null">
+        modified_time,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="guid != null">
+        #{guid,jdbcType=CHAR},
+      </if>
+      <if test="parentGuid != null">
+        #{parentGuid,jdbcType=CHAR},
+      </if>
+      <if test="fkProductGuid != null">
+        #{fkProductGuid,jdbcType=CHAR},
+      </if>
+      <if test="funName != null">
+        #{funName,jdbcType=VARCHAR},
+      </if>
+      <if test="authStr != null">
+        #{authStr,jdbcType=VARCHAR},
+      </if>
+      <if test="fileUrl != null">
+        #{fileUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="ico != null">
+        #{ico,jdbcType=VARCHAR},
+      </if>
+      <if test="remark != null">
+        #{remark,jdbcType=VARCHAR},
+      </if>
+      <if test="orderby != null">
+        #{orderby,jdbcType=INTEGER},
+      </if>
+      <if test="nodeType != null">
+        #{nodeType,jdbcType=INTEGER},
+      </if>
+      <if test="isForbid != null">
+        #{isForbid,jdbcType=INTEGER},
+      </if>
+      <if test="state != null">
+        #{state,jdbcType=INTEGER},
+      </if>
+      <if test="createUser != null">
+        #{createUser,jdbcType=CHAR},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="modifiedUser != null">
+        #{modifiedUser,jdbcType=CHAR},
+      </if>
+      <if test="modifiedTime != null">
+        #{modifiedTime,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.hcloud.microservice.org.facade.entity.BaseAuthorization">
+    update t_base_authorization
+    <set>
+      <if test="parentGuid != null">
+        parent_guid = #{parentGuid,jdbcType=CHAR},
+      </if>
+      <if test="fkProductGuid != null">
+        fk_product_guid = #{fkProductGuid,jdbcType=CHAR},
+      </if>
+      <if test="funName != null">
+        fun_name = #{funName,jdbcType=VARCHAR},
+      </if>
+      <if test="authStr != null">
+        auth_str = #{authStr,jdbcType=VARCHAR},
+      </if>
+      <if test="fileUrl != null">
+        file_url = #{fileUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="ico != null">
+        ico = #{ico,jdbcType=VARCHAR},
+      </if>
+      <if test="remark != null">
+        remark = #{remark,jdbcType=VARCHAR},
+      </if>
+      <if test="orderby != null">
+        orderby = #{orderby,jdbcType=INTEGER},
+      </if>
+      <if test="nodeType != null">
+        node_type=#{nodeType,jdbcType=INTEGER},
+      </if>
+      <if test="isForbid != null">
+        is_forbid = #{isForbid,jdbcType=INTEGER},
+      </if>
+      <if test="state != null">
+        state = #{state,jdbcType=INTEGER},
+      </if>
+      <if test="createUser != null">
+        create_user = #{createUser,jdbcType=CHAR},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="modifiedUser != null">
+        modified_user = #{modifiedUser,jdbcType=CHAR},
+      </if>
+      <if test="modifiedTime != null">
+        modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    where guid = #{guid,jdbcType=CHAR}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.hcloud.microservice.org.facade.entity.BaseAuthorization">
+    update t_base_authorization
+    set parent_guid = #{parentGuid,jdbcType=CHAR},
+      fk_product_guid = #{fkProductGuid,jdbcType=CHAR},
+      fun_name = #{funName,jdbcType=VARCHAR},
+      auth_str = #{authStr,jdbcType=VARCHAR},
+      file_url = #{fileUrl,jdbcType=VARCHAR},
+      ico = #{ico,jdbcType=VARCHAR},
+      remark = #{remark,jdbcType=VARCHAR},
+      orderby = #{orderby,jdbcType=INTEGER},
+      node_type = #{nodeType,jdbcType=INTEGER},
+      is_forbid = #{isForbid,jdbcType=INTEGER},
+      state = #{state,jdbcType=INTEGER},
+      create_user = #{createUser,jdbcType=CHAR},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      modified_user = #{modifiedUser,jdbcType=CHAR},
+      modified_time = #{modifiedTime,jdbcType=TIMESTAMP}
+    where guid = #{guid,jdbcType=CHAR}
+  </update>
+
+
+  <select id="searchBaseAuthInfoByPage" parameterType="com.hcloud.microserver.commoncore.base.PageBean" resultType="com.hcloud.microservice.org.bo.BaseAuthBO">
+    SELECT
+      aa.guid,
+      aa.fun_name AS funName,
+      aa.file_url AS fileUrl,
+      aa.auth_str AS authStr,
+      aa.ico,
+      aa.orderby,
+      aa.is_forbid AS isForbid,
+      aa.node_type AS nodeType,
+      aa.create_time AS createTime
+    FROM
+	  t_base_authorization aa
+	<where>
+      <if test="data.funName!=null and data.funName!=''">
+        aa.fun_name LIKE CONCAT(#{data.funName},'%')
+      </if>
+      <if test="data.fileUrl!=null and data.fileUrl!=''">
+        AND  aa.file_url = #{data.fileUrl}
+      </if>
+    </where>
+  </select>
+
+  <select id="searchMenuAuthInfo"  resultType="com.hcloud.microservice.org.bo.BaseAuthBO">
+     SELECT
+        aa.guid,
+        aa.parent_guid AS parentGuid,
+        aa.fun_name AS funName,
+        aa.file_url AS fileUrl,
+        aa.auth_str AS authStr,
+        aa.ico,
+        aa.orderby,
+        aa.is_forbid AS isForbid,
+        aa.create_time AS createTime
+    FROM
+        t_base_authorization aa
+    WHERE
+       aa.is_forbid=0
+    AND aa.node_type = 0
+  </select>
+    <select id="searchAllBaseAuthInfo" resultType="com.hcloud.microservice.org.bo.BaseAuthBO">
+        SELECT
+          aa.guid,
+          aa.fk_product_guid AS fkProductGuid,
+          aa.parent_guid AS parentGuid,
+          aa.fun_name AS funName,
+          aa.file_url AS fileUrl,
+          aa.auth_str AS authStr,
+          aa.ico,
+          aa.orderby,
+          aa.is_forbid AS isForbid,
+          aa.node_type AS nodeType,
+          aa.create_time AS createTime
+        FROM
+          t_base_authorization aa
+        WHERE
+            aa.is_forbid=0
+    </select>
+
+</mapper>

+ 164 - 0
src/main/resources/mappers/BaseDictionaryMapper.xml

@@ -0,0 +1,164 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.hcloud.microservice.org.dao.BaseDictionaryMapper">
+  <resultMap id="BaseResultMap" type="com.hcloud.microservice.org.entity.BaseDictionary">
+    <id column="guid" jdbcType="CHAR" property="guid" />
+    <result column="fk_org_guid" jdbcType="CHAR" property="fkOrgGuid" />
+    <result column="fk_type_guid" jdbcType="CHAR" property="fkTypeGuid" />
+    <result column="dicname" jdbcType="VARCHAR" property="dicname" />
+    <result column="diccode" jdbcType="VARCHAR" property="diccode" />
+    <result column="is_forbiden" jdbcType="INTEGER" property="isForbiden" />
+    <result column="orderby" jdbcType="INTEGER" property="orderby" />
+    <result column="remark" jdbcType="VARCHAR" property="remark" />
+    <result column="state" jdbcType="INTEGER" property="state" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="modified_time" jdbcType="TIMESTAMP" property="modifiedTime" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    guid, fk_org_guid, fk_type_guid, dicname, diccode, is_forbiden, orderby, remark, 
+    state, create_time, modified_time
+  </sql>
+  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from t_base_dictionary
+    where guid = #{guid,jdbcType=CHAR}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+    delete from t_base_dictionary
+    where guid = #{guid,jdbcType=CHAR}
+  </delete>
+  <insert id="insert" parameterType="com.hcloud.microservice.org.entity.BaseDictionary">
+    insert into t_base_dictionary (guid, fk_org_guid, fk_type_guid, 
+      dicname, diccode, is_forbiden, 
+      orderby, remark, state, 
+      create_time, modified_time)
+    values (#{guid,jdbcType=CHAR}, #{fkOrgGuid,jdbcType=CHAR}, #{fkTypeGuid,jdbcType=CHAR}, 
+      #{dicname,jdbcType=VARCHAR}, #{diccode,jdbcType=VARCHAR}, #{isForbiden,jdbcType=INTEGER}, 
+      #{orderby,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR}, #{state,jdbcType=INTEGER}, 
+      #{createTime,jdbcType=TIMESTAMP}, #{modifiedTime,jdbcType=TIMESTAMP})
+  </insert>
+  <insert id="insertSelective" parameterType="com.hcloud.microservice.org.entity.BaseDictionary">
+    insert into t_base_dictionary
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="guid != null">
+        guid,
+      </if>
+      <if test="fkOrgGuid != null">
+        fk_org_guid,
+      </if>
+      <if test="fkTypeGuid != null">
+        fk_type_guid,
+      </if>
+      <if test="dicname != null">
+        dicname,
+      </if>
+      <if test="diccode != null">
+        diccode,
+      </if>
+      <if test="isForbiden != null">
+        is_forbiden,
+      </if>
+      <if test="orderby != null">
+        orderby,
+      </if>
+      <if test="remark != null">
+        remark,
+      </if>
+      <if test="state != null">
+        state,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="modifiedTime != null">
+        modified_time,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="guid != null">
+        #{guid,jdbcType=CHAR},
+      </if>
+      <if test="fkOrgGuid != null">
+        #{fkOrgGuid,jdbcType=CHAR},
+      </if>
+      <if test="fkTypeGuid != null">
+        #{fkTypeGuid,jdbcType=CHAR},
+      </if>
+      <if test="dicname != null">
+        #{dicname,jdbcType=VARCHAR},
+      </if>
+      <if test="diccode != null">
+        #{diccode,jdbcType=VARCHAR},
+      </if>
+      <if test="isForbiden != null">
+        #{isForbiden,jdbcType=INTEGER},
+      </if>
+      <if test="orderby != null">
+        #{orderby,jdbcType=INTEGER},
+      </if>
+      <if test="remark != null">
+        #{remark,jdbcType=VARCHAR},
+      </if>
+      <if test="state != null">
+        #{state,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="modifiedTime != null">
+        #{modifiedTime,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.hcloud.microservice.org.entity.BaseDictionary">
+    update t_base_dictionary
+    <set>
+      <if test="fkOrgGuid != null">
+        fk_org_guid = #{fkOrgGuid,jdbcType=CHAR},
+      </if>
+      <if test="fkTypeGuid != null">
+        fk_type_guid = #{fkTypeGuid,jdbcType=CHAR},
+      </if>
+      <if test="dicname != null">
+        dicname = #{dicname,jdbcType=VARCHAR},
+      </if>
+      <if test="diccode != null">
+        diccode = #{diccode,jdbcType=VARCHAR},
+      </if>
+      <if test="isForbiden != null">
+        is_forbiden = #{isForbiden,jdbcType=INTEGER},
+      </if>
+      <if test="orderby != null">
+        orderby = #{orderby,jdbcType=INTEGER},
+      </if>
+      <if test="remark != null">
+        remark = #{remark,jdbcType=VARCHAR},
+      </if>
+      <if test="state != null">
+        state = #{state,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="modifiedTime != null">
+        modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    where guid = #{guid,jdbcType=CHAR}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.hcloud.microservice.org.entity.BaseDictionary">
+    update t_base_dictionary
+    set fk_org_guid = #{fkOrgGuid,jdbcType=CHAR},
+      fk_type_guid = #{fkTypeGuid,jdbcType=CHAR},
+      dicname = #{dicname,jdbcType=VARCHAR},
+      diccode = #{diccode,jdbcType=VARCHAR},
+      is_forbiden = #{isForbiden,jdbcType=INTEGER},
+      orderby = #{orderby,jdbcType=INTEGER},
+      remark = #{remark,jdbcType=VARCHAR},
+      state = #{state,jdbcType=INTEGER},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      modified_time = #{modifiedTime,jdbcType=TIMESTAMP}
+    where guid = #{guid,jdbcType=CHAR}
+  </update>
+</mapper>

+ 77 - 0
src/main/resources/mappers/BaseDictionaryTypeMapper.xml

@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.hcloud.microservice.org.dao.BaseDictionaryTypeMapper">
+  <resultMap id="BaseResultMap" type="com.hcloud.microservice.org.entity.BaseDictionaryType">
+    <result column="guid" jdbcType="CHAR" property="guid" />
+    <result column="fk_org_guid" jdbcType="CHAR" property="fkOrgGuid" />
+    <result column="parent_type_id" jdbcType="CHAR" property="parentTypeId" />
+    <result column="type_code" jdbcType="VARCHAR" property="typeCode" />
+    <result column="type_name" jdbcType="VARCHAR" property="typeName" />
+    <result column="state" jdbcType="INTEGER" property="state" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="modified_time" jdbcType="TIMESTAMP" property="modifiedTime" />
+  </resultMap>
+  <insert id="insert" parameterType="com.hcloud.microservice.org.entity.BaseDictionaryType">
+    insert into t_base_dictionary_type (guid, fk_org_guid, parent_type_id, 
+      type_code, type_name, state, 
+      create_time, modified_time)
+    values (#{guid,jdbcType=CHAR}, #{fkOrgGuid,jdbcType=CHAR}, #{parentTypeId,jdbcType=CHAR}, 
+      #{typeCode,jdbcType=VARCHAR}, #{typeName,jdbcType=VARCHAR}, #{state,jdbcType=INTEGER}, 
+      #{createTime,jdbcType=TIMESTAMP}, #{modifiedTime,jdbcType=TIMESTAMP})
+  </insert>
+  <insert id="insertSelective" parameterType="com.hcloud.microservice.org.entity.BaseDictionaryType">
+    insert into t_base_dictionary_type
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="guid != null">
+        guid,
+      </if>
+      <if test="fkOrgGuid != null">
+        fk_org_guid,
+      </if>
+      <if test="parentTypeId != null">
+        parent_type_id,
+      </if>
+      <if test="typeCode != null">
+        type_code,
+      </if>
+      <if test="typeName != null">
+        type_name,
+      </if>
+      <if test="state != null">
+        state,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="modifiedTime != null">
+        modified_time,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="guid != null">
+        #{guid,jdbcType=CHAR},
+      </if>
+      <if test="fkOrgGuid != null">
+        #{fkOrgGuid,jdbcType=CHAR},
+      </if>
+      <if test="parentTypeId != null">
+        #{parentTypeId,jdbcType=CHAR},
+      </if>
+      <if test="typeCode != null">
+        #{typeCode,jdbcType=VARCHAR},
+      </if>
+      <if test="typeName != null">
+        #{typeName,jdbcType=VARCHAR},
+      </if>
+      <if test="state != null">
+        #{state,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="modifiedTime != null">
+        #{modifiedTime,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
+  </insert>
+</mapper>

+ 345 - 0
src/main/resources/mappers/BaseOrgAuthorizationMapper.xml

@@ -0,0 +1,345 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.hcloud.microservice.org.dao.BaseOrgAuthorizationMapper">
+  <resultMap id="BaseResultMap" type="com.hcloud.microservice.org.facade.entity.BaseOrgAuthorization">
+    <id column="guid" jdbcType="CHAR" property="guid" />
+    <result column="fk_product_guid" jdbcType="CHAR" property="fkProductGuid" />
+    <result column="fk_org_guid" jdbcType="CHAR" property="fkOrgGuid" />
+    <result column="parent_guid" jdbcType="CHAR" property="parentGuid" />
+    <result column="fk_auth_guid" jdbcType="CHAR" property="fkAuthGuid" />
+    <result column="fun_name" jdbcType="VARCHAR" property="funName" />
+    <result column="auth_str" jdbcType="VARCHAR" property="authStr" />
+    <result column="file_url" jdbcType="VARCHAR" property="fileUrl" />
+    <result column="ico" jdbcType="VARCHAR" property="ico" />
+    <result column="remark" jdbcType="VARCHAR" property="remark" />
+    <result column="orderby" jdbcType="INTEGER" property="orderby" />
+    <result column="node_type" jdbcType="INTEGER" property="nodeType" />
+    <result column="is_forbid" jdbcType="INTEGER" property="isForbid" />
+    <result column="state" jdbcType="INTEGER" property="state" />
+    <result column="create_user" jdbcType="CHAR" property="createUser" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="modified_user" jdbcType="CHAR" property="modifiedUser" />
+    <result column="modified_time" jdbcType="TIMESTAMP" property="modifiedTime" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    guid, fk_product_guid, fk_org_guid, parent_guid, fk_auth_guid, fun_name, auth_str, 
+    file_url, ico, remark, orderby,node_type, is_forbid, state, create_user, create_time, modified_user,
+    modified_time
+  </sql>
+  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from t_base_org_authorization
+    where guid = #{guid,jdbcType=CHAR}
+  </select>
+
+  <select id="searchOrgAuthInfoByOrgId" parameterType="com.hcloud.microserver.commoncore.base.PageBean"
+          resultType="com.hcloud.microservice.org.bo.BaseOrgAuthBO">
+    SELECT
+      aa.guid AS guid,
+      aa.parent_guid AS parentGuid,
+      aa.fk_product_guid AS fkProductGuid,
+      aa.fk_org_guid AS fkOrgGuid,
+      aa.fk_auth_guid AS fkAuthGuid,
+      aa.fun_name AS funName,
+      aa.auth_str AS authStr,
+      aa.file_url AS fileUrl,
+      ico,
+      aa.remark,
+      aa.orderby,
+      aa.node_type AS nodeType,
+      aa.is_forbid AS isForbid,
+      aa.create_time AS createTime
+    FROM
+        t_base_org_authorization aa
+    WHERE
+        aa.fk_org_guid = #{data.fkOrgGuid,jdbcType=CHAR}
+  </select>
+  <select id="searchOrgAuthStringByOrgId" resultType="java.lang.String">
+    SELECT
+      aa.fk_auth_guid AS fkAuthGuid
+    FROM
+        t_base_org_authorization aa
+    WHERE
+        aa.fk_org_guid = #{id,jdbcType=CHAR}
+  </select>
+  <select id="searchOrgMenuInfo" resultType="com.hcloud.microservice.org.bo.BaseOrgAuthBO">
+       SELECT
+      aa.guid AS guid,
+      aa.parent_guid AS parentGuid,
+      aa.fk_auth_guid AS fkAuthGuid,
+      aa.fun_name AS funName,
+      aa.auth_str AS authStr,
+      aa.file_url AS fileUrl,
+      ico,
+      aa.remark,
+      aa.orderby,
+      aa.node_type AS nodeType,
+      aa.is_forbid AS isForbid,
+      aa.create_time AS createTime
+    FROM
+        t_base_org_authorization aa
+    WHERE
+        aa.node_type=0
+        AND aa.is_forbid=0
+        AND aa.fk_org_guid = #{data.fkOrgGuid,jdbcType=CHAR}
+
+  </select>
+  <select id="searchAllOrgAuthInfo" resultType="com.hcloud.microservice.org.bo.BaseOrgAuthBO">
+      SELECT
+        aa.guid AS guid,
+        aa.parent_guid AS parentGuid,
+        aa.fk_product_guid AS fkProductGuid,
+        aa.fk_org_guid AS fkOrgGuid,
+        aa.fk_auth_guid AS id,
+        aa.fun_name AS funName,
+        aa.auth_str AS authStr,
+        aa.file_url AS fileUrl,
+        ico,
+        aa.remark,
+        aa.orderby,
+        aa.node_type AS nodeType,
+        aa.is_forbid AS isForbid,
+        aa.create_time AS createTime
+      FROM
+          t_base_org_authorization aa
+      WHERE
+          aa.fk_org_guid = #{id,jdbcType=CHAR}
+      ORDER BY aa.orderby DESC
+  </select>
+
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+    delete from t_base_org_authorization
+    where guid = #{guid,jdbcType=CHAR}
+  </delete>
+    <delete id="delOrgAuthInfoByOrgId">
+      delete from t_base_org_authorization
+    where fk_org_guid = #{id}
+    </delete>
+    <insert id="insert" parameterType="com.hcloud.microservice.org.facade.entity.BaseOrgAuthorization">
+    insert into t_base_org_authorization (guid, fk_product_guid, fk_org_guid, 
+      parent_guid, fk_auth_guid, fun_name, 
+      auth_str, file_url, ico, 
+      remark, orderby,node_type,is_forbid,
+      state, create_user, create_time, 
+      modified_user, modified_time)
+    values (#{guid,jdbcType=CHAR}, #{fkProductGuid,jdbcType=CHAR}, #{fkOrgGuid,jdbcType=CHAR}, 
+      #{parentGuid,jdbcType=CHAR}, #{fkAuthGuid,jdbcType=CHAR}, #{funName,jdbcType=VARCHAR}, 
+      #{authStr,jdbcType=VARCHAR}, #{fileUrl,jdbcType=VARCHAR}, #{ico,jdbcType=VARCHAR}, 
+      #{remark,jdbcType=VARCHAR}, #{orderby,jdbcType=INTEGER},#{nodeType,jdbcType=INTEGER},
+      #{isForbid,jdbcType=INTEGER},#{state,jdbcType=INTEGER}, #{createUser,jdbcType=CHAR},
+      #{createTime,jdbcType=TIMESTAMP},#{modifiedUser,jdbcType=CHAR}, #{modifiedTime,jdbcType=TIMESTAMP})
+  </insert>
+  <insert id="insertSelective" parameterType="com.hcloud.microservice.org.facade.entity.BaseOrgAuthorization">
+    insert into t_base_org_authorization
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="guid != null">
+        guid,
+      </if>
+      <if test="fkProductGuid != null">
+        fk_product_guid,
+      </if>
+      <if test="fkOrgGuid != null">
+        fk_org_guid,
+      </if>
+      <if test="parentGuid != null">
+        parent_guid,
+      </if>
+      <if test="fkAuthGuid != null">
+        fk_auth_guid,
+      </if>
+      <if test="funName != null">
+        fun_name,
+      </if>
+      <if test="authStr != null">
+        auth_str,
+      </if>
+      <if test="fileUrl != null">
+        file_url,
+      </if>
+      <if test="ico != null">
+        ico,
+      </if>
+      <if test="remark != null">
+        remark,
+      </if>
+      <if test="orderby != null">
+        orderby,
+      </if>
+      <if test="nodeType != null">
+        node_type,
+      </if>
+      <if test="isForbid != null">
+        is_forbid,
+      </if>
+      <if test="state != null">
+        state,
+      </if>
+      <if test="createUser != null">
+        create_user,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="modifiedUser != null">
+        modified_user,
+      </if>
+      <if test="modifiedTime != null">
+        modified_time,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="guid != null">
+        #{guid,jdbcType=CHAR},
+      </if>
+      <if test="fkProductGuid != null">
+        #{fkProductGuid,jdbcType=CHAR},
+      </if>
+      <if test="fkOrgGuid != null">
+        #{fkOrgGuid,jdbcType=CHAR},
+      </if>
+      <if test="parentGuid != null">
+        #{parentGuid,jdbcType=CHAR},
+      </if>
+      <if test="fkAuthGuid != null">
+        #{fkAuthGuid,jdbcType=CHAR},
+      </if>
+      <if test="funName != null">
+        #{funName,jdbcType=VARCHAR},
+      </if>
+      <if test="authStr != null">
+        #{authStr,jdbcType=VARCHAR},
+      </if>
+      <if test="fileUrl != null">
+        #{fileUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="ico != null">
+        #{ico,jdbcType=VARCHAR},
+      </if>
+      <if test="remark != null">
+        #{remark,jdbcType=VARCHAR},
+      </if>
+      <if test="orderby != null">
+        #{orderby,jdbcType=INTEGER},
+      </if>
+      <if test="nodeType != null">
+        #{nodeType,jdbcType=INTEGER},
+      </if>
+      <if test="isForbid != null">
+        #{isForbid,jdbcType=INTEGER},
+      </if>
+      <if test="state != null">
+        #{state,jdbcType=INTEGER},
+      </if>
+      <if test="createUser != null">
+        #{createUser,jdbcType=CHAR},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="modifiedUser != null">
+        #{modifiedUser,jdbcType=CHAR},
+      </if>
+      <if test="modifiedTime != null">
+        #{modifiedTime,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
+  </insert>
+  <insert id="batchOrgAuthInfo" parameterType="list">
+    insert into t_base_org_authorization (guid, fk_product_guid, fk_org_guid,
+    parent_guid, fk_auth_guid, fun_name,
+    auth_str, file_url, ico,
+    remark, orderby,node_type,is_forbid,
+    state,create_time,modified_time)
+    values
+    <foreach collection="list" item="bean" open="" separator="," close="">
+      (REPLACE(UUID(),'-',''), #{bean.fkProductGuid,jdbcType=CHAR}, #{bean.fkOrgGuid,jdbcType=CHAR},
+      #{bean.parentGuid,jdbcType=CHAR}, #{bean.fkAuthGuid,jdbcType=CHAR}, #{bean.funName,jdbcType=VARCHAR},
+      #{bean.authStr,jdbcType=VARCHAR}, #{bean.fileUrl,jdbcType=VARCHAR}, #{bean.ico,jdbcType=VARCHAR},
+      #{bean.remark,jdbcType=VARCHAR}, #{bean.orderby,jdbcType=INTEGER},#{bean.nodeType,jdbcType=INTEGER},
+      #{bean.isForbid,jdbcType=INTEGER},1,NOW(),NOW())
+    </foreach>
+  </insert>
+
+
+  <update id="updateByPrimaryKeySelective" parameterType="com.hcloud.microservice.org.facade.entity.BaseOrgAuthorization">
+    update t_base_org_authorization
+    <set>
+      <if test="fkProductGuid != null">
+        fk_product_guid = #{fkProductGuid,jdbcType=CHAR},
+      </if>
+      <if test="fkOrgGuid != null">
+        fk_org_guid = #{fkOrgGuid,jdbcType=CHAR},
+      </if>
+      <if test="parentGuid != null">
+        parent_guid = #{parentGuid,jdbcType=CHAR},
+      </if>
+      <if test="fkAuthGuid != null">
+        fk_auth_guid = #{fkAuthGuid,jdbcType=CHAR},
+      </if>
+      <if test="funName != null">
+        fun_name = #{funName,jdbcType=VARCHAR},
+      </if>
+      <if test="authStr != null">
+        auth_str = #{authStr,jdbcType=VARCHAR},
+      </if>
+      <if test="fileUrl != null">
+        file_url = #{fileUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="ico != null">
+        ico = #{ico,jdbcType=VARCHAR},
+      </if>
+      <if test="remark != null">
+        remark = #{remark,jdbcType=VARCHAR},
+      </if>
+      <if test="orderby != null">
+        orderby = #{orderby,jdbcType=INTEGER},
+      </if>
+      <if test="nodeType != null">
+        node_type = #{nodeType,jdbcType=INTEGER},
+      </if>
+      <if test="isForbid != null">
+        is_forbid = #{isForbid,jdbcType=INTEGER},
+      </if>
+      <if test="state != null">
+        state = #{state,jdbcType=INTEGER},
+      </if>
+      <if test="createUser != null">
+        create_user = #{createUser,jdbcType=CHAR},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="modifiedUser != null">
+        modified_user = #{modifiedUser,jdbcType=CHAR},
+      </if>
+      <if test="modifiedTime != null">
+        modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    where guid = #{guid,jdbcType=CHAR}
+  </update>
+
+  <update id="updateByPrimaryKey" parameterType="com.hcloud.microservice.org.facade.entity.BaseOrgAuthorization">
+    update t_base_org_authorization
+    set fk_product_guid = #{fkProductGuid,jdbcType=CHAR},
+      fk_org_guid = #{fkOrgGuid,jdbcType=CHAR},
+      parent_guid = #{parentGuid,jdbcType=CHAR},
+      fk_auth_guid = #{fkAuthGuid,jdbcType=CHAR},
+      fun_name = #{funName,jdbcType=VARCHAR},
+      auth_str = #{authStr,jdbcType=VARCHAR},
+      file_url = #{fileUrl,jdbcType=VARCHAR},
+      ico = #{ico,jdbcType=VARCHAR},
+      remark = #{remark,jdbcType=VARCHAR},
+      orderby = #{orderby,jdbcType=INTEGER},
+      node_type = #{nodeType,jdbcType=INTEGER},
+      is_forbid = #{isForbid,jdbcType=INTEGER},
+      state = #{state,jdbcType=INTEGER},
+      create_user = #{createUser,jdbcType=CHAR},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      modified_user = #{modifiedUser,jdbcType=CHAR},
+      modified_time = #{modifiedTime,jdbcType=TIMESTAMP}
+    where guid = #{guid,jdbcType=CHAR}
+  </update>
+
+</mapper>

+ 402 - 0
src/main/resources/mappers/BaseOrgMapper.xml

@@ -0,0 +1,402 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.hcloud.microservice.org.dao.BaseOrgMapper">
+  <resultMap id="BaseResultMap" type="com.hcloud.microservice.org.facade.entity.BaseOrg">
+    <id column="guid" jdbcType="CHAR" property="guid" />
+    <result column="dic_org_type_code" jdbcType="INTEGER" property="dicOrgTypeCode" />
+    <result column="org_name" jdbcType="VARCHAR" property="orgName" />
+    <result column="org_code" jdbcType="CHAR" property="orgCode" />
+    <result column="org_brevity" jdbcType="CHAR" property="orgBrevity" />
+    <result column="ico" jdbcType="VARCHAR" property="ico" />
+    <result column="org_address" jdbcType="VARCHAR" property="orgAddress" />
+    <result column="position_type" jdbcType="INTEGER" property="positionType" />
+    <result column="fk_position_id" jdbcType="CHAR" property="fkPositionId" />
+    <result column="principals" jdbcType="VARCHAR" property="principals" />
+    <result column="org_imgs" jdbcType="VARCHAR" property="orgImgs" />
+    <result column="wx_qr_img" jdbcType="VARCHAR" property="wxQRImg" />
+    <result column="qq_code" jdbcType="VARCHAR" property="qqCode" />
+    <result column="company_url" jdbcType="VARCHAR" property="companyUrl" />
+    <result column="company_tel" jdbcType="VARCHAR" property="companyTel" />
+    <result column="tel" jdbcType="CHAR" property="tel" />
+    <result column="remark" jdbcType="VARCHAR" property="remark" />
+    <result column="qrcode_url_prefixe" jdbcType="VARCHAR" property="qrcodeUrlPrefixe" />
+    <result column="state" jdbcType="INTEGER" property="state" />
+    <result column="create_user" jdbcType="CHAR" property="createUser" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="modify_user" jdbcType="CHAR" property="modifyUser" />
+    <result column="modied_time" jdbcType="TIMESTAMP" property="modiedTime" />
+    <result column="system_name" jdbcType="VARCHAR" property="systemName" />
+    <result column="temple_type" jdbcType="INTEGER" property="templeType" />
+    <result column="qualifica_imgs" jdbcType="VARCHAR" property="qualificaImgs" />
+    <result column="tmall_url" jdbcType="VARCHAR" property="tmallUrl" />
+    <result column="jd_url" jdbcType="VARCHAR" property="jdUrl" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    guid, dic_org_type_code, org_name, org_code, org_brevity, ico, org_address, position_type, 
+    fk_position_id, principals, org_imgs,wx_qr_img,qq_code,company_url,company_tel,tel, remark,
+    qrcode_url_prefixe,state, create_user,create_time, modify_user, modied_time,system_name,temple_type,
+    qualifica_imgs,tmall_url,jd_url
+  </sql>
+  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from t_base_org
+    where guid = #{guid,jdbcType=CHAR}
+  </select>
+    <select id="searchOrgInfoByPage" parameterType="com.hcloud.microserver.commoncore.base.PageBean"
+            resultMap="BaseResultMap">
+          SELECT
+            aa.guid,
+            aa.org_code,
+            aa.org_name,
+            aa.principals,
+            aa.org_address,
+            aa.tel,
+            aa.org_imgs,
+            aa.wx_qr_img,
+            aa.qq_code,
+            aa.company_url,
+            aa.company_tel,
+            aa.qrcode_url_prefixe,
+            aa.create_user,
+            aa.create_user,
+            aa.system_name,
+            aa.temple_type
+          FROM
+              t_base_org aa
+          WHERE
+              aa.state=1
+            <if test="data.dicOrgTypeCode!=null">
+              and aa.dic_org_type_code = #{data.dicOrgTypeCode}
+            </if>
+            <if test="data.orgName!=null and data.orgName!=''">
+              AND aa.org_name LIKE CONCAT(#{data.orgName}, '%')
+            </if>
+            <if test="data.orgCode!=null and data.orgCode!=''">
+              AND aa.org_code = #{data.orgCode}
+            </if>
+            <if test="data.orgBrevity!=null and data.orgBrevity!=''">
+              AND aa.org_brevity = #{data.orgBrevity}
+            </if>
+            <if test="data.orgAddress!=null and data.orgAddress!=''">
+              AND aa.org_address LIKE CONCAT('%', #{data.orgAddress}, '%')
+            </if>
+            <if test="data.tel!=null and data.tel!=''">
+              AND aa.tel = #{data.tel}
+            </if>
+        ORDER BY aa.create_time DESC
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+    delete from t_base_org
+    where guid = #{guid,jdbcType=CHAR}
+  </delete>
+  <insert id="insert" parameterType="com.hcloud.microservice.org.facade.entity.BaseOrg">
+    insert into t_base_org (guid, dic_org_type_code, org_name, 
+      org_code, org_brevity, ico, 
+      org_address, position_type, fk_position_id, 
+      principals,org_imgs,wx_qr_img,qq_code,
+      company_url,company_tel, tel, remark,qrcode_url_prefixe,
+      state, create_user,create_time, modify_user, modied_time,system_name,temple_type
+      )
+    values (#{guid,jdbcType=CHAR}, #{dicOrgTypeCode,jdbcType=INTEGER}, #{orgName,jdbcType=VARCHAR}, 
+      #{orgCode,jdbcType=CHAR}, #{orgBrevity,jdbcType=CHAR}, #{ico,jdbcType=VARCHAR}, 
+      #{orgAddress,jdbcType=VARCHAR}, #{positionType,jdbcType=INTEGER}, #{fkPositionId,jdbcType=CHAR}, 
+      #{principals,jdbcType=VARCHAR},#{orgImgs,jdbcType=VARCHAR} ,#{wxQRImg,jdbcType=VARCHAR},
+      #{qqCode,jdbcType=VARCHAR},#{companyUrl,jdbcType=VARCHAR},#{companyTel,jdbcType=VARCHAR},
+      #{tel,jdbcType=CHAR}, #{remark,jdbcType=VARCHAR},#{qrcodeUrlPrefixe,jdbcType=VARCHAR},
+      #{state,jdbcType=INTEGER}, #{createUser,jdbcType=CHAR},#{createTime,jdbcType=TIMESTAMP},
+      #{modifyUser,jdbcType=CHAR}, #{modiedTime,jdbcType=TIMESTAMP},#{systemName,jdbcType=VARCHAR},
+      #{templeType,jdbcType=INTEGER}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.hcloud.microservice.org.facade.entity.BaseOrg">
+    insert into t_base_org
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="guid != null">
+        guid,
+      </if>
+      <if test="dicOrgTypeCode != null">
+        dic_org_type_code,
+      </if>
+      <if test="orgName != null">
+        org_name,
+      </if>
+      <if test="orgCode != null">
+        org_code,
+      </if>
+      <if test="orgBrevity != null">
+        org_brevity,
+      </if>
+      <if test="ico != null">
+        ico,
+      </if>
+      <if test="orgAddress != null">
+        org_address,
+      </if>
+      <if test="positionType != null">
+        position_type,
+      </if>
+      <if test="fkPositionId != null">
+        fk_position_id,
+      </if>
+      <if test="principals != null">
+        principals,
+      </if>
+      <if test="orgImgs != null">
+        org_imgs,
+      </if>
+      <if test="wxQRImg != null">
+        wx_qr_img,
+      </if>
+      <if test="qqCode != null">
+        qq_code,
+      </if>
+      <if test="companyUrl != null">
+        company_url,
+      </if>
+      <if test="companyTel != null">
+        company_tel,
+      </if>
+      <if test="tel != null">
+        tel,
+      </if>
+      <if test="remark != null">
+        remark,
+      </if>
+      <if test="qrcodeUrlPrefixe != null">
+        qrcode_url_prefixe,
+      </if>
+      <if test="state != null">
+        state,
+      </if>
+      <if test="createUser != null">
+        create_user,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="modifyUser != null">
+        modify_user,
+      </if>
+      <if test="modiedTime != null">
+        modied_time,
+      </if>
+      <if test="systemName != null">
+        system_name,
+      </if>
+      <if test="templeType != null">
+        temple_type,
+      </if>
+      <if test="qualificaImgs != null">
+        qualifica_imgs,
+      </if>
+      <if test="tmallUrl != null">
+        tmall_url,
+      </if>
+      <if test="jdUrl != null">
+        jd_url,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="guid != null">
+        #{guid,jdbcType=CHAR},
+      </if>
+      <if test="dicOrgTypeCode != null">
+        #{dicOrgTypeCode,jdbcType=INTEGER},
+      </if>
+      <if test="orgName != null">
+        #{orgName,jdbcType=VARCHAR},
+      </if>
+      <if test="orgCode != null">
+        #{orgCode,jdbcType=CHAR},
+      </if>
+      <if test="orgBrevity != null">
+        #{orgBrevity,jdbcType=CHAR},
+      </if>
+      <if test="ico != null">
+        #{ico,jdbcType=VARCHAR},
+      </if>
+      <if test="orgAddress != null">
+        #{orgAddress,jdbcType=VARCHAR},
+      </if>
+      <if test="positionType != null">
+        #{positionType,jdbcType=INTEGER},
+      </if>
+      <if test="fkPositionId != null">
+        #{fkPositionId,jdbcType=CHAR},
+      </if>
+      <if test="principals != null">
+        #{principals,jdbcType=VARCHAR},
+      </if>
+      <if test="orgImgs != null">
+        #{orgImgs,jdbcType=VARCHAR},
+      </if>
+      <if test="wxQRImg != null">
+        #{wxQRImg,jdbcType=VARCHAR},
+      </if>
+      <if test="qqCode != null">
+        #{qqCode,jdbcType=VARCHAR},
+      </if>
+      <if test="companyUrl != null">
+        #{companyUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="companyTel != null">
+        #{companyTel,jdbcType=VARCHAR},
+      </if>
+      <if test="tel != null">
+        #{tel,jdbcType=CHAR},
+      </if>
+      <if test="remark != null">
+        #{remark,jdbcType=VARCHAR},
+      </if>
+      <if test="qrcodeUrlPrefixe != null">
+        #{qrcodeUrlPrefixe,jdbcType=VARCHAR},
+      </if>
+      <if test="state != null">
+        #{state,jdbcType=INTEGER},
+      </if>
+      <if test="createUser != null">
+        #{createUser,jdbcType=CHAR},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="modifyUser != null">
+        #{modifyUser,jdbcType=CHAR},
+      </if>
+      <if test="modiedTime != null">
+        #{modiedTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="systemName != null">
+        #{systemName,jdbcType=VARCHAR},
+      </if>
+      <if test="templeType != null">
+        #{templeType,jdbcType=INTEGER},
+      </if>
+      <if test="qualificaImgs != null">
+        #{qualificaImgs,jdbcType=VARCHAR},
+      </if>
+      <if test="tmallUrl != null">
+        #{tmallUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="jdUrl != null">
+        #{jdUrl,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.hcloud.microservice.org.facade.entity.BaseOrg">
+    update t_base_org
+    <set>
+      <if test="dicOrgTypeCode != null">
+        dic_org_type_code = #{dicOrgTypeCode,jdbcType=INTEGER},
+      </if>
+      <if test="orgName != null">
+        org_name = #{orgName,jdbcType=VARCHAR},
+      </if>
+      <if test="orgCode != null">
+        org_code = #{orgCode,jdbcType=CHAR},
+      </if>
+      <if test="orgBrevity != null">
+        org_brevity = #{orgBrevity,jdbcType=CHAR},
+      </if>
+      <if test="ico != null">
+        ico = #{ico,jdbcType=VARCHAR},
+      </if>
+      <if test="orgAddress != null">
+        org_address = #{orgAddress,jdbcType=VARCHAR},
+      </if>
+      <if test="positionType != null">
+        position_type = #{positionType,jdbcType=INTEGER},
+      </if>
+      <if test="fkPositionId != null">
+        fk_position_id = #{fkPositionId,jdbcType=CHAR},
+      </if>
+      <if test="principals != null">
+        principals = #{principals,jdbcType=VARCHAR},
+      </if>
+      <if test="orgImgs != null">
+        org_imgs=#{orgImgs,jdbcType=VARCHAR},
+      </if>
+      <if test="wxQRImg != null">
+        wx_qr_img=#{wxQRImg,jdbcType=VARCHAR},
+      </if>
+      <if test="qqCode != null">
+        qq_code = #{qqCode,jdbcType=VARCHAR},
+      </if>
+      <if test="companyUrl != null">
+        company_url = #{companyUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="companyTel != null">
+        company_tel = #{companyTel,jdbcType=VARCHAR},
+      </if>
+      <if test="tel != null">
+        tel = #{tel,jdbcType=CHAR},
+      </if>
+      <if test="remark != null">
+        remark = #{remark,jdbcType=VARCHAR},
+      </if>
+      <if test="qrcodeUrlPrefixe != null">
+        qrcode_url_prefixe = #{qrcodeUrlPrefixe,jdbcType=VARCHAR},
+      </if>
+      <if test="state != null">
+        state = #{state,jdbcType=INTEGER},
+      </if>
+      <if test="createUser != null">
+        create_user = #{createUser,jdbcType=CHAR},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="modifyUser != null">
+        modify_user = #{modifyUser,jdbcType=CHAR},
+      </if>
+      <if test="modiedTime != null">
+        modied_time = #{modiedTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="systemName != null">
+        system_name = #{systemName,jdbcType=VARCHAR},
+      </if>
+      <if test="templeType != null">
+        temple_type = #{templeType,jdbcType=INTEGER},
+      </if>
+      <if test="qualificaImgs != null">
+        qualifica_imgs = #{qualificaImgs,jdbcType=VARCHAR},
+      </if>
+      <if test="tmallUrl != null">
+        tmall_url = #{tmallUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="jdUrl != null">
+        jd_url = #{jdUrl,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where guid = #{guid,jdbcType=CHAR}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.hcloud.microservice.org.facade.entity.BaseOrg">
+    update t_base_org
+    set dic_org_type_code = #{dicOrgTypeCode,jdbcType=INTEGER},
+      org_name = #{orgName,jdbcType=VARCHAR},
+      org_code = #{orgCode,jdbcType=CHAR},
+      org_brevity = #{orgBrevity,jdbcType=CHAR},
+      ico = #{ico,jdbcType=VARCHAR},
+      org_address = #{orgAddress,jdbcType=VARCHAR},
+      position_type = #{positionType,jdbcType=INTEGER},
+      fk_position_id = #{fkPositionId,jdbcType=CHAR},
+      principals = #{principals,jdbcType=VARCHAR},
+      org_imgs=#{orgImgs,jdbcType=VARCHAR},
+      wx_qr_img=#{wxQRImg,jdbcType=VARCHAR},
+      qq_code = #{qqCode,jdbcType=VARCHAR},
+      company_url = #{companyUrl,jdbcType=VARCHAR},
+      company_tel = #{companyTel,jdbcType=VARCHAR},
+      tel = #{tel,jdbcType=CHAR},
+      remark = #{remark,jdbcType=VARCHAR},
+      qrcode_url_prefixe = #{qrcodeUrlPrefixe,jdbcType=VARCHAR},
+      state = #{state,jdbcType=INTEGER},
+      create_user = #{createUser,jdbcType=CHAR},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      modify_user = #{modifyUser,jdbcType=CHAR},
+      modied_time = #{modiedTime,jdbcType=TIMESTAMP},
+      system_name = #{systemName,jdbcType=VARCHAR},
+      temple_type = #{templeType,jdbcType=INTEGER}
+    where guid = #{guid,jdbcType=CHAR}
+  </update>
+</mapper>

+ 145 - 0
src/main/resources/mappers/BasePositionMapper.xml

@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.hcloud.microservice.org.dao.BasePositionMapper">
+  <resultMap id="BaseResultMap" type="com.hcloud.microservice.org.facade.entity.BasePosition">
+    <id column="id" jdbcType="INTEGER" property="id" />
+    <result column="upCode" jdbcType="VARCHAR" property="upcode" />
+    <result column="name" jdbcType="VARCHAR" property="name" />
+    <result column="level" jdbcType="INTEGER" property="level" />
+    <result column="pinyin" jdbcType="VARCHAR" property="pinyin" />
+    <result column="acronym" jdbcType="VARCHAR" property="acronym" />
+    <result column="code" jdbcType="VARCHAR" property="code" />
+    <result column="areaCode" jdbcType="VARCHAR" property="areacode" />
+    <result column="zip" jdbcType="CHAR" property="zip" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    id, upCode, name, level, pinyin, acronym, code, areaCode, zip
+  </sql>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from t_base_position
+    where id = #{id,jdbcType=INTEGER}
+  </select>
+  <select id="getBasePositionByCode" parameterType="java.lang.String" resultMap="BaseResultMap">
+    select
+    <include refid="Base_Column_List" />
+    from t_base_position
+    where code=#{areaCode}
+  </select>
+  <select id="getBasePositionByParentCode" parameterType="java.lang.String" resultMap="BaseResultMap">
+    select
+    <include refid="Base_Column_List" />
+    from t_base_position
+    where upCode=#{parentCode}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+    delete from t_base_position
+    where id = #{id,jdbcType=INTEGER}
+  </delete>
+  <insert id="insert" useGeneratedKeys="true" keyProperty="id" parameterType="com.hcloud.microservice.org.facade.entity.BasePosition">
+    insert into t_base_position (upCode, name,
+      level, pinyin, acronym, 
+      code, areaCode, zip)
+    values (#{upcode,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
+      #{level,jdbcType=INTEGER}, #{pinyin,jdbcType=VARCHAR}, #{acronym,jdbcType=VARCHAR}, 
+      #{code,jdbcType=VARCHAR}, #{areacode,jdbcType=VARCHAR}, #{zip,jdbcType=CHAR})
+  </insert>
+  <insert id="insertSelective" useGeneratedKeys="true" keyProperty="id" parameterType="com.hcloud.microservice.org.facade.entity.BasePosition">
+    insert into t_base_position
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="upcode != null">
+        upCode,
+      </if>
+      <if test="name != null">
+        name,
+      </if>
+      <if test="level != null">
+        level,
+      </if>
+      <if test="pinyin != null">
+        pinyin,
+      </if>
+      <if test="acronym != null">
+        acronym,
+      </if>
+      <if test="code != null">
+        code,
+      </if>
+      <if test="areacode != null">
+        areaCode,
+      </if>
+      <if test="zip != null">
+        zip,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="upcode != null">
+        #{upcode,jdbcType=VARCHAR},
+      </if>
+      <if test="name != null">
+        #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="level != null">
+        #{level,jdbcType=INTEGER},
+      </if>
+      <if test="pinyin != null">
+        #{pinyin,jdbcType=VARCHAR},
+      </if>
+      <if test="acronym != null">
+        #{acronym,jdbcType=VARCHAR},
+      </if>
+      <if test="code != null">
+        #{code,jdbcType=VARCHAR},
+      </if>
+      <if test="areacode != null">
+        #{areacode,jdbcType=VARCHAR},
+      </if>
+      <if test="zip != null">
+        #{zip,jdbcType=CHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.hcloud.microservice.org.facade.entity.BasePosition">
+    update t_base_position
+    <set>
+      <if test="upcode != null">
+        upCode = #{upcode,jdbcType=VARCHAR},
+      </if>
+      <if test="name != null">
+        name = #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="level != null">
+        level = #{level,jdbcType=INTEGER},
+      </if>
+      <if test="pinyin != null">
+        pinyin = #{pinyin,jdbcType=VARCHAR},
+      </if>
+      <if test="acronym != null">
+        acronym = #{acronym,jdbcType=VARCHAR},
+      </if>
+      <if test="code != null">
+        code = #{code,jdbcType=VARCHAR},
+      </if>
+      <if test="areacode != null">
+        areaCode = #{areacode,jdbcType=VARCHAR},
+      </if>
+      <if test="zip != null">
+        zip = #{zip,jdbcType=CHAR},
+      </if>
+    </set>
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.hcloud.microservice.org.facade.entity.BasePosition">
+    update t_base_position
+    set upCode = #{upcode,jdbcType=VARCHAR},
+      name = #{name,jdbcType=VARCHAR},
+      level = #{level,jdbcType=INTEGER},
+      pinyin = #{pinyin,jdbcType=VARCHAR},
+      acronym = #{acronym,jdbcType=VARCHAR},
+      code = #{code,jdbcType=VARCHAR},
+      areaCode = #{areacode,jdbcType=VARCHAR},
+      zip = #{zip,jdbcType=CHAR}
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+</mapper>

+ 80 - 0
src/main/resources/mappers/BaseRoleAuthorizationMapper.xml

@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.hcloud.microservice.org.dao.BaseRoleAuthorizationMapper">
+  <resultMap id="BaseResultMap" type="com.hcloud.microservice.org.facade.entity.BaseRoleAuthorization">
+    <result column="guid" jdbcType="CHAR" property="guid" />
+    <result column="fk_org_guid" jdbcType="CHAR" property="fkOrgGuid" />
+    <result column="fk_product_guid" jdbcType="CHAR" property="fkProductGuid" />
+    <result column="fk_role_guid" jdbcType="CHAR" property="fkRoleGuid" />
+    <result column="fk_fun_guid" jdbcType="CHAR" property="fkFunGuid" />
+  </resultMap>
+  <insert id="insert" parameterType="com.hcloud.microservice.org.facade.entity.BaseRoleAuthorization">
+    insert into t_base_role_authorization (guid, fk_org_guid, fk_product_guid, 
+      fk_role_guid, fk_fun_guid)
+    values (#{guid,jdbcType=CHAR}, #{fkOrgGuid,jdbcType=CHAR}, #{fkProductGuid,jdbcType=CHAR}, 
+      #{fkRoleGuid,jdbcType=CHAR}, #{fkFunGuid,jdbcType=CHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.hcloud.microservice.org.facade.entity.BaseRoleAuthorization">
+    insert into t_base_role_authorization
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="guid != null">
+        guid,
+      </if>
+      <if test="fkOrgGuid != null">
+        fk_org_guid,
+      </if>
+      <if test="fkProductGuid != null">
+        fk_product_guid,
+      </if>
+      <if test="fkRoleGuid != null">
+        fk_role_guid,
+      </if>
+      <if test="fkFunGuid != null">
+        fk_fun_guid,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="guid != null">
+        #{guid,jdbcType=CHAR},
+      </if>
+      <if test="fkOrgGuid != null">
+        #{fkOrgGuid,jdbcType=CHAR},
+      </if>
+      <if test="fkProductGuid != null">
+        #{fkProductGuid,jdbcType=CHAR},
+      </if>
+      <if test="fkRoleGuid != null">
+        #{fkRoleGuid,jdbcType=CHAR},
+      </if>
+      <if test="fkFunGuid != null">
+        #{fkFunGuid,jdbcType=CHAR},
+      </if>
+    </trim>
+  </insert>
+
+    <insert id="batchSaveRoleAuthInfo">
+       insert into t_base_role_authorization (guid, fk_org_guid, fk_product_guid, 
+      fk_role_guid, fk_fun_guid)
+        values
+      <foreach collection="list" item="ops" open="" separator="," close="">
+         (REPLACE(UUID(),'-',''), #{ops.fkOrgGuid,jdbcType=CHAR}, #{ops.fkProductGuid,jdbcType=CHAR},
+        #{ops.fkRoleGuid,jdbcType=CHAR}, #{ops.fkAuthGuid,jdbcType=CHAR})
+      </foreach>
+    </insert>
+
+    <delete id="delRoleAuthByRoleId">
+        DELETE FROM t_base_role_authorization WHERE fk_role_guid=#{id} and fk_org_guid=#{orgGuid}
+
+    </delete>
+
+
+    <select id="searchRoleAuthByRoleId"  parameterType="java.lang.String" resultType="java.lang.String">
+      SELECT
+         aa.fk_fun_guid AS fkFunGuid
+      FROM
+          t_base_role_authorization aa
+      WHERE
+         aa.fk_role_guid =#{roleId}
+      AND aa.fk_org_guid=#{orgGuid}
+  </select>
+</mapper>

+ 185 - 0
src/main/resources/mappers/BaseRoleMapper.xml

@@ -0,0 +1,185 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.hcloud.microservice.org.dao.BaseRoleMapper">
+  <resultMap id="BaseResultMap" type="com.hcloud.microservice.org.facade.entity.BaseRole">
+    <id column="guid" jdbcType="CHAR" property="guid" />
+    <result column="fk_org_guid" jdbcType="CHAR" property="fkOrgGuid" />
+    <result column="fk_product_guid" jdbcType="CHAR" property="fkProductGuid" />
+    <result column="role_name" jdbcType="VARCHAR" property="roleName" />
+    <result column="is_forbid" jdbcType="INTEGER" property="isForbid" />
+    <result column="remark" jdbcType="VARCHAR" property="remark" />
+    <result column="state" jdbcType="INTEGER" property="state" />
+    <result column="create_user" jdbcType="CHAR" property="createUser" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="modified_user" jdbcType="CHAR" property="modifiedUser" />
+    <result column="modified_time" jdbcType="TIMESTAMP" property="modifiedTime" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    guid, fk_org_guid, fk_product_guid, role_name, is_forbid, remark, state, create_user,
+    create_time, modified_user, modified_time
+  </sql>
+  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from t_base_role
+    where guid = #{guid,jdbcType=CHAR}
+  </select>
+    <select id="searchRoleInfoByPage" resultMap="BaseResultMap">
+      select
+      <include refid="Base_Column_List" />
+      from t_base_role
+    <where>
+        state=1 AND fk_org_guid =#{data.fkOrgGuid}
+      <if test="data.roleName!=null and data.roleName!=''">
+        and role_name like CONCAT('%',#{data.roleName},'%')
+      </if>
+    </where>
+    </select>
+    <select id="searchUserInfoByRoleId" parameterType="java.lang.String" resultType="com.hcloud.microservice.org.bo.BaseRoleUserBO">
+      SELECT
+          aa.fk_user_guid AS userId,
+          aa.fk_org_guid AS fkOrgGuid,
+          aa.fk_role_guid AS roleId
+      FROM
+          t_base_role_user aa
+      WHERE
+	    aa.fk_role_guid =#{guid}
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+    delete from t_base_role
+    where guid = #{guid,jdbcType=CHAR}
+  </delete>
+  <insert id="insert" parameterType="com.hcloud.microservice.org.facade.entity.BaseRole">
+    insert into t_base_role (guid, fk_org_guid, fk_product_guid,
+      role_name, is_forbid, remark, 
+      state, create_user, create_time, 
+      modified_user, modified_time)
+    values (#{guid,jdbcType=CHAR}, #{fkOrgGuid,jdbcType=CHAR}, #{fkProductGuid,jdbcType=CHAR},
+      #{roleName,jdbcType=VARCHAR}, #{isForbid,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR}, 
+      #{state,jdbcType=INTEGER}, #{createUser,jdbcType=CHAR}, #{createTime,jdbcType=TIMESTAMP}, 
+      #{modifiedUser,jdbcType=CHAR}, #{modifiedTime,jdbcType=TIMESTAMP})
+  </insert>
+  <insert id="insertSelective" parameterType="com.hcloud.microservice.org.facade.entity.BaseRole">
+    insert into t_base_role
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="guid != null">
+        guid,
+      </if>
+      <if test="fkOrgGuid != null">
+        fk_org_guid,
+      </if>
+      <if test="fkProductGuid != null">
+        fk_product_guid,
+      </if>
+      <if test="roleName != null">
+        role_name,
+      </if>
+      <if test="isForbid != null">
+        is_forbid,
+      </if>
+      <if test="remark != null">
+        remark,
+      </if>
+      <if test="state != null">
+        state,
+      </if>
+      <if test="createUser != null">
+        create_user,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="modifiedUser != null">
+        modified_user,
+      </if>
+      <if test="modifiedTime != null">
+        modified_time,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="guid != null">
+        #{guid,jdbcType=CHAR},
+      </if>
+      <if test="fkOrgGuid != null">
+        #{fkOrgGuid,jdbcType=CHAR},
+      </if>
+      <if test="fkProductGuid != null">
+        #{fkProductGuid,jdbcType=CHAR},
+      </if>
+      <if test="roleName != null">
+        #{roleName,jdbcType=VARCHAR},
+      </if>
+      <if test="isForbid != null">
+        #{isForbid,jdbcType=INTEGER},
+      </if>
+      <if test="remark != null">
+        #{remark,jdbcType=VARCHAR},
+      </if>
+      <if test="state != null">
+        #{state,jdbcType=INTEGER},
+      </if>
+      <if test="createUser != null">
+        #{createUser,jdbcType=CHAR},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="modifiedUser != null">
+        #{modifiedUser,jdbcType=CHAR},
+      </if>
+      <if test="modifiedTime != null">
+        #{modifiedTime,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.hcloud.microservice.org.facade.entity.BaseRole">
+    update t_base_role
+    <set>
+      <if test="fkOrgGuid != null">
+        fk_org_guid = #{fkOrgGuid,jdbcType=CHAR},
+      </if>
+      <if test="fkProductGuid != null">
+        fk_product_guid = #{fkProductGuid,jdbcType=CHAR},
+      </if>
+      <if test="roleName != null">
+        role_name = #{roleName,jdbcType=VARCHAR},
+      </if>
+      <if test="isForbid != null">
+        is_forbid = #{isForbid,jdbcType=INTEGER},
+      </if>
+      <if test="remark != null">
+        remark = #{remark,jdbcType=VARCHAR},
+      </if>
+      <if test="state != null">
+        state = #{state,jdbcType=INTEGER},
+      </if>
+      <if test="createUser != null">
+        create_user = #{createUser,jdbcType=CHAR},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="modifiedUser != null">
+        modified_user = #{modifiedUser,jdbcType=CHAR},
+      </if>
+      <if test="modifiedTime != null">
+        modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    where guid = #{guid,jdbcType=CHAR}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.hcloud.microservice.org.facade.entity.BaseRole">
+    update t_base_role
+    set fk_org_guid = #{fkOrgGuid,jdbcType=CHAR},
+      fk_product_guid = #{fkProductGuid,jdbcType=CHAR},
+      role_name = #{roleName,jdbcType=VARCHAR},
+      is_forbid = #{isForbid,jdbcType=INTEGER},
+      remark = #{remark,jdbcType=VARCHAR},
+      state = #{state,jdbcType=INTEGER},
+      create_user = #{createUser,jdbcType=CHAR},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      modified_user = #{modifiedUser,jdbcType=CHAR},
+      modified_time = #{modifiedTime,jdbcType=TIMESTAMP}
+    where guid = #{guid,jdbcType=CHAR}
+  </update>
+</mapper>

+ 131 - 0
src/main/resources/mappers/BaseRoleUserMapper.xml

@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.hcloud.microservice.org.dao.BaseRoleUserMapper">
+  <resultMap id="BaseResultMap" type="com.hcloud.microservice.org.facade.entity.BaseRoleUser">
+    <id column="guid" jdbcType="CHAR" property="guid" />
+    <result column="fk_org_guid" jdbcType="CHAR" property="fkOrgGuid" />
+    <result column="fk_product_guid" jdbcType="CHAR" property="fkProductGuid" />
+    <result column="fk_user_guid" jdbcType="CHAR" property="fkUserGuid" />
+    <result column="fk_role_guid" jdbcType="CHAR" property="fkRoleGuid" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    guid, fk_org_guid, fk_product_guid, fk_user_guid, fk_role_guid
+  </sql>
+  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from t_base_role_user
+    where GUID = #{guid,jdbcType=CHAR}
+  </select>
+    <select id="searchRoleUserInfoByPage" parameterType="com.hcloud.microserver.commoncore.base.PageBean"
+            resultType="com.hcloud.microservice.org.bo.BaseRoleUserBO">
+        SELECT
+          aa.fk_org_guid AS fkOrgGuid,
+          bb.guid AS userId,
+          bb.account,
+          bb.user_name AS userName,
+          bb.nickname,
+          bb.dic_sex_code AS dicSexCode,
+          bb.last_login_time AS lastLoginTime,
+          bb.is_forbid AS isForbid,
+          bb.remark,
+          dd.org_name AS orgName,
+          cc.guid AS roleId,
+          cc.role_name AS roleName
+        FROM
+          t_base_role_user aa
+        LEFT JOIN t_base_user bb ON aa.fk_user_guid = bb.guid
+        LEFT JOIN t_base_role cc ON aa.fk_role_guid = cc.guid
+        LEFT JOIN t_base_org dd ON aa.fk_org_guid = dd.guid
+        <where>
+          <if test="data.fkOrgGuid!=null and data.fkOrgGuid!=''">
+            aa.fk_org_guid=#{data.fkOrgGuid}
+          </if>
+          <if test="data.fkUserGuid!=null and data.fkUserGuid!=''">
+            AND aa.fk_user_guid=#{data.fkUserGuid}
+          </if>
+          <if test="data.fkRoleGuid!=null and data.fkRoleGuid!=''">
+            AND aa.fk_role_guid=#{data.fkRoleGuid}
+          </if>
+        </where>
+    </select>
+
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+    delete from t_base_role_user
+    where GUID = #{guid,jdbcType=CHAR}
+  </delete>
+
+  <delete id="delRoleUserInfoByUserId">
+        delete from t_base_role_user where fk_org_guid=#{oguid} and fk_user_guid=#{id}
+  </delete>
+  <insert id="insert" parameterType="com.hcloud.microservice.org.facade.entity.BaseRoleUser">
+    insert into t_base_role_user (guid, fk_org_guid, fk_product_guid,
+      fk_user_guid, fk_role_guid)
+    values (#{guid,jdbcType=CHAR}, #{fkOrgGuid,jdbcType=CHAR}, #{fkProductGuid,jdbcType=CHAR}, 
+      #{fkUserGuid,jdbcType=CHAR}, #{fkRoleGuid,jdbcType=CHAR})
+  </insert>
+
+  <insert id="insertSelective" parameterType="com.hcloud.microservice.org.facade.entity.BaseRoleUser">
+    insert into t_base_role_user
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="guid != null">
+        guid,
+      </if>
+      <if test="fkOrgGuid != null">
+        fk_org_guid,
+      </if>
+      <if test="fkProductGuid != null">
+        fk_product_guid,
+      </if>
+      <if test="fkUserGuid != null">
+        fk_user_guid,
+      </if>
+      <if test="fkRoleGuid != null">
+        fk_role_guid,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="guid != null">
+        #{guid,jdbcType=CHAR},
+      </if>
+      <if test="fkOrgGuid != null">
+        #{fkOrgGuid,jdbcType=CHAR},
+      </if>
+      <if test="fkProductGuid != null">
+        #{fkProductGuid,jdbcType=CHAR},
+      </if>
+      <if test="fkUserGuid != null">
+        #{fkUserGuid,jdbcType=CHAR},
+      </if>
+      <if test="fkRoleGuid != null">
+        #{fkRoleGuid,jdbcType=CHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.hcloud.microservice.org.facade.entity.BaseRoleUser">
+    update t_base_role_user
+    <set>
+      <if test="fkOrgGuid != null">
+        fk_org_guid = #{fkOrgGuid,jdbcType=CHAR},
+      </if>
+      <if test="fkProductGuid != null">
+        fk_product_guid = #{fkProductGuid,jdbcType=CHAR},
+      </if>
+      <if test="fkUserGuid != null">
+        fk_user_guid = #{fkUserGuid,jdbcType=CHAR},
+      </if>
+      <if test="fkRoleGuid != null">
+        fk_role_guid = #{fkRoleGuid,jdbcType=CHAR},
+      </if>
+    </set>
+    where guid = #{guid,jdbcType=CHAR}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.hcloud.microservice.org.facade.entity.BaseRoleUser">
+    update t_base_role_user
+    set fk_org_guid = #{fkOrgGuid,jdbcType=CHAR},
+      fk_product_guid = #{fkProductGuid,jdbcType=CHAR},
+      fk_user_guid = #{fkUserGuid,jdbcType=CHAR},
+      fk_role_guid = #{fkRoleGuid,jdbcType=CHAR}
+    where guid = #{guid,jdbcType=CHAR}
+  </update>
+</mapper>

+ 74 - 0
src/main/resources/mappers/BaseUserAuthorizationMapper.xml

@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.hcloud.microservice.org.dao.BaseUserAuthorizationMapper">
+  <resultMap id="BaseResultMap" type="com.hcloud.microservice.org.facade.entity.BaseUserAuthorization">
+    <result column="guid" jdbcType="CHAR" property="guid" />
+    <result column="fk_org_guid" jdbcType="CHAR" property="fkOrgGuid" />
+    <result column="fk_product_guid" jdbcType="CHAR" property="fkProductGuid" />
+    <result column="fk_user_guid" jdbcType="CHAR" property="fkUserGuid" />
+    <result column="fk_fun_guid" jdbcType="CHAR" property="fkFunGuid" />
+  </resultMap>
+  <insert id="insert" parameterType="com.hcloud.microservice.org.facade.entity.BaseUserAuthorization">
+    insert into t_base_user_authorization (guid, fk_org_guid, fk_product_guid, 
+      fk_user_guid, fk_fun_guid)
+    values (#{guid,jdbcType=CHAR}, #{fkOrgGuid,jdbcType=CHAR}, #{fkProductGuid,jdbcType=CHAR}, 
+      #{fkUserGuid,jdbcType=CHAR}, #{fkFunGuid,jdbcType=CHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.hcloud.microservice.org.facade.entity.BaseUserAuthorization">
+    insert into t_base_user_authorization
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="guid != null">
+        guid,
+      </if>
+      <if test="fkOrgGuid != null">
+        fk_org_guid,
+      </if>
+      <if test="fkProductGuid != null">
+        fk_product_guid,
+      </if>
+      <if test="fkUserGuid != null">
+        fk_user_guid,
+      </if>
+      <if test="fkFunGuid != null">
+        fk_fun_guid,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="guid != null">
+        #{guid,jdbcType=CHAR},
+      </if>
+      <if test="fkOrgGuid != null">
+        #{fkOrgGuid,jdbcType=CHAR},
+      </if>
+      <if test="fkProductGuid != null">
+        #{fkProductGuid,jdbcType=CHAR},
+      </if>
+      <if test="fkUserGuid != null">
+        #{fkUserGuid,jdbcType=CHAR},
+      </if>
+      <if test="fkFunGuid != null">
+        #{fkFunGuid,jdbcType=CHAR},
+      </if>
+    </trim>
+  </insert>
+  <insert id="batchSaveUserAuthInfo">
+    insert into t_base_user_authorization (guid, fk_org_guid, fk_product_guid,
+      fk_user_guid, fk_fun_guid) values
+      <foreach collection="list" item="bean" open="" separator="," close="">
+        (REPLACE(UUID(),'-',''), #{bean.fkOrgGuid,jdbcType=CHAR}, #{bean.fkProductGuid,jdbcType=CHAR},
+        #{bean.fkUserGuid,jdbcType=CHAR}, #{bean.fkAuthGuid,jdbcType=CHAR})
+      </foreach>
+  </insert>
+  <delete id="delUserAuthInfoByUserId">
+    DELETE FROM t_base_user_authorization WHERE fk_user_guid=#{id} AND fk_org_guid=#{oguid}
+  </delete>
+  <select id="searchUserAuthInfoByUserId" resultType="java.lang.String">
+      SELECT
+          aa.fk_fun_guid
+      FROM
+          t_base_user_authorization aa
+      WHERE
+          aa.fk_org_guid =#{oguid}
+      AND aa.fk_user_guid=#{id}
+  </select>
+</mapper>

+ 382 - 0
src/main/resources/mappers/BaseUserMapper.xml

@@ -0,0 +1,382 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.hcloud.microservice.org.dao.BaseUserMapper">
+  <resultMap id="BaseResultMap" type="com.hcloud.microservice.org.facade.entity.BaseUser">
+    <id column="guid" jdbcType="CHAR" property="guid" />
+    <result column="fk_org_guid" jdbcType="CHAR" property="fkOrgGuid" />
+    <result column="fk_product_guid" jdbcType="CHAR" property="fkProductGuid" />
+    <result column="account" jdbcType="VARCHAR" property="account" />
+    <result column="user_name" jdbcType="VARCHAR" property="userName" />
+    <result column="nickname" jdbcType="VARCHAR" property="nickname" />
+    <result column="dic_sex_code" jdbcType="INTEGER" property="dicSexCode" />
+    <result column="passwd" jdbcType="VARCHAR" property="passwd" />
+    <result column="pid" jdbcType="CHAR" property="pid" />
+    <result column="photo" jdbcType="VARCHAR" property="photo" />
+    <result column="mobile_no" jdbcType="CHAR" property="mobileNo" />
+    <result column="is_modified_pwd" jdbcType="INTEGER" property="isModifiedPwd" />
+    <result column="last_change_pwd_time" jdbcType="TIMESTAMP" property="lastChangePwdTime" />
+    <result column="input_pwd_error_num" jdbcType="INTEGER" property="inputPwdErrorNum" />
+    <result column="last_login_time" jdbcType="TIMESTAMP" property="lastLoginTime" />
+    <result column="lock_time" jdbcType="INTEGER" property="lockTime" />
+    <result column="is_forbid" jdbcType="INTEGER" property="isForbid" />
+    <result column="remark" jdbcType="VARCHAR" property="remark" />
+    <result column="state" jdbcType="INTEGER" property="state" />
+    <result column="create_user" jdbcType="CHAR" property="createUser" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="modified_user" jdbcType="CHAR" property="modifiedUser" />
+    <result column="modified_time" jdbcType="TIMESTAMP" property="modifiedTime" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    guid, fk_org_guid, fk_product_guid, account, user_name, nickname, dic_sex_code, passwd, 
+    pid, photo, mobile_no, is_modified_pwd, last_change_pwd_time, input_pwd_error_num, 
+    last_login_time, lock_time, is_forbid, remark, state, create_user, create_time, modified_user, 
+    modified_time
+  </sql>
+  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
+    select
+    <include refid="Base_Column_List" />
+    from t_base_user
+    where guid = #{guid,jdbcType=CHAR}
+  </select>
+    <select id="searchUserInfoByPage" parameterType="com.hcloud.microserver.commoncore.base.PageBean"
+            resultType="com.hcloud.microservice.org.bo.BaseUserBO">
+        SELECT
+          bb.guid,
+          bb.fk_org_guid AS fkOrgGuid,
+          bb.account,
+          bb.passwd,
+          bb.user_name AS userName,
+          bb.nickname,
+          bb.dic_sex_code AS dicSexCode,
+          bb.last_login_time AS lastLoginTime,
+          bb.is_forbid AS isForbid,
+          bb.remark,
+          dd.org_name AS orgName,
+          aa.role_name AS roleName,
+          aa.guid AS roleId,
+          bb.mobile_no AS mobileNo
+        FROM
+          t_base_user bb
+        LEFT JOIN t_base_org dd ON bb.fk_org_guid = dd.guid
+        LEFT JOIN t_base_role_user cc ON bb.guid =cc.fk_user_guid
+        LEFT JOIN t_base_role aa ON aa.guid = cc.fk_role_guid
+        where
+              bb.state=1
+            <if test="data.guid!=null and data.guid!=''">
+             AND bb.guid = #{data.guid}
+            </if>
+            <if test="data.fkOrgGuid!=null and data.fkOrgGuid!=''">
+             AND bb.fk_org_guid=#{data.fkOrgGuid}
+            </if>
+            <if test="data.account!=null and data.account!=''">
+              AND bb.account LIKE CONCAT(#{data.account},'%')
+            </if>
+            <if test="data.userName!=null and data.userName!=''">
+              AND bb.user_name LIKE CONCAT(#{data.userName},'%')
+            </if>
+            <if test="data.isForbid!=null">
+              AND bb.is_forbid =#{data.isForbid}
+            </if>
+            <if test="data.roleId!=null and data.roleId!=''">
+              AND aa.guid = #{data.roleId}
+            </if>
+            <if test="data.dicSexCode!=null">
+              AND bb.dic_sex_code=#{data.dicSexCode}
+            </if>
+            <if test="data.beginDate!=null and data.beginDate!=''">
+              AND bb.last_login_time >= CONCAT(#{data.beginDate},' 00:00:00')
+            </if>
+            <if test="data.endDate!=null and data.endDate!=''">
+              <![CDATA[
+              AND bb.last_login_time <=CONCAT(#{data.endDate},' 23:59:59')
+            ]]>
+            </if>
+    </select>
+  <select id="getUserInfoByAccount" resultMap="BaseResultMap">
+    select
+      <include refid="Base_Column_List" />
+    from t_base_user
+    where state=1 and account = #{account}
+  </select>
+
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+    delete from t_base_user
+    where guid = #{guid,jdbcType=CHAR}
+  </delete>
+  <insert id="insert" parameterType="com.hcloud.microservice.org.facade.entity.BaseUser">
+    insert into t_base_user (guid, fk_org_guid, fk_product_guid, 
+      account, user_name, nickname, 
+      dic_sex_code, passwd, pid, 
+      photo, mobile_no, is_modified_pwd, 
+      last_change_pwd_time, input_pwd_error_num, 
+      last_login_time, lock_time, is_forbid, 
+      remark, state, create_user, 
+      create_time, modified_user, modified_time
+      )
+    values (#{guid,jdbcType=CHAR}, #{fkOrgGuid,jdbcType=CHAR}, #{fkProductGuid,jdbcType=CHAR}, 
+      #{account,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR}, #{nickname,jdbcType=VARCHAR}, 
+      #{dicSexCode,jdbcType=INTEGER}, #{passwd,jdbcType=VARCHAR}, #{pid,jdbcType=CHAR}, 
+      #{photo,jdbcType=VARCHAR}, #{mobileNo,jdbcType=CHAR}, #{isModifiedPwd,jdbcType=INTEGER}, 
+      #{lastChangePwdTime,jdbcType=TIMESTAMP}, #{inputPwdErrorNum,jdbcType=INTEGER}, 
+      #{lastLoginTime,jdbcType=TIMESTAMP}, #{lockTime,jdbcType=INTEGER}, #{isForbid,jdbcType=INTEGER}, 
+      #{remark,jdbcType=VARCHAR}, #{state,jdbcType=INTEGER}, #{createUser,jdbcType=CHAR}, 
+      #{createTime,jdbcType=TIMESTAMP}, #{modifiedUser,jdbcType=CHAR}, #{modifiedTime,jdbcType=TIMESTAMP}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.hcloud.microservice.org.facade.entity.BaseUser">
+    insert into t_base_user
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="guid != null">
+        guid,
+      </if>
+      <if test="fkOrgGuid != null">
+        fk_org_guid,
+      </if>
+      <if test="fkProductGuid != null">
+        fk_product_guid,
+      </if>
+      <if test="account != null">
+        account,
+      </if>
+      <if test="userName != null">
+        user_name,
+      </if>
+      <if test="nickname != null">
+        nickname,
+      </if>
+      <if test="dicSexCode != null">
+        dic_sex_code,
+      </if>
+      <if test="passwd != null">
+        passwd,
+      </if>
+      <if test="pid != null">
+        pid,
+      </if>
+      <if test="photo != null">
+        photo,
+      </if>
+      <if test="mobileNo != null">
+        mobile_no,
+      </if>
+      <if test="isModifiedPwd != null">
+        is_modified_pwd,
+      </if>
+      <if test="lastChangePwdTime != null">
+        last_change_pwd_time,
+      </if>
+      <if test="inputPwdErrorNum != null">
+        input_pwd_error_num,
+      </if>
+      <if test="lastLoginTime != null">
+        last_login_time,
+      </if>
+      <if test="lockTime != null">
+        lock_time,
+      </if>
+      <if test="isForbid != null">
+        is_forbid,
+      </if>
+      <if test="remark != null">
+        remark,
+      </if>
+      <if test="state != null">
+        state,
+      </if>
+      <if test="createUser != null">
+        create_user,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="modifiedUser != null">
+        modified_user,
+      </if>
+      <if test="modifiedTime != null">
+        modified_time,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="guid != null">
+        #{guid,jdbcType=CHAR},
+      </if>
+      <if test="fkOrgGuid != null">
+        #{fkOrgGuid,jdbcType=CHAR},
+      </if>
+      <if test="fkProductGuid != null">
+        #{fkProductGuid,jdbcType=CHAR},
+      </if>
+      <if test="account != null">
+        #{account,jdbcType=VARCHAR},
+      </if>
+      <if test="userName != null">
+        #{userName,jdbcType=VARCHAR},
+      </if>
+      <if test="nickname != null">
+        #{nickname,jdbcType=VARCHAR},
+      </if>
+      <if test="dicSexCode != null">
+        #{dicSexCode,jdbcType=INTEGER},
+      </if>
+      <if test="passwd != null">
+        #{passwd,jdbcType=VARCHAR},
+      </if>
+      <if test="pid != null">
+        #{pid,jdbcType=CHAR},
+      </if>
+      <if test="photo != null">
+        #{photo,jdbcType=VARCHAR},
+      </if>
+      <if test="mobileNo != null">
+        #{mobileNo,jdbcType=CHAR},
+      </if>
+      <if test="isModifiedPwd != null">
+        #{isModifiedPwd,jdbcType=INTEGER},
+      </if>
+      <if test="lastChangePwdTime != null">
+        #{lastChangePwdTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="inputPwdErrorNum != null">
+        #{inputPwdErrorNum,jdbcType=INTEGER},
+      </if>
+      <if test="lastLoginTime != null">
+        #{lastLoginTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="lockTime != null">
+        #{lockTime,jdbcType=INTEGER},
+      </if>
+      <if test="isForbid != null">
+        #{isForbid,jdbcType=INTEGER},
+      </if>
+      <if test="remark != null">
+        #{remark,jdbcType=VARCHAR},
+      </if>
+      <if test="state != null">
+        #{state,jdbcType=INTEGER},
+      </if>
+      <if test="createUser != null">
+        #{createUser,jdbcType=CHAR},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="modifiedUser != null">
+        #{modifiedUser,jdbcType=CHAR},
+      </if>
+      <if test="modifiedTime != null">
+        #{modifiedTime,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.hcloud.microservice.org.facade.entity.BaseUser">
+    update t_base_user
+    <set>
+      <if test="fkOrgGuid != null">
+        fk_org_guid = #{fkOrgGuid,jdbcType=CHAR},
+      </if>
+      <if test="fkProductGuid != null">
+        fk_product_guid = #{fkProductGuid,jdbcType=CHAR},
+      </if>
+      <if test="account != null">
+        account = #{account,jdbcType=VARCHAR},
+      </if>
+      <if test="userName != null">
+        user_name = #{userName,jdbcType=VARCHAR},
+      </if>
+      <if test="nickname != null">
+        nickname = #{nickname,jdbcType=VARCHAR},
+      </if>
+      <if test="dicSexCode != null">
+        dic_sex_code = #{dicSexCode,jdbcType=INTEGER},
+      </if>
+      <if test="passwd != null">
+        passwd = #{passwd,jdbcType=VARCHAR},
+      </if>
+      <if test="pid != null">
+        pid = #{pid,jdbcType=CHAR},
+      </if>
+      <if test="photo != null">
+        photo = #{photo,jdbcType=VARCHAR},
+      </if>
+      <if test="mobileNo != null">
+        mobile_no = #{mobileNo,jdbcType=CHAR},
+      </if>
+      <if test="isModifiedPwd != null">
+        is_modified_pwd = #{isModifiedPwd,jdbcType=INTEGER},
+      </if>
+      <if test="lastChangePwdTime != null">
+        last_change_pwd_time = #{lastChangePwdTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="inputPwdErrorNum != null">
+        input_pwd_error_num = #{inputPwdErrorNum,jdbcType=INTEGER},
+      </if>
+      <if test="lastLoginTime != null">
+        last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="lockTime != null">
+        lock_time = #{lockTime,jdbcType=INTEGER},
+      </if>
+      <if test="isForbid != null">
+        is_forbid = #{isForbid,jdbcType=INTEGER},
+      </if>
+      <if test="remark != null">
+        remark = #{remark,jdbcType=VARCHAR},
+      </if>
+      <if test="state != null">
+        state = #{state,jdbcType=INTEGER},
+      </if>
+      <if test="createUser != null">
+        create_user = #{createUser,jdbcType=CHAR},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="modifiedUser != null">
+        modified_user = #{modifiedUser,jdbcType=CHAR},
+      </if>
+      <if test="modifiedTime != null">
+        modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    where guid = #{guid,jdbcType=CHAR}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.hcloud.microservice.org.facade.entity.BaseUser">
+    update t_base_user
+    set fk_org_guid = #{fkOrgGuid,jdbcType=CHAR},
+      fk_product_guid = #{fkProductGuid,jdbcType=CHAR},
+      account = #{account,jdbcType=VARCHAR},
+      user_name = #{userName,jdbcType=VARCHAR},
+      nickname = #{nickname,jdbcType=VARCHAR},
+      dic_sex_code = #{dicSexCode,jdbcType=INTEGER},
+      passwd = #{passwd,jdbcType=VARCHAR},
+      pid = #{pid,jdbcType=CHAR},
+      photo = #{photo,jdbcType=VARCHAR},
+      mobile_no = #{mobileNo,jdbcType=CHAR},
+      is_modified_pwd = #{isModifiedPwd,jdbcType=INTEGER},
+      last_change_pwd_time = #{lastChangePwdTime,jdbcType=TIMESTAMP},
+      input_pwd_error_num = #{inputPwdErrorNum,jdbcType=INTEGER},
+      last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP},
+      lock_time = #{lockTime,jdbcType=INTEGER},
+      is_forbid = #{isForbid,jdbcType=INTEGER},
+      remark = #{remark,jdbcType=VARCHAR},
+      state = #{state,jdbcType=INTEGER},
+      create_user = #{createUser,jdbcType=CHAR},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      modified_user = #{modifiedUser,jdbcType=CHAR},
+      modified_time = #{modifiedTime,jdbcType=TIMESTAMP}
+    where guid = #{guid,jdbcType=CHAR}
+  </update>
+
+  <select id="selectAccountNotSelf" parameterType="com.hcloud.microservice.org.facade.forms.BaseUserForm" resultType="com.hcloud.microservice.org.facade.entity.BaseUser">
+    select <include refid="Base_Column_List" />
+    from t_base_user
+    <where>
+      <if test="account != null and account != ''">
+        and account = #{account,jdbcType=VARCHAR}
+      </if>
+      <if test="guid != null and guid != ''">
+        and guid != #{guid,jdbcType=CHAR}
+      </if>
+    </where>
+  </select>
+</mapper>

+ 54 - 0
src/main/resources/swagger-ui.html

@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="UTF-8">
+    <title>Swagger UI</title>
+    <link rel="icon" type="image/png" href="webjars/springfox-swagger-ui/images/favicon-32x32.png" sizes="32x32"/>
+    <link rel="icon" type="image/png" href="webjars/springfox-swagger-ui/images/favicon-16x16.png" sizes="16x16"/>
+    <link href='webjars/springfox-swagger-ui/css/typography.css' media='screen' rel='stylesheet' type='text/css'/>
+    <link href='webjars/springfox-swagger-ui/css/reset.css' media='screen' rel='stylesheet' type='text/css'/>
+    <link href='webjars/springfox-swagger-ui/css/screen.css' media='screen' rel='stylesheet' type='text/css'/>
+    <link href='webjars/springfox-swagger-ui/css/reset.css' media='print' rel='stylesheet' type='text/css'/>
+    <link href='webjars/springfox-swagger-ui/css/print.css' media='print' rel='stylesheet' type='text/css'/>
+
+    <script src='webjars/springfox-swagger-ui/lib/object-assign-pollyfill.js' type='text/javascript'></script>
+    <script src='webjars/springfox-swagger-ui/lib/jquery-1.8.0.min.js' type='text/javascript'></script>
+    <script src='webjars/springfox-swagger-ui/lib/jquery.slideto.min.js' type='text/javascript'></script>
+    <script src='webjars/springfox-swagger-ui/lib/jquery.wiggle.min.js' type='text/javascript'></script>
+    <script src='webjars/springfox-swagger-ui/lib/jquery.ba-bbq.min.js' type='text/javascript'></script>
+    <script src='webjars/springfox-swagger-ui/lib/handlebars-4.0.5.js' type='text/javascript'></script>
+    <script src='webjars/springfox-swagger-ui/lib/lodash.min.js' type='text/javascript'></script>
+    <script src='webjars/springfox-swagger-ui/lib/backbone-min.js' type='text/javascript'></script>
+    <script src='webjars/springfox-swagger-ui/swagger-ui.min.js' type='text/javascript'></script>
+    <script src='webjars/springfox-swagger-ui/lib/highlight.9.1.0.pack.js' type='text/javascript'></script>
+    <script src='webjars/springfox-swagger-ui/lib/highlight.9.1.0.pack_extended.js' type='text/javascript'></script>
+    <script src='webjars/springfox-swagger-ui/lib/jsoneditor.min.js' type='text/javascript'></script>
+    <script src='webjars/springfox-swagger-ui/lib/marked.js' type='text/javascript'></script>
+    <script src='webjars/springfox-swagger-ui/lib/swagger-oauth.js' type='text/javascript'></script>
+    <script src='webjars/springfox-swagger-ui/springfox.js' type='text/javascript'></script>
+
+    <!--国际化操作:选择中文版 -->
+    <script src='webjars/springfox-swagger-ui/lang/translator.js' type='text/javascript'></script>
+    <script src='webjars/springfox-swagger-ui/lang/zh-cn.js' type='text/javascript'></script>
+
+</head>
+
+<body class="swagger-section">
+<div id='header'>
+    <div class="swagger-ui-wrap">
+        <a id="logo" href="http://swagger.io">![](webjars/springfox-swagger-ui/images/logo_small.png)<span class="logo__title">swagger</span></a>
+        <form id='api_selector'>
+            <div class='input'>
+                <select id="select_baseUrl" name="select_baseUrl"></select>
+            </div>
+            <div class='input'><input placeholder="http://example.com/api" id="input_baseUrl" name="baseUrl" type="text"/></div>
+            <div id='auth_container'></div>
+            <div class='input'><a id="explore" class="header__btn" href="#" data-sw-translate>Explore</a></div>
+        </form>
+    </div>
+</div>
+
+<div id="message-bar" class="swagger-ui-wrap" data-sw-translate> </div>
+<div id="swagger-ui-container" class="swagger-ui-wrap"></div>
+</body>
+</html>

+ 17 - 0
src/test/java/com/hcloud/microservice/org/OrgManageServiceApplicationTests.java

@@ -0,0 +1,17 @@
+package com.hcloud.microservice.org;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest
+public class OrgManageServiceApplicationTests {
+
+    @Test
+    public void contextLoads() {
+    }
+
+}
+

+ 8 - 0
src/test/java/com/hcloud/microservice/org/TestInit.java

@@ -0,0 +1,8 @@
+package com.hcloud.microservice.org;
+
+public class TestInit {
+    protected static final String FK_PRODUCT_GUID="0100e712ef4f41bda6258b7d70f62bfa";
+    protected static final String FK_CREATE_USER="01305ed226d74b3d97507a7c629e9377";
+    protected static final String FK_MODIFIED_USER="038886af1e954e3daf24854583c77520";
+    protected static final String FK_ORG_GUID="05fd823546a3428c9a3952b00f047cd2";
+}

+ 47 - 0
src/test/java/com/hcloud/microservice/org/controller/AuthManagerControllerTest.java

@@ -0,0 +1,47 @@
+package com.hcloud.microservice.org.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.hcloud.microservice.org.facade.forms.BaseAuthForm;
+import lombok.extern.slf4j.Slf4j;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.http.MediaType;
+import org.springframework.test.context.junit4.SpringRunner;
+import org.springframework.test.web.servlet.MockMvc;
+import org.springframework.test.web.servlet.MvcResult;
+
+import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
+import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
+import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
+
+@Slf4j
+@RunWith(SpringRunner.class)
+@SpringBootTest
+@AutoConfigureMockMvc
+public class AuthManagerControllerTest {
+
+    @Autowired
+    private MockMvc mockMvc;
+
+    @Test
+    public void searchAuthInfoByPage() throws Exception {
+        BaseAuthForm baseAuthForm = new BaseAuthForm();
+        baseAuthForm.setFunName("权限");
+            MvcResult mvcResult =  mockMvc.perform(post("/auth/searchAuthInfoByPage").
+                    contentType(MediaType.APPLICATION_JSON_UTF8).
+                    content(JSONObject.toJSONString(baseAuthForm))).andExpect(status().isOk()).
+                    andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)).andReturn();
+            log.info("========================>{}",mvcResult.getResponse().getContentAsString());
+    }
+
+    @Test
+    public void addAuthInfo() {
+    }
+
+    @Test
+    public void updateAuthInfo() {
+    }
+}

+ 93 - 0
src/test/java/com/hcloud/microservice/org/controller/UserManagerControllerTest.java

@@ -0,0 +1,93 @@
+package com.hcloud.microservice.org.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.hcloud.microservice.org.TestInit;
+import com.hcloud.microservice.org.facade.forms.BaseUserForm;
+import lombok.extern.slf4j.Slf4j;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.http.MediaType;
+import org.springframework.test.context.junit4.SpringRunner;
+import org.springframework.test.web.servlet.MockMvc;
+import org.springframework.test.web.servlet.MvcResult;
+
+import java.util.Date;
+
+import static org.junit.Assert.*;
+import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
+import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
+import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
+
+@Slf4j
+@RunWith(SpringRunner.class)
+@SpringBootTest
+@AutoConfigureMockMvc
+public class UserManagerControllerTest extends TestInit {
+
+    @Autowired
+    private MockMvc mockMvc;
+
+    @Test
+    public void searchUserInfoByPage() {
+    }
+
+    @Test
+    public void addUserInfo() throws Exception {
+        BaseUserForm user = new BaseUserForm();
+        user.setAccount("admin");
+        user.setUserName("超级管理员");
+        user.setDicSexCode(1);
+        user.setPasswd("123456");
+        user.setIsForbid(0);
+        user.setRemark("测试类生成用户信息");
+        user.setState(1);
+        user.setCreateUser(super.FK_CREATE_USER);
+        user.setCreateTime(new Date());
+        user.setModifiedUser(super.FK_MODIFIED_USER);
+        user.setModifiedTime(new Date());
+        user.setFkProductGuid(super.FK_PRODUCT_GUID);
+        user.setFkOrgGuid(super.FK_ORG_GUID);
+        MvcResult result = mockMvc.perform(post("/user/addUserInfo").
+                contentType(MediaType.APPLICATION_JSON_UTF8).
+                content(JSONObject.toJSONString(user))).
+                andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)).
+                andExpect(status().isOk()).andReturn();
+        log.info("json===================>{}", result.getResponse().getContentAsString());
+    }
+
+    @Test
+    public void updateUserInfo() {
+    }
+
+    @Test
+    public void searchUserAuthInfo() {
+    }
+
+    @Test
+    public void distributionUserAuthInfo() {
+    }
+
+    @Test
+    public void loginSystem() throws Exception {
+        String account = "admin";
+        String password = "123456";
+        MvcResult result = mockMvc.perform(post("/user/addUserInfo").
+                contentType(MediaType.TEXT_HTML_VALUE).
+                param("account", account).
+                param("password", password)).andReturn();
+        log.info("result=========================>{}", result.getResponse().getStatus());
+        log.info("result=========================>{}", result.getResponse().getContentAsString());
+    }
+
+    @Test
+    public void getUserMenusInfo() {
+    }
+
+    @Test
+    public void getSubUserAuthInfo() {
+    }
+}

+ 105 - 0
src/test/java/com/hcloud/microservice/org/service/impl/BaseAuthorizationServiceImplTest.java

@@ -0,0 +1,105 @@
+package com.hcloud.microservice.org.service.impl;
+
+import com.github.pagehelper.PageInfo;
+import com.hcloud.microserver.commoncore.util.GetUUID;
+import com.hcloud.microservice.org.TestInit;
+import com.hcloud.microservice.org.bo.BaseAuthBO;
+import com.hcloud.microservice.org.facade.entity.BaseAuthorization;
+import com.hcloud.microservice.org.facade.forms.BaseAuthForm;
+import com.hcloud.microservice.org.service.BaseAuthorizationService;
+import lombok.extern.slf4j.Slf4j;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Date;
+import java.util.List;
+
+@Slf4j
+@RunWith(SpringRunner.class)
+@SpringBootTest
+@Transactional
+public class BaseAuthorizationServiceImplTest extends TestInit {
+
+    @Autowired
+    private BaseAuthorizationService baseAuthorizationService;
+
+    private BaseAuthorization auth;
+
+    @Before
+    public void setUp() throws Exception {
+        auth = new BaseAuthorization();
+        auth.setParentGuid("1f95b74e91f146ebaee5ad0a46742aad");
+        auth.setFkProductGuid(super.FK_PRODUCT_GUID);
+        auth.setFunName("禁用平台用户信息");
+        auth.setAuthStr("platform:sys:deluser");
+        auth.setRemark("禁用平台用户信息");
+        auth.setOrderby(96);
+        auth.setNodeType(1);
+        auth.setIsForbid(0);
+        auth.setState(1);
+        auth.setCreateUser(super.FK_CREATE_USER);
+        auth.setCreateTime(new Date());
+        auth.setModifiedUser(super.FK_MODIFIED_USER);
+        auth.setModifiedTime(new Date());
+    }
+
+    @After
+    public void tearDown() throws Exception {
+    }
+
+    @Test
+    public void saveSelective() {
+      int i=  baseAuthorizationService.saveSelective(auth);
+        Assert.assertNotEquals(0,i);
+    }
+
+    @Test
+    public void queryByPrimaryKey() {
+        BaseAuthorization bean =
+                baseAuthorizationService.queryByPrimaryKey("903471b6473d464098b8d85c8db8885d");
+        Assert.assertNotNull(bean);
+    }
+
+    @Test
+    public void modifyByPrimaryKeySelective() {
+        BaseAuthorization bean = new BaseAuthorization();
+        bean.setGuid("903471b6473d464098b8d85c8db8885d");
+        bean.setIsForbid(1);
+        int i = baseAuthorizationService.modifyByPrimaryKeySelective(auth);
+        Assert.assertNotEquals(0,i);
+        BaseAuthorization beans =
+                baseAuthorizationService.queryByPrimaryKey("903471b6473d464098b8d85c8db8885d");
+        Assert.assertEquals(new Integer(1),beans.getIsForbid());
+    }
+
+    @Test
+    public void searchBaseAuthInfoByPage() {
+        BaseAuthForm baseAuthForm = new BaseAuthForm();
+        //baseAuthForm.setFunName("权限管理");
+        baseAuthForm.setFileUrl("sys/auth/managerPage");
+        PageInfo pageInfo = baseAuthorizationService.searchBaseAuthInfoByPage(baseAuthForm);
+        List page = pageInfo.getList();
+        BaseAuthBO pps = (BaseAuthBO) page.get(0);
+        log.info("funName=============>{}",pps.getFunName());
+        log.info("fileUrl=============>{}",pps.getFileUrl());
+        Assert.assertEquals(1,pageInfo.getTotal());
+        Assert.assertEquals(pps.getFileUrl(),"sys/auth/managerPage");
+    }
+
+    @Test
+    public void searchMenuAuthInfo() {
+        List list = baseAuthorizationService.searchMenuAuthInfo();
+        for (Object o:list) {
+            BaseAuthBO bo = (BaseAuthBO) o;
+            log.info("bo info==============>{}",bo);
+        }
+        Assert.assertEquals(list.size(),3);
+    }
+}

+ 113 - 0
src/test/java/com/hcloud/microservice/org/service/impl/BaseOrgAuthorizationServiceImplTest.java

@@ -0,0 +1,113 @@
+package com.hcloud.microservice.org.service.impl;
+
+import com.github.pagehelper.Page;
+import com.github.pagehelper.PageInfo;
+import com.hcloud.microserver.commoncore.util.GetUUID;
+import com.hcloud.microservice.org.TestInit;
+import com.hcloud.microservice.org.facade.entity.BaseOrgAuthorization;
+import com.hcloud.microservice.org.facade.forms.BaseOrgAuthForm;
+import com.hcloud.microservice.org.service.BaseOrgAuthorizationService;
+import lombok.extern.slf4j.Slf4j;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import static org.junit.Assert.*;
+
+@Slf4j
+@RunWith(SpringRunner.class)
+@SpringBootTest
+//@Transactional
+public class BaseOrgAuthorizationServiceImplTest extends TestInit {
+
+    @Autowired
+    private BaseOrgAuthorizationService baseOrgAuthorizationService;
+
+    @Before
+    public void setUp() throws Exception {
+    }
+
+    @After
+    public void tearDown() throws Exception {
+    }
+
+    @Test
+    public void saveSelective() {
+        BaseOrgAuthorization bean = new BaseOrgAuthorization();
+        bean.setGuid(GetUUID.getUUID());
+        bean.setFkProductGuid(super.FK_PRODUCT_GUID);
+        bean.setFkOrgGuid(super.FK_ORG_GUID);
+        bean.setParentGuid(GetUUID.getUUID());
+        bean.setFkAuthGuid(GetUUID.getUUID());
+        bean.setFunName("溯源系统管理");
+        bean.setAuthStr("sys:org:index");
+        bean.setRemark("溯源系统管理");
+        bean.setOrderby(99);
+        bean.setIsForbid(0);
+        bean.setState(1);
+        bean.setCreateUser(super.FK_CREATE_USER);
+        bean.setCreateTime(new Date());
+        bean.setModifiedUser(super.FK_MODIFIED_USER);
+        bean.setModifiedTime(new Date());
+        bean.setNodeType(0);
+        int i= baseOrgAuthorizationService.saveSelective(bean);
+        Assert.assertEquals(i,1);
+    }
+
+    @Test
+    public void queryByPrimaryKey() {
+    }
+
+    @Test
+    public void modifyByPrimaryKeySelective() {
+    }
+
+    @Test
+    public void batchOrgAuthInfo() {
+        Page<BaseOrgAuthForm> list = new Page<>();
+        for (int i = 0; i <20 ; i++) {
+            BaseOrgAuthForm bean = new BaseOrgAuthForm();
+            bean.setId(GetUUID.getUUID());
+            bean.setFkProductGuid(super.FK_PRODUCT_GUID);
+            bean.setFkOrgGuid(super.FK_ORG_GUID);
+            bean.setParentGuid(GetUUID.getUUID());
+            bean.setFkAuthGuid(GetUUID.getUUID());
+            bean.setFunName("溯源系统管理");
+            bean.setAuthStr("sys:org:index");
+            bean.setFileUrl("");
+            bean.setIco("");
+            bean.setRemark("溯源系统管理");
+            bean.setOrderby(99);
+            bean.setIsForbid(0);
+            bean.setState(1);
+            bean.setCreateUser(super.FK_CREATE_USER);
+            bean.setCreateTime(new Date());
+            bean.setModifiedUser(super.FK_MODIFIED_USER);
+            bean.setModifiedTime(new Date());
+            bean.setNodeType(0);
+            list.add(bean);
+        }
+        int i = baseOrgAuthorizationService.batchOrgAuthInfo(list,super.FK_ORG_GUID);
+        Assert.assertEquals(i,20);
+    }
+
+    @Test
+    public void searchOrgAuthInfoByOrgId() {
+        BaseOrgAuthForm baseOrgAuthForm = new BaseOrgAuthForm();
+        baseOrgAuthForm.setFkOrgGuid(super.FK_ORG_GUID);
+        PageInfo pageInfo = baseOrgAuthorizationService.searchOrgAuthInfoByOrgId(baseOrgAuthForm);
+        log.info("context=================>{}",pageInfo.getList().get(0));
+        Assert.assertEquals(21,pageInfo.getTotal());
+        Assert.assertEquals(10,pageInfo.getList().size());
+
+    }
+}

+ 90 - 0
src/test/java/com/hcloud/microservice/org/service/impl/BaseOrgServiceImplTest.java

@@ -0,0 +1,90 @@
+package com.hcloud.microservice.org.service.impl;
+
+import com.github.pagehelper.PageInfo;
+import com.hcloud.microserver.commoncore.util.GetUUID;
+import com.hcloud.microservice.org.TestInit;
+import com.hcloud.microservice.org.facade.entity.BaseOrg;
+import com.hcloud.microservice.org.facade.forms.BaseOrgForm;
+import com.hcloud.microservice.org.service.BaseOrgService;
+import lombok.extern.slf4j.Slf4j;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import java.util.Date;
+
+import static org.junit.Assert.*;
+
+@Slf4j
+@RunWith(SpringRunner.class)
+@SpringBootTest
+//@Transactional
+public class BaseOrgServiceImplTest extends TestInit {
+
+    @Autowired
+    private BaseOrgService baseOrgService;
+
+    @Test
+    public void saveSelective() {
+        BaseOrg baseOrg = new BaseOrg();
+        baseOrg.setGuid(GetUUID.getUUID());
+        baseOrg.setDicOrgTypeCode(1);
+        baseOrg.setOrgName("xxxxx个人");
+        baseOrg.setOrgCode("600160");
+        baseOrg.setOrgBrevity("160");
+        baseOrg.setIco("icon.ico");
+        baseOrg.setOrgAddress("贵州省修文县xxxx乡xxxx村");
+        baseOrg.setPositionType(3);
+        baseOrg.setFkPositionId(GetUUID.getUUID());
+        baseOrg.setPrincipals("王五");
+        baseOrg.setTel("18799876543");
+        baseOrg.setRemark("测试方法生成记录二");
+        baseOrg.setQrcodeUrlPrefixe("https://www.xxxxx.com/600160");
+        baseOrg.setState(1);
+        baseOrg.setCreateUser(super.FK_CREATE_USER);
+        baseOrg.setCreateTime(new Date());
+        baseOrg.setModifyUser(super.FK_MODIFIED_USER);
+        baseOrg.setModiedTime(new Date());
+        int i = baseOrgService.saveSelective(baseOrg);
+        Assert.assertEquals(1,i);
+    }
+
+    @Test
+    public void queryByPrimaryKey() {
+        String guid="7ea42e7a2bb94670951b9d0fcf82a1d8";
+        BaseOrg baseOrg = baseOrgService.queryByPrimaryKey(guid);
+        Assert.assertNotNull("查询到条件对象",baseOrg);
+    }
+
+    @Test
+    public void modifyByPrimaryKeySelective() {
+        BaseOrg baseOrg = new BaseOrg();
+        baseOrg.setGuid("7ea42e7a2bb94670951b9d0fcf82a1d8");
+        baseOrg.setPrincipals("李四");
+        baseOrg.setTel("18799876578");
+        baseOrg.setRemark("测试方法修改记录");
+        baseOrg.setState(0);
+        baseOrg.setModifyUser(super.FK_MODIFIED_USER);
+        baseOrg.setModiedTime(new Date());
+        int i = baseOrgService.modifyByPrimaryKeySelective(baseOrg);
+        Assert.assertEquals(1,i);
+        BaseOrg baseOrgs = baseOrgService.queryByPrimaryKey(baseOrg.getGuid());
+        Assert.assertEquals("李四",baseOrgs.getPrincipals());
+    }
+
+    @Test
+    public void searchOrgInfoByPage() {
+        BaseOrgForm baseOrgForm = new BaseOrgForm();
+//        baseOrgForm.setDicOrgTypeCode(1);
+        baseOrgForm.setOrgName("xxxxx农企");
+//        baseOrgForm.setOrgCode("600159");
+//        baseOrgForm.setOrgAddress("贵州省贵阳市xxxx区xxxx村");
+        baseOrgForm.setTel("18799876578");
+        PageInfo pageInfo = baseOrgService.searchOrgInfoByPage(baseOrgForm);
+        Assert.assertNotNull(pageInfo.getList());
+        Assert.assertEquals(1,pageInfo.getTotal());
+    }
+}

+ 113 - 0
src/test/java/com/hcloud/microservice/org/service/impl/BaseRoleServiceImplTest.java

@@ -0,0 +1,113 @@
+package com.hcloud.microservice.org.service.impl;
+
+import com.github.pagehelper.PageInfo;
+import com.hcloud.microserver.commoncore.util.GetUUID;
+import com.hcloud.microservice.org.TestInit;
+import com.hcloud.microservice.org.facade.entity.BaseRole;
+import com.hcloud.microservice.org.facade.forms.BaseRoleAuthForm;
+import com.hcloud.microservice.org.facade.forms.BaseRoleForm;
+import com.hcloud.microservice.org.service.BaseRoleService;
+import lombok.extern.slf4j.Slf4j;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+@Slf4j
+@RunWith(SpringRunner.class)
+@SpringBootTest
+//@Transactional
+public class BaseRoleServiceImplTest extends TestInit {
+
+    @Autowired
+    private BaseRoleService baseRoleService;
+
+    @Test
+    public void saveSelective() {
+        BaseRole baseRole = new BaseRole();
+        baseRole.setGuid(GetUUID.getUUID());
+        baseRole.setFkOrgGuid(super.FK_ORG_GUID);
+        baseRole.setFkProductGuid(super.FK_PRODUCT_GUID);
+        baseRole.setRoleName("业务员");
+        baseRole.setIsForbid(0);
+        baseRole.setRemark("测试方法生成角色信息");
+        baseRole.setState(1);
+        baseRole.setCreateUser(super.FK_CREATE_USER);
+        baseRole.setCreateTime(new Date());
+        baseRole.setModifiedUser(super.FK_MODIFIED_USER);
+        baseRole.setModifiedTime(new Date());
+       int i = baseRoleService.saveSelective(baseRole);
+        Assert.assertEquals(1,i);
+    }
+
+    @Test
+    public void queryByPrimaryKey() {
+        String guid = "8e1ccb4116454ebbbb5f0970422253b0";
+        BaseRole role = baseRoleService.queryByPrimaryKey(guid);
+        Assert.assertNotNull(role);
+        Assert.assertEquals(guid,role.getGuid());
+    }
+
+    @Test
+    public void modifyByPrimaryKeySelective() {
+        String guid = "8e1ccb4116454ebbbb5f0970422253b0";
+        BaseRole baseRole = new BaseRole();
+        baseRole.setGuid(guid);
+        baseRole.setFkOrgGuid(super.FK_ORG_GUID);
+        baseRole.setFkProductGuid(super.FK_PRODUCT_GUID);
+        baseRole.setRoleName("信息管理员");
+        baseRole.setIsForbid(0);
+        baseRole.setRemark("测试方法修改角色信息");
+        baseRole.setState(0);
+        baseRole.setModifiedUser(super.FK_MODIFIED_USER);
+        baseRole.setModifiedTime(new Date());
+        int i = baseRoleService.modifyByPrimaryKeySelective(baseRole);
+        Assert.assertEquals(1,i);
+    }
+
+    @Test
+    public void batchSaveRoleAuthInfo() {
+        String guid = "8e1ccb4116454ebbbb5f0970422253b0";
+        List<BaseRoleAuthForm> list = new ArrayList<>();
+        for (int i = 0; i <20 ; i++) {
+            BaseRoleAuthForm baseRoleAuthForm = new BaseRoleAuthForm();
+            baseRoleAuthForm.setFkAuthGuid(GetUUID.getUUID());
+            baseRoleAuthForm.setFkRoleGuid(guid);
+            baseRoleAuthForm.setFkProductGuid(super.FK_PRODUCT_GUID);
+            baseRoleAuthForm.setFkOrgGuid(super.FK_ORG_GUID);
+            list.add(baseRoleAuthForm);
+        }
+        int i = baseRoleService.batchSaveRoleAuthInfo(list,guid,super.FK_ORG_GUID);
+        Assert.assertEquals(20,i);
+    }
+
+    @Test
+    public void searchRoleAuthByRoleId() {
+        String guid = "8e1ccb4116454ebbbb5f0970422253b0";
+        List<String> list = new ArrayList<>(); //baseRoleService.searchRoleAuthByRoleId(guid,super.FK_ORG_GUID);
+//        Assert.assertNotNull(list);
+//        Assert.assertEquals(20,list.size());
+    }
+
+    @Test
+    public void delRoleAuthInfoByRoleId() {
+        String guid = "8e1ccb4116454ebbbb5f0970422253b0";
+        int i = baseRoleService.delRoleAuthInfoByRoleId(guid,super.FK_ORG_GUID);
+        Assert.assertEquals(20,i);
+    }
+
+    @Test
+    public void  searchRoleInfoByPage(){
+        BaseRoleForm baseRoleForm = new BaseRoleForm();
+        baseRoleForm.setRoleName("信息");
+       PageInfo pageInfo =  baseRoleService.searchRoleInfoByPage(baseRoleForm);
+       Assert.assertNotNull(pageInfo.getList());
+       Assert.assertEquals(1,pageInfo.getTotal());
+    }
+}

+ 151 - 0
src/test/java/com/hcloud/microservice/org/service/impl/BaseUserServiceImplTest.java

@@ -0,0 +1,151 @@
+package com.hcloud.microservice.org.service.impl;
+
+import com.github.pagehelper.PageInfo;
+import com.hcloud.microserver.commoncore.util.GetUUID;
+import com.hcloud.microserver.commoncore.util.Md5Util;
+import com.hcloud.microservice.org.TestInit;
+import com.hcloud.microservice.org.facade.entity.BaseUser;
+import com.hcloud.microservice.org.facade.forms.BaseRoleUserForm;
+import com.hcloud.microservice.org.facade.forms.BaseUserAuthForm;
+import com.hcloud.microservice.org.facade.forms.BaseUserForm;
+import com.hcloud.microservice.org.service.BaseUserService;
+import lombok.extern.slf4j.Slf4j;
+import org.bouncycastle.jcajce.provider.digest.MD5;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import static org.junit.Assert.*;
+
+@Slf4j
+@RunWith(SpringRunner.class)
+@SpringBootTest
+//@Transactional
+public class BaseUserServiceImplTest extends TestInit {
+
+    @Autowired
+    private BaseUserService baseUserService;
+
+    @Test
+    public void saveSelective() {
+        BaseUser baseUser = new BaseUser();
+        baseUser.setGuid(GetUUID.getUUID());
+        baseUser.setFkOrgGuid(super.FK_ORG_GUID);
+        baseUser.setFkProductGuid(super.FK_PRODUCT_GUID);
+        baseUser.setAccount("999999");
+        baseUser.setUserName("测试类生成用户2");
+        baseUser.setNickname("安全测试通过2");
+        baseUser.setDicSexCode(1);
+        baseUser.setPasswd(Md5Util.toMD5("123456"));
+        baseUser.setPid("5201121478956421");
+        baseUser.setPhoto("images/sss.png");
+        baseUser.setMobileNo("13809548362");
+        baseUser.setIsModifiedPwd(0);
+        baseUser.setLastChangePwdTime(new Date());
+        baseUser.setInputPwdErrorNum(0);
+        baseUser.setLastLoginTime(new Date());
+        baseUser.setLockTime(0);
+        baseUser.setIsForbid(0);
+        baseUser.setRemark("测试类生成用户信息");
+        baseUser.setState(1);
+        baseUser.setCreateUser(super.FK_CREATE_USER);
+        baseUser.setCreateTime(new Date());
+        baseUser.setModifiedUser(super.FK_MODIFIED_USER);
+        baseUser.setModifiedTime(new Date());
+        int i = baseUserService.saveSelective(baseUser);
+        Assert.assertEquals(1,i);
+    }
+
+    @Test
+    public void queryByPrimaryKey() {
+        String guid = "ead1f9f3c69544a5a523966c8b723b18";
+        BaseUser baseUser = baseUserService.queryByPrimaryKey(guid);
+        Assert.assertNotNull(baseUser);
+        Assert.assertEquals(guid,baseUser.getGuid());
+    }
+
+    @Test
+    public void batchSaveUserAuthInfo() {
+        String guid = "ead1f9f3c69544a5a523966c8b723b18";
+        List<BaseUserAuthForm> list = new ArrayList<>();
+        for (int i = 0; i <20 ; i++) {
+            BaseUserAuthForm baseUserAuthForm = new BaseUserAuthForm();
+            baseUserAuthForm.setFkUserGuid(guid);
+            baseUserAuthForm.setFkAuthGuid(GetUUID.getUUID());
+            baseUserAuthForm.setFkProductGuid(super.FK_PRODUCT_GUID);
+            baseUserAuthForm.setFkOrgGuid(super.FK_ORG_GUID);
+            list.add(baseUserAuthForm);
+        }
+        int i = baseUserService.batchSaveUserAuthInfo(guid,super.FK_ORG_GUID,list);
+        Assert.assertEquals(20,i);
+    }
+
+    @Test
+    public void searchUserInfoByPage() {
+        BaseUserForm baseUserForm = new BaseUserForm();
+        baseUserForm.setFkOrgGuid(super.FK_ORG_GUID);
+        baseUserForm.setUserName("测试");
+        baseUserForm.setIsForbid(0);
+        baseUserForm.setBeginDate("2019-01-05");
+        baseUserForm.setEndDate("2019-01-05");
+        PageInfo pageInfo = baseUserService.searchUserInfoByPage(baseUserForm);
+        log.info("object=====================>{}",pageInfo.getList().get(0));
+        Assert.assertNotNull(pageInfo.getList());
+        Assert.assertEquals(2,pageInfo.getTotal());
+    }
+
+    @Test
+    public void searchUserAuthInfo() {
+        String guid = "ead1f9f3c69544a5a523966c8b723b18";
+       List<BaseUserAuthForm> list =  baseUserService.searchUserAuthInfo(guid,super.FK_ORG_GUID);
+       Assert.assertNotNull(list);
+       Assert.assertEquals(20,list.size());
+    }
+
+    @Test
+    public void delUserAuthInfoByUserId() {
+        String guid = "ead1f9f3c69544a5a523966c8b723b18";
+        int i =  baseUserService.delUserAuthInfoByUserId(guid,super.FK_ORG_GUID);
+        Assert.assertEquals(20,i);
+    }
+
+    @Test
+    public void searchRoleUserInfoById() {
+        BaseRoleUserForm baseRoleUserForm = new BaseRoleUserForm();
+        baseRoleUserForm.setFkOrgGuid(super.FK_ORG_GUID);
+//        baseRoleUserForm.setFkUserGuid("ead1f9f3c69544a5a523966c8b723b18");
+        baseRoleUserForm.setFkRoleGuid("8e1ccb4116454ebbbb5f0970422253b0");
+        PageInfo pageInfo = baseUserService.searchRoleUserInfoById(baseRoleUserForm);
+        log.info("======================>{}",pageInfo.getList().get(0));
+        Assert.assertNotNull(pageInfo.getList());
+        Assert.assertEquals(1,pageInfo.getTotal());
+    }
+
+    @Test
+    public void distributionUserAuthInfo(){
+        String guid = "ead1f9f3c69544a5a523966c8b723b18";
+        List<BaseUserAuthForm> list = new ArrayList<>();
+        for (int i = 0; i <20 ; i++) {
+            BaseUserAuthForm baseUserAuthForm = new BaseUserAuthForm();
+            baseUserAuthForm.setFkUserGuid(guid);
+            baseUserAuthForm.setFkAuthGuid(GetUUID.getUUID());
+            baseUserAuthForm.setFkProductGuid(super.FK_PRODUCT_GUID);
+            baseUserAuthForm.setFkOrgGuid(super.FK_ORG_GUID);
+            list.add(baseUserAuthForm);
+        }
+        BaseUserForm baseUserForm = new BaseUserForm();
+        baseUserForm.setGuid(guid);
+        baseUserForm.setFkOrgGuid(super.FK_ORG_GUID);
+        baseUserForm.setFkProductGuid(super.FK_PRODUCT_GUID);
+        baseUserForm.setRoleId("8e1ccb4116454ebbbb5f0970422253b0");
+        baseUserForm.setAuthList(list);
+        baseUserService.distributionUserAuthInfo(baseUserForm);
+    }
+}