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
b9cd3627
Commit
b9cd3627
authored
Nov 25, 2020
by
KeYong
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_upgrade' of 172.16.10.76:station/YeeAmosFireAutoSysRoot into eqintegration
parents
34164ec6
6bf518c1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
309 additions
and
240 deletions
+309
-240
ContingencyAction.java
...m/yeejoin/amos/fas/business/action/ContingencyAction.java
+5
-3
ContingencyLogListener.java
...join/amos/fas/business/action/ContingencyLogListener.java
+8
-1
RiskSituationAction.java
...yeejoin/amos/fas/business/action/RiskSituationAction.java
+4
-2
SimpleTipAction.java
...com/yeejoin/amos/fas/business/action/SimpleTipAction.java
+5
-2
StationEnum.java
.../com/yeejoin/amos/fas/business/action/mq/StationEnum.java
+0
-32
RiskSourceController.java
...in/amos/fas/business/controller/RiskSourceController.java
+28
-24
SafetyController.java
...eejoin/amos/fas/business/controller/SafetyController.java
+1
-1
View3dController.java
...eejoin/amos/fas/business/controller/View3dController.java
+15
-0
ContingencyInstanceImpl.java
...os/fas/business/service/impl/ContingencyInstanceImpl.java
+5
-2
EquipmentServiceImpl.java
.../amos/fas/business/service/impl/EquipmentServiceImpl.java
+2
-2
HandlerMqttMessageImpl.java
...mos/fas/business/service/impl/HandlerMqttMessageImpl.java
+68
-33
RiskSourceServiceImpl.java
...amos/fas/business/service/impl/RiskSourceServiceImpl.java
+0
-0
View3dServiceImpl.java
...oin/amos/fas/business/service/impl/View3dServiceImpl.java
+8
-0
IEquipmentHandlerService.java
.../fas/business/service/intfc/IEquipmentHandlerService.java
+4
-1
PermissionAspect.java
...in/java/com/yeejoin/amos/fas/config/PermissionAspect.java
+37
-38
application-dev.properties
...utoSysStart/src/main/resources/application-dev.properties
+5
-1
application.properties
...ireAutoSysStart/src/main/resources/application.properties
+2
-2
dbTemplate_3d_plan_visual.xml
...rc/main/resources/db/mapper/dbTemplate_3d_plan_visual.xml
+2
-1
dbTemplate_alarm.xml
...ysStart/src/main/resources/db/mapper/dbTemplate_alarm.xml
+4
-4
dbTemplate_equipment_specific.xml
...ain/resources/db/mapper/dbTemplate_equipment_specific.xml
+20
-14
dbTemplate_fire_equip.xml
...rt/src/main/resources/db/mapper/dbTemplate_fire_equip.xml
+7
-7
dbTemplate_fire_equippoint.xml
...c/main/resources/db/mapper/dbTemplate_fire_equippoint.xml
+39
-38
dbTemplate_fmea_equipment_point.xml
...n/resources/db/mapper/dbTemplate_fmea_equipment_point.xml
+22
-18
dbTemplate_impAndfire_equip.xml
.../main/resources/db/mapper/dbTemplate_impAndfire_equip.xml
+4
-5
dbTemplate_risk_source.xml
...t/src/main/resources/db/mapper/dbTemplate_risk_source.xml
+14
-9
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/ContingencyAction.java
View file @
b9cd3627
...
...
@@ -38,7 +38,6 @@ import com.yeejoin.amos.fas.business.action.model.ContingencyEvent;
import
com.yeejoin.amos.fas.business.action.model.ContingencyRo
;
import
com.yeejoin.amos.fas.business.action.model.DeviceRo
;
import
com.yeejoin.amos.fas.business.action.model.SetpEnum
;
import
com.yeejoin.amos.fas.business.action.mq.StationEnum
;
import
com.yeejoin.amos.fas.business.action.mq.WebMqttComponent
;
import
com.yeejoin.amos.fas.business.action.result.ActionResult
;
import
com.yeejoin.amos.fas.business.action.result.SafteyPlanResult
;
...
...
@@ -76,6 +75,9 @@ public class ContingencyAction implements CustomerAction {
@Value
(
"${spring.application.name}"
)
private
String
serviceName
;
@Value
(
"${station.name}"
)
private
String
stationName
;
@Autowired
private
IContingencyInstance
iContingencyInstance
;
...
...
@@ -182,7 +184,7 @@ public class ContingencyAction implements CustomerAction {
AbstractActionResultMessage
<?>
action
=
(
AbstractActionResultMessage
<?>)
constructor
.
newInstance
(
result
);
if
(
"mqtt"
.
equals
(
pushType
.
toLowerCase
()))
{
ToipResponse
toipResponse
=
action
.
buildResponse
(
msgType
,
contingency
,
result
.
toJson
());
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
StationEnum
.
YINAN
.
getCode
()
,
"plan"
);
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
"plan"
);
log
.
info
(
String
.
format
(
"mqtt[%s]:【 %s 】"
,
topic
,
toipResponse
.
toJsonStr
()));
webMqttComponent
.
publish
(
topic
,
toipResponse
.
toJsonStr
());
...
...
@@ -745,7 +747,7 @@ public class ContingencyAction implements CustomerAction {
AbstractActionResultMessage
<?>
action
=
(
AbstractActionResultMessage
<?>)
constructor
.
newInstance
(
result
);
if
(
"mqtt"
.
equals
(
pushType
.
toLowerCase
()))
{
ToipResponse
toipResponse
=
action
.
buildResponse
(
msgType
,
deviceRo
,
result
.
toJson
());
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
StationEnum
.
YINAN
.
getCode
()
,
"plan"
);
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
"plan"
);
log
.
info
(
String
.
format
(
"mqtt[%s]:【 %s 】"
,
topic
,
toipResponse
.
toJsonStr
()));
webMqttComponent
.
publish
(
topic
,
toipResponse
.
toJsonStr
());
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/ContingencyLogListener.java
View file @
b9cd3627
package
com
.
yeejoin
.
amos
.
fas
.
business
.
action
;
import
com.yeejoin.amos.fas.business.service.intfc.IEquipmentHandlerService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.ApplicationListener
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.stereotype.Component
;
import
com.yeejoin.amos.fas.business.action.model.ContingencyEvent
;
...
...
@@ -12,10 +14,15 @@ public class ContingencyLogListener implements ApplicationListener<ContingencyEv
@Autowired
IRuleRunningSnapshotService
ruleRunningSnapshotService
;
// @Autowired
// @Lazy
// IEquipmentHandlerService equipmentHandlerService;
@Override
public
void
onApplicationEvent
(
ContingencyEvent
event
)
{
ruleRunningSnapshotService
.
reacordPlan
(
event
.
getTopic
(),
event
.
getMsgType
(),
event
.
getMsgBody
(),
event
.
getContingency
());
// equipmentHandlerService.subscribeTopic();
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/RiskSituationAction.java
View file @
b9cd3627
...
...
@@ -11,7 +11,6 @@ import org.springframework.stereotype.Component;
import
com.yeejoin.amos.component.rule.MethodParam
;
import
com.yeejoin.amos.component.rule.RuleActionBean
;
import
com.yeejoin.amos.component.rule.RuleMethod
;
import
com.yeejoin.amos.fas.business.action.mq.StationEnum
;
import
com.yeejoin.amos.fas.business.action.mq.WebMqttComponent
;
import
com.yeejoin.amos.fas.business.action.result.ActionResult
;
import
com.yeejoin.amos.fas.business.action.result.BubbleTipResult
;
...
...
@@ -42,6 +41,9 @@ public class RiskSituationAction implements CustomerAction
@Value
(
"${spring.application.name}"
)
private
String
serviceName
;
@Value
(
"${station.name}"
)
private
String
stationName
;
@RuleMethod
(
methodLabel
=
"气泡提示"
,
project
=
"换流站消防专项预案"
)
public
void
sendBubbleTip
(
@MethodParam
(
paramLabel
=
"bizobj对象"
)
Object
bizobj
,
@MethodParam
(
paramLabel
=
"是否显示名称"
)
Boolean
showInfo
,
...
...
@@ -70,7 +72,7 @@ public class RiskSituationAction implements CustomerAction
String
msgType
=
"bubbleTip"
;
if
(
"mqtt"
.
equals
(
pushType
.
toLowerCase
()))
{
ToipResponse
toipResponse
=
action
.
buildResponse
(
msgType
,
bizobj
,
result
);
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
StationEnum
.
YINAN
.
getCode
()
,
"rule"
);
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
"rule"
);
webMqttComponent
.
publish
(
topic
,
toipResponse
.
toJsonStr
());
}
else
{
Object
obj
=
action
.
execute
(
msgType
,
bizobj
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/SimpleTipAction.java
View file @
b9cd3627
...
...
@@ -9,7 +9,6 @@ import org.springframework.beans.factory.annotation.Value;
import
org.springframework.stereotype.Component
;
import
com.yeejoin.amos.fas.business.action.el.ELEvaluationContext
;
import
com.yeejoin.amos.fas.business.action.mq.StationEnum
;
import
com.yeejoin.amos.fas.business.action.mq.WebMqttComponent
;
import
com.yeejoin.amos.fas.business.action.result.ActionResult
;
import
com.yeejoin.amos.fas.business.action.result.TipResult
;
...
...
@@ -43,6 +42,10 @@ public class SimpleTipAction implements CustomerAction
@Value
(
"${spring.application.name}"
)
private
String
serviceName
;
@Value
(
"${station.name}"
)
private
String
stationName
;
//@ExposeAction("消息提示")
public
void
sendMessageTip
(
Object
bizobj
,
String
title
,
String
content
,
String
type
)
{
...
...
@@ -68,7 +71,7 @@ public class SimpleTipAction implements CustomerAction
String
msgType
=
"message"
;
if
(
"mqtt"
.
equals
(
pushType
.
toLowerCase
()))
{
ToipResponse
toipResponse
=
action
.
buildResponse
(
msgType
,
bizobj
,
result
);
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
StationEnum
.
YINAN
.
getCode
()
,
"rule"
);
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
"rule"
);
webMqttComponent
.
publish
(
topic
,
toipResponse
.
toJsonStr
());
}
else
{
action
.
execute
(
msgType
,
bizobj
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/mq/StationEnum.java
deleted
100644 → 0
View file @
34164ec6
package
com
.
yeejoin
.
amos
.
fas
.
business
.
action
.
mq
;
public
enum
StationEnum
{
YINAN
(
"yinan"
,
"沂南站"
);
String
code
;
String
desc
;
private
StationEnum
(
String
code
,
String
desc
)
{
this
.
desc
=
desc
;
this
.
code
=
code
;
}
public
String
getDesc
()
{
return
desc
;
}
public
void
setDesc
(
String
desc
)
{
this
.
desc
=
desc
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/RiskSourceController.java
View file @
b9cd3627
...
...
@@ -4,6 +4,7 @@ import java.util.ArrayList;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
...
...
@@ -45,6 +46,9 @@ import io.swagger.annotations.ApiParam;
@Api
(
tags
=
"风险点API"
)
public
class
RiskSourceController
extends
BaseController
{
private
final
Logger
log
=
LoggerFactory
.
getLogger
(
RiskSourceController
.
class
);
private
final
static
String
IS_RISK_AREA
=
"TRUE"
;
@Autowired
IRiskFactorService
iRiskFactorService
;
...
...
@@ -87,7 +91,7 @@ public class RiskSourceController extends BaseController {
* @return
*/
@Permission
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"风险上升率"
,
notes
=
"风险上升率"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"风险上升率"
,
notes
=
"风险上升率"
)
@RequestMapping
(
value
=
"/riseuprate"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryForRiseUp
()
throws
Exception
{
return
CommonResponseUtil
.
success
(
riskSourceService
.
queryForRiseUp
());
...
...
@@ -116,29 +120,29 @@ public class RiskSourceController extends BaseController {
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取风险点树型结构"
,
notes
=
"获取风险点树型结构"
)
@RequestMapping
(
value
=
"/riskSourceTress"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
getRiskSourceTress
()
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
List
<
RiskSourceTreeResponse
>
riskSources
=
riskSourceService
.
findRiskSourceTrees
(
compCode
);
return
CommonResponseUtil
.
success
(
getRiskSourcesTree
(
riskSources
));
}
@Permission
@ApiOperation
(
value
=
"远程同步"
,
notes
=
"将本地 风险模型推送到远程同步"
)
@PutMapping
(
value
=
"/synToEquipManage"
)
public
CommonResponse
synToEquipManage
()
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
if
(!
riskSourceService
.
isSynEquipManage
())
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
if
(!
riskSourceService
.
isSynEquipManage
())
{
return
CommonResponseUtil
.
failure
(
"同步功能未开启"
);
}
List
<
RiskSourceTreeResponse
>
riskSources
=
riskSourceService
.
findRiskSourceTrees
(
compCode
);
List
<
RiskSourceTreeResponse
>
riskSources
=
riskSourceService
.
findRiskSourceTrees
(
compCode
)
.
stream
().
filter
(
source
->
IS_RISK_AREA
.
equalsIgnoreCase
(
source
.
getIsRegion
())).
collect
(
Collectors
.
toList
())
;
String
synMsg
=
riskSourceService
.
synToEquipManage
(
getAppKey
(),
getProduct
(),
getToken
(),
SUCCESS
,
getRiskSourcesTree
(
riskSources
));
if
(
synMsg
!=
null
)
{
return
CommonResponseUtil
.
failure
(
synMsg
);
}
return
CommonResponseUtil
.
success
();
}
/**
* 获取区域树型结构
*
...
...
@@ -149,12 +153,12 @@ public class RiskSourceController extends BaseController {
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取区域树型结构"
,
notes
=
"获取区域树型结构"
)
@RequestMapping
(
value
=
"/regionTress"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
getRegionTress
()
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
List
<
RiskSourceTreeResponse
>
riskSources
=
riskSourceService
.
findRiskSourceTrees
(
compCode
);
return
CommonResponseUtil
.
success
(
getRegionTree
(
riskSources
));
}
@Permission
//@Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"统计级别为1的风险点下面"
,
notes
=
"获取风险点树型结构"
)
...
...
@@ -184,8 +188,8 @@ public class RiskSourceController extends BaseController {
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"统计级别为1的风险点下面"
,
notes
=
"获取风险点树型结构"
)
@RequestMapping
(
value
=
"/riskSourceStatistics"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
riskSourceStatistics
()
throws
Exception
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
List
<
RiskSourceTreeResponse
>
riskSources
=
riskSourceService
.
findRiskSourceTrees
(
compCode
);
List
<
RiskSourceTreeResponse
>
treeRiskSources
=
getRiskSourcesTree
(
riskSources
);
return
CommonResponseUtil
.
success
(
riskSourceStatistics
(
treeRiskSources
));
...
...
@@ -322,7 +326,7 @@ public class RiskSourceController extends BaseController {
}
@Permission
// @Authorization(ingore = true)
// @Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"统计级别为1的风险点下面设备统计"
,
notes
=
"统计级别为1的风险点下面设备统计"
)
@RequestMapping
(
value
=
"/equipStatistics/{type}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
equipStatistics
(
@PathVariable
(
value
=
"type"
,
required
=
true
)
String
[]
type
)
throws
Exception
{
...
...
@@ -525,7 +529,7 @@ public class RiskSourceController extends BaseController {
}
return
treeList
;
}
private
static
List
<
RiskSourceTreeResponse
>
getRegionTree
(
List
<
RiskSourceTreeResponse
>
list
)
{
List
<
RiskSourceTreeResponse
>
treeList
=
new
ArrayList
<
RiskSourceTreeResponse
>();
for
(
RiskSourceTreeResponse
tree
:
list
)
{
...
...
@@ -554,7 +558,7 @@ public class RiskSourceController extends BaseController {
@ApiParam
(
value
=
"分页参数"
,
required
=
true
)
@RequestParam
Integer
pageNumber
,
@ApiParam
(
value
=
"分页参数"
,
required
=
true
)
@RequestParam
Integer
pageSize
)
{
try
{
Page
<
Map
<
String
,
Object
>>
list
=
riskSourceService
.
listFmeaPointInputitem
(
getToken
(),
getProduct
(),
getAppKey
(),
fmeaId
,
pageNumber
,
pageSize
);
Page
<
Map
<
String
,
Object
>>
list
=
riskSourceService
.
listFmeaPointInputitem
(
getToken
(),
getProduct
(),
getAppKey
(),
fmeaId
,
pageNumber
,
pageSize
);
return
CommonResponseUtil
.
success
(
list
);
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
...
...
@@ -632,15 +636,15 @@ public class RiskSourceController extends BaseController {
return
CommonResponseUtil
.
success
();
}
// @Permission
// @Permission
// @Authorization(ingore = true)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"上传巡检数据"
,
notes
=
"上传巡检数据"
)
@RequestMapping
(
value
=
"/data/patroldata"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
PUT
)
public
CommonResponse
postPatrolData
(
@RequestBody
ProtalDataRo
protalData
)
throws
Exception
{
log
.
info
(
"上传巡检数据"
+
JSONObject
.
toJSONString
(
protalData
));
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
riskSourceService
.
processProtalData
(
getToken
(),
getProduct
(),
getAppKey
(),
protalData
,
compCode
);
log
.
info
(
"上传巡检数据"
+
JSONObject
.
toJSONString
(
protalData
));
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
riskSourceService
.
processProtalData
(
getToken
(),
getProduct
(),
getAppKey
(),
protalData
,
compCode
);
return
CommonResponseUtil
.
success
();
}
...
...
@@ -714,8 +718,8 @@ public class RiskSourceController extends BaseController {
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取危险因素树二级节点"
,
notes
=
"获取危险因素树二级节点"
)
@RequestMapping
(
value
=
"/riskSourceSecondLevel"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryRiskSourceSecondLevel
()
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
return
CommonResponseUtil
.
success
(
riskSourceService
.
queryRiskSourceSecondLevel
(
compCode
));
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/SafetyController.java
View file @
b9cd3627
...
...
@@ -44,7 +44,7 @@ public class SafetyController extends BaseController{
@PostMapping
(
value
=
"/save/curCompany"
)
public
CommonResponse
saveCurCompany
(
@RequestBody
ReginParams
reginParams
)
{
this
.
saveSelectedOrgInfo
(
reginParams
);
equipmentHandlerService
.
subscribeTopic
(
reginParams
);
equipmentHandlerService
.
subscribeTopic
();
return
CommonResponseUtil
.
success
();
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/View3dController.java
View file @
b9cd3627
...
...
@@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.PathVariable;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -224,6 +225,20 @@ public class View3dController extends BaseController {
return
CommonResponseUtil
.
success
();
}
/**
* 二级区域风险等级,风险值
*
* @return
*/
@Permission
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"二级区域风险等级,风险值"
,
notes
=
"二级区域风险等级,风险值"
)
@RequestMapping
(
value
=
"/secondLevelRiskSource"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryRiskSourceSecondLevel
()
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
return
CommonResponseUtil
.
success
(
riskSourceService
.
queryRiskSourceSecondLevel
(
compCode
));
}
/**
* <pre>
* 初始化三维视图节点
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/ContingencyInstanceImpl.java
View file @
b9cd3627
...
...
@@ -25,7 +25,6 @@ import com.yeejoin.amos.fas.business.action.ContingencyAction;
import
com.yeejoin.amos.fas.business.action.model.ContingencyEvent
;
import
com.yeejoin.amos.fas.business.action.model.ContingencyRo
;
import
com.yeejoin.amos.fas.business.action.model.SetpEnum
;
import
com.yeejoin.amos.fas.business.action.mq.StationEnum
;
import
com.yeejoin.amos.fas.business.action.util.ContingencyLogPublisher
;
import
com.yeejoin.amos.fas.business.dao.mapper.FireEquipPointMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.ImpAndFireEquipMapper
;
...
...
@@ -66,6 +65,10 @@ public class ContingencyInstanceImpl /*extends GenericManagerImpl<ContingencyPla
@Autowired
private
IContingencyInstance
iContingencyInstance
;
@Value
(
"${station.name}"
)
private
String
stationName
;
private
static
Map
<
String
,
String
>
stepMap
=
new
HashMap
<>();
...
...
@@ -213,7 +216,7 @@ public class ContingencyInstanceImpl /*extends GenericManagerImpl<ContingencyPla
json
.
put
(
"msgType"
,
"message"
);
json
.
put
(
"msgContext"
,
msgContext
);
event
.
setMsgBody
(
json
.
toJSONString
());
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
StationEnum
.
YINAN
.
getCode
()
,
"plan"
);
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
"plan"
);
event
.
setTopic
(
topic
);
event
.
setMsgType
(
"clickEvent"
);
event
.
setContingency
(
batchNo
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/EquipmentServiceImpl.java
View file @
b9cd3627
...
...
@@ -117,14 +117,14 @@ public class EquipmentServiceImpl implements IEquipmentService {
public
Equipment
queryOne
(
Long
id
)
{
Optional
<
Equipment
>
dict1
=
iEquipmentDao
.
findById
(
id
);
Equipment
dict
=
null
;
if
(
dict1
.
isPresent
()){
dict
=
dict1
.
get
();
}
return
dict
;
}
@Override
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/HandlerMqttMessageImpl.java
View file @
b9cd3627
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
impl
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.UUID
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.google.common.collect.Lists
;
...
...
@@ -10,12 +33,15 @@ import com.yeejoin.amos.fas.business.action.model.FireEquimentDataRo;
import
com.yeejoin.amos.fas.business.action.model.SetpEnum
;
import
com.yeejoin.amos.fas.business.action.mq.WebMqttComponent
;
import
com.yeejoin.amos.fas.business.action.mq.WebMqttSubscribe
;
import
com.yeejoin.amos.fas.business.bo.JpushMsgBo
;
import
com.yeejoin.amos.fas.business.bo.MsgParamBo
;
import
com.yeejoin.amos.fas.business.dao.mapper.*
;
import
com.yeejoin.amos.fas.business.dao.mapper.EquipmentSpecificMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.FireEquipMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.FireEquipPointMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.FmeaEquipmentPointMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.FmeaMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.FmeaPointInputitemMapper
;
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.IEvaluationModelDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IFireEquipmentDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IPreplanPictureDao
;
import
com.yeejoin.amos.fas.business.feign.RemoteSecurityService
;
import
com.yeejoin.amos.fas.business.param.AlarmParam
;
...
...
@@ -25,28 +51,21 @@ import com.yeejoin.amos.fas.business.service.intfc.IView3dService;
import
com.yeejoin.amos.fas.business.util.JexlUtil
;
import
com.yeejoin.amos.fas.business.util.RpnUtils
;
import
com.yeejoin.amos.fas.business.util.StringUtil
;
import
com.yeejoin.amos.fas.business.vo.*
;
import
com.yeejoin.amos.fas.business.vo.EquipmentSpecificForRiskVo
;
import
com.yeejoin.amos.fas.business.vo.EquipmentSpecificIndexVo
;
import
com.yeejoin.amos.fas.business.vo.ReginParams
;
import
com.yeejoin.amos.fas.business.vo.Toke
;
import
com.yeejoin.amos.fas.business.vo.TopicEntityVo
;
import
com.yeejoin.amos.fas.client.invoke.RsDataQueue
;
import
com.yeejoin.amos.fas.common.enums.EquipmentRiskTypeEnum
;
import
com.yeejoin.amos.fas.common.enums.View3dRefreshAreaEum
;
import
com.yeejoin.amos.fas.dao.entity.*
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
import
com.yeejoin.amos.fas.dao.entity.ContingencyOriginalData
;
import
com.yeejoin.amos.fas.dao.entity.Equipment
;
import
com.yeejoin.amos.fas.dao.entity.EvaluationModel
;
import
com.yeejoin.amos.fas.dao.entity.Fmea
;
import
com.yeejoin.amos.fas.dao.entity.FmeaEquipmentPoint
;
import
com.yeejoin.amos.fas.dao.entity.FmeaPointInputitem
;
import
com.yeejoin.amos.fas.dao.entity.PreplanPicture
;
/**
* @author keyong
...
...
@@ -118,7 +137,9 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
@Autowired
private
FmeaMapper
fmeaMapper
;
@Value
(
"${station.name}"
)
private
String
stationName
;
@Value
(
"${spring.application.name}"
)
private
String
serviceName
;
...
...
@@ -166,29 +187,43 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
}
else
{
// 向三维推送实时值修改
log
.
info
(
"(监测)Message type is: "
+
equipmentSpecificIndex
.
getType
());
Map
<
String
,
Object
>
content
=
new
HashMap
<>();
// content.put("id", fireEquipmentData.getId());
// content.put("label", fireEquipmentData.getEqPointName());
// content.put("changeDate", fireEquipmentData.getCreateDate());
// content.put("orgCode", fireEquipment.getOrgCode());
// content.put("status", deviceData.getSoe());
content
.
put
(
"id"
,
"id"
);
content
.
put
(
"label"
,
"eqPointName"
);
content
.
put
(
"changeDate"
,
new
Date
());
content
.
put
(
"orgCode"
,
"orgCode"
);
content
.
put
(
"status"
,
deviceData
.
getSoe
());
iDataRefreshService
.
sendRefreshDataWithArea
(
View3dRefreshAreaEum
.
monitor_data
.
getCode
(),
content
);
String
title
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
"yinan"
,
"data/refresh/monitorData"
);
String
title
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
"data/refresh/monitorData"
);
webMqttComponent
.
publish
(
title
,
JSON
.
toJSONString
(
view3dService
.
getEquipStatusList
(
equipmentSpecific
.
getOrgCode
())));
}
}
// @Override
// public void subscribeTopic(ReginParams reginParams) {
// // 若登录系统则订阅装备数据
// webMqttSubscribe.adapter.removeTopic(defaultTopic);
// String orgCode = reginParams.getCompany().getOrgCode();
// String topic = String.format("%s.%s%s", serverName, "equipment", "/#");
// String[] strs = webMqttSubscribe.adapter.getTopic();
// List<String> list = Stream.of(strs).collect(Collectors.toList());
// if(list.size() > 0) {
// list.forEach(x -> {
// if(!(x.equals(topic))) {
// webMqttSubscribe.adapter.addTopic(topic);
// }
// });
// } else {
// webMqttSubscribe.adapter.addTopic(topic);
// }
//
// }
@Override
public
void
subscribeTopic
(
ReginParams
reginParams
)
{
public
void
subscribeTopic
()
{
// 若登录系统则订阅装备数据
webMqttSubscribe
.
adapter
.
removeTopic
(
defaultTopic
);
String
orgCode
=
reginParams
.
getCompany
().
getOrgCode
();
String
topic
=
String
.
format
(
"%s.%s.%s%s"
,
serverName
,
orgCode
,
"equipment"
,
"/#"
);
String
topic
=
String
.
format
(
"%s.%s%s"
,
serverName
,
"equipment"
,
"/#"
);
String
[]
strs
=
webMqttSubscribe
.
adapter
.
getTopic
();
List
<
String
>
list
=
Stream
.
of
(
strs
).
collect
(
Collectors
.
toList
());
if
(
list
.
size
()
>
0
)
{
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/RiskSourceServiceImpl.java
View file @
b9cd3627
This diff is collapsed.
Click to expand it.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/View3dServiceImpl.java
View file @
b9cd3627
...
...
@@ -28,6 +28,8 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
...
...
@@ -56,6 +58,7 @@ import com.yeejoin.amos.fas.business.service.intfc.IDataRefreshService;
import
com.yeejoin.amos.fas.business.service.intfc.IView3dService
;
import
com.yeejoin.amos.fas.business.vo.ErrorContentVo
;
import
com.yeejoin.amos.fas.business.vo.ExceptionRegionVo
;
import
com.yeejoin.amos.fas.business.vo.ReginParams
;
import
com.yeejoin.amos.fas.business.vo.SafetyIndexDetailVo
;
import
com.yeejoin.amos.fas.business.vo.TodaySafetyIndexVo
;
import
com.yeejoin.amos.fas.business.vo.View3dNodeVo
;
...
...
@@ -67,6 +70,7 @@ import com.yeejoin.amos.fas.common.enums.RiskSourceLevelEum;
import
com.yeejoin.amos.fas.common.enums.RiskSourceRegionEum
;
import
com.yeejoin.amos.fas.common.enums.RpnChangeTypeEum
;
import
com.yeejoin.amos.fas.common.enums.StatisticsErrorTypeEum
;
import
com.yeejoin.amos.fas.config.Permission
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.common.request.DateUtil
;
import
com.yeejoin.amos.fas.core.common.response.CoordDTO
;
...
...
@@ -85,6 +89,8 @@ import com.yeejoin.amos.fas.dao.entity.SafetyIndexChangeLog;
import
com.yeejoin.amos.fas.dao.entity.WaterResource
;
import
com.yeejoin.amos.fas.exception.YeeException
;
import
io.swagger.annotations.ApiOperation
;
/**
* @author DELL
*/
...
...
@@ -343,6 +349,8 @@ public class View3dServiceImpl implements IView3dService {
}
return
vo
;
}
@Override
public
List
<
SafetyIndexDetailVo
>
getSafetyIndexDetail
(
String
type
,
String
orgCode
)
{
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IEquipmentHandlerService.java
View file @
b9cd3627
...
...
@@ -12,5 +12,8 @@ import com.yeejoin.amos.fas.business.vo.ReginParams;
*/
public
interface
IEquipmentHandlerService
{
void
handlerMqttMessage
(
String
topic
,
String
message
);
void
subscribeTopic
(
ReginParams
reginParams
);
// void subscribeTopic(ReginParams reginParams);
void
subscribeTopic
();
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/config/PermissionAspect.java
View file @
b9cd3627
...
...
@@ -78,44 +78,43 @@ public class PermissionAspect {
if
(
joinPoint
.
getSignature
().
getName
().
equals
(
"saveCurCompany"
))
{
return
;
}
// FeignClientResult feignClientResult;
// AgencyUserModel userModel=null;
// try {
// feignClientResult = Privilege.agencyUserClient.getme();
// userModel = (AgencyUserModel) feignClientResult.getResult();
//
// } catch (InnerInvokException e) {
// e.printStackTrace();
// }
// String userId = null;
// ReginParams regionParam = new ReginParams();
// if(userModel != null){
// userId = userModel.getUserId();
// Map<Long, List<RoleModel>> orgRoles = userModel.getOrgRoles();
// List<RoleModel> roleModels = null;
// if(!ObjectUtils.isEmpty(orgRoles)) {
// for (Map.Entry<Long, List<RoleModel>> entry : orgRoles.entrySet()) {
// roleModels = entry.getValue();
// break;
// }
// }
// ReginParams reginParams = JSON.parseObject(redisTemplate.opsForValue().get(buildKey(userModel.getUserId(), token)), ReginParams.class);
// if(reginParams == null && userModel.getCompanys().size() > 0){
// CompanyModel companyModel = userModel.getCompanys().get(0);
//
// List<DepartmentModel> deptList = remoteSecurityService.getDepartmentTreeByCompanyId(token, product, appKey, companyModel.getSequenceNbr().toString());
// if(deptList.size() > 0){
// CompanyBo companyBo = convertCompanyModelToBo(companyModel);
// DepartmentBo departmentBo = convertDepartmentModelToBo(deptList.get(0));
// regionParam.setCompany(companyBo);
// regionParam.setDepartment(departmentBo);
// }
// if(!ObjectUtils.isEmpty(roleModels)){
// regionParam.setRole(convertRoleModelToBo(roleModels.get(0)));
// }
// redisTemplate.opsForValue().set(buildKey(userId, token), JSONObject.toJSONString(regionParam));
// }
// }
FeignClientResult
feignClientResult
;
AgencyUserModel
userModel
=
null
;
try
{
feignClientResult
=
Privilege
.
agencyUserClient
.
getme
();
userModel
=
(
AgencyUserModel
)
feignClientResult
.
getResult
();
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
String
userId
=
null
;
ReginParams
regionParam
=
new
ReginParams
();
if
(
userModel
!=
null
){
userId
=
userModel
.
getUserId
();
ReginParams
reginParams
=
JSON
.
parseObject
(
redisTemplate
.
opsForValue
().
get
(
buildKey
(
userModel
.
getUserId
(),
token
)),
ReginParams
.
class
);
if
(
reginParams
==
null
&&
userModel
.
getCompanys
().
size
()
>
0
){
CompanyModel
companyModel
=
userModel
.
getCompanys
().
get
(
0
);
List
<
DepartmentModel
>
deptList
=
remoteSecurityService
.
getDepartmentTreeByCompanyId
(
token
,
product
,
appKey
,
companyModel
.
getSequenceNbr
().
toString
());
if
(
deptList
.
size
()
>
0
){
CompanyBo
companyBo
=
convertCompanyModelToBo
(
companyModel
);
DepartmentBo
departmentBo
=
convertDepartmentModelToBo
(
deptList
.
get
(
0
));
regionParam
.
setCompany
(
companyBo
);
regionParam
.
setDepartment
(
departmentBo
);
}
Map
<
Long
,
List
<
RoleModel
>>
orgRoles
=
userModel
.
getOrgRoles
();
List
<
RoleModel
>
roleModels
=
null
;
if
(!
ObjectUtils
.
isEmpty
(
orgRoles
))
{
for
(
Map
.
Entry
<
Long
,
List
<
RoleModel
>>
entry
:
orgRoles
.
entrySet
())
{
roleModels
=
entry
.
getValue
();
break
;
}
}
if
(!
ObjectUtils
.
isEmpty
(
roleModels
)){
regionParam
.
setRole
(
convertRoleModelToBo
(
roleModels
.
get
(
0
)));
}
redisTemplate
.
opsForValue
().
set
(
buildKey
(
userId
,
token
),
JSONObject
.
toJSONString
(
regionParam
));
}
}
}
private
DepartmentBo
convertDepartmentModelToBo
(
DepartmentModel
departmentModel
){
...
...
YeeAmosFireAutoSysStart/src/main/resources/application-dev.properties
View file @
b9cd3627
...
...
@@ -71,4 +71,8 @@ amos.feign.gennerator.use-gateway=true
autoSys.push.type
=
mqtt
#�����
file.downLoad.url
=
http://172.16.10.175:8888/
file.downLoad.url
=
http://39.98.246.31:8888/
#站端名称使用全拼
station.name
=
yinan
YeeAmosFireAutoSysStart/src/main/resources/application.properties
View file @
b9cd3627
spring.application.name
=
AMOS-AUTOSYS
server.port
=
8083
spring.profiles.active
=
dev
#spring.freemarker.cache=false
...
...
@@ -61,4 +59,6 @@ param.safetyIndexChange.cron = 0 0 2 * * ?
param.weather.url
=
http://wthrcdn.etouch.cn/weather_mini?citykey=
#站端名称使用全拼
station.name
=
yinan
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_3d_plan_visual.xml
View file @
b9cd3627
...
...
@@ -2,8 +2,9 @@
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.PlanVisual3dMapper"
>
<!--查询-->
<!--查询
0-设备类;1-耗材类;2-视频监控;3-灭火器材'
-->
<select
id=
"getResourceListByType"
resultType=
"java.util.HashMap"
>
SELECT
rs.id as `key` ,
rs.id AS `value`,
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_alarm.xml
View file @
b9cd3627
...
...
@@ -4,7 +4,7 @@
<mapper
namespace=
"com.yeejoin.amos.fas.business.dao.mapper.AlarmMapper"
>
<!---->
<select
id=
"countPageData"
resultType=
"long"
>
SELECT
<!--
SELECT
count(a.id) AS total_num
FROM `f_alarm` a
inner join
...
...
@@ -22,7 +22,7 @@
<trim prefix="WHERE" prefixOverrides="AND ">
<if test="beginDate!=null"> and a.alarm_time >= #{beginDate} </if>
<if test="endDate!=null"> and a.alarm_time <![CDATA[<=]]> #{endDate} </if>
</trim>
</trim>
-->
</select>
<select
id=
"countAlarmData"
resultType=
"long"
>
...
...
@@ -32,7 +32,7 @@
</select>
<!--分页查询 -->
<select
id=
"getAlarmMapperPage"
resultType=
"java.util.HashMap"
>
SELECT
<!--
SELECT
a.id,
sa.code,
sa.equip_code as equipCode,
...
...
@@ -67,7 +67,7 @@
<choose>
<when test="pageSize==-1"></when>
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when>
</choose>
</choose>
-->
</select>
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_equipment_specific.xml
View file @
b9cd3627
...
...
@@ -58,20 +58,26 @@
</select>
<select
id=
"getEquipmentBySpeCount"
resultType=
"int"
>
select
count(1)
from
wl_stock_detail as sto
left join wl_equipment_detail as det on sto.equipment_detail_id = det.id
left join wl_equipment as equ on det.equipment_id = equ.id
left join wl_equipment_category as cate on equ.category_id = cate.id
where sto.amount
<![CDATA[>]]>
0
<if
test=
"name != null and name!='null' "
>
and det.name like CONCAT('%',#{name},'%' )
</if>
<if
test=
"code != null and code!='null' "
>
and cate.code like CONCAT('%',#{code},'%' )
</if>
select
count(1)
from
wl_stock_detail as sto
left join wl_equipment_specific as spe on sto.qr_code = spe.qr_code
left join wl_warehouse_structure as ware on sto.warehouse_structure_id = ware .id
left join wl_equipment_detail as det on sto.equipment_detail_id = det.id
left join wl_equipment as equ on det.equipment_id = equ.id
left join wl_equipment_category as cate on equ.category_id = cate.id
left join f_equipment_fire_equipment as fire on sto.id = fire.fire_equipment_id
where sto.amount
<![CDATA[>]]>
0
<if
test=
"name != null and name!='null' "
>
and det.name like CONCAT('%',#{name},'%' )
</if>
<if
test=
"code != null and code!='null' "
>
and cate.code like CONCAT('%',#{code},'%' )
</if>
<if
test=
"equipmentId != null and equipmentId!='null' "
>
and fire.equipment_id = #{equipmentId}
</if>
</select>
<select
id=
"getFireEquiments"
resultType=
"com.yeejoin.amos.fas.business.vo.EquipmentSpeVo"
>
select
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_fire_equip.xml
View file @
b9cd3627
...
...
@@ -115,7 +115,7 @@
<select
id=
"queryForFireEquipmentHistoryCount"
resultType=
"long"
>
SELECT
SELECT
count(1)
FROM
(
...
...
@@ -221,7 +221,6 @@
ORDER BY d.create_date desc
LIMIT ${start},${length}
</select>
...
...
@@ -359,7 +358,7 @@
f_fire_equipment_point p
LEFT JOIN f_fire_equipment e ON e.id = p.fire_equipment_id
LEFT JOIN f_dict d on d.id = p.alarm_type
where p.`code` = #{code}
where p.`code` = #{code}
</select>
<select
id=
"listByCodes"
resultType=
"com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentEntity"
>
...
...
@@ -432,7 +431,7 @@
#{item.weight},
#{item.riskSourceId}
)
</foreach>
</foreach>
</insert>
<update
id=
"updateBatch"
>
...
...
@@ -517,7 +516,7 @@
count(1)
FROM
f_equipment_fire_equipment efe
JOIN
f_fire_equipment
fe ON efe.fire_equipment_id = fe.id
JOIN
wl_equipment_specific
fe ON efe.fire_equipment_id = fe.id
WHERE
efe.equipment_id = ${equipmentId}
<if
test=
"fname != null"
>
...
...
@@ -531,7 +530,7 @@
<select
id=
"removeIfmeaPointByFireEquipIdAndEquipId"
resultType=
"long"
>
DELETE fmep FROM `f_fmea_equipment_point` fmep
LEFT JOIN
f_fire_equipment_point fep ON fep
.id = fmep.equipment_point_id
WHERE
fep.fire_equipment
_id = #{fireEquipmentId} AND fmep.important_equipment_id = #{importantEquipmentId}
LEFT JOIN
wl_equipment_specific_index esi ON esi
.id = fmep.equipment_point_id
WHERE
esi.equipment_specific
_id = #{fireEquipmentId} AND fmep.important_equipment_id = #{importantEquipmentId}
</select>
</mapper>
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_fire_equippoint.xml
View file @
b9cd3627
...
...
@@ -6,30 +6,30 @@
<select
id=
"queryOne"
resultType=
"java.util.Map"
>
select * from f_fire_equipment_point where id = ${id}
<!-- select * from f_fire_equipment_point where id = ${id} -->
</select>
<select
id=
"queryCountForPage"
resultType=
"long"
>
select count(1) from f_fire_equipment_point
<!--
select count(1) from f_fire_equipment_point
where fire_equipment_id = ${fireEqumntId}
<if test="name!=null">
and fp.name like '%${name}%'
</if>
</if>
-->
</select>
<select
id=
"queryForPage"
resultType=
"java.util.Map"
>
select * from f_fire_equipment_point fp
<!--
select * from f_fire_equipment_point fp
where fp.fire_equipment_id = ${fireEqumntId}
<if test="name!=null">
and fp.name like '%${name}%'
</if>
LIMIT ${start},${length} ;
LIMIT ${start},${length} ;
-->
</select>
<select
id=
"queryForEqueAndPointName"
resultType=
"map"
>
SELECT
<!--
SELECT
ep.`name`,
(
SELECT
...
...
@@ -52,12 +52,12 @@
AND se.risk_source_id = ${riskSourceId}
)
AND ep.type = 'SWITCH'
AND ep.`value` = 1
AND ep.`value` = 1
-->
</select>
<select
id=
"queryStopCountByEuipmentIdAndAlarmType"
resultType=
"int"
>
SELECT
<!--
SELECT
count(1)
FROM
f_equipment e,
...
...
@@ -70,11 +70,11 @@
and d.id = ep.alarm_type
AND d.dict_value = #{alarmType}
AND e.id = #{equimentId}
AND ep.`value` = #{value}
AND ep.`value` = #{value}
-->
</select>
<select
id=
"queryCountByEuipmentIdAndAlarmType"
resultType=
"int"
>
SELECT
<!--
SELECT
count(1)
FROM
f_equipment e,
...
...
@@ -86,17 +86,17 @@
AND fe.fire_equipment_id = ep.fire_equipment_id
and d.id = ep.alarm_type
AND d.dict_value = #{alarmType}
AND e.id = #{equimentId}
AND e.id = #{equimentId}
-->
</select>
<update
id=
"updateValue"
>
update f_fire_equipment_point set value = #{state},create_date = NOW() where id = #{id}
<!-- update f_fire_equipment_point set value = #{state},create_date = NOW() where id = #{id} -->
</update>
<insert
id=
"saveBatch"
keyColumn=
"id"
keyProperty=
"id"
parameterType=
"com.yeejoin.amos.fas.business.param.FireEquipmentPointParam"
useGeneratedKeys=
"true"
>
insert into f_fire_equipment_point
<!--
insert into f_fire_equipment_point
(
name,
code,
...
...
@@ -119,11 +119,11 @@
#{item.orgCode},
#{item.createBy}
)
</foreach>
</foreach>
-->
</insert>
<select
id=
"listByMap"
resultType=
"com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity"
>
select
<!--
select
a.id,
a.name,
a.code,
...
...
@@ -159,11 +159,11 @@
order by a.create_date desc
<if test="pageSize!=null and pageSize!=-1 and offset!=null">
limit #{offset},#{pageSize}
</if>
</if>
-->
</select>
<select
id=
"countByMap"
resultType=
"long"
>
select
<!--
select
count(1)
from
f_fire_equipment_point as a
...
...
@@ -178,11 +178,11 @@
<if test="type!=null and type.trim() != ''">
and a.type = #{type}
</if>
</where>
</where>
-->
</select>
<select
id=
"getByCode"
resultType=
"com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity"
>
select
<!--
select
id,
name,
code,
...
...
@@ -199,11 +199,11 @@
f_fire_equipment_point
where
code = #{code}
limit 1
limit 1
-->
</select>
<update
id=
"updateBatch"
>
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
";"
>
<!--
<foreach collection="list" item="item" index="index" separator=";">
update f_fire_equipment_point
<set>
<if test="item.name != null">
...
...
@@ -241,11 +241,11 @@
</if>
</set>
where id = #{item.id}
</foreach>
</foreach>
-->
</update>
<select
id=
"listByCodes"
resultType=
"com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity"
>
select
<!--
select
id,
name,
code,
...
...
@@ -264,11 +264,11 @@
code in
<foreach collection="codes" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</foreach>
-->
</select>
<select
id=
"getById"
resultType=
"com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity"
>
select
<!--
select
id,
name,
code,
...
...
@@ -285,11 +285,11 @@
f_fire_equipment_point
where
id = #{id}
limit 1
limit 1
-->
</select>
<select
id=
"countBindByIds"
resultType=
"java.lang.Long"
>
select
<!--
select
count(1)
from
f_fire_equipment_point
...
...
@@ -299,23 +299,23 @@
#{item}
</foreach>
and
fire_equipment_id > 0
fire_equipment_id > 0
-->
</select>
<update
id=
"updatefireEquipmentIdByIds"
>
update
<!--
update
f_fire_equipment_point
set
fire_equipment_id = #{fireEquipmentId}
where id in
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</foreach>
-->
</update>
<insert
id=
"save"
keyColumn=
"id"
keyProperty=
"id"
parameterType=
"com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity"
useGeneratedKeys=
"true"
>
insert into f_fire_equipment_point
<!--
insert into f_fire_equipment_point
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">
name,
...
...
@@ -385,11 +385,11 @@
<if test="alarmType != null">
#{alarmType},
</if>
</trim>
</trim>
-->
</insert>
<update
id=
"update"
parameterType=
"com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity"
>
update f_fire_equipment_point
<!--
update f_fire_equipment_point
<set>
<if test="name != null">
name = #{name},
...
...
@@ -425,25 +425,25 @@
alarm_type = #{alarmType},
</if>
</set>
where id = #{id}
where id = #{id}
-->
</update>
<delete
id=
"deleteBatchByIds"
>
delete from f_fire_equipment_point
<!--
delete from f_fire_equipment_point
where
id in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</foreach>
-->
</delete>
<select
id=
"getPointsByEquipmentIdAndType"
resultType=
"Map"
>
SELECT p.* from
<!--
SELECT p.* from
f_fire_equipment_point p
LEFT JOIN f_fire_equipment fe on p.fire_equipment_id = fe.id
LEFT JOIN f_equipment_fire_equipment e on fe.id = e.fire_equipment_id
where e.equipment_id = #{id}
and p.type = #{type}
and p.type = #{type}
-->
</select>
</mapper>
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_fmea_equipment_point.xml
View file @
b9cd3627
...
...
@@ -50,14 +50,14 @@
select
c.fmea_id as fmeaId
from
f_fire_equipment
as a
wl_equipment_specific
as a
left join
f_fire_equipment_point as b on b.fire_equipment
_id = a.id
wl_equipment_specific_index as b on b.equipment_specific
_id = a.id
left join
f_fmea_equipment_point as c on c.equipment_point_id = b.id
where
c.fmea_id = #{fmeaId}
group by b.
fire_equipment
_id
group by b.
equipment_specific
_id
) as d
</select>
...
...
@@ -65,21 +65,25 @@
select
c.fmea_id as fmeaId,
a.id as equipmentId,
group_concat(concat(
b.NAME
, '##', c.state ) SEPARATOR
<![CDATA[ '\n' ]]>
) as equipmentPointNames,
a
.name as equipmentName,
group_concat(concat(
ei.name
, '##', c.state ) SEPARATOR
<![CDATA[ '\n' ]]>
) as equipmentPointNames,
ed
.name as equipmentName,
a.code as equipmentCode,
d.name AS importantEquipName,
d.id AS importantEquipId
from
f_fire_equipment
as a
wl_equipment_specific
as a
left join
f_fire_equipment_point as b on b.fire_equipment_id = a.id
wl_equipment_detail as ed on ed.id = a.equipment_detail_id
left join
wl_equipment_specific_index as b on b.equipment_specific_id = a.id
left join
wl_equipment_index as ei on b.equipment_index_id = ei.id
left join
f_fmea_equipment_point as c on c.equipment_point_id = b.id
LEFT JOIN f_equipment AS d ON d.id = c.important_equipment_id
where
c.fmea_id = #{fmeaId}
group by b.
fire_equipment
_id,c.important_equipment_id
group by b.
equipment_specific
_id,c.important_equipment_id
limit #{offset},#{limit}
</select>
...
...
@@ -87,13 +91,13 @@
select
count(1)
from
f_fire_equipment_point
as a
wl_equipment_specific_index
as a
where
a.
fire_equipment
_id = #{equipmentId}
a.
equipment_specific
_id = #{equipmentId}
</select>
<select
id=
"listEquipmentPointIdsByEquipmentId"
resultType=
"java.lang.Long"
>
select id from
f_fire_equipment_point where fire_equipment
_id = #{equipmentId}
select id from
wl_equipment_specific_index where equipment_specific
_id = #{equipmentId}
</select>
<select
id=
"listByEquipmentPointId"
resultType=
"com.yeejoin.amos.fas.dao.entity.FmeaEquipmentPoint"
>
...
...
@@ -108,8 +112,8 @@
<select
id=
"listEquipmentPoint"
resultType=
"java.util.Map"
>
select
a.id,
a
.name,
a.
code,
ei
.name,
ei.name_key as
code,
(
select
case when count(1) > 0 then 'bound' else 'noBound' end
...
...
@@ -123,15 +127,15 @@
d.important_equipment_id = #{importantEquipId}
) isBound
from
f_fire_equipment_point
as a
left join
f_dict fd on fd.id = a.alarm_type
wl_equipment_specific_index
as a
left join
wl_equipment_index ei on ei.id = a.equipment_index_id
<where>
fd.dict_value = 'alarm_type_trouble
'
ei.type_code = 'BREAKDOWN
'
<if
test=
"equipmentId!=null"
>
and a.
fire_equipment
_id = #{equipmentId}
and a.
equipment_specific
_id = #{equipmentId}
</if>
<if
test=
"equipmentPointName!=null and equipmentPointName!=''"
>
and
a
.name like concat("%",#{equipmentPointName},"%")
and
ei
.name like concat("%",#{equipmentPointName},"%")
</if>
</where>
</select>
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_impAndfire_equip.xml
View file @
b9cd3627
...
...
@@ -149,12 +149,11 @@
SELECT
1
FROM
f_fire_equipment_point
ep
LEFT JOIN
f_fire_equipment e ON e.id = ep.fire_equipment
_id
wl_equipment_specific_index
ep
LEFT JOIN
wl_equipment_specific e ON e.id = ep.equipment_specific
_id
LEFT JOIN f_equipment_fire_equipment fe ON fe.fire_equipment_id = e.id
LEFT JOIN f_dict d on ep.alarm_type = d.id
where d.dict_code = 'fire_equipment_switch'
and d.dict_value = 'alarm_type_fire'
LEFT JOIN wl_equipment_index ei on ei.id = ep.equipment_index_id
where ei.type_code = 'FIREALARM'
and fe.equipment_id = #{equipmentId}
and ep.id = #{pointId}
</select>
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_risk_source.xml
View file @
b9cd3627
...
...
@@ -570,12 +570,14 @@
<select
id=
"queryForFmeaEquipAlarm"
resultType=
"map"
>
SELECT
fe
.`name` as 'fireEquipmentName',
fep
.`name` as 'name'
ed
.`name` as 'fireEquipmentName',
ei
.`name` as 'name'
FROM
`f_fmea_equipment_point` AS fmep
LEFT JOIN f_fire_equipment_point fep ON fep.id = fmep.equipment_point_id
LEFT JOIN f_fire_equipment fe ON fe.id = fep.fire_equipment_id
LEFT JOIN wl_equipment_specific_index fep ON fep.id = fmep.equipment_point_id
LEFT JOIN wl_equipment_index ei ON ei.id = fep.equipment_index_id
LEFT JOIN wl_equipment_specific fe ON fe.id = fep.equipment_specific_id
LEFT JOIN wl_equipment_detail ed ON ed.id = fe.equipment_detail_id
LEFT JOIN f_fmea fm ON fm.id = fmep.fmea_id
WHERE
fmep.state = 1
...
...
@@ -597,7 +599,7 @@
f_risk_source rs
LEFT JOIN f_risk_level rl ON rl.id = rs.risk_level_id
WHERE rs.parent_id
>
0
order by rs.id
order by rs.
sort_num,rs.
id
</select>
<select
id=
"queryByFactor"
resultType=
"com.yeejoin.amos.fas.dao.entity.RiskSource"
>
SELECT
...
...
@@ -620,9 +622,12 @@
SELECT
rs.id,
rs.`code`,
rs.`name`
rs.`name`,
rl.`level`,
rs.rpn
FROM
`f_risk_source` rs
LEFT JOIN f_risk_level rl ON rl.id = rs.risk_level_id
WHERE
rs.parent_id = (
SELECT
...
...
@@ -632,12 +637,12 @@
WHERE
parent_id = 0 and org_code = #{compCode}
)
ORDER BY sort_num
ASC,id DESC
ORDER BY sort_num
,id
</select>
<select
id=
"queryContingencyWater"
resultType=
"java.util.HashMap"
>
SELECT
<!--
SELECT
wr.alarm_level,
wr.max_level,
wr.area,
...
...
@@ -654,7 +659,7 @@
wr.alarm_level,
wr.max_level,
wr.area,
wr.`name`
wr.`name`
-->
</select>
...
...
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