作者 朱兆平

组织结构和权限列表重构采用树形

  1 +
1 #上传文件的路径,要带斜杠 2 #上传文件的路径,要带斜杠
2 web: 3 web:
3 upload-path: upload/ 4 upload-path: upload/
@@ -13,11 +14,6 @@ spring: @@ -13,11 +14,6 @@ spring:
13 mvc: 14 mvc:
14 #静态资源,设置上传文件的访问, 15 #静态资源,设置上传文件的访问,
15 static-path-pattern: /** 16 static-path-pattern: /**
16 - boot:  
17 - admin:  
18 - client:  
19 - url: http://192.168.1.63:16666  
20 - password: vmvnv1v2  
21 zipkin: 17 zipkin:
22 base-url: http://192.168.1.63:9411 18 base-url: http://192.168.1.63:9411
23 sleuth: 19 sleuth:
@@ -27,10 +23,10 @@ spring: @@ -27,10 +23,10 @@ spring:
27 static-locations: classpath:/META-INF/resources/,classpath:/static,classpath:/resources/,file:${web.upload-path} 23 static-locations: classpath:/META-INF/resources/,classpath:/static,classpath:/resources/,file:${web.upload-path}
28 24
29 application: 25 application:
30 - name: cloud-user-centerV2 26 + name: cloud-user-center
31 redis: 27 redis:
  28 +# host: 127.0.0.1
32 host: 192.168.1.53 29 host: 192.168.1.53
33 -# host: 192.168.43.78  
34 port: 6379 30 port: 6379
35 jackson: 31 jackson:
36 serialization: 32 serialization:
@@ -61,7 +57,7 @@ spring: @@ -61,7 +57,7 @@ spring:
61 #username=CGOETL 57 #username=CGOETL
62 #password=1q2w3e4r 58 #password=1q2w3e4r
63 #spring datasource mysql,注意编码配置,缺少数据库编码配置容易引起中文入库乱码 59 #spring datasource mysql,注意编码配置,缺少数据库编码配置容易引起中文入库乱码
64 - url: jdbc:mysql://118.31.66.166:3306/HQPT_USER?useUnicode=true&characterEncoding=utf8 60 + url: jdbc:mysql://118.31.66.166:3306/statistics?useUnicode=true&characterEncoding=utf8
65 username: 110 61 username: 110
66 password: QAHqCJf2kFYCLirM 62 password: QAHqCJf2kFYCLirM
67 driver-class-name: com.mysql.cj.jdbc.Driver 63 driver-class-name: com.mysql.cj.jdbc.Driver
@@ -93,12 +89,17 @@ spring: @@ -93,12 +89,17 @@ spring:
93 eureka: 89 eureka:
94 instance: 90 instance:
95 #eureka服务器页面中status的请求路径 91 #eureka服务器页面中status的请求路径
96 - status-page-url: http://${eureka.instance.hostname}:${server.port}/index 92 +# status-page-url: http://${eureka.instance.hostname}:${server.port}/index
97 prefer-ip-address: true 93 prefer-ip-address: true
98 instance-id: ${spring.cloud.client.ip-address}:${server.port} 94 instance-id: ${spring.cloud.client.ip-address}:${server.port}
99 hostname: ${spring.cloud.client.ip-address} 95 hostname: ${spring.cloud.client.ip-address}
100 lease-renewal-interval-in-seconds: 15 96 lease-renewal-interval-in-seconds: 15
101 lease-expiration-duration-in-seconds: 45 97 lease-expiration-duration-in-seconds: 45
  98 + health-check-url-path: /actuator/health
  99 + metadata-map:
  100 + user:
  101 + name: "admin" #These two are needed so that the server
  102 + password: "123456"
102 client: 103 client:
103 #eureka注册中心服务器地址 104 #eureka注册中心服务器地址
104 service-url: 105 service-url:
@@ -113,7 +114,7 @@ management: @@ -113,7 +114,7 @@ management:
113 enabled-by-default: true 114 enabled-by-default: true
114 web: 115 web:
115 exposure: 116 exposure:
116 - include: ["*"] 117 + include: "*"
117 endpoint: 118 endpoint:
118 health: 119 health:
119 show-details: always 120 show-details: always
@@ -150,3 +151,7 @@ logging: @@ -150,3 +151,7 @@ logging:
150 #Java Web Token 时效时间,单位秒 151 #Java Web Token 时效时间,单位秒
151 jwt: 152 jwt:
152 max-alive: 30000 153 max-alive: 30000
  154 +
  155 +info:
  156 + version: 2.0
  157 + description: "具有公司及部门管理级别的用户管理中心"
1 -#登录账号  
2 -loginname = KAKO  
3 -#登录密码  
4 -loginpass = KAKO  
5 -#发送报文目录,相对程序目录  
6 -readDirectory = /Users/mrz/Documents/java项目/test  
7 -#接收存储报文目录  
8 -bakDirectory = kakoRevice  
9 -#是否需要发送报文,默认N不发,Y将发送readDirectory下的XML扩展名的报文  
10 -isNeedSend = Y  
11 -#本地要保存的styp类型,用英文逗号分隔,注意中英文字符  
12 -saveStyp = DFDL,ARRE,ONRE,STLS  
13 -  
14 -#IMF MEAT报头配置  
15 -  
16 -RCVR=  
17 -TYPE=KAKO  
18 -STYP=CARM  
19 -AppId=warehouse  
1 -#log4j=log_api.xml  
2 -isneedlog=N  
3 -#psip=218.28.199.134  
4 -psip=10.50.3.74  
5 -psport=7484  
6 -encoding=UTF-8  
1 -########Log4j configuration#####################################  
2 -log4j.rootLogger=INFO, stdout, fileout  
3 -  
4 -  
5 -log4j.logger.com.fiscal = INFO  
6 -#*******************************  
7 -log4j.logger.com.system = INFO  
8 -#*******************************  
9 -log4j.appender.stdout=org.apache.log4j.ConsoleAppender  
10 -log4j.appender.stdout.layout=org.apache.log4j.PatternLayout  
11 -log4j.appender.stdout.layout.ConversionPattern=%d{MM-dd HH:mm:ss,SSSS}[%p] %m%n  
12 -  
13 -#yyyy-MM-dd HH:mm:ss  
14 -  
15 -  
16 -log4j.appender.fileout=org.apache.log4j.RollingFileAppender  
17 -log4j.appender.fileout.File=logs/imf.log  
18 -log4j.appender.fileout.MaxFileSize=50MB  
19 -log4j.appender.fileout.MaxBackupIndex=10  
20 -log4j.appender.fileout.layout=org.apache.log4j.PatternLayout  
21 -log4j.appender.fileout.layout.ConversionPattern=%d{MM-dd HH:mm:ss,SSSS}[%p] %m%n  
@@ -25,7 +25,7 @@ @@ -25,7 +25,7 @@
25 <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> 25 <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
26 <!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息--> 26 <!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息-->
27 <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> 27 <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
28 - <level>INFO</level> 28 + <level>info</level>
29 </filter> 29 </filter>
30 <encoder> 30 <encoder>
31 <Pattern>${CONSOLE_LOG_PATTERN}</Pattern> 31 <Pattern>${CONSOLE_LOG_PATTERN}</Pattern>
@@ -172,14 +172,14 @@ @@ -172,14 +172,14 @@
172 172
173 <!--开发环境:打印控制台--> 173 <!--开发环境:打印控制台-->
174 <springProfile name="dev"> 174 <springProfile name="dev">
175 - <logger name="org.springframework.security" level="trace"/> 175 + <logger name="org.springframework.security" level="debug"/>
176 <logger name="org.apache.tomcat" level="info" /> 176 <logger name="org.apache.tomcat" level="info" />
177 <logger name="com.tianbo.warehouse.dao" level="DEBUG" /> 177 <logger name="com.tianbo.warehouse.dao" level="DEBUG" />
178 <root level="INFO"> 178 <root level="INFO">
179 <appender-ref ref="CONSOLE" /> 179 <appender-ref ref="CONSOLE" />
180 - <!--<appender-ref ref="DEBUG_FILE" />-->  
181 - <!--<appender-ref ref="INFO_FILE" />-->  
182 - <!--<appender-ref ref="WARN_FILE" />--> 180 + <appender-ref ref="DEBUG_FILE" />
  181 + <appender-ref ref="INFO_FILE" />
  182 + <appender-ref ref="WARN_FILE" />
183 <appender-ref ref="ERROR_FILE" /> 183 <appender-ref ref="ERROR_FILE" />
184 </root> 184 </root>
185 </springProfile> 185 </springProfile>
@@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
11 </parent> 11 </parent>
12 <groupId>com.tianbo</groupId> 12 <groupId>com.tianbo</groupId>
13 <artifactId>warehouse</artifactId> 13 <artifactId>warehouse</artifactId>
14 - <version>0.0.1-SNAPSHOT</version> 14 + <version>2.0Beta</version>
15 <name>warehouse</name> 15 <name>warehouse</name>
16 <description>warehouse for Spring Boot</description> 16 <description>warehouse for Spring Boot</description>
17 17
1 Manifest-Version: 1.0 1 Manifest-Version: 1.0
2 -Class-Path: thymeleaf-extras-java8time-3.0.4.RELEASE.jar springfox-swa  
3 - gger-common-2.9.2.jar commons-math-2.2.jar attoparser-2.0.5.RELEASE.j  
4 - ar spring-cloud-netflix-eureka-client-2.1.5.BUILD-20191219.032215-243  
5 - .jar netty-buffer-4.1.42.Final.jar bcpkix-jdk15on-1.64.jar aspectjwea  
6 - ver-1.9.4.jar spring-cloud-starter-netflix-eureka-client-2.1.5.BUILD-  
7 - 20191219.032239-243.jar logback-core-1.2.3.jar slf4j-api-1.7.28.jar s  
8 - pring-context-5.2.0.RELEASE.jar mybatis-3.4.6.jar classmate-1.5.0.jar  
9 - jackson-datatype-jsr310-2.10.0.jar spring-security-crypto-5.2.0.RELE  
10 - ASE.jar mapstruct-1.2.0.Final.jar antlr-2.7.7.jar jboss-logging-3.4.1  
11 - .Final.jar springfox-schema-2.9.2.jar spring-aop-5.2.0.RELEASE.jar sp  
12 - ring-plugin-core-1.2.0.RELEASE.jar tomcat-embed-core-9.0.27.jar thyme  
13 - leaf-spring5-3.0.11.RELEASE.jar spring-jcl-5.2.0.RELEASE.jar HikariCP  
14 - -3.4.1.jar jersey-core-1.19.1.jar commons-jxpath-1.3.jar spring-boot-  
15 - starter-validation-2.2.0.BUILD-20191016.163457-711.jar jettison-1.3.7  
16 - .jar spring-boot-starter-tomcat-2.2.0.BUILD-20191016.163456-712.jar g  
17 - uice-4.1.0.jar commons-codec-1.11.jar jackson-module-parameter-names-  
18 - 2.10.0.jar lettuce-core-5.2.0.RELEASE.jar spring-websocket-5.2.0.RELE  
19 - ASE.jar spring-data-keyvalue-2.2.0.RELEASE.jar spring-boot-starter-2.  
20 - 2.0.BUILD-20191016.163501-711.jar netflix-commons-util-0.3.0.jar xmlp  
21 - ull-1.1.3.1.jar stax-api-1.0.1.jar netty-codec-4.1.42.Final.jar druid  
22 - -1.1.9.jar spring-oxm-5.2.0.RELEASE.jar jsr311-api-1.1.1.jar spring-b  
23 - oot-starter-thymeleaf-2.2.0.BUILD-20191016.163455-712.jar ribbon-tran  
24 - sport-2.3.0.jar commons-lang-2.6.jar commons-io-2.6.jar spring-data-c  
25 - ommons-2.2.0.RELEASE.jar jackson-annotations-2.10.0.jar logback-class  
26 - ic-1.2.3.jar pagehelper-spring-boot-autoconfigure-1.2.5.jar dom4j-2.1  
27 - .0.jar servo-core-0.12.21.jar springfox-core-2.9.2.jar mysql-connecto  
28 - r-java-8.0.18.jar log4j-to-slf4j-2.12.1.jar ribbon-loadbalancer-2.3.0  
29 - .jar spring-cloud-starter-netflix-archaius-2.1.5.BUILD-20191219.03222  
30 - 9-243.jar jsqlparser-1.0.jar netty-handler-4.1.42.Final.jar antlr-run  
31 - time-3.4.jar springfox-swagger-ui-2.9.2.jar mybatis-spring-boot-start  
32 - er-1.3.2.jar pagehelper-5.1.4.jar tomcat-embed-websocket-9.0.27.jar s  
33 - pring-boot-starter-json-2.2.0.BUILD-20191016.163444-713.jar jackson-c  
34 - ore-2.10.0.jar bcprov-jdk15on-1.64.jar springfox-spi-2.9.2.jar mybati  
35 - s-spring-1.3.2.jar netflix-infix-0.3.0.jar reactor-core-3.3.0.RELEASE  
36 - .jar snakeyaml-1.25.jar jakarta.validation-api-2.0.1.jar spring-secur  
37 - ity-core-5.2.0.RELEASE.jar spring-security-config-5.2.0.RELEASE.jar c  
38 - ommons-collections-3.2.2.jar jackson-databind-2.10.0.jar ribbon-core-  
39 - 2.3.0.jar spring-boot-starter-websocket-2.2.0.BUILD-20191016.163500-7  
40 - 11.jar eureka-core-1.9.13.jar eureka-client-1.9.13.jar netty-common-4  
41 - .1.42.Final.jar rxnetty-servo-0.4.9.jar unbescape-1.1.6.RELEASE.jar r  
42 - xjava-1.3.8.jar gson-2.8.6.jar mybatis-spring-boot-autoconfigure-1.3.  
43 - 2.jar druid-spring-boot-starter-1.1.9.jar ribbon-eureka-2.3.0.jar spr  
44 - ing-boot-starter-data-redis-2.2.0.BUILD-20191016.163436-713.jar sprin  
45 - g-cloud-commons-2.1.5.BUILD-20191219.033001-243.jar spring-boot-confi  
46 - guration-processor-2.2.0.BUILD-20191016.163408-713.jar spring-cloud-c  
47 - ontext-2.1.5.BUILD-20191219.032901-243.jar spring-boot-starter-jdbc-2  
48 - .2.0.BUILD-20191016.163441-713.jar httpcore-4.4.12.jar commons-config  
49 - uration-1.8.jar xpp3_min-1.1.4c.jar spring-plugin-metadata-1.2.0.RELE  
50 - ASE.jar jackson-datatype-jdk8-2.10.0.jar reactive-streams-1.0.3.jar j  
51 - ersey-apache-client4-1.19.1.jar httpclient-4.5.10.jar spring-cloud-ne  
52 - tflix-ribbon-2.1.5.BUILD-20191219.031914-243.jar spring-boot-autoconf  
53 - igure-2.2.0.BUILD-20191016.163400-713.jar HdrHistogram-2.1.9.jar spri  
54 - ng-security-rsa-1.0.9.RELEASE.jar jjwt-0.7.0.jar spring-core-5.2.0.RE  
55 - LEASE.jar netflix-eventbus-0.3.0.jar spring-cloud-starter-netflix-rib  
56 - bon-2.1.5.BUILD-20191219.032234-243.jar spring-cloud-netflix-archaius  
57 - -2.1.5.BUILD-20191219.031847-243.jar spring-context-support-5.2.0.REL  
58 - EASE.jar spring-boot-starter-logging-2.2.0.BUILD-20191016.163447-713.  
59 - jar hystrix-core-1.5.18.jar ojdbc6-11.2.0.4.0-atlassian-hosted.jar sp  
60 - ring-boot-starter-web-2.2.0.BUILD-20191016.163459-711.jar spring-clou  
61 - d-netflix-hystrix-2.1.5.BUILD-20191219.031954-243.jar stax2-api-4.2.j  
62 - ar pagehelper-spring-boot-starter-1.2.5.jar stringtemplate-3.2.1.jar  
63 - spring-expression-5.2.0.RELEASE.jar javax.inject-1.jar spring-cloud-s  
64 - tarter-2.1.5.BUILD-20191219.033020-243.jar spring-boot-starter-aop-2.  
65 - 2.0.BUILD-20191016.163422-713.jar spring-messaging-5.2.0.RELEASE.jar  
66 - spring-security-web-5.2.0.RELEASE.jar spring-web-5.2.0.RELEASE.jar je  
67 - rsey-client-1.19.1.jar netty-transport-4.1.42.Final.jar ribbon-2.3.0.  
68 - jar woodstox-core-5.2.1.jar springfox-swagger2-2.9.2.jar xstream-1.4.  
69 - 11.1.jar guava-20.0.jar hibernate-validator-6.0.17.Final.jar jakarta.  
70 - annotation-api-1.3.5.jar aopalliance-1.0.jar jaxen-1.2.0.jar jul-to-s  
71 - lf4j-1.7.28.jar spring-tx-5.2.0.RELEASE.jar spring-webmvc-5.2.0.RELEA  
72 - SE.jar byte-buddy-1.10.1.jar fastjson-1.2.28.jar swagger-annotations-  
73 - 1.5.20.jar thymeleaf-3.0.11.RELEASE.jar log4j-api-2.12.1.jar spring-b  
74 - eans-5.2.0.RELEASE.jar tomcat-embed-el-9.0.27.jar rxnetty-0.4.9.jar r  
75 - ibbon-httpclient-2.3.0.jar springfox-spring-web-2.9.2.jar archaius-co  
76 - re-0.7.6.jar swagger-models-1.5.20.jar spring-boot-2.2.0.BUILD-201910  
77 - 16.163506-711.jar spring-data-redis-2.2.0.RELEASE.jar spring-jdbc-5.2  
78 - .0.RELEASE.jar spring-boot-starter-security-2.2.0.BUILD-20191016.1634  
79 - 54-713.jar netty-resolver-4.1.42.Final.jar rxnetty-contexts-0.4.9.jar  
80 - joda-time-2.10.4.jar netflix-statistics-0.1.1.jar 2 +Class-Path: thymeleaf-3.0.11.RELEASE.jar stringtemplate-3.2.1.jar mysq
  3 + l-connector-java-8.0.17.jar brave-instrumentation-servlet-5.7.0.jar j
  4 + avax.inject-1.jar thymeleaf-spring5-3.0.11.RELEASE.jar jul-to-slf4j-1
  5 + .7.28.jar spring-boot-starter-websocket-2.1.9.RELEASE.jar spring-secu
  6 + rity-config-5.1.6.RELEASE.jar jettison-1.3.7.jar brave-5.7.0.jar reac
  7 + tor-core-3.2.12.RELEASE.jar commons-lang-2.6.jar tomcat-embed-core-9.
  8 + 0.26.jar spring-security-web-5.1.6.RELEASE.jar jackson-annotations-2.
  9 + 9.0.jar spring-boot-starter-logging-2.1.9.RELEASE.jar lettuce-core-5.
  10 + 1.8.RELEASE.jar hibernate-validator-6.0.17.Final.jar springfox-schema
  11 + -2.9.2.jar spring-plugin-core-1.2.0.RELEASE.jar netty-handler-4.1.39.
  12 + Final.jar spring-boot-starter-data-redis-2.1.9.RELEASE.jar mybatis-sp
  13 + ring-boot-starter-1.3.2.jar springfox-swagger-common-2.9.2.jar druid-
  14 + spring-boot-starter-1.1.9.jar stax-api-1.0.1.jar jboss-logging-3.3.3.
  15 + Final.jar spring-cloud-starter-netflix-archaius-2.1.3.RELEASE.jar dru
  16 + id-1.1.9.jar reactive-streams-1.0.3.jar jersey-apache-client4-1.19.1.
  17 + jar netty-resolver-4.1.39.Final.jar rxjava-1.3.8.jar xpp3_min-1.1.4c.
  18 + jar woodstox-core-5.0.3.jar snakeyaml-1.23.jar springfox-swagger2-2.9
  19 + .2.jar spring-plugin-metadata-1.2.0.RELEASE.jar springfox-swagger-ui-
  20 + 2.9.2.jar spring-cloud-netflix-hystrix-2.1.3.RELEASE.jar HikariCP-3.2
  21 + .0.jar spring-security-crypto-5.1.6.RELEASE.jar bcprov-jdk15on-1.60.j
  22 + ar zipkin-sender-amqp-client-2.10.2.jar unbescape-1.1.6.RELEASE.jar s
  23 + pring-messaging-5.1.10.RELEASE.jar netflix-statistics-0.1.1.jar sprin
  24 + g-data-keyvalue-2.1.11.RELEASE.jar spring-expression-5.1.10.RELEASE.j
  25 + ar brave-instrumentation-jms-5.7.0.jar zipkin-reporter-2.10.2.jar com
  26 + mons-configuration-1.8.jar springfox-spring-web-2.9.2.jar mapstruct-1
  27 + .2.0.Final.jar spring-context-5.1.10.RELEASE.jar spring-boot-starter-
  28 + 2.1.9.RELEASE.jar swagger-models-1.5.20.jar netty-transport-4.1.39.Fi
  29 + nal.jar guava-20.0.jar aspectjweaver-1.9.4.jar attoparser-2.0.5.RELEA
  30 + SE.jar springfox-spi-2.9.2.jar jersey-client-1.19.1.jar spring-aop-5.
  31 + 1.10.RELEASE.jar spring-boot-2.1.9.RELEASE.jar jersey-core-1.19.1.jar
  32 + commons-io-2.6.jar ribbon-transport-2.3.0.jar validation-api-2.0.1.F
  33 + inal.jar commons-collections-3.2.2.jar spring-boot-starter-tomcat-2.1
  34 + .9.RELEASE.jar spring-boot-autoconfigure-2.1.9.RELEASE.jar rxnetty-co
  35 + ntexts-0.4.9.jar rxnetty-0.4.9.jar javax.annotation-api-1.3.2.jar spr
  36 + ing-data-redis-2.1.11.RELEASE.jar commons-codec-1.11.jar brave-instru
  37 + mentation-http-5.7.0.jar spring-boot-configuration-processor-2.1.9.RE
  38 + LEASE.jar slf4j-api-1.7.28.jar thymeleaf-extras-java8time-3.0.4.RELEA
  39 + SE.jar spring-boot-starter-thymeleaf-2.1.9.RELEASE.jar spring-cloud-n
  40 + etflix-archaius-2.1.3.RELEASE.jar zipkin-sender-kafka-2.10.2.jar spri
  41 + ng-cloud-sleuth-core-2.1.3.RELEASE.jar gson-2.8.5.jar jackson-datatyp
  42 + e-jdk8-2.9.9.jar spring-boot-starter-json-2.1.9.RELEASE.jar ribbon-2.
  43 + 3.0.jar spring-boot-actuator-autoconfigure-2.1.9.RELEASE.jar LatencyU
  44 + tils-2.0.3.jar classmate-1.4.0.jar spring-security-core-5.1.6.RELEASE
  45 + .jar spring-cloud-starter-zipkin-2.1.3.RELEASE.jar spring-cloud-sleut
  46 + h-zipkin-2.1.3.RELEASE.jar antlr-2.7.7.jar json-simple-1.1.1.jar xmlp
  47 + ull-1.1.3.1.jar brave-instrumentation-kafka-clients-5.7.0.jar jaxen-1
  48 + .1.6.jar antlr-runtime-3.4.jar spring-oxm-5.1.10.RELEASE.jar spring-j
  49 + cl-5.1.10.RELEASE.jar xstream-1.4.11.1.jar httpcore-4.4.12.jar spring
  50 + fox-core-2.9.2.jar spring-boot-starter-web-2.1.9.RELEASE.jar spring-b
  51 + oot-starter-security-2.1.9.RELEASE.jar spring-cloud-starter-netflix-e
  52 + ureka-client-2.1.3.RELEASE.jar jackson-datatype-jsr310-2.9.9.jar spri
  53 + ng-boot-admin-client-2.1.6.jar netty-common-4.1.39.Final.jar spring-c
  54 + ontext-support-5.1.10.RELEASE.jar hystrix-core-1.5.18.jar spring-tx-5
  55 + .1.10.RELEASE.jar spring-cloud-starter-2.1.3.RELEASE.jar jackson-core
  56 + -2.9.9.jar logback-core-1.2.3.jar spring-cloud-netflix-ribbon-2.1.3.R
  57 + ELEASE.jar tomcat-embed-websocket-9.0.26.jar ribbon-httpclient-2.3.0.
  58 + jar micrometer-core-1.1.7.jar spring-cloud-starter-netflix-ribbon-2.1
  59 + .3.RELEASE.jar spring-cloud-netflix-eureka-client-2.1.3.RELEASE.jar c
  60 + ommons-math-2.2.jar aspectjrt-1.9.4.jar netflix-commons-util-0.3.0.ja
  61 + r spring-cloud-commons-2.1.3.RELEASE.jar jolokia-core-1.6.2.jar sprin
  62 + g-jdbc-5.1.10.RELEASE.jar rxnetty-servo-0.4.9.jar spring-webmvc-5.1.1
  63 + 0.RELEASE.jar brave-instrumentation-spring-rabbit-5.7.0.jar spring-be
  64 + ans-5.1.10.RELEASE.jar jjwt-0.7.0.jar pagehelper-spring-boot-starter-
  65 + 1.2.5.jar jackson-databind-2.9.9.3.jar brave-instrumentation-httpclie
  66 + nt-5.7.0.jar commons-jxpath-1.3.jar netflix-infix-0.3.0.jar spring-bo
  67 + ot-starter-actuator-2.1.9.RELEASE.jar ribbon-loadbalancer-2.3.0.jar s
  68 + pring-boot-admin-starter-client-2.1.6.jar spring-boot-starter-jdbc-2.
  69 + 1.9.RELEASE.jar spring-websocket-5.1.10.RELEASE.jar log4j-to-slf4j-2.
  70 + 11.2.jar mybatis-spring-boot-autoconfigure-1.3.2.jar zipkin-2.16.0.ja
  71 + r spring-boot-starter-aop-2.1.9.RELEASE.jar bcpkix-jdk15on-1.60.jar l
  72 + og4j-api-2.11.2.jar tomcat-embed-el-9.0.26.jar eureka-core-1.9.13.jar
  73 + servo-core-0.12.21.jar logback-classic-1.2.3.jar spring-boot-actuato
  74 + r-2.1.9.RELEASE.jar brave-instrumentation-spring-webmvc-5.7.0.jar bra
  75 + ve-instrumentation-httpasyncclient-5.7.0.jar httpclient-4.5.10.jar js
  76 + qlparser-1.0.jar eureka-client-1.9.13.jar joda-time-2.10.4.jar spring
  77 + -security-rsa-1.0.7.RELEASE.jar guice-4.1.0.jar mybatis-spring-1.3.2.
  78 + jar spring-cloud-context-2.1.3.RELEASE.jar mybatis-3.4.6.jar spring-c
  79 + ore-5.1.10.RELEASE.jar ribbon-core-2.3.0.jar netty-codec-4.1.39.Final
  80 + .jar HdrHistogram-2.1.9.jar dom4j-2.1.0.jar pagehelper-5.1.4.jar fast
  81 + json-1.2.28.jar spring-data-commons-2.1.11.RELEASE.jar swagger-annota
  82 + tions-1.5.20.jar ribbon-eureka-2.3.0.jar jackson-module-parameter-nam
  83 + es-2.9.9.jar stax2-api-3.1.4.jar aopalliance-1.0.jar byte-buddy-1.9.1
  84 + 6.jar archaius-core-0.7.6.jar pagehelper-spring-boot-autoconfigure-1.
  85 + 2.5.jar netty-buffer-4.1.39.Final.jar spring-web-5.1.10.RELEASE.jar b
  86 + rave-context-log4j2-5.7.0.jar netflix-eventbus-0.3.0.jar jsr311-api-1
  87 + .1.1.jar spring-cloud-starter-sleuth-2.1.3.RELEASE.jar brave-instrume
  88 + ntation-spring-web-5.7.0.jar
81 Main-Class: com.tianbo.warehouse.WarehouseApplication 89 Main-Class: com.tianbo.warehouse.WarehouseApplication
82 90
@@ -100,8 +100,8 @@ public class UserController { @@ -100,8 +100,8 @@ public class UserController {
100 100
101 @PutMapping("/roleset") 101 @PutMapping("/roleset")
102 public ResultJson roleSet(@RequestBody Map<String,Object> map){ 102 public ResultJson roleSet(@RequestBody Map<String,Object> map){
103 - Integer id = (Integer) map.get("id");  
104 - List<Integer> roles = (List<Integer>) map.get("setRole"); 103 + Integer id = (Integer) map.get("userId");
  104 + List<Integer> roles = (List<Integer>) map.get("roleIds");
105 UserRole userRole = new UserRole(); 105 UserRole userRole = new UserRole();
106 userRole.setUserId(id); 106 userRole.setUserId(id);
107 userRole.setRoleIds(roles); 107 userRole.setRoleIds(roles);
@@ -20,6 +20,8 @@ public interface PERMISSIONMapper { @@ -20,6 +20,8 @@ public interface PERMISSIONMapper {
20 20
21 List<PERMISSION> findAll(@Param("name") String name); 21 List<PERMISSION> findAll(@Param("name") String name);
22 22
  23 + List<PERMISSION> selectByParentId(Integer permissionId);
  24 +
23 List<PERMISSION> getAllMenus(); 25 List<PERMISSION> getAllMenus();
24 26
25 List<PERMISSION> findByUserId(Integer userId); 27 List<PERMISSION> findByUserId(Integer userId);
@@ -16,6 +16,8 @@ public interface ROLEMapper { @@ -16,6 +16,8 @@ public interface ROLEMapper {
16 16
17 List<ROLE> findRolesByUserId(Integer userId); 17 List<ROLE> findRolesByUserId(Integer userId);
18 18
  19 + List<ROLE> selectByParentId(Integer roleId);
  20 +
19 List<ROLE> findAll(@Param("roleName") String roleName); 21 List<ROLE> findAll(@Param("roleName") String roleName);
20 22
21 int updateByPrimaryKeySelective(ROLE record); 23 int updateByPrimaryKeySelective(ROLE record);
1 package com.tianbo.warehouse.model; 1 package com.tianbo.warehouse.model;
2 2
  3 +import lombok.Data;
3 import org.springframework.security.core.GrantedAuthority; 4 import org.springframework.security.core.GrantedAuthority;
4 5
5 import java.util.List; 6 import java.util.List;
6 7
  8 +@Data
7 public class ROLE implements GrantedAuthority { 9 public class ROLE implements GrantedAuthority {
8 10
9 private static final long serialVersionUID = 1L; 11 private static final long serialVersionUID = 1L;
10 12
11 private Integer roleId; 13 private Integer roleId;
12 14
  15 + private Integer parentid;
  16 +
13 private String roleName; 17 private String roleName;
14 18
15 private String roleSign; 19 private String roleSign;
@@ -18,17 +22,20 @@ public class ROLE implements GrantedAuthority { @@ -18,17 +22,20 @@ public class ROLE implements GrantedAuthority {
18 22
19 private String departmentId; 23 private String departmentId;
20 24
21 - private String departmentName; 25 + private String type;
22 26
23 private List<PERMISSION> permissions; 27 private List<PERMISSION> permissions;
24 28
25 - public String getDepartmentName() {  
26 - return departmentName;  
27 - } 29 + private Integer rsort;
  30 +
  31 + private String customsRegCode;
  32 +
  33 + private String businessLicense;
  34 +
  35 + private String departmentid;
  36 +
  37 + private List<ROLE> children;
28 38
29 - public void setDepartmentName(String departmentName) {  
30 - this.departmentName = departmentName;  
31 - }  
32 39
33 public Integer getRoleId() { 40 public Integer getRoleId() {
34 return roleId; 41 return roleId;
@@ -62,21 +69,14 @@ public class ROLE implements GrantedAuthority { @@ -62,21 +69,14 @@ public class ROLE implements GrantedAuthority {
62 this.description = description == null ? null : description.trim(); 69 this.description = description == null ? null : description.trim();
63 } 70 }
64 71
65 - public String getDepartmentId() {  
66 - return departmentId; 72 + public String getType() {
  73 + return type;
67 } 74 }
68 75
69 - public void setDepartmentId(String departmentId) {  
70 - this.departmentId = departmentId == null ? null : departmentId.trim(); 76 + public void setType(String type) {
  77 + this.type = type == null ? null : type.trim();
71 } 78 }
72 79
73 - public List<PERMISSION> getPermissions() {  
74 - return permissions;  
75 - }  
76 -  
77 - public void setPermissions(List<PERMISSION> permissions) {  
78 - this.permissions = permissions;  
79 - }  
80 80
81 @Override 81 @Override
82 public String getAuthority(){ 82 public String getAuthority(){
@@ -26,4 +26,8 @@ public class UserRole { @@ -26,4 +26,8 @@ public class UserRole {
26 this.roleId=roleId; 26 this.roleId=roleId;
27 this.userId = userId; 27 this.userId = userId;
28 } 28 }
  29 + public UserRole(Integer userId,Integer roleId){
  30 + this.roleId=roleId;
  31 + this.userId = userId;
  32 + }
29 } 33 }
@@ -28,7 +28,7 @@ public class MyInvocationSecurityMetadataSourceService implements FilterInvocati @@ -28,7 +28,7 @@ public class MyInvocationSecurityMetadataSourceService implements FilterInvocati
28 private HashMap<String, Collection<ConfigAttribute>> map =null; 28 private HashMap<String, Collection<ConfigAttribute>> map =null;
29 29
30 /** 30 /**
31 - * 加载权限表中所有权限,还是加载URL所需要的权限 31 + * 加载权限表URL所需要的权限
32 */ 32 */
33 public void loadResourceDefine(String requestUrl){ 33 public void loadResourceDefine(String requestUrl){
34 map = new HashMap<>(); 34 map = new HashMap<>();
@@ -41,17 +41,14 @@ public class MyInvocationSecurityMetadataSourceService implements FilterInvocati @@ -41,17 +41,14 @@ public class MyInvocationSecurityMetadataSourceService implements FilterInvocati
41 //此处只添加了用户的名字,其实还可以添加更多权限的信息, 41 //此处只添加了用户的名字,其实还可以添加更多权限的信息,
42 // 例如请求方法到ConfigAttribute的集合中去。 42 // 例如请求方法到ConfigAttribute的集合中去。
43 // 此处添加的信息将会作为MyAccessDecisionManager类的decide的第三个参数。 43 // 此处添加的信息将会作为MyAccessDecisionManager类的decide的第三个参数。
44 -  
45 //CFG存储访问的URL需要的权限"ROLE_??"LIST 44 //CFG存储访问的URL需要的权限"ROLE_??"LIST
46 String pUrl = permission.getUrl(); 45 String pUrl = permission.getUrl();
47 - List<String> urlOfRoles = permissionMapper.findRoleListByUrl(pUrl); 46 +
48 47
49 //路径适配,这个很重要,是配上后会包含其他适配的所有权限,比如/**与/user/List是可以适配上的, 48 //路径适配,这个很重要,是配上后会包含其他适配的所有权限,比如/**与/user/List是可以适配上的,
50 // 那么/**这个通用适配是要有/user/list这个路径所对应的角色信息的 49 // 那么/**这个通用适配是要有/user/list这个路径所对应的角色信息的
51 if(pathMatcher.match(pUrl,requestUrl)){ 50 if(pathMatcher.match(pUrl,requestUrl)){
52 -  
53 - }  
54 - 51 + List<String> urlOfRoles = permissionMapper.findRoleListByUrl(pUrl);
55 for (String roleName:urlOfRoles) { 52 for (String roleName:urlOfRoles) {
56 53
57 if(null!=roleName) { 54 if(null!=roleName) {
@@ -59,6 +56,9 @@ public class MyInvocationSecurityMetadataSourceService implements FilterInvocati @@ -59,6 +56,9 @@ public class MyInvocationSecurityMetadataSourceService implements FilterInvocati
59 array.add(cfg); 56 array.add(cfg);
60 } 57 }
61 } 58 }
  59 + }
  60 +
  61 +
62 //用权限的getUrl() 作为map的key,用ConfigAttribute的集合作为 value, 62 //用权限的getUrl() 作为map的key,用ConfigAttribute的集合作为 value,
63 map.put(pUrl, array); 63 map.put(pUrl, array);
64 64
@@ -136,8 +136,8 @@ public class MyInvocationSecurityMetadataSourceService implements FilterInvocati @@ -136,8 +136,8 @@ public class MyInvocationSecurityMetadataSourceService implements FilterInvocati
136 */ 136 */
137 @Override 137 @Override
138 public Collection<ConfigAttribute> getAllConfigAttributes() { 138 public Collection<ConfigAttribute> getAllConfigAttributes() {
139 -// return loadResourceDefine();  
140 - return null; 139 + return loadResourceDefine();
  140 +// return null;
141 } 141 }
142 142
143 @Override 143 @Override
@@ -7,6 +7,8 @@ import com.tianbo.warehouse.security.handel.*; @@ -7,6 +7,8 @@ import com.tianbo.warehouse.security.handel.*;
7 import com.tianbo.warehouse.security.MyFilterSecurityInterceptor; 7 import com.tianbo.warehouse.security.MyFilterSecurityInterceptor;
8 import org.springframework.beans.factory.annotation.Autowired; 8 import org.springframework.beans.factory.annotation.Autowired;
9 import org.springframework.beans.factory.annotation.Qualifier; 9 import org.springframework.beans.factory.annotation.Qualifier;
  10 +import org.springframework.boot.actuate.autoconfigure.security.servlet.EndpointRequest;
  11 +import org.springframework.boot.autoconfigure.security.servlet.PathRequest;
10 import org.springframework.context.annotation.Configuration; 12 import org.springframework.context.annotation.Configuration;
11 import org.springframework.core.annotation.Order; 13 import org.springframework.core.annotation.Order;
12 import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; 14 import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
@@ -75,6 +77,8 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { @@ -75,6 +77,8 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
75 @Override 77 @Override
76 protected void configure(HttpSecurity http) throws Exception { 78 protected void configure(HttpSecurity http) throws Exception {
77 http.authorizeRequests() 79 http.authorizeRequests()
  80 + //静态文件允许访问
  81 + .requestMatchers(PathRequest.toStaticResources().atCommonLocations()).permitAll()
78 //跨域配置 82 //跨域配置
79 .requestMatchers(CorsUtils::isPreFlightRequest).permitAll() 83 .requestMatchers(CorsUtils::isPreFlightRequest).permitAll()
80 //管理页面只允许管理员角色访问 84 //管理页面只允许管理员角色访问
@@ -27,7 +27,7 @@ public class PermissionServiceImp implements PermissionService { @@ -27,7 +27,7 @@ public class PermissionServiceImp implements PermissionService {
27 PageInfo<PERMISSION> result = new PageInfo<>(getPermissionList(list, 0)); 27 PageInfo<PERMISSION> result = new PageInfo<>(getPermissionList(list, 0));
28 return result; 28 return result;
29 } 29 }
30 - 30 + @Override
31 public List<PERMISSION> findByRoleId(Integer roleId) { 31 public List<PERMISSION> findByRoleId(Integer roleId) {
32 List<PERMISSION> list = getPermissionList(permissionMapper.findByRoleId(roleId), 0); 32 List<PERMISSION> list = getPermissionList(permissionMapper.findByRoleId(roleId), 0);
33 return list; 33 return list;
@@ -38,7 +38,7 @@ public class PermissionServiceImp implements PermissionService { @@ -38,7 +38,7 @@ public class PermissionServiceImp implements PermissionService {
38 return permissionMapper.insertSelective(record); 38 return permissionMapper.insertSelective(record);
39 } 39 }
40 40
41 - 41 + @Override
42 public List<PERMISSION> getPermissionList(List<PERMISSION> permissions, Integer pid) { 42 public List<PERMISSION> getPermissionList(List<PERMISSION> permissions, Integer pid) {
43 List<PERMISSION> permissionList = new ArrayList<>(); 43 List<PERMISSION> permissionList = new ArrayList<>();
44 for (PERMISSION permission : permissions) { 44 for (PERMISSION permission : permissions) {
@@ -36,17 +36,6 @@ public class RoleServiceImp implements RoleService{ @@ -36,17 +36,6 @@ public class RoleServiceImp implements RoleService{
36 public PageInfo<ROLE> findAll(int pageNum, int pageSize, String roleName){ 36 public PageInfo<ROLE> findAll(int pageNum, int pageSize, String roleName){
37 Page<ROLE> page = PageHelper.startPage(pageNum,pageSize); 37 Page<ROLE> page = PageHelper.startPage(pageNum,pageSize);
38 List<ROLE> list = roleMapper.findAll(roleName); 38 List<ROLE> list = roleMapper.findAll(roleName);
39 - for (ROLE role: list){  
40 - if(role.getPermissions().size()>1){  
41 - role.setPermissions(permissionService.getPermissionList(role.getPermissions(),0));  
42 - }  
43 - Department department = departmentMapper.selectByPrimaryKey(role.getDepartmentId());  
44 - if (department == null){  
45 - role.setDepartmentName("无");  
46 - }else {  
47 - role.setDepartmentName(department.getDepartmentName());  
48 - }  
49 - }  
50 PageInfo<ROLE> result = new PageInfo<ROLE>(list); 39 PageInfo<ROLE> result = new PageInfo<ROLE>(list);
51 40
52 return result; 41 return result;
@@ -68,9 +68,6 @@ public class UserServiceImpl implements UserService{ @@ -68,9 +68,6 @@ public class UserServiceImpl implements UserService{
68 // user.setPermissions(permissionList); 68 // user.setPermissions(permissionList);
69 List<ROLE> roleList = roleMapper.findRolesByUserId(user.getUserId()); 69 List<ROLE> roleList = roleMapper.findRolesByUserId(user.getUserId());
70 user.setRoles(roleList); 70 user.setRoles(roleList);
71 - if(user.getUserId() == 27){  
72 - System.out.println(users.getRoles());  
73 - }  
74 } 71 }
75 PageInfo<USERS> result = new PageInfo<USERS>(list); 72 PageInfo<USERS> result = new PageInfo<USERS>(list);
76 return result; 73 return result;
@@ -119,7 +116,7 @@ public class UserServiceImpl implements UserService{ @@ -119,7 +116,7 @@ public class UserServiceImpl implements UserService{
119 userRoleMapper.deleteByUserId(userId); 116 userRoleMapper.deleteByUserId(userId);
120 if (null!=ids && !ids.isEmpty()){ 117 if (null!=ids && !ids.isEmpty()){
121 for (Integer id:ids) { 118 for (Integer id:ids) {
122 - UserRole ur = new UserRole(new Random().nextInt(10000000)+1,userId,id); 119 + UserRole ur = new UserRole(userId,id);
123 userRoleMapper.insertSelective(ur); 120 userRoleMapper.insertSelective(ur);
124 } 121 }
125 } 122 }
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd"> 4 "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
5 <generatorConfiguration> 5 <generatorConfiguration>
6 <!-- 数据库驱动:选择你的本地硬盘上面的数据库驱动包--> 6 <!-- 数据库驱动:选择你的本地硬盘上面的数据库驱动包-->
7 - <classPathEntry location="/Users/shenhailong/.m2/repository/mysql/mysql-connector-java/5.1.30/mysql-connector-java-5.1.30.jar"/> 7 + <classPathEntry location="/Users/mrz/Documents/maven/mysql-connector-java-5.1.7-bin.jar"/>
8 <!--<classPathEntry location="/Users/mrz/Documents/maven/ojdbc6.jar"/>--> 8 <!--<classPathEntry location="/Users/mrz/Documents/maven/ojdbc6.jar"/>-->
9 <context id="DB2Tables" targetRuntime="MyBatis3"> 9 <context id="DB2Tables" targetRuntime="MyBatis3">
10 <commentGenerator> 10 <commentGenerator>
@@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
14 </commentGenerator> 14 </commentGenerator>
15 <!--数据库链接URL,用户名、密码 --> 15 <!--数据库链接URL,用户名、密码 -->
16 <jdbcConnection driverClass="com.mysql.jdbc.Driver" 16 <jdbcConnection driverClass="com.mysql.jdbc.Driver"
17 - connectionURL="jdbc:mysql://118.31.66.166:3306/HQPT_USER" 17 + connectionURL="jdbc:mysql://118.31.66.166:3306/statistics"
18 userId="110" 18 userId="110"
19 password="QAHqCJf2kFYCLirM"> 19 password="QAHqCJf2kFYCLirM">
20 </jdbcConnection> 20 </jdbcConnection>
@@ -45,6 +45,6 @@ @@ -45,6 +45,6 @@
45 <property name="enableSubPackages" value="true"/> 45 <property name="enableSubPackages" value="true"/>
46 </javaClientGenerator> 46 </javaClientGenerator>
47 <!-- 要生成的表 tableName是数据库中的表名或视图名 domainObjectName是实体类名--> 47 <!-- 要生成的表 tableName是数据库中的表名或视图名 domainObjectName是实体类名-->
48 - <table tableName="staff_aparment_come_car" domainObjectName="StaffApartmentComeCar" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table> 48 + <table tableName="role" domainObjectName="ROLE" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
49 </context> 49 </context>
50 </generatorConfiguration> 50 </generatorConfiguration>
@@ -29,10 +29,20 @@ @@ -29,10 +29,20 @@
29 select 29 select
30 <include refid="Base_Column_List" /> 30 <include refid="Base_Column_List" />
31 from permission 31 from permission
32 - <if test="name != '' and name !=null" >  
33 - where name = #{name, jdbcType=VARCHAR}  
34 - </if>  
35 - ORDER BY permission_order 32 + where 1=1
  33 + <choose>
  34 + <when test="name != '' and name !=null" >
  35 + and name = #{name, jdbcType=VARCHAR}
  36 + </when>
  37 + </choose>
  38 + ORDER BY parent_id,permission_order
  39 + </select>
  40 + <select id="selectByParentId" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  41 + select
  42 + <include refid="Base_Column_List" />
  43 + from permission
  44 + where parent_id = #{permissionId, jdbcType=INTEGER}
  45 + ORDER BY parent_id,permission_order
36 </select> 46 </select>
37 <select id="getRolePermisson" resultMap="BaseResultMap" parameterType="java.lang.Integer"> 47 <select id="getRolePermisson" resultMap="BaseResultMap" parameterType="java.lang.Integer">
38 select p.* 48 select p.*
1 -<?xml version="1.0" encoding="UTF-8" ?>  
2 -<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >  
3 -<mapper namespace="com.tianbo.warehouse.dao.ROLEMapper" >  
4 - <resultMap id="BaseResultMap" type="com.tianbo.warehouse.model.ROLE" >  
5 - <id column="role_id" property="roleId" jdbcType="INTEGER" />  
6 - <result column="role_name" property="roleName" jdbcType="VARCHAR" />  
7 - <result column="role_sign" property="roleSign" jdbcType="VARCHAR" />  
8 - <result column="description" property="description" jdbcType="VARCHAR" />  
9 - <result column="department_id" property="departmentId" jdbcType="VARCHAR" />  
10 - <collection property="permissions" ofType="com.tianbo.warehouse.model.PERMISSION" javaType="java.util.ArrayList" select="com.tianbo.warehouse.dao.PERMISSIONMapper.getRolePermisson" column="role_id"></collection> 1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3 +<mapper namespace="com.tianbo.warehouse.dao.ROLEMapper">
  4 + <resultMap id="BaseResultMap" type="com.tianbo.warehouse.model.ROLE">
  5 + <id column="role_id" jdbcType="INTEGER" property="roleId" />
  6 + <result column="role_name" jdbcType="VARCHAR" property="roleName" />
  7 + <result column="role_sign" jdbcType="VARCHAR" property="roleSign" />
  8 + <result column="description" jdbcType="VARCHAR" property="description" />
  9 + <result column="type" jdbcType="VARCHAR" property="type" />
  10 + <result column="parentId" jdbcType="INTEGER" property="parentid" />
  11 + <result column="rsort" jdbcType="INTEGER" property="rsort" />
  12 + <result column="customs_reg_code" jdbcType="VARCHAR" property="customsRegCode" />
  13 + <result column="business_license" jdbcType="VARCHAR" property="businessLicense" />
  14 + <result column="departmentId" jdbcType="VARCHAR" property="departmentid" />
  15 + <collection column="role_id" javaType="java.util.ArrayList" ofType="com.tianbo.warehouse.model.PERMISSION" property="permissions" select="com.tianbo.warehouse.dao.PERMISSIONMapper.getRolePermisson" />
  16 + <collection column="role_id" property="children" select="selectByParentId" />
11 </resultMap> 17 </resultMap>
12 - <sql id="Base_Column_List" >  
13 - role_id, role_name, role_sign, description, department_id 18 + <sql id="Base_Column_List">
  19 + role_id, role_name, role_sign, description, type, parentId, rsort, customs_reg_code,
  20 + business_license, departmentId
14 </sql> 21 </sql>
15 - <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" > 22 + <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
16 select 23 select
17 <include refid="Base_Column_List" /> 24 <include refid="Base_Column_List" />
18 from role 25 from role
19 where role_id = #{roleId,jdbcType=INTEGER} 26 where role_id = #{roleId,jdbcType=INTEGER}
20 </select> 27 </select>
21 -  
22 - <select id="findAll" resultMap="BaseResultMap" parameterType="java.lang.String">  
23 - SELECT 28 + <select id="selectByParentId" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  29 + select
24 <include refid="Base_Column_List" /> 30 <include refid="Base_Column_List" />
25 - FROM role  
26 - <if test="roleName != '' and roleName !=null" >  
27 - where role_name = #{roleName, jdbcType=VARCHAR}  
28 - </if>  
29 - </select>  
30 - <select id="findRolesByUserId" parameterType="java.lang.Integer" resultMap="BaseResultMap">  
31 - SELECT  
32 - R.*  
33 - FROM  
34 - users U  
35 - LEFT JOIN user_role UR ON U.user_id = UR.user_id  
36 - LEFT JOIN role R ON R.role_id= UR.role_id  
37 - where U.user_id = #{userId,jdbcType=INTEGER} 31 + from role
  32 + where parentId = #{roleId,jdbcType=INTEGER}
38 </select> 33 </select>
39 -  
40 - <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" > 34 + <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
41 delete from role 35 delete from role
42 where role_id = #{roleId,jdbcType=INTEGER} 36 where role_id = #{roleId,jdbcType=INTEGER}
43 </delete> 37 </delete>
44 - <insert id="insert" parameterType="com.tianbo.warehouse.model.ROLE" > 38 + <insert id="insert" parameterType="com.tianbo.warehouse.model.ROLE">
45 insert into role (role_id, role_name, role_sign, 39 insert into role (role_id, role_name, role_sign,
46 - description, department_id) 40 + description, type, parentId,
  41 + rsort, customs_reg_code, business_license,
  42 + departmentId)
47 values (#{roleId,jdbcType=INTEGER}, #{roleName,jdbcType=VARCHAR}, #{roleSign,jdbcType=VARCHAR}, 43 values (#{roleId,jdbcType=INTEGER}, #{roleName,jdbcType=VARCHAR}, #{roleSign,jdbcType=VARCHAR},
48 - #{description,jdbcType=VARCHAR}, #{departmentId,jdbcType=VARCHAR}) 44 + #{description,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{parentid,jdbcType=INTEGER},
  45 + #{rsort,jdbcType=INTEGER}, #{customsRegCode,jdbcType=VARCHAR}, #{businessLicense,jdbcType=VARCHAR},
  46 + #{departmentid,jdbcType=VARCHAR})
49 </insert> 47 </insert>
50 - <insert id="insertSelective" parameterType="com.tianbo.warehouse.model.ROLE" > 48 + <insert id="insertSelective" parameterType="com.tianbo.warehouse.model.ROLE">
51 insert into role 49 insert into role
52 - <trim prefix="(" suffix=")" suffixOverrides="," >  
53 - <if test="roleId != null" > 50 + <trim prefix="(" suffix=")" suffixOverrides=",">
  51 + <if test="roleId != null">
54 role_id, 52 role_id,
55 </if> 53 </if>
56 - <if test="roleName != null" > 54 + <if test="roleName != null">
57 role_name, 55 role_name,
58 </if> 56 </if>
59 - <if test="roleSign != null" > 57 + <if test="roleSign != null">
60 role_sign, 58 role_sign,
61 </if> 59 </if>
62 - <if test="description != null" > 60 + <if test="description != null">
63 description, 61 description,
64 </if> 62 </if>
65 - <if test="departmentId != null" >  
66 - department_id, 63 + <if test="type != null">
  64 + type,
  65 + </if>
  66 + <if test="parentid != null">
  67 + parentId,
  68 + </if>
  69 + <if test="rsort != null">
  70 + rsort,
  71 + </if>
  72 + <if test="customsRegCode != null">
  73 + customs_reg_code,
  74 + </if>
  75 + <if test="businessLicense != null">
  76 + business_license,
  77 + </if>
  78 + <if test="departmentid != null">
  79 + departmentId,
67 </if> 80 </if>
68 </trim> 81 </trim>
69 - <trim prefix="values (" suffix=")" suffixOverrides="," >  
70 - <if test="roleId != null" > 82 + <trim prefix="values (" suffix=")" suffixOverrides=",">
  83 + <if test="roleId != null">
71 #{roleId,jdbcType=INTEGER}, 84 #{roleId,jdbcType=INTEGER},
72 </if> 85 </if>
73 - <if test="roleName != null" > 86 + <if test="roleName != null">
74 #{roleName,jdbcType=VARCHAR}, 87 #{roleName,jdbcType=VARCHAR},
75 </if> 88 </if>
76 - <if test="roleSign != null" > 89 + <if test="roleSign != null">
77 #{roleSign,jdbcType=VARCHAR}, 90 #{roleSign,jdbcType=VARCHAR},
78 </if> 91 </if>
79 - <if test="description != null" > 92 + <if test="description != null">
80 #{description,jdbcType=VARCHAR}, 93 #{description,jdbcType=VARCHAR},
81 </if> 94 </if>
82 - <if test="departmentId != null" >  
83 - #{departmentId,jdbcType=VARCHAR}, 95 + <if test="type != null">
  96 + #{type,jdbcType=VARCHAR},
  97 + </if>
  98 + <if test="parentid != null">
  99 + #{parentid,jdbcType=INTEGER},
  100 + </if>
  101 + <if test="rsort != null">
  102 + #{rsort,jdbcType=INTEGER},
  103 + </if>
  104 + <if test="customsRegCode != null">
  105 + #{customsRegCode,jdbcType=VARCHAR},
  106 + </if>
  107 + <if test="businessLicense != null">
  108 + #{businessLicense,jdbcType=VARCHAR},
  109 + </if>
  110 + <if test="departmentid != null">
  111 + #{departmentid,jdbcType=VARCHAR},
84 </if> 112 </if>
85 </trim> 113 </trim>
86 </insert> 114 </insert>
87 - <update id="updateByPrimaryKeySelective" parameterType="com.tianbo.warehouse.model.ROLE" > 115 + <update id="updateByPrimaryKeySelective" parameterType="com.tianbo.warehouse.model.ROLE">
88 update role 116 update role
89 - <set >  
90 - <if test="roleName != null" > 117 + <set>
  118 + <if test="roleName != null">
91 role_name = #{roleName,jdbcType=VARCHAR}, 119 role_name = #{roleName,jdbcType=VARCHAR},
92 </if> 120 </if>
93 - <if test="roleSign != null" > 121 + <if test="roleSign != null">
94 role_sign = #{roleSign,jdbcType=VARCHAR}, 122 role_sign = #{roleSign,jdbcType=VARCHAR},
95 </if> 123 </if>
96 - <if test="description != null" > 124 + <if test="description != null">
97 description = #{description,jdbcType=VARCHAR}, 125 description = #{description,jdbcType=VARCHAR},
98 </if> 126 </if>
99 - <if test="departmentId != null" >  
100 - department_id = #{departmentId,jdbcType=VARCHAR}, 127 + <if test="type != null">
  128 + type = #{type,jdbcType=VARCHAR},
  129 + </if>
  130 + <if test="parentid != null">
  131 + parentId = #{parentid,jdbcType=INTEGER},
  132 + </if>
  133 + <if test="rsort != null">
  134 + rsort = #{rsort,jdbcType=INTEGER},
  135 + </if>
  136 + <if test="customsRegCode != null">
  137 + customs_reg_code = #{customsRegCode,jdbcType=VARCHAR},
  138 + </if>
  139 + <if test="businessLicense != null">
  140 + business_license = #{businessLicense,jdbcType=VARCHAR},
  141 + </if>
  142 + <if test="departmentid != null">
  143 + departmentId = #{departmentid,jdbcType=VARCHAR},
101 </if> 144 </if>
102 </set> 145 </set>
103 where role_id = #{roleId,jdbcType=INTEGER} 146 where role_id = #{roleId,jdbcType=INTEGER}
104 </update> 147 </update>
105 - <update id="updateByPrimaryKey" parameterType="com.tianbo.warehouse.model.ROLE" > 148 + <update id="updateByPrimaryKey" parameterType="com.tianbo.warehouse.model.ROLE">
106 update role 149 update role
107 set role_name = #{roleName,jdbcType=VARCHAR}, 150 set role_name = #{roleName,jdbcType=VARCHAR},
108 role_sign = #{roleSign,jdbcType=VARCHAR}, 151 role_sign = #{roleSign,jdbcType=VARCHAR},
109 description = #{description,jdbcType=VARCHAR}, 152 description = #{description,jdbcType=VARCHAR},
110 - department_id = #{departmentId,jdbcType=VARCHAR} 153 + type = #{type,jdbcType=VARCHAR},
  154 + parentId = #{parentid,jdbcType=INTEGER},
  155 + rsort = #{rsort,jdbcType=INTEGER},
  156 + customs_reg_code = #{customsRegCode,jdbcType=VARCHAR},
  157 + business_license = #{businessLicense,jdbcType=VARCHAR},
  158 + departmentId = #{departmentid,jdbcType=VARCHAR}
111 where role_id = #{roleId,jdbcType=INTEGER} 159 where role_id = #{roleId,jdbcType=INTEGER}
112 </update> 160 </update>
  161 +
  162 + <select id="findAll" parameterType="java.lang.String" resultMap="BaseResultMap">
  163 + SELECT
  164 + <include refid="Base_Column_List" />
  165 + FROM role
  166 + where parentId=0
  167 + and 1=1
  168 + <if test="roleName != '' and roleName !=null">
  169 + and role_name = #{roleName, jdbcType=VARCHAR}
  170 + </if>
  171 + </select>
  172 + <select id="findRolesByUserId" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  173 + SELECT
  174 + R.*
  175 + FROM
  176 + users U
  177 + LEFT JOIN user_role UR ON U.user_id = UR.user_id
  178 + LEFT JOIN role R ON R.role_id= UR.role_id
  179 + where U.user_id = #{userId,jdbcType=INTEGER}
  180 + </select>
113 </mapper> 181 </mapper>