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
f720f850
Commit
f720f850
authored
May 25, 2020
by
maoying
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_upgrade' of 172.16.10.76:station/YeeAmosFireAutoSysRoot into upgrade
parents
cdb3ef58
c20ebad3
Hide whitespace changes
Inline
Side-by-side
Showing
47 changed files
with
2403 additions
and
254 deletions
+2403
-254
ContingencyAction.java
...m/yeejoin/amos/fas/business/action/ContingencyAction.java
+437
-0
CustomerAction.java
.../com/yeejoin/amos/fas/business/action/CustomerAction.java
+4
-0
AbstractActionResult.java
...amos/fas/business/action/result/AbstractActionResult.java
+29
-0
ActionResult.java
...yeejoin/amos/fas/business/action/result/ActionResult.java
+15
-0
BubbleTipResult.java
...join/amos/fas/business/action/result/BubbleTipResult.java
+23
-0
RiskSituationResult.java
.../amos/fas/business/action/result/RiskSituationResult.java
+23
-0
SimpleResult.java
...yeejoin/amos/fas/business/action/result/SimpleResult.java
+55
-0
TipResult.java
...om/yeejoin/amos/fas/business/action/result/TipResult.java
+23
-0
AbstractActionResultMessage.java
...ss/action/result/message/AbstractActionResultMessage.java
+78
-0
ActionResultMessage.java
...s/business/action/result/message/ActionResultMessage.java
+20
-0
BubbleTipResultMessage.java
...usiness/action/result/message/BubbleTipResultMessage.java
+20
-0
RiskSituationResultMessage.java
...ess/action/result/message/RiskSituationResultMessage.java
+20
-0
SimpleResultMessage.java
...s/business/action/result/message/SimpleResultMessage.java
+25
-0
TipResultMessage.java
.../fas/business/action/result/message/TipResultMessage.java
+20
-0
ReflectUtil.java
...om/yeejoin/amos/fas/business/action/util/ReflectUtil.java
+363
-0
RuleWebSocket.java
...oin/amos/fas/business/action/websocket/RuleWebSocket.java
+169
-0
WebSocketConfig.java
...n/amos/fas/business/action/websocket/WebSocketConfig.java
+14
-0
FireCarController.java
...ejoin/amos/fas/business/controller/FireCarController.java
+4
-3
FireStationController.java
...n/amos/fas/business/controller/FireStationController.java
+6
-1
View3dController.java
...eejoin/amos/fas/business/controller/View3dController.java
+8
-3
FireStrengthMapper.java
...join/amos/fas/business/dao/mapper/FireStrengthMapper.java
+7
-3
RuleRuningSnapshotMapper.java
...mos/fas/business/dao/mapper/RuleRuningSnapshotMapper.java
+14
-0
View3dMapper.java
...om/yeejoin/amos/fas/business/dao/mapper/View3dMapper.java
+2
-2
ContingencyInstanceImpl.java
...os/fas/business/service/impl/ContingencyInstanceImpl.java
+21
-5
FireCarServiceImpl.java
...in/amos/fas/business/service/impl/FireCarServiceImpl.java
+1
-1
FireStrengthServiceImpl.java
...os/fas/business/service/impl/FireStrengthServiceImpl.java
+18
-29
RiskSourceServiceImpl.java
...amos/fas/business/service/impl/RiskSourceServiceImpl.java
+12
-4
RuleRunigSnapshotServiceImpl.java
...s/business/service/impl/RuleRunigSnapshotServiceImpl.java
+198
-0
View3dServiceImpl.java
...oin/amos/fas/business/service/impl/View3dServiceImpl.java
+15
-4
WaterResourceServiceImpl.java
...s/fas/business/service/impl/WaterResourceServiceImpl.java
+1
-1
FireStengthService.java
...n/amos/fas/business/service/intfc/FireStengthService.java
+3
-1
IContingencyInstance.java
...amos/fas/business/service/intfc/IContingencyInstance.java
+1
-1
IRuleRunningSnapshotService.java
...s/business/service/intfc/IRuleRunningSnapshotService.java
+18
-0
IView3dService.java
...ejoin/amos/fas/business/service/intfc/IView3dService.java
+3
-1
ContingencyRo.java
...eejoin/amos/fas/business/service/model/ContingencyRo.java
+154
-153
RuleRuningSnapshot.java
...n/amos/fas/business/service/model/RuleRuningSnapshot.java
+129
-0
ToipResponse.java
...yeejoin/amos/fas/business/service/model/ToipResponse.java
+123
-0
View3dNodeVo.java
...n/java/com/yeejoin/amos/fas/business/vo/View3dNodeVo.java
+16
-2
application-dev.properties
...utoSysStart/src/main/resources/application-dev.properties
+8
-0
application-docker.properties
...SysStart/src/main/resources/application-docker.properties
+9
-0
application-test.properties
...toSysStart/src/main/resources/application-test.properties
+8
-0
dbTemplate_fier_station.xml
.../src/main/resources/db/mapper/dbTemplate_fier_station.xml
+1
-0
dbTemplate_fier_stength.xml
.../src/main/resources/db/mapper/dbTemplate_fier_stength.xml
+28
-0
dbTemplate_rule_runing_snapshot.xml
...n/resources/db/mapper/dbTemplate_rule_runing_snapshot.xml
+16
-0
dbTemplate_view3d.xml
...sStart/src/main/resources/db/mapper/dbTemplate_view3d.xml
+235
-40
dbTemplate_waterResource.xml
...src/main/resources/db/mapper/dbTemplate_waterResource.xml
+1
-0
pom.xml
pom.xml
+5
-0
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/ContingencyAction.java
0 → 100644
View file @
f720f850
package
com
.
yeejoin
.
amos
.
fas
.
business
.
action
;
import
java.io.IOException
;
import
java.lang.reflect.Constructor
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Method
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.CollectionUtils
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.yeejoin.amos.fas.business.action.result.ActionResult
;
import
com.yeejoin.amos.fas.business.action.result.BubbleTipResult
;
import
com.yeejoin.amos.fas.business.action.result.message.ActionResultMessage
;
import
com.yeejoin.amos.fas.business.service.impl.RuleRunigSnapshotServiceImpl
;
import
com.yeejoin.amos.fas.business.service.intfc.FireStengthService
;
import
com.yeejoin.amos.fas.business.service.intfc.IContingencyInstance
;
import
com.yeejoin.amos.fas.business.service.intfc.IRiskSourceService
;
import
com.yeejoin.amos.fas.business.service.model.ContingencyDeviceStatus
;
import
com.yeejoin.amos.fas.business.service.model.ContingencyRo
;
import
com.yeejoin.amos.fas.business.util.StringUtil
;
import
com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance
;
import
com.yeejoin.amos.fas.dao.entity.FireStrength
;
@Component
public
class
ContingencyAction
implements
CustomerAction
{
private
static
String
PACKAGEURL
=
"com.yeejoin.amos.fas.business.action.result.message."
;
@Autowired
private
IContingencyInstance
iContingencyInstance
;
@Autowired
private
FireStengthService
fireStrengthService
;
// private RestTemplate restTemplate = new RestTemplate();
// @Value("${bussunis.domain}")
// private String bussunisDomain ;
@Autowired
private
IRiskSourceService
riskSourceService
;
private
static
Map
<
String
,
String
>
OPERATE_RECORD_ID
=
new
HashMap
<>();
private
static
Map
<
String
,
Map
<
String
,
String
>>
stringStringMap
=
new
HashMap
<>();
static
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"HH:mm:ss"
);
//当值值班长(S1)、副值班长(S2)、值班员(A1,A2,A3)、白班值班员、保安人员、驻站消防队长(F1)
/* private static Map<String, String> positionMap = new HashMap<String, String>() {{
put("S1", "S1");
put("S2", "S2");
put("A1", "A1");
put("A2", "A2");
put("A3", "A3");
put("F1", "F1");
}};
*/
private
Map
<
String
,
String
>
getStrengthMap
(
String
batchNo
)
{
Map
<
String
,
String
>
returnMap
=
stringStringMap
.
get
(
batchNo
);
if
(
CollectionUtils
.
isEmpty
(
returnMap
))
{
stringStringMap
=
new
HashMap
<>();
returnMap
=
new
HashMap
<>();
Date
now
=
new
Date
();
String
time
=
sdf
.
format
(
now
);
List
<
FireStrength
>
strengths
=
fireStrengthService
.
queryForStrengthList
(
time
);
// List<FireStrength> strengths = iStrengthRepository.queryForStrengthList(time);
if
(!
CollectionUtils
.
isEmpty
(
strengths
))
{
for
(
FireStrength
fireStrength
:
strengths
)
{
String
name
=
returnMap
.
get
(
fireStrength
.
getPosition
());
if
(
StringUtil
.
isNotEmpty
(
name
))
{
returnMap
.
put
(
fireStrength
.
getPosition
(),
name
+
"、"
+
fireStrength
.
getUsername
());
}
else
{
returnMap
.
put
(
fireStrength
.
getPosition
(),
fireStrength
.
getUsername
());
}
}
}
stringStringMap
.
put
(
batchNo
,
returnMap
);
}
return
returnMap
;
}
public
static
void
sendcmd
(
String
firstStr
,
String
secondStr
,
String
thirdStr
,
BubbleTipResult
result
)
{
Constructor
<?>
constructor
;
try
{
constructor
=
Class
.
forName
(
PACKAGEURL
+
result
.
getClass
().
getSimpleName
()
+
"Message"
)
.
getConstructor
(
ActionResult
.
class
);
ActionResultMessage
<?>
action
=
(
ActionResultMessage
<?>)
constructor
.
newInstance
(
result
);
action
.
execute
(
firstStr
,
secondStr
,
thirdStr
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
/**
* @param stepCode 当前步骤编号
* @param stepName 当前步骤名称
* @param state 当前步骤状态
* @param nextStepCode 下一步编号
* @param nextStepName 下一步名称
* @param stepType 步骤类型,总览步骤、详细步骤
* @param paramObj 预案对象
*/
public
void
stepInfo
(
String
stepCode
,
String
stepName
,
String
state
,
String
nextStepCode
,
String
nextStepName
,
String
stepType
,
Object
paramObj
)
{
ContingencyRo
contingencyRo
=
(
ContingencyRo
)
paramObj
;
stopSnapshop
(
contingencyRo
);
BubbleTipResult
result
=
new
BubbleTipResult
();
Map
<
String
,
Object
>
tempmap1
=
new
HashMap
<>();
tempmap1
.
put
(
"stepCode"
,
stepCode
);
tempmap1
.
put
(
"stepName"
,
stepName
);
tempmap1
.
put
(
"state"
,
state
);
tempmap1
.
put
(
"nextStepCode"
,
nextStepCode
);
tempmap1
.
put
(
"nextStepName"
,
nextStepName
);
tempmap1
.
put
(
"batchNo"
,
contingencyRo
.
getBatchNo
());
tempmap1
.
put
(
"contingencyRo"
,
contingencyRo
);
result
.
add
(
tempmap1
);
this
.
sendcmd
(
"fromws"
,
"stepArea"
,
stepType
,
result
);
}
/**
* @param stepCode 当前步骤编号
* @param paramObj 预案对象
*/
public
void
saveStepInfo
(
String
stepCode
,
Object
paramObj
)
{
ContingencyRo
contingencyRo
=
(
ContingencyRo
)
paramObj
;
iContingencyInstance
.
updateStep
(
stepCode
,
contingencyRo
.
getBatchNo
());
}
/**
* @param content 消息内容
* @param paramObj 预案对象
*/
public
void
messageRecord
(
String
content
,
Object
paramObj
)
{
ContingencyRo
contingencyRo
=
(
ContingencyRo
)
paramObj
;
stopSnapshop
(
contingencyRo
);
//转换content中的变量
content
=
instedParams
(
content
,
contingencyRo
);
BubbleTipResult
result
=
new
BubbleTipResult
();
Map
<
String
,
Object
>
tempmap1
=
new
HashMap
<>();
tempmap1
.
put
(
"refresh"
,
"refresh"
);
tempmap1
.
put
(
"batchNo"
,
contingencyRo
.
getBatchNo
());
result
.
add
(
tempmap1
);
iContingencyInstance
.
createInstanceRecord
(
contingencyRo
.
getBatchNo
(),
""
,
"DEFAULT"
,
content
,
"MESSAGE"
,
""
);
this
.
sendcmd
(
"fromws"
,
"recordArea"
,
"refresh"
,
result
);
}
/**
* <pre>
* 智能辅助
* </pre>
*
* @param step 当前步骤
* @param icon 图标
* @param title 标题
* @param image 图片集合
* @param table 表格
* @param content 内容
* @param paramObj 预案对象
*/
public
void
help
(
String
step
,
String
icon
,
String
title
,
String
image
,
String
table
,
String
content
,
Object
paramObj
)
{
ContingencyRo
contingencyRo
=
(
ContingencyRo
)
paramObj
;
stopSnapshop
(
contingencyRo
);
//转换智能辅助中的变量
content
=
instedParams
(
content
,
contingencyRo
);
BubbleTipResult
result
=
new
BubbleTipResult
();
Map
<
String
,
Object
>
tempmap1
=
new
HashMap
<>();
tempmap1
.
put
(
"icon"
,
icon
);
tempmap1
.
put
(
"step"
,
step
);
tempmap1
.
put
(
"title"
,
title
);
tempmap1
.
put
(
"content"
,
content
);
tempmap1
.
put
(
"image"
,
image
);
tempmap1
.
put
(
"table"
,
table
);
tempmap1
.
put
(
"batchNo"
,
contingencyRo
.
getBatchNo
());
tempmap1
.
put
(
"contingencyRo"
,
contingencyRo
);
result
.
add
(
tempmap1
);
this
.
sendcmd
(
"fromws"
,
"helpArea"
,
""
,
result
);
}
private
String
instedParams
(
String
content
,
ContingencyRo
contingencyRo
)
{
Map
<
String
,
String
>
strengthMap
=
this
.
getStrengthMap
(
contingencyRo
.
getBatchNo
());
for
(
String
key
:
strengthMap
.
keySet
())
content
=
content
.
replaceAll
(
"\\$\\{"
+
key
+
"}"
,
strengthMap
.
get
(
key
));
/* for (String key : positionMap.keySet())
c ontent = content.replaceAll("\\$\\{" + key + "}", positionMap.get(key));
*/
Field
[]
fields
=
contingencyRo
.
getClass
().
getDeclaredFields
();
Method
getMethod
=
null
;
try
{
for
(
Field
field
:
fields
)
{
if
(
field
.
getName
().
equals
(
"serialVersionUID"
))
continue
;
String
fileNameInMethod
=
String
.
valueOf
(
field
.
getName
().
charAt
(
0
)).
toUpperCase
()
+
field
.
getName
().
substring
(
1
);
getMethod
=
contingencyRo
.
getClass
().
getMethod
(
"get"
+
fileNameInMethod
);
String
value
=
String
.
valueOf
(
getMethod
.
invoke
(
contingencyRo
));
content
=
content
.
replaceAll
(
"\\$\\{"
+
field
.
getName
()
+
"}"
,
value
);
}
content
=
content
.
replaceAll
(
"\\$\\{"
,
""
);
content
=
content
.
replaceAll
(
"}"
,
""
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
content
;
}
/**
* 交互动作
*
* @param actionName 动作名称
* @param icon 图标
* @param tips 提示信息
* @param buttonJson 按钮json字符串
* @param paramObj 预案对象
*/
public
void
operation
(
String
actionName
,
String
icon
,
String
tips
,
String
buttonJson
,
Object
paramObj
)
{
ContingencyRo
contingencyRo
=
(
ContingencyRo
)
paramObj
;
stopSnapshop
(
contingencyRo
);
//转换content中的变量
tips
=
instedParams
(
tips
,
contingencyRo
);
BubbleTipResult
result
=
new
BubbleTipResult
();
Map
<
String
,
Object
>
tempmap1
=
new
HashMap
<>();
String
contingencyPlanId
=
getContingencyPlanId
(
contingencyRo
.
getBatchNo
(),
actionName
,
icon
,
tips
,
buttonJson
);
tempmap1
.
put
(
"actionName"
,
actionName
);
tempmap1
.
put
(
"icon"
,
icon
);
tempmap1
.
put
(
"tips"
,
tips
);
tempmap1
.
put
(
"buttonJson"
,
buttonJson
);
tempmap1
.
put
(
"batchNo"
,
contingencyRo
.
getBatchNo
());
tempmap1
.
put
(
"contingencyRo"
,
contingencyRo
);
tempmap1
.
put
(
"contingencyPlanId"
,
contingencyPlanId
);
result
.
add
(
tempmap1
);
this
.
sendcmd
(
"fromws"
,
"optionArea"
,
""
,
result
);
sendButton
(
contingencyRo
.
getBatchNo
(),
contingencyPlanId
,
contingencyRo
.
getEquipmentId
(),
actionName
,
buttonJson
);
}
private
boolean
sendButton
(
String
batchNo
,
String
contingencyPlanId
,
String
equipmentId
,
String
actionName
,
String
buttonJson
)
{
// String url = bussunisDomain+ "/api/risksource/contingency/setup";
ObjectMapper
objectMapper
=
new
ObjectMapper
();
//Map<String,Object> map = new HashMap<>();
/**
* batchNo
* stepCode
* buttonCode
* confirm
* contingencyPlanId
* stepState
*/
try
{
Map
button
=
objectMapper
.
readValue
(
buttonJson
,
Map
.
class
);
Map
operateInstance
=
(
Map
)((
List
)
button
.
get
(
"operate"
)).
get
(
0
);
// map.put("batchNo",batchNo);
// map.put("actionName",actionName);
// map.put("equipmentId",equipmentId);
// map.put("stepCode",button.get("stepCode"));
// map.put("buttonCode",operateInstance.get("code"));
// map.put("confirm","CONFIRM");
// map.put("stepState",operateInstance.get("stepState"));
// map.put("contingencyPlanId",contingencyPlanId);
ContingencyDeviceStatus
contingencyDeviceStatus
=
new
ContingencyDeviceStatus
();
contingencyDeviceStatus
.
setActionName
(
actionName
);
contingencyDeviceStatus
.
setButtonCode
(
String
.
valueOf
(
operateInstance
.
get
(
"code"
)));
contingencyDeviceStatus
.
setConfirm
(
"CONFIRM"
);
contingencyDeviceStatus
.
setContingencyPlanId
(
contingencyPlanId
);
contingencyDeviceStatus
.
setEquipmentId
(
equipmentId
);
contingencyDeviceStatus
.
setStepCode
(
String
.
valueOf
(
button
.
get
(
"stepCode"
)));
contingencyDeviceStatus
.
setStepState
(
String
.
valueOf
(
operateInstance
.
get
(
"stepState"
)));
riskSourceService
.
queryContingencyDeviceStatus
(
contingencyDeviceStatus
);
//HttpEntity<Map> entity = new HttpEntity<>(map);
// restTemplate.exchange(url, HttpMethod.POST,entity,Map.class);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
false
;
}
/**
* 保存交互动作
*
* @param actionName 动作名称
* @param icon 图标
* @param tips 提示信息
* @param buttonJson 按钮json字符串
* @param paramObj 预案对象
*/
public
void
saveOperation
(
String
actionName
,
String
icon
,
String
tips
,
String
buttonJson
,
Object
paramObj
)
{
ContingencyRo
contingencyRo
=
(
ContingencyRo
)
paramObj
;
stopSnapshop
(
contingencyRo
);
//转换content中的变量
tips
=
instedParams
(
tips
,
contingencyRo
);
BubbleTipResult
result1
=
new
BubbleTipResult
();
Map
<
String
,
Object
>
tempmap2
=
new
HashMap
<>();
tempmap2
.
put
(
"refresh"
,
"refresh"
);
tempmap2
.
put
(
"batchNo"
,
contingencyRo
.
getBatchNo
());
result1
.
add
(
tempmap2
);
String
contingencyPlanId
=
getContingencyPlanId
(
contingencyRo
.
getBatchNo
(),
actionName
,
icon
,
tips
,
buttonJson
);
this
.
sendcmd
(
"fromws"
,
"recordArea"
,
"refresh"
,
result1
);
}
private
String
getContingencyPlanId
(
String
batchNo
,
String
actionName
,
String
icon
,
String
tips
,
String
buttonJson
)
{
String
cacheKey
=
batchNo
+
actionName
;
String
contingencyPlanId
=
null
;
ContingencyPlanInstance
contingencyPlanInstance
=
null
;
if
(
OPERATE_RECORD_ID
.
get
(
cacheKey
)
==
null
)
{
contingencyPlanInstance
=
iContingencyInstance
.
createInstanceRecord
(
batchNo
,
actionName
,
"DEFAULT"
,
buttonJson
,
"OPERATE"
,
icon
);
contingencyPlanId
=
contingencyPlanInstance
.
getId
();
OPERATE_RECORD_ID
.
put
(
cacheKey
,
contingencyPlanId
);
}
else
{
contingencyPlanId
=
OPERATE_RECORD_ID
.
get
(
cacheKey
);
OPERATE_RECORD_ID
.
remove
(
cacheKey
);
}
return
contingencyPlanId
;
}
/**
* 地图动作推送
*
* @param actionName 动作名称标识
* @param paramObj 预案对象
*/
public
void
mapAction
(
String
actionName
,
Object
paramObj
)
{
ContingencyRo
contingencyRo
=
(
ContingencyRo
)
paramObj
;
stopSnapshop
(
contingencyRo
);
BubbleTipResult
result
=
new
BubbleTipResult
();
Map
<
String
,
Object
>
tempmap1
=
new
HashMap
<>();
tempmap1
.
put
(
"actionName"
,
actionName
);
tempmap1
.
put
(
"batchNo"
,
contingencyRo
.
getBatchNo
());
tempmap1
.
put
(
"contingencyRo"
,
contingencyRo
);
result
.
add
(
tempmap1
);
this
.
sendcmd
(
"fromws"
,
"mapArea"
,
actionName
,
result
);
}
/**
* 顶部消息提示
*
* @param content 消息内容
* @param messageType 消息类型 messageType 黑色框消息类型CONTINGENCY,,滚动消息:CURRENTMESSAGE
* @param paramObj 预案对象
*/
public
void
topMessage
(
String
content
,
String
messageType
,
Object
paramObj
)
{
ContingencyRo
contingencyRo
=
(
ContingencyRo
)
paramObj
;
stopSnapshop
(
contingencyRo
);
BubbleTipResult
result
=
new
BubbleTipResult
();
Map
<
String
,
Object
>
tempmap1
=
new
HashMap
<>();
//转换content中的变量
content
=
instedParams
(
content
,
contingencyRo
);
tempmap1
.
put
(
"content"
,
content
);
tempmap1
.
put
(
"messageType"
,
messageType
);
//消息类型 messageType 黑色框消息类型 CONTINGENCY,,滚动消息:CURRENTMESSAGE
tempmap1
.
put
(
"batchNo"
,
contingencyRo
.
getBatchNo
());
tempmap1
.
put
(
"contingencyRo"
,
contingencyRo
);
result
.
add
(
tempmap1
);
this
.
sendcmd
(
"fromws"
,
"topArea"
,
messageType
,
result
);
}
private
void
stopSnapshop
(
ContingencyRo
contingencyRo
)
{
if
(
RuleRunigSnapshotServiceImpl
.
getReplayBatchNo
()
!=
null
&&
!
RuleRunigSnapshotServiceImpl
.
getReplayBatchNo
().
equals
(
contingencyRo
.
getBatchNo
()))
RuleRunigSnapshotServiceImpl
.
setReplayBatchNoToNull
();
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/CustomerAction.java
0 → 100644
View file @
f720f850
package
com
.
yeejoin
.
amos
.
fas
.
business
.
action
;
public
interface
CustomerAction
{
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/result/AbstractActionResult.java
0 → 100644
View file @
f720f850
package
com
.
yeejoin
.
amos
.
fas
.
business
.
action
.
result
;
import
com.yeejoin.amos.fas.business.service.model.ToipResponse
;
import
com.yeejoin.amos.fas.dao.entity.BusinessEntity
;
public
abstract
class
AbstractActionResult
implements
ActionResult
{
public
ToipResponse
toipResponse
;
/**
* 智能体业务对象
*/
private
BusinessEntity
bizObj
;
public
ToipResponse
getToipResponse
()
{
return
toipResponse
;
}
public
void
setToipResponse
(
ToipResponse
toipResponse
)
{
this
.
toipResponse
=
toipResponse
;
}
public
BusinessEntity
getBizObj
()
{
return
bizObj
;
}
public
void
setBizObj
(
BusinessEntity
bizObj
)
{
this
.
bizObj
=
bizObj
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/result/ActionResult.java
0 → 100644
View file @
f720f850
package
com
.
yeejoin
.
amos
.
fas
.
business
.
action
.
result
;
import
java.util.List
;
import
com.alibaba.fastjson.JSON
;
public
interface
ActionResult
{
public
JSON
toJson
();
public
void
addAll
(
List
<
Object
>
data
);
public
void
add
(
Object
data
);
public
List
<?>
getData
();
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/result/BubbleTipResult.java
0 → 100644
View file @
f720f850
package
com
.
yeejoin
.
amos
.
fas
.
business
.
action
.
result
;
import
java.util.HashMap
;
import
java.util.Map
;
import
com.alibaba.fastjson.JSON
;
public
class
BubbleTipResult
extends
SimpleResult
{
@Override
public
JSON
toJson
()
{
// TODO Auto-generated method stub
Map
<
String
,
Object
>
results
=
new
HashMap
<>();
for
(
Map
<
String
,
Object
>
tempMap
:
data
)
{
for
(
Map
.
Entry
<
String
,
Object
>
entry
:
tempMap
.
entrySet
())
{
results
.
put
(
entry
.
getKey
(),
entry
.
getValue
());
}
}
return
(
JSON
)
JSON
.
toJSON
(
results
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/result/RiskSituationResult.java
0 → 100644
View file @
f720f850
package
com
.
yeejoin
.
amos
.
fas
.
business
.
action
.
result
;
import
java.util.HashMap
;
import
java.util.Map
;
import
com.alibaba.fastjson.JSON
;
public
class
RiskSituationResult
extends
SimpleResult
{
@Override
public
JSON
toJson
()
{
// TODO Auto-generated method stub
Map
<
String
,
Object
>
results
=
new
HashMap
<>();
for
(
Map
<
String
,
Object
>
tempMap
:
data
)
{
for
(
Map
.
Entry
<
String
,
Object
>
entry
:
tempMap
.
entrySet
())
{
results
.
put
(
entry
.
getKey
(),
entry
.
getValue
());
}
}
return
(
JSON
)
JSON
.
toJSON
(
results
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/result/SimpleResult.java
0 → 100644
View file @
f720f850
package
com
.
yeejoin
.
amos
.
fas
.
business
.
action
.
result
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
com.alibaba.fastjson.JSON
;
import
com.yeejoin.amos.fas.business.util.JSONUtil
;
public
class
SimpleResult
extends
AbstractActionResult
implements
ActionResult
{
List
<
Map
<
String
,
Object
>>
data
=
new
ArrayList
<>();
@Override
public
JSON
toJson
()
{
List
<
Map
<
String
,
Object
>>
results
=
new
ArrayList
<>();
for
(
Map
<
String
,
Object
>
tempMap
:
data
)
{
for
(
Map
.
Entry
<
String
,
Object
>
entry
:
tempMap
.
entrySet
())
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
result
.
put
(
"label"
,
entry
.
getKey
());
result
.
put
(
"value"
,
entry
.
getValue
());
results
.
add
(
result
);
}
}
return
(
JSON
)
JSON
.
toJSON
(
results
);
}
@Override
public
void
addAll
(
List
<
Object
>
data
)
{
// this.data.addAll((Collection<? extends Map<String, Object>>) data);
}
@Override
public
void
add
(
Object
data
)
{
this
.
data
.
add
(
JSONUtil
.
toMap
(
JSONUtil
.
toJson
(
data
)));
}
public
void
add
(
String
key
,
Object
value
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
key
,
value
);
this
.
data
.
add
(
map
);
}
@Override
public
List
<
Map
<
String
,
Object
>>
getData
()
{
// TODO Auto-generated method stub
return
data
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/result/TipResult.java
0 → 100644
View file @
f720f850
package
com
.
yeejoin
.
amos
.
fas
.
business
.
action
.
result
;
import
java.util.HashMap
;
import
java.util.Map
;
import
com.alibaba.fastjson.JSON
;
public
class
TipResult
extends
SimpleResult
{
@Override
public
JSON
toJson
()
{
// TODO Auto-generated method stub
Map
<
String
,
Object
>
results
=
new
HashMap
<>();
for
(
Map
<
String
,
Object
>
tempMap
:
data
)
{
for
(
Map
.
Entry
<
String
,
Object
>
entry
:
tempMap
.
entrySet
())
{
results
.
put
(
entry
.
getKey
(),
entry
.
getValue
());
}
}
return
(
JSON
)
JSON
.
toJSON
(
results
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/result/message/AbstractActionResultMessage.java
0 → 100644
View file @
f720f850
package
com
.
yeejoin
.
amos
.
fas
.
business
.
action
.
result
.
message
;
import
java.io.IOException
;
import
com.yeejoin.amos.fas.business.action.result.AbstractActionResult
;
import
com.yeejoin.amos.fas.business.action.result.ActionResult
;
import
com.yeejoin.amos.fas.business.action.websocket.RuleWebSocket
;
import
com.yeejoin.amos.fas.business.service.model.ToipResponse
;
import
com.yeejoin.amos.fas.business.util.Constants
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
public
abstract
class
AbstractActionResultMessage
<
R
extends
ToipResponse
>
implements
ActionResultMessage
<
ToipResponse
>
{
protected
ActionResult
actionResult
;
@Override
public
ToipResponse
execute
(
String
firstStr
,
String
secondStr
,
String
thirdStr
)
throws
IOException
,
Exception
{
ToipResponse
response
=
buildResponse
(
firstStr
,
secondStr
,
thirdStr
,
getActionResultByDataFormat
()
==
null
?
actionResult
.
getData
():
getActionResultByDataFormat
(),
actionResult
);
if
(!
actionResult
.
getData
().
isEmpty
())
{
sendResponse
(
response
);
}
return
response
;
}
protected
abstract
Object
getActionResultByDataFormat
();
/**
*
* <pre>
* 构建对象
* </pre>
*
* @param viewTemp
* @param obj
* @return
*/
public
ToipResponse
buildResponse
(
String
firstIfDomain
,
String
secondIfDomain
,
String
thirdIfDomain
,
Object
obj
,
ActionResult
actionResult
)
{
ToipResponse
toipResponse
=
new
ToipResponse
();
toipResponse
.
setIFDomain
(
firstIfDomain
);
toipResponse
.
setTemplate
(
secondIfDomain
+
"_"
+
thirdIfDomain
);
toipResponse
.
setGroup
(
""
);
// group值暂填充至temolate中
// toipResponse.setActionId(ruleAction.getId());
// toipResponse.setBizId(
// ((AbstractActionResult) actionResult).getBizObj().getId());
toipResponse
.
setBizObj
(((
AbstractActionResult
)
actionResult
).
getBizObj
());
toipResponse
.
setResult
(
Constants
.
RESULT_SUCCESS
);
toipResponse
.
setDataList
(
obj
);
return
toipResponse
;
}
/**
*
* <pre>
* 发送数据
* </pre>
*
* @param response
* @throws IOException
* @throws Exception
*/
protected
void
sendResponse
(
CommonResponse
response
)
throws
IOException
,
Exception
{
RuleWebSocket
.
sendInfo
(
response
.
toJsonStr
());
System
.
out
.
println
(
"数据发送成功>>>>>>>>"
+
response
.
toJsonStr
());
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/result/message/ActionResultMessage.java
0 → 100644
View file @
f720f850
package
com
.
yeejoin
.
amos
.
fas
.
business
.
action
.
result
.
message
;
import
java.io.IOException
;
public
interface
ActionResultMessage
<
T
>
{
/**
*
* <pre>
*
* </pre>
*
* @param firstStr 一级界面域
* @param secondStr 二级界面域
* @param thirdStr 三级界面域
* @return
* @throws IOException
* @throws Exception
*/
T
execute
(
String
firstStr
,
String
secondStr
,
String
thirdStr
)
throws
IOException
,
Exception
;
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/result/message/BubbleTipResultMessage.java
0 → 100644
View file @
f720f850
package
com
.
yeejoin
.
amos
.
fas
.
business
.
action
.
result
.
message
;
import
com.yeejoin.amos.fas.business.action.result.ActionResult
;
/**
*
* <pre>
* 气泡消息提示
* </pre>
*
* @author amos
* @version $Id: BubbleTipResultMessage.java, v 0.1 2019年5月16日 下午1:52:36 amos Exp $
*/
public
class
BubbleTipResultMessage
extends
SimpleResultMessage
{
public
BubbleTipResultMessage
(
ActionResult
actionResult
)
{
super
(
actionResult
);
// TODO Auto-generated constructor stub
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/result/message/RiskSituationResultMessage.java
0 → 100644
View file @
f720f850
package
com
.
yeejoin
.
amos
.
fas
.
business
.
action
.
result
.
message
;
import
com.yeejoin.amos.fas.business.action.result.ActionResult
;
/**
*
* <pre>
* 气泡消息提示
* </pre>
*
* @author amos
* @version $Id: BubbleTipResultMessage.java, v 0.1 2019年5月16日 下午1:52:36 amos Exp $
*/
public
class
RiskSituationResultMessage
extends
SimpleResultMessage
{
public
RiskSituationResultMessage
(
ActionResult
actionResult
)
{
super
(
actionResult
);
// TODO Auto-generated constructor stub
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/result/message/SimpleResultMessage.java
0 → 100644
View file @
f720f850
package
com
.
yeejoin
.
amos
.
fas
.
business
.
action
.
result
.
message
;
import
com.yeejoin.amos.fas.business.action.result.ActionResult
;
import
com.yeejoin.amos.fas.business.service.model.ToipResponse
;
/**
*
* <pre>
* 简单文本输入
* </pre>
*
* @author amos
* @version $Id: SimpleResultMessage.java, v 0.1 2019年4月25日 下午1:57:33 amos Exp $
*/
public
class
SimpleResultMessage
extends
AbstractActionResultMessage
<
ToipResponse
>
{
public
SimpleResultMessage
(
ActionResult
actionResult
)
{
this
.
actionResult
=
actionResult
;
}
@Override
protected
Object
getActionResultByDataFormat
()
{
return
actionResult
.
toJson
();
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/result/message/TipResultMessage.java
0 → 100644
View file @
f720f850
package
com
.
yeejoin
.
amos
.
fas
.
business
.
action
.
result
.
message
;
import
com.yeejoin.amos.fas.business.action.result.ActionResult
;
/**
*
* <pre>
* 消息提示
* </pre>
*
* @author amos
* @version $Id: TipResultMessage.java, v 0.1 2019年4月25日 上午11:47:13 amos Exp $
*/
public
class
TipResultMessage
extends
SimpleResultMessage
{
public
TipResultMessage
(
ActionResult
actionResult
)
{
super
(
actionResult
);
// TODO Auto-generated constructor stub
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/util/ReflectUtil.java
0 → 100644
View file @
f720f850
package
com
.
yeejoin
.
amos
.
fas
.
business
.
action
.
util
;
import
java.lang.annotation.Annotation
;
import
java.lang.reflect.AnnotatedElement
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Method
;
import
java.lang.reflect.Modifier
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
/**
*
* <pre>
* 反射工具类
* </pre>
*
* @author HK
* @version $Id: ReflectUtil.java, v 0.1 2017年12月25日 下午8:05:45 HK Exp $
*/
public
class
ReflectUtil
{
private
final
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ReflectUtil
.
class
);
/**
*
* <pre>
* 设置属性值
* </pre>
*
* @param target
* 目标对象
* @param fname
* 字段名称
* @param ftype
* 字典类型
* @param fvalue
* 字段值
*/
@SuppressWarnings
({
"rawtypes"
,
"unchecked"
})
public
static
void
setFieldValue
(
Object
target
,
String
fname
,
Class
ftype
,
Object
fvalue
)
{
// 设置字段值 如:username 字段,setUsername(String username)
if
(
target
==
null
||
fname
==
null
||
""
.
equals
(
fname
)
||
(
fvalue
!=
null
&&
!
ftype
.
isAssignableFrom
(
fvalue
.
getClass
())))
{
// 如果类型不匹配,直接退出
return
;
}
Class
clazz
=
target
.
getClass
();
try
{
// 先通过setXxx()方法设置类属性值
String
methodname
=
"set"
+
Character
.
toUpperCase
(
fname
.
charAt
(
0
))
+
fname
.
substring
(
1
);
// System.out.println(methodname);
Method
method
=
clazz
.
getDeclaredMethod
(
methodname
,
ftype
);
// 获取定义的方法
if
(!
Modifier
.
isPublic
(
method
.
getModifiers
()))
{
// 设置非共有方法权限
method
.
setAccessible
(
true
);
}
method
.
invoke
(
target
,
fvalue
);
// 执行方法回调
}
catch
(
Exception
me
)
{
// 如果set方法不存在,则直接设置类属性值
try
{
Field
field
=
clazz
.
getDeclaredField
(
fname
);
// 获取定义的类属性
if
(!
Modifier
.
isPublic
(
field
.
getModifiers
()))
{
// 设置非共有类属性权限
field
.
setAccessible
(
true
);
}
field
.
set
(
target
,
fvalue
);
// 设置类属性值
}
catch
(
Exception
fe
)
{
if
(
logger
.
isDebugEnabled
())
{
logger
.
debug
(
fe
.
getMessage
());
}
}
}
}
/**
*
* <pre>
* 获取属性值
* </pre>
*
* @param target
* 目标对象
* @param fname
* 字段名称
* @param ftype
* 字段类型
* @return
*/
@SuppressWarnings
({
"rawtypes"
,
"unchecked"
})
public
static
Object
getFieldValue
(
Object
target
,
String
fname
,
Class
ftype
)
{
// 获取字段值 如:username 字段,getUsername()
if
(
target
==
null
||
fname
==
null
||
""
.
equals
(
fname
))
{
return
null
;
}
Class
clazz
=
target
.
getClass
();
try
{
// 先通过getXxx()方法获取类属性值
String
methodname
=
"get"
+
Character
.
toUpperCase
(
fname
.
charAt
(
0
))
+
fname
.
substring
(
1
);
// System.out.println(methodname);
Method
method
=
clazz
.
getDeclaredMethod
(
methodname
);
// 获取定义的方法
if
(!
Modifier
.
isPublic
(
method
.
getModifiers
()))
{
// 设置非共有方法权限
method
.
setAccessible
(
true
);
}
return
method
.
invoke
(
target
);
// 方法回调,返回值
}
catch
(
Exception
me
)
{
// 如果get方法不存在,则直接获取类属性值
if
(
logger
.
isDebugEnabled
())
{
logger
.
debug
(
me
.
getMessage
());
}
try
{
Field
field
=
clazz
.
getDeclaredField
(
fname
);
// 获取定义的类属性
if
(!
Modifier
.
isPublic
(
field
.
getModifiers
()))
{
// 设置非共有类属性权限
field
.
setAccessible
(
true
);
}
return
field
.
get
(
target
);
// 返回类属性值
}
catch
(
Exception
fe
)
{
if
(
logger
.
isDebugEnabled
())
{
logger
.
debug
(
fe
.
getMessage
());
}
}
}
return
null
;
}
public
static
<
E
>
E
newInstance
(
final
Class
<?
extends
E
>
clazz
)
{
try
{
return
clazz
.
newInstance
();
}
catch
(
final
Exception
e
)
{
logger
.
warn
(
"Could not instantiate {}: {}"
,
clazz
,
e
);
if
(
e
instanceof
RuntimeException
)
{
throw
(
RuntimeException
)
e
;
}
throw
new
IllegalStateException
(
e
);
}
}
public
static
<
A
extends
Annotation
>
A
getAnnotation
(
final
Enum
<?>
enumConstant
,
final
Class
<
A
>
annotationClass
)
{
try
{
final
Field
field
=
enumConstant
.
getClass
()
.
getDeclaredField
(
enumConstant
.
name
());
return
getAnnotation
(
field
,
annotationClass
);
}
catch
(
final
Exception
e
)
{
throw
new
IllegalStateException
(
e
);
}
}
public
static
<
A
extends
Annotation
>
A
getAnnotation
(
final
AnnotatedElement
element
,
final
Class
<
A
>
annotationClass
)
{
final
A
annotation
=
element
.
getAnnotation
(
annotationClass
);
if
(
annotation
==
null
&&
element
instanceof
Method
)
{
// check for annotations on overridden methods. Since Java 8
// those are not returned by .getAnnotation(...)
final
Method
m
=
(
Method
)
element
;
final
Class
<?>
declaringClass
=
m
.
getDeclaringClass
();
final
Class
<?>
superClass
=
declaringClass
.
getSuperclass
();
final
String
methodName
=
m
.
getName
();
final
Class
<?>[]
methodParameterTypes
=
m
.
getParameterTypes
();
if
(
superClass
!=
null
)
{
try
{
final
Method
overriddenMethod
=
superClass
.
getMethod
(
methodName
,
methodParameterTypes
);
return
getAnnotation
(
overriddenMethod
,
annotationClass
);
}
catch
(
final
NoSuchMethodException
e
)
{
logger
.
debug
(
"Failed to get overridden method '{}' from {}"
,
methodName
,
superClass
);
}
}
// check for annotations on interface methods too.
final
Class
<?>[]
interfaces
=
declaringClass
.
getInterfaces
();
for
(
final
Class
<?>
interfaceClass
:
interfaces
)
{
try
{
final
Method
overriddenMethod
=
interfaceClass
.
getMethod
(
methodName
,
methodParameterTypes
);
return
getAnnotation
(
overriddenMethod
,
annotationClass
);
}
catch
(
final
NoSuchMethodException
e
)
{
logger
.
debug
(
"Failed to get overridden method '{}' from {}"
,
methodName
,
interfaceClass
);
}
}
}
if
(
annotation
==
null
&&
element
instanceof
Class
<?>){
final
Class
<?>
clazz
=
(
Class
<?>)
element
;
// final Class<?> declaringClass = clazz.getDeclaringClass();
final
Class
<?>
superClass
=
clazz
.
getSuperclass
();
if
(
superClass
!=
null
)
{
return
getAnnotation
(
superClass
,
annotationClass
);
}
}
return
annotation
;
}
public
static
boolean
isAnnotationPresent
(
final
Enum
<?>
enumConstant
,
final
Class
<?
extends
Annotation
>
annotationClass
)
{
try
{
final
Field
field
=
enumConstant
.
getClass
()
.
getDeclaredField
(
enumConstant
.
name
());
return
isAnnotationPresent
(
field
,
annotationClass
);
}
catch
(
final
Exception
e
)
{
throw
new
IllegalStateException
(
e
);
}
}
public
static
boolean
isAnnotationPresent
(
final
AnnotatedElement
element
,
final
Class
<?
extends
Annotation
>
annotationClass
)
{
return
getAnnotation
(
element
,
annotationClass
)
!=
null
;
}
public
static
Field
[]
getAllFields
(
String
clazzName
,
final
Class
<?
extends
Annotation
>
withAnnotation
)
throws
ClassNotFoundException
{
final
List
<
Field
>
result
=
new
ArrayList
<>();
final
Field
[]
fields
=
getAllFields
(
Class
.
forName
(
clazzName
));
for
(
final
Field
field
:
fields
)
{
if
(
isAnnotationPresent
(
field
,
withAnnotation
))
{
result
.
add
(
field
);
}
}
return
result
.
toArray
(
new
Field
[
result
.
size
()]);
}
public
static
Field
[]
getAllFields
(
final
Class
<?>
clazz
,
final
Class
<?
extends
Annotation
>
withAnnotation
)
{
final
List
<
Field
>
result
=
new
ArrayList
<>();
final
Field
[]
fields
=
getAllFields
(
clazz
);
for
(
final
Field
field
:
fields
)
{
if
(
isAnnotationPresent
(
field
,
withAnnotation
))
{
result
.
add
(
field
);
}
}
return
result
.
toArray
(
new
Field
[
result
.
size
()]);
}
public
static
Field
[]
getAllFields
(
final
Class
<?>
clazz
)
{
final
List
<
Field
>
allFields
=
new
ArrayList
<>();
addFields
(
allFields
,
clazz
);
return
allFields
.
toArray
(
new
Field
[
allFields
.
size
()]);
}
private
static
void
addFields
(
final
List
<
Field
>
allFields
,
final
Class
<?>
clazz
)
{
addFields
(
allFields
,
clazz
,
false
);
}
private
static
void
addFields
(
final
List
<
Field
>
allFields
,
final
Class
<?>
clazz
,
final
boolean
excludeSynthetic
)
{
if
(
clazz
==
Object
.
class
)
{
return
;
}
final
Field
[]
f
=
clazz
.
getDeclaredFields
();
for
(
final
Field
field
:
f
)
{
if
(
excludeSynthetic
&&
field
.
isSynthetic
())
{
continue
;
}
allFields
.
add
(
field
);
}
final
Class
<?>
superclass
=
clazz
.
getSuperclass
();
addFields
(
allFields
,
superclass
,
excludeSynthetic
);
}
public
static
Method
[]
getMethods
(
final
Class
<?>
clazz
,
final
Class
<?
extends
Annotation
>
withAnnotation
)
{
final
List
<
Method
>
result
=
new
ArrayList
<>();
final
Method
[]
methods
=
getMethods
(
clazz
);
for
(
final
Method
method
:
methods
)
{
if
(
isAnnotationPresent
(
method
,
withAnnotation
))
{
result
.
add
(
method
);
}
}
return
result
.
toArray
(
new
Method
[
result
.
size
()]);
}
public
static
Method
[]
getMethods
(
final
Class
<?>
clazz
)
{
final
List
<
Method
>
allMethods
=
new
ArrayList
<>();
addMethods
(
allMethods
,
clazz
);
return
allMethods
.
toArray
(
new
Method
[
allMethods
.
size
()]);
}
private
static
void
addMethods
(
final
List
<
Method
>
allMethods
,
final
Class
<?>
clazz
)
{
if
(
clazz
==
Object
.
class
||
clazz
==
null
)
{
return
;
}
final
Method
[]
methods
=
clazz
.
getMethods
();
for
(
final
Method
method
:
methods
)
{
final
Class
<?>
declaringClass
=
method
.
getDeclaringClass
();
if
(
declaringClass
!=
Object
.
class
)
{
allMethods
.
add
(
method
);
}
}
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/websocket/RuleWebSocket.java
0 → 100644
View file @
f720f850
package
com
.
yeejoin
.
amos
.
fas
.
business
.
action
.
websocket
;
import
java.io.IOException
;
import
java.util.Observable
;
import
java.util.Observer
;
import
java.util.concurrent.CopyOnWriteArraySet
;
import
javax.websocket.OnClose
;
import
javax.websocket.OnError
;
import
javax.websocket.OnMessage
;
import
javax.websocket.OnOpen
;
import
javax.websocket.Session
;
import
javax.websocket.server.ServerEndpoint
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.stereotype.Component
;
/**
*
* <pre>
* rule webSocket定义
* </pre>
*
* @author amos
* @version $Id: RuleWebSocket.java, v 0.1 2019年5月20日 下午4:59:50 amos Exp $
*/
@Component
@ServerEndpoint
(
value
=
"/rule.ws"
)
public
class
RuleWebSocket
implements
Observer
{
private
final
static
Logger
log
=
LoggerFactory
.
getLogger
(
RuleWebSocket
.
class
);
// 静态变量,用来记录当前在线连接数。应该把它设计成线程安全的。
private
static
int
onlineCount
=
0
;
// concurrent包的线程安全Set,用来存放每个客户端对应的MyWebSocket对象。
private
static
CopyOnWriteArraySet
<
RuleWebSocket
>
webSocketSet
=
new
CopyOnWriteArraySet
<
RuleWebSocket
>();
// 与某个客户端的连接会话,需要通过它来给客户端发送数据
private
Session
session
;
private
Observable
ob
;
private
String
name
;
/**
* 连接建立成功调用的方法
*/
@OnOpen
public
void
onOpen
(
Session
session
)
{
this
.
session
=
session
;
webSocketSet
.
add
(
this
);
// 加入set中
addOnlineCount
();
// 在线数加1
log
.
debug
(
"有新连接加入!当前在线人数为"
+
getOnlineCount
());
subscribeTopics
(
session
);
}
/**
*
* <pre>
* 订阅指挥
* </pre>
*
*/
public
void
subscribeTopics
(
Session
session
)
{
// this.ob = GlobalDispatch.getInstance();
// GlobalDispatch.getInstance().addObserver(this);
log
.
info
(
"成功加入规则主题"
);
}
/**
* 连接关闭调用的方法
*/
@OnClose
public
void
onClose
()
{
webSocketSet
.
remove
(
this
);
// 从set中删除
subOnlineCount
();
// 在线数减1
log
.
debug
(
"有一连接关闭!当前在线人数为"
+
getOnlineCount
());
if
(
ob
!=
null
)
{
ob
.
deleteObserver
(
this
);
}
}
/**
* 收到客户端消息后调用的方法
*
* @param message
* 客户端发送过来的消息
*/
@OnMessage
public
void
onMessage
(
String
message
,
Session
session
)
{
log
.
info
(
"来自客户端的消息:"
+
message
);
}
@OnError
public
void
onError
(
Session
session
,
Throwable
error
)
{
log
.
error
(
"发生错误"
,
error
);
}
public
void
sendMessage
(
String
message
)
throws
IOException
{
this
.
session
.
getBasicRemote
().
sendText
(
message
);
// this.session.getAsyncRemote().sendText(message);
}
/**
* 群发自定义消息
*/
public
static
void
sendInfo
(
String
message
)
throws
IOException
{
log
.
debug
(
"——----RuleWebSocket开始群发消息------"
);
log
.
debug
(
"消息内容为:"
+
message
);
for
(
RuleWebSocket
item
:
webSocketSet
)
{
try
{
item
.
sendMessage
(
message
);
}
catch
(
IOException
e
)
{
log
.
error
(
item
.
session
.
getId
()
+
"消息发送失败"
,
e
);
continue
;
}
}
log
.
debug
(
"——----RuleWebSocket结束群发消息------"
);
}
public
static
synchronized
int
getOnlineCount
()
{
return
onlineCount
;
}
public
static
synchronized
void
addOnlineCount
()
{
RuleWebSocket
.
onlineCount
++;
}
public
static
synchronized
void
subOnlineCount
()
{
RuleWebSocket
.
onlineCount
--;
}
@Override
public
void
update
(
Observable
o
,
Object
arg
)
{
try
{
if
(
session
.
isOpen
())
{
sendMessage
(
arg
.
toString
());
log
.
debug
(
"session"
+
name
+
"消息发送成功"
);
}
else
{
o
.
deleteObserver
(
this
);
log
.
debug
(
"session"
+
name
+
"消息发送失败:"
+
"session已经失去连接"
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"session"
+
name
+
"消息发送失败:"
+
e
.
getMessage
());
}
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/websocket/WebSocketConfig.java
0 → 100644
View file @
f720f850
package
com
.
yeejoin
.
amos
.
fas
.
business
.
action
.
websocket
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.socket.server.standard.ServerEndpointExporter
;
@Configuration
public
class
WebSocketConfig
{
@Bean
public
ServerEndpointExporter
serverEndpointExporter
()
{
return
new
ServerEndpointExporter
();
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/FireCarController.java
View file @
f720f850
...
...
@@ -3,6 +3,7 @@ package com.yeejoin.amos.fas.business.controller;
import
java.util.Date
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -69,8 +70,9 @@ public class FireCarController extends BaseController {
//@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"上传消防车图片"
,
notes
=
"上传消防车图片"
)
@RequestMapping
(
value
=
"/uploadCarImg"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
uploadCarImg
(
@ApiParam
(
value
=
"消防车图片"
,
required
=
false
)
@RequestParam
(
value
=
"file"
,
required
=
false
)
MultipartFile
[]
file
,
FireCar
fireCar
)
{
public
CommonResponse
uploadCarImg
(
@ApiParam
(
value
=
"消防车图片"
,
required
=
false
)
@RequestParam
(
value
=
"file"
,
required
=
false
)
MultipartFile
[]
file
,
FireCar
fireCar
,
BindingResult
bindingResult
)
{
System
.
out
.
print
(
fireCar
);
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
fireCar
.
setOrgCode
(
compCode
);
...
...
@@ -78,5 +80,4 @@ public class FireCarController extends BaseController {
fireCarService
.
saveFireCarAndPhoto
(
fireCar
,
file
);
return
CommonResponseUtil
.
success
();
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/FireStationController.java
View file @
f720f850
...
...
@@ -55,7 +55,12 @@ public class FireStationController extends BaseController {
fireStationFireEquipment
.
setCreateBy
(
"0"
);
fireStationFireEquipment
.
setCreateDate
(
new
Date
());
}
return
CommonResponseUtil
.
success
(
iFireStationService
.
saveStationFireEquipment
(
fireStationFireEquipments
));
try
{
List
<
FireStationFireEquipment
>
fireStationFireEquipments1
=
iFireStationService
.
saveStationFireEquipment
(
fireStationFireEquipments
);
return
CommonResponseUtil
.
success
(
fireStationFireEquipments1
);
}
catch
(
Exception
e
){
return
CommonResponseUtil
.
failure
(
e
.
getMessage
());
}
}
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"解除绑定消防设备"
,
notes
=
"解除绑定消防设备"
)
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/View3dController.java
View file @
f720f850
...
...
@@ -178,7 +178,7 @@ public class View3dController extends BaseController {
public
CommonResponse
get3dPointsByType
(
@RequestParam
(
required
=
false
,
defaultValue
=
"grain"
)
String
model
){
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
return
CommonResponseUtil
.
success
(
view3dService
.
get3dPointsByModel
(
orgCode
,
model
)
);
return
view3dService
.
get3dPointsByModel
(
orgCode
,
model
);
}
@Scheduled
(
cron
=
"${param.safetyIndexChange.cron}"
)
...
...
@@ -215,11 +215,16 @@ public class View3dController extends BaseController {
@RequestParam
(
required
=
false
)
String
type
,
@RequestParam
(
required
=
false
)
String
inputText
,
@RequestParam
(
required
=
true
)
int
current
,
@RequestParam
(
required
=
true
)
int
pageSize
@RequestParam
(
required
=
true
)
int
pageSize
,
@RequestParam
(
required
=
false
)
String
dataLevel
,
@RequestParam
(
required
=
false
)
String
protectObjName
)
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
return
view3dService
.
retrieveAll
(
type
,
inputText
,
current
,
pageSize
,
orgCode
);
String
token
=
this
.
getToken
();
String
appKey
=
this
.
getAppKey
();
String
product
=
this
.
getProduct
();
return
view3dService
.
retrieveAll
(
type
,
inputText
,
current
,
pageSize
,
orgCode
,
dataLevel
,
protectObjName
,
token
,
appKey
,
product
);
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/FireStrengthMapper.java
View file @
f720f850
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.ibatis.annotations.Param
;
import
com.yeejoin.amos.fas.dao.entity.FireStrength
;
public
interface
FireStrengthMapper
extends
BaseMapper
{
Map
queryOne
(
@Param
(
"id"
)
Long
id
);
List
<
Map
>
queryForPage
(
@Param
(
"username"
)
String
username
,
@Param
(
"code"
)
String
code
,
@Param
(
"start"
)
long
start
,
@Param
(
"length"
)
Integer
length
);
Long
queryCountForPage
(
@Param
(
"username"
)
String
username
,
@Param
(
"code"
)
String
code
);
List
<
FireStrength
>
queryForStrengthList
(
@Param
(
"time"
)
String
time
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/RuleRuningSnapshotMapper.java
0 → 100644
View file @
f720f850
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
mapper
;
import
java.util.List
;
import
com.yeejoin.amos.fas.business.service.model.RuleRuningSnapshot
;
public
interface
RuleRuningSnapshotMapper
extends
BaseMapper
{
RuleRuningSnapshot
querForObject
(
String
batchNo
);
List
<
RuleRuningSnapshot
>
querForObjectList
(
String
batchNo
);
void
save
(
RuleRuningSnapshot
ruleRuningSnapshot
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/View3dMapper.java
View file @
f720f850
...
...
@@ -146,7 +146,7 @@ public interface View3dMapper extends BaseMapper{
List
<
Node3DVoResponse
>
findViewDataByType
(
String
type
,
Long
riskSourceId
,
String
orgCode
);
Long
retrieveAllCount
(
String
type
,
String
inputText
,
String
orgCode
);
Long
retrieveAllCount
(
String
type
,
String
inputText
,
String
orgCode
,
String
dataLevel
,
String
protectObjName
);
List
<
HashMap
<
String
,
Object
>>
retrieveAll
(
String
type
,
String
inputText
,
long
start
,
int
length
,
String
orgCode
);
List
<
HashMap
<
String
,
Object
>>
retrieveAll
(
String
type
,
String
inputText
,
long
start
,
int
length
,
String
orgCode
,
String
dataLevel
,
String
protectObjName
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/ContingencyInstanceImpl.java
View file @
f720f850
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
impl
;
import
com.yeejoin.amos.component.rule.RuleTrigger
;
import
com.yeejoin.amos.fas.business.action.ContingencyAction
;
import
com.yeejoin.amos.fas.business.action.result.BubbleTipResult
;
import
com.yeejoin.amos.fas.business.dao.mapper.ImpAndFireEquipMapper
;
import
com.yeejoin.amos.fas.business.dao.repository.IContingencyOriginalDataDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IContingencyPlanInstanceRepository
;
...
...
@@ -11,6 +14,7 @@ import com.yeejoin.amos.fas.business.service.model.OperateGroup;
import
com.yeejoin.amos.fas.dao.entity.ContingencyOriginalData
;
import
com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance
;
import
com.yeejoin.amos.fas.dao.entity.Equipment
;
import
org.codehaus.jackson.map.ObjectMapper
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -63,6 +67,8 @@ public class ContingencyInstanceImpl /*extends GenericManagerImpl<ContingencyPla
private
static
Map
<
String
,
String
>
stepMap
=
new
HashMap
<>();
@Autowired
private
RuleTrigger
ruleTrigger
;
/* public ContingencyInstanceImpl(IContingencyPlanInstanceRepository repository) {
super(repository);
...
...
@@ -169,11 +175,16 @@ public class ContingencyInstanceImpl /*extends GenericManagerImpl<ContingencyPla
Equipment
equipment
=
impAndFireEquipMapper
.
queryImpEqumtByFireEquipmt
(
Long
.
parseLong
(
contingencyRo
.
getFireEquipmentId
()));
Object
result
=
remoteRuleServer
.
fireRuleFlow
(
contingencyRo
,
equipment
.
getReservePlan
(),
equipment
.
getName
());
String
url
=
remoteRuleUrl
+
"/urule/rule/refreshTimeline?batchNo="
+
batchNo
;
restTemplate
.
exchange
(
url
,
HttpMethod
.
GET
,
HttpEntity
.
EMPTY
,
Object
.
class
);
//Object result = remoteRuleServer.fireRuleFlow(contingencyRo, equipment.getReservePlan(),equipment.getName());
ruleTrigger
.
publish
(
contingencyRo
,
equipment
.
getReservePlan
());
BubbleTipResult
result1
=
new
BubbleTipResult
();
Map
<
String
,
Object
>
tempmap2
=
new
HashMap
<>();
tempmap2
.
put
(
"refresh"
,
"refresh"
);
tempmap2
.
put
(
"batchNo"
,
batchNo
);
ContingencyAction
.
sendcmd
(
"fromws"
,
"recordArea"
,
"refresh"
,
result1
);
// String url = remoteRuleUrl + "/urule/rule/refreshTimeline?batchNo=" + batchNo;
//restTemplate.exchange(url, HttpMethod.GET, HttpEntity.EMPTY, Object.class);
}
else
{
throw
new
Exception
(
"数据异常,请联系管理员."
);
}
...
...
@@ -258,4 +269,9 @@ public class ContingencyInstanceImpl /*extends GenericManagerImpl<ContingencyPla
}
@Override
public
void
updateStep
(
String
step
,
String
batchNo
)
{
// TODO Auto-generated method stub
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/FireCarServiceImpl.java
View file @
f720f850
...
...
@@ -105,7 +105,7 @@ public class FireCarServiceImpl implements IFireCarService {
List
<
DepartmentModel
>
depts
=
remoteSecurityService
.
listDepartmentByDeptIds
(
toke
,
product
,
appKey
,
Joiner
.
on
(
","
).
join
(
deptIds
));
Map
<
Long
,
String
>
deptMap
=
depts
.
stream
().
collect
(
Collectors
.
toMap
(
DepartmentModel:
:
getSequenceNbr
,
DepartmentModel:
:
getDepartmentName
));
content
.
forEach
(
e
->
{
e
.
put
(
"departmentName"
,
deptMap
.
get
(
e
.
get
(
"dept_id"
)));
e
.
put
(
"departmentName"
,
deptMap
.
get
(
Long
.
valueOf
(
e
.
get
(
"dept_id"
).
toString
()
)));
});
}
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/FireStrengthServiceImpl.java
View file @
f720f850
...
...
@@ -17,57 +17,46 @@ import java.util.Optional;
@Service
(
"fireStengthService"
)
public
class
FireStrengthServiceImpl
implements
FireStengthService
{
@Autowired
private
FireStrengthPointDao
fireStrengthPointDao
;
@Autowired
private
FireStrengthMapper
fireStrengthMapper
;
public
FireStrength
savePoint
(
FireStrength
fireEquipmentPoint
)
{
public
FireStrength
savePoint
(
FireStrength
fireEquipmentPoint
)
{
return
fireStrengthPointDao
.
save
(
fireEquipmentPoint
);
}
public
Map
queryOne
(
Long
id
)
{
public
Map
queryOne
(
Long
id
)
{
return
fireStrengthMapper
.
queryOne
(
id
);
}
public
String
[]
deletePoint
(
String
[]
idArray
)
throws
Exception
{
for
(
String
id:
idArray
)
{
public
String
[]
deletePoint
(
String
[]
idArray
)
throws
Exception
{
for
(
String
id
:
idArray
)
{
Optional
<
FireStrength
>
fireEquipmentPoint1
=
fireStrengthPointDao
.
findById
(
Long
.
parseLong
(
id
));
FireStrength
fireEquipmentPoint
=
null
;
if
(
fireEquipmentPoint1
.
isPresent
())
{
fireEquipmentPoint
=
fireEquipmentPoint1
.
get
();
FireStrength
fireEquipmentPoint
=
null
;
if
(
fireEquipmentPoint1
.
isPresent
())
{
fireEquipmentPoint
=
fireEquipmentPoint1
.
get
();
}
if
(
fireEquipmentPoint
!=
null
)
{
if
(
fireEquipmentPoint
!=
null
)
{
this
.
fireStrengthPointDao
.
deleteById
(
Long
.
parseLong
(
id
));
}
else
{
throw
new
Exception
(
"找不到指定的监测点:"
+
id
);
}
else
{
throw
new
Exception
(
"找不到指定的监测点:"
+
id
);
}
}
return
idArray
;
}
public
Page
queryByFireEquimt
(
String
username
,
String
code
,
CommonPageable
pageable
)
{
Long
total
=
fireStrengthMapper
.
queryCountForPage
(
username
,
code
);
List
<
Map
>
content
=
fireStrengthMapper
.
queryForPage
(
username
,
code
,
pageable
.
getOffset
(),
pageable
.
getPageSize
());
Page
result
=
new
PageImpl
(
content
,
pageable
,
total
);
public
Page
queryByFireEquimt
(
String
username
,
String
code
,
CommonPageable
pageable
)
{
Long
total
=
fireStrengthMapper
.
queryCountForPage
(
username
,
code
);
List
<
Map
>
content
=
fireStrengthMapper
.
queryForPage
(
username
,
code
,
pageable
.
getOffset
(),
pageable
.
getPageSize
());
Page
result
=
new
PageImpl
(
content
,
pageable
,
total
);
return
result
;
}
public
List
<
FireStrength
>
queryForStrengthList
(
String
time
)
{
return
fireStrengthMapper
.
queryForStrengthList
(
time
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/RiskSourceServiceImpl.java
View file @
f720f850
...
...
@@ -44,6 +44,8 @@ import com.google.common.base.Joiner;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Sets
;
import
com.yeejoin.amos.component.rule.RuleTrigger
;
import
com.yeejoin.amos.component.rule.action.ActionHandler
;
import
com.yeejoin.amos.fas.business.bo.BindRegionBo
;
import
com.yeejoin.amos.fas.business.bo.JpushMsgBo
;
import
com.yeejoin.amos.fas.business.bo.JpushMsgContentBo
;
...
...
@@ -225,6 +227,9 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
@Autowired
private
IDataRefreshService
iDataRefreshService
;
@Autowired
private
RuleTrigger
ruleTrigger
;
@Override
public
RiskSource
editRiskSource
(
HashMap
<
String
,
Object
>
map
)
throws
Exception
{
...
...
@@ -542,7 +547,9 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
}
}
Object
result
=
remoteRuleServer
.
fireRuleFlow
(
contingencyRo
,
equipment
.
getReservePlan
(),
equipment
.
getName
());
//Object result = remoteRuleServer.fireRuleFlow(contingencyRo, equipment.getReservePlan(), equipment.getName());
ruleTrigger
.
publish
(
contingencyRo
,
equipment
.
getReservePlan
());
ContingencyOriginalData
contingencyOriginalData
=
new
ContingencyOriginalData
();
BeanUtils
.
copyProperties
(
contingencyRo
,
contingencyOriginalData
);
iContingencyOriginalDataDao
.
save
(
contingencyOriginalData
);
...
...
@@ -584,9 +591,10 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
@Override
public
Page
<
Map
<
String
,
Object
>>
listFmeaPointInputitem
(
String
toke
,
String
product
,
String
appKey
,
Long
fmeaId
,
Integer
pageNumber
,
Integer
pageSize
)
{
List
<
Map
<
String
,
Object
>>
content
=
Lists
.
newArrayList
();
CommonPageable
pageable
=
new
CommonPageable
(
pageNumber
,
pageSize
);
long
total
=
fmeaPointInputitemMapper
.
countByFmeaId
(
fmeaId
);
if
(
total
==
0L
)
{
return
new
PageImpl
<>(
content
,
null
,
total
);
return
new
PageImpl
<>(
content
,
pageable
,
total
);
}
content
=
fmeaPointInputitemMapper
.
listByFmeaId
(
fmeaId
,
pageNumber
,
pageSize
);
if
(!
CollectionUtils
.
isEmpty
(
content
)){
...
...
@@ -617,14 +625,14 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
e
.
put
(
"tel"
,
userMap
.
get
(
String
.
valueOf
(
e
.
get
(
"deptId"
)+
"tel"
)));
});
}
return
new
PageImpl
<>(
content
,
null
,
total
);
return
new
PageImpl
<>(
content
,
pageable
,
total
);
}
@Override
public
Page
<
Map
<
String
,
Object
>>
listFeamEquipmentPoint
(
Long
fmeaId
,
Integer
pageNumber
,
Integer
pageSize
)
{
long
total
=
fmeaEquipmentPointMapper
.
countByFmeaId
(
fmeaId
);
List
<
Map
<
String
,
Object
>>
content
=
fmeaEquipmentPointMapper
.
listByFmeaId
(
fmeaId
,
pageNumber
,
pageSize
);
return
new
PageImpl
<>(
content
,
n
ull
,
total
);
return
new
PageImpl
<>(
content
,
n
ew
CommonPageable
(
pageNumber
,
pageSize
)
,
total
);
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/RuleRunigSnapshotServiceImpl.java
0 → 100644
View file @
f720f850
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
impl
;
import
java.lang.reflect.Method
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.UUID
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
import
org.typroject.tyboot.core.foundation.context.SpringContextHelper
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.yeejoin.amos.fas.business.action.CustomerAction
;
import
com.yeejoin.amos.fas.business.dao.mapper.RuleRuningSnapshotMapper
;
import
com.yeejoin.amos.fas.business.service.intfc.IRuleRunningSnapshotService
;
import
com.yeejoin.amos.fas.business.service.model.BasicsRo
;
import
com.yeejoin.amos.fas.business.service.model.RuleRuningSnapshot
;
/**
*
* <pre>
* 三维节点与规则消息实体视图service实现
* </pre>
*
* @author amos
* @version $Id: NodeMsgViewServiceImpl.java, v 0.1 2018年11月28日 下午6:14:51 amos Exp
* $
*/
@Service
(
"ruleRunningSnapshotService"
)
public
class
RuleRunigSnapshotServiceImpl
implements
IRuleRunningSnapshotService
//,ExecuteMethodHook
{
//IRuleRuningSnapshotRepository repository;
private
RuleRuningSnapshotMapper
ruleRuningSnapshotMapper
;
private
static
String
replayBatchNo
=
null
;
static
ObjectMapper
objectMapper
;
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
RuleRunigSnapshotServiceImpl
.
class
);
static
{
objectMapper
=
new
ObjectMapper
();
}
// public RuleRunigSnapshotServiceImpl(IRuleRuningSnapshotRepository repository)
// {
// super(repository);
// // TODO Auto-generated constructor stub
// this.repository = repository;
// ExecuteMethodHook.hook.add(this);
// }
//
//
/**
* 保存动作记录
* @param methodName
* @param paramsAndTypes
* @param matchedObj
*/
public
void
process
(
Object
bean
,
String
methodName
,
String
paramsAndTypes
,
Object
matchedObj
)
{
if
(
bean
instanceof
CustomerAction
)
{
Set
set
=
(
Set
)
matchedObj
;
BasicsRo
fireEquimentDataRo
=
(
BasicsRo
)
set
.
iterator
().
next
();
RuleRuningSnapshot
ruleRuningSnapshot
=
new
RuleRuningSnapshot
();
ruleRuningSnapshot
.
setId
(
UUID
.
randomUUID
().
toString
());
ruleRuningSnapshot
.
setMethodClass
(
bean
.
getClass
().
getName
());
ruleRuningSnapshot
.
setMethodName
(
methodName
);
ruleRuningSnapshot
.
setMethodParam
(
paramsAndTypes
);
ruleRuningSnapshot
.
setBatchNo
(
fireEquimentDataRo
.
getBatchNo
());
//ruleRuningSnapshot.setPackageId(fireEquimentDataRo.getPackageId());
//ruleRuningSnapshot.setEquipmentId(String.valueOf(fireEquimentDataRo.getId()));
Date
now
=
new
Date
();
ruleRuningSnapshot
.
setCreateTime
(
now
);
ruleRuningSnapshot
.
setCreateMillisecond
(
String
.
valueOf
(
now
.
getTime
()));
ruleRuningSnapshot
.
setPreviousInterval
(
0L
);
RuleRuningSnapshot
oldEntity
=
ruleRuningSnapshotMapper
.
querForObject
(
fireEquimentDataRo
.
getBatchNo
());
if
(
oldEntity
!=
null
)
ruleRuningSnapshot
.
setPreviousInterval
(
now
.
getTime
()
-
Long
.
parseLong
(
oldEntity
.
getCreateMillisecond
()));
//repository.save(ruleRuningSnapshot);
ruleRuningSnapshotMapper
.
save
(
ruleRuningSnapshot
);
}
}
@Async
public
void
replay
(
String
batchNo
)
throws
Exception
{
if
(
replayBatchNo
!=
null
)
throw
new
Exception
(
"一次只能回放一个预案记录."
);
try
{
replayBatchNo
=
batchNo
;
List
<
RuleRuningSnapshot
>
oldEntityList
=
ruleRuningSnapshotMapper
.
querForObjectList
(
batchNo
);
// List<RuleRuningSnapshot> oldEntityList = repository.querForObjectList(batchNo);
if
(!
CollectionUtils
.
isEmpty
(
oldEntityList
))
{
logger
.
info
(
"开始回放:batchNo="
+
batchNo
);
logger
.
info
(
"获取到动作记录个数:"
+
oldEntityList
.
size
());
int
count
=
0
;
for
(
RuleRuningSnapshot
snapshot
:
oldEntityList
)
{
if
(
replayBatchNo
==
null
)
return
;
//延迟
logger
.
info
(
"开始执行第"
+(++
count
)+
"个动作."
);
logger
.
info
(
"方法名:"
+
snapshot
.
getMethodClass
()+
"."
+
snapshot
.
getMethodName
());
logger
.
info
(
"需要延迟"
+
snapshot
.
getPreviousInterval
()+
"毫秒......."
);
Thread
.
sleep
(
snapshot
.
getPreviousInterval
());
try
{
Class
clzz
=
Class
.
forName
(
snapshot
.
getMethodClass
());
Object
obj
=
SpringContextHelper
.
getBean
(
clzz
);
Method
[]
methods
=
clzz
.
getMethods
();
if
(!
StringUtils
.
isEmpty
(
snapshot
.
getMethodParam
()))
{
for
(
Method
method:
methods
)
{
if
(
replayBatchNo
==
null
)
return
;
String
name
=
method
.
getName
();
if
(!
name
.
equals
(
snapshot
.
getMethodName
())){
continue
;
}
Map
paramsMap
=
objectMapper
.
readValue
(
snapshot
.
getMethodParam
(),
Map
.
class
);
List
<
String
>
datatypes
=
(
List
<
String
>)
paramsMap
.
get
(
"datatypes"
);
List
<
Object
>
values
=
(
List
<
Object
>)
paramsMap
.
get
(
"values"
);
Object
[]
params
=
new
Object
[
values
.
size
()];
for
(
int
i
=
0
;
i
<
datatypes
.
size
();
i
++)
{
if
(
replayBatchNo
==
null
)
return
;
String
typeStr
=
datatypes
.
get
(
i
);
Object
value
=
values
.
get
(
i
);
String
valueStr
=
objectMapper
.
writeValueAsString
(
value
);
Class
valueClzz
=
Class
.
forName
(
typeStr
);
params
[
i
]
=
objectMapper
.
readValue
(
valueStr
,
valueClzz
);
}
method
.
invoke
(
obj
,
params
);
}
}
else
{
Method
method
=
clzz
.
getMethod
(
snapshot
.
getMethodName
(),
new
Class
[]{});
method
.
invoke
(
obj
);
}
logger
.
info
(
"第"
+(
count
)+
"个动作执行成功."
);
}
catch
(
Exception
e
)
{
logger
.
info
(
"第"
+(
count
)+
"个动作执行失败."
);
e
.
printStackTrace
();
logger
.
error
(
e
.
getMessage
(),
e
);
}
}
}
}
catch
(
Exception
e
)
{
logger
.
info
(
"回放失败."
);
logger
.
error
(
e
.
getMessage
(),
e
);
}
finally
{
replayBatchNo
=
null
;
}
}
public
static
String
getReplayBatchNo
()
{
return
replayBatchNo
;
}
public
static
void
setReplayBatchNoToNull
()
{
RuleRunigSnapshotServiceImpl
.
replayBatchNo
=
null
;
}
}
\ No newline at end of file
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/View3dServiceImpl.java
View file @
f720f850
...
...
@@ -36,6 +36,7 @@ import com.yeejoin.amos.fas.business.dao.mapper.RiskSourceMapper;
import
com.yeejoin.amos.fas.business.dao.mapper.View3dMapper
;
import
com.yeejoin.amos.fas.business.dao.repository.*
;
import
com.yeejoin.amos.fas.business.feign.IDutyModeServer
;
import
com.yeejoin.amos.fas.business.feign.RemoteSecurityService
;
import
com.yeejoin.amos.fas.business.feign.RemoteWebSocketServer
;
import
com.yeejoin.amos.fas.business.service.intfc.IDataRefreshService
;
import
com.yeejoin.amos.fas.business.service.intfc.IView3dService
;
...
...
@@ -50,6 +51,8 @@ import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
import
com.yeejoin.amos.fas.core.util.StringUtil
;
import
com.yeejoin.amos.fas.dao.entity.*
;
import
com.yeejoin.amos.fas.exception.YeeException
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.BeanUtils
;
...
...
@@ -105,7 +108,8 @@ public class View3dServiceImpl implements IView3dService {
private
IDataRefreshService
iDataRefreshService
;
@Autowired
private
RiskSourceMapper
riskSourceMapper
;
@Autowired
private
RemoteSecurityService
remoteSecurityService
;
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
...
@@ -590,10 +594,17 @@ public class View3dServiceImpl implements IView3dService {
}
@Override
public
CommonResponse
retrieveAll
(
String
type
,
String
inputText
,
int
current
,
int
pageSize
,
String
orgCode
)
{
public
CommonResponse
retrieveAll
(
String
type
,
String
inputText
,
int
current
,
int
pageSize
,
String
orgCode
,
String
dataLevel
,
String
protectObjName
,
String
token
,
String
appKey
,
String
product
)
{
CommonPageable
pageable
=
new
CommonPageable
(
current
,
pageSize
);
Long
count
=
view3dMapper
.
retrieveAllCount
(
type
,
inputText
,
orgCode
);
List
<
HashMap
<
String
,
Object
>>
retrieveAll
=
view3dMapper
.
retrieveAll
(
type
,
inputText
,
pageable
.
getOffset
(),
pageable
.
getPageSize
(),
orgCode
);
Long
count
=
view3dMapper
.
retrieveAllCount
(
type
,
inputText
,
orgCode
,
dataLevel
,
protectObjName
);
List
<
HashMap
<
String
,
Object
>>
retrieveAll
=
view3dMapper
.
retrieveAll
(
type
,
inputText
,
pageable
.
getOffset
(),
pageable
.
getPageSize
(),
orgCode
,
dataLevel
,
protectObjName
);
retrieveAll
.
stream
().
forEach
(
e
->{
String
person
=
(
String
)
e
.
get
(
"person"
);
if
(
person
!=
null
&&
!
person
.
equals
(
""
))
{
AgencyUserModel
user
=
remoteSecurityService
.
getUserById
(
token
,
product
,
appKey
,
person
);
e
.
put
(
"person"
,
user
!=
null
?
user
.
getRealName
()
:
""
);
}
});
Page
result
=
new
PageImpl
(
retrieveAll
,
pageable
,
count
);
return
CommonResponseUtil
.
success
(
result
);
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/WaterResourceServiceImpl.java
View file @
f720f850
...
...
@@ -98,7 +98,7 @@ public class WaterResourceServiceImpl implements IWaterResourceService {
for
(
WaterResourceEquipment
waterResourceEquipment:
waterResourceEquipments
){
WaterResourceEquipment
saveWaterResourceEquipment
=
iWaterResourceEquipmentDao
.
findByWaterResourceIdAndFireEquipmentId
(
waterResourceEquipment
.
getWaterResourceId
(),
waterResourceEquipment
.
getFireEquipmentId
());
if
(
StringUtil
.
isNotEmpty
(
saveWaterResourceEquipment
)){
deleteList
.
add
(
w
aterResourceEquipment
);
deleteList
.
add
(
saveW
aterResourceEquipment
);
}
}
iWaterResourceEquipmentDao
.
deleteAll
(
deleteList
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/FireStengthService.java
View file @
f720f850
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
intfc
;
import
java.util.List
;
import
java.util.Map
;
import
org.springframework.data.domain.Page
;
...
...
@@ -40,5 +41,6 @@ public interface FireStengthService {
*/
Page
queryByFireEquimt
(
String
username
,
String
code
,
CommonPageable
pageable
);
List
<
FireStrength
>
queryForStrengthList
(
String
time
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IContingencyInstance.java
View file @
f720f850
...
...
@@ -20,5 +20,5 @@ public interface IContingencyInstance {
void
fire
(
String
batchNo
,
String
stepCode
,
String
contingencyPlanId
,
String
buttonCode
,
String
buttonState
,
String
stepStateOnbutton
)
throws
Exception
;
void
updateStep
(
String
step
,
String
batchNo
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IRuleRunningSnapshotService.java
0 → 100644
View file @
f720f850
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
intfc
;
/**
*
* <pre>
* 三维节点与规则消息实体视图service
* </pre>
*
* @version $Id: INodeMsgViewService.java, v 0.1 2019年1月2日 下午2:48:40 amos Exp $
*/
public
interface
IRuleRunningSnapshotService
{
void
replay
(
String
batchNo
)
throws
Exception
;
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IView3dService.java
View file @
f720f850
...
...
@@ -149,12 +149,14 @@ public interface IView3dService {
* 检索
* @param type类型
* @param inputText关键字
* @param dataLevel风险等级
* @param protectObjName设备名称
* @param current
* @param pageSize
* @param orgCode
* @return
*/
CommonResponse
retrieveAll
(
String
type
,
String
inputText
,
int
current
,
int
pageSize
,
String
orgCode
);
CommonResponse
retrieveAll
(
String
type
,
String
inputText
,
int
current
,
int
pageSize
,
String
orgCode
,
String
dataLevel
,
String
protectObjName
,
String
token
,
String
appKey
,
String
product
);
/**
* 等级查询
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/model/ContingencyRo.java
View file @
f720f850
...
...
@@ -3,13 +3,17 @@ package com.yeejoin.amos.fas.business.service.model;
public
class
ContingencyRo
extends
BasicsRo
{
private
String
fireEquipmentName
;
//消防设备名称
/**
*
*/
private
static
final
long
serialVersionUID
=
451541541451L
;
private
String
fireEquipmentName
;
//消防设备名称
private
String
fireEquipmentId
;
//消防设备id
private
int
layer
;
//显示图层
private
Integer
layer
=
0
;
//显示图层
//当前探测器
private
int
fireEquipmentLayer
;
//当前探测器图层
private
Integer
fireEquipmentLayer
=
0
;
//当前探测器图层
private
String
fireEquipmentPosition
;
//消防设备位置
//重点设备信息
...
...
@@ -26,7 +30,7 @@ public class ContingencyRo extends BasicsRo {
private
String
cameraIds
;
//摄像头id
private
int
fireCount
=
1
;
//火情数量
private
Integer
fireCount
=
1
;
//火情数量
private
String
confirm
=
"NONE"
;
//是否确认火情,确认 CONFIRM,取消CANCEL,未操作 NONE
...
...
@@ -37,7 +41,7 @@ public class ContingencyRo extends BasicsRo {
private
String
fireTruckRoute
;
private
b
oolean
runstep
;
//是否已经执行流程
private
B
oolean
runstep
;
//是否已经执行流程
private
String
step
;
//当前步骤
...
...
@@ -46,201 +50,198 @@ public class ContingencyRo extends BasicsRo {
private
String
stepState
;
//步骤操作状态
public
String
getFireEquipmentName
()
{
return
fireEquipmentName
;
}
public
String
getEquipmentPosition3d
(
)
{
return
equipmentPosition3d
;
}
public
void
setFireEquipmentName
(
String
fireEquipmentName
)
{
this
.
fireEquipmentName
=
fireEquipmentName
;
}
public
void
setEquipmentPosition3d
(
String
equipmentPosition3d
)
{
this
.
equipmentPosition3d
=
equipmentPosition3
d
;
}
public
String
getFireEquipmentId
(
)
{
return
fireEquipmentI
d
;
}
public
String
getButtonState
(
)
{
return
buttonState
;
}
public
void
setFireEquipmentId
(
String
fireEquipmentId
)
{
this
.
fireEquipmentId
=
fireEquipmentId
;
}
public
void
setButtonState
(
String
buttonState
)
{
this
.
buttonState
=
buttonState
;
}
public
Integer
getLayer
(
)
{
return
layer
;
}
public
String
getStepState
(
)
{
return
stepState
;
}
public
void
setLayer
(
Integer
layer
)
{
this
.
layer
=
layer
;
}
public
void
setStepState
(
String
stepState
)
{
this
.
stepState
=
stepState
;
}
public
Integer
getFireEquipmentLayer
(
)
{
return
fireEquipmentLayer
;
}
public
String
getButtonCode
(
)
{
return
buttonCode
;
}
public
void
setFireEquipmentLayer
(
Integer
fireEquipmentLayer
)
{
this
.
fireEquipmentLayer
=
fireEquipmentLayer
;
}
public
void
setButtonCode
(
String
buttonCode
)
{
this
.
buttonCode
=
buttonCode
;
}
public
String
getFireEquipmentPosition
(
)
{
return
fireEquipmentPosition
;
}
public
String
getStep
(
)
{
return
step
;
}
public
void
setFireEquipmentPosition
(
String
fireEquipmentPosition
)
{
this
.
fireEquipmentPosition
=
fireEquipmentPosition
;
}
public
void
setStep
(
String
step
)
{
this
.
step
=
step
;
}
public
String
getEquipmentId
(
)
{
return
equipmentId
;
}
public
void
setEquipmentId
(
String
equipmentId
)
{
this
.
equipmentId
=
equipmentId
;
}
public
String
getEquipmentName
()
{
return
equipmentName
;
}
public
void
setEquipmentName
(
String
equipmentName
)
{
this
.
equipmentName
=
equipmentName
;
}
public
boolean
getRunstep
()
{
return
runstep
;
}
public
String
getEquipmentPosition3d
()
{
return
equipmentPosition3d
;
}
public
void
setRunstep
(
boolean
runstep
)
{
this
.
runstep
=
runstep
;
}
public
void
setEquipmentPosition3d
(
String
equipmentPosition3d
)
{
this
.
equipmentPosition3d
=
equipmentPosition3d
;
}
public
String
getFireTruckRout
e
()
{
return
fireTruckRout
e
;
}
public
String
getMobil
e
()
{
return
mobil
e
;
}
public
void
setFireTruckRoute
(
String
fireTruckRout
e
)
{
this
.
fireTruckRoute
=
fireTruckRout
e
;
}
public
void
setMobile
(
String
mobil
e
)
{
this
.
mobile
=
mobil
e
;
}
public
String
getPicture1
()
{
return
picture1
;
}
public
String
getAdminName
()
{
return
adminName
;
}
public
void
setPicture1
(
String
picture1
)
{
this
.
picture1
=
picture1
;
}
public
void
setAdminName
(
String
adminName
)
{
this
.
adminName
=
adminName
;
}
public
String
getPicture2
()
{
return
picture2
;
}
public
String
getCameraCodes
()
{
return
cameraCodes
;
}
public
void
setPicture2
(
String
picture2
)
{
this
.
picture2
=
picture2
;
}
public
void
setCameraCodes
(
String
cameraCodes
)
{
this
.
cameraCodes
=
cameraCodes
;
}
public
String
getPicture3
()
{
return
picture3
;
}
public
String
getCameraIds
()
{
return
cameraIds
;
}
public
void
setPicture3
(
String
picture3
)
{
this
.
picture3
=
picture3
;
}
public
void
setCameraIds
(
String
cameraIds
)
{
this
.
cameraIds
=
cameraIds
;
}
public
String
getPicture4
()
{
return
picture4
;
}
public
Integer
getFireCount
()
{
return
fireCount
;
}
public
void
setPicture4
(
String
picture4
)
{
this
.
picture4
=
picture4
;
}
public
void
setFireCount
(
Integer
fireCount
)
{
this
.
fireCount
=
fireCount
;
}
public
String
getCameraIds
()
{
return
cameraIds
;
}
public
String
getConfirm
()
{
return
confirm
;
}
public
void
setCameraIds
(
String
cameraIds
)
{
this
.
cameraIds
=
cameraIds
;
}
public
void
setConfirm
(
String
confirm
)
{
this
.
confirm
=
confirm
;
}
public
String
getFireEquipmentPosition
()
{
return
fireEquipmentPosition
;
}
public
String
getPicture1
()
{
return
picture1
;
}
public
void
setFireEquipmentPosition
(
String
fireEquipmentPosition
)
{
this
.
fireEquipmentPosition
=
fireEquipmentPosition
;
}
public
void
setPicture1
(
String
picture1
)
{
this
.
picture1
=
picture1
;
}
public
String
getConfirm
()
{
return
confirm
;
}
public
String
getPicture2
()
{
return
picture2
;
}
public
void
setConfirm
(
String
confirm
)
{
this
.
confirm
=
confirm
;
}
public
void
setPicture2
(
String
picture2
)
{
this
.
picture2
=
picture2
;
}
public
int
getFireCount
()
{
return
fireCount
;
}
public
String
getPicture3
()
{
return
picture3
;
}
public
void
setFireCount
(
int
fireCount
)
{
this
.
fireCount
=
fireCount
;
}
public
void
setPicture3
(
String
picture3
)
{
this
.
picture3
=
picture3
;
}
public
String
getEquipmentName
()
{
return
equipmentName
;
}
public
String
getPicture4
()
{
return
picture4
;
}
public
void
setEquipmentName
(
String
equipmentName
)
{
this
.
equipmentName
=
equipmentName
;
}
public
void
setPicture4
(
String
picture4
)
{
this
.
picture4
=
picture4
;
}
public
String
getFireEquipmentId
()
{
return
fireEquipmentId
;
}
public
String
getFireTruckRoute
()
{
return
fireTruckRoute
;
}
public
void
setFireEquipmentId
(
String
fireEquipmentId
)
{
this
.
fireEquipmentId
=
fireEquipmentId
;
}
public
void
setFireTruckRoute
(
String
fireTruckRoute
)
{
this
.
fireTruckRoute
=
fireTruckRoute
;
}
public
Boolean
getRunstep
()
{
return
runstep
;
}
public
String
getFireEquipmentName
(
)
{
return
fireEquipmentName
;
}
public
void
setRunstep
(
Boolean
runstep
)
{
this
.
runstep
=
runstep
;
}
public
void
setFireEquipmentName
(
String
fireEquipmentName
)
{
this
.
fireEquipmentName
=
fireEquipmentName
;
}
public
String
getStep
(
)
{
return
step
;
}
public
int
getLayer
(
)
{
return
layer
;
}
public
void
setStep
(
String
step
)
{
this
.
step
=
step
;
}
public
void
setLayer
(
int
layer
)
{
this
.
layer
=
layer
;
}
public
String
getButtonCode
(
)
{
return
buttonCode
;
}
public
int
getFireEquipmentLayer
(
)
{
return
fireEquipmentLayer
;
}
public
void
setButtonCode
(
String
buttonCode
)
{
this
.
buttonCode
=
buttonCode
;
}
public
void
setFireEquipmentLayer
(
int
fireEquipmentLayer
)
{
this
.
fireEquipmentLayer
=
fireEquipmentLayer
;
}
public
String
getButtonState
(
)
{
return
buttonState
;
}
public
String
getEquipmentId
(
)
{
return
equipmentId
;
}
public
void
setButtonState
(
String
buttonState
)
{
this
.
buttonState
=
buttonState
;
}
public
void
setEquipmentId
(
String
equipmentId
)
{
this
.
equipmentId
=
equipmentId
;
}
public
String
getStepState
(
)
{
return
stepState
;
}
public
String
getMobile
(
)
{
return
mobil
e
;
}
public
void
setStepState
(
String
stepState
)
{
this
.
stepState
=
stepStat
e
;
}
public
void
setMobile
(
String
mobile
)
{
this
.
mobile
=
mobile
;
}
public
String
getAdminName
()
{
return
adminName
;
}
public
void
setAdminName
(
String
adminName
)
{
this
.
adminName
=
adminName
;
}
public
String
getCameraCodes
()
{
return
cameraCodes
;
}
public
void
setCameraCodes
(
String
cameraCodes
)
{
this
.
cameraCodes
=
cameraCodes
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/model/RuleRuningSnapshot.java
0 → 100644
View file @
f720f850
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
model
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
java.io.Serializable
;
import
java.util.Date
;
@Entity
@Table
(
name
=
"toip_rm_snapshot"
)
public
class
RuleRuningSnapshot
implements
Serializable
{
private
static
final
long
serialVersionUID
=
292329658525267887L
;
@Id
private
String
id
;
@Column
(
name
=
"batch_no"
)
private
String
batchNo
;
// '规则执行的批次号',
@Column
(
name
=
"package_id"
)
private
String
packageId
;
// '规则包id',
@Column
(
name
=
"method_class"
)
private
String
methodClass
;
// 'bean方法的类名',
@Column
(
name
=
"method_name"
)
private
String
methodName
;
// 'bean方法名',
@Column
(
name
=
"equipment_id"
)
private
String
equipmentId
;
// '设备类型',
@Column
(
name
=
"method_param"
)
private
String
methodParam
;
// 方法参数',
@Column
(
name
=
"create_time"
)
private
Date
createTime
;
// 创建时间',
@Column
(
name
=
"create_millisecond"
)
private
String
createMillisecond
;
// 当前动作执行时的毫秒数',
@Column
(
name
=
"previous_interval"
)
private
Long
previousInterval
;
// 与上一次的动作执行的时间差',
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getBatchNo
()
{
return
batchNo
;
}
public
void
setBatchNo
(
String
batchNo
)
{
this
.
batchNo
=
batchNo
;
}
public
String
getPackageId
()
{
return
packageId
;
}
public
void
setPackageId
(
String
packageId
)
{
this
.
packageId
=
packageId
;
}
public
String
getMethodClass
()
{
return
methodClass
;
}
public
void
setMethodClass
(
String
methodClass
)
{
this
.
methodClass
=
methodClass
;
}
public
String
getMethodName
()
{
return
methodName
;
}
public
void
setMethodName
(
String
methodName
)
{
this
.
methodName
=
methodName
;
}
public
String
getEquipmentId
()
{
return
equipmentId
;
}
public
void
setEquipmentId
(
String
equipmentId
)
{
this
.
equipmentId
=
equipmentId
;
}
public
String
getMethodParam
()
{
return
methodParam
;
}
public
void
setMethodParam
(
String
methodParam
)
{
this
.
methodParam
=
methodParam
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
String
getCreateMillisecond
()
{
return
createMillisecond
;
}
public
void
setCreateMillisecond
(
String
createMillisecond
)
{
this
.
createMillisecond
=
createMillisecond
;
}
public
Long
getPreviousInterval
()
{
return
previousInterval
;
}
public
void
setPreviousInterval
(
Long
previousInterval
)
{
this
.
previousInterval
=
previousInterval
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/model/ToipResponse.java
0 → 100644
View file @
f720f850
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
model
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.dao.entity.BusinessEntity
;
/**
*
* <pre>
*
* </pre>
*
* @author HK
* @version $Id: ToipResponse.java, v 0.1 2018年1月26日 下午5:02:12 HK Exp $
*/
public
class
ToipResponse
extends
CommonResponse
{
// 具体界面域由三部分组成: [IFDomain].[group].[template], 其中 group可选 [IFDomain].[template]
// dispatch.map.marker.basic
/**
* <pre>
*
* </pre>
*/
private
static
final
long
serialVersionUID
=
1L
;
/**
* 界面域
* 例如
* dispatch.map
*/
private
String
IFDomain
;
/**
* 模板类型
* 例如
* basic
*/
private
String
template
;
/**
* 模板组
* 例如
* marker
*/
private
String
group
;
/**
* 智能体业务对象
*/
private
BusinessEntity
bizObj
;
/**
* 动作ID
*/
private
String
actionId
;
/**
* 火灾id
*/
private
String
fireId
;
private
String
domainView
;
public
String
getIFDomain
()
{
return
IFDomain
;
}
public
void
setIFDomain
(
String
iFDomain
)
{
IFDomain
=
iFDomain
;
}
public
String
getTemplate
()
{
return
template
;
}
public
void
setTemplate
(
String
template
)
{
this
.
template
=
template
;
}
public
String
getGroup
()
{
return
group
;
}
public
void
setGroup
(
String
group
)
{
this
.
group
=
group
;
}
public
BusinessEntity
getBizObj
()
{
return
bizObj
;
}
public
void
setBizObj
(
BusinessEntity
bizObj
)
{
this
.
bizObj
=
bizObj
;
}
public
String
getActionId
()
{
return
actionId
;
}
public
void
setActionId
(
String
actionId
)
{
this
.
actionId
=
actionId
;
}
public
String
getDomainView
()
{
return
domainView
;
}
public
void
setDomainView
(
String
domainView
)
{
this
.
domainView
=
domainView
;
}
public
String
getFireId
()
{
return
fireId
;
}
public
void
setFireId
(
String
fireId
)
{
this
.
fireId
=
fireId
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/vo/View3dNodeVo.java
View file @
f720f850
package
com
.
yeejoin
.
amos
.
fas
.
business
.
vo
;
import
java.util.List
;
import
com.alibaba.druid.util.StringUtils
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.yeejoin.amos.fas.business.util.StringUtil
;
import
com.yeejoin.amos.fas.core.common.response.CoordDTO
;
public
class
View3dNodeVo
{
...
...
@@ -19,6 +18,7 @@ public class View3dNodeVo {
private
String
[]
relationKeys
;
private
String
level
;
private
String
levelStr
;
private
CoordDTO
position
;
/**
* 顶牌内容
*/
...
...
@@ -131,4 +131,18 @@ public class View3dNodeVo {
this
.
levelStr
=
levelStr
;
}
/**
* @return the position
*/
public
CoordDTO
getPosition
()
{
return
position
;
}
/**
* @param position the position to set
*/
public
void
setPosition
(
String
position
)
{
this
.
position
=
position
==
null
?
null
:
JSON
.
parseObject
(
position
,
CoordDTO
.
class
);
}
}
YeeAmosFireAutoSysStart/src/main/resources/application-dev.properties
View file @
f720f850
...
...
@@ -46,5 +46,12 @@ file.uploadUrl=D:\\upload\\files\\
file.readUrl
=
http://172.16.3.89:8083/file/getFile?in=
params.isPush
=
true
## emqx
emqx.clean-session
=
true
emqx.client-id
=
${spring.application.name}-${random.int[1024,65536]}
emqx.broker
=
tcp://172.16.10.85:1883
emqx.user-name
=
super
emqx.password
=
a123456
Push.fegin.name
=
PPMESSAGEPUSHSERVICE15
dutyMode.fegin.name
=
AMOS-DUTY
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/application-docker.properties
View file @
f720f850
...
...
@@ -45,5 +45,13 @@ file.uploadUrl=D:\\upload\\files\\
#picture read
file.readUrl
=
http://station-fireautosys:8083/file/getFile?in=
params.isPush
=
true
## emqx
emqx.clean-session
=
true
emqx.client-id
=
${spring.application.name}-${random.int[1024,65536]}
emqx.broker
=
tcp://172.16.10.85:1883
emqx.user-name
=
super
emqx.password
=
a123456
Push.fegin.name
=
AMOS-PUSH
dutyMode.fegin.name
=
AMOS-DUTY
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/application-test.properties
View file @
f720f850
...
...
@@ -46,5 +46,12 @@ file.uploadUrl=D:\\upload\\files\\
file.readUrl
=
http://172.16.3.89:8083/file/getFile?in=
params.isPush
=
true
## emqx
emqx.clean-session
=
true
emqx.client-id
=
${spring.application.name}-${random.int[1024,65536]}
emqx.broker
=
tcp://172.16.10.85:1883
emqx.user-name
=
super
emqx.password
=
a123456
Push.fegin.name
=
PPMESSAGEPUSHSERVICE15
dutyMode.fegin.name
=
AMOS-DUTY
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_fier_station.xml
View file @
f720f850
...
...
@@ -45,6 +45,7 @@
left join f_risk_source frs on frs.id = f.risk_source_id
WHERE
fs.fire_station_id = ${fireStationId}
and f.id is not null
LIMIT ${start}, ${length};
</select>
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_fier_stength.xml
View file @
f720f850
...
...
@@ -62,5 +62,32 @@
<select
id=
"queryForStrengthList"
resultType=
"com.yeejoin.amos.fas.dao.entity.FireStrength"
>
SELECT
*
FROM
f_fire_strength t
WHERE
TIME_TO_SEC(#{time})
>
= TIME_TO_SEC( t.day_begin )
AND TIME_TO_SEC(#{time})
<
= TIME_TO_SEC(
t.day_end)
</select>
<insert
id=
"save"
parameterType=
"com.yeejoin.amos.fas.dao.entity.FireStrength"
>
INSERT INTO f_fire_strength
username,
`code`,
position,
tel,
phone_num,
job_des,
remark,
org_code,
create_by,
create_date,
day_end ,
day_begin
VALUES(#{username},#{code},#{position},#{tel},#{phoneNum},#{jobDes},#{remark},#{orgCode},#{createBy},NOW(),#{dayEnd},#{dayBegin})
</insert>
</mapper>
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_rule_runing_snapshot.xml
0 → 100644
View file @
f720f850
<?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.yeejoin.amos.fas.business.dao.mapper.RuleRuningSnapshotMapper"
>
<select
id=
"querForObject"
resultType=
"com.yeejoin.amos.fas.business.service.model.RuleRuningSnapshot"
>
SELECT * FROM toip_rm_snapshot t WHERE t.batch_no = #{batchNo} ORDER BY t.create_millisecond DESC limit 0,1
</select>
<select
id=
"querForObjectList"
resultType=
"com.yeejoin.amos.fas.business.service.model.RuleRuningSnapshot"
>
SELECT * FROM toip_rm_snapshot t WHERE t.batch_no = #{batchNo} ORDER BY t.create_millisecond
</select>
</mapper>
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_view3d.xml
View file @
f720f850
...
...
@@ -619,15 +619,57 @@
</select>
<select
id=
"getImpEqu3dPoints"
resultType=
"com.yeejoin.amos.fas.business.vo.View3dNodeVo"
>
SELECT id,name,code,ue4_location,ue4_rotation,'monitorEquipment' as type,
null as relationKeys
SELECT id,name,code,ue4_location,ue4_rotation,'monitorEquipment' as type,'monitorEquipment' as level,
null as relationKeys,
CASE
WHEN (
ISNULL(fe.position3d) || LENGTH(trim(fe.position3d))
<![CDATA[ <]]>
1
) THEN
NULL
ELSE
CONCAT(
'{"x":',
substring_index(fe.position3d, ',', 1),
',"y":',
substring_index(
substring_index(fe.position3d, ',', - 2),
',',
1
),
',"z":',
substring_index(fe.position3d, ',', - 1),
'}'
)
END position,
concat('monitorEquipment-',fe.id) as `key`
FROM f_fire_equipment fe
WHERE fe.id IN (
select fire_equipment_id from f_equipment_fire_equipment
) AND org_code like CONCAT(#{orgCode},'%')
UNION ALL
SELECT e.id,e.name,e.code,e.ue4_location,e.ue4_rotation,'impEquipment' as type,
TMP.relationKeys
SELECT e.id,e.name,e.code,e.ue4_location,e.ue4_rotation,'impEquipment' as type,'impEquipment' as level,
TMP.relationKeys,
CASE
WHEN (
ISNULL(e.position3d) || LENGTH(trim(e.position3d))
<![CDATA[ <]]>
1
) THEN
NULL
ELSE
CONCAT(
'{"x":',
substring_index(e.position3d, ',', 1),
',"y":',
substring_index(
substring_index(e.position3d, ',', - 2),
',',
1
),
',"z":',
substring_index(e.position3d, ',', - 1),
'}'
)
END position,
concat('impEquipment-',e.id) as `key`
FROM f_equipment e
LEFT JOIN
(select GROUP_CONCAT(fire_equipment_id) as relationKeys,equipment_id from f_equipment_fire_equipment GROUP BY equipment_id) tmp
...
...
@@ -639,17 +681,87 @@
when 1 then 'hydrant'
when 2 then 'pool'
end as type,
null as relationKeys
case type
when 1 then 'hydrant'
when 2 then 'pool'
end as level,
null as relationKeys,
CASE
WHEN (
ISNULL(position3d) || LENGTH(trim(position3d))
<![CDATA[ <]]>
1
) THEN
NULL
ELSE
CONCAT(
'{"x":',
substring_index(position3d, ',', 1),
',"y":',
substring_index(
substring_index(position3d, ',', - 2),
',',
1
),
',"z":',
substring_index(position3d, ',', - 1),
'}'
)
END position,
case type
when 1 then concat('hydrant-',id)
when 2 then concat('pool-',id)
end as `key`
FROM f_water_resource
WHERE org_code like CONCAT(#{orgCode},'%')
UNION ALL
SELECT id,name,code,ue4_location,ue4_rotation,'fireChamber' as type,
null as relationKeys
SELECT id,name,code,ue4_location,ue4_rotation,'fireChamber' as type,'fireChamber' as level,
null as relationKeys,
CASE
WHEN (
ISNULL(position3d) || LENGTH(trim(position3d))
<![CDATA[ <]]>
1
) THEN
NULL
ELSE
CONCAT(
'{"x":',
substring_index(position3d, ',', 1),
',"y":',
substring_index(
substring_index(position3d, ',', - 2),
',',
1
),
',"z":',
substring_index(position3d, ',', - 1),
'}'
)
END position,
concat('fireChamber-',id) as `key`
FROM f_fire_station
WHERE type = 1 AND org_code like CONCAT(#{orgCode},'%')
UNION ALL
SELECT id,name,car_num as code,ue4_location,ue4_rotation,'fireCar' as type,
null as relationKeys
SELECT id,name,car_num as code,ue4_location,ue4_rotation,'fireCar' as type,'fireCar' as level,
null as relationKeys,
CASE
WHEN (
ISNULL(position3d) || LENGTH(trim(position3d))
<![CDATA[ <]]>
1
) THEN
NULL
ELSE
CONCAT(
'{"x":',
substring_index(position3d, ',', 1),
',"y":',
substring_index(
substring_index(position3d, ',', - 2),
',',
1
),
',"z":',
substring_index(position3d, ',', - 1),
'}'
)
END position,
concat('fireCar-',id) as `key`
FROM f_fire_car
WHERE org_code like CONCAT(#{orgCode},'%')
</select>
...
...
@@ -714,8 +826,9 @@
AND e.org_code like CONCAT(#{orgCode},'%')
) tmp
where 1=1
<if
test=
"riskSourceId != null"
>
</if>
<if
test=
"riskSourceId != null"
>
AND FIND_IN_SET(tmp.risk_source_id,queryRiskSourceChildrenIds(#{riskSourceId}))
</if>
<if
test=
"type != null"
>
AND tmp.type = #{type}
</if>
...
...
@@ -887,6 +1000,9 @@
from f_risk_source r
left join f_risk_level rl ON rl.id = r.risk_level_id
where r.is_region = 'FALSE'
<if
test=
"dataLevel != null and dataLevel != ''"
>
AND rl.level = #{dataLevel}
</if>
UNION all
select p.name,p.point_no as code,'patrol' as typeCode,p.org_code as orgCode
from p_point p
...
...
@@ -895,8 +1011,14 @@
select name,code,'impEquipment' as typeCode,org_code as orgCode
from f_equipment e
UNION all
select name,code,'monitorEquipment' as typeCode,org_code as orgCode
from f_fire_equipment where equip_classify = 0
select m.name,m.code,'monitorEquipment' as typeCode,m.org_code as orgCode
from f_fire_equipment m
left join f_equipment_fire_equipment fe on fe.fire_equipment_id = m.id
left join f_equipment f on f.id = fe.equipment_id
where equip_classify = 0
<if
test=
"protectObjName != null and protectObjName != ''"
>
AND f.name = #{protectObjName}
</if>
UNION all
select name,code,'video' as typeCode,org_code as orgCode
from f_fire_equipment where equip_classify = 2
...
...
@@ -926,7 +1048,7 @@
OR tmp.name LIKE '%${inputText}%'
)
</if>
<if
test=
"type!=null"
>
<if
test=
"type!=null
and type!=''
"
>
AND tmp.typeCode = #{type}
</if>
<if
test=
"orgCode!=null"
>
...
...
@@ -937,7 +1059,7 @@
<select
id=
"retrieveAll"
resultType=
"java.util.HashMap"
>
select *,'{ "x": 0, "y": 0, "z": 0 }' rotationDTO,'{ "x": 1, "y": 1, "z": 1 }' scaleDTO
from (select r.id,r.name,r.code,r.ue4_location as ue4Location,r.ue4_rotation as ue4Rotation ,'riskSource' as type,r.org_code as orgCode,
rl.level,CONCAT('level_',rl.level) as levelStr,r.is_indoor as isIndoor,'风险点' as typeName,'riskSource' as typeCode,
rl.
name as
level,CONCAT('level_',rl.level) as levelStr,r.is_indoor as isIndoor,'风险点' as typeName,'riskSource' as typeCode,
CASE
WHEN (
ISNULL(r.position3d) || LENGTH(trim(r.position3d))
<![CDATA[ <]]>
1
...
...
@@ -957,10 +1079,18 @@ from (select r.id,r.name,r.code,r.ue4_location as ue4Location,r.ue4_rotation as
substring_index(r.position3d, ',', - 1),
'}'
)
END positionDTO
END positionDTO,
r.name as label,
'' as protectObjName,
'' as routeName,
'' as person,
'' as title
from f_risk_source r
left join f_risk_level rl ON rl.id = r.risk_level_id
where r.is_region = 'FALSE'
<if
test=
"dataLevel != null and dataLevel != ''"
>
AND rl.level = #{dataLevel}
</if>
UNION all
select p.id,p.name,p.point_no as code,p.ue4_location as ue4Location,p.ue4_rotation as ue4Rotation ,'patrol' as type,p.org_code as orgCode,
p.status as level,CONCAT('level_',p.status) as levelStr,p.is_indoor as isIndoor,'巡检点' as typeName,'patrol' as typeCode,
...
...
@@ -983,7 +1113,17 @@ from (select r.id,r.name,r.code,r.ue4_location as ue4Location,r.ue4_rotation as
substring_index(p.coordinates, ',', - 1),
'}'
)
END positionDTO
END positionDTO,
p.name as label,
'' as protectObjName,
p.route_name as routeName,
p.charge_person_id as person,
case
when p.status = '0' then '未执行'
when p.status = '1' then '合格'
when p.status = '2' then '不合格'
when p.status = '3' then '漏检'
end as title
from p_point p
WHERE is_delete = FALSE
UNION all
...
...
@@ -1008,56 +1148,81 @@ from (select r.id,r.name,r.code,r.ue4_location as ue4Location,r.ue4_rotation as
substring_index(e.position3d, ',', - 1),
'}'
)
END positionDTO
END positionDTO,
e.name as label,
'' as protectObjName,
'' as routeName,
'' as person,
'' as title
from f_equipment e
UNION all
select
id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'monitorEquipment' as type,
org_code as orgCode,
equip_status as level , concat('level_',equip_status) as levelStr,
is_indoor as isIndoor,'探测器' as typeName,'monitorEquipment' as typeCode,
select
m.id,m.name,m.code,m.ue4_location as ue4Location,m.ue4_rotation as ue4Rotation ,'monitorEquipment' as type,m.
org_code as orgCode,
m.equip_status as level , concat('level_',m.equip_status) as levelStr,m.
is_indoor as isIndoor,'探测器' as typeName,'monitorEquipment' as typeCode,
CASE
WHEN (
ISNULL(
position3d) || LENGTH(trim(
position3d))
<![CDATA[ <]]>
1
ISNULL(
m.position3d) || LENGTH(trim(m.
position3d))
<![CDATA[ <]]>
1
) THEN
NULL
ELSE
CONCAT(
'{"x":',
substring_index(position3d, ',', 1),
substring_index(
m.
position3d, ',', 1),
',"y":',
substring_index(
substring_index(position3d, ',', - 2),
substring_index(
m.
position3d, ',', - 2),
',',
1
),
',"z":',
substring_index(position3d, ',', - 1),
substring_index(
m.
position3d, ',', - 1),
'}'
)
END positionDTO
from f_fire_equipment where equip_classify = 0
END positionDTO,
m.name as label,
f.name as protectObjName,
'' as routeName,
'' as person,
'' as title
from f_fire_equipment m
left join f_equipment_fire_equipment fe on fe.fire_equipment_id = m.id
left join f_equipment f on f.id = fe.equipment_id
where equip_classify = 0
<if
test=
"protectObjName != null and protectObjName != ''"
>
AND f.name = #{protectObjName}
</if>
UNION all
select
id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'video' as type,
org_code as orgCode,
equip_status as level , concat('level_',equip_status) as levelStr,
is_indoor as isIndoor,'摄像头' as typeName,'video' as typeCode,
select
m.id,m.name,m.code,m.ue4_location as ue4Location,m.ue4_rotation as ue4Rotation ,'video' as type,m.
org_code as orgCode,
m.equip_status as level , concat('level_',m.equip_status) as levelStr,m.
is_indoor as isIndoor,'摄像头' as typeName,'video' as typeCode,
CASE
WHEN (
ISNULL(
position3d) || LENGTH(trim(
position3d))
<![CDATA[ <]]>
1
ISNULL(
m.position3d) || LENGTH(trim(m.
position3d))
<![CDATA[ <]]>
1
) THEN
NULL
ELSE
CONCAT(
'{"x":',
substring_index(position3d, ',', 1),
substring_index(
m.
position3d, ',', 1),
',"y":',
substring_index(
substring_index(position3d, ',', - 2),
substring_index(
m.
position3d, ',', - 2),
',',
1
),
',"z":',
substring_index(position3d, ',', - 1),
substring_index(
m.
position3d, ',', - 1),
'}'
)
END positionDTO
from f_fire_equipment where equip_classify = 2
END positionDTO,
m.name as label,
f.name as protectObjName,
'' as routeName,
'' as person,
'' as title
from f_fire_equipment m
left join f_equipment_fire_equipment fe on fe.fire_equipment_id = m.id
left join f_equipment f on f.id = fe.equipment_id
where m.equip_classify = 2
UNION all
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'hydrant' as type,org_code as orgCode,
0 as level , 'level_0' as levelStr,is_indoor as isIndoor,'消防栓' as typeName,'fireEquipment' as typeCode,
...
...
@@ -1080,7 +1245,12 @@ from (select r.id,r.name,r.code,r.ue4_location as ue4Location,r.ue4_rotation as
substring_index(position3d, ',', - 1),
'}'
)
END positionDTO
END positionDTO,
name as label,
'' as protectObjName,
'' as routeName,
'' as person,
'' as title
from f_water_resource where type = 1
UNION all
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,'pool' as type,org_code as orgCode,
...
...
@@ -1104,7 +1274,12 @@ from (select r.id,r.name,r.code,r.ue4_location as ue4Location,r.ue4_rotation as
substring_index(position3d, ',', - 1),
'}'
)
END positionDTO
END positionDTO,
name as label,
'' as protectObjName,
'' as routeName,
'' as person,
'' as title
from f_water_resource where type = 2
UNION all
select id,name,car_num as code,ue4_location as ue4Location,ue4_rotation as ue4Rotation, 'fireCar' as type,org_code as orgCode,
...
...
@@ -1128,7 +1303,12 @@ from (select r.id,r.name,r.code,r.ue4_location as ue4Location,r.ue4_rotation as
substring_index(position3d, ',', - 1),
'}'
)
END positionDTO
END positionDTO,
name as label,
'' as protectObjName,
'' as routeName,
'' as person,
'' as title
from f_fire_car
UNION all
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,'fireEquipment' as type,org_code as orgCode,
...
...
@@ -1152,7 +1332,12 @@ from (select r.id,r.name,r.code,r.ue4_location as ue4Location,r.ue4_rotation as
substring_index(position3d, ',', - 1),
'}'
)
END positionDTO
END positionDTO,
name as label,
'' as protectObjName,
'' as routeName,
'' as person,
'' as title
from f_fire_equipment where equip_classify = 3
UNION all
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation , 'fireChamber' as type,org_code as orgCode,
...
...
@@ -1176,7 +1361,12 @@ from (select r.id,r.name,r.code,r.ue4_location as ue4Location,r.ue4_rotation as
substring_index(position3d, ',', - 1),
'}'
)
END positionDTO
END positionDTO,
name as label,
'' as protectObjName,
'' as routeName,
'' as person,
'' as title
from f_fire_station where type = 2
UNION all
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'fireFoamRoom' as type,org_code as orgCode,
...
...
@@ -1200,7 +1390,12 @@ from (select r.id,r.name,r.code,r.ue4_location as ue4Location,r.ue4_rotation as
substring_index(position3d, ',', - 1),
'}'
)
END positionDTO
END positionDTO,
name as label,
'' as protectObjName,
'' as routeName,
'' as person,
'' as title
from f_fire_station where type = 1
) as tmp
where 1=1
...
...
@@ -1210,7 +1405,7 @@ from (select r.id,r.name,r.code,r.ue4_location as ue4Location,r.ue4_rotation as
OR tmp.name LIKE '%${inputText}%'
)
</if>
<if
test=
"type!=null"
>
<if
test=
"type!=null
and type!=''
"
>
AND tmp.typeCode = #{type}
</if>
<if
test=
"orgCode!=null"
>
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_waterResource.xml
View file @
f720f850
...
...
@@ -99,6 +99,7 @@
left join f_risk_source frs on frs.id = f.risk_source_id
WHERE
fs.water_resource_id = ${waterResourceId}
and f.id is not null
LIMIT ${start}, ${length};
</select>
...
...
pom.xml
View file @
f720f850
...
...
@@ -31,6 +31,11 @@
</properties>
<dependencies>
<dependency>
<groupId>
com.yeejoin
</groupId>
<artifactId>
amos-component-rule
</artifactId>
<version>
1.1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-netflix-eureka-client
</artifactId>
...
...
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