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
b026498d
Commit
b026498d
authored
Feb 02, 2024
by
李秀明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: 将warning相关代码从jxiop-analyse包移动到jxiop
parent
69c2c157
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
325 additions
and
17 deletions
+325
-17
application-dev.properties
...analyse-biz/src/main/resources/application-dev.properties
+0
-6
McbWarningMapper.java
...n/amos/boot/module/jxiop/api/mapper/McbWarningMapper.java
+1
-1
IMcbWarningService.java
...mos/boot/module/jxiop/api/service/IMcbWarningService.java
+1
-4
IPermissionService.java
...mos/boot/module/jxiop/api/service/IPermissionService.java
+9
-0
McbWarningMapper.xml
...pi/src/main/resources/mapper/warning/McbWarningMapper.xml
+1
-1
pom.xml
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/pom.xml
+2
-2
MabWarningDbConfig.java
...amos/boot/module/jxiop/biz/config/MabWarningDbConfig.java
+84
-0
McbWarningController.java
...oot/module/jxiop/biz/controller/McbWarningController.java
+127
-0
IPermissionServiceImpl.java
...module/jxiop/biz/service/impl/IPermissionServiceImpl.java
+92
-0
McbWarningServiceImpl.java
.../module/jxiop/biz/service/impl/McbWarningServiceImpl.java
+3
-3
application-dev.properties
...e-jxiop-biz/src/main/resources/application-dev.properties
+5
-0
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/application-dev.properties
View file @
b026498d
...
@@ -24,12 +24,6 @@ spring.db6.datasource.url=jdbc:mysql://139.9.173.44:3306/amos_project?allowMulti
...
@@ -24,12 +24,6 @@ spring.db6.datasource.url=jdbc:mysql://139.9.173.44:3306/amos_project?allowMulti
spring.db6.datasource.username
=
root
spring.db6.datasource.username
=
root
spring.db6.datasource.password
=
Yeejoin@2020
spring.db6.datasource.password
=
Yeejoin@2020
spring.db6.datasource.driver-class-name
:
com.mysql.cj.jdbc.Driver
spring.db6.datasource.driver-class-name
:
com.mysql.cj.jdbc.Driver
## amos_mcb
spring.db7.datasource.type
:
com.alibaba.druid.pool.DruidDataSource
spring.db7.datasource.url
=
jdbc:mysql://10.20.1.157:3306/amos_mcb?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull
spring.db7.datasource.username
=
root
spring.db7.datasource.password
=
Yeejoin@2020
spring.db7.datasource.driver-class-name
:
com.mysql.cj.jdbc.Driver
## eureka properties:
## eureka properties:
eureka.instance.hostname
=
139.9.173.44
eureka.instance.hostname
=
139.9.173.44
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-a
nalyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/mapper2
/McbWarningMapper.java
→
amos-boot-system-jxiop/amos-boot-module-jxiop-a
pi/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/mapper
/McbWarningMapper.java
View file @
b026498d
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
mapper2
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
api
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-a
nalyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz
/service/IMcbWarningService.java
→
amos-boot-system-jxiop/amos-boot-module-jxiop-a
pi/src/main/java/com/yeejoin/amos/boot/module/jxiop/api
/service/IMcbWarningService.java
View file @
b026498d
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
service
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
api
.
service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -88,6 +87,4 @@ public interface IMcbWarningService {
...
@@ -88,6 +87,4 @@ public interface IMcbWarningService {
*/
*/
Object
getQuestionRecordStatistic
(
Map
<
String
,
Object
>
map
);
Object
getQuestionRecordStatistic
(
Map
<
String
,
Object
>
map
);
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/service/IPermissionService.java
0 → 100644
View file @
b026498d
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
api
.
service
;
import
java.util.List
;
public
interface
IPermissionService
{
List
<
String
>
getCurrentUserPermissions
();
List
<
String
>
getCurrentUserProjectOrgCodes
();
}
amos-boot-system-jxiop/amos-boot-module-jxiop-a
nalyse-biz/src/main/resources/mapper/cluster
/McbWarningMapper.xml
→
amos-boot-system-jxiop/amos-boot-module-jxiop-a
pi/src/main/resources/mapper/warning
/McbWarningMapper.xml
View file @
b026498d
<?xml version="1.0" encoding="UTF-8"?>
<?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">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.boot.module.jxiop.
biz.mapper2
.McbWarningMapper"
>
<mapper
namespace=
"com.yeejoin.amos.boot.module.jxiop.
api.mapper
.McbWarningMapper"
>
<select
id=
"queryTodayCount"
resultType=
"java.util.Map"
>
<select
id=
"queryTodayCount"
resultType=
"java.util.Map"
>
SELECT
SELECT
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/pom.xml
View file @
b026498d
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
</properties>
</properties>
<dependencies>
<dependencies>
<!--
<!--
<dependency>
<dependency>
<groupId>com.amosframework.boot</groupId>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-ugp-api</artifactId>
<artifactId>amos-boot-module-ugp-api</artifactId>
...
@@ -54,7 +54,7 @@
...
@@ -54,7 +54,7 @@
<version>
5.7.22
</version>
<version>
5.7.22
</version>
</dependency>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
<plugins>
<plugins>
<plugin>
<plugin>
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/config/MabWarningDbConfig.java
0 → 100644
View file @
b026498d
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
config
;
import
com.alibaba.druid.pool.DruidDataSource
;
import
com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean
;
import
com.github.pagehelper.PageInterceptor
;
import
org.apache.ibatis.plugin.Interceptor
;
import
org.apache.ibatis.session.SqlSessionFactory
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.core.io.support.PathMatchingResourcePatternResolver
;
import
org.springframework.jdbc.datasource.DataSourceTransactionManager
;
import
javax.sql.DataSource
;
import
java.util.Properties
;
@Configuration
@MapperScan
(
basePackages
=
"com.yeejoin.amos.boot.module.jxiop.biz.mcbwarningmapper"
,
sqlSessionFactoryRef
=
"mcbWarningSqlSessionFactory"
)
public
class
MabWarningDbConfig
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
MabWarningDbConfig
.
class
);
// 精确到 master 目录,以便跟其他数据源隔离
private
static
final
String
MAPPER_LOCATION
=
"classpath*:mapper/warning/*.xml"
;
@Value
(
"${spring.db3.datasource.url}"
)
private
String
dbUrl
;
@Value
(
"${spring.db2.datasource.username}"
)
private
String
username
;
@Value
(
"${spring.db2.datasource.password}"
)
private
String
password
;
@Value
(
"${spring.db2.datasource.driver-class-name}"
)
private
String
driverClassName
;
@Bean
(
name
=
"mcbWarningDataSource"
)
//声明其为Bean实例
public
DataSource
masterDataSource
()
{
DruidDataSource
datasource
=
new
DruidDataSource
();
datasource
.
setUrl
(
this
.
dbUrl
);
datasource
.
setUsername
(
username
);
datasource
.
setPassword
(
password
);
datasource
.
setDriverClassName
(
driverClassName
);
return
datasource
;
}
@Bean
(
name
=
"mcbWarningTransactionManager"
)
public
DataSourceTransactionManager
masterTransactionManager
()
{
return
new
DataSourceTransactionManager
(
masterDataSource
());
}
@Bean
(
name
=
"mcbWarningSqlSessionFactory"
)
public
SqlSessionFactory
masterSqlSessionFactory
(
@Qualifier
(
"mcbWarningDataSource"
)
DataSource
masterDataSource
)
throws
Exception
{
final
MybatisSqlSessionFactoryBean
sessionFactory
=
new
MybatisSqlSessionFactoryBean
();
sessionFactory
.
setDataSource
(
masterDataSource
);
sessionFactory
.
setMapperLocations
(
new
PathMatchingResourcePatternResolver
()
.
getResources
(
MabWarningDbConfig
.
MAPPER_LOCATION
));
sessionFactory
.
setTypeAliasesPackage
(
"com.yeejoin.amos.boot.module.jxiop.biz.entity"
);
//mybatis 数据库字段与实体类属性驼峰映射配置
sessionFactory
.
getObject
().
getConfiguration
().
setMapUnderscoreToCamelCase
(
true
);
//分页插件
Interceptor
interceptor
=
new
PageInterceptor
();
Properties
properties
=
new
Properties
();
properties
.
setProperty
(
"helperDialect"
,
"mysql"
);
properties
.
setProperty
(
"offsetAsPageNum"
,
"true"
);
properties
.
setProperty
(
"rowBoundsWithCount"
,
"true"
);
properties
.
setProperty
(
"reasonable"
,
"true"
);
properties
.
setProperty
(
"supportMethodsArguments"
,
"true"
);
properties
.
setProperty
(
"params"
,
"pageNum=pageNum;pageSize=pageSize;"
);
interceptor
.
setProperties
(
properties
);
sessionFactory
.
setPlugins
(
interceptor
);
return
sessionFactory
.
getObject
();
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/McbWarningController.java
0 → 100644
View file @
b026498d
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
controller
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jxiop.api.service.IMcbWarningService
;
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.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
@RestController
@Api
(
tags
=
"McbWarning Controller"
)
@RequestMapping
(
value
=
"/warning"
)
public
class
McbWarningController
{
@Autowired
private
IMcbWarningService
mcbWarningService
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"[监测总览]今日预警-预警总数"
,
notes
=
"[监测总览]今日预警-预警总数"
)
@GetMapping
(
value
=
"/count/today"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
queryTodayCount
(
@RequestParam
(
value
=
"processingStatus"
,
required
=
false
)
Integer
processingStatus
)
{
return
ResponseHelper
.
buildResponse
(
mcbWarningService
.
queryTodayCount
(
processingStatus
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"[监测总览]近七日预警统计"
,
notes
=
"[监测总览]近七日预警统计"
)
@GetMapping
(
value
=
"/count/week"
)
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
queryWeekCount
()
{
return
ResponseHelper
.
buildResponse
(
mcbWarningService
.
queryWeekCount
());
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"[监测总览]预警信息列表"
,
notes
=
"[监测总览]预警信息列表"
)
@GetMapping
(
value
=
"/warning/page"
)
public
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
queryWarningPage
(
@RequestParam
(
value
=
"pageNumber"
,
defaultValue
=
"1"
)
Integer
pageNumber
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"20"
)
Integer
pageSize
,
@RequestParam
(
value
=
"processingStatus"
,
required
=
false
)
Integer
processingStatus
)
{
Page
<
Map
<
String
,
Object
>>
page
=
new
Page
<>(
pageNumber
,
pageSize
);
return
ResponseHelper
.
buildResponse
(
mcbWarningService
.
queryWarningPage
(
page
,
processingStatus
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"[监测总览]预警信息总数"
,
notes
=
"[监测总览]预警信息总数"
)
@GetMapping
(
value
=
"/warning/count"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
queryWarningCount
(
@RequestParam
(
value
=
"processingStatus"
,
required
=
false
)
Integer
processingStatus
)
{
Long
count
=
mcbWarningService
.
queryWarningCount
(
processingStatus
);
Map
<
String
,
Object
>
result
=
new
HashMap
<
String
,
Object
>()
{{
this
.
put
(
"count"
,
count
);
}};
return
ResponseHelper
.
buildResponse
(
result
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"[监测总览]问题列表"
,
notes
=
"[监测总览]问题列表"
)
@GetMapping
(
value
=
"/question/page"
)
public
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
queryQuestionList
(
@RequestParam
(
value
=
"pageNumber"
,
defaultValue
=
"1"
)
Integer
pageNumber
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"20"
)
Integer
pageSize
,
@RequestParam
(
value
=
"completionStatus"
,
required
=
false
)
Integer
completionStatus
)
{
Page
<
Map
<
String
,
Object
>>
page
=
new
Page
<>(
pageNumber
,
pageSize
);
return
ResponseHelper
.
buildResponse
(
mcbWarningService
.
queryQuestionPage
(
page
,
completionStatus
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"任务详情、问题记录左侧树"
,
notes
=
"任务详情、问题记录左侧树"
)
@GetMapping
(
value
=
"/warning-warning-info/tree"
)
public
ResponseModel
getWarnTree
(
@RequestParam
Map
<
String
,
Object
>
map
)
{
return
ResponseHelper
.
buildResponse
(
mcbWarningService
.
getWarnTree
(
map
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"任务详情分页列表"
,
notes
=
"任务详情分页列表"
)
@GetMapping
(
value
=
"/warning-warning-info/page"
)
public
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
getTaskDetailPage
(
@RequestParam
Map
<
String
,
Object
>
map
)
{
return
ResponseHelper
.
buildResponse
(
mcbWarningService
.
getTaskDetailPage
(
map
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"任务详情统计"
,
notes
=
"任务详情统计"
)
@GetMapping
(
value
=
"/warning-warning-info/statistics"
)
public
ResponseModel
getTaskDetailStatistic
(
@RequestParam
Map
<
String
,
Object
>
map
)
{
return
ResponseHelper
.
buildResponse
(
mcbWarningService
.
getTaskDetailStatistic
(
map
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"问题记录分页列表"
,
notes
=
"问题记录分页列表"
)
@GetMapping
(
value
=
"/warning-question-info/questionPage"
)
public
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
getQuestionRecordPage
(
@RequestParam
Map
<
String
,
Object
>
map
)
{
return
ResponseHelper
.
buildResponse
(
mcbWarningService
.
getQuestionRecordPage
(
map
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"问题记录统计"
,
notes
=
"问题记录统计"
)
@GetMapping
(
value
=
"/warning-question-info/questionPageTopStatistics"
)
public
ResponseModel
getQuestionRecordStatistic
(
@RequestParam
Map
<
String
,
Object
>
map
)
{
return
ResponseHelper
.
buildResponse
(
mcbWarningService
.
getQuestionRecordStatistic
(
map
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"[监测总览]问题总数"
,
notes
=
"[监测总览]问题总数"
)
@GetMapping
(
value
=
"/question/count"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
queryQuestionCount
(
@RequestParam
(
value
=
"completionStatus"
,
required
=
false
)
Integer
completionStatus
)
{
Long
count
=
mcbWarningService
.
queryQuestionCount
(
completionStatus
);
Map
<
String
,
Object
>
result
=
new
HashMap
<
String
,
Object
>()
{{
this
.
put
(
"count"
,
count
);
}};
return
ResponseHelper
.
buildResponse
(
result
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"[监测总览]地图点位/路线"
,
notes
=
"[监测总览]地图点位/路线"
)
@GetMapping
(
value
=
"/map/routes"
)
public
ResponseModel
<
Object
>
queryMapRoutes
(
@RequestParam
(
value
=
"province"
,
required
=
false
)
String
province
)
{
return
ResponseHelper
.
buildResponse
(
mcbWarningService
.
queryMapRoutes
(
province
));
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/IPermissionServiceImpl.java
0 → 100644
View file @
b026498d
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper
;
import
com.yeejoin.amos.boot.module.jxiop.api.service.IPermissionService
;
import
com.yeejoin.amos.boot.module.jxiop.biz.amosprojectmapper.UserEmpowerMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.StdUserEmpower
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
@Service
public
class
IPermissionServiceImpl
implements
IPermissionService
{
@Autowired
private
RedisUtils
redisUtils
;
@Autowired
private
UserEmpowerMapper
userEmpowerMapper
;
@Autowired
private
StationBasicMapper
stationBasicMapper
;
@Override
public
List
<
String
>
getCurrentUserPermissions
()
{
List
<
String
>
result
=
new
ArrayList
<>();
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
String
userId
=
reginParams
.
getUserModel
().
getUserId
();
StdUserEmpower
stdUserEmpower
=
userEmpowerMapper
.
selectOne
(
new
QueryWrapper
<
StdUserEmpower
>().
eq
(
"amos_user_id"
,
userId
).
eq
(
"permission_type"
,
"YTH"
));
if
(
ObjectUtils
.
isEmpty
(
stdUserEmpower
))
{
return
null
;
}
else
{
String
permissionOrgCode
=
stdUserEmpower
.
getAmosOrgCode
().
get
(
0
);
Map
<
String
,
String
>
companyInfo
=
userEmpowerMapper
.
getCompanyInfoByOrgCode
(
permissionOrgCode
);
String
companyLevel
=
companyInfo
.
get
(
"level"
);
if
(
companyLevel
.
equals
(
"categroy_leve2"
))
{
return
null
;
}
if
(
companyLevel
.
equals
(
"area"
))
{
List
<
StationBasic
>
stationBasics
=
stationBasicMapper
.
selectList
(
new
QueryWrapper
<
StationBasic
>().
like
(
"project_org_code"
,
permissionOrgCode
));
result
=
stationBasics
.
stream
().
map
(
StationBasic:
:
getFanGatewayId
).
collect
(
Collectors
.
toList
());
return
result
;
}
if
(
companyLevel
.
equals
(
"station"
))
{
StationBasic
stationBasic
=
stationBasicMapper
.
selectOne
(
new
QueryWrapper
<
StationBasic
>().
eq
(
"project_org_code"
,
permissionOrgCode
));
result
.
add
(
stationBasic
.
getFanGatewayId
());
return
result
;
}
}
return
result
;
}
@Override
public
List
<
String
>
getCurrentUserProjectOrgCodes
()
{
List
<
String
>
result
=
new
ArrayList
<>();
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
String
userId
=
reginParams
.
getUserModel
().
getUserId
();
StdUserEmpower
stdUserEmpower
=
userEmpowerMapper
.
selectOne
(
new
QueryWrapper
<
StdUserEmpower
>().
eq
(
"amos_user_id"
,
userId
).
eq
(
"permission_type"
,
"YTH"
));
if
(
ObjectUtils
.
isEmpty
(
stdUserEmpower
))
{
return
null
;
}
else
{
String
permissionOrgCode
=
stdUserEmpower
.
getAmosOrgCode
().
get
(
0
);
Map
<
String
,
String
>
companyInfo
=
userEmpowerMapper
.
getCompanyInfoByOrgCode
(
permissionOrgCode
);
String
companyLevel
=
companyInfo
.
get
(
"level"
);
if
(
companyLevel
.
equals
(
"categroy_leve2"
))
{
return
null
;
}
if
(
companyLevel
.
equals
(
"area"
))
{
List
<
StationBasic
>
stationBasics
=
stationBasicMapper
.
selectList
(
new
QueryWrapper
<
StationBasic
>().
like
(
"project_org_code"
,
permissionOrgCode
));
result
=
stationBasics
.
stream
().
map
(
StationBasic:
:
getProjectOrgCode
).
collect
(
Collectors
.
toList
());
return
result
;
}
if
(
companyLevel
.
equals
(
"station"
))
{
StationBasic
stationBasic
=
stationBasicMapper
.
selectOne
(
new
QueryWrapper
<
StationBasic
>().
eq
(
"project_org_code"
,
permissionOrgCode
));
result
.
add
(
stationBasic
.
getProjectOrgCode
());
return
result
;
}
}
return
result
;
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-
analyse-
biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/McbWarningServiceImpl.java
→
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/McbWarningServiceImpl.java
View file @
b026498d
...
@@ -2,9 +2,9 @@ package com.yeejoin.amos.boot.module.jxiop.biz.service.impl;
...
@@ -2,9 +2,9 @@ package com.yeejoin.amos.boot.module.jxiop.biz.service.impl;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jxiop.api.feign.McbWarningFeign
;
import
com.yeejoin.amos.boot.module.jxiop.api.feign.McbWarningFeign
;
import
com.yeejoin.amos.boot.module.jxiop.
biz.mapper2
.McbWarningMapper
;
import
com.yeejoin.amos.boot.module.jxiop.
api.mapper
.McbWarningMapper
;
import
com.yeejoin.amos.boot.module.jxiop.
biz
.service.IMcbWarningService
;
import
com.yeejoin.amos.boot.module.jxiop.
api
.service.IMcbWarningService
;
import
com.yeejoin.amos.boot.module.jxiop.
biz
.service.IPermissionService
;
import
com.yeejoin.amos.boot.module.jxiop.
api
.service.IPermissionService
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/resources/application-dev.properties
View file @
b026498d
...
@@ -9,6 +9,11 @@ spring.db2.datasource.url=jdbc:mysql://139.9.173.44:3306/amos_project?allowMulti
...
@@ -9,6 +9,11 @@ spring.db2.datasource.url=jdbc:mysql://139.9.173.44:3306/amos_project?allowMulti
spring.db2.datasource.username
=
root
spring.db2.datasource.username
=
root
spring.db2.datasource.password
=
Yeejoin@2020
spring.db2.datasource.password
=
Yeejoin@2020
spring.db3.datasource.driver-class-name
:
com.mysql.cj.jdbc.Driver
spring.db3.datasource.url
=
jdbc:mysql://139.9.173.44:3306/amos_mcb?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull
spring.db3.datasource.username
=
root
spring.db3.datasource.password
=
Yeejoin@2020
## eureka properties:
## eureka properties:
eureka.instance.hostname
=
172.16.10.220
eureka.instance.hostname
=
172.16.10.220
eureka.client.serviceUrl.defaultZone
=
http://admin:a1234560@${eureka.instance.hostname}:10001/eureka/
eureka.client.serviceUrl.defaultZone
=
http://admin:a1234560@${eureka.instance.hostname}:10001/eureka/
...
...
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