Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YeeAmosFireAutoSysRoot
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
station
YeeAmosFireAutoSysRoot
Commits
0d1cb7cd
Commit
0d1cb7cd
authored
Aug 26, 2020
by
高东东
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'gaodongdong' into dev_upgrade_rule
parents
3d1733d8
636f3615
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
121 additions
and
32 deletions
+121
-32
ContingencyAction.java
...m/yeejoin/amos/fas/business/action/ContingencyAction.java
+0
-0
DeviceRo.java
.../com/yeejoin/amos/fas/business/action/model/DeviceRo.java
+24
-0
SetpEnum.java
.../com/yeejoin/amos/fas/business/action/model/SetpEnum.java
+11
-11
ContingencyInstanceImpl.java
...os/fas/business/service/impl/ContingencyInstanceImpl.java
+3
-2
RiskSourceServiceImpl.java
...amos/fas/business/service/impl/RiskSourceServiceImpl.java
+69
-7
PermissionAspect.java
...in/java/com/yeejoin/amos/fas/config/PermissionAspect.java
+12
-10
application-dev.properties
...utoSysStart/src/main/resources/application-dev.properties
+1
-1
application.properties
...ireAutoSysStart/src/main/resources/application.properties
+1
-1
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/ContingencyAction.java
View file @
0d1cb7cd
This diff is collapsed.
Click to expand it.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/model/DeviceRo.java
0 → 100644
View file @
0d1cb7cd
package
com
.
yeejoin
.
amos
.
fas
.
business
.
action
.
model
;
import
java.io.Serializable
;
import
com.yeejoin.amos.component.rule.Label
;
import
com.yeejoin.amos.component.rule.RuleFact
;
import
lombok.Data
;
@RuleFact
(
value
=
"设备数据"
,
project
=
"青海换流站消防预案"
)
@Data
public
class
DeviceRo
implements
Serializable
{
/**
*
*/
private
static
final
long
serialVersionUID
=
299646964348882067L
;
@Label
(
"点编码"
)
private
String
pointCode
;
@Label
(
"值"
)
private
String
value
;
@Label
(
"重点装备ID"
)
private
Long
equipmentId
;
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/model/SetpEnum.java
View file @
0d1cb7cd
...
@@ -8,17 +8,17 @@ public enum SetpEnum implements RuleConstants{
...
@@ -8,17 +8,17 @@ public enum SetpEnum implements RuleConstants{
STEP1
(
"1"
,
"停运换流阀、拨打报警电话"
,
1
),
STEP1
(
"1"
,
"停运换流阀、拨打报警电话"
,
1
),
STEP2
(
"2"
,
"开启水喷雾系统"
,
2
),
STEP2
(
"2"
,
"开启水喷雾系统"
,
2
),
STEP3
(
"3"
,
"断开上级电源"
,
3
),
STEP3
(
"3"
,
"断开上级电源"
,
3
),
STEP4
(
"
10
"
,
"开启油枕排油系统"
,
4
),
STEP4
(
"
4
"
,
"开启油枕排油系统"
,
4
),
STEP5
(
"
11
"
,
"消防炮“一键启动”"
,
5
),
STEP5
(
"
5
"
,
"消防炮“一键启动”"
,
5
),
STEP6
(
"12
"
,
"消防供水"
,
6
),
// STEP6("6
", "消防供水", 6),
STEP7
(
"
13
"
,
"阀厅防护"
,
7
),
STEP7
(
"
7
"
,
"阀厅防护"
,
7
),
STEP8
(
"
14
"
,
"本体排油"
,
8
),
STEP8
(
"
8
"
,
"本体排油"
,
8
),
STEP9
(
"
4
"
,
"停运空调和水冷系统"
,
9
),
STEP9
(
"
9
"
,
"停运空调和水冷系统"
,
9
),
STEP10
(
"
5
"
,
"驻站消防指挥权准备交接"
,
10
),
STEP10
(
"
10
"
,
"驻站消防指挥权准备交接"
,
10
),
STEP11
(
"
6
"
,
"驻站消防指挥权交接"
,
11
),
STEP11
(
"
11
"
,
"驻站消防指挥权交接"
,
11
),
STEP12
(
"
7
"
,
"电缆沟封堵"
,
12
),
STEP12
(
"
12
"
,
"电缆沟封堵"
,
12
),
STEP13
(
"
8
"
,
"灭火指挥权交接"
,
13
),
STEP13
(
"
13
"
,
"灭火指挥权交接"
,
13
),
STEP14
(
"
9
"
,
"应急处置结束"
,
14
);
STEP14
(
"
14
"
,
"应急处置结束"
,
14
);
private
String
stepCode
;
private
String
stepCode
;
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/ContingencyInstanceImpl.java
View file @
0d1cb7cd
...
@@ -170,8 +170,9 @@ public class ContingencyInstanceImpl /*extends GenericManagerImpl<ContingencyPla
...
@@ -170,8 +170,9 @@ public class ContingencyInstanceImpl /*extends GenericManagerImpl<ContingencyPla
SetpEnum
step
=
SetpEnum
.
getStepByCode
(
stepCode
);
SetpEnum
step
=
SetpEnum
.
getStepByCode
(
stepCode
);
contingencyRo
.
setStep
(
step
.
getValue
());
contingencyRo
.
setStep
(
step
.
getValue
());
contingencyRo
.
setStepState
(
stepMap
.
get
(
stepKey
));
contingencyRo
.
setStepState
(
stepMap
.
get
(
stepKey
));
// contingencyRo.setStep(stepCode);
log
.
info
(
"stepstate:"
+
contingencyRo
.
getStepState
());
log
.
info
(
"stepstate:"
+
contingencyRo
.
getStepState
());
log
.
info
(
"stepCode:"
+
stepCode
);
Equipment
equipment
=
impAndFireEquipMapper
.
queryImpEqumtByFireEquipmt
(
Long
.
parseLong
(
contingencyRo
.
getFireEquipmentId
()));
Equipment
equipment
=
impAndFireEquipMapper
.
queryImpEqumtByFireEquipmt
(
Long
.
parseLong
(
contingencyRo
.
getFireEquipmentId
()));
// 获取重点设备胚胎指标
// 获取重点设备胚胎指标
// 获取遥信指标
// 获取遥信指标
...
@@ -189,7 +190,7 @@ public class ContingencyInstanceImpl /*extends GenericManagerImpl<ContingencyPla
...
@@ -189,7 +190,7 @@ public class ContingencyInstanceImpl /*extends GenericManagerImpl<ContingencyPla
}
}
contingencyRo
.
setTelemetryMap
(
telemetryMap
);
contingencyRo
.
setTelemetryMap
(
telemetryMap
);
ruleTrigger
.
publish
(
contingencyRo
,
"青海换流站消防预案/test"
,
ArrayUtils
.
toArray
(
"极Ⅰ高端YY换流变B相"
));
ruleTrigger
.
publish
(
contingencyRo
,
equipment
.
getReservePlan
(),
ArrayUtils
.
toArray
(
equipment
.
getName
()
));
// 刷新记录区
// 刷新记录区
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/RiskSourceServiceImpl.java
View file @
0d1cb7cd
...
@@ -26,6 +26,7 @@ import org.slf4j.Logger;
...
@@ -26,6 +26,7 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.data.redis.core.HashOperations
;
import
org.springframework.data.redis.core.HashOperations
;
...
@@ -49,10 +50,12 @@ import com.google.common.collect.Sets;
...
@@ -49,10 +50,12 @@ import com.google.common.collect.Sets;
import
com.yeejoin.amos.component.rule.RuleTrigger
;
import
com.yeejoin.amos.component.rule.RuleTrigger
;
import
com.yeejoin.amos.fas.business.action.model.CheckInputItemRo
;
import
com.yeejoin.amos.fas.business.action.model.CheckInputItemRo
;
import
com.yeejoin.amos.fas.business.action.model.ContingencyRo
;
import
com.yeejoin.amos.fas.business.action.model.ContingencyRo
;
import
com.yeejoin.amos.fas.business.action.model.DeviceRo
;
import
com.yeejoin.amos.fas.business.action.model.FireEquimentDataRo
;
import
com.yeejoin.amos.fas.business.action.model.FireEquimentDataRo
;
import
com.yeejoin.amos.fas.business.action.model.ProtalDataRo
;
import
com.yeejoin.amos.fas.business.action.model.ProtalDataRo
;
import
com.yeejoin.amos.fas.business.action.model.RiskSourceRuleRo
;
import
com.yeejoin.amos.fas.business.action.model.RiskSourceRuleRo
;
import
com.yeejoin.amos.fas.business.action.model.SetpEnum
;
import
com.yeejoin.amos.fas.business.action.model.SetpEnum
;
import
com.yeejoin.amos.fas.business.action.mq.WebMqttComponent
;
import
com.yeejoin.amos.fas.business.bo.BindRegionBo
;
import
com.yeejoin.amos.fas.business.bo.BindRegionBo
;
import
com.yeejoin.amos.fas.business.bo.JpushMsgBo
;
import
com.yeejoin.amos.fas.business.bo.JpushMsgBo
;
import
com.yeejoin.amos.fas.business.bo.JpushMsgContentBo
;
import
com.yeejoin.amos.fas.business.bo.JpushMsgContentBo
;
...
@@ -516,6 +519,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -516,6 +519,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
public
void
alermContingency
(
String
batchNo
,
FireEquipment
fireEquipment
,
Equipment
equipment
)
throws
Exception
{
public
void
alermContingency
(
String
batchNo
,
FireEquipment
fireEquipment
,
Equipment
equipment
)
throws
Exception
{
Object
oldContingencyRo
=
redisTemplate
.
opsForValue
().
get
(
"contingencyRo"
);
ContingencyRo
contingencyRo
=
new
ContingencyRo
();
ContingencyRo
contingencyRo
=
new
ContingencyRo
();
contingencyRo
.
setBatchNo
(
batchNo
);
contingencyRo
.
setBatchNo
(
batchNo
);
contingencyRo
.
setEquipmentId
(
String
.
valueOf
(
equipment
.
getId
()));
contingencyRo
.
setEquipmentId
(
String
.
valueOf
(
equipment
.
getId
()));
...
@@ -523,8 +527,13 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -523,8 +527,13 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
contingencyRo
.
setFireEquipmentId
(
String
.
valueOf
(
fireEquipment
.
getId
()));
contingencyRo
.
setFireEquipmentId
(
String
.
valueOf
(
fireEquipment
.
getId
()));
contingencyRo
.
setFireEquipmentName
(
fireEquipment
.
getName
());
contingencyRo
.
setFireEquipmentName
(
fireEquipment
.
getName
());
// if (ObjectUtils.isEmpty(oldContingencyRo)) {
// contingencyRo.setStep(SetpEnum.STEP0.getValue());
// } else {
// contingencyRo.setStep(((ContingencyRo)oldContingencyRo).getStep());
// }
contingencyRo
.
setStep
(
SetpEnum
.
STEP0
.
getValue
());
contingencyRo
.
setStep
(
SetpEnum
.
STEP0
.
getValue
());
//contingencyRo.setNodeState(deviceData.getNodeState());
contingencyRo
.
setConfirm
(
"NONE"
);
contingencyRo
.
setConfirm
(
"NONE"
);
contingencyRo
.
setFireTruckRoute
(
equipment
.
getFireTruckRoute
());
contingencyRo
.
setFireTruckRoute
(
equipment
.
getFireTruckRoute
());
contingencyRo
.
setRunstep
(
false
);
contingencyRo
.
setRunstep
(
false
);
...
@@ -557,12 +566,27 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -557,12 +566,27 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
}
}
}
}
}
log
.
debug
(
"开始调用规则"
);
//Object result = remoteRuleServer.fireRuleFlow(contingencyRo, equipment.getReservePlan(), equipment.getName());
// 获取遥信指标
List
<
Map
>
points
=
fireEquipPointMapper
.
getPointsByEquipmentIdAndType
(
equipment
.
getId
(),
"SWITCH"
);
HashMap
<
String
,
Integer
>
telesignallingMap
=
new
HashMap
<>();
for
(
Map
map
:
points
)
{
telesignallingMap
.
put
(
map
.
get
(
"code"
)
+
""
,
(
ObjectUtils
.
isEmpty
(
map
.
get
(
"value"
))
||
"false"
.
equals
(
map
.
get
(
"value"
).
toString
()))
?
0
:
1
);
}
contingencyRo
.
setTelesignallingMap
(
telesignallingMap
);
// 获取遥测指标
points
=
fireEquipPointMapper
.
getPointsByEquipmentIdAndType
(
equipment
.
getId
(),
"ANALOGUE"
);
HashMap
<
String
,
Double
>
telemetryMap
=
new
HashMap
<>();
for
(
Map
map
:
points
)
{
telemetryMap
.
put
(
map
.
get
(
"code"
)
+
""
,
Double
.
valueOf
(
ObjectUtils
.
isEmpty
(
map
.
get
(
"value"
))
?
"0"
:
map
.
get
(
"value"
).
toString
()));
}
contingencyRo
.
setTelemetryMap
(
telemetryMap
);
log
.
debug
(
"开始调用规则"
);
Object
result
=
ruleTrigger
.
publish
(
contingencyRo
,
equipment
.
getReservePlan
(),
ArrayUtils
.
toArray
(
equipment
.
getName
()));
Object
result
=
ruleTrigger
.
publish
(
contingencyRo
,
equipment
.
getReservePlan
(),
ArrayUtils
.
toArray
(
equipment
.
getName
()));
// Object result = ruleTrigger.publish(contingencyRo, "青海换流站消防预案/预案执行", ArrayUtils.toArray("极Ⅰ高端YY换流变B相"));
log
.
debug
(
"规则调用返回=="
,
result
);
log
.
debug
(
"规则调用返回=="
,
result
);
ContingencyOriginalData
contingencyOriginalData
=
new
ContingencyOriginalData
();
ContingencyOriginalData
contingencyOriginalData
=
new
ContingencyOriginalData
();
BeanUtils
.
copyProperties
(
contingencyRo
,
contingencyOriginalData
);
BeanUtils
.
copyProperties
(
contingencyRo
,
contingencyOriginalData
);
iContingencyOriginalDataDao
.
save
(
contingencyOriginalData
);
iContingencyOriginalDataDao
.
save
(
contingencyOriginalData
);
...
@@ -821,12 +845,20 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -821,12 +845,20 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
saveFireEquipmentData
(
fireEquipmentPoint
,
fireEquipment
,
deviceData
,
fireEquipmentPointType
);
saveFireEquipmentData
(
fireEquipmentPoint
,
fireEquipment
,
deviceData
,
fireEquipmentPointType
);
// 根据监测点设备信息获取保护的重点装备
// 根据监测点设备信息获取保护的重点装备
equipment
=
impAndFireEquipMapper
.
queryImpEqumtByFireEquipmt
(
fireEquipmentPoint
.
getFireEquipmentId
());
equipment
=
impAndFireEquipMapper
.
queryImpEqumtByFireEquipmt
(
fireEquipmentPoint
.
getFireEquipmentId
());
DeviceRo
deviceRo
=
new
DeviceRo
();
deviceRo
.
setEquipmentId
(
equipment
.
getId
());
deviceRo
.
setPointCode
(
deviceData
.
getPointCode
());
deviceRo
.
setValue
(
deviceData
.
getState
());
triggerPlanDevice
(
deviceRo
,
equipment
,
toke
);
// Boolean have = equipmentGroupedPointDao.existsByEqpPointIdAndEquipId(fireEquipmentPoint.getId(), equipment.getId());
// Boolean have = equipmentGroupedPointDao.existsByEqpPointIdAndEquipId(fireEquipmentPoint.getId(), equipment.getId());
Boolean
have
=
impAndFireEquipMapper
.
existsAlarmPointByEqpPointIdAndEquipId
(
fireEquipmentPoint
.
getId
(),
equipment
.
getId
());
Boolean
have
=
impAndFireEquipMapper
.
existsAlarmPointByEqpPointIdAndEquipId
(
fireEquipmentPoint
.
getId
(),
equipment
.
getId
());
if
(!
ObjectUtils
.
isEmpty
(
have
)
&&
have
)
{
if
(!
ObjectUtils
.
isEmpty
(
have
)
&&
have
)
{
//动态预案执行
//动态预案执行
dynamicPlan
(
deviceData
,
equipment
,
fireEquipment
,
toke
);
dynamicPlan
(
deviceData
,
equipment
,
fireEquipment
,
toke
);
}
}
}
}
}
}
...
@@ -840,7 +872,14 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -840,7 +872,14 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
*/
*/
@Async
@Async
void
dynamicPlan
(
AlarmParam
deviceData
,
Equipment
equipment
,
FireEquipment
fireEquipment
,
Toke
toke
)
{
void
dynamicPlan
(
AlarmParam
deviceData
,
Equipment
equipment
,
FireEquipment
fireEquipment
,
Toke
toke
)
{
String
batchNo
=
UUID
.
randomUUID
().
toString
();
Object
contingencyRo
=
redisTemplate
.
opsForValue
().
get
(
"contingencyRo"
);
String
batchNo
=
null
;
// if (!ObjectUtils.isEmpty(contingencyRo)) {
// batchNo = ((ContingencyRo)contingencyRo).getBatchNo();
// } else {
// batchNo = UUID.randomUUID().toString();
// }
batchNo
=
UUID
.
randomUUID
().
toString
();
RequestContext
.
setToken
(
toke
.
getToke
());
RequestContext
.
setToken
(
toke
.
getToke
());
RequestContext
.
setProduct
(
toke
.
getProduct
());
RequestContext
.
setProduct
(
toke
.
getProduct
());
try
{
try
{
...
@@ -849,6 +888,17 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -849,6 +888,17 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
}
}
@Async
public
void
triggerPlanDevice
(
DeviceRo
deviceRo
,
Equipment
equipment
,
Toke
toke
)
{
try
{
RequestContext
.
setToken
(
toke
.
getToke
());
RequestContext
.
setProduct
(
toke
.
getProduct
());
Object
result1
=
ruleTrigger
.
publish
(
deviceRo
,
equipment
.
getReservePlan
(),
ArrayUtils
.
toArray
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
@Override
@Override
@javax
.
transaction
.
Transactional
@javax
.
transaction
.
Transactional
...
@@ -919,6 +969,9 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -919,6 +969,9 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
iDataRefreshService
.
sendRefreshDataWithArea
(
View3dRefreshAreaEum
.
monitor_data
.
getCode
(),
content
);
iDataRefreshService
.
sendRefreshDataWithArea
(
View3dRefreshAreaEum
.
monitor_data
.
getCode
(),
content
);
}
}
}
}
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
"yinan"
,
"telesignaling"
);
webMqttComponent
.
publish
(
topic
,
JSON
.
toJSONString
(
deviceData
));
List
<
AlarmParam
>
list
=
new
ArrayList
<>();
List
<
AlarmParam
>
list
=
new
ArrayList
<>();
list
.
add
(
deviceData
);
list
.
add
(
deviceData
);
//保存所有数据(遥测,遥信)到mongo
//保存所有数据(遥测,遥信)到mongo
...
@@ -1008,12 +1061,21 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1008,12 +1061,21 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
fmeaIds
.
forEach
(
fmeaId
->
rsDataQueue
.
addEquipmentMessage
(
fmeaId
,
monitor
,
st
));
fmeaIds
.
forEach
(
fmeaId
->
rsDataQueue
.
addEquipmentMessage
(
fmeaId
,
monitor
,
st
));
}
}
}
}
@Autowired
private
WebMqttComponent
webMqttComponent
;
@Value
(
"${auto-sys.push.type}"
)
private
String
pushType
;
@Value
(
"${spring.application.name}"
)
private
String
serviceName
;
@Async
@Async
public
void
sendAnalogue
(
EquipCommunicationData
data
)
{
public
void
sendAnalogue
(
EquipCommunicationData
data
)
{
try
{
try
{
redisTemplate
.
opsForHash
().
put
(
"Analogue"
,
data
.
getPointCode
(),
data
);
redisTemplate
.
opsForHash
().
put
(
"Analogue"
,
data
.
getPointCode
(),
data
);
remoteWebSocketServer
.
sendMessage
(
"plan"
,
JSON
.
toJSONString
(
data
));
// remoteWebSocketServer.sendMessage("plan", JSON.toJSONString(data));
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
"yinan"
,
"analogue"
);
webMqttComponent
.
publish
(
topic
,
JSON
.
toJSONString
(
data
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/config/PermissionAspect.java
View file @
0d1cb7cd
...
@@ -9,6 +9,7 @@ import org.aspectj.lang.annotation.Before;
...
@@ -9,6 +9,7 @@ import org.aspectj.lang.annotation.Before;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
...
@@ -31,15 +32,16 @@ public class PermissionAspect {
...
@@ -31,15 +32,16 @@ public class PermissionAspect {
logger
.
info
(
"======开始权限校验======"
);
logger
.
info
(
"======开始权限校验======"
);
// 用户token
// 用户token
String
token
=
(
String
)
request
.
getHeader
(
"token"
);
String
token
=
(
String
)
request
.
getHeader
(
"token"
);
String
product
=
(
String
)
request
.
getHeader
(
"product"
);
token
=
ObjectUtils
.
isEmpty
(
token
)
?
(
String
)
request
.
getHeader
(
"X-Access-Token"
)
:
token
;
String
appKey
=
(
String
)
request
.
getHeader
(
"appKey"
);
String
product
=
(
String
)
request
.
getHeader
(
"product"
);
logger
.
info
(
"用户token:"
+
token
);
String
appKey
=
(
String
)
request
.
getHeader
(
"appKey"
);
RequestContext
.
setToken
(
token
);
logger
.
info
(
"用户token:"
+
token
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setToken
(
token
);
RequestContext
.
setAppKey
(
appKey
);
RequestContext
.
setProduct
(
product
);
if
(!
TokenOperation
.
refresh
(
token
))
{
RequestContext
.
setAppKey
(
appKey
);
throw
new
PermissionException
(
"登录信息失效,请重新登录"
);
if
(!
TokenOperation
.
refresh
(
token
))
{
}
throw
new
PermissionException
(
"登录信息失效,请重新登录"
);
}
}
}
}
}
YeeAmosFireAutoSysStart/src/main/resources/application-dev.properties
View file @
0d1cb7cd
...
@@ -15,7 +15,7 @@ eureka.client.healthcheck.enabled = true
...
@@ -15,7 +15,7 @@ eureka.client.healthcheck.enabled = true
eureka.client.fetchRegistry
=
true
eureka.client.fetchRegistry
=
true
eureka.instance.prefer-ip-address
=
true
eureka.instance.prefer-ip-address
=
true
#DB properties:
#DB properties:
spring.datasource.url
=
jdbc:mysql://172.16.11.33:3306/
safety-business-2.0.37
?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.datasource.url
=
jdbc:mysql://172.16.11.33:3306/
v2.0_zmd_yeejoin_safety_business
?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.datasource.username
=
root
spring.datasource.username
=
root
spring.datasource.password
=
admin_1234
spring.datasource.password
=
admin_1234
spring.datasource.driver-class-name
=
com.mysql.jdbc.Driver
spring.datasource.driver-class-name
=
com.mysql.jdbc.Driver
...
...
YeeAmosFireAutoSysStart/src/main/resources/application.properties
View file @
0d1cb7cd
spring.application.name
=
Amos-autosys
-gdd
spring.application.name
=
Amos-autosys
server.port
=
8083
server.port
=
8083
...
...
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