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
b55ed9da
Commit
b55ed9da
authored
Oct 30, 2019
by
Suvalue
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://192.168.18.110:8880/bsoft/sv-springboot
into dev
parents
47148483
ef3b2855
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
280 additions
and
140 deletions
+280
-140
bsoft-api/pom.xml
+4
-0
bsoft-api/src/main/java/com/bsoft/api/BsoftApiApplication.java
+2
-0
bsoft-api/src/main/java/com/bsoft/api/common/Result.java
+6
-4
bsoft-api/src/main/java/com/bsoft/api/common/exceptions/DBConfigurationError.java
+7
-0
bsoft-api/src/main/java/com/bsoft/api/common/handlers/GlobalExceptionHandler.java
+40
-1
bsoft-api/src/main/java/com/bsoft/api/controller/BlockValuesController.java
+5
-9
bsoft-api/src/main/java/com/bsoft/api/controller/LoginController.java
+7
-1
bsoft-api/src/main/java/com/bsoft/api/controller/UserController.java
+2
-2
bsoft-api/src/main/java/com/bsoft/api/mapper/SerPageBlockRsMapper.java
+2
-1
bsoft-api/src/main/java/com/bsoft/api/mapper/SerPageMapper.java
+5
-0
bsoft-api/src/main/java/com/bsoft/api/model/SysUser.java
+1
-1
bsoft-api/src/main/java/com/bsoft/api/model/reqmodel/BlockValues.java
+8
-12
bsoft-api/src/main/java/com/bsoft/api/service/AsynBlockValuesService.java
+10
-0
bsoft-api/src/main/java/com/bsoft/api/service/BlockValuesService.java
+1
-1
bsoft-api/src/main/java/com/bsoft/api/service/Impl/AsynBlockValuesServiceImpl.java
+41
-0
bsoft-api/src/main/java/com/bsoft/api/service/Impl/BlockValuesServiceImpl.java
+67
-54
bsoft-api/src/main/java/com/bsoft/api/service/LoginService.java
+1
-1
bsoft-api/src/main/resources/application.properties
+7
-2
bsoft-api/src/main/resources/mapper/SerPageMapper.xml
+62
-37
bsoft-tools/nginx/nginx.conf
+2
-14
No files found.
bsoft-api/pom.xml
View file @
b55ed9da
...
...
@@ -80,6 +80,10 @@
相当于compile,但是打包阶段做了exclude操作-->
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-aop
</artifactId>
</dependency>
</dependencies>
<build>
...
...
bsoft-api/src/main/java/com/bsoft/api/BsoftApiApplication.java
View file @
b55ed9da
...
...
@@ -4,7 +4,9 @@ import org.mybatis.spring.annotation.MapperScan;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.scheduling.annotation.EnableAsync
;
@EnableAsync
@SpringBootApplication
@MapperScan
(
"com.bsoft.api.mapper"
)
@ComponentScan
(
basePackages
=
{
"com.bsoft.common.config"
,
"com.bsoft.api"
})
...
...
bsoft-api/src/main/java/com/bsoft/api/common/Result.java
View file @
b55ed9da
package
com
.
bsoft
.
api
.
common
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* 请求统一返回结果
*/
@ApiModel
(
description
=
"接口结果"
)
public
class
Result
<
T
>
{
@ApiModelProperty
(
"
code
"
)
@ApiModelProperty
(
"
错误编码
"
)
private
int
code
;
@ApiModelProperty
(
"错误信息"
)
private
String
msg
;
@ApiModelProperty
(
"返回的数据"
)
@ApiModelProperty
(
value
=
"返回的数据"
)
private
T
data
;
private
Result
(
int
code
,
String
msg
,
T
data
)
{
...
...
@@ -52,7 +54,7 @@ public class Result<T> {
this
.
data
=
data
;
}
public
static
Result
success
(
Object
data
){
public
static
<
T
>
Result
<
T
>
success
(
T
data
){
return
new
Result
(
ErrorCode
.
SUCCESS
.
getCode
(),
ErrorCode
.
SUCCESS
.
getEnMessage
(),
data
);
}
...
...
bsoft-api/src/main/java/com/bsoft/api/common/exceptions/DBConfigurationError.java
0 → 100644
View file @
b55ed9da
package
com
.
bsoft
.
api
.
common
.
exceptions
;
public
class
DBConfigurationError
extends
ExceptionBase
{
public
DBConfigurationError
(
String
message
){
super
(
message
);
}
}
bsoft-api/src/main/java/com/bsoft/api/common/handlers/GlobalExceptionHandler.java
View file @
b55ed9da
package
com
.
bsoft
.
api
.
common
.
handlers
;
import
com.bsoft.api.common.Result
;
import
com.bsoft.api.common.exceptions.DBConfigurationError
;
import
com.bsoft.api.common.exceptions.ExceptionBase
;
import
com.bsoft.api.common.exceptions.InvalidTokenException
;
import
com.bsoft.common.utils.HttpUtil
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.web.bind.annotation.ControllerAdvice
;
...
...
@@ -25,9 +29,44 @@ public class GlobalExceptionHandler {
@ExceptionHandler
(
Exception
.
class
)
@ResponseBody
public
Object
defaultErrorHandler
(
HttpServletRequest
request
,
Exception
e
){
log
.
error
(
"未知异常:"
+
e
.
getMessage
(),
e
.
getStackTrace
());
String
url
=
HttpUtil
.
getIP
(
request
);
log
.
error
(
url
+
"请求未知异常:"
+
e
.
getMessage
(),
e
.
getStackTrace
());
return
Result
.
error
();
}
/**
* 其他内部异常
* @param request
* @param e
* @return
*/
@ExceptionHandler
(
ExceptionBase
.
class
)
@ResponseBody
public
Object
BaseErrorHandler
(
HttpServletRequest
request
,
Exception
e
){
String
url
=
HttpUtil
.
getIP
(
request
);
log
.
error
(
url
+
"请求未知异常:"
+
e
.
getMessage
(),
e
.
getStackTrace
());
return
Result
.
error
();
}
@ExceptionHandler
(
DBConfigurationError
.
class
)
@ResponseBody
public
Object
DBConfigurationErrorHandler
(
HttpServletRequest
request
,
Exception
e
){
String
url
=
HttpUtil
.
getIP
(
request
);
log
.
error
(
url
+
"请求未知异常:"
+
e
.
getMessage
(),
e
.
getStackTrace
());
return
Result
.
error
(
400
,
e
.
getMessage
());
}
/**
* 无效token
* @param request
* @param e
* @return
*/
@ExceptionHandler
(
InvalidTokenException
.
class
)
@ResponseBody
public
Object
InvalidTokenExceptionHandler
(
HttpServletRequest
request
,
Exception
e
){
String
url
=
HttpUtil
.
getIP
(
request
);
log
.
error
(
url
+
"请求未知异常:"
+
e
.
getMessage
(),
e
.
getStackTrace
());
return
Result
.
error
(
Result
.
ErrorCode
.
INVALID_TOKEN
);
}
}
bsoft-api/src/main/java/com/bsoft/api/controller/BlockValuesController.java
View file @
b55ed9da
...
...
@@ -2,19 +2,14 @@ package com.bsoft.api.controller;
import
com.bsoft.api.common.Result
;
import
com.bsoft.api.common.annotations.Token
;
import
com.bsoft.api.common.base.RequestResult
;
import
com.bsoft.api.mapper.BlockValuesMapper
;
import
com.bsoft.api.model.requmodel.BlockValues
;
import
com.bsoft.api.model.reqmodel.BlockValues
;
import
com.bsoft.api.service.BlockValuesService
;
import
com.bsoft.api.service.Impl.BlockValuesServiceImpl
;
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.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
springfox.documentation.annotations.ApiIgnore
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -35,10 +30,10 @@ public class BlockValuesController {
@GetMapping
(
"blockValues"
)
@Token
@ApiOperation
(
"根据Page查询板块数值"
)
public
Object
getBlockValuesByPageID
(
@RequestBody
BlockValues
blockValues
){
public
Object
getBlockValuesByPageID
(
@RequestBody
BlockValues
blockValues
)
throws
InterruptedException
{
List
<
Map
<
String
,
Object
>>
list
=
blockValuesService
.
getBlockValuesByPage
ID
(
blockValues
.
getPageId
(),
blockValues
.
getDiseas
e
(),
blockValues
.
getDoctor
(),
blockValues
.
getDepartment
(),
blockValues
.
getTime
());
List
<
Map
<
String
,
Object
>>
list
=
blockValuesService
.
getBlockValuesByPage
Code
(
blockValues
.
getPageCod
e
(),
blockValues
.
getD
isease
(),
blockValues
.
getD
octor
(),
blockValues
.
getDepartment
(),
blockValues
.
getTime
());
return
Result
.
success
(
list
);
}
}
\ No newline at end of file
bsoft-api/src/main/java/com/bsoft/api/controller/LoginController.java
View file @
b55ed9da
...
...
@@ -19,8 +19,14 @@ public class LoginController {
@Autowired
private
LoginService
loginServiceImpl
;
/**
*
* @param codeAndPwd
* @param request
* @return
*/
@PostMapping
(
"login"
)
@ApiOperation
(
"
登录"
)
@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
(
...
...
bsoft-api/src/main/java/com/bsoft/api/controller/UserController.java
View file @
b55ed9da
...
...
@@ -42,7 +42,7 @@ public class UserController {
* @return
*/
@GetMapping
(
"roles"
)
@Token
//
@Token
@ApiOperation
(
"查询用户角色"
)
public
Object
getRoleListByUser
(
@ApiIgnore@CurrentUser
Long
userId
)
throws
Exception
{
List
<
SysRole
>
list
=
sysUserRoleRsService
.
getRoleListByUser
(
userId
);
...
...
@@ -55,7 +55,7 @@ public class UserController {
* @return
*/
@GetMapping
(
"menus"
)
@Token
//
@Token
@ApiOperation
(
"查询用户菜单"
)
public
Object
getMenuByUser
(
@ApiIgnore@CurrentUser
Long
userId
)
throws
Exception
{
return
Result
.
success
(
sysMenuService
.
getMenu
(
userId
));
...
...
bsoft-api/src/main/java/com/bsoft/api/mapper/SerPageBlockRsMapper.java
View file @
b55ed9da
...
...
@@ -16,5 +16,5 @@ public interface SerPageBlockRsMapper {
int
updateByPrimaryKey
(
SerPageBlockRs
record
);
List
<
SerPageBlockRs
>
selectByPageId
(
Integer
pageID
);
List
<
SerPageBlockRs
>
selectByPageId
(
Long
pageID
);
}
\ No newline at end of file
bsoft-api/src/main/java/com/bsoft/api/mapper/SerPageMapper.java
View file @
b55ed9da
package
com
.
bsoft
.
api
.
mapper
;
import
com.bsoft.api.model.SerPage
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
public
interface
SerPageMapper
{
...
...
@@ -13,4 +15,6 @@ public interface SerPageMapper {
List
<
SerPage
>
selectAll
();
int
updateByPrimaryKey
(
SerPage
record
);
List
<
SerPage
>
selectByCodeAndDim
(
@Param
(
"pageCode"
)
Integer
pageCode
,
@Param
(
"inField"
)
String
inField
,
@Param
(
"dimCount"
)
int
dimCount
);
}
\ No newline at end of file
bsoft-api/src/main/java/com/bsoft/api/model/SysUser.java
View file @
b55ed9da
...
...
@@ -5,7 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import
java.util.Date
;
@ApiModel
(
"用户信息"
)
@ApiModel
(
description
=
"用户信息"
)
public
class
SysUser
{
/**
*
...
...
bsoft-api/src/main/java/com/bsoft/api/model/req
u
model/BlockValues.java
→
bsoft-api/src/main/java/com/bsoft/api/model/reqmodel/BlockValues.java
View file @
b55ed9da
package
com
.
bsoft
.
api
.
model
.
req
u
model
;
package
com
.
bsoft
.
api
.
model
.
reqmodel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.util.Date
;
@ApiModel
(
"调用blockValues请求的数据"
)
@ApiModel
(
description
=
"调用blockValues请求的数据"
)
public
class
BlockValues
{
public
Integer
getPage
Id
()
{
return
page
Id
;
public
Integer
getPage
Code
()
{
return
page
Code
;
}
public
void
setPage
Id
(
Integer
pageId
)
{
this
.
page
Id
=
pageId
;
public
void
setPage
Code
(
Integer
pageCode
)
{
this
.
page
Code
=
pageCode
;
}
public
Integer
getDisease
()
{
...
...
@@ -49,10 +47,8 @@ public class BlockValues {
this
.
time
=
time
;
}
@ApiModelProperty
(
value
=
"pageID"
,
required
=
true
)
private
Integer
pageId
;
@ApiModelProperty
(
value
=
"pageCode"
,
required
=
true
)
private
Integer
pageCode
;
@ApiModelProperty
(
"病组"
)
private
Integer
disease
;
@ApiModelProperty
(
"科室"
)
...
...
bsoft-api/src/main/java/com/bsoft/api/service/AsynBlockValuesService.java
0 → 100644
View file @
b55ed9da
package
com
.
bsoft
.
api
.
service
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.CountDownLatch
;
public
interface
AsynBlockValuesService
{
void
getBlockValues
(
List
<
Map
<
String
,
Object
>>
list
,
String
blockId
,
String
tableName
,
String
whereClause
,
CountDownLatch
latch
);
}
bsoft-api/src/main/java/com/bsoft/api/service/BlockValuesService.java
View file @
b55ed9da
...
...
@@ -4,5 +4,5 @@ import java.util.List;
import
java.util.Map
;
public
interface
BlockValuesService
{
List
<
Map
<
String
,
Object
>>
getBlockValuesByPage
ID
(
Integer
pageId
,
Integer
disease
,
Integer
doctor
,
Integer
department
,
Integer
time
)
;
List
<
Map
<
String
,
Object
>>
getBlockValuesByPage
Code
(
Integer
pageId
,
Integer
disease
,
Integer
doctor
,
Integer
department
,
Integer
time
)
throws
InterruptedException
;
}
bsoft-api/src/main/java/com/bsoft/api/service/Impl/AsynBlockValuesServiceImpl.java
0 → 100644
View file @
b55ed9da
package
com
.
bsoft
.
api
.
service
.
Impl
;
import
com.bsoft.api.mapper.BlockValuesMapper
;
import
com.bsoft.api.service.AsynBlockValuesService
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.CountDownLatch
;
@Service
public
class
AsynBlockValuesServiceImpl
implements
AsynBlockValuesService
{
private
final
static
Object
obj
=
new
Object
();
@Resource
private
BlockValuesMapper
blockValuesMapper
;
@Async
@Override
public
void
getBlockValues
(
List
<
Map
<
String
,
Object
>>
list
,
String
blockId
,
String
tableName
,
String
whereClause
,
CountDownLatch
latch
)
{
System
.
out
.
println
(
"开始"
+
tableName
);
List
<
Map
<
String
,
Object
>>
dataList
=
blockValuesMapper
.
selectByWhere
(
tableName
,
whereClause
);
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>(){
{
put
(
blockId
,
dataList
);
}
};
synchronized
(
obj
){
list
.
add
(
map
);
}
System
.
out
.
println
(
"结束"
+
tableName
);
latch
.
countDown
();
}
}
bsoft-api/src/main/java/com/bsoft/api/service/Impl/BlockValuesServiceImpl.java
View file @
b55ed9da
package
com
.
bsoft
.
api
.
service
.
Impl
;
import
com.bsoft.api.common.exceptions.DBConfigurationError
;
import
com.bsoft.api.mapper.BlockValuesMapper
;
import
com.bsoft.api.mapper.DicDimMapper
;
import
com.bsoft.api.mapper.SerPageBlockRsMapper
;
import
com.bsoft.api.mapper.SerPageMapper
;
import
com.bsoft.api.model.DicDim
;
import
com.bsoft.api.model.SerPage
;
import
com.bsoft.api.model.SerPageBlockRs
;
import
com.bsoft.api.service.AsynBlockValuesService
;
import
com.bsoft.api.service.BlockValuesService
;
import
org.apache.ibatis.binding.MapperMethod
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.scheduling.annotation.AsyncResult
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
...
...
@@ -15,72 +21,79 @@ import java.util.ArrayList;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.CountDownLatch
;
import
java.util.concurrent.ExecutionException
;
import
java.util.concurrent.Future
;
@Service
public
class
BlockValuesServiceImpl
implements
BlockValuesService
{
@Resource
private
SerPageBlockRsMapper
serPageBlockRsMapper
;
@Resource
private
DicDimMapper
dicDim
Mapper
;
private
SerPageMapper
serPage
Mapper
;
@Resource
private
BlockValuesMapper
blockValuesMapper
;
private
AsynBlockValuesService
asynBlockValuesServiceImpl
;
@Override
public
List
<
Map
<
String
,
Object
>>
getBlockValuesByPageID
(
Integer
pageId
,
Integer
disease
,
Integer
doctor
,
Integer
department
,
Integer
time
){
Boolean
isDisease
=
false
;
Boolean
isDoctor
=
false
;
Boolean
isDepartment
=
false
;
Boolean
isTime
=
false
;
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<>();
//根据pageId查询所有板块
List
<
SerPageBlockRs
>
pageBlocklist
=
serPageBlockRsMapper
.
selectByPageId
(
pageId
);
//根据pageId查询所有维度
List
<
DicDim
>
dimList
=
dicDimMapper
.
selectByPageid
(
pageId
);
//循环获取需要添加的维度查询条件
for
(
DicDim
data
:
dimList
)
{
if
(
data
.
getDimField
().
equalsIgnoreCase
(
"disease"
)){
isDisease
=
true
;
}
if
(
data
.
getDimField
().
equalsIgnoreCase
(
"doctor"
)){
isDoctor
=
true
;
}
if
(
data
.
getDimField
().
equalsIgnoreCase
(
"department"
)){
isDepartment
=
true
;
}
if
(
data
.
getDimField
().
equalsIgnoreCase
(
"time"
)){
isTime
=
true
;
}
}
//循环获取数据
for
(
SerPageBlockRs
data
:
pageBlocklist
)
{
//获取表名
String
tableName
=
"VAL_BLOCK_VALUES_"
+
data
.
getBlockId
();
@Override
public
List
<
Map
<
String
,
Object
>>
getBlockValuesByPageCode
(
Integer
pageCode
,
Integer
disease
,
Integer
doctor
,
Integer
department
,
Integer
time
)
throws
InterruptedException
{
/**
* 1.根据pageCode,disease,doctor,department,time查询所有对应的pageId
* 查询要求为pageCode为当前pageCode,相同pageId的所有数据有且仅有DIM_ID为
* disease,doctor,department,time中不为null的对应id
* 2.根据pageId获取所有block
* 3.根据block拼接表名及where语句
*/
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<>();
String
whereSql
=
"where 1=1"
;
int
count
=
0
;
String
inField
=
""
;
String
whereClause
=
"where 1=1"
;
if
(
disease
!=
null
){
whereClause
+=
String
.
format
(
" and disease='%s'"
,
disease
);
inField
+=
"'disease',"
;
count
++;
}
if
(
doctor
!=
null
)
{
whereClause
+=
String
.
format
(
" and doctor='%s'"
,
doctor
);
inField
+=
"'doctor',"
;
count
++;
}
if
(
department
!=
null
)
{
whereClause
+=
String
.
format
(
" and department='%s'"
,
department
);
inField
+=
"'department',"
;
count
++;
}
if
(
time
!=
null
)
{
whereClause
+=
String
.
format
(
" and time='%s'"
,
time
);
inField
+=
"'time',"
;
count
++;
}
if
(
count
>
0
){
inField
=
inField
.
substring
(
0
,
inField
.
length
()-
1
);
}
//添加查询条件
if
(
disease
!=
null
&&
isDisease
){
whereSql
+=
String
.
format
(
" and disease='%s'"
,
disease
);
}
if
(
doctor
!=
null
&&
isDoctor
){
whereSql
+=
String
.
format
(
" and doctor='%s'"
,
doctor
);
}
if
(
department
!=
null
&&
isDepartment
){
whereSql
+=
String
.
format
(
" and department='%s'"
,
department
);
}
if
(
time
!=
null
&&
isTime
){
whereSql
+=
String
.
format
(
" and time='%s'"
,
time
);
}
List
<
Map
<
String
,
Object
>>
dataList
=
blockValuesMapper
.
selectByWhere
(
tableName
,
whereSql
);
list
.
add
(
new
HashMap
<
String
,
Object
>(){
{
put
(
data
.
getBlockId
().
toString
(),
dataList
);
}
});
}
return
list
;
List
<
SerPage
>
pageList
=
serPageMapper
.
selectByCodeAndDim
(
pageCode
,
inField
,
count
);
if
(
pageList
.
size
()
==
0
){
throw
new
DBConfigurationError
(
"页面维度配置表错误,请联系管理员"
);
}
SerPage
page
=
pageList
.
get
(
0
);
//根据pageId查询所有板块
List
<
SerPageBlockRs
>
pageBlocklist
=
serPageBlockRsMapper
.
selectByPageId
(
page
.
getId
());
//循环获取数据
CountDownLatch
latch
=
new
CountDownLatch
(
pageBlocklist
.
size
());
for
(
SerPageBlockRs
data
:
pageBlocklist
)
{
//获取表名
String
blockId
=
data
.
getBlockId
().
toString
();
String
tableName
=
"VAL_BLOCK_VALUES_"
+
blockId
;
asynBlockValuesServiceImpl
.
getBlockValues
(
list
,
blockId
,
tableName
,
whereClause
,
latch
);
}
latch
.
await
();
return
list
;
}
}
bsoft-api/src/main/java/com/bsoft/api/service/LoginService.java
View file @
b55ed9da
...
...
@@ -11,7 +11,7 @@ public interface LoginService {
String
refreshToken
(
String
oldToken
);
@ApiModel
(
"登录信息"
)
@ApiModel
(
description
=
"登录信息"
)
class
LoginInfo
{
@ApiModelProperty
(
"token"
)
private
String
token
;
...
...
bsoft-api/src/main/resources/application.properties
View file @
b55ed9da
...
...
@@ -8,4 +8,9 @@ mybatis.type-aliases-package=com.bsoft.api.model
config.path.include[0]=/token
config.path.include[1]=/user/**
config.path.exclude[0]=/login
\ No newline at end of file
config.path.exclude[0]=/login
# Add @EnableAspectJAutoProxy.
spring.aop.auto
=
true
# Whether subclass-based (CGLIB) proxies are to be created (true)
spring.aop.proxy-target-class
=
false
\ No newline at end of file
bsoft-api/src/main/resources/mapper/SerPageMapper.xml
View file @
b55ed9da
<?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.api.mapper.SerPageMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.bsoft.api.model.SerPage"
>
<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=
"PAGE_CODE"
jdbcType=
"VARCHAR"
property=
"pageCode"
/>
<result
column=
"PAGE_NAME"
jdbcType=
"VARCHAR"
property=
"pageName"
/>
</resultMap>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
<resultMap
id=
"BaseResultMap"
type=
"com.bsoft.api.model.SerPage"
>
<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=
"PAGE_CODE"
jdbcType=
"VARCHAR"
property=
"pageCode"
/>
<result
column=
"PAGE_NAME"
jdbcType=
"VARCHAR"
property=
"pageName"
/>
</resultMap>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
delete from LL.SER_PAGE
where ID = #{id,jdbcType=DECIMAL}
</delete>
<insert
id=
"insert"
parameterType=
"com.bsoft.api.model.SerPage"
>
<selectKey
keyProperty=
"id"
order=
"AFTER"
resultType=
"java.lang.Long"
>
select SEQ_SER_PAGE_ID.nextval from dual
</selectKey>
insert into LL.SER_PAGE (CREATE_DATE, CREATE_USERID, STATE,
PAGE_CODE, PAGE_NAME)
values (#{createDate,jdbcType=TIMESTAMP}, #{createUserid,jdbcType=DECIMAL}, #{state,jdbcType=DECIMAL},
#{pageCode,jdbcType=VARCHAR}, #{pageName,jdbcType=VARCHAR})
</insert>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.bsoft.api.model.SerPage"
>
update LL.SER_PAGE
set CREATE_DATE = #{createDate,jdbcType=TIMESTAMP},
CREATE_USERID = #{createUserid,jdbcType=DECIMAL},
STATE = #{state,jdbcType=DECIMAL},
PAGE_CODE = #{pageCode,jdbcType=VARCHAR},
PAGE_NAME = #{pageName,jdbcType=VARCHAR}
where ID = #{id,jdbcType=DECIMAL}
</update>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Long"
resultMap=
"BaseResultMap"
>
select ID, CREATE_DATE, CREATE_USERID, STATE, PAGE_CODE, PAGE_NAME
from LL.SER_PAGE
where ID = #{id,jdbcType=DECIMAL}
</select>
<select
id=
"selectAll"
resultMap=
"BaseResultMap"
>
select ID, CREATE_DATE, CREATE_USERID, STATE, PAGE_CODE, PAGE_NAME
from LL.SER_PAGE
</select>
</delete>
<insert
id=
"insert"
parameterType=
"com.bsoft.api.model.SerPage"
>
<selectKey
keyProperty=
"id"
order=
"AFTER"
resultType=
"java.lang.Long"
>
select SEQ_SER_PAGE_ID.nextval from dual
</selectKey>
insert into LL.SER_PAGE (CREATE_DATE, CREATE_USERID, STATE,
PAGE_CODE, PAGE_NAME)
values (#{createDate,jdbcType=TIMESTAMP}, #{createUserid,jdbcType=DECIMAL}, #{state,jdbcType=DECIMAL},
#{pageCode,jdbcType=VARCHAR}, #{pageName,jdbcType=VARCHAR})
</insert>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.bsoft.api.model.SerPage"
>
update LL.SER_PAGE
set CREATE_DATE = #{createDate,jdbcType=TIMESTAMP},
CREATE_USERID = #{createUserid,jdbcType=DECIMAL},
STATE = #{state,jdbcType=DECIMAL},
PAGE_CODE = #{pageCode,jdbcType=VARCHAR},
PAGE_NAME = #{pageName,jdbcType=VARCHAR}
where ID = #{id,jdbcType=DECIMAL}
</update>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Long"
resultMap=
"BaseResultMap"
>
select ID, CREATE_DATE, CREATE_USERID, STATE, PAGE_CODE, PAGE_NAME
from LL.SER_PAGE
where ID = #{id,jdbcType=DECIMAL}
</select>
<select
id=
"selectAll"
resultMap=
"BaseResultMap"
>
select ID, CREATE_DATE, CREATE_USERID, STATE, PAGE_CODE, PAGE_NAME
from LL.SER_PAGE
</select>
<select
id=
"selectByCodeAndDim"
resultMap=
"BaseResultMap"
>
select d.* from SER_PAGE d,
<if
test=
"dimCount != 0"
>
(select a.id,COUNT(b.ID) count
from SER_PAGE a
LEFT JOIN ser_page_dim_rs b on a.id = b.PAGE_ID and b.state = 1
LEFT JOIN DIC_DIM c on c.ID = b.DIM_ID
where a.state =1 and a.PAGE_CODE = #{pageCode,jdbcType=VARCHAR}
and c.DIM_FIELD in (${inField})
GROUP BY a.ID) e,
</if>
(select a.id,COUNT(b.ID) count
from SER_PAGE a
LEFT JOIN ser_page_dim_rs b on a.id = b.PAGE_ID and b.state = 1
LEFT JOIN DIC_DIM c on c.ID = b.DIM_ID
where a.state =1 and a.PAGE_CODE = #{pageCode,jdbcType=VARCHAR}
GROUP BY a.ID) f
where d.id = f.id
<if
test=
"dimCount != 0"
>
and f.count = e.count
and d.Id = e.id
</if>
and f.count =#{dimCount,jdbcType=INTEGER}
</select>
</mapper>
\ No newline at end of file
bsoft-tools/nginx/nginx.conf
View file @
b55ed9da
...
...
@@ -13,20 +13,6 @@ http {
sendfile
on
;
keepalive_timeout
65
;
server
{
listen
80
;
server_name
localhost
;
location
/
{
root
html
;
index
index.html
index.htm
;
}
error_page
500
502
503
504
/50x.html
;
location
=
/50x.html
{
root
html
;
}
}
server
{
listen
8080
;
...
...
@@ -46,6 +32,8 @@ http {
add_header
'Access-Control-Allow-Methods'
'GET,POST'
;
# 获取请求的host
proxy_set_header
Host
$host
;
# 获取请求的port(为解决swagger调用接口用)
proxy_set_header
X-Forwarded-Port
83
;
# 获取请求的ip地址
proxy_set_header
X-Real-IP
$remote_addr
;
# 获取请求的多级ip地址,当请求经过多个反向代理时,会获取多个ip,英文逗号隔开
...
...
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