Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sv-springboot
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bsoft
sv-springboot
Commits
c4e21bbb
Commit
c4e21bbb
authored
May 08, 2020
by
Suvalue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数据库切换到mysql后的优化
parent
a46126c8
Hide whitespace changes
Inline
Side-by-side
Showing
118 changed files
with
723 additions
and
1754 deletions
+723
-1754
bsoft-admin/pom.xml
+35
-31
bsoft-admin/src/main/java/com/bsoft/admin/BsoftAdminApplication.java
+1
-1
bsoft-admin/src/main/java/com/bsoft/admin/common/Result.java
+16
-16
bsoft-admin/src/main/java/com/bsoft/admin/common/aspect/RequestMappingAspect.java
+9
-6
bsoft-admin/src/main/java/com/bsoft/admin/common/aspect/TokenAspect.java
+3
-5
bsoft-admin/src/main/java/com/bsoft/admin/common/base/RequestResult.java
+1
-1
bsoft-admin/src/main/java/com/bsoft/admin/common/configurations/CurrentUserConfigure.java
+2
-3
bsoft-admin/src/main/java/com/bsoft/admin/common/configurations/LoginConfigure.java
+1
-2
bsoft-admin/src/main/java/com/bsoft/admin/common/enums/RequestResultType.java
+3
-2
bsoft-admin/src/main/java/com/bsoft/admin/common/enums/StateType.java
+3
-2
bsoft-admin/src/main/java/com/bsoft/admin/common/exceptions/DBConfigurationError.java
+1
-1
bsoft-admin/src/main/java/com/bsoft/admin/common/exceptions/ExceptionBase.java
+6
-6
bsoft-admin/src/main/java/com/bsoft/admin/common/exceptions/InvalidTokenException.java
+3
-2
bsoft-admin/src/main/java/com/bsoft/admin/common/handlers/GlobalExceptionHandler.java
+17
-18
bsoft-admin/src/main/java/com/bsoft/admin/common/intercepters/LoginInterceptor.java
+10
-13
bsoft-admin/src/main/java/com/bsoft/admin/common/resolvers/CurrentUserMethodArgumentResolver.java
+3
-6
bsoft-admin/src/main/java/com/bsoft/admin/common/utils/SqlUtil.java
+2
-3
bsoft-admin/src/main/java/com/bsoft/admin/common/utils/TokenUtil.java
+13
-10
bsoft-admin/src/main/java/com/bsoft/admin/controller/LoginController.java
+4
-4
bsoft-admin/src/main/java/com/bsoft/admin/controller/MenuController.java
+12
-12
bsoft-admin/src/main/java/com/bsoft/admin/controller/OrgController.java
+11
-11
bsoft-admin/src/main/java/com/bsoft/admin/controller/RoleController.java
+10
-10
bsoft-admin/src/main/java/com/bsoft/admin/controller/UserController.java
+14
-14
bsoft-admin/src/main/java/com/bsoft/admin/mapper/DicOrgMapper.java
+6
-5
bsoft-admin/src/main/java/com/bsoft/admin/mapper/SysMenuMapper.java
+4
-4
bsoft-admin/src/main/java/com/bsoft/admin/mapper/SysRoleMapper.java
+4
-3
bsoft-admin/src/main/java/com/bsoft/admin/mapper/SysRoleMenuRsMapper.java
+3
-3
bsoft-admin/src/main/java/com/bsoft/admin/mapper/SysUserMapper.java
+2
-2
bsoft-admin/src/main/java/com/bsoft/admin/mapper/SysUserMenuRsMapper.java
+3
-3
bsoft-admin/src/main/java/com/bsoft/admin/mapper/SysUserOrgRsMapper.java
+3
-3
bsoft-admin/src/main/java/com/bsoft/admin/mapper/SysUserRoleRsMapper.java
+2
-4
bsoft-admin/src/main/java/com/bsoft/admin/model/DicOrg.java
+6
-25
bsoft-admin/src/main/java/com/bsoft/admin/model/SysMenu.java
+3
-20
bsoft-admin/src/main/java/com/bsoft/admin/model/SysRole.java
+3
-16
bsoft-admin/src/main/java/com/bsoft/admin/model/SysRoleMenuRs.java
+3
-16
bsoft-admin/src/main/java/com/bsoft/admin/model/SysUser.java
+3
-25
bsoft-admin/src/main/java/com/bsoft/admin/model/SysUserMenuRs.java
+3
-16
bsoft-admin/src/main/java/com/bsoft/admin/model/SysUserOrgRs.java
+3
-16
bsoft-admin/src/main/java/com/bsoft/admin/model/SysUserRoleRs.java
+3
-16
bsoft-admin/src/main/java/com/bsoft/admin/model/reqmodel/CodeAndPwd.java
+4
-27
bsoft-admin/src/main/java/com/bsoft/admin/model/reqmodel/MenuReq.java
+46
-46
bsoft-admin/src/main/java/com/bsoft/admin/model/reqmodel/OrgReq.java
+18
-18
bsoft-admin/src/main/java/com/bsoft/admin/model/reqmodel/RoleReq.java
+25
-25
bsoft-admin/src/main/java/com/bsoft/admin/model/reqmodel/UserReq.java
+30
-30
bsoft-admin/src/main/java/com/bsoft/admin/model/respmodel/DicOrgList.java
+2
-14
bsoft-admin/src/main/java/com/bsoft/admin/model/respmodel/SysMenuList.java
+2
-15
bsoft-admin/src/main/java/com/bsoft/admin/model/respmodel/SysRoleMenuRsList.java
+2
-15
bsoft-admin/src/main/java/com/bsoft/admin/model/respmodel/SysUserMenuRsList.java
+2
-15
bsoft-admin/src/main/java/com/bsoft/admin/model/respmodel/SysUserOrgRsList.java
+2
-0
bsoft-admin/src/main/java/com/bsoft/admin/service/DicOrgService.java
+3
-3
bsoft-admin/src/main/java/com/bsoft/admin/service/LoginService.java
+3
-3
bsoft-admin/src/main/java/com/bsoft/admin/service/ServiceBase.java
+10
-4
bsoft-admin/src/main/java/com/bsoft/admin/service/SysMenuService.java
+15
-6
bsoft-admin/src/main/java/com/bsoft/admin/service/SysRoleService.java
+9
-3
bsoft-admin/src/main/java/com/bsoft/admin/service/SysUserRoleRsService.java
+1
-1
bsoft-admin/src/main/java/com/bsoft/admin/service/UserService.java
+7
-2
bsoft-admin/src/main/java/com/bsoft/admin/service/impl/DicOrgServiceImpl.java
+29
-29
bsoft-admin/src/main/java/com/bsoft/admin/service/impl/LoginServiceImpl.java
+4
-4
bsoft-admin/src/main/java/com/bsoft/admin/service/impl/SysMenuServiceImpl.java
+44
-44
bsoft-admin/src/main/java/com/bsoft/admin/service/impl/SysRoleServiceImpl.java
+17
-17
bsoft-admin/src/main/java/com/bsoft/admin/service/impl/SysUserRoleServiceImpl.java
+4
-4
bsoft-admin/src/main/java/com/bsoft/admin/service/impl/UserServiceImpl.java
+11
-11
bsoft-admin/src/main/resources/application-dev.properties
+4
-4
bsoft-admin/src/main/resources/application-test.properties
+5
-5
bsoft-admin/src/main/resources/mapper/DicOrgMapper.xml
+0
-79
bsoft-admin/src/main/resources/mapper/SysMenuMapper.xml
+0
-89
bsoft-admin/src/main/resources/mapper/SysRoleMapper.xml
+0
-56
bsoft-admin/src/main/resources/mapper/SysRoleMenuRsMapper.xml
+0
-63
bsoft-admin/src/main/resources/mapper/SysUserMapper.xml
+0
-78
bsoft-admin/src/main/resources/mapper/SysUserMenuRsMapper.xml
+0
-62
bsoft-admin/src/main/resources/mapper/SysUserOrgRsMapper.xml
+0
-64
bsoft-admin/src/main/resources/mapper/SysUserRoleRsMapper.xml
+0
-56
bsoft-admin/src/test/resources/generatorConfig.xml
+17
-96
bsoft-admin/src/test/resources/jdbc.properties
+4
-3
bsoft-api/src/main/java/com/bsoft/api/common/Result.java
+16
-16
bsoft-api/src/main/java/com/bsoft/api/common/aspect/RequestMappingAspect.java
+9
-6
bsoft-api/src/main/java/com/bsoft/api/common/aspect/TokenAspect.java
+3
-2
bsoft-api/src/main/java/com/bsoft/api/common/base/RequestResult.java
+1
-1
bsoft-api/src/main/java/com/bsoft/api/common/configurations/CurrentUserConfigure.java
+2
-2
bsoft-api/src/main/java/com/bsoft/api/common/configurations/LoginConfigure.java
+1
-1
bsoft-api/src/main/java/com/bsoft/api/common/enums/RequestResultType.java
+3
-2
bsoft-api/src/main/java/com/bsoft/api/common/enums/StateType.java
+3
-2
bsoft-api/src/main/java/com/bsoft/api/common/exceptions/DBConfigurationError.java
+1
-1
bsoft-api/src/main/java/com/bsoft/api/common/exceptions/ExceptionBase.java
+6
-6
bsoft-api/src/main/java/com/bsoft/api/common/exceptions/InvalidTokenException.java
+3
-2
bsoft-api/src/main/java/com/bsoft/api/common/handlers/GlobalExceptionHandler.java
+17
-15
bsoft-api/src/main/java/com/bsoft/api/common/intercepters/LoginInterceptor.java
+10
-10
bsoft-api/src/main/java/com/bsoft/api/common/utils/SqlUtil.java
+2
-3
bsoft-api/src/main/java/com/bsoft/api/controller/BlockValuesController.java
+0
-1
bsoft-api/src/main/java/com/bsoft/api/controller/DimController.java
+3
-2
bsoft-api/src/main/java/com/bsoft/api/controller/ExcelController.java
+4
-4
bsoft-api/src/main/java/com/bsoft/api/controller/IndController.java
+6
-6
bsoft-api/src/main/java/com/bsoft/api/controller/LoginController.java
+10
-7
bsoft-api/src/main/java/com/bsoft/api/mapper/BlockValuesMapper.java
+2
-3
bsoft-api/src/main/java/com/bsoft/api/mapper/SerBlockMapper.java
+1
-0
bsoft-api/src/main/java/com/bsoft/api/mapper/SerDeptDocRsMapper.java
+1
-0
bsoft-api/src/main/java/com/bsoft/api/mapper/SerPageFieldMapper.java
+1
-0
bsoft-api/src/main/java/com/bsoft/api/mapper/SerPageProjFieldRsMapper.java
+1
-0
bsoft-api/src/main/java/com/bsoft/api/mapper/SerPageProjMapper.java
+1
-0
bsoft-api/src/main/java/com/bsoft/api/mapper/SysProjectMapper.java
+0
-17
bsoft-api/src/main/java/com/bsoft/api/mapper/SysRoleMapper.java
+1
-0
bsoft-api/src/main/java/com/bsoft/api/mapper/SysRoleMenuRsMapper.java
+1
-0
bsoft-api/src/main/java/com/bsoft/api/mapper/SysUserMenuRsMapper.java
+1
-0
bsoft-api/src/main/java/com/bsoft/api/mapper/SysUserOrgRsMapper.java
+1
-0
bsoft-api/src/main/java/com/bsoft/api/model/reqmodel/AddBudgetValue.java
+2
-33
bsoft-api/src/main/java/com/bsoft/api/model/reqmodel/BlockValues.java
+3
-52
bsoft-api/src/main/java/com/bsoft/api/model/reqmodel/BlockValuesNew.java
+3
-25
bsoft-api/src/main/java/com/bsoft/api/model/reqmodel/BudgetValue.java
+1
-0
bsoft-api/src/main/java/com/bsoft/api/model/reqmodel/CodeAndPwd.java
+4
-26
bsoft-api/src/main/java/com/bsoft/api/model/reqmodel/Disease.java
+6
-7
bsoft-api/src/main/java/com/bsoft/api/model/reqmodel/DiseaseDoc.java
+3
-45
bsoft-api/src/main/java/com/bsoft/api/model/reqmodel/Doctor.java
+2
-8
bsoft-api/src/main/java/com/bsoft/api/model/reqmodel/ExportReq.java
+2
-15
bsoft-api/src/main/java/com/bsoft/api/model/reqmodel/QueryBudgetValue.java
+2
-26
bsoft-api/src/main/java/com/bsoft/api/model/reqmodel/ReqDimValue.java
+3
-34
bsoft-api/src/main/java/com/bsoft/api/model/respmodel/BlockValue.java
+5
-4
bsoft-api/src/main/java/com/bsoft/api/model/respmodel/ListPage.java
+5
-5
bsoft-api/src/main/java/com/bsoft/api/service/Impl/AsynBlockValuesServiceImpl.java
+17
-18
No files found.
bsoft-admin/pom.xml
View file @
c4e21bbb
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
2.2.2.RELEASE
</version>
<relativePath/>
<!-- lookup parent from repository -->
</parent>
<groupId>
com.bsoft
</groupId>
<artifactId>
bsoft-admin
</artifactId>
<version>
0.0.1-SNAPSHOT
</version>
<name>
bsoft-admin
</name>
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
2.2.2.RELEASE
</version>
<relativePath/>
<!-- lookup parent from repository -->
</parent>
<groupId>
com.bsoft
</groupId>
<artifactId>
bsoft-admin
</artifactId>
<version>
0.0.1-SNAPSHOT
</version>
<name>
bsoft-admin
</name>
<packaging>
war
</packaging>
<description>
Demo project for Spring Boot
</description>
<description>
Demo project for Spring Boot
</description>
<properties>
<java.version>
1.8
</java.version>
</properties>
<properties>
<java.version>
1.8
</java.version>
</properties>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
...
...
@@ -77,15 +77,20 @@
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-aop
</artifactId>
</dependency>
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
<version>
1.18.10
</version>
<scope>
provided
</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
</plugin>
<build>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
</plugin>
<plugin>
<groupId>
org.mybatis.generator
</groupId>
<artifactId>
mybatis-generator-maven-plugin
</artifactId>
...
...
@@ -139,10 +144,9 @@
<!--endregion-->
</dependencies>
</plugin>
</plugins>
</build>
</plugins>
</build>
</project>
bsoft-admin/src/main/java/com/bsoft/admin/BsoftAdminApplication.java
View file @
c4e21bbb
...
...
@@ -11,7 +11,7 @@ import org.springframework.context.annotation.ComponentScan;
public
class
BsoftAdminApplication
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
BsoftAdminApplication
.
class
,
args
);
SpringApplication
.
run
(
BsoftAdminApplication
.
class
,
args
);
}
}
bsoft-admin/src/main/java/com/bsoft/admin/common/Result.java
View file @
c4e21bbb
...
...
@@ -15,7 +15,7 @@ public class Result<T> {
@ApiModelProperty
(
value
=
"返回的数据"
)
private
T
data
;
private
Result
(
int
code
,
String
msg
,
T
data
)
{
private
Result
(
int
code
,
String
msg
,
T
data
)
{
this
.
code
=
code
;
this
.
msg
=
msg
;
this
.
data
=
data
;
...
...
@@ -54,37 +54,37 @@ public class Result<T> {
this
.
data
=
data
;
}
public
static
<
T
>
Result
<
T
>
success
(
T
data
){
return
new
Result
(
ErrorCode
.
SUCCESS
.
getCode
(),
ErrorCode
.
SUCCESS
.
getEnMessage
(),
data
);
public
static
<
T
>
Result
<
T
>
success
(
T
data
)
{
return
new
Result
(
ErrorCode
.
SUCCESS
.
getCode
(),
ErrorCode
.
SUCCESS
.
getEnMessage
(),
data
);
}
public
static
Result
error
(
int
code
,
String
msg
)
{
return
new
Result
(
code
,
msg
,
null
);
public
static
Result
error
(
int
code
,
String
msg
)
{
return
new
Result
(
code
,
msg
,
null
);
}
public
static
Result
error
(){
return
new
Result
(
ErrorCode
.
ERROR
.
getCode
(),
ErrorCode
.
ERROR
.
getEnMessage
(),
null
);
public
static
Result
error
()
{
return
new
Result
(
ErrorCode
.
ERROR
.
getCode
(),
ErrorCode
.
ERROR
.
getEnMessage
(),
null
);
}
public
static
Result
error
(
String
msg
){
return
new
Result
(
ErrorCode
.
ERROR
.
getCode
(),
msg
,
null
);
public
static
Result
error
(
String
msg
)
{
return
new
Result
(
ErrorCode
.
ERROR
.
getCode
(),
msg
,
null
);
}
public
static
Result
error
(
ErrorCode
errorCode
){
return
new
Result
(
errorCode
.
getCode
(),
errorCode
.
getEnMessage
(),
null
);
public
static
Result
error
(
ErrorCode
errorCode
)
{
return
new
Result
(
errorCode
.
getCode
(),
errorCode
.
getEnMessage
(),
null
);
}
public
static
enum
ErrorCode
{
SUCCESS
(
1
,
"成功"
,
"success"
),
INVALID_TOKEN
(
401
,
"无效的TOKEN"
,
"invalid token"
),
ERROR
(
400
,
"错误"
,
"error"
),
public
static
enum
ErrorCode
{
SUCCESS
(
1
,
"成功"
,
"success"
),
INVALID_TOKEN
(
401
,
"无效的TOKEN"
,
"invalid token"
),
ERROR
(
400
,
"错误"
,
"error"
),
USERERROR
(
2
,
"账号或密码错误"
,
"wrong account or password"
);
private
int
code
;
private
String
cnMessage
;
private
String
enMessage
;
ErrorCode
(
int
code
,
String
cnMessage
,
String
enMessage
)
{
ErrorCode
(
int
code
,
String
cnMessage
,
String
enMessage
)
{
this
.
code
=
code
;
this
.
cnMessage
=
cnMessage
;
this
.
enMessage
=
enMessage
;
...
...
bsoft-admin/src/main/java/com/bsoft/admin/common/aspect/RequestMappingAspect.java
View file @
c4e21bbb
...
...
@@ -22,9 +22,12 @@ import java.util.List;
@Profile
({
"test"
,
"prod"
})
public
class
RequestMappingAspect
{
@Pointcut
(
"@annotation(org.springframework.web.bind.annotation.GetMapping)"
)
public
void
getMappingAspect
(){}
public
void
getMappingAspect
()
{
}
@Pointcut
(
"@annotation(org.springframework.web.bind.annotation.PostMapping)"
)
public
void
postMappingAspect
(){}
public
void
postMappingAspect
()
{
}
@Around
(
"getMappingAspect()"
)
public
Object
get
(
ProceedingJoinPoint
joinPoint
)
throws
Throwable
{
...
...
@@ -38,16 +41,16 @@ public class RequestMappingAspect {
private
Object
request
(
ProceedingJoinPoint
joinPoint
)
throws
Throwable
{
Date
beginDate
=
new
Date
();
HttpServletRequest
request
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
();
HttpServletRequest
request
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
();
Logger
logger
=
org
.
slf4j
.
LoggerFactory
.
getLogger
(
joinPoint
.
getTarget
().
getClass
());
Object
result
=
joinPoint
.
proceed
();
String
uri
=
request
.
getRequestURI
();
Object
[]
params
=
joinPoint
.
getArgs
();
List
<
Object
>
paramsList
=
Arrays
.
asList
(
params
);
Date
endDate
=
new
Date
();
logger
.
debug
(
"执行时间:"
+
(
endDate
.
getTime
()
-
beginDate
.
getTime
())
+
",URL:"
+
uri
+
"入参参数:"
+
paramsList
+
"返回结果:"
+
result
);
logger
.
debug
(
"执行时间:"
+
(
endDate
.
getTime
()
-
beginDate
.
getTime
())
+
",URL:"
+
uri
+
"入参参数:"
+
paramsList
+
"返回结果:"
+
result
);
return
result
;
}
}
bsoft-admin/src/main/java/com/bsoft/admin/common/aspect/TokenAspect.java
View file @
c4e21bbb
...
...
@@ -3,9 +3,6 @@ package com.bsoft.admin.common.aspect;
import
com.bsoft.admin.common.Constants
;
import
com.bsoft.admin.common.exceptions.InvalidTokenException
;
import
com.bsoft.admin.common.utils.TokenUtil
;
import
com.bsoft.admin.common.Constants
;
import
com.bsoft.admin.common.exceptions.InvalidTokenException
;
import
com.bsoft.admin.common.utils.TokenUtil
;
import
com.bsoft.common.utils.StringUtil
;
import
org.aspectj.lang.ProceedingJoinPoint
;
import
org.aspectj.lang.annotation.Around
;
...
...
@@ -26,11 +23,12 @@ import javax.servlet.http.HttpServletRequest;
@Profile
({
"dev"
,
"test"
,
"prod"
})
public
class
TokenAspect
{
@Pointcut
(
"@annotation(com.bsoft.admin.common.annotations.Token)"
)
public
void
tokenAspect
(){}
public
void
tokenAspect
()
{
}
@Around
(
"tokenAspect()"
)
public
Object
verifierToken
(
ProceedingJoinPoint
joinPoint
)
throws
Throwable
{
HttpServletRequest
request
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
();
HttpServletRequest
request
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
();
String
token
=
request
.
getHeader
(
Constants
.
TOKEN_KEY
);
if
(!
StringUtil
.
isNullOrEmpty
(
token
)
&&
TokenUtil
.
checkToken
(
token
)){
...
...
bsoft-admin/src/main/java/com/bsoft/admin/common/base/RequestResult.java
View file @
c4e21bbb
...
...
@@ -29,7 +29,7 @@ public class RequestResult {
this
.
data
=
data
;
}
public
RequestResult
(
Integer
code
,
String
msg
,
Object
data
)
{
public
RequestResult
(
Integer
code
,
String
msg
,
Object
data
)
{
this
.
code
=
code
;
this
.
msg
=
msg
;
this
.
data
=
data
;
...
...
bsoft-admin/src/main/java/com/bsoft/admin/common/configurations/CurrentUserConfigure.java
View file @
c4e21bbb
package
com
.
bsoft
.
admin
.
common
.
configurations
;
import
com.bsoft.admin.common.resolvers.CurrentUserMethodArgumentResolver
;
import
com.bsoft.admin.common.resolvers.CurrentUserMethodArgumentResolver
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.method.support.HandlerMethodArgumentResolver
;
...
...
@@ -12,12 +11,12 @@ import java.util.List;
@Configuration
public
class
CurrentUserConfigure
implements
WebMvcConfigurer
{
@Override
public
void
addArgumentResolvers
(
List
<
HandlerMethodArgumentResolver
>
resolvers
){
public
void
addArgumentResolvers
(
List
<
HandlerMethodArgumentResolver
>
resolvers
)
{
resolvers
.
add
(
currentUserMethodArgumentResolver
());
}
@Bean
public
CurrentUserMethodArgumentResolver
currentUserMethodArgumentResolver
(){
public
CurrentUserMethodArgumentResolver
currentUserMethodArgumentResolver
()
{
return
new
CurrentUserMethodArgumentResolver
();
}
}
bsoft-admin/src/main/java/com/bsoft/admin/common/configurations/LoginConfigure.java
View file @
c4e21bbb
package
com
.
bsoft
.
admin
.
common
.
configurations
;
import
com.bsoft.admin.common.intercepters.LoginInterceptor
;
import
com.bsoft.admin.common.intercepters.LoginInterceptor
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
...
...
@@ -39,7 +38,7 @@ public class LoginConfigure implements WebMvcConfigurer {
}
@Bean
public
LoginInterceptor
loginIntercepter
(){
public
LoginInterceptor
loginIntercepter
()
{
return
new
LoginInterceptor
();
}
}
bsoft-admin/src/main/java/com/bsoft/admin/common/enums/RequestResultType.java
View file @
c4e21bbb
package
com
.
bsoft
.
admin
.
common
.
enums
;
public
enum
RequestResultType
{
SUCCESS
(
1
,
"成功"
),
FAILURE
(
0
,
"失败"
),;
SUCCESS
(
1
,
"成功"
),
FAILURE
(
0
,
"失败"
);
private
int
value
;
private
String
desc
;
RequestResultType
(
int
value
,
String
desc
)
{
RequestResultType
(
int
value
,
String
desc
)
{
this
.
value
=
value
;
this
.
desc
=
desc
;
}
...
...
bsoft-admin/src/main/java/com/bsoft/admin/common/enums/StateType.java
View file @
c4e21bbb
package
com
.
bsoft
.
admin
.
common
.
enums
;
public
enum
StateType
{
ON
(
1
,
"启用"
),
OFF
(
0
,
"禁用"
),;
ON
(
1
,
"启用"
),
OFF
(
0
,
"禁用"
);
private
int
value
;
private
String
desc
;
StateType
(
int
value
,
String
desc
)
{
StateType
(
int
value
,
String
desc
)
{
this
.
value
=
value
;
this
.
desc
=
desc
;
}
...
...
bsoft-admin/src/main/java/com/bsoft/admin/common/exceptions/DBConfigurationError.java
View file @
c4e21bbb
package
com
.
bsoft
.
admin
.
common
.
exceptions
;
public
class
DBConfigurationError
extends
ExceptionBase
{
public
DBConfigurationError
(
String
message
){
public
DBConfigurationError
(
String
message
)
{
super
(
message
);
}
}
bsoft-admin/src/main/java/com/bsoft/admin/common/exceptions/ExceptionBase.java
View file @
c4e21bbb
package
com
.
bsoft
.
admin
.
common
.
exceptions
;
public
class
ExceptionBase
extends
RuntimeException
{
public
ExceptionBase
()
{
super
();
}
public
ExceptionBase
()
{
super
();
}
public
ExceptionBase
(
String
message
)
{
super
(
message
);
}
public
ExceptionBase
(
String
message
)
{
super
(
message
);
}
}
bsoft-admin/src/main/java/com/bsoft/admin/common/exceptions/InvalidTokenException.java
View file @
c4e21bbb
package
com
.
bsoft
.
admin
.
common
.
exceptions
;
public
class
InvalidTokenException
extends
ExceptionBase
{
public
InvalidTokenException
(){
public
InvalidTokenException
()
{
super
();
}
public
InvalidTokenException
(
String
message
){
public
InvalidTokenException
(
String
message
)
{
super
(
message
);
}
}
bsoft-admin/src/main/java/com/bsoft/admin/common/handlers/GlobalExceptionHandler.java
View file @
c4e21bbb
...
...
@@ -4,10 +4,6 @@ import com.bsoft.admin.common.Result;
import
com.bsoft.admin.common.exceptions.DBConfigurationError
;
import
com.bsoft.admin.common.exceptions.ExceptionBase
;
import
com.bsoft.admin.common.exceptions.InvalidTokenException
;
import
com.bsoft.admin.common.Result
;
import
com.bsoft.admin.common.exceptions.DBConfigurationError
;
import
com.bsoft.admin.common.exceptions.ExceptionBase
;
import
com.bsoft.admin.common.exceptions.InvalidTokenException
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.validation.BindingResult
;
...
...
@@ -30,71 +26,74 @@ public class GlobalExceptionHandler {
/**
* 其他异常处理
*
* @param request
* @param e
* @return
*/
@ExceptionHandler
(
Exception
.
class
)
@ResponseBody
public
Object
defaultErrorHandler
(
HttpServletRequest
request
,
Exception
e
)
{
public
Object
defaultErrorHandler
(
HttpServletRequest
request
,
Exception
e
)
{
String
url
=
request
.
getRequestURI
();
log
.
error
(
url
+
"请求未知异常:"
+
e
.
getMessage
(),
e
);
log
.
error
(
url
+
"请求未知异常:"
+
e
.
getMessage
(),
e
);
return
Result
.
error
();
}
@ExceptionHandler
(
MethodArgumentNotValidException
.
class
)
@ResponseBody
public
Object
MethodArgumentNotValidErrorHandler
(
HttpServletRequest
request
,
MethodArgumentNotValidException
e
)
{
public
Object
MethodArgumentNotValidErrorHandler
(
HttpServletRequest
request
,
MethodArgumentNotValidException
e
)
{
String
url
=
request
.
getRequestURI
();
BindingResult
bindingResult
=
e
.
getBindingResult
();
List
<
ObjectError
>
allErrors
=
bindingResult
.
getAllErrors
();
StringBuilder
errorStrBu
=
new
StringBuilder
();
allErrors
.
forEach
(
objectError
->
{
FieldError
fieldError
=
(
FieldError
)
objectError
;
FieldError
fieldError
=
(
FieldError
)
objectError
;
errorStrBu
.
append
(
fieldError
.
getDefaultMessage
());
errorStrBu
.
append
(
","
);
});
});
String
errorStr
=
errorStrBu
.
toString
();
log
.
error
(
url
+
"请求未知异常:"
+
e
.
getMessage
(),
e
);
return
Result
.
error
(
errorStr
.
substring
(
0
,
errorStr
.
length
()
-
1
));
log
.
error
(
url
+
"请求未知异常:"
+
e
.
getMessage
(),
e
);
return
Result
.
error
(
errorStr
.
substring
(
0
,
errorStr
.
length
()
-
1
));
}
/**
* 其他内部异常
*
* @param request
* @param e
* @return
*/
@ExceptionHandler
(
ExceptionBase
.
class
)
@ResponseBody
public
Object
BaseErrorHandler
(
HttpServletRequest
request
,
Exception
e
)
{
public
Object
BaseErrorHandler
(
HttpServletRequest
request
,
Exception
e
)
{
String
url
=
request
.
getRequestURI
();
log
.
error
(
url
+
"请求未知异常:"
+
e
.
getMessage
(),
e
);
log
.
error
(
url
+
"请求未知异常:"
+
e
.
getMessage
(),
e
);
return
Result
.
error
();
}
@ExceptionHandler
(
DBConfigurationError
.
class
)
@ResponseBody
public
Object
DBConfigurationErrorHandler
(
HttpServletRequest
request
,
Exception
e
)
{
public
Object
DBConfigurationErrorHandler
(
HttpServletRequest
request
,
Exception
e
)
{
String
url
=
request
.
getRequestURI
();
log
.
error
(
url
+
"请求未知异常:"
+
e
.
getMessage
(),
e
);
return
Result
.
error
(
400
,
e
.
getMessage
());
log
.
error
(
url
+
"请求未知异常:"
+
e
.
getMessage
(),
e
);
return
Result
.
error
(
400
,
e
.
getMessage
());
}
/**
* 无效token
*
* @param request
* @param e
* @return
*/
@ExceptionHandler
(
InvalidTokenException
.
class
)
@ResponseBody
public
Object
InvalidTokenExceptionHandler
(
HttpServletRequest
request
,
Exception
e
)
{
public
Object
InvalidTokenExceptionHandler
(
HttpServletRequest
request
,
Exception
e
)
{
String
url
=
request
.
getRequestURI
();
log
.
error
(
url
+
"请求未知异常:"
+
e
.
getMessage
(),
e
);
log
.
error
(
url
+
"请求未知异常:"
+
e
.
getMessage
(),
e
);
return
Result
.
error
(
Result
.
ErrorCode
.
INVALID_TOKEN
);
}
}
bsoft-admin/src/main/java/com/bsoft/admin/common/intercepters/LoginInterceptor.java
View file @
c4e21bbb
...
...
@@ -3,9 +3,6 @@ package com.bsoft.admin.common.intercepters;
import
com.bsoft.admin.common.Constants
;
import
com.bsoft.admin.common.Result
;
import
com.bsoft.admin.common.utils.TokenUtil
;
import
com.bsoft.admin.common.Constants
;
import
com.bsoft.admin.common.Result
;
import
com.bsoft.admin.common.utils.TokenUtil
;
import
org.slf4j.Logger
;
import
org.springframework.web.servlet.HandlerInterceptor
;
import
org.springframework.web.servlet.ModelAndView
;
...
...
@@ -17,8 +14,9 @@ import java.io.PrintWriter;
public
class
LoginInterceptor
implements
HandlerInterceptor
{
Logger
logger
=
org
.
slf4j
.
LoggerFactory
.
getLogger
(
LoginInterceptor
.
class
);
@Override
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
throws
Exception
{
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
throws
Exception
{
System
.
out
.
println
(
"LoginInterceptor----------->preHandle"
);
String
token
=
request
.
getHeader
(
Constants
.
TOKEN_KEY
);
...
...
@@ -26,16 +24,16 @@ public class LoginInterceptor implements HandlerInterceptor {
response
.
setCharacterEncoding
(
"UTF-8"
);
response
.
setContentType
(
"application/json; charset=utf-8"
);
PrintWriter
writer
=
null
;
try
{
try
{
String
remoteHost
=
request
.
getRemoteHost
();
String
uri
=
request
.
getRequestURI
();
logger
.
info
(
remoteHost
+
" 访问 "
+
uri
+
", token无效, token:["
+
token
+
"]"
);
writer
=
response
.
getWriter
();
writer
.
print
(
Result
.
error
(
Result
.
ErrorCode
.
INVALID_TOKEN
));
}
catch
(
IOException
e
){
}
catch
(
IOException
e
){
logger
.
error
(
e
.
getMessage
());
}
finally
{
}
finally
{
if
(
writer
!=
null
){
writer
.
close
();
}
...
...
@@ -43,24 +41,23 @@ public class LoginInterceptor implements HandlerInterceptor {
return
false
;
}
return
HandlerInterceptor
.
super
.
preHandle
(
request
,
response
,
handler
);
return
HandlerInterceptor
.
super
.
preHandle
(
request
,
response
,
handler
);
}
@Override
public
void
postHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
,
ModelAndView
modelAndView
)
throws
Exception
{
public
void
postHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
,
ModelAndView
modelAndView
)
throws
Exception
{
System
.
out
.
println
(
"LoginInterceptor----------->postHandle"
);
HandlerInterceptor
.
super
.
postHandle
(
request
,
response
,
handler
,
modelAndView
);
HandlerInterceptor
.
super
.
postHandle
(
request
,
response
,
handler
,
modelAndView
);
}
@Override
public
void
afterCompletion
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
,
Exception
ex
)
throws
Exception
{
HttpServletResponse
response
,
Object
handler
,
Exception
ex
)
throws
Exception
{
System
.
out
.
println
(
"LoginInterceptor------->afterCompletion"
);
HandlerInterceptor
.
super
.
afterCompletion
(
request
,
response
,
handler
,
ex
);
HandlerInterceptor
.
super
.
afterCompletion
(
request
,
response
,
handler
,
ex
);
}
}
bsoft-admin/src/main/java/com/bsoft/admin/common/resolvers/CurrentUserMethodArgumentResolver.java
View file @
c4e21bbb
...
...
@@ -3,9 +3,6 @@ package com.bsoft.admin.common.resolvers;
import
com.bsoft.admin.common.Constants
;
import
com.bsoft.admin.common.annotations.CurrentUser
;
import
com.bsoft.admin.common.utils.TokenUtil
;
import
com.bsoft.admin.common.Constants
;
import
com.bsoft.admin.common.annotations.CurrentUser
;
import
com.bsoft.admin.common.utils.TokenUtil
;
import
com.bsoft.admin.model.SysUser
;
import
com.bsoft.common.utils.RedisUtil
;
import
org.springframework.core.MethodParameter
;
...
...
@@ -21,11 +18,11 @@ public class CurrentUserMethodArgumentResolver implements HandlerMethodArgumentR
}
@Override
public
Object
resolveArgument
(
MethodParameter
methodParameter
,
ModelAndViewContainer
modelAndViewContainer
,
NativeWebRequest
nativeWebRequest
,
WebDataBinderFactory
webDataBinderFactory
)
{
public
Object
resolveArgument
(
MethodParameter
methodParameter
,
ModelAndViewContainer
modelAndViewContainer
,
NativeWebRequest
nativeWebRequest
,
WebDataBinderFactory
webDataBinderFactory
)
{
String
token
=
nativeWebRequest
.
getHeader
(
Constants
.
TOKEN_KEY
);
if
(
TokenUtil
.
checkToken
(
token
)){
SysUser
user
=
(
SysUser
)
RedisUtil
.
get
(
token
);
SysUser
user
=
(
SysUser
)
RedisUtil
.
get
(
token
);
return
user
.
getId
();
}
return
null
;
...
...
bsoft-admin/src/main/java/com/bsoft/admin/common/utils/SqlUtil.java
View file @
c4e21bbb
package
com
.
bsoft
.
admin
.
common
.
utils
;
public
class
SqlUtil
{
public
static
String
TransactSQLInjection
(
String
str
)
{
return
str
.
replaceAll
(
".*([';]+|(--)+).*"
,
" "
);
public
static
String
TransactSQLInjection
(
String
str
)
{
return
str
.
replaceAll
(
".*([';]+|(--)+).*"
,
" "
);
}
}
bsoft-admin/src/main/java/com/bsoft/admin/common/utils/TokenUtil.java
View file @
c4e21bbb
...
...
@@ -10,40 +10,43 @@ public class TokenUtil {
/**
* 获取token,并将token存入redis
*
* @param secret 密码
* @param user 用户信息
* @return token
*/
public
static
String
getToken
(
String
secret
,
SysUser
user
)
{
public
static
String
getToken
(
String
secret
,
SysUser
user
)
{
String
time
=
String
.
valueOf
(
System
.
currentTimeMillis
());
String
token
=
JWTUtil
.
create
(
secret
,
time
,
String
.
valueOf
(
user
.
getId
()));
RedisUtil
.
set
(
token
,
user
,
TOKEN_TIME_OUT
);
String
token
=
JWTUtil
.
create
(
secret
,
time
,
String
.
valueOf
(
user
.
getId
()));
RedisUtil
.
set
(
token
,
user
,
TOKEN_TIME_OUT
);
return
token
;
}
/**
* 刷新token,并将旧token设置过期时间为5分钟
*
* @param oldToken 旧的token
* @return 新的token
*/
public
static
String
refresh
(
String
oldToken
){
public
static
String
refresh
(
String
oldToken
)
{
String
token
=
null
;
SysUser
user
=
(
SysUser
)
RedisUtil
.
get
(
oldToken
);
SysUser
user
=
(
SysUser
)
RedisUtil
.
get
(
oldToken
);
if
(
checkToken
(
oldToken
)){
RedisUtil
.
expire
(
oldToken
,
OLD_TOKEN_DURATION
);
token
=
getToken
(
user
.
getPassword
(),
user
);
RedisUtil
.
expire
(
oldToken
,
OLD_TOKEN_DURATION
);
token
=
getToken
(
user
.
getPassword
(),
user
);
}
return
token
;
}
/**
* 校验token
*
* @param token token
* @return 返回校验结果
*/
public
static
boolean
checkToken
(
String
token
){
SysUser
user
=
(
SysUser
)
RedisUtil
.
get
(
token
);
boolean
result
=
user
!=
null
&&
JWTUtil
.
verifier
(
token
,
user
.
getPassword
());
public
static
boolean
checkToken
(
String
token
)
{
SysUser
user
=
(
SysUser
)
RedisUtil
.
get
(
token
);
boolean
result
=
user
!=
null
&&
JWTUtil
.
verifier
(
token
,
user
.
getPassword
());
if
(
result
){
RedisUtil
.
expire
(
token
,
TOKEN_TIME_OUT
);
}
...
...
bsoft-admin/src/main/java/com/bsoft/admin/controller/LoginController.java
View file @
c4e21bbb
...
...
@@ -25,12 +25,12 @@ public class LoginController {
private
LoginService
loginServiceImpl
;
@PostMapping
(
"login"
)
@ApiOperation
(
value
=
"Result«LoginService.LoginInfo»登录"
)
public
Result
<
LoginService
.
LoginInfo
>
login
(
@Valid
@RequestBody
CodeAndPwd
codeAndPwd
,
HttpServletRequest
request
)
{
@ApiOperation
(
value
=
"Result«LoginService.LoginInfo»登录"
)
public
Result
<
LoginService
.
LoginInfo
>
login
(
@Valid
@RequestBody
CodeAndPwd
codeAndPwd
,
HttpServletRequest
request
)
{
String
ip
=
HttpUtil
.
getIP
(
request
);
LoginService
.
LoginInfo
loginInfo
=
loginServiceImpl
.
login
(
codeAndPwd
.
getLoginName
(),
codeAndPwd
.
getPassword
(),
ip
);
if
(
loginInfo
.
getUser
()
==
null
){
if
(
loginInfo
.
getUser
()
==
null
){
return
Result
.
error
(
Result
.
ErrorCode
.
USERERROR
);
}
return
Result
.
success
(
loginInfo
);
...
...
@@ -38,7 +38,7 @@ public class LoginController {
@PostMapping
(
"token"
)
@ApiOperation
(
"刷新TOKEN"
)
public
Result
<
String
>
refresh
(
@ApiIgnore
HttpServletRequest
request
){
public
Result
<
String
>
refresh
(
@ApiIgnore
HttpServletRequest
request
)
{
String
oldToken
=
request
.
getHeader
(
"Authorization"
);
String
token
=
loginServiceImpl
.
refreshToken
(
oldToken
);
return
Result
.
success
(
token
);
...
...
bsoft-admin/src/main/java/com/bsoft/admin/controller/MenuController.java
View file @
c4e21bbb
...
...
@@ -21,7 +21,7 @@ import springfox.documentation.annotations.ApiIgnore;
import
javax.validation.Valid
;
import
java.util.List
;
@Api
(
tags
=
"菜单API"
,
produces
=
"produces"
,
consumes
=
"consumes"
,
protocols
=
"protocols"
)
@Api
(
tags
=
"菜单API"
,
produces
=
"produces"
,
consumes
=
"consumes"
,
protocols
=
"protocols"
)
@RequestMapping
(
"/menu"
)
@RestController
public
class
MenuController
{
...
...
@@ -31,7 +31,7 @@ public class MenuController {
@PostMapping
(
"parentall"
)
@Token
@ApiOperation
(
"查询菜单列表及其子级列表"
)
public
Object
getParentAll
(
@RequestBody
MenuReq
.
GetMenuReq
menu
)
throws
Exception
{
public
Object
getParentAll
(
@RequestBody
MenuReq
.
GetMenuReq
menu
)
throws
Exception
{
List
<
SysMenuList
>
list
=
sysMenuService
.
getParentAll
(
menu
);
return
Result
.
success
(
list
);
}
...
...
@@ -39,7 +39,7 @@ public class MenuController {
@PostMapping
(
"all"
)
@Token
@ApiOperation
(
"查询菜单列表"
)
public
Object
getAll
()
throws
Exception
{
public
Object
getAll
()
throws
Exception
{
List
<
SysMenu
>
list
=
sysMenuService
.
getAll
();
return
Result
.
success
(
list
);
}
...
...
@@ -47,7 +47,7 @@ public class MenuController {
@PostMapping
(
"info"
)
@Token
@ApiOperation
(
"查询菜单详细信息"
)
public
Object
getById
(
@RequestBody
MenuReq
.
InfoMenuReq
menu
)
throws
Exception
{
public
Object
getById
(
@RequestBody
MenuReq
.
InfoMenuReq
menu
)
throws
Exception
{
SysMenu
info
=
sysMenuService
.
info
(
menu
);
return
Result
.
success
(
info
);
}
...
...
@@ -55,7 +55,7 @@ public class MenuController {
@PostMapping
(
"add"
)
@Token
@ApiOperation
(
"添加菜单"
)
public
Object
addUser
(
@ApiIgnore
@CurrentUser
Long
userId
,
@Valid
@RequestBody
MenuReq
.
AddMenuReq
menu
)
throws
Exception
{
public
Object
addUser
(
@ApiIgnore
@CurrentUser
Long
userId
,
@Valid
@RequestBody
MenuReq
.
AddMenuReq
menu
)
throws
Exception
{
boolean
result
=
sysMenuService
.
addMenu
(
userId
,
menu
);
if
(
result
)
return
Result
.
success
(
null
);
...
...
@@ -66,7 +66,7 @@ public class MenuController {
@PostMapping
(
"delete"
)
@Token
@ApiOperation
(
"删除菜单"
)
public
Object
addUser
(
@RequestBody
MenuReq
.
DeleteMenuReq
menu
)
throws
Exception
{
public
Object
addUser
(
@RequestBody
MenuReq
.
DeleteMenuReq
menu
)
throws
Exception
{
boolean
result
=
sysMenuService
.
deleteMenu
(
menu
);
if
(
result
)
return
Result
.
success
(
null
);
...
...
@@ -77,7 +77,7 @@ public class MenuController {
@PostMapping
(
"update"
)
@Token
@ApiOperation
(
"修改菜单"
)
public
Object
addUser
(
@Valid
@RequestBody
MenuReq
.
UpdateMenuReq
menu
)
throws
Exception
{
public
Object
addUser
(
@Valid
@RequestBody
MenuReq
.
UpdateMenuReq
menu
)
throws
Exception
{
boolean
result
=
sysMenuService
.
updateMenu
(
menu
);
if
(
result
)
return
Result
.
success
(
null
);
...
...
@@ -88,7 +88,7 @@ public class MenuController {
@PostMapping
(
"usermenu"
)
@Token
@ApiOperation
(
"查询用户菜单"
)
public
Object
getUserMenu
(
@RequestBody
MenuReq
.
GetUserMenuReq
menu
)
throws
Exception
{
public
Object
getUserMenu
(
@RequestBody
MenuReq
.
GetUserMenuReq
menu
)
throws
Exception
{
List
<
SysUserMenuRsList
>
list
=
sysMenuService
.
getUserMenu
(
menu
.
getUserId
());
return
Result
.
success
(
list
);
}
...
...
@@ -96,7 +96,7 @@ public class MenuController {
@PostMapping
(
"saveusermenu"
)
@Token
@ApiOperation
(
"保存用户菜单"
)
public
Object
saveUserMenu
(
@ApiIgnore
@CurrentUser
Long
userId
,
@RequestBody
MenuReq
.
SaveUserMenuReq
menu
)
throws
Exception
{
public
Object
saveUserMenu
(
@ApiIgnore
@CurrentUser
Long
userId
,
@RequestBody
MenuReq
.
SaveUserMenuReq
menu
)
throws
Exception
{
boolean
result
=
sysMenuService
.
saveUserMenu
(
userId
,
menu
);
if
(
result
)
return
Result
.
success
(
null
);
...
...
@@ -107,7 +107,7 @@ public class MenuController {
@PostMapping
(
"rolemenu"
)
@Token
@ApiOperation
(
"查询角色菜单"
)
public
Object
getRoleMenu
(
@RequestBody
MenuReq
.
GetRoleMenuReq
menu
)
throws
Exception
{
public
Object
getRoleMenu
(
@RequestBody
MenuReq
.
GetRoleMenuReq
menu
)
throws
Exception
{
List
<
SysRoleMenuRsList
>
list
=
sysMenuService
.
getRoleMenu
(
menu
.
getRoleId
());
return
Result
.
success
(
list
);
}
...
...
@@ -115,7 +115,7 @@ public class MenuController {
@PostMapping
(
"saverolemenu"
)
@Token
@ApiOperation
(
"保存角色菜单"
)
public
Object
saveRoleMenu
(
@ApiIgnore
@CurrentUser
Long
userId
,
@RequestBody
MenuReq
.
SaveRoleMenuReq
menu
)
throws
Exception
{
public
Object
saveRoleMenu
(
@ApiIgnore
@CurrentUser
Long
userId
,
@RequestBody
MenuReq
.
SaveRoleMenuReq
menu
)
throws
Exception
{
boolean
result
=
sysMenuService
.
saveRoleMenu
(
userId
,
menu
);
if
(
result
)
return
Result
.
success
(
null
);
...
...
@@ -126,7 +126,7 @@ public class MenuController {
@PostMapping
(
"updateSort"
)
@Token
@ApiOperation
(
"修改排序"
)
public
Object
updateSort
(
@ApiIgnore
@CurrentUser
Long
userId
,
@RequestBody
MenuReq
.
UpdateSortReq
menu
)
throws
Exception
{
public
Object
updateSort
(
@ApiIgnore
@CurrentUser
Long
userId
,
@RequestBody
MenuReq
.
UpdateSortReq
menu
)
throws
Exception
{
boolean
result
=
sysMenuService
.
updateSort
(
userId
,
menu
);
if
(
result
)
return
Result
.
success
(
null
);
...
...
bsoft-admin/src/main/java/com/bsoft/admin/controller/OrgController.java
View file @
c4e21bbb
...
...
@@ -57,13 +57,13 @@ public class OrgController {
@PostMapping
(
"add"
)
@Token
@ApiOperation
(
"添加机构"
)
public
Object
addOrg
(
@ApiIgnore
@CurrentUser
Long
userId
,
@Valid
@RequestBody
OrgReq
.
AddOrgReq
org
)
throws
Exception
{
public
Object
addOrg
(
@ApiIgnore
@CurrentUser
Integer
userId
,
@Valid
@RequestBody
OrgReq
.
AddOrgReq
org
)
throws
Exception
{
DicOrg
sysRole
=
dicOrgService
.
getByName
(
org
.
getOrgName
());
if
(
sysRole
!=
null
)
{
if
(
sysRole
!=
null
)
{
return
Result
.
error
(
"该机构已存在!"
);
}
boolean
result
=
dicOrgService
.
addOrg
(
userId
,
org
);
if
(
result
)
boolean
result
=
dicOrgService
.
addOrg
(
userId
,
org
);
if
(
result
)
return
Result
.
success
(
null
);
else
return
Result
.
error
();
...
...
@@ -74,7 +74,7 @@ public class OrgController {
@ApiOperation
(
"删除机构"
)
public
Object
deleteOrg
(
@RequestBody
OrgReq
.
DeleteOrgReq
org
)
throws
Exception
{
boolean
result
=
dicOrgService
.
deleteOrg
(
org
);
if
(
result
)
if
(
result
)
return
Result
.
success
(
null
);
else
return
Result
.
error
();
...
...
@@ -86,13 +86,13 @@ public class OrgController {
public
Object
updateOrg
(
@Valid
@RequestBody
OrgReq
.
UpdateOrgReq
org
)
throws
Exception
{
DicOrg
reqDic
=
dicOrgService
.
info
(
org
.
getOrgId
());
DicOrg
nameRole
=
dicOrgService
.
getByName
(
org
.
getOrgName
());
if
(
reqDic
!=
null
)
{
if
(
nameRole
!=
null
&&
!
nameRole
.
getOrgName
().
equals
(
reqDic
.
getOrgName
()))
{
if
(
reqDic
!=
null
)
{
if
(
nameRole
!=
null
&&
!
nameRole
.
getOrgName
().
equals
(
reqDic
.
getOrgName
()))
{
return
Result
.
error
(
"该机构已存在"
);
}
}
boolean
result
=
dicOrgService
.
updateOrg
(
org
);
if
(
result
)
if
(
result
)
return
Result
.
success
(
null
);
else
return
Result
.
error
();
...
...
@@ -109,9 +109,9 @@ public class OrgController {
@PostMapping
(
"saveuserorg"
)
@Token
@ApiOperation
(
"保存用户机构"
)
public
Object
saveUserOrg
(
@ApiIgnore
@CurrentUser
Long
userId
,
@RequestBody
OrgReq
.
SaveUserOrgReq
org
)
throws
Exception
{
boolean
result
=
dicOrgService
.
saveUserOrg
(
userId
,
org
);
if
(
result
)
public
Object
saveUserOrg
(
@ApiIgnore
@CurrentUser
Long
userId
,
@RequestBody
OrgReq
.
SaveUserOrgReq
org
)
throws
Exception
{
boolean
result
=
dicOrgService
.
saveUserOrg
(
userId
,
org
);
if
(
result
)
return
Result
.
success
(
null
);
else
return
Result
.
error
();
...
...
bsoft-admin/src/main/java/com/bsoft/admin/controller/RoleController.java
View file @
c4e21bbb
...
...
@@ -18,7 +18,7 @@ import springfox.documentation.annotations.ApiIgnore;
import
javax.validation.Valid
;
import
java.util.List
;
@Api
(
tags
=
"角色API"
,
produces
=
"produces"
,
consumes
=
"consumes"
,
protocols
=
"protocols"
)
@Api
(
tags
=
"角色API"
,
produces
=
"produces"
,
consumes
=
"consumes"
,
protocols
=
"protocols"
)
@RequestMapping
(
"/role"
)
@RestController
public
class
RoleController
{
...
...
@@ -28,7 +28,7 @@ public class RoleController {
@PostMapping
(
"all"
)
@Token
@ApiOperation
(
"查询角色列表"
)
public
Object
getAll
(
@Valid
@RequestBody
RoleReq
.
GetRoleReq
role
)
throws
Exception
{
public
Object
getAll
(
@Valid
@RequestBody
RoleReq
.
GetRoleReq
role
)
throws
Exception
{
List
<
SysRole
>
list
=
sysRoleService
.
getAll
(
role
);
return
Result
.
success
(
list
);
}
...
...
@@ -36,7 +36,7 @@ public class RoleController {
@PostMapping
(
"info"
)
@Token
@ApiOperation
(
"查询角色详细信息"
)
public
Object
getById
(
@RequestBody
RoleReq
.
InfoRoleReq
role
)
throws
Exception
{
public
Object
getById
(
@RequestBody
RoleReq
.
InfoRoleReq
role
)
throws
Exception
{
SysRole
info
=
sysRoleService
.
info
(
role
.
getRoleId
());
return
Result
.
success
(
info
);
}
...
...
@@ -44,9 +44,9 @@ public class RoleController {
@PostMapping
(
"add"
)
@Token
@ApiOperation
(
"添加角色"
)
public
Object
addUser
(
@ApiIgnore
@CurrentUser
Long
userId
,
@Valid
@RequestBody
RoleReq
.
AddRoleReq
role
)
throws
Exception
{
public
Object
addUser
(
@ApiIgnore
@CurrentUser
Long
userId
,
@Valid
@RequestBody
RoleReq
.
AddRoleReq
role
)
throws
Exception
{
SysRole
sysRole
=
sysRoleService
.
findByCode
(
role
.
getRoleCode
());
if
(
sysRole
!=
null
){
if
(
sysRole
!=
null
){
return
Result
.
error
(
"该角色已存在!"
);
}
boolean
result
=
sysRoleService
.
addRole
(
userId
,
role
);
...
...
@@ -59,7 +59,7 @@ public class RoleController {
@PostMapping
(
"delete"
)
@Token
@ApiOperation
(
"删除角色"
)
public
Object
addUser
(
@RequestBody
RoleReq
.
DeleteRoleReq
role
)
throws
Exception
{
public
Object
addUser
(
@RequestBody
RoleReq
.
DeleteRoleReq
role
)
throws
Exception
{
boolean
result
=
sysRoleService
.
deleteRole
(
role
);
if
(
result
)
return
Result
.
success
(
null
);
...
...
@@ -70,11 +70,11 @@ public class RoleController {
@PostMapping
(
"update"
)
@Token
@ApiOperation
(
"修改角色"
)
public
Object
addUser
(
@Valid
@RequestBody
RoleReq
.
UpdateRoleReq
role
)
throws
Exception
{
public
Object
addUser
(
@Valid
@RequestBody
RoleReq
.
UpdateRoleReq
role
)
throws
Exception
{
SysRole
reqRole
=
sysRoleService
.
info
(
role
.
getRoleId
());
SysRole
codeRole
=
sysRoleService
.
findByCode
(
role
.
getRoleCode
());
if
(
reqRole
!=
null
){
if
(
codeRole
!=
null
&&
!
codeRole
.
getRoleCode
().
equals
(
reqRole
.
getRoleCode
())){
if
(
reqRole
!=
null
){
if
(
codeRole
!=
null
&&
!
codeRole
.
getRoleCode
().
equals
(
reqRole
.
getRoleCode
())){
return
Result
.
error
(
"该角色已存在"
);
}
}
...
...
@@ -88,7 +88,7 @@ public class RoleController {
@PostMapping
(
"saveuserole"
)
@Token
@ApiOperation
(
"保存用户角色"
)
public
Object
saveUserOrg
(
@ApiIgnore
@CurrentUser
Long
userId
,
@RequestBody
RoleReq
.
SavaUserRoleReq
role
)
throws
Exception
{
public
Object
saveUserOrg
(
@ApiIgnore
@CurrentUser
Long
userId
,
@RequestBody
RoleReq
.
SavaUserRoleReq
role
)
throws
Exception
{
boolean
result
=
sysRoleService
.
saveUserRole
(
userId
,
role
);
if
(
result
)
return
Result
.
success
(
null
);
...
...
bsoft-admin/src/main/java/com/bsoft/admin/controller/UserController.java
View file @
c4e21bbb
...
...
@@ -22,7 +22,7 @@ import springfox.documentation.annotations.ApiIgnore;
import
javax.validation.Valid
;
import
java.util.List
;
@Api
(
tags
=
"用户API"
,
produces
=
"produces"
,
consumes
=
"consumes"
,
protocols
=
"protocols"
)
@Api
(
tags
=
"用户API"
,
produces
=
"produces"
,
consumes
=
"consumes"
,
protocols
=
"protocols"
)
@RequestMapping
(
"/user"
)
@RestController
public
class
UserController
{
...
...
@@ -36,7 +36,7 @@ public class UserController {
@PostMapping
(
"all"
)
@Token
@ApiOperation
(
"查询用户列表"
)
public
Object
getAll
(
@RequestBody
UserReq
.
GetUserReq
user
)
throws
Exception
{
public
Object
getAll
(
@RequestBody
UserReq
.
GetUserReq
user
)
throws
Exception
{
List
<
SysUser
>
list
=
userService
.
getAll
(
user
);
return
Result
.
success
(
list
);
}
...
...
@@ -44,7 +44,7 @@ public class UserController {
@PostMapping
(
"info"
)
@Token
@ApiOperation
(
"查询用户详细信息"
)
public
Object
getById
(
@RequestBody
UserReq
.
InfoUserReq
user
)
throws
Exception
{
public
Object
getById
(
@RequestBody
UserReq
.
InfoUserReq
user
)
throws
Exception
{
SysUser
info
=
userService
.
info
(
user
.
getUserId
());
return
Result
.
success
(
info
);
}
...
...
@@ -52,12 +52,12 @@ public class UserController {
@PostMapping
(
"add"
)
@Token
@ApiOperation
(
"添加用户"
)
public
Object
addUser
(
@ApiIgnore
@CurrentUser
Long
userId
,
@Valid
@RequestBody
UserReq
.
AddUserReq
user
)
throws
Exception
{
public
Object
addUser
(
@ApiIgnore
@CurrentUser
Long
userId
,
@Valid
@RequestBody
UserReq
.
AddUserReq
user
)
throws
Exception
{
SysUser
sysUser
=
userService
.
findByLoginName
(
user
.
getUserCode
());
if
(
sysUser
!=
null
){
if
(
sysUser
!=
null
){
return
Result
.
error
(
"该账号已存在!"
);
}
boolean
result
=
userService
.
addUser
(
userId
,
user
);
boolean
result
=
userService
.
addUser
(
userId
,
user
);
if
(
result
)
return
Result
.
success
(
null
);
else
...
...
@@ -67,8 +67,8 @@ public class UserController {
@PostMapping
(
"delete"
)
@Token
@ApiOperation
(
"删除用户"
)
public
Object
deleteUser
(
@RequestBody
UserReq
.
DeleteUserReq
user
)
throws
Exception
{
boolean
result
=
userService
.
deleteUser
(
user
);
public
Object
deleteUser
(
@RequestBody
UserReq
.
DeleteUserReq
user
)
throws
Exception
{
boolean
result
=
userService
.
deleteUser
(
user
);
if
(
result
)
return
Result
.
success
(
null
);
else
...
...
@@ -78,15 +78,15 @@ public class UserController {
@PostMapping
(
"update"
)
@Token
@ApiOperation
(
"修改用户"
)
public
Object
updateUser
(
@Valid
@RequestBody
UserReq
.
UpdateUserReq
user
)
throws
Exception
{
public
Object
updateUser
(
@Valid
@RequestBody
UserReq
.
UpdateUserReq
user
)
throws
Exception
{
SysUser
reqUser
=
userService
.
info
(
user
.
getUserId
());
SysUser
codeUser
=
userService
.
findByLoginName
(
user
.
getUserCode
());
if
(
reqUser
!=
null
){
if
(
codeUser
!=
null
&&
!
codeUser
.
getUserCode
().
equals
(
reqUser
.
getUserCode
())){
if
(
reqUser
!=
null
){
if
(
codeUser
!=
null
&&
!
codeUser
.
getUserCode
().
equals
(
reqUser
.
getUserCode
())){
return
Result
.
error
(
"该用户已存在"
);
}
}
boolean
result
=
userService
.
updateUser
(
user
);
boolean
result
=
userService
.
updateUser
(
user
);
if
(
result
)
return
Result
.
success
(
null
);
else
...
...
@@ -96,7 +96,7 @@ public class UserController {
@PostMapping
(
"roles"
)
@Token
@ApiOperation
(
"查询用户角色"
)
public
Object
getRoleListByUser
(
@RequestBody
UserReq
.
InfoUserReq
user
)
throws
Exception
{
public
Object
getRoleListByUser
(
@RequestBody
UserReq
.
InfoUserReq
user
)
throws
Exception
{
List
<
SysRole
>
sysRoleList
=
sysUserRoleRsService
.
getRoleListByUser
(
user
.
getUserId
());
return
Result
.
success
(
sysRoleList
);
}
...
...
@@ -104,7 +104,7 @@ public class UserController {
@PostMapping
(
"menus"
)
@Token
@ApiOperation
(
"查询用户菜单"
)
public
Object
getMenuByUser
(
@RequestBody
UserReq
.
InfoUserReq
user
)
throws
Exception
{
public
Object
getMenuByUser
(
@RequestBody
UserReq
.
InfoUserReq
user
)
throws
Exception
{
List
<
SysMenuList
>
sysMenuList
=
sysMenuService
.
getMenu
(
user
.
getUserId
());
return
Result
.
success
(
sysMenuList
);
}
...
...
bsoft-admin/src/main/java/com/bsoft/admin/mapper/DicOrgMapper.java
View file @
c4e21bbb
...
...
@@ -7,19 +7,19 @@ import org.apache.ibatis.annotations.Param;
import
java.util.List
;
public
interface
DicOrgMapper
{
int
deleteByPrimaryKey
(
Long
id
);
int
deleteByPrimaryKey
(
Integer
id
);
int
insert
(
DicOrg
record
);
DicOrg
selectByPrimaryKey
(
Long
id
);
DicOrg
selectByPrimaryKey
(
Integer
id
);
List
<
DicOrg
>
selectAll
();
List
<
DicOrgList
>
selectParentAll
();
int
updateByPrimaryKey
(
DicOrg
record
);
List
<
DicOrg
>
selectByUser
(
@Param
(
"userId"
)
Long
userId
);
List
<
DicOrgList
>
selectParentAll
();
List
<
DicOrg
>
selectByUser
(
@Param
(
"userId"
)
Integer
userId
);
DicOrg
selectByName
(
@Param
(
"orgName"
)
String
orgName
);
}
\ No newline at end of file
bsoft-admin/src/main/java/com/bsoft/admin/mapper/SysMenuMapper.java
View file @
c4e21bbb
...
...
@@ -7,19 +7,19 @@ import org.apache.ibatis.annotations.Param;
import
java.util.List
;
public
interface
SysMenuMapper
{
int
deleteByPrimaryKey
(
Long
id
);
int
deleteByPrimaryKey
(
Integer
id
);
int
insert
(
SysMenu
record
);
SysMenu
selectByPrimaryKey
(
Long
id
);
SysMenu
selectByPrimaryKey
(
Integer
id
);
List
<
SysMenu
>
selectAll
();
int
updateByPrimaryKey
(
SysMenu
record
);
List
<
SysMenuList
>
selectMenuAllByUser
(
Long
userId
);
List
<
SysMenuList
>
selectMenuAllByUser
(
Integer
userId
);
List
<
SysMenuList
>
selectMenuByRole
(
Long
userId
);
List
<
SysMenuList
>
selectMenuByRole
(
Integer
userId
);
List
<
SysMenuList
>
selectParentAll
();
...
...
bsoft-admin/src/main/java/com/bsoft/admin/mapper/SysRoleMapper.java
View file @
c4e21bbb
...
...
@@ -6,17 +6,17 @@ import org.apache.ibatis.annotations.Param;
import
java.util.List
;
public
interface
SysRoleMapper
{
int
deleteByPrimaryKey
(
Long
id
);
int
deleteByPrimaryKey
(
Integer
id
);
int
insert
(
SysRole
record
);
SysRole
selectByPrimaryKey
(
Long
id
);
SysRole
selectByPrimaryKey
(
Integer
id
);
List
<
SysRole
>
selectAll
();
int
updateByPrimaryKey
(
SysRole
record
);
List
<
SysRole
>
selectRoleByUser
(
Long
userId
);
List
<
SysRole
>
selectRoleByUser
(
Integer
userId
);
SysRole
selectByCode
(
@Param
(
"roleCode"
)
Long
roleCode
);
}
\ No newline at end of file
bsoft-admin/src/main/java/com/bsoft/admin/mapper/SysRoleMenuRsMapper.java
View file @
c4e21bbb
...
...
@@ -7,17 +7,17 @@ import org.apache.ibatis.annotations.Param;
import
java.util.List
;
public
interface
SysRoleMenuRsMapper
{
int
deleteByPrimaryKey
(
Long
id
);
int
deleteByPrimaryKey
(
Integer
id
);
int
insert
(
SysRoleMenuRs
record
);
SysRoleMenuRs
selectByPrimaryKey
(
Long
id
);
SysRoleMenuRs
selectByPrimaryKey
(
Integer
id
);
List
<
SysRoleMenuRs
>
selectAll
();
int
updateByPrimaryKey
(
SysRoleMenuRs
record
);
List
<
SysRoleMenuRsList
>
selectByRole
(
@Param
(
"roleId"
)
Long
roleId
);
List
<
SysRoleMenuRsList
>
selectByRole
(
@Param
(
"roleId"
)
Integer
roleId
);
int
deleteAllByRole
(
@Param
(
"roleId"
)
Long
roleId
);
...
...
bsoft-admin/src/main/java/com/bsoft/admin/mapper/SysUserMapper.java
View file @
c4e21bbb
...
...
@@ -6,11 +6,11 @@ import org.apache.ibatis.annotations.Param;
import
java.util.List
;
public
interface
SysUserMapper
{
int
deleteByPrimaryKey
(
Long
id
);
int
deleteByPrimaryKey
(
Integer
id
);
int
insert
(
SysUser
record
);
SysUser
selectByPrimaryKey
(
Long
id
);
SysUser
selectByPrimaryKey
(
Integer
id
);
List
<
SysUser
>
selectAll
();
...
...
bsoft-admin/src/main/java/com/bsoft/admin/mapper/SysUserMenuRsMapper.java
View file @
c4e21bbb
...
...
@@ -7,17 +7,17 @@ import org.apache.ibatis.annotations.Param;
import
java.util.List
;
public
interface
SysUserMenuRsMapper
{
int
deleteByPrimaryKey
(
Long
id
);
int
deleteByPrimaryKey
(
Integer
id
);
int
insert
(
SysUserMenuRs
record
);
SysUserMenuRs
selectByPrimaryKey
(
Long
id
);
SysUserMenuRs
selectByPrimaryKey
(
Integer
id
);
List
<
SysUserMenuRs
>
selectAll
();
int
updateByPrimaryKey
(
SysUserMenuRs
record
);
List
<
SysUserMenuRsList
>
selectByUser
(
@Param
(
"userId"
)
Long
userId
);
List
<
SysUserMenuRsList
>
selectByUser
(
@Param
(
"userId"
)
Integer
userId
);
int
deleteAllByUser
(
@Param
(
"userId"
)
Long
userId
);
...
...
bsoft-admin/src/main/java/com/bsoft/admin/mapper/SysUserOrgRsMapper.java
View file @
c4e21bbb
...
...
@@ -7,17 +7,17 @@ import org.apache.ibatis.annotations.Param;
import
java.util.List
;
public
interface
SysUserOrgRsMapper
{
int
deleteByPrimaryKey
(
Long
id
);
int
deleteByPrimaryKey
(
Integer
id
);
int
insert
(
SysUserOrgRs
record
);
SysUserOrgRs
selectByPrimaryKey
(
Long
id
);
SysUserOrgRs
selectByPrimaryKey
(
Integer
id
);
List
<
SysUserOrgRs
>
selectAll
();
int
updateByPrimaryKey
(
SysUserOrgRs
record
);
List
<
SysUserOrgRsList
>
selectByUser
(
@Param
(
"userId"
)
Long
userId
);
List
<
SysUserOrgRsList
>
selectByUser
(
@Param
(
"userId"
)
Integer
userId
);
SysUserOrgRs
selectByUserWithOrg
(
@Param
(
"userId"
)
Long
userId
,
@Param
(
"orgId"
)
Long
orgId
);
...
...
bsoft-admin/src/main/java/com/bsoft/admin/mapper/SysUserRoleRsMapper.java
View file @
c4e21bbb
package
com
.
bsoft
.
admin
.
mapper
;
import
com.bsoft.admin.model.SysUserRoleRs
;
import
com.bsoft.admin.model.SysRole
;
import
org.apache.ibatis.annotations.Param
;
import
javax.annotation.security.PermitAll
;
import
java.util.List
;
public
interface
SysUserRoleRsMapper
{
int
deleteByPrimaryKey
(
Long
id
);
int
deleteByPrimaryKey
(
Integer
id
);
int
insert
(
SysUserRoleRs
record
);
SysUserRoleRs
selectByPrimaryKey
(
Long
id
);
SysUserRoleRs
selectByPrimaryKey
(
Integer
id
);
List
<
SysUserRoleRs
>
selectAll
();
...
...
bsoft-admin/src/main/java/com/bsoft/admin/model/DicOrg.java
View file @
c4e21bbb
...
...
@@ -3,7 +3,7 @@ package com.bsoft.admin.model;
import
java.util.Date
;
public
class
DicOrg
{
private
Long
id
;
private
Integer
id
;
private
Date
createDate
;
...
...
@@ -25,13 +25,13 @@ public class DicOrg {
private
String
orgAddress
;
private
Long
parentId
;
private
Integer
parentId
;
public
Long
getId
()
{
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Long
id
)
{
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
...
...
@@ -115,29 +115,11 @@ public class DicOrg {
this
.
orgAddress
=
orgAddress
;
}
public
Long
getParentId
()
{
public
Integer
getParentId
()
{
return
parentId
;
}
public
void
setParentId
(
Long
parentId
)
{
public
void
setParentId
(
Integer
parentId
)
{
this
.
parentId
=
parentId
;
}
@Override
public
String
toString
()
{
return
"DicOrg{"
+
"id="
+
id
+
", createDate="
+
createDate
+
", createUserid="
+
createUserid
+
", state="
+
state
+
", orgCode='"
+
orgCode
+
'\''
+
", orgName='"
+
orgName
+
'\''
+
", orgNo='"
+
orgNo
+
'\''
+
", orgShortName='"
+
orgShortName
+
'\''
+
", orgGroup='"
+
orgGroup
+
'\''
+
", orgType='"
+
orgType
+
'\''
+
", orgAddress='"
+
orgAddress
+
'\''
+
", parentId="
+
parentId
+
'}'
;
}
}
\ No newline at end of file
bsoft-admin/src/main/java/com/bsoft/admin/model/SysMenu.java
View file @
c4e21bbb
...
...
@@ -3,7 +3,7 @@ package com.bsoft.admin.model;
import
java.util.Date
;
public
class
SysMenu
{
private
Long
id
;
private
Integer
id
;
private
Date
createData
;
...
...
@@ -23,11 +23,11 @@ public class SysMenu {
private
Long
sort
;
public
Long
getId
()
{
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Long
id
)
{
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
...
...
@@ -102,20 +102,4 @@ public class SysMenu {
public
void
setSort
(
Long
sort
)
{
this
.
sort
=
sort
;
}
@Override
public
String
toString
()
{
return
"SysMenu{"
+
"id="
+
id
+
", createData="
+
createData
+
", createUserid="
+
createUserid
+
", state="
+
state
+
", menuName='"
+
menuName
+
'\''
+
", menuUrl='"
+
menuUrl
+
'\''
+
", menuImage='"
+
menuImage
+
'\''
+
", parentId="
+
parentId
+
", pageCode='"
+
pageCode
+
'\''
+
", sort="
+
sort
+
'}'
;
}
}
\ No newline at end of file
bsoft-admin/src/main/java/com/bsoft/admin/model/SysRole.java
View file @
c4e21bbb
...
...
@@ -3,7 +3,7 @@ package com.bsoft.admin.model;
import
java.util.Date
;
public
class
SysRole
{
private
Long
id
;
private
Integer
id
;
private
Date
createDate
;
...
...
@@ -15,11 +15,11 @@ public class SysRole {
private
Long
roleCode
;
public
Long
getId
()
{
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Long
id
)
{
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
...
...
@@ -62,16 +62,4 @@ public class SysRole {
public
void
setRoleCode
(
Long
roleCode
)
{
this
.
roleCode
=
roleCode
;
}
@Override
public
String
toString
()
{
return
"SysRole{"
+
"id="
+
id
+
", createDate="
+
createDate
+
", createUserid="
+
createUserid
+
", state="
+
state
+
", roleName='"
+
roleName
+
'\''
+
", roleCode="
+
roleCode
+
'}'
;
}
}
\ No newline at end of file
bsoft-admin/src/main/java/com/bsoft/admin/model/SysRoleMenuRs.java
View file @
c4e21bbb
...
...
@@ -3,7 +3,7 @@ package com.bsoft.admin.model;
import
java.util.Date
;
public
class
SysRoleMenuRs
{
private
Long
id
;
private
Integer
id
;
private
Date
createDate
;
...
...
@@ -15,11 +15,11 @@ public class SysRoleMenuRs {
private
Long
roleId
;
public
Long
getId
()
{
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Long
id
)
{
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
...
...
@@ -62,16 +62,4 @@ public class SysRoleMenuRs {
public
void
setRoleId
(
Long
roleId
)
{
this
.
roleId
=
roleId
;
}
@Override
public
String
toString
()
{
return
"SysRoleMenuRs{"
+
"id="
+
id
+
", createDate="
+
createDate
+
", createUserid="
+
createUserid
+
", state="
+
state
+
", menuId="
+
menuId
+
", roleId="
+
roleId
+
'}'
;
}
}
\ No newline at end of file
bsoft-admin/src/main/java/com/bsoft/admin/model/SysUser.java
View file @
c4e21bbb
...
...
@@ -3,7 +3,7 @@ package com.bsoft.admin.model;
import
java.util.Date
;
public
class
SysUser
{
private
Long
id
;
private
Integer
id
;
private
Date
createDate
;
...
...
@@ -33,11 +33,11 @@ public class SysUser {
private
String
lastIp
;
public
Long
getId
()
{
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Long
id
)
{
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
...
...
@@ -152,25 +152,4 @@ public class SysUser {
public
void
setLastIp
(
String
lastIp
)
{
this
.
lastIp
=
lastIp
;
}
@Override
public
String
toString
()
{
return
"SysUser{"
+
"id="
+
id
+
", createDate="
+
createDate
+
", createUserid="
+
createUserid
+
", state="
+
state
+
", userCode='"
+
userCode
+
'\''
+
", userName='"
+
userName
+
'\''
+
", password='"
+
password
+
'\''
+
", idcard='"
+
idcard
+
'\''
+
", sex='"
+
sex
+
'\''
+
", mobile='"
+
mobile
+
'\''
+
", pageCount="
+
pageCount
+
", errorCount="
+
errorCount
+
", errorTime="
+
errorTime
+
", lastTime="
+
lastTime
+
", lastIp='"
+
lastIp
+
'\''
+
'}'
;
}
}
\ No newline at end of file
bsoft-admin/src/main/java/com/bsoft/admin/model/SysUserMenuRs.java
View file @
c4e21bbb
...
...
@@ -3,7 +3,7 @@ package com.bsoft.admin.model;
import
java.util.Date
;
public
class
SysUserMenuRs
{
private
Long
id
;
private
Integer
id
;
private
Date
createDate
;
...
...
@@ -15,11 +15,11 @@ public class SysUserMenuRs {
private
Long
menuId
;
public
Long
getId
()
{
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Long
id
)
{
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
...
...
@@ -62,16 +62,4 @@ public class SysUserMenuRs {
public
void
setMenuId
(
Long
menuId
)
{
this
.
menuId
=
menuId
;
}
@Override
public
String
toString
()
{
return
"SysUserMenuRs{"
+
"id="
+
id
+
", createDate="
+
createDate
+
", createUserid="
+
createUserid
+
", state="
+
state
+
", userId="
+
userId
+
", menuId="
+
menuId
+
'}'
;
}
}
\ No newline at end of file
bsoft-admin/src/main/java/com/bsoft/admin/model/SysUserOrgRs.java
View file @
c4e21bbb
...
...
@@ -3,7 +3,7 @@ package com.bsoft.admin.model;
import
java.util.Date
;
public
class
SysUserOrgRs
{
private
Long
id
;
private
Integer
id
;
private
Date
createDate
;
...
...
@@ -15,11 +15,11 @@ public class SysUserOrgRs {
private
Long
orgId
;
public
Long
getId
()
{
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Long
id
)
{
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
...
...
@@ -62,16 +62,4 @@ public class SysUserOrgRs {
public
void
setOrgId
(
Long
orgId
)
{
this
.
orgId
=
orgId
;
}
@Override
public
String
toString
()
{
return
"SysUserOrgRs{"
+
"id="
+
id
+
", createDate="
+
createDate
+
", createUserid="
+
createUserid
+
", state="
+
state
+
", userId="
+
userId
+
", orgId="
+
orgId
+
'}'
;
}
}
\ No newline at end of file
bsoft-admin/src/main/java/com/bsoft/admin/model/SysUserRoleRs.java
View file @
c4e21bbb
...
...
@@ -3,7 +3,7 @@ package com.bsoft.admin.model;
import
java.util.Date
;
public
class
SysUserRoleRs
{
private
Long
id
;
private
Integer
id
;
private
Date
createDate
;
...
...
@@ -15,11 +15,11 @@ public class SysUserRoleRs {
private
Long
roleId
;
public
Long
getId
()
{
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Long
id
)
{
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
...
...
@@ -62,16 +62,4 @@ public class SysUserRoleRs {
public
void
setRoleId
(
Long
roleId
)
{
this
.
roleId
=
roleId
;
}
@Override
public
String
toString
()
{
return
"SysUserRoleRs{"
+
"id="
+
id
+
", createDate="
+
createDate
+
", createUserid="
+
createUserid
+
", state="
+
state
+
", userId="
+
userId
+
", roleId="
+
roleId
+
'}'
;
}
}
\ No newline at end of file
bsoft-admin/src/main/java/com/bsoft/admin/model/reqmodel/CodeAndPwd.java
View file @
c4e21bbb
...
...
@@ -2,40 +2,17 @@ package com.bsoft.admin.model.reqmodel;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
@ApiModel
(
"账号密码"
)
@Data
public
class
CodeAndPwd
{
@ApiModelProperty
(
value
=
"账号"
,
required
=
true
)
@ApiModelProperty
(
value
=
"账号"
,
required
=
true
)
@NotBlank
(
message
=
"账号 参数必传"
)
String
loginName
;
@NotBlank
(
message
=
"密码 参数必传"
)
@ApiModelProperty
(
value
=
"密码"
,
required
=
true
)
@ApiModelProperty
(
value
=
"密码"
,
required
=
true
)
String
password
;
public
String
getLoginName
()
{
return
loginName
;
}
public
void
setLoginName
(
String
loginName
)
{
this
.
loginName
=
loginName
;
}
public
String
getPassword
()
{
return
password
;
}
public
void
setPassword
(
String
password
)
{
this
.
password
=
password
;
}
@Override
public
String
toString
()
{
return
"CodeAndPwd{"
+
"loginName='"
+
loginName
+
'\''
+
", password='"
+
password
+
'\''
+
'}'
;
}
}
bsoft-admin/src/main/java/com/bsoft/admin/model/reqmodel/MenuReq.java
View file @
c4e21bbb
...
...
@@ -8,8 +8,8 @@ import javax.validation.constraints.NotNull;
import
java.util.List
;
public
class
MenuReq
{
public
static
class
GetMenuReq
{
@ApiModelProperty
(
value
=
"菜单名称"
)
public
static
class
GetMenuReq
{
@ApiModelProperty
(
value
=
"菜单名称"
)
private
String
menuName
;
public
String
getMenuName
()
{
...
...
@@ -28,16 +28,16 @@ public class MenuReq {
}
}
public
static
class
InfoMenuReq
{
@ApiModelProperty
(
value
=
"菜单ID"
,
required
=
true
)
public
static
class
InfoMenuReq
{
@ApiModelProperty
(
value
=
"菜单ID"
,
required
=
true
)
@NotNull
(
message
=
"菜单ID 参数必传"
)
private
Long
menuId
;
private
Integer
menuId
;
public
Long
getMenuId
()
{
public
Integer
getMenuId
()
{
return
menuId
;
}
public
void
setMenuId
(
Long
menuId
)
{
public
void
setMenuId
(
Integer
menuId
)
{
this
.
menuId
=
menuId
;
}
...
...
@@ -49,22 +49,22 @@ public class MenuReq {
}
}
public
static
class
AddMenuReq
{
@ApiModelProperty
(
value
=
"菜单名称"
,
required
=
true
)
public
static
class
AddMenuReq
{
@ApiModelProperty
(
value
=
"菜单名称"
,
required
=
true
)
@NotBlank
(
message
=
"菜单名称 参数必传"
)
private
String
menuName
;
@ApiModelProperty
(
value
=
"菜单路径"
,
required
=
true
)
@ApiModelProperty
(
value
=
"菜单路径"
,
required
=
true
)
private
String
menuUrl
;
@ApiModelProperty
(
value
=
"菜单图片"
,
required
=
true
)
@ApiModelProperty
(
value
=
"菜单图片"
,
required
=
true
)
private
String
menuImage
;
@ApiModelProperty
(
value
=
"父级关系"
,
required
=
true
)
@ApiModelProperty
(
value
=
"父级关系"
,
required
=
true
)
@NotNull
(
message
=
"父级关系 参数必传"
)
private
Long
parentId
;
@ApiModelProperty
(
value
=
"页面编码"
,
required
=
true
)
@ApiModelProperty
(
value
=
"页面编码"
,
required
=
true
)
private
String
pageCode
;
public
String
getMenuName
()
{
...
...
@@ -119,16 +119,16 @@ public class MenuReq {
}
}
public
static
class
DeleteMenuReq
{
@ApiModelProperty
(
value
=
"菜单ID"
,
required
=
true
)
public
static
class
DeleteMenuReq
{
@ApiModelProperty
(
value
=
"菜单ID"
,
required
=
true
)
@NotNull
(
message
=
"菜单ID 参数必传"
)
private
Long
menuId
;
private
Integer
menuId
;
public
Long
getMenuId
()
{
public
Integer
getMenuId
()
{
return
menuId
;
}
public
void
setMenuId
(
Long
menuId
)
{
public
void
setMenuId
(
Integer
menuId
)
{
this
.
menuId
=
menuId
;
}
...
...
@@ -140,33 +140,33 @@ public class MenuReq {
}
}
public
static
class
UpdateMenuReq
{
@ApiModelProperty
(
value
=
"菜单ID"
,
required
=
true
)
public
static
class
UpdateMenuReq
{
@ApiModelProperty
(
value
=
"菜单ID"
,
required
=
true
)
@NotNull
(
message
=
"菜单ID 参数必传"
)
private
Long
menuId
;
private
Integer
menuId
;
@ApiModelProperty
(
value
=
"菜单名称"
,
required
=
true
)
@ApiModelProperty
(
value
=
"菜单名称"
,
required
=
true
)
@NotBlank
(
message
=
"菜单名称 参数必传"
)
private
String
menuName
;
@ApiModelProperty
(
value
=
"菜单路径"
,
required
=
true
)
@ApiModelProperty
(
value
=
"菜单路径"
,
required
=
true
)
private
String
menuUrl
;
@ApiModelProperty
(
value
=
"菜单图片"
,
required
=
true
)
@ApiModelProperty
(
value
=
"菜单图片"
,
required
=
true
)
private
String
menuImage
;
@ApiModelProperty
(
value
=
"父级关系"
,
required
=
true
)
@ApiModelProperty
(
value
=
"父级关系"
,
required
=
true
)
@NotNull
(
message
=
"父级关系 参数必传"
)
private
Long
parentId
;
@ApiModelProperty
(
value
=
"页面编码"
,
required
=
true
)
@ApiModelProperty
(
value
=
"页面编码"
,
required
=
true
)
private
String
pageCode
;
public
Long
getMenuId
()
{
public
Integer
getMenuId
()
{
return
menuId
;
}
public
void
setMenuId
(
Long
menuId
)
{
public
void
setMenuId
(
Integer
menuId
)
{
this
.
menuId
=
menuId
;
}
...
...
@@ -226,12 +226,12 @@ public class MenuReq {
/**
* 保存用户菜单入参
*/
public
static
class
SaveUserMenuReq
{
@ApiModelProperty
(
value
=
"用户ID"
,
required
=
true
)
public
static
class
SaveUserMenuReq
{
@ApiModelProperty
(
value
=
"用户ID"
,
required
=
true
)
@NotNull
(
message
=
"用户ID 参数必传"
)
private
Long
userId
;
@ApiModelProperty
(
value
=
"菜单ID集合"
,
required
=
true
)
@ApiModelProperty
(
value
=
"菜单ID集合"
,
required
=
true
)
@NotNull
(
message
=
"菜单ID集合 参数必传"
)
private
List
<
Long
>
menus
;
...
...
@@ -263,16 +263,16 @@ public class MenuReq {
/**
* 查询用户菜单入参
*/
public
static
class
GetUserMenuReq
{
@ApiModelProperty
(
value
=
"用户ID"
,
required
=
true
)
public
static
class
GetUserMenuReq
{
@ApiModelProperty
(
value
=
"用户ID"
,
required
=
true
)
@NotNull
(
message
=
"用户ID 参数必传"
)
private
Long
userId
;
private
Integer
userId
;
public
Long
getUserId
()
{
public
Integer
getUserId
()
{
return
userId
;
}
public
void
setUserId
(
Long
userId
)
{
public
void
setUserId
(
Integer
userId
)
{
this
.
userId
=
userId
;
}
...
...
@@ -287,12 +287,12 @@ public class MenuReq {
/**
* 保存角色菜单入参
*/
public
static
class
SaveRoleMenuReq
{
@ApiModelProperty
(
value
=
"角色ID"
,
required
=
true
)
public
static
class
SaveRoleMenuReq
{
@ApiModelProperty
(
value
=
"角色ID"
,
required
=
true
)
@NotNull
(
message
=
"角色ID 参数必传"
)
private
Long
roleId
;
@ApiModelProperty
(
value
=
"菜单ID集合"
,
required
=
true
)
@ApiModelProperty
(
value
=
"菜单ID集合"
,
required
=
true
)
@NotNull
(
message
=
"菜单ID集合 参数必传"
)
private
List
<
Long
>
menus
;
...
...
@@ -316,16 +316,16 @@ public class MenuReq {
/**
* 查询角色菜单入参
*/
public
static
class
GetRoleMenuReq
{
@ApiModelProperty
(
value
=
"角色ID"
,
required
=
true
)
public
static
class
GetRoleMenuReq
{
@ApiModelProperty
(
value
=
"角色ID"
,
required
=
true
)
@NotNull
(
message
=
"角色ID 参数必传"
)
private
Long
roleId
;
private
Integer
roleId
;
public
Long
getRoleId
()
{
public
Integer
getRoleId
()
{
return
roleId
;
}
public
void
setRoleId
(
Long
roleId
)
{
public
void
setRoleId
(
Integer
roleId
)
{
this
.
roleId
=
roleId
;
}
}
...
...
@@ -333,8 +333,8 @@ public class MenuReq {
/**
* 修改菜单排序入参
*/
public
static
class
UpdateSortReq
{
@ApiModelProperty
(
value
=
"菜单列表"
,
required
=
true
)
public
static
class
UpdateSortReq
{
@ApiModelProperty
(
value
=
"菜单列表"
,
required
=
true
)
@NotNull
(
message
=
"菜单列表 参数必传"
)
private
List
<
SysMenu
>
menus
;
...
...
bsoft-admin/src/main/java/com/bsoft/admin/model/reqmodel/OrgReq.java
View file @
c4e21bbb
...
...
@@ -30,13 +30,13 @@ public class OrgReq {
public
static
class
InfoOrgReq
{
@ApiModelProperty
(
value
=
"机构ID"
,
required
=
true
)
@NotNull
(
message
=
"机构ID 参数必传"
)
private
Long
orgId
;
private
Integer
orgId
;
public
Long
getOrgId
()
{
public
Integer
getOrgId
()
{
return
orgId
;
}
public
void
setOrgId
(
Long
orgId
)
{
public
void
setOrgId
(
Integer
orgId
)
{
this
.
orgId
=
orgId
;
}
...
...
@@ -75,7 +75,7 @@ public class OrgReq {
@ApiModelProperty
(
value
=
"父级关系"
,
required
=
true
)
@NotNull
(
message
=
"父级关系 参数必传"
)
private
Long
parentId
;
private
Integer
parentId
;
public
String
getOrgCode
()
{
return
orgCode
;
...
...
@@ -133,11 +133,11 @@ public class OrgReq {
this
.
orgAddress
=
orgAddress
;
}
public
Long
getParentId
()
{
public
Integer
getParentId
()
{
return
parentId
;
}
public
void
setParentId
(
Long
parentId
)
{
public
void
setParentId
(
Integer
parentId
)
{
this
.
parentId
=
parentId
;
}
...
...
@@ -159,13 +159,13 @@ public class OrgReq {
public
static
class
DeleteOrgReq
{
@ApiModelProperty
(
value
=
"机构ID"
,
required
=
true
)
@NotNull
(
message
=
"机构ID 参数必传"
)
private
Long
orgId
;
private
Integer
orgId
;
public
Long
getOrgId
()
{
public
Integer
getOrgId
()
{
return
orgId
;
}
public
void
setOrgId
(
Long
orgId
)
{
public
void
setOrgId
(
Integer
orgId
)
{
this
.
orgId
=
orgId
;
}
...
...
@@ -180,7 +180,7 @@ public class OrgReq {
public
static
class
UpdateOrgReq
{
@ApiModelProperty
(
value
=
"机构ID"
,
required
=
true
)
@NotNull
(
message
=
"机构ID 参数必传"
)
private
Long
orgId
;
private
Integer
orgId
;
@ApiModelProperty
(
value
=
"组织机构代码"
,
required
=
true
)
@NotBlank
(
message
=
"组织机构代码 参数必传"
)
...
...
@@ -208,13 +208,13 @@ public class OrgReq {
@ApiModelProperty
(
value
=
"父级关系"
,
required
=
true
)
@NotNull
(
message
=
"父级关系 参数必传"
)
private
Long
parentId
;
private
Integer
parentId
;
public
Long
getOrgId
()
{
public
Integer
getOrgId
()
{
return
orgId
;
}
public
void
setOrgId
(
Long
orgId
)
{
public
void
setOrgId
(
Integer
orgId
)
{
this
.
orgId
=
orgId
;
}
...
...
@@ -274,11 +274,11 @@ public class OrgReq {
this
.
orgAddress
=
orgAddress
;
}
public
Long
getParentId
()
{
public
Integer
getParentId
()
{
return
parentId
;
}
public
void
setParentId
(
Long
parentId
)
{
public
void
setParentId
(
Integer
parentId
)
{
this
.
parentId
=
parentId
;
}
...
...
@@ -304,13 +304,13 @@ public class OrgReq {
public
static
class
GetUserOrgReq
{
@ApiModelProperty
(
value
=
"用户ID"
,
required
=
true
)
@NotNull
(
message
=
"用户ID 参数必传"
)
private
Long
userId
;
private
Integer
userId
;
public
Long
getUserId
()
{
public
Integer
getUserId
()
{
return
userId
;
}
public
void
setUserId
(
Long
userId
)
{
public
void
setUserId
(
Integer
userId
)
{
this
.
userId
=
userId
;
}
...
...
bsoft-admin/src/main/java/com/bsoft/admin/model/reqmodel/RoleReq.java
View file @
c4e21bbb
...
...
@@ -6,8 +6,8 @@ import javax.validation.constraints.NotBlank;
import
javax.validation.constraints.NotNull
;
public
class
RoleReq
{
public
static
class
GetRoleReq
{
@ApiModelProperty
(
value
=
"角色名称"
,
required
=
true
)
public
static
class
GetRoleReq
{
@ApiModelProperty
(
value
=
"角色名称"
,
required
=
true
)
private
String
roleName
;
public
String
getRoleName
()
{
...
...
@@ -26,16 +26,16 @@ public class RoleReq {
}
}
public
static
class
InfoRoleReq
{
@ApiModelProperty
(
value
=
"角色ID"
,
required
=
true
)
public
static
class
InfoRoleReq
{
@ApiModelProperty
(
value
=
"角色ID"
,
required
=
true
)
@NotNull
(
message
=
"角色ID 参数必传"
)
private
Long
roleId
;
private
Integer
roleId
;
public
Long
getRoleId
()
{
public
Integer
getRoleId
()
{
return
roleId
;
}
public
void
setRoleId
(
Long
roleId
)
{
public
void
setRoleId
(
Integer
roleId
)
{
this
.
roleId
=
roleId
;
}
...
...
@@ -47,12 +47,12 @@ public class RoleReq {
}
}
public
static
class
AddRoleReq
{
@ApiModelProperty
(
value
=
"角色编码"
,
required
=
true
)
public
static
class
AddRoleReq
{
@ApiModelProperty
(
value
=
"角色编码"
,
required
=
true
)
@NotNull
(
message
=
"角色编码 参数必传"
)
private
Long
roleCode
;
@ApiModelProperty
(
value
=
"角色名称"
,
required
=
true
)
@ApiModelProperty
(
value
=
"角色名称"
,
required
=
true
)
@NotBlank
(
message
=
"角色名称 参数必传"
)
private
String
roleName
;
...
...
@@ -81,16 +81,16 @@ public class RoleReq {
}
}
public
static
class
DeleteRoleReq
{
@ApiModelProperty
(
value
=
"角色ID"
,
required
=
true
)
public
static
class
DeleteRoleReq
{
@ApiModelProperty
(
value
=
"角色ID"
,
required
=
true
)
@NotNull
(
message
=
"角色ID 参数必传"
)
private
Long
roleId
;
private
Integer
roleId
;
public
Long
getRoleId
()
{
public
Integer
getRoleId
()
{
return
roleId
;
}
public
void
setRoleId
(
Long
roleId
)
{
public
void
setRoleId
(
Integer
roleId
)
{
this
.
roleId
=
roleId
;
}
...
...
@@ -102,24 +102,24 @@ public class RoleReq {
}
}
public
static
class
UpdateRoleReq
{
@ApiModelProperty
(
value
=
"角色ID"
,
required
=
true
)
public
static
class
UpdateRoleReq
{
@ApiModelProperty
(
value
=
"角色ID"
,
required
=
true
)
@NotNull
(
message
=
"角色ID 参数必传"
)
private
Long
roleId
;
private
Integer
roleId
;
@ApiModelProperty
(
value
=
"角色编码"
,
required
=
true
)
@ApiModelProperty
(
value
=
"角色编码"
,
required
=
true
)
@NotNull
(
message
=
"角色编码 参数必传"
)
private
Long
roleCode
;
@ApiModelProperty
(
value
=
"角色名称"
,
required
=
true
)
@ApiModelProperty
(
value
=
"角色名称"
,
required
=
true
)
@NotBlank
(
message
=
"角色名称 参数必传"
)
private
String
roleName
;
public
Long
getRoleId
()
{
public
Integer
getRoleId
()
{
return
roleId
;
}
public
void
setRoleId
(
Long
roleId
)
{
public
void
setRoleId
(
Integer
roleId
)
{
this
.
roleId
=
roleId
;
}
...
...
@@ -149,12 +149,12 @@ public class RoleReq {
}
}
public
static
class
SavaUserRoleReq
{
@ApiModelProperty
(
value
=
"用户ID"
,
required
=
true
)
public
static
class
SavaUserRoleReq
{
@ApiModelProperty
(
value
=
"用户ID"
,
required
=
true
)
@NotNull
(
message
=
"用户ID 参数必传"
)
private
Long
userId
;
@ApiModelProperty
(
value
=
"角色ID"
,
required
=
true
)
@ApiModelProperty
(
value
=
"角色ID"
,
required
=
true
)
@NotNull
(
message
=
"角色ID 参数必传"
)
private
Long
roleId
;
...
...
bsoft-admin/src/main/java/com/bsoft/admin/model/reqmodel/UserReq.java
View file @
c4e21bbb
...
...
@@ -7,8 +7,8 @@ import javax.validation.constraints.NotNull;
public
class
UserReq
{
public
static
class
GetUserReq
{
@ApiModelProperty
(
value
=
"用户名称"
,
required
=
true
)
public
static
class
GetUserReq
{
@ApiModelProperty
(
value
=
"用户名称"
,
required
=
true
)
private
String
userName
;
public
String
getUserName
()
{
...
...
@@ -27,16 +27,16 @@ public class UserReq {
}
}
public
static
class
InfoUserReq
{
@ApiModelProperty
(
value
=
"用户ID"
,
required
=
true
)
public
static
class
InfoUserReq
{
@ApiModelProperty
(
value
=
"用户ID"
,
required
=
true
)
@NotNull
(
message
=
"用户ID 参数必传"
)
private
Long
userId
;
private
Integer
userId
;
public
Long
getUserId
()
{
public
Integer
getUserId
()
{
return
userId
;
}
public
void
setUserId
(
Long
userId
)
{
public
void
setUserId
(
Integer
userId
)
{
this
.
userId
=
userId
;
}
...
...
@@ -48,26 +48,26 @@ public class UserReq {
}
}
public
static
class
AddUserReq
{
@ApiModelProperty
(
value
=
"账号"
,
required
=
true
)
public
static
class
AddUserReq
{
@ApiModelProperty
(
value
=
"账号"
,
required
=
true
)
@NotBlank
(
message
=
"账号 参数必传"
)
private
String
userCode
;
@ApiModelProperty
(
value
=
"名称"
,
required
=
true
)
@ApiModelProperty
(
value
=
"名称"
,
required
=
true
)
@NotBlank
(
message
=
"名称 参数必传"
)
private
String
userName
;
@ApiModelProperty
(
value
=
"密码"
,
required
=
true
)
@ApiModelProperty
(
value
=
"密码"
,
required
=
true
)
@NotBlank
(
message
=
"密码 参数必传"
)
private
String
password
;
@ApiModelProperty
(
value
=
"身份证"
,
required
=
true
)
@ApiModelProperty
(
value
=
"身份证"
,
required
=
true
)
private
String
idcard
;
@ApiModelProperty
(
value
=
"性别"
,
required
=
true
)
@ApiModelProperty
(
value
=
"性别"
,
required
=
true
)
private
String
sex
;
@ApiModelProperty
(
value
=
"手机号码"
,
required
=
true
)
@ApiModelProperty
(
value
=
"手机号码"
,
required
=
true
)
private
String
mobile
;
public
String
getUserCode
()
{
...
...
@@ -132,16 +132,16 @@ public class UserReq {
}
public
static
class
DeleteUserReq
{
@ApiModelProperty
(
value
=
"用户ID"
,
required
=
true
)
public
static
class
DeleteUserReq
{
@ApiModelProperty
(
value
=
"用户ID"
,
required
=
true
)
@NotNull
(
message
=
"用户ID 参数必传"
)
private
Long
userId
;
private
Integer
userId
;
public
Long
getUserId
()
{
public
Integer
getUserId
()
{
return
userId
;
}
public
void
setUserId
(
Long
userId
)
{
public
void
setUserId
(
Integer
userId
)
{
this
.
userId
=
userId
;
}
...
...
@@ -153,37 +153,37 @@ public class UserReq {
}
}
public
static
class
UpdateUserReq
{
@ApiModelProperty
(
value
=
"用户ID"
,
required
=
true
)
public
static
class
UpdateUserReq
{
@ApiModelProperty
(
value
=
"用户ID"
,
required
=
true
)
@NotNull
(
message
=
"用户ID 参数必传"
)
private
Long
userId
;
private
Integer
userId
;
@ApiModelProperty
(
value
=
"账号"
,
required
=
true
)
@ApiModelProperty
(
value
=
"账号"
,
required
=
true
)
@NotBlank
(
message
=
"账号 参数必传"
)
private
String
userCode
;
@ApiModelProperty
(
value
=
"名称"
,
required
=
true
)
@ApiModelProperty
(
value
=
"名称"
,
required
=
true
)
@NotBlank
(
message
=
"名称 参数必传"
)
private
String
userName
;
@ApiModelProperty
(
value
=
"密码"
,
required
=
true
)
@ApiModelProperty
(
value
=
"密码"
,
required
=
true
)
@NotBlank
(
message
=
"密码 参数必传"
)
private
String
password
;
@ApiModelProperty
(
value
=
"身份证"
,
required
=
true
)
@ApiModelProperty
(
value
=
"身份证"
,
required
=
true
)
private
String
idcard
;
@ApiModelProperty
(
value
=
"性别"
,
required
=
true
)
@ApiModelProperty
(
value
=
"性别"
,
required
=
true
)
private
String
sex
;
@ApiModelProperty
(
value
=
"手机号码"
,
required
=
true
)
@ApiModelProperty
(
value
=
"手机号码"
,
required
=
true
)
private
String
mobile
;
public
Long
getUserId
()
{
public
Integer
getUserId
()
{
return
userId
;
}
public
void
setUserId
(
Long
userId
)
{
public
void
setUserId
(
Integer
userId
)
{
this
.
userId
=
userId
;
}
...
...
bsoft-admin/src/main/java/com/bsoft/admin/model/respmodel/DicOrgList.java
View file @
c4e21bbb
package
com
.
bsoft
.
admin
.
model
.
respmodel
;
import
com.bsoft.admin.model.DicOrg
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
DicOrgList
extends
DicOrg
{
private
List
<
DicOrgList
>
dicOrgList
;
public
List
<
DicOrgList
>
getDicOrgList
()
{
return
dicOrgList
;
}
public
void
setDicOrgList
(
List
<
DicOrgList
>
dicOrgList
)
{
this
.
dicOrgList
=
dicOrgList
;
}
@Override
public
String
toString
()
{
return
"DicOrgList{"
+
"dicOrgList="
+
dicOrgList
+
'}'
;
}
}
bsoft-admin/src/main/java/com/bsoft/admin/model/respmodel/SysMenuList.java
View file @
c4e21bbb
...
...
@@ -2,27 +2,14 @@ package com.bsoft.admin.model.respmodel;
import
com.bsoft.admin.model.SysMenu
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
SysMenuList
extends
SysMenu
{
private
List
<
SysMenuList
>
sysMenuList
;
public
void
setSysMenuList
(
List
<
SysMenuList
>
sysMenuList
)
{
this
.
sysMenuList
=
sysMenuList
;
}
public
List
<
SysMenuList
>
getSysMenuList
()
{
return
this
.
sysMenuList
;
}
@Override
public
String
toString
()
{
return
"SysMenuList{"
+
"sysMenuList="
+
sysMenuList
+
'}'
;
}
}
bsoft-admin/src/main/java/com/bsoft/admin/model/respmodel/SysRoleMenuRsList.java
View file @
c4e21bbb
package
com
.
bsoft
.
admin
.
model
.
respmodel
;
import
com.bsoft.admin.model.SysRoleMenuRs
;
import
lombok.Data
;
@Data
public
class
SysRoleMenuRsList
extends
SysRoleMenuRs
{
private
Long
parentId
;
public
Long
getParentId
()
{
return
parentId
;
}
public
void
setParentId
(
Long
parentId
)
{
this
.
parentId
=
parentId
;
}
@Override
public
String
toString
()
{
return
"SysUserOrgRsList{"
+
"parentId="
+
parentId
+
'}'
;
}
}
bsoft-admin/src/main/java/com/bsoft/admin/model/respmodel/SysUserMenuRsList.java
View file @
c4e21bbb
package
com
.
bsoft
.
admin
.
model
.
respmodel
;
import
com.bsoft.admin.model.SysUserMenuRs
;
import
lombok.Data
;
@Data
public
class
SysUserMenuRsList
extends
SysUserMenuRs
{
private
Long
parentId
;
public
Long
getParentId
()
{
return
parentId
;
}
public
void
setParentId
(
Long
parentId
)
{
this
.
parentId
=
parentId
;
}
@Override
public
String
toString
()
{
return
"SysUserOrgRsList{"
+
"parentId="
+
parentId
+
'}'
;
}
}
bsoft-admin/src/main/java/com/bsoft/admin/model/respmodel/SysUserOrgRsList.java
View file @
c4e21bbb
package
com
.
bsoft
.
admin
.
model
.
respmodel
;
import
com.bsoft.admin.model.SysUserOrgRs
;
import
lombok.Data
;
@Data
public
class
SysUserOrgRsList
extends
SysUserOrgRs
{
private
Long
parentId
;
...
...
bsoft-admin/src/main/java/com/bsoft/admin/service/DicOrgService.java
View file @
c4e21bbb
...
...
@@ -15,9 +15,9 @@ public interface DicOrgService {
List
<
DicOrg
>
getAll
();
DicOrg
info
(
Long
orgId
);
DicOrg
info
(
Integer
orgId
);
boolean
addOrg
(
Long
userId
,
OrgReq
.
AddOrgReq
org
);
boolean
addOrg
(
Integer
userId
,
OrgReq
.
AddOrgReq
org
);
boolean
deleteOrg
(
OrgReq
.
DeleteOrgReq
org
);
...
...
@@ -25,7 +25,7 @@ public interface DicOrgService {
DicOrg
getByName
(
String
orgName
);
List
<
SysUserOrgRsList
>
getUserOrg
(
Long
userId
);
List
<
SysUserOrgRsList
>
getUserOrg
(
Integer
userId
);
boolean
saveUserOrg
(
Long
userId
,
OrgReq
.
SaveUserOrgReq
org
);
}
bsoft-admin/src/main/java/com/bsoft/admin/service/LoginService.java
View file @
c4e21bbb
...
...
@@ -10,7 +10,7 @@ import java.util.List;
public
interface
LoginService
{
LoginInfo
login
(
String
loginName
,
String
password
,
String
ip
);
LoginInfo
login
(
String
loginName
,
String
password
,
String
ip
);
String
refreshToken
(
String
oldToken
);
...
...
@@ -26,10 +26,10 @@ public interface LoginService {
public
LoginInfo
()
{
}
public
LoginInfo
(
String
token
,
SysUser
user
,
List
<
DicOrg
>
org
)
{
public
LoginInfo
(
String
token
,
SysUser
user
,
List
<
DicOrg
>
org
)
{
this
.
token
=
token
;
this
.
user
=
user
;
this
.
org
=
org
;
this
.
org
=
org
;
}
public
String
getToken
()
{
...
...
bsoft-admin/src/main/java/com/bsoft/admin/service/ServiceBase.java
View file @
c4e21bbb
...
...
@@ -5,40 +5,46 @@ import java.util.List;
public
interface
ServiceBase
<
T
>
{
/**
* 新增
*
* @param t
* @return
*/
int
add
(
T
t
)
;
int
add
(
T
t
);
/**
* 查询所有
*
* @return
*/
List
<
T
>
findAll
();
/**
* 根据id查询
*
* @param id
* @return
*/
T
find
(
Long
id
);
T
find
(
Integer
id
);
/**
* 物理删除
*
* @param id
* @return
*/
int
delete
(
Long
id
);
int
delete
(
Integer
id
);
/**
* 逻辑删除
*
* @param id
* @return
*/
int
logicDelete
(
Long
id
);
int
logicDelete
(
Integer
id
);
/**
* 更新
*
* @param t
* @return
*/
...
...
bsoft-admin/src/main/java/com/bsoft/admin/service/SysMenuService.java
View file @
c4e21bbb
package
com
.
bsoft
.
admin
.
service
;
import
com.bsoft.admin.model.SysMenu
;
import
com.bsoft.admin.model.SysRoleMenuRs
;
import
com.bsoft.admin.model.SysUserMenuRs
;
import
com.bsoft.admin.model.reqmodel.MenuReq
;
import
com.bsoft.admin.model.respmodel.SysMenuList
;
import
com.bsoft.admin.model.respmodel.SysRoleMenuRsList
;
...
...
@@ -13,18 +11,29 @@ import java.util.List;
public
interface
SysMenuService
{
//顶级菜单的父级id
final
static
Integer
MENU_TOP_PARENT_ID
=
0
;
List
<
SysMenuList
>
getMenu
(
Long
userId
)
throws
Exception
;
final
static
Integer
MENU_TOP_PARENT_ID
=
0
;
List
<
SysMenuList
>
getMenu
(
Integer
userId
)
throws
Exception
;
List
<
SysMenuList
>
getParentAll
(
MenuReq
.
GetMenuReq
menu
);
List
<
SysMenu
>
getAll
();
SysMenu
info
(
MenuReq
.
InfoMenuReq
menu
);
boolean
addMenu
(
Long
userId
,
MenuReq
.
AddMenuReq
menu
);
boolean
deleteMenu
(
MenuReq
.
DeleteMenuReq
menu
);
boolean
updateMenu
(
MenuReq
.
UpdateMenuReq
menu
);
List
<
SysUserMenuRsList
>
getUserMenu
(
Long
userId
);
List
<
SysUserMenuRsList
>
getUserMenu
(
Integer
userId
);
boolean
saveUserMenu
(
Long
userId
,
MenuReq
.
SaveUserMenuReq
menu
);
List
<
SysRoleMenuRsList
>
getRoleMenu
(
Long
roleId
);
List
<
SysRoleMenuRsList
>
getRoleMenu
(
Integer
roleId
);
boolean
saveRoleMenu
(
Long
userId
,
MenuReq
.
SaveRoleMenuReq
menu
);
boolean
updateSort
(
Long
userId
,
MenuReq
.
UpdateSortReq
menu
);
}
bsoft-admin/src/main/java/com/bsoft/admin/service/SysRoleService.java
View file @
c4e21bbb
...
...
@@ -5,12 +5,18 @@ import com.bsoft.admin.model.reqmodel.RoleReq;
import
java.util.List
;
public
interface
SysRoleService
{
public
interface
SysRoleService
{
SysRole
findByCode
(
Long
roleCode
);
boolean
addRole
(
Long
userId
,
RoleReq
.
AddRoleReq
role
);
boolean
addRole
(
Long
userId
,
RoleReq
.
AddRoleReq
role
);
boolean
deleteRole
(
RoleReq
.
DeleteRoleReq
role
);
boolean
updateRole
(
RoleReq
.
UpdateRoleReq
role
);
List
<
SysRole
>
getAll
(
RoleReq
.
GetRoleReq
role
);
SysRole
info
(
Long
roleId
);
SysRole
info
(
Integer
roleId
);
boolean
saveUserRole
(
Long
userId
,
RoleReq
.
SavaUserRoleReq
role
);
}
bsoft-admin/src/main/java/com/bsoft/admin/service/SysUserRoleRsService.java
View file @
c4e21bbb
...
...
@@ -6,5 +6,5 @@ import com.bsoft.admin.model.SysUserRoleRs;
import
java.util.List
;
public
interface
SysUserRoleRsService
extends
ServiceBase
<
SysUserRoleRs
>
{
List
<
SysRole
>
getRoleListByUser
(
Long
userId
)
throws
Exception
;
List
<
SysRole
>
getRoleListByUser
(
Integer
userId
)
throws
Exception
;
}
bsoft-admin/src/main/java/com/bsoft/admin/service/UserService.java
View file @
c4e21bbb
...
...
@@ -7,9 +7,14 @@ import java.util.List;
public
interface
UserService
{
SysUser
findByLoginName
(
String
loginName
);
boolean
addUser
(
Long
userId
,
UserReq
.
AddUserReq
user
);
boolean
addUser
(
Long
userId
,
UserReq
.
AddUserReq
user
);
boolean
deleteUser
(
UserReq
.
DeleteUserReq
user
);
boolean
updateUser
(
UserReq
.
UpdateUserReq
user
);
List
<
SysUser
>
getAll
(
UserReq
.
GetUserReq
user
);
SysUser
info
(
Long
userId
);
SysUser
info
(
Integer
userId
);
}
bsoft-admin/src/main/java/com/bsoft/admin/service/impl/DicOrgServiceImpl.java
View file @
c4e21bbb
...
...
@@ -25,10 +25,10 @@ public class DicOrgServiceImpl implements DicOrgService {
@Resource
private
SysUserOrgRsMapper
sysUserOrgRsMapper
;
private
List
<
DicOrgList
>
getLevelData
(
List
<
DicOrgList
>
list
,
Long
parentcode
)
{
private
List
<
DicOrgList
>
getLevelData
(
List
<
DicOrgList
>
list
,
Integer
parentcode
)
{
List
<
DicOrgList
>
resultList
=
new
ArrayList
<>();
for
(
DicOrgList
data
:
list
)
{
if
(
data
.
getParentId
()
==
parentcode
){
for
(
DicOrgList
data
:
list
)
{
if
(
data
.
getParentId
()
==
parentcode
){
List
<
DicOrgList
>
childList
=
getLevelData
(
list
,
data
.
getId
());
data
.
setDicOrgList
(
childList
);
resultList
.
add
(
data
);
...
...
@@ -38,33 +38,33 @@ public class DicOrgServiceImpl implements DicOrgService {
}
public
List
<
DicOrgList
>
getParentAll
(
OrgReq
.
GetOrgReq
org
){
public
List
<
DicOrgList
>
getParentAll
(
OrgReq
.
GetOrgReq
org
)
{
List
<
DicOrgList
>
list
=
dicOrgMapper
.
selectParentAll
();
if
(
org
.
getOrgName
()
!=
null
){
if
(
org
.
getOrgName
()
!=
null
){
list
=
list
.
stream
().
filter
(
o
->(
o
.
getOrgName
()!=
null
&&
o
.
getOrgName
().
toLowerCase
().
contains
(
org
.
getOrgName
().
toLowerCase
())))
o
->
(
o
.
getOrgName
()
!=
null
&&
o
.
getOrgName
().
toLowerCase
().
contains
(
org
.
getOrgName
().
toLowerCase
())))
.
collect
(
Collectors
.
toList
());
}
List
<
DicOrgList
>
resultList
=
getLevelData
(
list
,
Long
.
valueOf
(
ORG_TOP_PARENT_ID
)
);
List
<
DicOrgList
>
resultList
=
getLevelData
(
list
,
ORG_TOP_PARENT_ID
);
return
resultList
;
}
public
List
<
DicOrg
>
getAll
(){
public
List
<
DicOrg
>
getAll
()
{
List
<
DicOrg
>
list
=
dicOrgMapper
.
selectAll
();
return
list
;
}
public
DicOrg
info
(
Long
orgId
)
{
public
DicOrg
info
(
Integer
orgId
)
{
DicOrg
dicOrg
=
dicOrgMapper
.
selectByPrimaryKey
(
orgId
);
return
dicOrg
;
}
public
boolean
addOrg
(
Long
userId
,
OrgReq
.
AddOrgReq
org
)
{
if
(
org
!=
null
){
public
boolean
addOrg
(
Integer
userId
,
OrgReq
.
AddOrgReq
org
)
{
if
(
org
!=
null
){
DicOrg
dicOrg
=
new
DicOrg
();
dicOrg
.
setCreateDate
(
new
Date
());
dicOrg
.
setCreateUserid
(
userId
);
dicOrg
.
setState
((
short
)
StateType
.
ON
.
getValue
());
dicOrg
.
setCreateUserid
(
Long
.
valueOf
(
userId
)
);
dicOrg
.
setState
((
short
)
StateType
.
ON
.
getValue
());
dicOrg
.
setOrgCode
(
org
.
getOrgCode
());
dicOrg
.
setOrgName
(
org
.
getOrgName
());
dicOrg
.
setOrgShortName
(
org
.
getOrgShortName
());
...
...
@@ -78,11 +78,11 @@ public class DicOrgServiceImpl implements DicOrgService {
return
false
;
}
public
boolean
deleteOrg
(
OrgReq
.
DeleteOrgReq
org
){
if
(
org
!=
null
){
public
boolean
deleteOrg
(
OrgReq
.
DeleteOrgReq
org
)
{
if
(
org
!=
null
){
DicOrg
dicOrg
=
dicOrgMapper
.
selectByPrimaryKey
(
org
.
getOrgId
());
if
(
dicOrg
!=
null
){
dicOrg
.
setState
((
short
)
StateType
.
OFF
.
getValue
());
if
(
dicOrg
!=
null
){
dicOrg
.
setState
((
short
)
StateType
.
OFF
.
getValue
());
dicOrgMapper
.
updateByPrimaryKey
(
dicOrg
);
return
true
;
}
...
...
@@ -90,10 +90,10 @@ public class DicOrgServiceImpl implements DicOrgService {
return
false
;
}
public
boolean
updateOrg
(
OrgReq
.
UpdateOrgReq
org
){
if
(
org
!=
null
)
{
public
boolean
updateOrg
(
OrgReq
.
UpdateOrgReq
org
)
{
if
(
org
!=
null
)
{
DicOrg
dicOrg
=
dicOrgMapper
.
selectByPrimaryKey
(
org
.
getOrgId
());
if
(
dicOrg
!=
null
){
if
(
dicOrg
!=
null
){
dicOrg
.
setOrgCode
(
org
.
getOrgCode
());
dicOrg
.
setOrgName
(
org
.
getOrgName
());
dicOrg
.
setOrgShortName
(
org
.
getOrgShortName
());
...
...
@@ -108,31 +108,32 @@ public class DicOrgServiceImpl implements DicOrgService {
return
false
;
}
public
DicOrg
getByName
(
String
orgName
){
public
DicOrg
getByName
(
String
orgName
)
{
return
dicOrgMapper
.
selectByName
(
orgName
);
}
/**
* 查询用户机构
*
* @param userId 操作人ID
* @return
*/
@Override
public
List
<
SysUserOrgRsList
>
getUserOrg
(
Long
userId
)
{
public
List
<
SysUserOrgRsList
>
getUserOrg
(
Integer
userId
)
{
List
<
SysUserOrgRsList
>
sysUserOrgRs
=
sysUserOrgRsMapper
.
selectByUser
(
userId
);
return
sysUserOrgRs
;
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
saveUserOrg
(
Long
userId
,
OrgReq
.
SaveUserOrgReq
org
){
public
boolean
saveUserOrg
(
Long
userId
,
OrgReq
.
SaveUserOrgReq
org
)
{
int
result
=
0
;
if
(
org
!=
null
&&
org
.
getOrg
()!=
null
&&
org
.
getOrg
().
size
()>
0
&&
org
.
getUserId
()!=
null
){
if
(
org
!=
null
&&
org
.
getOrg
()
!=
null
&&
org
.
getOrg
().
size
()
>
0
&&
org
.
getUserId
()
!=
null
){
sysUserOrgRsMapper
.
deleteByUser
(
org
.
getUserId
());
for
(
Long
orgId:
org
.
getOrg
())
{
for
(
Long
orgId
:
org
.
getOrg
())
{
//判断是否存在关系数据
SysUserOrgRs
sysUserOrgRs
=
sysUserOrgRsMapper
.
selectByUserWithOrg
(
org
.
getUserId
(),
orgId
);
if
(
sysUserOrgRs
!=
null
){
if
(
sysUserOrgRs
!=
null
){
//开启状态
sysUserOrgRs
.
setState
((
short
)
StateType
.
ON
.
getValue
());
result
+=
sysUserOrgRsMapper
.
updateByPrimaryKey
(
sysUserOrgRs
);
...
...
@@ -144,14 +145,13 @@ public class DicOrgServiceImpl implements DicOrgService {
sysUserOrgRs
.
setUserId
(
org
.
getUserId
());
sysUserOrgRs
.
setCreateDate
(
new
Date
());
sysUserOrgRs
.
setCreateUserid
(
userId
);
sysUserOrgRs
.
setState
((
short
)
StateType
.
ON
.
getValue
());
sysUserOrgRs
.
setState
((
short
)
StateType
.
ON
.
getValue
());
result
+=
sysUserOrgRsMapper
.
insert
(
sysUserOrgRs
);
}
}
}
return
result
>
0
;
return
result
>
0
;
}
}
bsoft-admin/src/main/java/com/bsoft/admin/service/impl/LoginServiceImpl.java
View file @
c4e21bbb
...
...
@@ -26,13 +26,13 @@ public class LoginServiceImpl implements LoginService {
private
DicOrgMapper
dicOrgMapper
;
@Override
public
LoginInfo
login
(
String
logName
,
String
password
,
String
ip
)
{
public
LoginInfo
login
(
String
logName
,
String
password
,
String
ip
)
{
LoginInfo
loginInfo
=
new
LoginInfo
();
SysUser
user
=
userServiceImpl
.
findByLoginName
(
logName
);
if
(
user
!=
null
&&
user
.
getPassword
().
equals
(
password
)){
String
token
=
TokenUtil
.
getToken
(
password
,
user
);
String
token
=
TokenUtil
.
getToken
(
password
,
user
);
//修改ip以及最后登录时间
user
.
setLastIp
(
ip
);
user
.
setLastTime
(
new
Date
());
...
...
@@ -42,13 +42,13 @@ public class LoginServiceImpl implements LoginService {
loginInfo
.
setToken
(
token
);
loginInfo
.
setUser
(
user
);
//查询用户机构
List
<
DicOrg
>
orgList
=
dicOrgMapper
.
selectByUser
(
user
.
getId
());
List
<
DicOrg
>
orgList
=
dicOrgMapper
.
selectByUser
(
user
.
getId
());
loginInfo
.
setOrg
(
orgList
);
}
return
loginInfo
;
}
public
String
refreshToken
(
String
oldToken
){
public
String
refreshToken
(
String
oldToken
)
{
return
TokenUtil
.
refresh
(
oldToken
);
}
}
bsoft-admin/src/main/java/com/bsoft/admin/service/impl/SysMenuServiceImpl.java
View file @
c4e21bbb
...
...
@@ -33,23 +33,23 @@ public class SysMenuServiceImpl implements SysMenuService {
private
SysRoleMenuRsMapper
sysRoleMenuRsMapper
;
@Override
public
List
<
SysMenuList
>
getMenu
(
Long
userId
)
throws
Exception
{
public
List
<
SysMenuList
>
getMenu
(
Integer
userId
)
throws
Exception
{
List
<
SysMenuList
>
userList
=
sysMenuMapper
.
selectMenuAllByUser
(
userId
);
List
<
SysMenuList
>
roleList
=
sysMenuMapper
.
selectMenuByRole
(
userId
);
List
<
SysMenuList
>
userRoleList
=
new
ArrayList
<>();
for
(
SysMenuList
roleMenu
:
roleList
)
{
for
(
SysMenuList
roleMenu
:
roleList
)
{
userRoleList
.
add
(
roleMenu
);
for
(
SysMenuList
userMenu
:
userList
)
{
for
(
SysMenuList
userMenu
:
userList
)
{
int
userMuenuState
=
userMenu
.
getState
().
intValue
();
if
(
userMenu
.
getId
().
equals
(
roleMenu
.
getId
())
&&
userMuenuState
==
StateType
.
OFF
.
getValue
())
{
if
(
userMenu
.
getId
().
equals
(
roleMenu
.
getId
())
&&
userMuenuState
==
StateType
.
OFF
.
getValue
())
{
//角色表存在,用户表存在,但是已删除 = 不显示
userRoleList
.
remove
(
roleMenu
);
}
else
if
(
userMenu
.
getId
().
equals
(
roleMenu
.
getId
())
&&
userMuenuState
==
StateType
.
ON
.
getValue
())
{
}
else
if
(
userMenu
.
getId
().
equals
(
roleMenu
.
getId
())
&&
userMuenuState
==
StateType
.
ON
.
getValue
())
{
//角色表存在,用户表存在,未删除 = 显示
continue
;
}
else
if
(!
userMenu
.
getId
().
equals
(
roleMenu
.
getId
())
&&
userMuenuState
==
StateType
.
ON
.
getValue
())
{
}
else
if
(!
userMenu
.
getId
().
equals
(
roleMenu
.
getId
())
&&
userMuenuState
==
StateType
.
ON
.
getValue
())
{
userRoleList
.
add
(
userMenu
);
}
}
...
...
@@ -57,16 +57,16 @@ public class SysMenuServiceImpl implements SysMenuService {
userRoleList
=
userRoleList
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
List
<
SysMenuList
>
resultList
=
getLevelData
(
userRoleList
,
Long
.
valueOf
(
MENU_TOP_PARENT_ID
));
List
<
SysMenuList
>
resultList
=
getLevelData
(
userRoleList
,
Long
.
valueOf
(
MENU_TOP_PARENT_ID
));
resultList
=
resultList
.
stream
().
sorted
(
Comparator
.
comparing
(
SysMenu:
:
getSort
)).
collect
(
Collectors
.
toList
());
return
resultList
;
}
private
List
<
SysMenuList
>
getLevelData
(
List
<
SysMenuList
>
list
,
Long
parentcode
)
{
private
List
<
SysMenuList
>
getLevelData
(
List
<
SysMenuList
>
list
,
Long
parentcode
)
{
List
<
SysMenuList
>
resultList
=
new
ArrayList
<>();
for
(
SysMenuList
data
:
list
)
{
if
(
data
.
getParentId
()
==
parentcode
)
{
List
<
SysMenuList
>
childList
=
getLevelData
(
list
,
data
.
getId
(
));
for
(
SysMenuList
data
:
list
)
{
if
(
data
.
getParentId
()
==
parentcode
)
{
List
<
SysMenuList
>
childList
=
getLevelData
(
list
,
Long
.
valueOf
(
data
.
getId
()
));
childList
=
childList
.
stream
().
sorted
(
Comparator
.
comparing
(
SysMenu:
:
getSort
)).
collect
(
Collectors
.
toList
());
data
.
setSysMenuList
(
childList
);
resultList
.
add
(
data
);
...
...
@@ -78,12 +78,12 @@ public class SysMenuServiceImpl implements SysMenuService {
@Override
public
List
<
SysMenuList
>
getParentAll
(
MenuReq
.
GetMenuReq
menu
)
{
List
<
SysMenuList
>
list
=
sysMenuMapper
.
selectParentAll
();
if
(
menu
.
getMenuName
()
!=
null
)
{
if
(
menu
.
getMenuName
()
!=
null
)
{
list
=
list
.
stream
().
filter
(
o
->
(
o
.
getMenuName
()
!=
null
&&
o
.
getMenuName
().
toLowerCase
().
contains
(
menu
.
getMenuName
().
toLowerCase
())))
.
collect
(
Collectors
.
toList
());
}
List
<
SysMenuList
>
resultList
=
getLevelData
(
list
,
Long
.
valueOf
(
MENU_TOP_PARENT_ID
));
List
<
SysMenuList
>
resultList
=
getLevelData
(
list
,
Long
.
valueOf
(
MENU_TOP_PARENT_ID
));
resultList
=
resultList
.
stream
().
sorted
(
Comparator
.
comparing
(
SysMenu:
:
getSort
)).
collect
(
Collectors
.
toList
());
return
resultList
;
}
...
...
@@ -101,18 +101,18 @@ public class SysMenuServiceImpl implements SysMenuService {
}
@Override
public
boolean
addMenu
(
Long
userId
,
MenuReq
.
AddMenuReq
menu
)
{
if
(
menu
!=
null
)
{
public
boolean
addMenu
(
Long
userId
,
MenuReq
.
AddMenuReq
menu
)
{
if
(
menu
!=
null
)
{
SysMenu
sysMenu
=
new
SysMenu
();
sysMenu
.
setCreateData
(
new
Date
());
sysMenu
.
setCreateUserid
(
userId
);
sysMenu
.
setState
((
short
)
StateType
.
ON
.
getValue
());
sysMenu
.
setState
((
short
)
StateType
.
ON
.
getValue
());
sysMenu
.
setMenuName
(
menu
.
getMenuName
());
sysMenu
.
setMenuUrl
(
menu
.
getMenuUrl
());
sysMenu
.
setMenuImage
(
menu
.
getMenuImage
());
sysMenu
.
setPageCode
(
menu
.
getPageCode
());
sysMenu
.
setParentId
(
menu
.
getParentId
());
sysMenu
.
setSort
((
long
)
sysMenuMapper
.
selectMaxSort
(
menu
.
getParentId
()));
sysMenu
.
setSort
((
long
)
sysMenuMapper
.
selectMaxSort
(
menu
.
getParentId
()));
sysMenuMapper
.
insert
(
sysMenu
);
return
true
;
}
...
...
@@ -121,10 +121,10 @@ public class SysMenuServiceImpl implements SysMenuService {
@Override
public
boolean
deleteMenu
(
MenuReq
.
DeleteMenuReq
menu
)
{
if
(
menu
!=
null
)
{
if
(
menu
!=
null
)
{
SysMenu
sysMenu
=
sysMenuMapper
.
selectByPrimaryKey
(
menu
.
getMenuId
());
if
(
sysMenu
!=
null
)
{
sysMenu
.
setState
((
short
)
StateType
.
OFF
.
getValue
());
if
(
sysMenu
!=
null
)
{
sysMenu
.
setState
((
short
)
StateType
.
OFF
.
getValue
());
sysMenuMapper
.
updateByPrimaryKey
(
sysMenu
);
return
true
;
}
...
...
@@ -134,9 +134,9 @@ public class SysMenuServiceImpl implements SysMenuService {
@Override
public
boolean
updateMenu
(
MenuReq
.
UpdateMenuReq
menu
)
{
if
(
menu
!=
null
)
{
if
(
menu
!=
null
)
{
SysMenu
sysMenu
=
sysMenuMapper
.
selectByPrimaryKey
(
menu
.
getMenuId
());
if
(
sysMenu
!=
null
)
{
if
(
sysMenu
!=
null
)
{
sysMenu
.
setMenuName
(
menu
.
getMenuName
());
sysMenu
.
setMenuUrl
(
menu
.
getMenuUrl
());
sysMenu
.
setMenuImage
(
menu
.
getMenuImage
());
...
...
@@ -157,7 +157,7 @@ public class SysMenuServiceImpl implements SysMenuService {
* @return
*/
@Override
public
List
<
SysUserMenuRsList
>
getUserMenu
(
Long
userId
)
{
public
List
<
SysUserMenuRsList
>
getUserMenu
(
Integer
userId
)
{
List
<
SysUserMenuRsList
>
list
=
sysUserMenuRsMapper
.
selectByUser
(
userId
);
return
list
;
}
...
...
@@ -166,24 +166,24 @@ public class SysMenuServiceImpl implements SysMenuService {
* 用户配置菜单
*
* @param userId 操作人ID
* @param menu
用户菜单关系数据
* @param menu 用户菜单关系数据
* @return
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
saveUserMenu
(
Long
userId
,
MenuReq
.
SaveUserMenuReq
menu
)
{
public
boolean
saveUserMenu
(
Long
userId
,
MenuReq
.
SaveUserMenuReq
menu
)
{
int
result
=
0
;
if
(
menu
!=
null
&&
menu
.
getMenus
()
!=
null
&&
menu
.
getMenus
().
size
()
>
0
&&
menu
.
getUserId
()
!=
null
)
{
if
(
menu
!=
null
&&
menu
.
getMenus
()
!=
null
&&
menu
.
getMenus
().
size
()
>
0
&&
menu
.
getUserId
()
!=
null
)
{
sysUserMenuRsMapper
.
deleteAllByUser
(
menu
.
getUserId
());
for
(
Long
menuId
:
menu
.
getMenus
())
{
SysUserMenuRs
um
=
sysUserMenuRsMapper
.
selectByUserWithMenu
(
menu
.
getUserId
(),
menuId
);
if
(
um
!=
null
)
{
um
.
setState
((
short
)
StateType
.
ON
.
getValue
());
for
(
Long
menuId
:
menu
.
getMenus
())
{
SysUserMenuRs
um
=
sysUserMenuRsMapper
.
selectByUserWithMenu
(
menu
.
getUserId
(),
menuId
);
if
(
um
!=
null
)
{
um
.
setState
((
short
)
StateType
.
ON
.
getValue
());
result
+=
sysUserMenuRsMapper
.
updateByPrimaryKey
(
um
);
}
else
{
}
else
{
um
=
new
SysUserMenuRs
();
um
.
setCreateDate
(
new
Date
());
um
.
setState
((
short
)
StateType
.
ON
.
getValue
());
um
.
setState
((
short
)
StateType
.
ON
.
getValue
());
um
.
setCreateUserid
(
userId
);
um
.
setUserId
(
menu
.
getUserId
());
um
.
setMenuId
(
menuId
);
...
...
@@ -201,26 +201,26 @@ public class SysMenuServiceImpl implements SysMenuService {
* @return
*/
@Override
public
List
<
SysRoleMenuRsList
>
getRoleMenu
(
Long
roleId
)
{
public
List
<
SysRoleMenuRsList
>
getRoleMenu
(
Integer
roleId
)
{
List
<
SysRoleMenuRsList
>
list
=
sysRoleMenuRsMapper
.
selectByRole
(
roleId
);
return
list
;
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
saveRoleMenu
(
Long
userId
,
MenuReq
.
SaveRoleMenuReq
menu
)
{
public
boolean
saveRoleMenu
(
Long
userId
,
MenuReq
.
SaveRoleMenuReq
menu
)
{
int
result
=
0
;
if
(
menu
!=
null
&&
menu
.
getMenus
()
!=
null
&&
menu
.
getMenus
().
size
()
>
0
&&
menu
.
getRoleId
()
!=
null
)
{
if
(
menu
!=
null
&&
menu
.
getMenus
()
!=
null
&&
menu
.
getMenus
().
size
()
>
0
&&
menu
.
getRoleId
()
!=
null
)
{
sysRoleMenuRsMapper
.
deleteAllByRole
(
menu
.
getRoleId
());
for
(
Long
menuId
:
menu
.
getMenus
())
{
SysRoleMenuRs
rm
=
sysRoleMenuRsMapper
.
selectByUserWithRole
(
menu
.
getRoleId
(),
menuId
);
if
(
rm
!=
null
)
{
rm
.
setState
((
short
)
StateType
.
ON
.
getValue
());
for
(
Long
menuId
:
menu
.
getMenus
())
{
SysRoleMenuRs
rm
=
sysRoleMenuRsMapper
.
selectByUserWithRole
(
menu
.
getRoleId
(),
menuId
);
if
(
rm
!=
null
)
{
rm
.
setState
((
short
)
StateType
.
ON
.
getValue
());
result
+=
sysRoleMenuRsMapper
.
updateByPrimaryKey
(
rm
);
}
else
{
}
else
{
rm
=
new
SysRoleMenuRs
();
rm
.
setCreateDate
(
new
Date
());
rm
.
setState
((
short
)
StateType
.
ON
.
getValue
());
rm
.
setState
((
short
)
StateType
.
ON
.
getValue
());
rm
.
setCreateUserid
(
userId
);
rm
.
setRoleId
(
menu
.
getRoleId
());
rm
.
setMenuId
(
menuId
);
...
...
@@ -233,10 +233,10 @@ public class SysMenuServiceImpl implements SysMenuService {
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
updateSort
(
Long
userId
,
MenuReq
.
UpdateSortReq
menu
)
{
public
boolean
updateSort
(
Long
userId
,
MenuReq
.
UpdateSortReq
menu
)
{
int
result
=
0
;
if
(
menu
!=
null
&&
menu
.
getMenus
()
!=
null
&&
menu
.
getMenus
().
size
()
>
0
)
{
for
(
SysMenu
info
:
menu
.
getMenus
())
{
if
(
menu
!=
null
&&
menu
.
getMenus
()
!=
null
&&
menu
.
getMenus
().
size
()
>
0
)
{
for
(
SysMenu
info
:
menu
.
getMenus
())
{
SysMenu
sysMenu
=
sysMenuMapper
.
selectByPrimaryKey
(
info
.
getId
());
sysMenu
.
setParentId
(
info
.
getParentId
());
sysMenu
.
setSort
(
info
.
getSort
());
...
...
bsoft-admin/src/main/java/com/bsoft/admin/service/impl/SysRoleServiceImpl.java
View file @
c4e21bbb
...
...
@@ -28,12 +28,12 @@ public class SysRoleServiceImpl implements SysRoleService {
}
@Override
public
boolean
addRole
(
Long
userId
,
RoleReq
.
AddRoleReq
role
)
{
if
(
role
!=
null
)
{
public
boolean
addRole
(
Long
userId
,
RoleReq
.
AddRoleReq
role
)
{
if
(
role
!=
null
)
{
SysRole
sysRole
=
new
SysRole
();
sysRole
.
setCreateDate
(
new
Date
());
sysRole
.
setCreateUserid
(
userId
);
sysRole
.
setState
((
short
)
StateType
.
ON
.
getValue
());
sysRole
.
setState
((
short
)
StateType
.
ON
.
getValue
());
sysRole
.
setRoleCode
(
role
.
getRoleCode
());
sysRole
.
setRoleName
(
role
.
getRoleName
());
sysRoleMapper
.
insert
(
sysRole
);
...
...
@@ -44,10 +44,10 @@ public class SysRoleServiceImpl implements SysRoleService {
@Override
public
boolean
deleteRole
(
RoleReq
.
DeleteRoleReq
role
)
{
if
(
role
!=
null
)
{
if
(
role
!=
null
)
{
SysRole
sysRole
=
sysRoleMapper
.
selectByPrimaryKey
(
role
.
getRoleId
());
if
(
sysRole
!=
null
)
{
sysRole
.
setState
((
short
)
StateType
.
OFF
.
getValue
());
if
(
sysRole
!=
null
)
{
sysRole
.
setState
((
short
)
StateType
.
OFF
.
getValue
());
sysRoleMapper
.
updateByPrimaryKey
(
sysRole
);
return
true
;
}
...
...
@@ -57,9 +57,9 @@ public class SysRoleServiceImpl implements SysRoleService {
@Override
public
boolean
updateRole
(
RoleReq
.
UpdateRoleReq
role
)
{
if
(
role
!=
null
)
{
if
(
role
!=
null
)
{
SysRole
sysRole
=
sysRoleMapper
.
selectByPrimaryKey
(
role
.
getRoleId
());
if
(
sysRole
!=
null
)
{
if
(
sysRole
!=
null
)
{
sysRole
.
setRoleCode
(
role
.
getRoleCode
());
sysRole
.
setRoleName
(
role
.
getRoleName
());
sysRoleMapper
.
updateByPrimaryKey
(
sysRole
);
...
...
@@ -72,7 +72,7 @@ public class SysRoleServiceImpl implements SysRoleService {
@Override
public
List
<
SysRole
>
getAll
(
RoleReq
.
GetRoleReq
role
)
{
List
<
SysRole
>
list
=
sysRoleMapper
.
selectAll
();
if
(
role
.
getRoleName
()
!=
null
)
{
if
(
role
.
getRoleName
()
!=
null
)
{
list
=
list
.
stream
().
filter
(
o
->
(
o
.
getRoleName
()
!=
null
&&
o
.
getRoleName
().
toLowerCase
().
contains
(
role
.
getRoleName
().
toLowerCase
())))
.
collect
(
Collectors
.
toList
());
...
...
@@ -81,27 +81,27 @@ public class SysRoleServiceImpl implements SysRoleService {
}
@Override
public
SysRole
info
(
Long
roleId
)
{
public
SysRole
info
(
Integer
roleId
)
{
SysRole
sysRole
=
sysRoleMapper
.
selectByPrimaryKey
(
roleId
);
return
sysRole
;
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
saveUserRole
(
Long
userId
,
RoleReq
.
SavaUserRoleReq
role
)
{
public
boolean
saveUserRole
(
Long
userId
,
RoleReq
.
SavaUserRoleReq
role
)
{
int
result
=
0
;
if
(
role
!=
null
&&
role
.
getRoleId
()
!=
null
&&
role
.
getUserId
()
!=
null
)
{
if
(
role
!=
null
&&
role
.
getRoleId
()
!=
null
&&
role
.
getUserId
()
!=
null
)
{
//先删除用户关联数据
sysUserRoleRsMapper
.
deleteByUser
(
role
.
getUserId
());
SysUserRoleRs
info
=
sysUserRoleRsMapper
.
selectByUser
(
role
.
getUserId
(),
role
.
getRoleId
());
if
(
info
!=
null
)
{
info
.
setState
((
short
)
StateType
.
ON
.
getValue
());
SysUserRoleRs
info
=
sysUserRoleRsMapper
.
selectByUser
(
role
.
getUserId
(),
role
.
getRoleId
());
if
(
info
!=
null
)
{
info
.
setState
((
short
)
StateType
.
ON
.
getValue
());
result
=
sysUserRoleRsMapper
.
updateByPrimaryKey
(
info
);
}
else
{
}
else
{
info
=
new
SysUserRoleRs
();
info
.
setCreateDate
(
new
Date
());
info
.
setCreateUserid
(
userId
);
info
.
setState
((
short
)
StateType
.
ON
.
getValue
());
info
.
setState
((
short
)
StateType
.
ON
.
getValue
());
info
.
setUserId
(
role
.
getUserId
());
info
.
setRoleId
(
role
.
getRoleId
());
result
=
sysUserRoleRsMapper
.
insert
(
info
);
...
...
bsoft-admin/src/main/java/com/bsoft/admin/service/impl/SysUserRoleServiceImpl.java
View file @
c4e21bbb
...
...
@@ -19,7 +19,7 @@ public class SysUserRoleServiceImpl implements SysUserRoleRsService {
private
SysRoleMapper
sysRoleMapper
;
@Override
public
List
<
SysRole
>
getRoleListByUser
(
Long
userId
)
throws
Exception
{
public
List
<
SysRole
>
getRoleListByUser
(
Integer
userId
)
throws
Exception
{
return
sysRoleMapper
.
selectRoleByUser
(
userId
);
}
...
...
@@ -34,17 +34,17 @@ public class SysUserRoleServiceImpl implements SysUserRoleRsService {
}
@Override
public
SysUserRoleRs
find
(
Long
id
)
{
public
SysUserRoleRs
find
(
Integer
id
)
{
return
sysUserRoleRsMapper
.
selectByPrimaryKey
(
id
);
}
@Override
public
int
delete
(
Long
id
)
{
public
int
delete
(
Integer
id
)
{
return
sysUserRoleRsMapper
.
deleteByPrimaryKey
(
id
);
}
@Override
public
int
logicDelete
(
Long
id
)
{
public
int
logicDelete
(
Integer
id
)
{
return
0
;
}
...
...
bsoft-admin/src/main/java/com/bsoft/admin/service/impl/UserServiceImpl.java
View file @
c4e21bbb
...
...
@@ -24,8 +24,8 @@ public class UserServiceImpl implements UserService {
}
@Override
public
boolean
addUser
(
Long
userId
,
UserReq
.
AddUserReq
user
)
{
if
(
user
!=
null
)
{
public
boolean
addUser
(
Long
userId
,
UserReq
.
AddUserReq
user
)
{
if
(
user
!=
null
)
{
SysUser
sysUser
=
new
SysUser
();
sysUser
.
setUserCode
(
user
.
getUserCode
());
sysUser
.
setUserName
(
user
.
getUserName
());
...
...
@@ -35,7 +35,7 @@ public class UserServiceImpl implements UserService {
sysUser
.
setSex
(
user
.
getSex
());
sysUser
.
setCreateDate
(
new
Date
());
sysUser
.
setCreateUserid
(
userId
);
sysUser
.
setState
((
short
)
StateType
.
ON
.
getValue
());
sysUser
.
setState
((
short
)
StateType
.
ON
.
getValue
());
sysUserMapper
.
insert
(
sysUser
);
return
true
;
}
...
...
@@ -44,9 +44,9 @@ public class UserServiceImpl implements UserService {
@Override
public
boolean
deleteUser
(
UserReq
.
DeleteUserReq
user
)
{
if
(
user
!=
null
){
if
(
user
!=
null
){
SysUser
sysUser
=
sysUserMapper
.
selectByPrimaryKey
(
user
.
getUserId
());
if
(
sysUser
!=
null
){
if
(
sysUser
!=
null
){
sysUser
.
setState
((
short
)
StateType
.
OFF
.
getValue
());
sysUserMapper
.
updateByPrimaryKey
(
sysUser
);
return
true
;
...
...
@@ -57,9 +57,9 @@ public class UserServiceImpl implements UserService {
@Override
public
boolean
updateUser
(
UserReq
.
UpdateUserReq
user
)
{
if
(
user
!=
null
){
if
(
user
!=
null
){
SysUser
sysUser
=
sysUserMapper
.
selectByPrimaryKey
(
user
.
getUserId
());
if
(
sysUser
!=
null
){
if
(
sysUser
!=
null
){
sysUser
.
setUserCode
(
user
.
getUserCode
());
sysUser
.
setUserName
(
user
.
getUserName
());
sysUser
.
setPassword
(
user
.
getPassword
());
...
...
@@ -76,17 +76,17 @@ public class UserServiceImpl implements UserService {
@Override
public
List
<
SysUser
>
getAll
(
UserReq
.
GetUserReq
user
)
{
List
<
SysUser
>
list
=
sysUserMapper
.
selectAll
();
if
(
user
.
getUserName
()
!=
null
){
if
(
user
.
getUserName
()
!=
null
){
list
=
list
.
stream
().
filter
(
o
->(
o
.
getUserName
()!=
null
&&
o
.
getUserName
().
toLowerCase
().
contains
(
user
.
getUserName
().
toLowerCase
())))
o
->
(
o
.
getUserName
()
!=
null
&&
o
.
getUserName
().
toLowerCase
().
contains
(
user
.
getUserName
().
toLowerCase
())))
.
collect
(
Collectors
.
toList
());
}
return
list
;
}
@Override
public
SysUser
info
(
Long
userId
)
{
SysUser
sysUser
=
sysUserMapper
.
selectByPrimaryKey
(
userId
);
public
SysUser
info
(
Integer
userId
)
{
SysUser
sysUser
=
sysUserMapper
.
selectByPrimaryKey
(
userId
);
return
sysUser
;
}
}
bsoft-admin/src/main/resources/application-dev.properties
View file @
c4e21bbb
#### \u5F00\u53D1\u73AF\u5883 ###################################################
spring.datasource.
driver-class-name
=
oracle.jdbc.driver.OracleDriver
spring.datasource.username
=
CH
spring.datasource.password
=
12345
6
spring.datasource.
url
=
jdbc:oracle:thin:@192.168.18.171:1521:his
spring.datasource.
url
=
jdbc:mysql://192.168.18.176:3306/scml_zp_cs?useUnicode=true&characterEncoding=utf8&useSSL=false&autoReconnect=true&rewriteBatchedStatements=TRUE&serverTimezone=UTC
spring.datasource.username
=
root
spring.datasource.password
=
Suvalue201
6
spring.datasource.
driver-class-name
=
com.mysql.jdbc.Driver
# Redis\u6570\u636E\u5E93\u7D22\u5F15\uFF08\u9ED8\u8BA40\uFF09
spring.redis.database
=
0
...
...
bsoft-admin/src/main/resources/application-test.properties
View file @
c4e21bbb
#### \u
5F00\u53D1
\u73AF\u5883 ###################################################
spring.datasource.
driver-class-name
=
oracle.jdbc.driver.OracleDriver
spring.datasource.username
=
scml_zp_cs
spring.datasource.password
=
123
spring.datasource.
url
=
jdbc:oracle:thin:@192.168.18.171:1521:his
#### \u
6D4B\u8BD5
\u73AF\u5883 ###################################################
spring.datasource.
url
=
jdbc:mysql://192.168.18.176:3306/scml_zp_cs?useUnicode=true&characterEncoding=utf8&useSSL=false&autoReconnect=true&rewriteBatchedStatements=TRUE&serverTimezone=UTC
spring.datasource.username
=
root
spring.datasource.password
=
Suvalue2016
spring.datasource.
driver-class-name
=
com.mysql.jdbc.Driver
# Redis\u6570\u636E\u5E93\u7D22\u5F15\uFF08\u9ED8\u8BA40\uFF09
spring.redis.database
=
0
...
...
bsoft-admin/src/main/resources/mapper/DicOrgMapper.xml
deleted
100644 → 0
View file @
a46126c8
<?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.bsoft.admin.mapper.DicOrgMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.bsoft.admin.model.DicOrg"
>
<id
column=
"ID"
jdbcType=
"DECIMAL"
property=
"id"
/>
<result
column=
"CREATE_DATE"
jdbcType=
"TIMESTAMP"
property=
"createDate"
/>
<result
column=
"CREATE_USERID"
jdbcType=
"DECIMAL"
property=
"createUserid"
/>
<result
column=
"STATE"
jdbcType=
"DECIMAL"
property=
"state"
/>
<result
column=
"ORG_CODE"
jdbcType=
"VARCHAR"
property=
"orgCode"
/>
<result
column=
"ORG_NAME"
jdbcType=
"VARCHAR"
property=
"orgName"
/>
<result
column=
"ORG_NO"
jdbcType=
"VARCHAR"
property=
"orgNo"
/>
<result
column=
"ORG_SHORT_NAME"
jdbcType=
"VARCHAR"
property=
"orgShortName"
/>
<result
column=
"ORG_GROUP"
jdbcType=
"VARCHAR"
property=
"orgGroup"
/>
<result
column=
"ORG_TYPE"
jdbcType=
"VARCHAR"
property=
"orgType"
/>
<result
column=
"ORG_ADDRESS"
jdbcType=
"VARCHAR"
property=
"orgAddress"
/>
<result
column=
"PARENT_ID"
jdbcType=
"DECIMAL"
property=
"parentId"
/>
</resultMap>
<resultMap
id=
"DicOrgResultMap"
extends=
"BaseResultMap"
type=
"com.bsoft.admin.model.respmodel.DicOrgList"
/>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
delete from DIC_ORG
where ID = #{id,jdbcType=DECIMAL}
</delete>
<insert
id=
"insert"
parameterType=
"com.bsoft.admin.model.DicOrg"
>
<selectKey
keyProperty=
"id"
order=
"BEFORE"
resultType=
"java.lang.Long"
>
select SEQ_DIC_ORG_ID.nextval from dual
</selectKey>
insert into DIC_ORG (ID,CREATE_DATE, CREATE_USERID, "STATE",
ORG_CODE, ORG_NAME, ORG_NO,
ORG_SHORT_NAME, ORG_GROUP, ORG_TYPE,
ORG_ADDRESS, PARENT_ID)
values (#{id,jdbcType=DECIMAL},#{createDate,jdbcType=TIMESTAMP}, #{createUserid,jdbcType=DECIMAL}, #{state,jdbcType=DECIMAL},
#{orgCode,jdbcType=VARCHAR}, #{orgName,jdbcType=VARCHAR}, #{orgNo,jdbcType=VARCHAR},
#{orgShortName,jdbcType=VARCHAR}, #{orgGroup,jdbcType=VARCHAR}, #{orgType,jdbcType=VARCHAR},
#{orgAddress,jdbcType=VARCHAR}, #{parentId,jdbcType=DECIMAL})
</insert>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.bsoft.admin.model.DicOrg"
>
update DIC_ORG
set CREATE_DATE = #{createDate,jdbcType=TIMESTAMP},
CREATE_USERID = #{createUserid,jdbcType=DECIMAL},
"STATE" = #{state,jdbcType=DECIMAL},
ORG_CODE = #{orgCode,jdbcType=VARCHAR},
ORG_NAME = #{orgName,jdbcType=VARCHAR},
ORG_NO = #{orgNo,jdbcType=VARCHAR},
ORG_SHORT_NAME = #{orgShortName,jdbcType=VARCHAR},
ORG_GROUP = #{orgGroup,jdbcType=VARCHAR},
ORG_TYPE = #{orgType,jdbcType=VARCHAR},
ORG_ADDRESS = #{orgAddress,jdbcType=VARCHAR},
PARENT_ID = #{parentId,jdbcType=DECIMAL}
where ID = #{id,jdbcType=DECIMAL}
</update>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Long"
resultMap=
"BaseResultMap"
>
select ID, CREATE_DATE, CREATE_USERID, "STATE", ORG_CODE, ORG_NAME, ORG_NO, ORG_SHORT_NAME,
ORG_GROUP, ORG_TYPE, ORG_ADDRESS, PARENT_ID
from DIC_ORG
where ID = #{id,jdbcType=DECIMAL} and "STATE"=1
</select>
<select
id=
"selectAll"
resultMap=
"BaseResultMap"
>
select ID, CREATE_DATE, CREATE_USERID, "STATE", ORG_CODE, ORG_NAME, ORG_NO, ORG_SHORT_NAME,
ORG_GROUP, ORG_TYPE, ORG_ADDRESS, PARENT_ID
from DIC_ORG
where "STATE"=1
</select>
<select
id=
"selectParentAll"
resultMap=
"DicOrgResultMap"
>
select ID, CREATE_DATE, CREATE_USERID, "STATE", ORG_CODE, ORG_NAME, ORG_NO, ORG_SHORT_NAME,
ORG_GROUP, ORG_TYPE, ORG_ADDRESS, PARENT_ID
from DIC_ORG
where "STATE"=1
</select>
<select
id=
"selectByUser"
resultMap=
"BaseResultMap"
>
SELECT o.*
FROM SYS_USER_ORG_RS uor,DIC_ORG o
where uor.ORG_ID=o.ID and uor.USER_ID= #{userId,jdbcType=DECIMAL}
and o."STATE"=1 and uor."STATE"=1
</select>
<select
id=
"selectByName"
resultMap=
"BaseResultMap"
>
select * from DIC_ORG where ORG_NAME=#{orgName,jdbcType=VARCHAR} and "STATE"=1
</select>
</mapper>
\ No newline at end of file
bsoft-admin/src/main/resources/mapper/SysMenuMapper.xml
deleted
100644 → 0
View file @
a46126c8
<?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.bsoft.admin.mapper.SysMenuMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.bsoft.admin.model.SysMenu"
>
<id
column=
"ID"
jdbcType=
"DECIMAL"
property=
"id"
/>
<result
column=
"CREATE_DATA"
jdbcType=
"TIMESTAMP"
property=
"createData"
/>
<result
column=
"CREATE_USERID"
jdbcType=
"DECIMAL"
property=
"createUserid"
/>
<result
column=
"STATE"
jdbcType=
"DECIMAL"
property=
"state"
/>
<result
column=
"MENU_NAME"
jdbcType=
"VARCHAR"
property=
"menuName"
/>
<result
column=
"MENU_URL"
jdbcType=
"VARCHAR"
property=
"menuUrl"
/>
<result
column=
"MENU_IMAGE"
jdbcType=
"VARCHAR"
property=
"menuImage"
/>
<result
column=
"PARENT_ID"
jdbcType=
"DECIMAL"
property=
"parentId"
/>
<result
column=
"PAGE_CODE"
jdbcType=
"VARCHAR"
property=
"pageCode"
/>
<result
column=
"SORT"
jdbcType=
"DECIMAL"
property=
"sort"
/>
</resultMap>
<resultMap
id=
"sysMenuResultMap"
type=
"com.bsoft.admin.model.respmodel.SysMenuList"
extends=
"BaseResultMap"
/>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
delete from SYS_MENU
where ID = #{id,jdbcType=DECIMAL}
</delete>
<insert
id=
"insert"
parameterType=
"com.bsoft.admin.model.SysMenu"
>
<selectKey
keyProperty=
"id"
order=
"BEFORE"
resultType=
"java.lang.Long"
>
select SEQ_SYS_MENU_ID.nextval from dual
</selectKey>
insert into SYS_MENU (ID,CREATE_DATA, CREATE_USERID, "STATE",
MENU_NAME, MENU_URL, MENU_IMAGE,
PARENT_ID, PAGE_CODE, SORT
)
values (#{id,jdbcType=DECIMAL},#{createData,jdbcType=TIMESTAMP}, #{createUserid,jdbcType=DECIMAL}, #{state,jdbcType=DECIMAL},
#{menuName,jdbcType=VARCHAR}, #{menuUrl,jdbcType=VARCHAR}, #{menuImage,jdbcType=VARCHAR},
#{parentId,jdbcType=DECIMAL}, #{pageCode,jdbcType=VARCHAR}, #{sort,jdbcType=DECIMAL}
)
</insert>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.bsoft.admin.model.SysMenu"
>
update SYS_MENU
set CREATE_DATA = #{createData,jdbcType=TIMESTAMP},
CREATE_USERID = #{createUserid,jdbcType=DECIMAL},
"STATE" = #{state,jdbcType=DECIMAL},
MENU_NAME = #{menuName,jdbcType=VARCHAR},
MENU_URL = #{menuUrl,jdbcType=VARCHAR},
MENU_IMAGE = #{menuImage,jdbcType=VARCHAR},
PARENT_ID = #{parentId,jdbcType=DECIMAL},
PAGE_CODE = #{pageCode,jdbcType=VARCHAR},
SORT = #{sort,jdbcType=DECIMAL}
where ID = #{id,jdbcType=DECIMAL}
</update>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Long"
resultMap=
"BaseResultMap"
>
select ID, CREATE_DATA, CREATE_USERID, "STATE", MENU_NAME, MENU_URL, MENU_IMAGE,
PARENT_ID, PAGE_CODE, SORT
from SYS_MENU
where ID = #{id,jdbcType=DECIMAL} and "STATE"=1
</select>
<select
id=
"selectAll"
resultMap=
"BaseResultMap"
>
select ID, CREATE_DATA, CREATE_USERID, "STATE", MENU_NAME, MENU_URL, MENU_IMAGE,
PARENT_ID, PAGE_CODE, SORT
from SYS_MENU
where "STATE"=1
</select>
<select
id=
"selectParentAll"
resultMap=
"sysMenuResultMap"
>
select ID, CREATE_DATA, CREATE_USERID, "STATE", MENU_NAME, MENU_URL, MENU_IMAGE,
PARENT_ID, PAGE_CODE, SORT
from SYS_MENU
where "STATE"=1
</select>
<select
id=
"selectMenuAllByUser"
resultMap=
"sysMenuResultMap"
>
select DISTINCT m.ID,m.MENU_NAME,m.MENU_URL,m.MENU_IMAGE,m.PARENT_ID,m.PAGE_CODE,m.SORT,umr.STATE
from
SYS_USER_MENU_RS umr
LEFT JOIN
SYS_MENU m on umr.MENU_ID = m.ID
where m.STATE=1 and umr.USER_ID = #{userId,jdbcType=DECIMAL}
</select>
<select
id=
"selectMenuByRole"
resultMap=
"sysMenuResultMap"
>
select DISTINCT m.ID,m.MENU_NAME,m.MENU_URL,m.MENU_IMAGE,m.PARENT_ID,m.PAGE_CODE,m.SORT,rmr.STATE
from
SYS_ROLE_MENU_RS rmr
LEFT JOIN
SYS_MENU m on rmr.MENU_ID = m.ID
LEFT JOIN
SYS_USER_ROLE_RS urr on rmr.ROLE_ID = urr.Role_ID
where rmr.STATE=1 and m.STATE=1 and urr.STATE=1 and urr.USER_ID = #{userId,jdbcType=DECIMAL}
</select>
<select
id=
"selectMaxSort"
resultType=
"java.lang.Integer"
>
select nvl(MAX(SORT),0) AS SORT
from SYS_MENU
where PARENT_ID=#{parentId,jdbcType=DECIMAL}
</select>
</mapper>
\ No newline at end of file
bsoft-admin/src/main/resources/mapper/SysRoleMapper.xml
deleted
100644 → 0
View file @
a46126c8
<?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.bsoft.admin.mapper.SysRoleMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.bsoft.admin.model.SysRole"
>
<id
column=
"ID"
jdbcType=
"DECIMAL"
property=
"id"
/>
<result
column=
"CREATE_DATE"
jdbcType=
"TIMESTAMP"
property=
"createDate"
/>
<result
column=
"CREATE_USERID"
jdbcType=
"DECIMAL"
property=
"createUserid"
/>
<result
column=
"STATE"
jdbcType=
"DECIMAL"
property=
"state"
/>
<result
column=
"ROLE_NAME"
jdbcType=
"VARCHAR"
property=
"roleName"
/>
<result
column=
"ROLE_CODE"
jdbcType=
"DECIMAL"
property=
"roleCode"
/>
</resultMap>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
delete from SYS_ROLE
where ID = #{id,jdbcType=DECIMAL}
</delete>
<insert
id=
"insert"
parameterType=
"com.bsoft.admin.model.SysRole"
>
<selectKey
keyProperty=
"id"
order=
"BEFORE"
resultType=
"java.lang.Long"
>
select SEQ_SYS_ROLE_ID.nextval from dual
</selectKey>
insert into SYS_ROLE (ID,CREATE_DATE, CREATE_USERID, "STATE",
ROLE_NAME, ROLE_CODE)
values (#{id,jdbcType=DECIMAL},#{createDate,jdbcType=TIMESTAMP}, #{createUserid,jdbcType=DECIMAL},
#{state,jdbcType=DECIMAL}, #{roleName,jdbcType=VARCHAR}, #{roleCode,jdbcType=DECIMAL})
</insert>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.bsoft.admin.model.SysRole"
>
update SYS_ROLE
set CREATE_DATE = #{createDate,jdbcType=TIMESTAMP},
CREATE_USERID = #{createUserid,jdbcType=DECIMAL},
"STATE" = #{state,jdbcType=DECIMAL},
ROLE_NAME = #{roleName,jdbcType=VARCHAR},
ROLE_CODE = #{roleCode,jdbcType=DECIMAL}
where ID = #{id,jdbcType=DECIMAL}
</update>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Long"
resultMap=
"BaseResultMap"
>
select ID, CREATE_DATE, CREATE_USERID, "STATE", ROLE_NAME, ROLE_CODE
from SYS_ROLE
where ID = #{id,jdbcType=DECIMAL} and "STATE"!=0
</select>
<select
id=
"selectAll"
resultMap=
"BaseResultMap"
>
select ID, CREATE_DATE, CREATE_USERID, "STATE", ROLE_NAME, ROLE_CODE
from SYS_ROLE
where "STATE"!=0
</select>
<select
id=
"selectRoleByUser"
resultMap=
"BaseResultMap"
>
select r.*
from SYS_USER_ROLE_RS rs,SYS_ROLE r
where USER_ID=#{userId,jdbcType=DECIMAL} and rs.ROLE_ID=r.ID
and rs.STATE!=0 and r.STATE!=0
</select>
<select
id=
"selectByCode"
resultMap=
"BaseResultMap"
>
select ID, CREATE_DATE, CREATE_USERID, "STATE", ROLE_NAME, ROLE_CODE
from SYS_ROLE
where ROLE_CODE = #{roleCode,jdbcType=DECIMAL} and "STATE"!=0
</select>
</mapper>
\ No newline at end of file
bsoft-admin/src/main/resources/mapper/SysRoleMenuRsMapper.xml
deleted
100644 → 0
View file @
a46126c8
<?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.bsoft.admin.mapper.SysRoleMenuRsMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.bsoft.admin.model.SysRoleMenuRs"
>
<id
column=
"ID"
jdbcType=
"DECIMAL"
property=
"id"
/>
<result
column=
"CREATE_DATE"
jdbcType=
"TIMESTAMP"
property=
"createDate"
/>
<result
column=
"CREATE_USERID"
jdbcType=
"DECIMAL"
property=
"createUserid"
/>
<result
column=
"STATE"
jdbcType=
"DECIMAL"
property=
"state"
/>
<result
column=
"MENU_ID"
jdbcType=
"DECIMAL"
property=
"menuId"
/>
<result
column=
"ROLE_ID"
jdbcType=
"DECIMAL"
property=
"roleId"
/>
</resultMap>
<resultMap
id=
"SysRoleMenuRsList"
extends=
"BaseResultMap"
type=
"com.bsoft.admin.model.respmodel.SysRoleMenuRsList"
>
<result
column=
"PARENT_ID"
jdbcType=
"DECIMAL"
property=
"parentId"
/>
</resultMap>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
delete from SYS_ROLE_MENU_RS
where ID = #{id,jdbcType=DECIMAL}
</delete>
<insert
id=
"insert"
parameterType=
"com.bsoft.admin.model.SysRoleMenuRs"
>
<selectKey
keyProperty=
"id"
order=
"BEFORE"
resultType=
"java.lang.Long"
>
select SEQ_SYS_ROLE_MENU_RSR_ID.nextval from dual
</selectKey>
insert into SYS_ROLE_MENU_RS (ID,CREATE_DATE, CREATE_USERID, "STATE",
MENU_ID, ROLE_ID)
values (#{id,jdbcType=DECIMAL},#{createDate,jdbcType=TIMESTAMP}, #{createUserid,jdbcType=DECIMAL}, #{state,jdbcType=DECIMAL},
#{menuId,jdbcType=DECIMAL}, #{roleId,jdbcType=DECIMAL})
</insert>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.bsoft.admin.model.SysRoleMenuRs"
>
update SYS_ROLE_MENU_RS
set CREATE_DATE = #{createDate,jdbcType=TIMESTAMP},
CREATE_USERID = #{createUserid,jdbcType=DECIMAL},
"STATE" = #{state,jdbcType=DECIMAL},
MENU_ID = #{menuId,jdbcType=DECIMAL},
ROLE_ID = #{roleId,jdbcType=DECIMAL}
where ID = #{id,jdbcType=DECIMAL}
</update>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Long"
resultMap=
"BaseResultMap"
>
select ID, CREATE_DATE, CREATE_USERID, "STATE", MENU_ID, ROLE_ID
from SYS_ROLE_MENU_RS
where ID = #{id,jdbcType=DECIMAL} and "STATE"=1
</select>
<select
id=
"selectAll"
resultMap=
"BaseResultMap"
>
select ID, CREATE_DATE, CREATE_USERID, "STATE", MENU_ID, ROLE_ID
from SYS_ROLE_MENU_RS
where "STATE"=1
</select>
<select
id=
"selectByRole"
resultMap=
"SysRoleMenuRsList"
>
select MAP.*,m.PARENT_ID
from SYS_ROLE_MENU_RS MAP
join SYS_MENU m on m.ID=MAP.MENU_ID
where MAP."STATE"=1 and MAP.ROLE_ID = #{roleId,jdbcType=DECIMAL}
</select>
<update
id=
"deleteAllByRole"
>
update SYS_ROLE_MENU_RS set "STATE"=0 where ROLE_ID = #{roleId,jdbcType=DECIMAL}
</update>
<select
id=
"selectByUserWithRole"
resultMap=
"BaseResultMap"
>
select ID, CREATE_DATE, CREATE_USERID, "STATE", MENU_ID, ROLE_ID
from SYS_ROLE_MENU_RS
where ROLE_ID = #{roleId,jdbcType=DECIMAL}
and MENU_ID=#{menuId,jdbcType=DECIMAL}
</select>
</mapper>
\ No newline at end of file
bsoft-admin/src/main/resources/mapper/SysUserMapper.xml
deleted
100644 → 0
View file @
a46126c8
<?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.bsoft.admin.mapper.SysUserMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.bsoft.admin.model.SysUser"
>
<id
column=
"ID"
jdbcType=
"DECIMAL"
property=
"id"
/>
<result
column=
"CREATE_DATE"
jdbcType=
"TIMESTAMP"
property=
"createDate"
/>
<result
column=
"CREATE_USERID"
jdbcType=
"DECIMAL"
property=
"createUserid"
/>
<result
column=
"STATE"
jdbcType=
"DECIMAL"
property=
"state"
/>
<result
column=
"USER_CODE"
jdbcType=
"VARCHAR"
property=
"userCode"
/>
<result
column=
"USER_NAME"
jdbcType=
"VARCHAR"
property=
"userName"
/>
<result
column=
"PASSWORD"
jdbcType=
"VARCHAR"
property=
"password"
/>
<result
column=
"IDCARD"
jdbcType=
"VARCHAR"
property=
"idcard"
/>
<result
column=
"SEX"
jdbcType=
"VARCHAR"
property=
"sex"
/>
<result
column=
"MOBILE"
jdbcType=
"VARCHAR"
property=
"mobile"
/>
<result
column=
"PAGE_COUNT"
jdbcType=
"DECIMAL"
property=
"pageCount"
/>
<result
column=
"ERROR_COUNT"
jdbcType=
"DECIMAL"
property=
"errorCount"
/>
<result
column=
"ERROR_TIME"
jdbcType=
"TIMESTAMP"
property=
"errorTime"
/>
<result
column=
"LAST_TIME"
jdbcType=
"TIMESTAMP"
property=
"lastTime"
/>
<result
column=
"LAST_IP"
jdbcType=
"VARCHAR"
property=
"lastIp"
/>
</resultMap>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
delete from SYS_USER
where ID = #{id,jdbcType=DECIMAL}
</delete>
<insert
id=
"insert"
parameterType=
"com.bsoft.admin.model.SysUser"
>
<selectKey
keyProperty=
"id"
order=
"BEFORE"
resultType=
"java.lang.Long"
>
select SEQ_SYS_USER_ID.nextval from dual
</selectKey>
insert into SYS_USER (ID,CREATE_DATE, CREATE_USERID, "STATE",
USER_CODE, USER_NAME, "PASSWORD",
IDCARD, SEX, MOBILE,
PAGE_COUNT, ERROR_COUNT, ERROR_TIME,
LAST_TIME, LAST_IP)
values (#{id,jdbcType=DECIMAL},#{createDate,jdbcType=TIMESTAMP}, #{createUserid,jdbcType=DECIMAL},
#{state,jdbcType=DECIMAL},#{userCode,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
#{idcard,jdbcType=VARCHAR}, #{sex,jdbcType=VARCHAR}, #{mobile,jdbcType=VARCHAR},
#{pageCount,jdbcType=DECIMAL}, #{errorCount,jdbcType=DECIMAL}, #{errorTime,jdbcType=TIMESTAMP},
#{lastTime,jdbcType=TIMESTAMP}, #{lastIp,jdbcType=VARCHAR})
</insert>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.bsoft.admin.model.SysUser"
>
update SYS_USER
set CREATE_DATE = #{createDate,jdbcType=TIMESTAMP},
CREATE_USERID = #{createUserid,jdbcType=DECIMAL},
"STATE" = #{state,jdbcType=DECIMAL},
USER_CODE = #{userCode,jdbcType=VARCHAR},
USER_NAME = #{userName,jdbcType=VARCHAR},
"PASSWORD" = #{password,jdbcType=VARCHAR},
IDCARD = #{idcard,jdbcType=VARCHAR},
SEX = #{sex,jdbcType=VARCHAR},
MOBILE = #{mobile,jdbcType=VARCHAR},
PAGE_COUNT = #{pageCount,jdbcType=DECIMAL},
ERROR_COUNT = #{errorCount,jdbcType=DECIMAL},
ERROR_TIME = #{errorTime,jdbcType=TIMESTAMP},
LAST_TIME = #{lastTime,jdbcType=TIMESTAMP},
LAST_IP = #{lastIp,jdbcType=VARCHAR}
where ID = #{id,jdbcType=DECIMAL}
</update>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Long"
resultMap=
"BaseResultMap"
>
select ID, CREATE_DATE, CREATE_USERID, "STATE", USER_CODE, USER_NAME, "PASSWORD",
IDCARD, SEX, MOBILE, PAGE_COUNT, ERROR_COUNT, ERROR_TIME, LAST_TIME, LAST_IP
from SYS_USER
where ID = #{id,jdbcType=DECIMAL} and "STATE"!=0
</select>
<select
id=
"selectAll"
resultMap=
"BaseResultMap"
>
select ID, CREATE_DATE, CREATE_USERID, "STATE", USER_CODE, USER_NAME, "PASSWORD",
IDCARD, SEX, MOBILE, PAGE_COUNT, ERROR_COUNT, ERROR_TIME, LAST_TIME, LAST_IP
from SYS_USER
where "STATE"!=0
</select>
<select
id=
"selectByCode"
resultMap=
"BaseResultMap"
>
select ID, CREATE_DATE, CREATE_USERID, STATE, USER_CODE, USER_NAME, PASSWORD, IDCARD,
SEX, MOBILE, PAGE_COUNT, ERROR_COUNT, ERROR_TIME, LAST_TIME, LAST_IP
from SYS_USER
where USER_CODE=#{userCode,jdbcType=VARCHAR}
and "STATE" != 0
</select>
</mapper>
\ No newline at end of file
bsoft-admin/src/main/resources/mapper/SysUserMenuRsMapper.xml
deleted
100644 → 0
View file @
a46126c8
<?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.bsoft.admin.mapper.SysUserMenuRsMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.bsoft.admin.model.SysUserMenuRs"
>
<id
column=
"ID"
jdbcType=
"DECIMAL"
property=
"id"
/>
<result
column=
"CREATE_DATE"
jdbcType=
"TIMESTAMP"
property=
"createDate"
/>
<result
column=
"CREATE_USERID"
jdbcType=
"DECIMAL"
property=
"createUserid"
/>
<result
column=
"STATE"
jdbcType=
"DECIMAL"
property=
"state"
/>
<result
column=
"USER_ID"
jdbcType=
"DECIMAL"
property=
"userId"
/>
<result
column=
"MENU_ID"
jdbcType=
"DECIMAL"
property=
"menuId"
/>
</resultMap>
<resultMap
id=
"SysUserMenuRsList"
extends=
"BaseResultMap"
type=
"com.bsoft.admin.model.respmodel.SysUserMenuRsList"
>
<result
column=
"PARENT_ID"
jdbcType=
"DECIMAL"
property=
"parentId"
/>
</resultMap>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
delete from SYS_USER_MENU_RS
where ID = #{id,jdbcType=DECIMAL}
</delete>
<insert
id=
"insert"
parameterType=
"com.bsoft.admin.model.SysUserMenuRs"
>
<selectKey
keyProperty=
"id"
order=
"BEFORE"
resultType=
"java.lang.Long"
>
select SEQ_SYS_USER_MENU_RS_ID.nextval from dual
</selectKey>
insert into SYS_USER_MENU_RS (ID,CREATE_DATE, CREATE_USERID, "STATE",
USER_ID, MENU_ID)
values (#{id,jdbcType=DECIMAL},#{createDate,jdbcType=TIMESTAMP}, #{createUserid,jdbcType=DECIMAL}, #{state,jdbcType=DECIMAL},
#{userId,jdbcType=DECIMAL}, #{menuId,jdbcType=DECIMAL})
</insert>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.bsoft.admin.model.SysUserMenuRs"
>
update SYS_USER_MENU_RS
set CREATE_DATE = #{createDate,jdbcType=TIMESTAMP},
CREATE_USERID = #{createUserid,jdbcType=DECIMAL},
"STATE" = #{state,jdbcType=DECIMAL},
USER_ID = #{userId,jdbcType=DECIMAL},
MENU_ID = #{menuId,jdbcType=DECIMAL}
where ID = #{id,jdbcType=DECIMAL}
</update>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Long"
resultMap=
"BaseResultMap"
>
select ID, CREATE_DATE, CREATE_USERID, "STATE", USER_ID, MENU_ID
from SYS_USER_MENU_RS
where ID = #{id,jdbcType=DECIMAL}
</select>
<select
id=
"selectAll"
resultMap=
"BaseResultMap"
>
select ID, CREATE_DATE, CREATE_USERID, "STATE", USER_ID, MENU_ID
from SYS_USER_MENU_RS
</select>
<select
id=
"selectByUser"
resultMap=
"SysUserMenuRsList"
>
select MAP.*,m.PARENT_ID
from SYS_USER_MENU_RS MAP
join SYS_MENU m on m.ID=MAP.MENU_ID
where MAP."STATE"=1 and MAP.USER_ID = #{userId,jdbcType=DECIMAL}
</select>
<update
id=
"deleteAllByUser"
>
update SYS_USER_MENU_RS set "STATE"=0 where USER_ID = #{userId,jdbcType=DECIMAL}
</update>
<select
id=
"selectByUserWithMenu"
resultMap=
"BaseResultMap"
>
select ID, CREATE_DATE, CREATE_USERID, "STATE", USER_ID, MENU_ID
from SYS_USER_MENU_RS
where USER_ID = #{userId,jdbcType=DECIMAL}
and MENU_ID=#{menuId,jdbcType=DECIMAL}
</select>
</mapper>
\ No newline at end of file
bsoft-admin/src/main/resources/mapper/SysUserOrgRsMapper.xml
deleted
100644 → 0
View file @
a46126c8
<?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.bsoft.admin.mapper.SysUserOrgRsMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.bsoft.admin.model.SysUserOrgRs"
>
<id
column=
"ID"
jdbcType=
"DECIMAL"
property=
"id"
/>
<result
column=
"CREATE_DATE"
jdbcType=
"TIMESTAMP"
property=
"createDate"
/>
<result
column=
"CREATE_USERID"
jdbcType=
"DECIMAL"
property=
"createUserid"
/>
<result
column=
"STATE"
jdbcType=
"DECIMAL"
property=
"state"
/>
<result
column=
"USER_ID"
jdbcType=
"DECIMAL"
property=
"userId"
/>
<result
column=
"ORG_ID"
jdbcType=
"DECIMAL"
property=
"orgId"
/>
</resultMap>
<resultMap
id=
"SysUserOrgRsList"
extends=
"BaseResultMap"
type=
"com.bsoft.admin.model.respmodel.SysUserOrgRsList"
>
<result
column=
"PARENT_ID"
jdbcType=
"DECIMAL"
property=
"parentId"
/>
</resultMap>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
delete from SYS_USER_ORG_RS
where ID = #{id,jdbcType=DECIMAL}
</delete>
<insert
id=
"insert"
parameterType=
"com.bsoft.admin.model.SysUserOrgRs"
>
<selectKey
keyProperty=
"id"
order=
"BEFORE"
resultType=
"java.lang.Long"
>
select SEQ_SYS_USER_ORG_RS_ID.nextval from dual
</selectKey>
insert into SYS_USER_ORG_RS (ID,CREATE_DATE, CREATE_USERID, "STATE",
USER_ID, ORG_ID)
values (#{id,jdbcType=DECIMAL},#{createDate,jdbcType=TIMESTAMP}, #{createUserid,jdbcType=DECIMAL}, #{state,jdbcType=DECIMAL},
#{userId,jdbcType=DECIMAL}, #{orgId,jdbcType=DECIMAL})
</insert>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.bsoft.admin.model.SysUserOrgRs"
>
update SYS_USER_ORG_RS
set CREATE_DATE = #{createDate,jdbcType=TIMESTAMP},
CREATE_USERID = #{createUserid,jdbcType=DECIMAL},
"STATE" = #{state,jdbcType=DECIMAL},
USER_ID = #{userId,jdbcType=DECIMAL},
ORG_ID = #{orgId,jdbcType=DECIMAL}
where ID = #{id,jdbcType=DECIMAL}
</update>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Long"
resultMap=
"BaseResultMap"
>
select ID, CREATE_DATE, CREATE_USERID, "STATE", USER_ID, ORG_ID
from SYS_USER_ORG_RS
where ID = #{id,jdbcType=DECIMAL}
</select>
<select
id=
"selectAll"
resultMap=
"BaseResultMap"
>
select ID, CREATE_DATE, CREATE_USERID, "STATE", USER_ID, ORG_ID
from SYS_USER_ORG_RS
where "STATE" = 1
</select>
<select
id=
"selectByUser"
resultMap=
"SysUserOrgRsList"
>
select map.*,o.PARENT_ID
from SYS_USER_ORG_RS MAP
join DIC_ORG o on o.ID=map.ORG_ID
where MAP."STATE" = 1 and MAP.USER_ID = #{userId,jdbcType=DECIMAL}
</select>
<select
id=
"selectByUserWithOrg"
resultMap=
"BaseResultMap"
>
select ID, CREATE_DATE, CREATE_USERID, "STATE", USER_ID, ORG_ID
from SYS_USER_ORG_RS
where USER_ID = #{userId,jdbcType=DECIMAL} and ORG_ID=#{orgId,jdbcType=DECIMAL}
</select>
<update
id=
"deleteByUser"
>
update SYS_USER_ORG_RS
set "STATE" = 0
where USER_ID = #{userId,jdbcType=DECIMAL}
</update>
</mapper>
\ No newline at end of file
bsoft-admin/src/main/resources/mapper/SysUserRoleRsMapper.xml
deleted
100644 → 0
View file @
a46126c8
<?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.bsoft.admin.mapper.SysUserRoleRsMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.bsoft.admin.model.SysUserRoleRs"
>
<id
column=
"ID"
jdbcType=
"DECIMAL"
property=
"id"
/>
<result
column=
"CREATE_DATE"
jdbcType=
"TIMESTAMP"
property=
"createDate"
/>
<result
column=
"CREATE_USERID"
jdbcType=
"DECIMAL"
property=
"createUserid"
/>
<result
column=
"STATE"
jdbcType=
"DECIMAL"
property=
"state"
/>
<result
column=
"USER_ID"
jdbcType=
"DECIMAL"
property=
"userId"
/>
<result
column=
"ROLE_ID"
jdbcType=
"DECIMAL"
property=
"roleId"
/>
</resultMap>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
delete from SYS_USER_ROLE_RS
where ID = #{id,jdbcType=DECIMAL}
</delete>
<insert
id=
"insert"
parameterType=
"com.bsoft.admin.model.SysUserRoleRs"
>
<selectKey
keyProperty=
"id"
order=
"BEFORE"
resultType=
"java.lang.Long"
>
select SEQ_SYS_USER_ROLE_RS_ID.nextval from dual
</selectKey>
insert into SYS_USER_ROLE_RS (ID,CREATE_DATE, CREATE_USERID, "STATE",
USER_ID, ROLE_ID)
values (#{id,jdbcType=DECIMAL},#{createDate,jdbcType=TIMESTAMP}, #{createUserid,jdbcType=DECIMAL}, #{state,jdbcType=DECIMAL},
#{userId,jdbcType=DECIMAL}, #{roleId,jdbcType=DECIMAL})
</insert>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.bsoft.admin.model.SysUserRoleRs"
>
update SYS_USER_ROLE_RS
set CREATE_DATE = #{createDate,jdbcType=TIMESTAMP},
CREATE_USERID = #{createUserid,jdbcType=DECIMAL},
"STATE" = #{state,jdbcType=DECIMAL},
USER_ID = #{userId,jdbcType=DECIMAL},
ROLE_ID = #{roleId,jdbcType=DECIMAL}
where ID = #{id,jdbcType=DECIMAL}
</update>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Long"
resultMap=
"BaseResultMap"
>
select ID, CREATE_DATE, CREATE_USERID, "STATE", USER_ID, ROLE_ID
from SYS_USER_ROLE_RS
where ID = #{id,jdbcType=DECIMAL}
</select>
<select
id=
"selectAll"
resultMap=
"BaseResultMap"
>
select ID, CREATE_DATE, CREATE_USERID, "STATE", USER_ID, ROLE_ID
from SYS_USER_ROLE_RS
where "STATE"=1
</select>
<update
id=
"deleteByUser"
>
update SYS_USER_ROLE_RS
set "STATE" = 0
where USER_ID = #{userId,jdbcType=DECIMAL}
</update>
<select
id=
"selectByUser"
resultMap=
"BaseResultMap"
>
select ID, CREATE_DATE, CREATE_USERID, "STATE", USER_ID, ROLE_ID
from SYS_USER_ROLE_RS
where USER_ID = #{userId,jdbcType=DECIMAL}
and ROLE_ID = #{roleId,jdbcType=DECIMAL}
</select>
</mapper>
\ No newline at end of file
bsoft-admin/src/test/resources/generatorConfig.xml
View file @
c4e21bbb
...
...
@@ -6,12 +6,12 @@
<!-- 引入配置文件 -->
<properties
resource=
"./application-dev.properties"
/>
<context
id=
"
Oracle
"
targetRuntime=
"MyBatis3Simple"
defaultModelType=
"flat"
>
<context
id=
"
MySql
"
targetRuntime=
"MyBatis3Simple"
defaultModelType=
"flat"
>
<!-- 生成的文件编码 -->
<property
name=
"javaFileEncoding"
value=
"utf-8"
/>
<property
name=
"autoDelimitKeywords"
value=
"true"
/>
<property
name=
"beginningDelimiter"
value=
"
"
"
/>
<property
name=
"endingDelimiter"
value=
"
"
"
/>
<property
name=
"beginningDelimiter"
value=
"
`
"
/>
<property
name=
"endingDelimiter"
value=
"
`
"
/>
<!-- 通过自定义插件类生成自定义注解和接口 -->
<!--<plugin type="com.suvalue.common.GenPlugin">-->
...
...
@@ -44,105 +44,26 @@
<!-- <!– 主键生成方式 –>-->
<!-- <generatedKey column="id" sqlStatement="select SEQ_SYS_USER_ID.nextval from dual" identity="true" />-->
<!-- </table>-->
<table
tableName=
"
SYS_USER"
schema=
"ll
"
>
<generatedKey
column=
"
id"
sqlStatement=
"select SEQ_SYS_USER_ID.nextval from dual"
identity=
"true"
/>
<table
tableName=
"
sys_menu
"
>
<generatedKey
column=
"
ID"
sqlStatement=
"Mysql"
identity=
"true"
/>
</table>
<table
tableName=
"
SYS_ROLE"
schema=
"ll
"
>
<generatedKey
column=
"
id"
sqlStatement=
"select SEQ_SYS_ROLE_ID.nextval from dual"
identity=
"true"
/>
<table
tableName=
"
sys_role
"
>
<generatedKey
column=
"
ID"
sqlStatement=
"Mysql"
identity=
"true"
/>
</table>
<table
tableName=
"
SYS_MENU"
schema=
"ll
"
>
<generatedKey
column=
"
id"
sqlStatement=
"select SEQ_SYS_MENU_ID.nextval from dual"
identity=
"true"
/>
<table
tableName=
"
sys_role_menu_rs
"
>
<generatedKey
column=
"
ID"
sqlStatement=
"Mysql"
identity=
"true"
/>
</table>
<table
tableName=
"
DIC_ORG"
schema=
"ll
"
>
<generatedKey
column=
"
id"
sqlStatement=
"select SEQ_DIC_ORG_ID.nextval from dual"
identity=
"true"
/>
<table
tableName=
"
sys_user_org_rs
"
>
<generatedKey
column=
"
ID"
sqlStatement=
"Mysql"
identity=
"true"
/>
</table>
<table
tableName=
"
SYS_ROLE_MENU_RS"
schema=
"ll
"
>
<generatedKey
column=
"
id"
sqlStatement=
"select SEQ_SYS_ROLE_MENU_RS_ID.nextval from dual"
identity=
"true"
/>
<table
tableName=
"
sys_user
"
>
<generatedKey
column=
"
ID"
sqlStatement=
"Mysql"
identity=
"true"
/>
</table>
<table
tableName=
"
SYS_USER_MENU_RS"
schema=
"ll
"
>
<generatedKey
column=
"
id"
sqlStatement=
"select SEQ_SYS_USER_MENU_RS _ID.nextval from dual"
identity=
"true"
/>
<table
tableName=
"
sys_user_role_rs
"
>
<generatedKey
column=
"
ID"
sqlStatement=
"Mysql"
identity=
"true"
/>
</table>
<table
tableName=
"
SYS_USER_ORG_RS"
schema=
"ll
"
>
<generatedKey
column=
"
id"
sqlStatement=
"select SEQ_SYS_USER_ORG_RS_ID.nextval from dual"
identity=
"true"
/>
<table
tableName=
"
sys_user_menu_rs
"
>
<generatedKey
column=
"
ID"
sqlStatement=
"Mysql"
identity=
"true"
/>
</table>
<table
tableName=
"SYS_USER_ROLE_RS"
schema=
"ll"
>
<generatedKey
column=
"id"
sqlStatement=
"select SEQ_SYS_USER_ROLE_RS_ID.nextval from dual"
identity=
"true"
/>
</table>
<!-- <table tableName="DIC_IND" schema="ll" >-->
<!-- <generatedKey column="id" sqlStatement="select SEQ_DIC_IND_ID.nextval from dual" identity="true" />-->
<!-- </table>-->
<!-- <table tableName="DIC_ORG" schema="ll" >-->
<!-- <generatedKey column="id" sqlStatement="select SEQ_DIC_ORG_ID.nextval from dual" identity="true" />-->
<!-- </table>-->
<!-- <table tableName="SER_BLOCK_IND_RS" schema="ll" >-->
<!-- <generatedKey column="id" sqlStatement="select SEQ_SER_ BLOCK_IND_RS_ID.nextval from dual" identity="true" />-->
<!-- </table>-->
<!-- <table tableName="SER_BLOCK" schema="ll" >-->
<!-- <generatedKey column="id" sqlStatement="select SEQ_SER_BLOCK_ID.nextval from dual" identity="true" />-->
<!-- </table>-->
<!-- <table tableName="SER_PAGE" schema="ll" >-->
<!-- <generatedKey column="id" sqlStatement="select SEQ_SER_PAGE_ID.nextval from dual" identity="true" />-->
<!-- </table>-->
<!-- <table tableName="SER_PAGE_BLOCK_RS" schema="ll" >-->
<!-- <generatedKey column="id" sqlStatement="select SEQ_SER_PAGE_BLOCK_RS_ID.nextval from dual" identity="true" />-->
<!-- </table>-->
<!-- <table tableName="SER_PAGE_DIM_RS" schema="ll" >-->
<!-- <generatedKey column="id" sqlStatement="select SEQ_SER_PAGE_DIM_RS_ID.nextval from dual" identity="true" />-->
<!-- </table>-->
<!-- <table tableName="SYS_MENU" schema="ll" >-->
<!-- <generatedKey column="id" sqlStatement="select SEQ_SYS_MENU_ID.nextval from dual" identity="true" />-->
<!-- </table>-->
<!-- <table tableName="SYS_ORG" schema="ll" >-->
<!-- <generatedKey column="id" sqlStatement="select SEQ_SYS_ORG_ID.nextval from dual" identity="true" />-->
<!-- </table>-->
<!-- <table tableName="SYS_PROJECT" schema="ll" >-->
<!-- <generatedKey column="id" sqlStatement="select SEQ_SYS_PROJECT_ID.nextval from dual" identity="true" />-->
<!-- </table>-->
<!-- <table tableName="SYS_ROLE" schema="ll" >-->
<!-- <generatedKey column="id" sqlStatement="select SEQ_SYS_ROLE_ID.nextval from dual" identity="true" />-->
<!-- </table>-->
<!-- <table tableName="SYS_ROLE_MENU_RS" schema="ll" >-->
<!-- <generatedKey column="id" sqlStatement="select SEQ_SYS_ROLE_MENU_RS_ID.nextval from dual" identity="true" />-->
<!-- </table>-->
<!-- <table tableName="SYS_USER_MENU_RS" schema="ll" >-->
<!-- <generatedKey column="id" sqlStatement="select SEQ_SYS_USER_MENU_RS_ID.nextval from dual" identity="true" />-->
<!-- </table>-->
<!-- <table tableName="SYS_USER_ORG_RS" schema="ll" >-->
<!-- <generatedKey column="id" sqlStatement="select SEQ_SYS_USER_ORG_RS_ID.nextval from dual" identity="true" />-->
<!-- </table>-->
<!-- <table tableName="SYS_USER_ROLE_RS" schema="ll" >-->
<!-- <generatedKey column="id" sqlStatement="select SEQ_SYS_USER_ROLE_RS_ID.nextval from dual" identity="true" />-->
<!-- </table>-->
</context>
<!--<context id="sqlserver" targetRuntime="MyBatis3Simple" defaultModelType="flat">-->
<!--<property enName="beginningDelimiter" value="["/>-->
<!--<property enName="endingDelimiter" value="]"/>-->
<!--<!– 生成的文件编码 –>-->
<!--<property enName="javaFileEncoding" value="utf-8"/>-->
<!--<!– 通过自定义插件类生成自定义注解和接口 –>-->
<!--<!–<plugin type="com.suvalue.common.GenPlugin">–>-->
<!--<!–<property enName="mappers" value="com.suvalue.demo.mapper.BaseMapper"/>–>-->
<!--<!–</plugin>–>-->
<!--<commentGenerator>-->
<!--<!– 取消生成注释 –>-->
<!--<property enName="suppressAllComments" value="false"/>-->
<!--</commentGenerator>-->
<!--<!– 数据库连接属性 –>-->
<!--<jdbcConnection driverClass="${jdbc.sqlserver.driver}"-->
<!--connectionURL="${jdbc.sqlserver.url}"-->
<!--userId="${jdbc.sqlserver.username}"-->
<!--password="${jdbc.sqlserver.password}">-->
<!--</jdbcConnection>-->
<!--<!– 生成实体类配置 –>-->
<!--<javaModelGenerator targetPackage="com.suvalue.verctrl.model" targetProject="src/main/java"/>-->
<!--<!– 生成映射文件配置 –>-->
<!--<sqlMapGenerator targetPackage="mapper" targetProject="src/main/resources"/>-->
<!--<!– 生成映射接口配置 –>-->
<!--<!–<javaClientGenerator targetPackage="com.suvalue.verctrl.mapper" targetProject="src/main/java" type="XMLMAPPER"/>–>-->
<!--<table tableName="data_version" schema="dbo">-->
<!--<!–mysql 配置 –>-->
<!--<generatedKey column="id" sqlStatement="SqlServer" identity="true"/>-->
<!--</table>-->
<!--</context>-->
</generatorConfiguration>
bsoft-admin/src/test/resources/jdbc.properties
View file @
c4e21bbb
jdbc.url
=
jdbc:mysql://192.168.18.
55:3306/db_appointment
?useUnicode=true&characterEncoding=utf8&useSSL=false&autoReconnect=true&rewriteBatchedStatements=TRUE
jdbc.username
=
ll
jdbc.password
=
12345
6
jdbc.url
=
jdbc:mysql://192.168.18.
176:3306/scml_zp_cs
?useUnicode=true&characterEncoding=utf8&useSSL=false&autoReconnect=true&rewriteBatchedStatements=TRUE
jdbc.username
=
root
jdbc.password
=
Suvalue201
6
jdbc.driverClass
=
com.mysql.jdbc.Driver
\ No newline at end of file
bsoft-api/src/main/java/com/bsoft/api/common/Result.java
View file @
c4e21bbb
...
...
@@ -15,7 +15,7 @@ public class Result<T> {
@ApiModelProperty
(
value
=
"返回的数据"
)
private
T
data
;
private
Result
(
int
code
,
String
msg
,
T
data
)
{
private
Result
(
int
code
,
String
msg
,
T
data
)
{
this
.
code
=
code
;
this
.
msg
=
msg
;
this
.
data
=
data
;
...
...
@@ -54,37 +54,37 @@ public class Result<T> {
this
.
data
=
data
;
}
public
static
<
T
>
Result
<
T
>
success
(
T
data
){
return
new
Result
(
ErrorCode
.
SUCCESS
.
getCode
(),
ErrorCode
.
SUCCESS
.
getEnMessage
(),
data
);
public
static
<
T
>
Result
<
T
>
success
(
T
data
)
{
return
new
Result
(
ErrorCode
.
SUCCESS
.
getCode
(),
ErrorCode
.
SUCCESS
.
getEnMessage
(),
data
);
}
public
static
Result
error
(
int
code
,
String
msg
)
{
return
new
Result
(
code
,
msg
,
null
);
public
static
Result
error
(
int
code
,
String
msg
)
{
return
new
Result
(
code
,
msg
,
null
);
}
public
static
Result
error
(){
return
new
Result
(
ErrorCode
.
ERROR
.
getCode
(),
ErrorCode
.
ERROR
.
getEnMessage
(),
null
);
public
static
Result
error
()
{
return
new
Result
(
ErrorCode
.
ERROR
.
getCode
(),
ErrorCode
.
ERROR
.
getEnMessage
(),
null
);
}
public
static
Result
error
(
String
msg
){
return
new
Result
(
ErrorCode
.
ERROR
.
getCode
(),
msg
,
null
);
public
static
Result
error
(
String
msg
)
{
return
new
Result
(
ErrorCode
.
ERROR
.
getCode
(),
msg
,
null
);
}
public
static
Result
error
(
ErrorCode
errorCode
){
return
new
Result
(
errorCode
.
getCode
(),
errorCode
.
getEnMessage
(),
null
);
public
static
Result
error
(
ErrorCode
errorCode
)
{
return
new
Result
(
errorCode
.
getCode
(),
errorCode
.
getEnMessage
(),
null
);
}
public
static
enum
ErrorCode
{
SUCCESS
(
1
,
"成功"
,
"success"
),
INVALID_TOKEN
(
401
,
"无效的TOKEN"
,
"invalid token"
),
ERROR
(
400
,
"错误"
,
"error"
),
public
static
enum
ErrorCode
{
SUCCESS
(
1
,
"成功"
,
"success"
),
INVALID_TOKEN
(
401
,
"无效的TOKEN"
,
"invalid token"
),
ERROR
(
400
,
"错误"
,
"error"
),
USERERROR
(
2
,
"账号或密码错误"
,
"wrong account or password"
);
private
int
code
;
private
String
cnMessage
;
private
String
enMessage
;
ErrorCode
(
int
code
,
String
cnMessage
,
String
enMessage
)
{
ErrorCode
(
int
code
,
String
cnMessage
,
String
enMessage
)
{
this
.
code
=
code
;
this
.
cnMessage
=
cnMessage
;
this
.
enMessage
=
enMessage
;
...
...
bsoft-api/src/main/java/com/bsoft/api/common/aspect/RequestMappingAspect.java
View file @
c4e21bbb
...
...
@@ -23,9 +23,12 @@ import java.util.List;
@Profile
({
"test"
,
"prod"
})
public
class
RequestMappingAspect
{
@Pointcut
(
"@annotation(org.springframework.web.bind.annotation.GetMapping)"
)
public
void
getMappingAspect
(){}
public
void
getMappingAspect
()
{
}
@Pointcut
(
"@annotation(org.springframework.web.bind.annotation.PostMapping)"
)
public
void
postMappingAspect
(){}
public
void
postMappingAspect
()
{
}
@Around
(
"getMappingAspect()"
)
public
Object
get
(
ProceedingJoinPoint
joinPoint
)
throws
Throwable
{
...
...
@@ -39,16 +42,16 @@ public class RequestMappingAspect {
private
Object
request
(
ProceedingJoinPoint
joinPoint
)
throws
Throwable
{
Date
beginDate
=
new
Date
();
HttpServletRequest
request
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
();
HttpServletRequest
request
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
();
Logger
logger
=
org
.
slf4j
.
LoggerFactory
.
getLogger
(
joinPoint
.
getTarget
().
getClass
());
Object
result
=
joinPoint
.
proceed
();
String
uri
=
request
.
getRequestURI
();
Object
[]
params
=
joinPoint
.
getArgs
();
List
<
Object
>
paramsList
=
Arrays
.
asList
(
params
);
Date
endDate
=
new
Date
();
logger
.
debug
(
"执行时间:"
+
(
endDate
.
getTime
()
-
beginDate
.
getTime
())
+
",URL:"
+
uri
+
"入参参数:"
+
paramsList
+
"返回结果:"
+
result
);
logger
.
debug
(
"执行时间:"
+
(
endDate
.
getTime
()
-
beginDate
.
getTime
())
+
",URL:"
+
uri
+
"入参参数:"
+
paramsList
+
"返回结果:"
+
result
);
return
result
;
}
}
bsoft-api/src/main/java/com/bsoft/api/common/aspect/TokenAspect.java
View file @
c4e21bbb
...
...
@@ -23,11 +23,12 @@ import javax.servlet.http.HttpServletRequest;
@Profile
({
"test"
,
"prod"
})
public
class
TokenAspect
{
@Pointcut
(
"@annotation(com.bsoft.api.common.annotations.Token)"
)
public
void
tokenAspect
(){}
public
void
tokenAspect
()
{
}
@Around
(
"tokenAspect()"
)
public
Object
verifierToken
(
ProceedingJoinPoint
joinPoint
)
throws
Throwable
{
HttpServletRequest
request
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
();
HttpServletRequest
request
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
();
String
token
=
request
.
getHeader
(
Constants
.
TOKEN_KEY
);
if
(!
StringUtil
.
isNullOrEmpty
(
token
)
&&
TokenUtil
.
checkToken
(
token
)){
...
...
bsoft-api/src/main/java/com/bsoft/api/common/base/RequestResult.java
View file @
c4e21bbb
...
...
@@ -29,7 +29,7 @@ public class RequestResult {
this
.
data
=
data
;
}
public
RequestResult
(
Integer
code
,
String
msg
,
Object
data
)
{
public
RequestResult
(
Integer
code
,
String
msg
,
Object
data
)
{
this
.
code
=
code
;
this
.
msg
=
msg
;
this
.
data
=
data
;
...
...
bsoft-api/src/main/java/com/bsoft/api/common/configurations/CurrentUserConfigure.java
View file @
c4e21bbb
...
...
@@ -11,12 +11,12 @@ import java.util.List;
@Configuration
public
class
CurrentUserConfigure
implements
WebMvcConfigurer
{
@Override
public
void
addArgumentResolvers
(
List
<
HandlerMethodArgumentResolver
>
resolvers
){
public
void
addArgumentResolvers
(
List
<
HandlerMethodArgumentResolver
>
resolvers
)
{
resolvers
.
add
(
currentUserMethodArgumentResolver
());
}
@Bean
public
CurrentUserMethodArgumentResolver
currentUserMethodArgumentResolver
(){
public
CurrentUserMethodArgumentResolver
currentUserMethodArgumentResolver
()
{
return
new
CurrentUserMethodArgumentResolver
();
}
}
bsoft-api/src/main/java/com/bsoft/api/common/configurations/LoginConfigure.java
View file @
c4e21bbb
...
...
@@ -38,7 +38,7 @@ public class LoginConfigure implements WebMvcConfigurer {
}
@Bean
public
LoginInterceptor
loginIntercepter
(){
public
LoginInterceptor
loginIntercepter
()
{
return
new
LoginInterceptor
();
}
}
bsoft-api/src/main/java/com/bsoft/api/common/enums/RequestResultType.java
View file @
c4e21bbb
package
com
.
bsoft
.
api
.
common
.
enums
;
public
enum
RequestResultType
{
SUCCESS
(
1
,
"成功"
),
FAILURE
(
0
,
"失败"
),;
SUCCESS
(
1
,
"成功"
),
FAILURE
(
0
,
"失败"
);
private
int
value
;
private
String
desc
;
RequestResultType
(
int
value
,
String
desc
)
{
RequestResultType
(
int
value
,
String
desc
)
{
this
.
value
=
value
;
this
.
desc
=
desc
;
}
...
...
bsoft-api/src/main/java/com/bsoft/api/common/enums/StateType.java
View file @
c4e21bbb
package
com
.
bsoft
.
api
.
common
.
enums
;
public
enum
StateType
{
ON
(
1
,
"启用"
),
OFF
(
0
,
"禁用"
),;
ON
(
1
,
"启用"
),
OFF
(
0
,
"禁用"
);
private
int
value
;
private
String
desc
;
StateType
(
int
value
,
String
desc
){
StateType
(
int
value
,
String
desc
)
{
this
.
value
=
value
;
this
.
desc
=
desc
;
}
...
...
bsoft-api/src/main/java/com/bsoft/api/common/exceptions/DBConfigurationError.java
View file @
c4e21bbb
package
com
.
bsoft
.
api
.
common
.
exceptions
;
public
class
DBConfigurationError
extends
ExceptionBase
{
public
DBConfigurationError
(
String
message
){
public
DBConfigurationError
(
String
message
)
{
super
(
message
);
}
}
bsoft-api/src/main/java/com/bsoft/api/common/exceptions/ExceptionBase.java
View file @
c4e21bbb
package
com
.
bsoft
.
api
.
common
.
exceptions
;
public
class
ExceptionBase
extends
RuntimeException
{
public
ExceptionBase
()
{
super
();
}
public
ExceptionBase
()
{
super
();
}
public
ExceptionBase
(
String
message
)
{
super
(
message
);
}
public
ExceptionBase
(
String
message
)
{
super
(
message
);
}
}
bsoft-api/src/main/java/com/bsoft/api/common/exceptions/InvalidTokenException.java
View file @
c4e21bbb
package
com
.
bsoft
.
api
.
common
.
exceptions
;
public
class
InvalidTokenException
extends
ExceptionBase
{
public
InvalidTokenException
(){
public
InvalidTokenException
()
{
super
();
}
public
InvalidTokenException
(
String
message
){
public
InvalidTokenException
(
String
message
)
{
super
(
message
);
}
}
bsoft-api/src/main/java/com/bsoft/api/common/handlers/GlobalExceptionHandler.java
View file @
c4e21bbb
...
...
@@ -15,7 +15,6 @@ import org.springframework.web.bind.annotation.ExceptionHandler;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
...
...
@@ -27,71 +26,74 @@ public class GlobalExceptionHandler {
/**
* 其他异常处理
*
* @param request
* @param e
* @return
*/
@ExceptionHandler
(
Exception
.
class
)
@ResponseBody
public
Object
defaultErrorHandler
(
HttpServletRequest
request
,
Exception
e
)
{
public
Object
defaultErrorHandler
(
HttpServletRequest
request
,
Exception
e
)
{
String
url
=
request
.
getRequestURI
();
log
.
error
(
url
+
"请求未知异常:"
+
e
.
getMessage
(),
e
);
log
.
error
(
url
+
"请求未知异常:"
+
e
.
getMessage
(),
e
);
return
Result
.
error
();
}
@ExceptionHandler
(
MethodArgumentNotValidException
.
class
)
@ResponseBody
public
Object
MethodArgumentNotValidErrorHandler
(
HttpServletRequest
request
,
MethodArgumentNotValidException
e
)
{
public
Object
MethodArgumentNotValidErrorHandler
(
HttpServletRequest
request
,
MethodArgumentNotValidException
e
)
{
String
url
=
request
.
getRequestURI
();
BindingResult
bindingResult
=
e
.
getBindingResult
();
List
<
ObjectError
>
allErrors
=
bindingResult
.
getAllErrors
();
StringBuilder
errorStrBu
=
new
StringBuilder
();
allErrors
.
forEach
(
objectError
->
{
FieldError
fieldError
=
(
FieldError
)
objectError
;
FieldError
fieldError
=
(
FieldError
)
objectError
;
errorStrBu
.
append
(
fieldError
.
getDefaultMessage
());
errorStrBu
.
append
(
","
);
});
});
String
errorStr
=
errorStrBu
.
toString
();
log
.
error
(
url
+
"请求未知异常:"
+
e
.
getMessage
(),
e
);
return
Result
.
error
(
errorStr
.
substring
(
0
,
errorStr
.
length
()
-
1
));
log
.
error
(
url
+
"请求未知异常:"
+
e
.
getMessage
(),
e
);
return
Result
.
error
(
errorStr
.
substring
(
0
,
errorStr
.
length
()
-
1
));
}
/**
* 其他内部异常
*
* @param request
* @param e
* @return
*/
@ExceptionHandler
(
ExceptionBase
.
class
)
@ResponseBody
public
Object
BaseErrorHandler
(
HttpServletRequest
request
,
Exception
e
)
{
public
Object
BaseErrorHandler
(
HttpServletRequest
request
,
Exception
e
)
{
String
url
=
request
.
getRequestURI
();
log
.
error
(
url
+
"请求未知异常:"
+
e
.
getMessage
(),
e
);
log
.
error
(
url
+
"请求未知异常:"
+
e
.
getMessage
(),
e
);
return
Result
.
error
();
}
@ExceptionHandler
(
DBConfigurationError
.
class
)
@ResponseBody
public
Object
DBConfigurationErrorHandler
(
HttpServletRequest
request
,
Exception
e
)
{
public
Object
DBConfigurationErrorHandler
(
HttpServletRequest
request
,
Exception
e
)
{
String
url
=
request
.
getRequestURI
();
log
.
error
(
url
+
"请求未知异常:"
+
e
.
getMessage
(),
e
);
return
Result
.
error
(
400
,
e
.
getMessage
());
log
.
error
(
url
+
"请求未知异常:"
+
e
.
getMessage
(),
e
);
return
Result
.
error
(
400
,
e
.
getMessage
());
}
/**
* 无效token
*
* @param request
* @param e
* @return
*/
@ExceptionHandler
(
InvalidTokenException
.
class
)
@ResponseBody
public
Object
InvalidTokenExceptionHandler
(
HttpServletRequest
request
,
Exception
e
)
{
public
Object
InvalidTokenExceptionHandler
(
HttpServletRequest
request
,
Exception
e
)
{
String
url
=
request
.
getRequestURI
();
log
.
error
(
url
+
"请求未知异常:"
+
e
.
getMessage
(),
e
);
log
.
error
(
url
+
"请求未知异常:"
+
e
.
getMessage
(),
e
);
return
Result
.
error
(
Result
.
ErrorCode
.
INVALID_TOKEN
);
}
}
bsoft-api/src/main/java/com/bsoft/api/common/intercepters/LoginInterceptor.java
View file @
c4e21bbb
...
...
@@ -14,8 +14,9 @@ import java.io.PrintWriter;
public
class
LoginInterceptor
implements
HandlerInterceptor
{
Logger
logger
=
org
.
slf4j
.
LoggerFactory
.
getLogger
(
LoginInterceptor
.
class
);
@Override
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
throws
Exception
{
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
throws
Exception
{
System
.
out
.
println
(
"LoginInterceptor----------->preHandle"
);
String
token
=
request
.
getHeader
(
Constants
.
TOKEN_KEY
);
...
...
@@ -23,16 +24,16 @@ public class LoginInterceptor implements HandlerInterceptor {
response
.
setCharacterEncoding
(
"UTF-8"
);
response
.
setContentType
(
"application/json; charset=utf-8"
);
PrintWriter
writer
=
null
;
try
{
try
{
String
remoteHost
=
request
.
getRemoteHost
();
String
uri
=
request
.
getRequestURI
();
logger
.
info
(
remoteHost
+
" 访问 "
+
uri
+
", token无效, token:["
+
token
+
"]"
);
writer
=
response
.
getWriter
();
writer
.
print
(
Result
.
error
(
Result
.
ErrorCode
.
INVALID_TOKEN
));
}
catch
(
IOException
e
){
}
catch
(
IOException
e
){
logger
.
error
(
e
.
getMessage
());
}
finally
{
}
finally
{
if
(
writer
!=
null
){
writer
.
close
();
}
...
...
@@ -40,24 +41,23 @@ public class LoginInterceptor implements HandlerInterceptor {
return
false
;
}
return
HandlerInterceptor
.
super
.
preHandle
(
request
,
response
,
handler
);
return
HandlerInterceptor
.
super
.
preHandle
(
request
,
response
,
handler
);
}
@Override
public
void
postHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
,
ModelAndView
modelAndView
)
throws
Exception
{
public
void
postHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
,
ModelAndView
modelAndView
)
throws
Exception
{
System
.
out
.
println
(
"LoginInterceptor----------->postHandle"
);
HandlerInterceptor
.
super
.
postHandle
(
request
,
response
,
handler
,
modelAndView
);
HandlerInterceptor
.
super
.
postHandle
(
request
,
response
,
handler
,
modelAndView
);
}
@Override
public
void
afterCompletion
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
,
Exception
ex
)
throws
Exception
{
HttpServletResponse
response
,
Object
handler
,
Exception
ex
)
throws
Exception
{
System
.
out
.
println
(
"LoginInterceptor------->afterCompletion"
);
HandlerInterceptor
.
super
.
afterCompletion
(
request
,
response
,
handler
,
ex
);
HandlerInterceptor
.
super
.
afterCompletion
(
request
,
response
,
handler
,
ex
);
}
}
bsoft-api/src/main/java/com/bsoft/api/common/utils/SqlUtil.java
View file @
c4e21bbb
package
com
.
bsoft
.
api
.
common
.
utils
;
public
class
SqlUtil
{
public
static
String
TransactSQLInjection
(
String
str
)
{
return
str
.
replaceAll
(
".*([';]+|(--)+).*"
,
" "
);
public
static
String
TransactSQLInjection
(
String
str
)
{
return
str
.
replaceAll
(
".*([';]+|(--)+).*"
,
" "
);
}
}
bsoft-api/src/main/java/com/bsoft/api/controller/BlockValuesController.java
View file @
c4e21bbb
...
...
@@ -10,7 +10,6 @@ import com.bsoft.api.service.BlockValuesService;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
bsoft-api/src/main/java/com/bsoft/api/controller/DimController.java
View file @
c4e21bbb
...
...
@@ -23,14 +23,15 @@ public class DimController {
/**
* 根据pageCode查询维度数值
*
* @return
* @throws Exception
*/
@PostMapping
(
"dimValue"
)
@Token
@ApiOperation
(
"根据pageCode查询维度数值"
)
public
Object
getdimValueByPageCode
(
@RequestBody
@Valid
ReqDimValue
reqDimValue
)
{
List
<
DimValue
>
dimValueList
=
dicDimService
.
getByPageCode
(
reqDimValue
.
getPageCode
(),
reqDimValue
.
getOrgId
(),
reqDimValue
.
getDate
());
public
Object
getdimValueByPageCode
(
@RequestBody
@Valid
ReqDimValue
reqDimValue
)
{
List
<
DimValue
>
dimValueList
=
dicDimService
.
getByPageCode
(
reqDimValue
.
getPageCode
(),
reqDimValue
.
getOrgId
(),
reqDimValue
.
getDate
());
return
Result
.
success
(
dimValueList
);
}
}
bsoft-api/src/main/java/com/bsoft/api/controller/ExcelController.java
View file @
c4e21bbb
...
...
@@ -28,11 +28,11 @@ public class ExcelController {
@PostMapping
(
"export"
)
@Token
@ApiOperation
(
"将Table转换为Xls"
)
public
Object
tableToXls
(
HttpServletRequest
request
,
@RequestBody
ExportReq
info
){
String
tableStr
=
StringEscapeUtils
.
unescapeHtml4
(
info
.
getTableStr
());
log
.
info
(
"table参数:"
+
tableStr
);
public
Object
tableToXls
(
HttpServletRequest
request
,
@RequestBody
ExportReq
info
)
{
String
tableStr
=
StringEscapeUtils
.
unescapeHtml4
(
info
.
getTableStr
());
log
.
info
(
"table参数:"
+
tableStr
);
String
realPath
=
request
.
getSession
().
getServletContext
().
getRealPath
(
"/"
);
String
fileUrl
=
excelService
.
tableToXls
(
realPath
,
tableStr
);
String
fileUrl
=
excelService
.
tableToXls
(
realPath
,
tableStr
);
return
Result
.
success
(
fileUrl
);
}
}
bsoft-api/src/main/java/com/bsoft/api/controller/IndController.java
View file @
c4e21bbb
...
...
@@ -20,16 +20,16 @@ public class IndController {
private
DicIndService
dicIndService
;
@GetMapping
public
ModelAndView
index
(
Model
model
,
String
filter
)
{
model
.
addAttribute
(
"title"
,
"指标搜索"
);
model
.
addAttribute
(
"indList"
,
dicIndService
.
selectAll
(
filter
));
model
.
addAttribute
(
"filter"
,
filter
==
null
?
""
:
filter
);
ModelAndView
mav
=
new
ModelAndView
(
"ind"
,
"indModel"
,
model
);
public
ModelAndView
index
(
Model
model
,
String
filter
)
{
model
.
addAttribute
(
"title"
,
"指标搜索"
);
model
.
addAttribute
(
"indList"
,
dicIndService
.
selectAll
(
filter
));
model
.
addAttribute
(
"filter"
,
filter
==
null
?
""
:
filter
);
ModelAndView
mav
=
new
ModelAndView
(
"ind"
,
"indModel"
,
model
);
return
mav
;
}
@PostMapping
(
"search"
)
public
ModelAndView
search
(
String
filter
){
public
ModelAndView
search
(
String
filter
)
{
return
new
ModelAndView
(
"redirect:/ind?filter="
+
filter
);
}
...
...
bsoft-api/src/main/java/com/bsoft/api/controller/LoginController.java
View file @
c4e21bbb
...
...
@@ -4,9 +4,13 @@ import com.bsoft.api.common.Result;
import
com.bsoft.api.model.reqmodel.CodeAndPwd
;
import
com.bsoft.api.service.LoginService
;
import
com.bsoft.common.utils.HttpUtil
;
import
io.swagger.annotations.*
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
springfox.documentation.annotations.ApiIgnore
;
import
javax.servlet.http.HttpServletRequest
;
...
...
@@ -20,18 +24,17 @@ public class LoginController {
private
LoginService
loginServiceImpl
;
/**
*
* @param codeAndPwd
* @param request
* @return
*/
@PostMapping
(
"login"
)
@ApiOperation
(
value
=
"Result«LoginService.LoginInfo»登录"
)
public
Result
<
LoginService
.
LoginInfo
>
login
(
@RequestBody
CodeAndPwd
codeAndPwd
,
HttpServletRequest
request
){
@ApiOperation
(
value
=
"Result«LoginService.LoginInfo»登录"
)
public
Result
<
LoginService
.
LoginInfo
>
login
(
@RequestBody
CodeAndPwd
codeAndPwd
,
HttpServletRequest
request
)
{
String
ip
=
HttpUtil
.
getIP
(
request
);
LoginService
.
LoginInfo
loginInfo
=
loginServiceImpl
.
login
(
codeAndPwd
.
getLoginName
(),
codeAndPwd
.
getPassword
(),
ip
);
if
(
loginInfo
==
null
){
if
(
loginInfo
==
null
){
return
Result
.
error
(
Result
.
ErrorCode
.
USERERROR
);
}
return
Result
.
success
(
loginInfo
);
...
...
@@ -39,7 +42,7 @@ public class LoginController {
@PostMapping
(
"token"
)
@ApiOperation
(
"刷新TOKEN"
)
public
Result
<
String
>
refresh
(
@ApiIgnore
HttpServletRequest
request
){
public
Result
<
String
>
refresh
(
@ApiIgnore
HttpServletRequest
request
)
{
String
oldToken
=
request
.
getHeader
(
"Authorization"
);
String
token
=
loginServiceImpl
.
refreshToken
(
oldToken
);
return
Result
.
success
(
token
);
...
...
bsoft-api/src/main/java/com/bsoft/api/mapper/BlockValuesMapper.java
View file @
c4e21bbb
package
com
.
bsoft
.
api
.
mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
public
interface
BlockValuesMapper
{
List
<
Map
<
String
,
Object
>>
selectByWhere
(
String
tableName
,
String
whereSql
);
List
<
Map
<
String
,
Object
>>
selectByWhereNew
(
Map
<
String
,
String
>
map
);
List
<
Map
<
String
,
Object
>>
selectByWhereNew
(
Map
<
String
,
String
>
map
);
}
bsoft-api/src/main/java/com/bsoft/api/mapper/SerBlockMapper.java
View file @
c4e21bbb
package
com
.
bsoft
.
api
.
mapper
;
import
com.bsoft.api.model.SerBlock
;
import
java.util.List
;
public
interface
SerBlockMapper
{
...
...
bsoft-api/src/main/java/com/bsoft/api/mapper/SerDeptDocRsMapper.java
View file @
c4e21bbb
package
com
.
bsoft
.
api
.
mapper
;
import
com.bsoft.api.model.SerDeptDocRs
;
import
java.math.BigDecimal
;
import
java.util.List
;
...
...
bsoft-api/src/main/java/com/bsoft/api/mapper/SerPageFieldMapper.java
View file @
c4e21bbb
package
com
.
bsoft
.
api
.
mapper
;
import
com.bsoft.api.model.SerPageField
;
import
java.util.List
;
public
interface
SerPageFieldMapper
{
...
...
bsoft-api/src/main/java/com/bsoft/api/mapper/SerPageProjFieldRsMapper.java
View file @
c4e21bbb
package
com
.
bsoft
.
api
.
mapper
;
import
com.bsoft.api.model.SerPageProjFieldRs
;
import
java.util.List
;
public
interface
SerPageProjFieldRsMapper
{
...
...
bsoft-api/src/main/java/com/bsoft/api/mapper/SerPageProjMapper.java
View file @
c4e21bbb
package
com
.
bsoft
.
api
.
mapper
;
import
com.bsoft.api.model.SerPageProj
;
import
java.util.List
;
public
interface
SerPageProjMapper
{
...
...
bsoft-api/src/main/java/com/bsoft/api/mapper/SysProjectMapper.java
deleted
100644 → 0
View file @
a46126c8
package
com
.
bsoft
.
api
.
mapper
;
import
com.bsoft.api.model.SysProject
;
import
java.util.List
;
public
interface
SysProjectMapper
{
int
deleteByPrimaryKey
(
Long
id
);
int
insert
(
SysProject
record
);
SysProject
selectByPrimaryKey
(
Long
id
);
List
<
SysProject
>
selectAll
();
int
updateByPrimaryKey
(
SysProject
record
);
}
\ No newline at end of file
bsoft-api/src/main/java/com/bsoft/api/mapper/SysRoleMapper.java
View file @
c4e21bbb
package
com
.
bsoft
.
api
.
mapper
;
import
com.bsoft.api.model.SysRole
;
import
java.util.List
;
public
interface
SysRoleMapper
{
...
...
bsoft-api/src/main/java/com/bsoft/api/mapper/SysRoleMenuRsMapper.java
View file @
c4e21bbb
package
com
.
bsoft
.
api
.
mapper
;
import
com.bsoft.api.model.SysRoleMenuRs
;
import
java.util.List
;
public
interface
SysRoleMenuRsMapper
{
...
...
bsoft-api/src/main/java/com/bsoft/api/mapper/SysUserMenuRsMapper.java
View file @
c4e21bbb
package
com
.
bsoft
.
api
.
mapper
;
import
com.bsoft.api.model.SysUserMenuRs
;
import
java.util.List
;
public
interface
SysUserMenuRsMapper
{
...
...
bsoft-api/src/main/java/com/bsoft/api/mapper/SysUserOrgRsMapper.java
View file @
c4e21bbb
package
com
.
bsoft
.
api
.
mapper
;
import
com.bsoft.api.model.SysUserOrgRs
;
import
java.util.List
;
public
interface
SysUserOrgRsMapper
{
...
...
bsoft-api/src/main/java/com/bsoft/api/model/reqmodel/AddBudgetValue.java
View file @
c4e21bbb
package
com
.
bsoft
.
api
.
model
.
reqmodel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.math.BigDecimal
;
import
java.util.List
;
@Data
public
class
AddBudgetValue
{
@ApiModelProperty
(
value
=
"类型"
)
@NotNull
(
message
=
"类型不能为空"
)
...
...
@@ -24,37 +26,4 @@ public class AddBudgetValue {
@NotNull
(
message
=
"数值不能为空"
)
private
List
<
BudgetValue
>
budgetValues
;
public
Integer
getProjType
()
{
return
projType
;
}
public
void
setProjType
(
Integer
projType
)
{
this
.
projType
=
projType
;
}
public
BigDecimal
getDate
()
{
return
date
;
}
public
void
setDate
(
BigDecimal
date
)
{
this
.
date
=
date
;
}
public
String
getDeptCode
()
{
return
deptCode
;
}
public
void
setDeptCode
(
String
deptCode
)
{
this
.
deptCode
=
deptCode
;
}
public
List
<
BudgetValue
>
getBudgetValues
()
{
return
budgetValues
;
}
public
void
setBudgetValues
(
List
<
BudgetValue
>
budgetValues
)
{
this
.
budgetValues
=
budgetValues
;
}
}
bsoft-api/src/main/java/com/bsoft/api/model/reqmodel/BlockValues.java
View file @
c4e21bbb
...
...
@@ -2,12 +2,14 @@ package com.bsoft.api.model.reqmodel;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
@ApiModel
(
description
=
"调用blockValues请求的数据"
)
@Data
public
class
BlockValues
{
@ApiModelProperty
(
value
=
"pageCode"
,
required
=
true
)
@ApiModelProperty
(
value
=
"pageCode"
,
required
=
true
)
private
Integer
pageCode
;
@ApiModelProperty
(
"病组"
)
private
Integer
disease
;
...
...
@@ -18,55 +20,4 @@ public class BlockValues {
@ApiModelProperty
(
"时间"
)
@NotNull
(
message
=
"time 参数必传"
)
private
Integer
time
;
public
Integer
getPageCode
()
{
return
pageCode
;
}
public
void
setPageCode
(
Integer
pageCode
)
{
this
.
pageCode
=
pageCode
;
}
public
Integer
getDisease
()
{
return
disease
;
}
public
void
setDisease
(
Integer
disease
)
{
this
.
disease
=
disease
;
}
public
Integer
getDepartment
()
{
return
department
;
}
public
void
setDepartment
(
Integer
department
)
{
this
.
department
=
department
;
}
public
Integer
getDoctor
()
{
return
doctor
;
}
public
void
setDoctor
(
Integer
doctor
)
{
this
.
doctor
=
doctor
;
}
public
Integer
getTime
()
{
return
time
;
}
public
void
setTime
(
Integer
time
)
{
this
.
time
=
time
;
}
@Override
public
String
toString
()
{
return
"BlockValues{"
+
"pageCode="
+
pageCode
+
", disease="
+
disease
+
", department="
+
department
+
", doctor="
+
doctor
+
", time="
+
time
+
'}'
;
}
}
bsoft-api/src/main/java/com/bsoft/api/model/reqmodel/BlockValuesNew.java
View file @
c4e21bbb
package
com
.
bsoft
.
api
.
model
.
reqmodel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
import
java.util.Map
;
@Data
public
class
BlockValuesNew
{
@ApiModelProperty
(
value
=
"pageCode"
,
required
=
true
)
@ApiModelProperty
(
value
=
"pageCode"
,
required
=
true
)
@NotNull
(
message
=
"pageCode 参数必传"
)
private
Integer
pageCode
;
@ApiModelProperty
(
"维度查询值"
)
private
Map
<
String
,
String
>
dim
;
public
Integer
getPageCode
()
{
return
pageCode
;
}
public
void
setPageCode
(
Integer
pageCode
)
{
this
.
pageCode
=
pageCode
;
}
public
Map
<
String
,
String
>
getDim
()
{
return
dim
;
}
public
void
setDim
(
Map
<
String
,
String
>
dim
)
{
this
.
dim
=
dim
;
}
@Override
public
String
toString
()
{
return
"BlockValuesNew{"
+
"pageCode="
+
pageCode
+
", dim="
+
dim
+
'}'
;
}
}
bsoft-api/src/main/java/com/bsoft/api/model/reqmodel/BudgetValue.java
View file @
c4e21bbb
...
...
@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModelProperty;
import
lombok.Data
;
import
java.math.BigDecimal
;
@Data
public
class
BudgetValue
{
@ApiModelProperty
(
value
=
"项目id"
)
...
...
bsoft-api/src/main/java/com/bsoft/api/model/reqmodel/CodeAndPwd.java
View file @
c4e21bbb
...
...
@@ -2,39 +2,17 @@ package com.bsoft.api.model.reqmodel;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
@ApiModel
(
"账号密码"
)
@Data
public
class
CodeAndPwd
{
@ApiModelProperty
(
value
=
"账号"
,
required
=
true
)
@ApiModelProperty
(
value
=
"账号"
,
required
=
true
)
@NotNull
(
message
=
"账号 参数必传"
)
String
loginName
;
@NotNull
(
message
=
"密码 参数必传"
)
@ApiModelProperty
(
value
=
"密码"
,
required
=
true
)
@ApiModelProperty
(
value
=
"密码"
,
required
=
true
)
String
password
;
public
String
getLoginName
()
{
return
loginName
;
}
public
void
setLoginName
(
String
loginName
)
{
this
.
loginName
=
loginName
;
}
public
String
getPassword
()
{
return
password
;
}
public
void
setPassword
(
String
password
)
{
this
.
password
=
password
;
}
@Override
public
String
toString
()
{
return
"CodeAndPwd{"
+
"loginName='"
+
loginName
+
'\''
+
", password='"
+
password
+
'\''
+
'}'
;
}
}
bsoft-api/src/main/java/com/bsoft/api/model/reqmodel/Disease.java
View file @
c4e21bbb
...
...
@@ -3,7 +3,6 @@ package com.bsoft.api.model.reqmodel;
import
io.swagger.annotations.ApiModelProperty
;
import
javax.validation.constraints.NotNull
;
import
java.math.BigDecimal
;
public
class
Disease
{
/**
...
...
@@ -11,16 +10,16 @@ public class Disease {
*/
public
static
class
DiseaseIDorLevel
{
@ApiModelProperty
(
value
=
"时间"
,
required
=
true
)
@ApiModelProperty
(
value
=
"时间"
,
required
=
true
)
@NotNull
(
message
=
"date 参数必传"
)
private
String
date
;
@ApiModelProperty
(
value
=
"疾病编码"
,
required
=
false
)
@ApiModelProperty
(
value
=
"疾病编码"
,
required
=
false
)
private
String
disease
;
@ApiModelProperty
(
value
=
"等级"
,
required
=
false
)
@ApiModelProperty
(
value
=
"等级"
,
required
=
false
)
private
Integer
level
;
@ApiModelProperty
(
value
=
"医生编码"
,
required
=
false
)
@ApiModelProperty
(
value
=
"医生编码"
,
required
=
false
)
private
String
doctor
;
@ApiModelProperty
(
value
=
"科室编码"
,
required
=
false
)
@ApiModelProperty
(
value
=
"科室编码"
,
required
=
false
)
private
String
dept
;
public
String
getDate
()
{
...
...
@@ -80,7 +79,7 @@ public class Disease {
*/
public
static
class
DiseaseName
{
@ApiModelProperty
(
value
=
"时间"
,
required
=
true
)
@ApiModelProperty
(
value
=
"时间"
,
required
=
true
)
@NotNull
(
message
=
"date 参数必传"
)
private
String
date
;
@ApiModelProperty
(
"疾病名称"
)
...
...
bsoft-api/src/main/java/com/bsoft/api/model/reqmodel/DiseaseDoc.java
View file @
c4e21bbb
package
com
.
bsoft
.
api
.
model
.
reqmodel
;
import
io.swagger.annotations.ApiModelProperty
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
import
java.math.BigDecimal
;
/**
* 医生疾病关系入参实体
*/
@Data
public
class
DiseaseDoc
{
@ApiModelProperty
(
"医生编码"
)
...
...
@@ -17,49 +17,7 @@ public class DiseaseDoc {
private
String
mdcCode
;
@ApiModelProperty
(
"科室编码"
)
private
String
deptCode
;
@ApiModelProperty
(
value
=
"时间"
,
required
=
true
)
@ApiModelProperty
(
value
=
"时间"
,
required
=
true
)
@NotNull
(
message
=
"date 参数必传"
)
private
String
date
;
public
String
getDate
()
{
return
date
;
}
public
void
setDate
(
String
date
)
{
this
.
date
=
date
;
}
public
String
getDocCode
()
{
return
docCode
;
}
public
void
setDocCode
(
String
docCode
)
{
this
.
docCode
=
docCode
;
}
public
String
getMdcCode
()
{
return
mdcCode
;
}
public
void
setMdcCode
(
String
mdcCode
)
{
this
.
mdcCode
=
mdcCode
;
}
public
String
getDeptCode
()
{
return
deptCode
;
}
public
void
setDeptCode
(
String
deptCode
)
{
this
.
deptCode
=
deptCode
;
}
@Override
public
String
toString
()
{
return
"DiseaseDoc{"
+
"docCode='"
+
docCode
+
'\''
+
", mdcCode='"
+
mdcCode
+
'\''
+
", deptCode='"
+
deptCode
+
'\''
+
", date='"
+
date
+
'\''
+
'}'
;
}
}
bsoft-api/src/main/java/com/bsoft/api/model/reqmodel/Doctor.java
View file @
c4e21bbb
package
com
.
bsoft
.
api
.
model
.
reqmodel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
@Data
public
class
Doctor
{
@ApiModelProperty
(
value
=
"科室编码"
,
required
=
false
)
@NotBlank
(
message
=
"dept 参数必传"
)
private
String
dept
;
public
String
getDept
()
{
return
dept
;
}
public
void
setDept
(
String
dept
)
{
this
.
dept
=
dept
;
}
}
bsoft-api/src/main/java/com/bsoft/api/model/reqmodel/ExportReq.java
View file @
c4e21bbb
package
com
.
bsoft
.
api
.
model
.
reqmodel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
public
class
ExportReq
{
@ApiModelProperty
(
"Table Html"
)
private
String
tableStr
;
public
String
getTableStr
()
{
return
tableStr
;
}
public
void
setTableStr
(
String
tableStr
)
{
this
.
tableStr
=
tableStr
;
}
@Override
public
String
toString
()
{
return
"ExportReq{"
+
"tableStr='"
+
tableStr
+
'\''
+
'}'
;
}
}
bsoft-api/src/main/java/com/bsoft/api/model/reqmodel/QueryBudgetValue.java
View file @
c4e21bbb
package
com
.
bsoft
.
api
.
model
.
reqmodel
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
public
class
QueryBudgetValue
{
@ApiModelProperty
(
value
=
"项目类型(1=门诊/2=住院/3=汇总)"
)
private
Integer
projectType
;
@ApiModelProperty
(
value
=
"时间"
,
required
=
true
)
private
Integer
date
;
@ApiModelProperty
(
value
=
"科室"
)
private
String
deptCode
;
public
Integer
getProjectType
()
{
return
projectType
;
}
public
void
setProjectType
(
Integer
projectType
)
{
this
.
projectType
=
projectType
;
}
public
Integer
getDate
()
{
return
date
;
}
public
void
setDate
(
Integer
date
)
{
this
.
date
=
date
;
}
public
String
getDeptCode
()
{
return
deptCode
;
}
public
void
setDeptCode
(
String
deptCode
)
{
this
.
deptCode
=
deptCode
;
}
}
bsoft-api/src/main/java/com/bsoft/api/model/reqmodel/ReqDimValue.java
View file @
c4e21bbb
package
com
.
bsoft
.
api
.
model
.
reqmodel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
@Data
public
class
ReqDimValue
{
@ApiModelProperty
(
value
=
"pageCode"
,
required
=
true
)
@ApiModelProperty
(
value
=
"pageCode"
,
required
=
true
)
@NotNull
(
message
=
"pageCode 参数必传"
)
private
String
pageCode
;
@ApiModelProperty
(
"机构id"
)
...
...
@@ -14,37 +16,4 @@ public class ReqDimValue {
@ApiModelProperty
(
"时间"
)
@NotNull
(
message
=
"date 参数必传"
)
private
String
date
;
public
String
getPageCode
()
{
return
pageCode
;
}
public
void
setPageCode
(
String
pageCode
)
{
this
.
pageCode
=
pageCode
;
}
public
Long
getOrgId
()
{
return
orgId
;
}
public
void
setOrgId
(
Long
orgId
)
{
this
.
orgId
=
orgId
;
}
public
String
getDate
()
{
return
date
;
}
public
void
setDate
(
String
date
)
{
this
.
date
=
date
;
}
@Override
public
String
toString
()
{
return
"ReqDimValue{"
+
"pageCode='"
+
pageCode
+
'\''
+
", orgId="
+
orgId
+
", date='"
+
date
+
'\''
+
'}'
;
}
}
bsoft-api/src/main/java/com/bsoft/api/model/respmodel/BlockValue.java
View file @
c4e21bbb
...
...
@@ -7,9 +7,10 @@ public class BlockValue {
private
long
blockId
;
private
List
<
Map
<
String
,
Object
>>
body
;
public
BlockValue
(){}
public
BlockValue
()
{
}
public
BlockValue
(
long
blockId
,
List
<
Map
<
String
,
Object
>>
body
)
{
public
BlockValue
(
long
blockId
,
List
<
Map
<
String
,
Object
>>
body
)
{
this
.
blockId
=
blockId
;
this
.
body
=
body
;
}
...
...
@@ -22,11 +23,11 @@ public class BlockValue {
this
.
blockId
=
blockId
;
}
public
List
<
Map
<
String
,
Object
>>
getBody
()
{
public
List
<
Map
<
String
,
Object
>>
getBody
()
{
return
body
;
}
public
void
setBody
(
List
<
Map
<
String
,
Object
>>
body
)
{
public
void
setBody
(
List
<
Map
<
String
,
Object
>>
body
)
{
this
.
body
=
body
;
}
...
...
bsoft-api/src/main/java/com/bsoft/api/model/respmodel/ListPage.java
View file @
c4e21bbb
...
...
@@ -12,18 +12,18 @@ public class ListPage<T> {
public
ListPage
()
{
}
public
ListPage
(
List
<
T
>
list
,
Integer
pageSize
,
Integer
pageIndex
,
int
cost
)
{
public
ListPage
(
List
<
T
>
list
,
Integer
pageSize
,
Integer
pageIndex
,
int
cost
)
{
totalCount
=
list
.
size
();
this
.
pageSize
=
pageSize
==
null
?
totalCount
:
pageSize
;
curPageIndex
=
pageIndex
==
null
?
1
:
pageIndex
;
totalPageCount
=
(
int
)
Math
.
ceil
((
double
)
totalCount
/
this
.
pageSize
);
totalPageCount
=
(
int
)
Math
.
ceil
((
double
)
totalCount
/
this
.
pageSize
);
int
startIndex
=
this
.
pageSize
*
(
curPageIndex
-
1
)
-
cost
;
int
endIndex
=
this
.
pageSize
*
curPageIndex
+
cost
;
listData
=
list
.
subList
(
startIndex
>
totalCount
?
totalCount
:
startIndex
<
0
?
0
:
startIndex
,
endIndex
<
totalCount
?
endIndex
:
totalCount
);
listData
=
list
.
subList
(
startIndex
>
totalCount
?
totalCount
:
startIndex
<
0
?
0
:
startIndex
,
endIndex
<
totalCount
?
endIndex
:
totalCount
);
}
public
ListPage
(
List
<
T
>
list
,
Integer
pageSize
,
Integer
pageIndex
)
{
this
(
list
,
pageSize
,
pageIndex
,
1
);
public
ListPage
(
List
<
T
>
list
,
Integer
pageSize
,
Integer
pageIndex
)
{
this
(
list
,
pageSize
,
pageIndex
,
1
);
}
public
int
getTotalCount
()
{
...
...
bsoft-api/src/main/java/com/bsoft/api/service/Impl/AsynBlockValuesServiceImpl.java
View file @
c4e21bbb
...
...
@@ -21,20 +21,20 @@ public class AsynBlockValuesServiceImpl implements AsynBlockValuesService {
@Async
@Override
public
void
getBlockValues
(
List
<
BlockValue
>
list
,
Long
blockId
,
String
tableName
,
String
whereClause
,
CountDownLatch
latch
)
{
public
void
getBlockValues
(
List
<
BlockValue
>
list
,
Long
blockId
,
String
tableName
,
String
whereClause
,
CountDownLatch
latch
)
{
try
{
System
.
out
.
println
(
"开始"
+
tableName
);
System
.
out
.
println
(
"开始"
+
tableName
);
List
<
Map
<
String
,
Object
>>
dataList
=
blockValuesMapper
.
selectByWhere
(
tableName
,
whereClause
);
BlockValue
blockValue
=
new
BlockValue
(
blockId
,
dataList
);
synchronized
(
obj
){
List
<
Map
<
String
,
Object
>>
dataList
=
blockValuesMapper
.
selectByWhere
(
tableName
,
whereClause
);
BlockValue
blockValue
=
new
BlockValue
(
blockId
,
dataList
);
synchronized
(
obj
){
list
.
add
(
blockValue
);
}
System
.
out
.
println
(
"结束"
+
tableName
);
}
catch
(
Exception
e
){
log
.
error
(
e
.
getMessage
(),
e
);
}
finally
{
System
.
out
.
println
(
"结束"
+
tableName
);
}
catch
(
Exception
e
){
log
.
error
(
e
.
getMessage
(),
e
);
}
finally
{
latch
.
countDown
();
}
...
...
@@ -43,22 +43,21 @@ public class AsynBlockValuesServiceImpl implements AsynBlockValuesService {
@Async
@Override
public
void
getBlockValuesNew
(
List
<
BlockValue
>
list
,
Long
blockId
,
Map
<
String
,
String
>
whereClause
,
CountDownLatch
latch
)
{
public
void
getBlockValuesNew
(
List
<
BlockValue
>
list
,
Long
blockId
,
Map
<
String
,
String
>
whereClause
,
CountDownLatch
latch
)
{
try
{
List
<
Map
<
String
,
Object
>>
dataList
=
blockValuesMapper
.
selectByWhereNew
(
whereClause
);
log
.
info
(
"开始查询"
+
whereClause
.
get
(
"tableName"
)+
",数据条数:"
+
dataList
.
size
()+
",查询条件:"
+
whereClause
);
BlockValue
blockValue
=
new
BlockValue
(
blockId
,
dataList
);
synchronized
(
obj
){
log
.
info
(
"开始查询"
+
whereClause
.
get
(
"tableName"
)
+
",数据条数:"
+
dataList
.
size
()
+
",查询条件:"
+
whereClause
);
BlockValue
blockValue
=
new
BlockValue
(
blockId
,
dataList
);
synchronized
(
obj
){
list
.
add
(
blockValue
);
}
}
catch
(
Exception
e
){
log
.
error
(
e
.
getMessage
(),
e
);
}
finally
{
}
catch
(
Exception
e
){
log
.
error
(
e
.
getMessage
(),
e
);
}
finally
{
latch
.
countDown
();
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment