Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
e8449fa1
Commit
e8449fa1
authored
Dec 16, 2021
by
helinlin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
50cc60f1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
33 additions
and
40 deletions
+33
-40
ControllerAop.java
...a/com/yeejoin/amos/boot/biz/common/aop/ControllerAop.java
+9
-8
AddResourceHandlersConfig.java
...yeejoin/equipmanage/config/AddResourceHandlersConfig.java
+2
-2
FasApplicationConfig.java
...yeejoin/amos/fas/core/framework/FasApplicationConfig.java
+6
-6
PatrolApplicationConfig.java
.../latentdanger/core/framework/PatrolApplicationConfig.java
+4
-6
PatrolApplicationConfig.java
...s/maintenance/core/framework/PatrolApplicationConfig.java
+4
-6
PatrolApplicationConfig.java
...n/amos/patrol/core/framework/PatrolApplicationConfig.java
+4
-6
PatrolApplicationConfig.java
...s/supervision/core/framework/PatrolApplicationConfig.java
+4
-6
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/aop/ControllerAop.java
View file @
e8449fa1
...
...
@@ -37,6 +37,7 @@ import java.util.Map;
/**
* controller层切面 用于用户数据缓存 供 sql自动填充使用
* (使用粒度过大的Aop会创建大量代理对象,影响性能,占用内存,考虑使用 WebMvcConfigurer#addInterceptors 添加拦截器 )
*
* @author Admin
*/
...
...
@@ -54,9 +55,9 @@ public class ControllerAop {
private
RedisUtils
redisUtils
;
@Pointcut
(
"(execution(public * com.yeejoin.amos.boot.module..*.biz.controller..*(..))"
+
"|| execution(public * com.yeejoin.amos.*.business.controller..*(..))"
+
" && !@annotation(org.springframework.scheduling.annotation.Scheduled))"
+
"|| execution(public * com.yeejoin.equipmanage.controller..*.*(..))"
)
+
"|| execution(public * com.yeejoin.amos.*.business.controller..*(..))"
+
" && !@annotation(org.springframework.scheduling.annotation.Scheduled))"
+
"|| execution(public * com.yeejoin.equipmanage.controller..*.*(..))"
)
public
void
userCache
()
{
}
...
...
@@ -69,8 +70,8 @@ public class ControllerAop {
String
[]
url
=
new
String
[]{
"/api/user/selectInfo"
,
"/api/user/save/curCompany"
,
"/jcs/command/lookHtmlText"
,
"/jcs/common/duty-person/findByDutyAreaId"
,
"/tzs/wechatBack"
,
"/tzs/elevator/getElevatorInfo"
};
// 获取请求路径
for
(
String
uri
:
url
)
{
if
(
request
.
getRequestURI
().
indexOf
(
uri
)
!=
-
1
)
{
for
(
String
uri
:
url
)
{
if
(
request
.
getRequestURI
().
indexOf
(
uri
)
!=
-
1
)
{
return
;
}
}
...
...
@@ -118,10 +119,10 @@ public class ControllerAop {
CompanyBo
company
=
new
CompanyBo
();
DepartmentBo
department
=
new
DepartmentBo
();
RoleBo
role
=
new
RoleBo
();
CompanyModel
companyM
=
user
.
getCompanys
()
!=
null
?
user
.
getCompanys
().
get
(
0
)
:
null
;
CompanyModel
companyM
=
user
.
getCompanys
()
!=
null
?
user
.
getCompanys
().
get
(
0
)
:
null
;
Bean
.
copyExistPropertis
(
companyM
,
company
);
Map
<
Long
,
List
<
DepartmentModel
>>
mapDepartments
=
user
.
getCompanyDepartments
();
DepartmentModel
departmentM
=
companyM
!=
null
?
mapDepartments
.
get
(
companyM
.
getSequenceNbr
()).
get
(
0
)
:
null
;
DepartmentModel
departmentM
=
companyM
!=
null
?
mapDepartments
.
get
(
companyM
.
getSequenceNbr
()).
get
(
0
)
:
null
;
Bean
.
copyExistPropertis
(
departmentM
,
department
);
Map
<
Long
,
List
<
RoleModel
>>
roles
=
user
.
getOrgRoles
();
Long
sequenceNbr
;
...
...
@@ -132,7 +133,7 @@ public class ControllerAop {
}
RoleModel
roleM
=
null
;
if
(
sequenceNbr
==
null
)
{
roleM
=
companyM
!=
null
?
roles
.
get
(
companyM
.
getSequenceNbr
()).
get
(
0
)
:
null
;
roleM
=
companyM
!=
null
?
roles
.
get
(
companyM
.
getSequenceNbr
()).
get
(
0
)
:
null
;
}
else
{
roleM
=
roles
.
get
(
sequenceNbr
).
get
(
0
);
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/config/AddResourceHandlersConfig.java
View file @
e8449fa1
...
...
@@ -3,10 +3,10 @@ package com.yeejoin.equipmanage.config;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
Adapter
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
@Configuration
public
class
AddResourceHandlersConfig
extends
WebMvcConfigurerAdapt
er
{
public
class
AddResourceHandlersConfig
implements
WebMvcConfigur
er
{
@Override
public
void
addResourceHandlers
(
ResourceHandlerRegistry
registry
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-fas-biz/src/main/java/com/yeejoin/amos/fas/core/framework/FasApplicationConfig.java
View file @
e8449fa1
package
com
.
yeejoin
.
amos
.
fas
.
core
.
framework
;
import
java.io.File
;
import
com.yeejoin.amos.fas.business.constants.FasConstant
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
import
java.io.File
;
import
com.yeejoin.amos.fas.business.constants.FasConstant
;
;
;
@Configuration
public
class
FasApplicationConfig
extends
WebMvcConfigurerAdapter
{
public
class
FasApplicationConfig
implements
WebMvcConfigurer
{
@Value
(
"${windows.img.path}"
)
private
String
winImgPath
;
...
...
@@ -27,6 +28,5 @@ public class FasApplicationConfig extends WebMvcConfigurerAdapter{
}
registry
.
addResourceHandler
(
"/upload/**"
).
addResourceLocations
(
"file:"
+
localPath
.
trim
()+
FasConstant
.
UPLOAD_ROOT_PATH
+
File
.
separator
);
// registry.addResourceHandler("/upload/video/**").addResourceLocations("file:G:/upload/video/");
super
.
addResourceHandlers
(
registry
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-latentdanger-biz/src/main/java/com/yeejoin/amos/latentdanger/core/framework/PatrolApplicationConfig.java
View file @
e8449fa1
package
com
.
yeejoin
.
amos
.
latentdanger
.
core
.
framework
;
import
java.io.File
;
import
com.yeejoin.amos.latentdanger.business.constants.Constants
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
Adapter
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
import
com.yeejoin.amos.latentdanger.business.constants.Constants
;
import
java.io.File
;
@Configuration
public
class
PatrolApplicationConfig
extends
WebMvcConfigurerAdapter
{
public
class
PatrolApplicationConfig
implements
WebMvcConfigurer
{
@Value
(
"${windows.img.path}"
)
private
String
winImgPath
;
...
...
@@ -27,6 +26,5 @@ public class PatrolApplicationConfig extends WebMvcConfigurerAdapter{
}
registry
.
addResourceHandler
(
"/upload/**"
).
addResourceLocations
(
"file:"
+
localPath
.
trim
()+
Constants
.
UPLOAD_ROOT_PATH
+
File
.
separator
);
// registry.addResourceHandler("/upload/video/**").addResourceLocations("file:G:/upload/video/");
super
.
addResourceHandlers
(
registry
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/core/framework/PatrolApplicationConfig.java
View file @
e8449fa1
package
com
.
yeejoin
.
amos
.
maintenance
.
core
.
framework
;
import
java.io.File
;
import
com.yeejoin.amos.maintenance.business.constants.XJConstant
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
Adapter
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
import
com.yeejoin.amos.maintenance.business.constants.XJConstant
;
import
java.io.File
;
@Configuration
public
class
PatrolApplicationConfig
extends
WebMvcConfigurerAdapter
{
public
class
PatrolApplicationConfig
implements
WebMvcConfigurer
{
@Value
(
"${windows.img.path}"
)
private
String
winImgPath
;
...
...
@@ -27,6 +26,5 @@ public class PatrolApplicationConfig extends WebMvcConfigurerAdapter{
}
registry
.
addResourceHandler
(
"/upload/**"
).
addResourceLocations
(
"file:"
+
localPath
.
trim
()+
XJConstant
.
UPLOAD_ROOT_PATH
+
File
.
separator
);
// registry.addResourceHandler("/upload/video/**").addResourceLocations("file:G:/upload/video/");
super
.
addResourceHandlers
(
registry
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/core/framework/PatrolApplicationConfig.java
View file @
e8449fa1
package
com
.
yeejoin
.
amos
.
patrol
.
core
.
framework
;
import
java.io.File
;
import
com.yeejoin.amos.patrol.business.constants.XJConstant
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
Adapter
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
import
com.yeejoin.amos.patrol.business.constants.XJConstant
;
import
java.io.File
;
@Configuration
public
class
PatrolApplicationConfig
extends
WebMvcConfigurerAdapter
{
public
class
PatrolApplicationConfig
implements
WebMvcConfigurer
{
@Value
(
"${windows.img.path}"
)
private
String
winImgPath
;
...
...
@@ -27,6 +26,5 @@ public class PatrolApplicationConfig extends WebMvcConfigurerAdapter{
}
registry
.
addResourceHandler
(
"/upload/**"
).
addResourceLocations
(
"file:"
+
localPath
.
trim
()+
XJConstant
.
UPLOAD_ROOT_PATH
+
File
.
separator
);
// registry.addResourceHandler("/upload/video/**").addResourceLocations("file:G:/upload/video/");
super
.
addResourceHandlers
(
registry
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/core/framework/PatrolApplicationConfig.java
View file @
e8449fa1
package
com
.
yeejoin
.
amos
.
supervision
.
core
.
framework
;
import
java.io.File
;
import
com.yeejoin.amos.supervision.business.constants.XJConstant
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
Adapter
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
import
com.yeejoin.amos.supervision.business.constants.XJConstant
;
import
java.io.File
;
@Configuration
public
class
PatrolApplicationConfig
extends
WebMvcConfigurerAdapter
{
public
class
PatrolApplicationConfig
implements
WebMvcConfigurer
{
@Value
(
"${windows.img.path}"
)
private
String
winImgPath
;
...
...
@@ -27,6 +26,5 @@ public class PatrolApplicationConfig extends WebMvcConfigurerAdapter{
}
registry
.
addResourceHandler
(
"/upload/**"
).
addResourceLocations
(
"file:"
+
localPath
.
trim
()+
XJConstant
.
UPLOAD_ROOT_PATH
+
File
.
separator
);
// registry.addResourceHandler("/upload/video/**").addResourceLocations("file:G:/upload/video/");
super
.
addResourceHandlers
(
registry
);
}
}
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