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
b0822c9c
Commit
b0822c9c
authored
Jun 24, 2020
by
maoying
Browse files
Options
Browse Files
Download
Plain Diff
解决冲突
parents
df82f465
4f60600e
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
357 additions
and
191 deletions
+357
-191
ExcelController.java
...yeejoin/amos/fas/business/controller/ExcelController.java
+6
-1
FireEquimtPointController.java
...os/fas/business/controller/FireEquimtPointController.java
+15
-0
FireSourceController.java
...in/amos/fas/business/controller/FireSourceController.java
+9
-1
FireEquipMapper.java
...yeejoin/amos/fas/business/dao/mapper/FireEquipMapper.java
+4
-2
IEquipmentFireEquipmentDao.java
...s/business/dao/repository/IEquipmentFireEquipmentDao.java
+3
-0
IFireEquipmentPointDao.java
...s/fas/business/dao/repository/IFireEquipmentPointDao.java
+10
-0
IRiskSourceDao.java
...join/amos/fas/business/dao/repository/IRiskSourceDao.java
+2
-0
FeignBasicAuthRequestInterceptor.java
.../fas/business/feign/FeignBasicAuthRequestInterceptor.java
+13
-10
FireEquipmentParam.java
...m/yeejoin/amos/fas/business/param/FireEquipmentParam.java
+18
-1
WaterResourceParam.java
...m/yeejoin/amos/fas/business/param/WaterResourceParam.java
+21
-4
AccidentTypeServiceImpl.java
...os/fas/business/service/impl/AccidentTypeServiceImpl.java
+1
-1
EquipmentServiceImpl.java
.../amos/fas/business/service/impl/EquipmentServiceImpl.java
+6
-0
ExcelServiceImpl.java
...join/amos/fas/business/service/impl/ExcelServiceImpl.java
+22
-0
FireEquipPointServiceImpl.java
.../fas/business/service/impl/FireEquipPointServiceImpl.java
+12
-0
FireEquipServiceImpl.java
.../amos/fas/business/service/impl/FireEquipServiceImpl.java
+3
-3
RiskSourceServiceImpl.java
...amos/fas/business/service/impl/RiskSourceServiceImpl.java
+155
-145
IEquipmentService.java
...in/amos/fas/business/service/intfc/IEquipmentService.java
+2
-0
IFireEquipPontService.java
...mos/fas/business/service/intfc/IFireEquipPontService.java
+6
-0
IFireEquipService.java
...in/amos/fas/business/service/intfc/IFireEquipService.java
+1
-1
application-dev.properties
...utoSysStart/src/main/resources/application-dev.properties
+6
-4
application.properties
...ireAutoSysStart/src/main/resources/application.properties
+11
-12
dbTemplate_fire_equip.xml
...rt/src/main/resources/db/mapper/dbTemplate_fire_equip.xml
+29
-5
dbTemplate_view3d.xml
...sStart/src/main/resources/db/mapper/dbTemplate_view3d.xml
+2
-1
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/ExcelController.java
View file @
b0822c9c
...
@@ -9,6 +9,8 @@ import com.yeejoin.amos.fas.business.util.FileHelper;
...
@@ -9,6 +9,8 @@ import com.yeejoin.amos.fas.business.util.FileHelper;
import
com.yeejoin.amos.fas.business.vo.ReginParams
;
import
com.yeejoin.amos.fas.business.vo.ReginParams
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.exception.YeeException
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
io.swagger.annotations.ApiParam
;
...
@@ -119,7 +121,10 @@ public class ExcelController extends BaseController {
...
@@ -119,7 +121,10 @@ public class ExcelController extends BaseController {
iExcelService
.
importWaterResource
(
list
);
iExcelService
.
importWaterResource
(
list
);
}
}
return
CommonResponseUtil
.
success
();
return
CommonResponseUtil
.
success
();
}
catch
(
Exception
e
)
{
}
catch
(
YeeException
e
)
{
logger
.
info
(
"导入数据异常"
,
e
);
return
CommonResponseUtil
.
failure
(
e
.
getMessage
());
}
catch
(
Exception
e
)
{
logger
.
info
(
"导入数据异常"
,
e
);
logger
.
info
(
"导入数据异常"
,
e
);
return
CommonResponseUtil
.
failure
(
"导入失败"
);
return
CommonResponseUtil
.
failure
(
"导入失败"
);
}
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/FireEquimtPointController.java
View file @
b0822c9c
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
com.itextpdf.text.pdf.PdfStructTreeController.returnType
;
import
com.yeejoin.amos.fas.business.dao.mapper.FireEquipPointMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.FireEquipPointMapper
;
import
com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity
;
import
com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity
;
import
com.yeejoin.amos.fas.business.service.intfc.IFireEquipPontService
;
import
com.yeejoin.amos.fas.business.service.intfc.IFireEquipPontService
;
...
@@ -163,6 +164,15 @@ public class FireEquimtPointController extends BaseController {
...
@@ -163,6 +164,15 @@ public class FireEquimtPointController extends BaseController {
@ApiOperation
(
value
=
"修改监测点"
,
notes
=
"修改监测点"
)
@ApiOperation
(
value
=
"修改监测点"
,
notes
=
"修改监测点"
)
@PostMapping
(
value
=
"/update"
)
@PostMapping
(
value
=
"/update"
)
public
CommonResponse
update
(
@ApiParam
(
value
=
"监测点对象"
,
required
=
true
)
@RequestBody
FireEquipmentPointEntity
fireEquipmentPointEntity
)
{
public
CommonResponse
update
(
@ApiParam
(
value
=
"监测点对象"
,
required
=
true
)
@RequestBody
FireEquipmentPointEntity
fireEquipmentPointEntity
)
{
FireEquipmentPoint
old
=
fireEquipPontService
.
queryOne
(
fireEquipmentPointEntity
.
getId
());
if
(
old
.
getId
()
!=
0
)
{
String
[]
idArray
=
new
String
[]
{
String
.
valueOf
(
old
.
getId
())
};
if
(
fireEquipPontService
.
countImpEquipment
(
idArray
)
>
0
)
{
String
riskSourceNames
=
fireEquipPontService
.
findBindRiskSourceStrByPointIds
(
idArray
);
return
CommonResponseUtil
.
failure
(
"该设备已被风险区域 ["
+
riskSourceNames
+
"] 绑定,请先删除绑定关系"
);
}
}
return
fireEquipPontService
.
update
(
fireEquipmentPointEntity
);
return
fireEquipPontService
.
update
(
fireEquipmentPointEntity
);
}
}
...
@@ -172,6 +182,11 @@ public class FireEquimtPointController extends BaseController {
...
@@ -172,6 +182,11 @@ public class FireEquimtPointController extends BaseController {
if
(
StringUtils
.
isEmpty
(
pointIds
))
{
if
(
StringUtils
.
isEmpty
(
pointIds
))
{
return
CommonResponseUtil
.
failure
(
"监测点编号必填"
);
return
CommonResponseUtil
.
failure
(
"监测点编号必填"
);
}
}
String
[]
idArray
=
pointIds
.
split
(
","
);
if
(
fireEquipPontService
.
countImpEquipment
(
idArray
)
>
0
)
{
String
riskSourceNames
=
fireEquipPontService
.
findBindRiskSourceStrByPointIds
(
idArray
);
return
CommonResponseUtil
.
failure
(
"该点位已被风险区域 ["
+
riskSourceNames
+
"] 绑定,请先删除绑定关系"
);
}
List
<
Long
>
ids
=
Arrays
.
stream
(
pointIds
.
split
(
","
)).
map
(
s
->
Long
.
parseLong
(
s
.
trim
())).
collect
(
Collectors
.
toList
());
List
<
Long
>
ids
=
Arrays
.
stream
(
pointIds
.
split
(
","
)).
map
(
s
->
Long
.
parseLong
(
s
.
trim
())).
collect
(
Collectors
.
toList
());
return
fireEquipPontService
.
batchDelete
(
ids
);
return
fireEquipPontService
.
batchDelete
(
ids
);
}
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/FireSourceController.java
View file @
b0822c9c
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
import
com.yeejoin.amos.fas.business.param.CommonPageInfoParam
;
import
com.yeejoin.amos.fas.business.param.CommonPageInfoParam
;
import
com.yeejoin.amos.fas.business.service.intfc.IEquipmentService
;
import
com.yeejoin.amos.fas.business.service.intfc.IFireCarService
;
import
com.yeejoin.amos.fas.business.service.intfc.IFireCarService
;
import
com.yeejoin.amos.fas.business.service.intfc.IFireEquipService
;
import
com.yeejoin.amos.fas.business.service.intfc.IFireEquipService
;
import
com.yeejoin.amos.fas.business.service.intfc.IWaterResourceService
;
import
com.yeejoin.amos.fas.business.service.intfc.IWaterResourceService
;
...
@@ -16,6 +17,7 @@ import com.yeejoin.amos.fas.dao.entity.FireEquipment;
...
@@ -16,6 +17,7 @@ import com.yeejoin.amos.fas.dao.entity.FireEquipment;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
io.swagger.annotations.ApiParam
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Page
;
...
@@ -35,6 +37,8 @@ public class FireSourceController extends BaseController {
...
@@ -35,6 +37,8 @@ public class FireSourceController extends BaseController {
private
IFireEquipService
iFireEquipService
;
private
IFireEquipService
iFireEquipService
;
@Autowired
@Autowired
private
IWaterResourceService
iWaterResourceService
;
private
IWaterResourceService
iWaterResourceService
;
@Autowired
private
IEquipmentService
iEquipService
;
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"添加消防装备"
,
notes
=
"添加消防装备"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"添加消防装备"
,
notes
=
"添加消防装备"
)
@RequestMapping
(
value
=
""
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
""
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
...
@@ -82,6 +86,9 @@ public class FireSourceController extends BaseController {
...
@@ -82,6 +86,9 @@ public class FireSourceController extends BaseController {
if
(
iFireEquipService
.
countAssociatedEquipStationByIds
(
idArray
)
>
0
)
{
if
(
iFireEquipService
.
countAssociatedEquipStationByIds
(
idArray
)
>
0
)
{
return
CommonResponseUtil
.
failure
(
"该设备已被消防泡沫间或消防小室绑定,请先删除绑定关系"
);
return
CommonResponseUtil
.
failure
(
"该设备已被消防泡沫间或消防小室绑定,请先删除绑定关系"
);
}
}
if
(
iEquipService
.
countImpEquipByIds
(
idArray
)
>
0
)
{
return
CommonResponseUtil
.
failure
(
"该设备已被重点设备绑定,请先删除绑定关系"
);
}
return
CommonResponseUtil
.
success
(
iFireEquipService
.
delete
(
idArray
));
return
CommonResponseUtil
.
success
(
iFireEquipService
.
delete
(
idArray
));
}
}
...
@@ -177,11 +184,12 @@ public class FireSourceController extends BaseController {
...
@@ -177,11 +184,12 @@ public class FireSourceController extends BaseController {
@ApiParam
(
value
=
"设备名称"
,
required
=
false
)
@RequestParam
(
required
=
false
)
String
name
,
@ApiParam
(
value
=
"设备名称"
,
required
=
false
)
@RequestParam
(
required
=
false
)
String
name
,
@ApiParam
(
value
=
"设备编号"
,
required
=
false
)
@RequestParam
(
required
=
false
)
String
code
,
@ApiParam
(
value
=
"设备编号"
,
required
=
false
)
@RequestParam
(
required
=
false
)
String
code
,
@ApiParam
(
value
=
"设备类型"
,
required
=
false
)
@RequestParam
(
required
=
false
)
String
equipClassify
,
@ApiParam
(
value
=
"设备类型"
,
required
=
false
)
@RequestParam
(
required
=
false
)
String
equipClassify
,
@ApiParam
(
value
=
"是否绑定配套设备"
,
required
=
false
)
@RequestParam
(
required
=
false
)
String
bindStation
,
int
pageNumber
,
int
pageSize
)
{
int
pageNumber
,
int
pageSize
)
{
CommonPageable
commonPageable
=
new
CommonPageable
(
pageNumber
,
pageSize
);
CommonPageable
commonPageable
=
new
CommonPageable
(
pageNumber
,
pageSize
);
return
CommonResponseUtil
.
success
(
iFireEquipService
.
queryForEquipmentList
(
StringUtils
.
trimToNull
(
name
),
return
CommonResponseUtil
.
success
(
iFireEquipService
.
queryForEquipmentList
(
StringUtils
.
trimToNull
(
name
),
StringUtils
.
trimToNull
(
code
),
StringUtils
.
trimToNull
(
equipClassify
),
commonPageable
));
StringUtils
.
trimToNull
(
code
),
StringUtils
.
trimToNull
(
equipClassify
),
commonPageable
,
StringUtils
.
trimToNull
(
bindStation
)
));
}
}
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"消防状态明细信息"
,
notes
=
"消防状态明细信息"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"消防状态明细信息"
,
notes
=
"消防状态明细信息"
)
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/FireEquipMapper.java
View file @
b0822c9c
...
@@ -41,14 +41,16 @@ public interface FireEquipMapper extends BaseMapper {
...
@@ -41,14 +41,16 @@ public interface FireEquipMapper extends BaseMapper {
long
queryForEquipmentPageCount
(
@Param
(
"name"
)
String
name
,
long
queryForEquipmentPageCount
(
@Param
(
"name"
)
String
name
,
@Param
(
"code"
)
String
code
,
@Param
(
"code"
)
String
code
,
@Param
(
"equipClassify"
)
String
equipClassify
);
@Param
(
"equipClassify"
)
String
equipClassify
,
@Param
(
"bindStation"
)
String
bindStation
);
List
<
Map
>
queryForEquipmentPage
(
List
<
Map
>
queryForEquipmentPage
(
@Param
(
"name"
)
String
name
,
@Param
(
"name"
)
String
name
,
@Param
(
"code"
)
String
code
,
@Param
(
"code"
)
String
code
,
@Param
(
"equipClassify"
)
String
equipClassify
,
@Param
(
"equipClassify"
)
String
equipClassify
,
@Param
(
"start"
)
long
start
,
@Param
(
"start"
)
long
start
,
@Param
(
"length"
)
int
length
);
@Param
(
"length"
)
int
length
,
@Param
(
"bindStation"
)
String
bindStation
);
List
<
Map
>
queryForGroupCount
(
@Param
(
"fireStationId"
)
Long
fireStationId
);
List
<
Map
>
queryForGroupCount
(
@Param
(
"fireStationId"
)
Long
fireStationId
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IEquipmentFireEquipmentDao.java
View file @
b0822c9c
...
@@ -22,4 +22,7 @@ public interface IEquipmentFireEquipmentDao extends BaseDao<EquipmentFireEquipme
...
@@ -22,4 +22,7 @@ public interface IEquipmentFireEquipmentDao extends BaseDao<EquipmentFireEquipme
List
<
EquipmentFireEquipment
>
findAllByEquipmentId
(
Long
equipmentId
);
List
<
EquipmentFireEquipment
>
findAllByEquipmentId
(
Long
equipmentId
);
@Query
(
value
=
"SELECT count(1) FROM `f_equipment_fire_equipment` WHERE fire_equipment_id in ?1"
,
nativeQuery
=
true
)
int
countImpEquipByIds
(
String
[]
ids
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IFireEquipmentPointDao.java
View file @
b0822c9c
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.fas.business.dao.repository;
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.fas.business.dao.repository;
import
java.util.Optional
;
import
java.util.Optional
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
com.yeejoin.amos.fas.dao.entity.FireEquipmentPoint
;
import
com.yeejoin.amos.fas.dao.entity.FireEquipmentPoint
;
...
@@ -15,4 +16,13 @@ public interface IFireEquipmentPointDao extends BaseDao<FireEquipmentPoint, Long
...
@@ -15,4 +16,13 @@ public interface IFireEquipmentPointDao extends BaseDao<FireEquipmentPoint, Long
int
countByCode
(
String
code
);
int
countByCode
(
String
code
);
@Query
(
value
=
"SELECT count(1) FROM `f_fmea_equipment_point` WHERE equipment_point_id in ?1"
,
nativeQuery
=
true
)
int
countImpEquipment
(
String
[]
idArray
);
@Query
(
value
=
"select group_CONCAT(r.name) from f_fmea_equipment_point ep "
+
"left join f_fmea f on f.id = ep.fmea_id "
+
"left join f_risk_source r on r.id = f.risk_source_id "
+
" WHERE ep.equipment_point_id in ?1 "
,
nativeQuery
=
true
)
String
findBindRiskSourceStrByPointIds
(
String
[]
idArray
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IRiskSourceDao.java
View file @
b0822c9c
...
@@ -39,4 +39,6 @@ public interface IRiskSourceDao extends BaseDao<RiskSource, Long> {
...
@@ -39,4 +39,6 @@ public interface IRiskSourceDao extends BaseDao<RiskSource, Long> {
Optional
<
RiskSource
>
findByOrgCodeAndParentId
(
String
orgCode
,
Long
parentId
);
Optional
<
RiskSource
>
findByOrgCodeAndParentId
(
String
orgCode
,
Long
parentId
);
List
<
RiskSource
>
findByParentIdAndIsRegion
(
long
id
,
String
string
);
List
<
RiskSource
>
findByParentIdAndIsRegion
(
long
id
,
String
string
);
Optional
<
RiskSource
>
findByCode
(
String
riskSourceCode
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/feign/FeignBasicAuthRequestInterceptor.java
View file @
b0822c9c
...
@@ -16,15 +16,18 @@ public class FeignBasicAuthRequestInterceptor implements RequestInterceptor{
...
@@ -16,15 +16,18 @@ public class FeignBasicAuthRequestInterceptor implements RequestInterceptor{
@Override
@Override
public
void
apply
(
RequestTemplate
template
)
{
public
void
apply
(
RequestTemplate
template
)
{
ServletRequestAttributes
attributes
=
(
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
();
ServletRequestAttributes
attributes
=
(
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
();
HttpServletRequest
request
=
attributes
.
getRequest
();
if
(
attributes
!=
null
)
{
/* Get token from header */
HttpServletRequest
request
=
attributes
.
getRequest
();
String
authToken
=
request
.
getHeader
(
"X-Access-Token"
);
/* If token not found get it from request parameter */
/* Get token from header */
if
(
authToken
==
null
)
String
authToken
=
request
.
getHeader
(
"X-Access-Token"
);
{
/* If token not found get it from request parameter */
authToken
=
request
.
getParameter
(
"token"
);
if
(
authToken
==
null
)
}
{
template
.
header
(
"X-Access-Token"
,
authToken
);
authToken
=
request
.
getParameter
(
"token"
);
template
.
header
(
"token"
,
authToken
);
}
template
.
header
(
"X-Access-Token"
,
authToken
);
template
.
header
(
"token"
,
authToken
);
}
}
}
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/param/FireEquipmentParam.java
View file @
b0822c9c
...
@@ -48,8 +48,11 @@ public class FireEquipmentParam {
...
@@ -48,8 +48,11 @@ public class FireEquipmentParam {
@Excel
(
name
=
"重量"
,
orderNum
=
"13"
)
@Excel
(
name
=
"重量"
,
orderNum
=
"13"
)
private
Double
weight
=
0.00
;
private
Double
weight
=
0.00
;
@Excel
(
name
=
"风险区域编号
"
,
orderNum
=
"14"
)
// @Excel(name = "风险区域id
", orderNum = "14")
private
Long
riskSourceId
;
private
Long
riskSourceId
;
@Excel
(
name
=
"风险区域编号(必填)"
,
orderNum
=
"14"
)
private
String
riskSourceCode
;
@Excel
(
name
=
"厂商"
,
orderNum
=
"15"
,
width
=
20
)
@Excel
(
name
=
"厂商"
,
orderNum
=
"15"
,
width
=
20
)
private
String
manufacturer
;
private
String
manufacturer
;
...
@@ -189,4 +192,18 @@ public class FireEquipmentParam {
...
@@ -189,4 +192,18 @@ public class FireEquipmentParam {
public
void
setManufacturer
(
String
manufacturer
)
{
public
void
setManufacturer
(
String
manufacturer
)
{
this
.
manufacturer
=
manufacturer
;
this
.
manufacturer
=
manufacturer
;
}
}
/**
* @return the riskSourceCode
*/
public
String
getRiskSourceCode
()
{
return
riskSourceCode
;
}
/**
* @param riskSourceCode the riskSourceCode to set
*/
public
void
setRiskSourceCode
(
String
riskSourceCode
)
{
this
.
riskSourceCode
=
riskSourceCode
;
}
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/param/WaterResourceParam.java
View file @
b0822c9c
...
@@ -6,13 +6,13 @@ public class WaterResourceParam {
...
@@ -6,13 +6,13 @@ public class WaterResourceParam {
private
Long
id
;
private
Long
id
;
@Excel
(
name
=
"编号"
,
width
=
20
)
@Excel
(
name
=
"编号
(必填)
"
,
width
=
20
)
private
String
code
;
private
String
code
;
@Excel
(
name
=
"名称"
,
orderNum
=
"1"
,
width
=
20
)
@Excel
(
name
=
"名称"
,
orderNum
=
"1"
,
width
=
20
)
private
String
name
;
private
String
name
;
@Excel
(
name
=
"类型"
,
replace
=
{
"消火栓_1"
,
"消防水池_2"
,
"喷淋_3"
},
orderNum
=
"3"
)
@Excel
(
name
=
"类型
(消火栓_1,消防水池_2,喷淋_3)
"
,
replace
=
{
"消火栓_1"
,
"消防水池_2"
,
"喷淋_3"
},
orderNum
=
"3"
)
private
String
type
;
private
String
type
;
@Excel
(
name
=
"三维坐标"
,
orderNum
=
"4"
,
width
=
15
)
@Excel
(
name
=
"三维坐标"
,
orderNum
=
"4"
,
width
=
15
)
...
@@ -21,11 +21,14 @@ public class WaterResourceParam {
...
@@ -21,11 +21,14 @@ public class WaterResourceParam {
@Excel
(
name
=
"三维楼层"
,
orderNum
=
"5"
)
@Excel
(
name
=
"三维楼层"
,
orderNum
=
"5"
)
private
String
floor3d
;
private
String
floor3d
;
@Excel
(
name
=
"是否室内"
,
replace
=
{
"是_1"
,
"否_0"
},
orderNum
=
"6"
)
@Excel
(
name
=
"是否室内
(是_1,否_0)
"
,
replace
=
{
"是_1"
,
"否_0"
},
orderNum
=
"6"
)
private
Boolean
isIndoor
=
true
;
private
Boolean
isIndoor
=
true
;
@Excel
(
name
=
"所属风险区域"
,
orderNum
=
"7"
)
//
@Excel(name = "所属风险区域", orderNum = "7")
private
Long
riskSourceId
;
private
Long
riskSourceId
;
@Excel
(
name
=
"所属风险区域编号(必填)"
,
orderNum
=
"7"
)
private
String
riskSourceCode
;
@Excel
(
name
=
"房间"
,
orderNum
=
"8"
)
@Excel
(
name
=
"房间"
,
orderNum
=
"8"
)
private
String
room
;
private
String
room
;
...
@@ -123,4 +126,18 @@ public class WaterResourceParam {
...
@@ -123,4 +126,18 @@ public class WaterResourceParam {
public
void
setOrgCode
(
String
orgCode
)
{
public
void
setOrgCode
(
String
orgCode
)
{
this
.
orgCode
=
orgCode
;
this
.
orgCode
=
orgCode
;
}
}
/**
* @return the riskSourceCode
*/
public
String
getRiskSourceCode
()
{
return
riskSourceCode
;
}
/**
* @param riskSourceCode the riskSourceCode to set
*/
public
void
setRiskSourceCode
(
String
riskSourceCode
)
{
this
.
riskSourceCode
=
riskSourceCode
;
}
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/AccidentTypeServiceImpl.java
View file @
b0822c9c
...
@@ -51,7 +51,7 @@ public class AccidentTypeServiceImpl implements IAccidentTypeService {
...
@@ -51,7 +51,7 @@ public class AccidentTypeServiceImpl implements IAccidentTypeService {
private
void
checkBeforeDet
(
Long
id
)
{
private
void
checkBeforeDet
(
Long
id
)
{
List
<
RiskFactor
>
list
=
iRiskFactorDao
.
findByAccidentTypeId
(
id
);
List
<
RiskFactor
>
list
=
iRiskFactorDao
.
findByAccidentTypeId
(
id
);
if
(
null
!=
list
&&
list
.
size
()>
0
){
if
(
null
!=
list
&&
list
.
size
()>
0
){
throw
new
YeeException
(
"危险因素"
+
list
.
get
(
0
).
getName
()+
"在使用中,不能删除"
);
throw
new
YeeException
(
list
.
get
(
0
).
getName
()+
"在使用中,不能删除"
);
}
}
}
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/EquipmentServiceImpl.java
View file @
b0822c9c
...
@@ -486,4 +486,10 @@ public class EquipmentServiceImpl implements IEquipmentService {
...
@@ -486,4 +486,10 @@ public class EquipmentServiceImpl implements IEquipmentService {
return
data
.
get
(
0
);
return
data
.
get
(
0
);
}
}
@Override
public
int
countImpEquipByIds
(
String
[]
idArray
)
{
return
equipmentFireEquipmentDao
.
countImpEquipByIds
(
idArray
);
}
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/ExcelServiceImpl.java
View file @
b0822c9c
...
@@ -6,6 +6,7 @@ import com.google.common.collect.Sets;
...
@@ -6,6 +6,7 @@ import com.google.common.collect.Sets;
import
com.yeejoin.amos.fas.business.dao.mapper.FireEquipMapper
;
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.FireEquipPointMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.WaterResourceMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.WaterResourceMapper
;
import
com.yeejoin.amos.fas.business.dao.repository.IRiskSourceDao
;
import
com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentEntity
;
import
com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentEntity
;
import
com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity
;
import
com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity
;
import
com.yeejoin.amos.fas.business.param.FireEquipmentParam
;
import
com.yeejoin.amos.fas.business.param.FireEquipmentParam
;
...
@@ -14,7 +15,10 @@ import com.yeejoin.amos.fas.business.param.WaterResourceParam;
...
@@ -14,7 +15,10 @@ import com.yeejoin.amos.fas.business.param.WaterResourceParam;
import
com.yeejoin.amos.fas.business.service.intfc.IExcelService
;
import
com.yeejoin.amos.fas.business.service.intfc.IExcelService
;
import
com.yeejoin.amos.fas.business.service.intfc.IFireEquipPontService
;
import
com.yeejoin.amos.fas.business.service.intfc.IFireEquipPontService
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.dao.entity.RiskSource
;
import
com.yeejoin.amos.fas.dao.entity.WaterResource
;
import
com.yeejoin.amos.fas.dao.entity.WaterResource
;
import
com.yeejoin.amos.fas.exception.YeeException
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.data.domain.PageImpl
;
...
@@ -25,6 +29,7 @@ import org.springframework.util.CollectionUtils;
...
@@ -25,6 +29,7 @@ import org.springframework.util.CollectionUtils;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.Set
;
import
java.util.Set
;
@Service
(
"excelService"
)
@Service
(
"excelService"
)
...
@@ -41,6 +46,9 @@ public class ExcelServiceImpl implements IExcelService {
...
@@ -41,6 +46,9 @@ public class ExcelServiceImpl implements IExcelService {
@Autowired
@Autowired
private
WaterResourceMapper
waterResourceMapper
;
private
WaterResourceMapper
waterResourceMapper
;
@Autowired
private
IRiskSourceDao
riskSourceDao
;
@Transactional
@Transactional
@Override
@Override
...
@@ -53,6 +61,13 @@ public class ExcelServiceImpl implements IExcelService {
...
@@ -53,6 +61,13 @@ public class ExcelServiceImpl implements IExcelService {
List
<
FireEquipmentParam
>
updateList
=
Lists
.
newArrayList
();
List
<
FireEquipmentParam
>
updateList
=
Lists
.
newArrayList
();
list
.
forEach
(
fireEquipment
->
{
list
.
forEach
(
fireEquipment
->
{
String
code
=
fireEquipment
.
getCode
();
String
code
=
fireEquipment
.
getCode
();
String
riskSourceCode
=
fireEquipment
.
getRiskSourceCode
();
Optional
<
RiskSource
>
riskSourceOptional
=
riskSourceDao
.
findByCode
(
riskSourceCode
);
if
(
riskSourceOptional
.
isPresent
())
{
fireEquipment
.
setRiskSourceId
(
riskSourceOptional
.
get
().
getId
());
}
else
{
throw
new
YeeException
(
"编号: ["
+
riskSourceCode
+
"] 风险区域不存在!"
);
}
FireEquipmentEntity
fireEquipmentEntity
=
equipmentMap
.
get
(
code
);
FireEquipmentEntity
fireEquipmentEntity
=
equipmentMap
.
get
(
code
);
if
(
fireEquipmentEntity
==
null
)
{
if
(
fireEquipmentEntity
==
null
)
{
saveList
.
add
(
fireEquipment
);
saveList
.
add
(
fireEquipment
);
...
@@ -132,6 +147,13 @@ public class ExcelServiceImpl implements IExcelService {
...
@@ -132,6 +147,13 @@ public class ExcelServiceImpl implements IExcelService {
List
<
WaterResourceParam
>
saveList
=
Lists
.
newArrayList
();
List
<
WaterResourceParam
>
saveList
=
Lists
.
newArrayList
();
List
<
WaterResourceParam
>
updateList
=
Lists
.
newArrayList
();
List
<
WaterResourceParam
>
updateList
=
Lists
.
newArrayList
();
list
.
forEach
(
warerRes
->
{
list
.
forEach
(
warerRes
->
{
String
riskSourceCode
=
warerRes
.
getRiskSourceCode
();
Optional
<
RiskSource
>
riskSourceOptional
=
riskSourceDao
.
findByCode
(
riskSourceCode
);
if
(
riskSourceOptional
.
isPresent
())
{
warerRes
.
setRiskSourceId
(
riskSourceOptional
.
get
().
getId
());
}
else
{
throw
new
YeeException
(
"编号: ["
+
riskSourceCode
+
"] 风险区域不存在!"
);
}
String
code
=
warerRes
.
getCode
();
String
code
=
warerRes
.
getCode
();
WaterResource
waterResource
=
waterResourceMap
.
get
(
code
);
WaterResource
waterResource
=
waterResourceMap
.
get
(
code
);
if
(
waterResource
==
null
)
{
if
(
waterResource
==
null
)
{
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/FireEquipPointServiceImpl.java
View file @
b0822c9c
...
@@ -154,4 +154,16 @@ public class FireEquipPointServiceImpl implements IFireEquipPontService {
...
@@ -154,4 +154,16 @@ public class FireEquipPointServiceImpl implements IFireEquipPontService {
List
<
FireEquipmentEntity
>
equipments
=
fireEquipMapper
.
listByType
(
type
);
List
<
FireEquipmentEntity
>
equipments
=
fireEquipMapper
.
listByType
(
type
);
return
CommonResponseUtil
.
success
(
equipments
);
return
CommonResponseUtil
.
success
(
equipments
);
}
}
@Override
public
int
countImpEquipment
(
String
[]
idArray
)
{
return
fireEquipmentPointDao
.
countImpEquipment
(
idArray
);
}
@Override
public
String
findBindRiskSourceStrByPointIds
(
String
[]
idArray
)
{
return
fireEquipmentPointDao
.
findBindRiskSourceStrByPointIds
(
idArray
);
}
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/FireEquipServiceImpl.java
View file @
b0822c9c
...
@@ -119,9 +119,9 @@ public class FireEquipServiceImpl implements IFireEquipService {
...
@@ -119,9 +119,9 @@ public class FireEquipServiceImpl implements IFireEquipService {
}
}
public
Page
queryForEquipmentList
(
String
name
,
String
code
,
String
equipClassify
,
CommonPageable
commonPageable
)
{
public
Page
queryForEquipmentList
(
String
name
,
String
code
,
String
equipClassify
,
CommonPageable
commonPageable
,
String
bindStation
)
{
long
total
=
fireEquipMapper
.
queryForEquipmentPageCount
(
name
,
code
,
equipClassify
);
long
total
=
fireEquipMapper
.
queryForEquipmentPageCount
(
name
,
code
,
equipClassify
,
bindStation
);
List
<
Map
>
content
=
this
.
fireEquipMapper
.
queryForEquipmentPage
(
name
,
code
,
equipClassify
,
commonPageable
.
getOffset
(),
commonPageable
.
getPageSize
());
List
<
Map
>
content
=
this
.
fireEquipMapper
.
queryForEquipmentPage
(
name
,
code
,
equipClassify
,
commonPageable
.
getOffset
(),
commonPageable
.
getPageSize
()
,
bindStation
);
Page
result
=
new
CommonPage
(
content
,
commonPageable
,
total
);
Page
result
=
new
CommonPage
(
content
,
commonPageable
,
total
);
return
result
;
return
result
;
}
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/RiskSourceServiceImpl.java
View file @
b0822c9c
...
@@ -3,7 +3,6 @@ package com.yeejoin.amos.fas.business.service.impl;
...
@@ -3,7 +3,6 @@ package com.yeejoin.amos.fas.business.service.impl;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.google.common.base.Joiner
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Sets
;
import
com.google.common.collect.Sets
;
...
@@ -26,10 +25,9 @@ import com.yeejoin.amos.fas.business.service.intfc.IDataRefreshService;
...
@@ -26,10 +25,9 @@ import com.yeejoin.amos.fas.business.service.intfc.IDataRefreshService;
import
com.yeejoin.amos.fas.business.service.intfc.IEquipmentService
;
import
com.yeejoin.amos.fas.business.service.intfc.IEquipmentService
;
import
com.yeejoin.amos.fas.business.service.intfc.IRiskSourceService
;
import
com.yeejoin.amos.fas.business.service.intfc.IRiskSourceService
;
import
com.yeejoin.amos.fas.business.service.model.*
;
import
com.yeejoin.amos.fas.business.service.model.*
;
import
com.yeejoin.amos.fas.business.util.DateUtils
;
import
com.yeejoin.amos.fas.business.util.*
;
import
com.yeejoin.amos.fas.business.util.JexlUtil
;
import
com.yeejoin.amos.fas.business.util.RpnUtils
;
import
com.yeejoin.amos.fas.business.vo.EquipCommunicationData
;
import
com.yeejoin.amos.fas.business.vo.EquipCommunicationData
;
import
com.yeejoin.amos.fas.business.vo.Toke
;
import
com.yeejoin.amos.fas.client.invoke.RsDataQueue
;
import
com.yeejoin.amos.fas.client.invoke.RsDataQueue
;
import
com.yeejoin.amos.fas.common.enums.CheckStatusEnum
;
import
com.yeejoin.amos.fas.common.enums.CheckStatusEnum
;
import
com.yeejoin.amos.fas.common.enums.DataRefreshTypeEum
;
import
com.yeejoin.amos.fas.common.enums.DataRefreshTypeEum
;
...
@@ -41,8 +39,6 @@ import com.yeejoin.amos.fas.core.util.StringUtil;
...
@@ -41,8 +39,6 @@ import com.yeejoin.amos.fas.core.util.StringUtil;
import
com.yeejoin.amos.fas.dao.entity.*
;
import
com.yeejoin.amos.fas.dao.entity.*
;
import
com.yeejoin.amos.fas.exception.YeeException
;
import
com.yeejoin.amos.fas.exception.YeeException
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.DepartmentModel
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -84,6 +80,10 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -84,6 +80,10 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
private
static
final
String
DATETYPE_YYYY
=
"yyyy"
;
//年
private
static
final
String
DATETYPE_YYYY
=
"yyyy"
;
//年
private
static
final
String
TOKE
=
"TOKE"
;
private
static
CacheMap
cacheMap
=
CacheFactory
.
newChacheMap
();
@Autowired
@Autowired
private
IRiskSourceDao
iRiskSourceDao
;
private
IRiskSourceDao
iRiskSourceDao
;
...
@@ -153,7 +153,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -153,7 +153,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
private
IDictDao
dictDao
;
private
IDictDao
dictDao
;
@Autowired
@Autowired
private
RedisTemplate
redisTemplate
;
private
RedisTemplate
redisTemplate
;
@Autowired
@Autowired
private
RuleTrigger
ruleTrigger
;
private
RuleTrigger
ruleTrigger
;
...
@@ -162,8 +162,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -162,8 +162,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
@Autowired
@Autowired
private
FmeaPointInputitemMapper
fmeaPointInputitemMapper
;
private
FmeaPointInputitemMapper
fmeaPointInputitemMapper
;
@Autowired
@Autowired
private
IAlarmDao
iAlarmDao
;
private
IAlarmDao
iAlarmDao
;
@Autowired
@Autowired
...
@@ -212,8 +212,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -212,8 +212,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
int
count
=
iRiskSourceDao
.
countByParentId
(
rId
);
int
count
=
iRiskSourceDao
.
countByParentId
(
rId
);
Optional
<
RiskSource
>
rs
=
iRiskSourceDao
.
findById
(
rId
);
Optional
<
RiskSource
>
rs
=
iRiskSourceDao
.
findById
(
rId
);
rs
.
ifPresent
(
riskSource
->
parentIds
.
add
(
riskSource
.
getParentId
()));
rs
.
ifPresent
(
riskSource
->
parentIds
.
add
(
riskSource
.
getParentId
()));
if
(
parentIds
.
contains
(
0
l
))
{
if
(
parentIds
.
contains
(
0
l
))
{
throw
new
YeeException
(
"公司节点不能删除"
);
throw
new
YeeException
(
"公司节点不能删除"
);
}
}
if
(
count
>
0
)
{
if
(
count
>
0
)
{
throw
new
YeeException
(
"该数据有关联子项,请先删除子项数据"
);
throw
new
YeeException
(
"该数据有关联子项,请先删除子项数据"
);
...
@@ -364,9 +364,9 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -364,9 +364,9 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
if
(!
CollectionUtils
.
isEmpty
(
returnList
)
&&
equipment
!=
null
)
{
if
(!
CollectionUtils
.
isEmpty
(
returnList
)
&&
equipment
!=
null
)
{
fmeaEquipmentPointMapper
.
saveBatch
(
returnList
);
fmeaEquipmentPointMapper
.
saveBatch
(
returnList
);
}
}
if
(
equipment
!=
null
)
{
if
(
equipment
!=
null
)
{
RsDataQueue
rsDataQueue
=
RsDataQueue
.
getInstance
();
RsDataQueue
rsDataQueue
=
RsDataQueue
.
getInstance
();
rsDataQueue
.
addEquipmentMessage
(
fmeaId
,
equipment
.
getName
());
rsDataQueue
.
addEquipmentMessage
(
fmeaId
,
equipment
.
getName
());
}
}
return
returnList
;
return
returnList
;
}
}
...
@@ -494,9 +494,9 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -494,9 +494,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
(),
ArrayUtils
.
toArray
(
equipment
.
getName
()));
ruleTrigger
.
publish
(
contingencyRo
,
equipment
.
getReservePlan
(),
ArrayUtils
.
toArray
(
equipment
.
getName
()));
ContingencyOriginalData
contingencyOriginalData
=
new
ContingencyOriginalData
();
ContingencyOriginalData
contingencyOriginalData
=
new
ContingencyOriginalData
();
BeanUtils
.
copyProperties
(
contingencyRo
,
contingencyOriginalData
);
BeanUtils
.
copyProperties
(
contingencyRo
,
contingencyOriginalData
);
iContingencyOriginalDataDao
.
save
(
contingencyOriginalData
);
iContingencyOriginalDataDao
.
save
(
contingencyOriginalData
);
...
@@ -536,7 +536,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -536,7 +536,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
}
@Override
@Override
public
Page
<
Map
<
String
,
Object
>>
listFmeaPointInputitem
(
String
toke
,
String
product
,
String
appKey
,
Long
fmeaId
,
Integer
pageNumber
,
Integer
pageSize
)
{
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
();
List
<
Map
<
String
,
Object
>>
content
=
Lists
.
newArrayList
();
CommonPageable
pageable
=
new
CommonPageable
(
pageNumber
,
pageSize
);
CommonPageable
pageable
=
new
CommonPageable
(
pageNumber
,
pageSize
);
long
total
=
fmeaPointInputitemMapper
.
countByFmeaId
(
fmeaId
);
long
total
=
fmeaPointInputitemMapper
.
countByFmeaId
(
fmeaId
);
...
@@ -544,28 +544,28 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -544,28 +544,28 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
return
new
PageImpl
<>(
content
,
pageable
,
total
);
return
new
PageImpl
<>(
content
,
pageable
,
total
);
}
}
content
=
fmeaPointInputitemMapper
.
listByFmeaId
(
fmeaId
,
pageNumber
,
pageSize
);
content
=
fmeaPointInputitemMapper
.
listByFmeaId
(
fmeaId
,
pageNumber
,
pageSize
);
if
(!
CollectionUtils
.
isEmpty
(
content
))
{
if
(!
CollectionUtils
.
isEmpty
(
content
))
{
Set
<
Object
>
userIds
=
content
.
stream
().
filter
(
x
->
!
StringUtils
.
isEmpty
(
x
.
get
(
"userId"
))).
map
(
arg0
->
arg0
.
get
(
"userId"
)).
collect
(
Collectors
.
toSet
());
Set
<
Object
>
userIds
=
content
.
stream
().
filter
(
x
->
!
StringUtils
.
isEmpty
(
x
.
get
(
"userId"
))).
map
(
arg0
->
arg0
.
get
(
"userId"
)).
collect
(
Collectors
.
toSet
());
Set
<
Object
>
deptIds
=
content
.
stream
().
filter
(
x
->
!
StringUtils
.
isEmpty
(
x
.
get
(
"deptId"
))).
map
(
arg0
->
arg0
.
get
(
"deptId"
)).
collect
(
Collectors
.
toSet
());
Set
<
Object
>
deptIds
=
content
.
stream
().
filter
(
x
->
!
StringUtils
.
isEmpty
(
x
.
get
(
"deptId"
))).
map
(
arg0
->
arg0
.
get
(
"deptId"
)).
collect
(
Collectors
.
toSet
());
Map
<
String
,
AgencyUserModel
>
userMap
=
new
HashMap
<>();
Map
<
String
,
AgencyUserModel
>
userMap
=
new
HashMap
<>();
if
(!
CollectionUtils
.
isEmpty
(
userIds
))
{
if
(!
CollectionUtils
.
isEmpty
(
userIds
))
{
userMap
=
remoteSecurityService
.
getUsersMap
(
toke
,
product
,
appKey
,
userIds
);
userMap
=
remoteSecurityService
.
getUsersMap
(
toke
,
product
,
appKey
,
userIds
);
}
}
Map
<
Long
,
String
>
deptMap
=
new
HashMap
<>();
Map
<
Long
,
String
>
deptMap
=
new
HashMap
<>();
if
(!
CollectionUtils
.
isEmpty
(
deptIds
))
{
if
(!
CollectionUtils
.
isEmpty
(
deptIds
))
{
deptMap
=
remoteSecurityService
.
getDepName
(
toke
,
product
,
appKey
,
deptIds
);
deptMap
=
remoteSecurityService
.
getDepName
(
toke
,
product
,
appKey
,
deptIds
);
}
}
for
(
int
i
=
0
;
i
<
content
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
content
.
size
();
i
++)
{
if
(
StringUtil
.
isNotEmpty
(
content
.
get
(
i
).
get
(
"userId"
))
&&
userMap
.
containsKey
(
content
.
get
(
i
).
get
(
"userId"
)))
{
if
(
StringUtil
.
isNotEmpty
(
content
.
get
(
i
).
get
(
"userId"
))
&&
userMap
.
containsKey
(
content
.
get
(
i
).
get
(
"userId"
)))
{
AgencyUserModel
user
=
userMap
.
get
(
content
.
get
(
i
).
get
(
"userId"
));
AgencyUserModel
user
=
userMap
.
get
(
content
.
get
(
i
).
get
(
"userId"
));
content
.
get
(
i
).
put
(
"userName"
,
user
.
getRealName
());
content
.
get
(
i
).
put
(
"userName"
,
user
.
getRealName
());
content
.
get
(
i
).
put
(
"tel"
,
user
.
getMobile
());
content
.
get
(
i
).
put
(
"tel"
,
user
.
getMobile
());
}
}
if
(
StringUtil
.
isNotEmpty
(
content
.
get
(
i
).
get
(
"deptId"
))
&&
deptMap
.
containsKey
(
Long
.
valueOf
(
content
.
get
(
i
).
get
(
"deptId"
).
toString
())))
{
if
(
StringUtil
.
isNotEmpty
(
content
.
get
(
i
).
get
(
"deptId"
))
&&
deptMap
.
containsKey
(
Long
.
valueOf
(
content
.
get
(
i
).
get
(
"deptId"
).
toString
())))
{
content
.
get
(
i
).
put
(
"deptName"
,
deptMap
.
get
(
Long
.
valueOf
(
content
.
get
(
i
).
get
(
"deptId"
).
toString
())));
content
.
get
(
i
).
put
(
"deptName"
,
deptMap
.
get
(
Long
.
valueOf
(
content
.
get
(
i
).
get
(
"deptId"
).
toString
())));
}
}
}
}
}
}
return
new
PageImpl
<>(
content
,
pageable
,
total
);
return
new
PageImpl
<>(
content
,
pageable
,
total
);
...
@@ -591,8 +591,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -591,8 +591,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
@Async
@Async
public
void
processProtalData
(
String
toke
,
String
product
,
String
appKey
,
ProtalDataRo
protalData
)
{
public
void
processProtalData
(
String
toke
,
String
product
,
String
appKey
,
ProtalDataRo
protalData
)
{
//巡检消息规则推送
//巡检消息规则推送
protalRuleMessagePush
(
protalData
,
toke
,
product
,
appKey
);
protalRuleMessagePush
(
protalData
,
toke
,
product
,
appKey
);
if
(!
CollectionUtils
.
isEmpty
(
protalData
.
getPointInputitems
()))
{
if
(!
CollectionUtils
.
isEmpty
(
protalData
.
getPointInputitems
()))
{
Long
pointId
=
protalData
.
getId
();
Long
pointId
=
protalData
.
getId
();
List
<
Long
>
inputIds
=
Lists
.
newArrayList
();
List
<
Long
>
inputIds
=
Lists
.
newArrayList
();
Map
<
Long
,
CheckInputItemRo
>
map
=
Maps
.
newHashMap
();
Map
<
Long
,
CheckInputItemRo
>
map
=
Maps
.
newHashMap
();
...
@@ -622,30 +622,31 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -622,30 +622,31 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
}
RsDataQueue
rsDataQueue
=
RsDataQueue
.
getInstance
();
RsDataQueue
rsDataQueue
=
RsDataQueue
.
getInstance
();
fmeaIds
.
forEach
(
fmeaId
->
fmeaIds
.
forEach
(
fmeaId
->
rsDataQueue
.
addPatrolMessage
(
fmeaId
,
protalData
.
getCheckUser
(),
protalData
.
getName
(),
protalData
.
getNodeState
()));
rsDataQueue
.
addPatrolMessage
(
fmeaId
,
protalData
.
getCheckUser
(),
protalData
.
getName
(),
protalData
.
getNodeState
()));
}
}
iDataRefreshService
.
refreshViewData
(
DataRefreshTypeEum
.
check
.
getCode
());
iDataRefreshService
.
refreshViewData
(
DataRefreshTypeEum
.
check
.
getCode
());
}
}
/**
/**
* 巡检消息规则推送
* 巡检消息规则推送
*
* @param protalData
* @param protalData
*/
*/
@Async
@Async
void
protalRuleMessagePush
(
ProtalDataRo
protalData
,
String
token
,
String
product
,
String
appKey
){
void
protalRuleMessagePush
(
ProtalDataRo
protalData
,
String
token
,
String
product
,
String
appKey
)
{
String
bacthNo
=
UUID
.
randomUUID
().
toString
();
String
bacthNo
=
UUID
.
randomUUID
().
toString
();
protalData
.
setBatchNo
(
bacthNo
);
protalData
.
setBatchNo
(
bacthNo
);
protalData
.
setOriginalNodeState
(
protalData
.
getNodeState
());
protalData
.
setOriginalNodeState
(
protalData
.
getNodeState
());
protalData
.
setUserName
(
protalData
.
getCheckUser
());
protalData
.
setUserName
(
protalData
.
getCheckUser
());
protalData
.
setPointName
(
protalData
.
getName
());
protalData
.
setPointName
(
protalData
.
getName
());
try
{
try
{
RequestContext
.
setToken
(
token
);
RequestContext
.
setToken
(
token
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setProduct
(
product
);
ruleTrigger
.
publish
(
protalData
,
"风险管控/patrol"
,
null
);
ruleTrigger
.
publish
(
protalData
,
"风险管控/patrol"
,
null
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// TODO Auto-generated catch block
// TODO Auto-generated catch block
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
}
}
@Override
@Override
...
@@ -707,8 +708,14 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -707,8 +708,14 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
if
(
alarmParam
==
null
)
{
if
(
alarmParam
==
null
)
{
log
.
warn
(
"alarmParam is empty!"
);
log
.
warn
(
"alarmParam is empty!"
);
}
else
{
}
else
{
Toke
toke
=
cacheMap
.
getValue
(
TOKE
);
if
(
toke
==
null
)
{
toke
=
remoteSecurityService
.
come
();
Long
times
=
(
long
)
(
20
*
24
*
60
*
60
);
cacheMap
.
setex
(
TOKE
,
toke
,
times
);
}
try
{
try
{
processFireData
(
alarmParam
);
processFireData
(
alarmParam
,
toke
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"parse alarmParam happened error"
,
e
);
log
.
error
(
"parse alarmParam happened error"
,
e
);
// 失败处理
// 失败处理
...
@@ -720,7 +727,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -720,7 +727,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
}
private
void
processFireData
(
AlarmParam
deviceData
)
throws
Exception
{
private
void
processFireData
(
AlarmParam
deviceData
,
Toke
toke
)
throws
Exception
{
//处理设备和巡检数据
//处理设备和巡检数据
deviceData
.
setNodeState
(
deviceData
.
getState
());
deviceData
.
setNodeState
(
deviceData
.
getState
());
FireEquipmentPoint
fireEquipmentPoint
=
iFireEquipmentPointDao
.
findOneByCode
(
deviceData
.
getPointCode
());
FireEquipmentPoint
fireEquipmentPoint
=
iFireEquipmentPointDao
.
findOneByCode
(
deviceData
.
getPointCode
());
...
@@ -743,22 +750,23 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -743,22 +750,23 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
saveFireEquipmentData
(
fireEquipmentPoint
,
fireEquipment
,
deviceData
,
fireEquipmentPointType
);
saveFireEquipmentData
(
fireEquipmentPoint
,
fireEquipment
,
deviceData
,
fireEquipmentPointType
);
equipment
=
impAndFireEquipMapper
.
queryImpEqumtByFireEquipmt
(
fireEquipmentPoint
.
getFireEquipmentId
());
equipment
=
impAndFireEquipMapper
.
queryImpEqumtByFireEquipmt
(
fireEquipmentPoint
.
getFireEquipmentId
());
if
(
equipment
!=
null
&&
"alarm_type_fire"
.
equals
(
fireEquipmentPointType
))
{
if
(
equipment
!=
null
&&
"alarm_type_fire"
.
equals
(
fireEquipmentPointType
))
{
//动态预案执行
//动态预案执行
dynamicPlan
(
deviceData
,
equipment
,
fireEquipment
,
fireEquipmentPointTyp
e
);
dynamicPlan
(
deviceData
,
equipment
,
fireEquipment
,
fireEquipmentPointType
,
tok
e
);
}
}
}
}
}
}
/**
/**
* 预案执行
* 预案执行
*
* @param deviceData
* @param deviceData
* @param equipment
* @param equipment
* @param fireEquipment
* @param fireEquipment
* @param fireEquipmentPointType
* @param fireEquipmentPointType
*/
*/
@Async
@Async
void
dynamicPlan
(
AlarmParam
deviceData
,
Equipment
equipment
,
FireEquipment
fireEquipment
,
String
fireEquipmentPointType
)
{
void
dynamicPlan
(
AlarmParam
deviceData
,
Equipment
equipment
,
FireEquipment
fireEquipment
,
String
fireEquipmentPointType
,
Toke
toke
)
{
String
batchNo
=
null
;
String
batchNo
=
null
;
Object
batch
=
null
;
Object
batch
=
null
;
Dict
dict
=
null
;
Dict
dict
=
null
;
if
(
fireEquipmentPointType
!=
null
)
{
if
(
fireEquipmentPointType
!=
null
)
{
...
@@ -789,6 +797,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -789,6 +797,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
Object
canBeRunning
=
redisTemplate
.
opsForValue
().
get
(
cacheKeyForCanBeRunning
());
Object
canBeRunning
=
redisTemplate
.
opsForValue
().
get
(
cacheKeyForCanBeRunning
());
if
(
canBeRunning
==
null
)
{
if
(
canBeRunning
==
null
)
{
try
{
try
{
RequestContext
.
setToken
(
toke
.
getToke
());
RequestContext
.
setProduct
(
toke
.
getProduct
());
alermContingency
(
batchNo
,
fireEquipment
,
equipment
);
alermContingency
(
batchNo
,
fireEquipment
,
equipment
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"调用规则失败"
,
e
);
log
.
error
(
"调用规则失败"
,
e
);
...
@@ -818,74 +828,73 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -818,74 +828,73 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
private
void
saveFireEquipmentData
(
FireEquipmentPoint
fireEquipmentPoint
,
FireEquipment
fireEquipment
,
AlarmParam
deviceData
,
String
fireEquipmentPointType
)
{
private
void
saveFireEquipmentData
(
FireEquipmentPoint
fireEquipmentPoint
,
FireEquipment
fireEquipment
,
AlarmParam
deviceData
,
String
fireEquipmentPointType
)
{
if
(
"alarm_type_fire"
.
equals
(
fireEquipmentPointType
)
||
"alarm_type_trouble"
.
equals
(
fireEquipmentPointType
))
{
if
(
"alarm_type_fire"
.
equals
(
fireEquipmentPointType
)
||
"alarm_type_trouble"
.
equals
(
fireEquipmentPointType
))
{
Alarm
alarm
=
iAlarmDao
.
findByStatusTrueAndFireEquipmentPointCode
(
deviceData
.
getPointCode
());
Alarm
alarm
=
iAlarmDao
.
findByStatusTrueAndFireEquipmentPointCode
(
deviceData
.
getPointCode
());
if
(
alarm
!=
null
)
{
if
(
alarm
!=
null
)
{
alarm
.
setFireEquipmentPointValue
(
deviceData
.
getState
());
alarm
.
setFireEquipmentPointValue
(
deviceData
.
getState
());
if
(
"false"
.
equals
(
deviceData
.
getState
()))
{
if
(
"false"
.
equals
(
deviceData
.
getState
()))
{
alarm
.
setRecoveryDate
(
new
Date
());
alarm
.
setRecoveryDate
(
new
Date
());
alarm
.
setStatus
(
false
);
alarm
.
setStatus
(
false
);
}
else
{
}
else
{
alarm
.
setFrequency
((
alarm
.
getFrequency
()+
1
));
alarm
.
setFrequency
((
alarm
.
getFrequency
()
+
1
));
alarm
.
setUpdateDate
(
new
Date
());
alarm
.
setUpdateDate
(
new
Date
());
}
}
iAlarmDao
.
save
(
alarm
);
iAlarmDao
.
save
(
alarm
);
}
else
{
}
else
{
if
(
"true"
.
equals
(
deviceData
.
getState
()))
{
if
(
"true"
.
equals
(
deviceData
.
getState
()))
{
alarm
=
new
Alarm
();
alarm
=
new
Alarm
();
alarm
.
setFireEquipmentCode
(
fireEquipment
.
getCode
());
alarm
.
setFireEquipmentCode
(
fireEquipment
.
getCode
());
alarm
.
setFireEquipmentId
(
fireEquipment
.
getId
());
alarm
.
setFireEquipmentId
(
fireEquipment
.
getId
());
alarm
.
setFireEquipmentName
(
fireEquipment
.
getName
());
alarm
.
setFireEquipmentName
(
fireEquipment
.
getName
());
alarm
.
setFireEquipmentPointCode
(
fireEquipmentPoint
.
getCode
());
alarm
.
setFireEquipmentPointCode
(
fireEquipmentPoint
.
getCode
());
alarm
.
setFireEquipmentPointId
(
fireEquipmentPoint
.
getId
());
alarm
.
setFireEquipmentPointId
(
fireEquipmentPoint
.
getId
());
alarm
.
setFireEquipmentPointName
(
fireEquipmentPoint
.
getName
());
alarm
.
setFireEquipmentPointName
(
fireEquipmentPoint
.
getName
());
alarm
.
setFireEquipmentPointValue
(
deviceData
.
getState
());
alarm
.
setFireEquipmentPointValue
(
deviceData
.
getState
());
alarm
.
setOrgCode
(
fireEquipment
.
getOrgCode
());
alarm
.
setOrgCode
(
fireEquipment
.
getOrgCode
());
alarm
.
setType
(
fireEquipmentPointType
);
alarm
.
setType
(
fireEquipmentPointType
);
iAlarmDao
.
save
(
alarm
);
iAlarmDao
.
save
(
alarm
);
}
}
}
}
if
(
alarm
!=
null
)
{
if
(
alarm
!=
null
)
{
if
(
"alarm_type_trouble"
.
equals
(
fireEquipmentPointType
))
{
if
(
"alarm_type_trouble"
.
equals
(
fireEquipmentPointType
))
{
//通知刷新3d页面相关故障数据
//通知刷新3d页面相关故障数据
notifyAlarm
(
fireEquipmentPoint
,
deviceData
);
notifyAlarm
(
fireEquipmentPoint
,
deviceData
);
}
else
{
}
else
{
//通知刷新3d页面告警数据
//通知刷新3d页面告警数据
iDataRefreshService
.
refreshViewData
(
DataRefreshTypeEum
.
alarm
.
getCode
());
iDataRefreshService
.
refreshViewData
(
DataRefreshTypeEum
.
alarm
.
getCode
());
}
}
}
}
}
else
{
}
else
{
if
(
"SWITCH"
.
equals
(
fireEquipmentPoint
.
getType
()))
{
//保存遥信信号数据到mysql中
if
(
"SWITCH"
.
equals
(
fireEquipmentPoint
.
getType
()))
{
//保存遥信信号数据到mysql中
FireEquipmentData
fireEquipmentData
=
new
FireEquipmentData
();
FireEquipmentData
fireEquipmentData
=
new
FireEquipmentData
();
fireEquipmentData
.
setEqPointCode
(
deviceData
.
getPointCode
());
fireEquipmentData
.
setEqPointCode
(
deviceData
.
getPointCode
());
fireEquipmentData
.
seteValue
(
deviceData
.
getState
());
fireEquipmentData
.
seteValue
(
deviceData
.
getState
());
fireEquipmentData
.
setInformationAddress
(
deviceData
.
getInformationAddress
());
fireEquipmentData
.
setInformationAddress
(
deviceData
.
getInformationAddress
());
fireEquipmentData
.
setSoe
(
deviceData
.
getSoe
());
fireEquipmentData
.
setSoe
(
deviceData
.
getSoe
());
fireEquipmentData
.
setIsInvalid
(
deviceData
.
getIsInvalid
());
fireEquipmentData
.
setIsInvalid
(
deviceData
.
getIsInvalid
());
fireEquipmentData
.
setEqPointName
(
fireEquipmentPoint
.
getName
());
fireEquipmentData
.
setEqPointName
(
fireEquipmentPoint
.
getName
());
fireEquipmentData
.
setEqPointUnit
(
fireEquipmentPoint
.
getUnit
());
fireEquipmentData
.
setEqPointUnit
(
fireEquipmentPoint
.
getUnit
());
fireEquipmentData
.
setFireEquipmentPointId
(
fireEquipmentPoint
.
getId
());
fireEquipmentData
.
setFireEquipmentPointId
(
fireEquipmentPoint
.
getId
());
fireEquipmentData
.
setFireEquipmentId
(
fireEquipmentPoint
.
getFireEquipmentId
());
fireEquipmentData
.
setFireEquipmentId
(
fireEquipmentPoint
.
getFireEquipmentId
());
fireEquipmentData
.
setType
(
"monitor"
);
fireEquipmentData
.
setType
(
"monitor"
);
fireEquipmentData
.
setOrgCode
(
fireEquipment
.
getOrgCode
());
fireEquipmentData
.
setOrgCode
(
fireEquipment
.
getOrgCode
());
iFireEquipmentDataDao
.
save
(
fireEquipmentData
);
iFireEquipmentDataDao
.
save
(
fireEquipmentData
);
Map
<
String
,
Object
>
content
=
new
HashMap
<>();
Map
<
String
,
Object
>
content
=
new
HashMap
<>();
content
.
put
(
"id"
,
fireEquipmentData
.
getId
());
content
.
put
(
"id"
,
fireEquipmentData
.
getId
());
content
.
put
(
"label"
,
fireEquipmentData
.
getEqPointName
());
content
.
put
(
"label"
,
fireEquipmentData
.
getEqPointName
());
content
.
put
(
"changeDate"
,
fireEquipmentData
.
getCreateDate
());
content
.
put
(
"changeDate"
,
fireEquipmentData
.
getCreateDate
());
content
.
put
(
"orgCode"
,
fireEquipment
.
getOrgCode
());
content
.
put
(
"orgCode"
,
fireEquipment
.
getOrgCode
());
content
.
put
(
"status"
,
deviceData
.
getSoe
());
content
.
put
(
"status"
,
deviceData
.
getSoe
());
iDataRefreshService
.
sendRefreshDataWithArea
(
View3dRefreshAreaEum
.
monitor_data
.
getCode
(),
content
);
iDataRefreshService
.
sendRefreshDataWithArea
(
View3dRefreshAreaEum
.
monitor_data
.
getCode
(),
content
);
}
}
}
}
List
<
AlarmParam
>
list
=
new
ArrayList
<>();
List
<
AlarmParam
>
list
=
new
ArrayList
<>();
list
.
add
(
deviceData
);
list
.
add
(
deviceData
);
//保存所有数据(遥测,遥信)到mongo
//保存所有数据(遥测,遥信)到mongo
saveData
(
list
,
"soe"
);
saveData
(
list
,
"soe"
);
}
}
@Override
@Override
public
void
saveData
(
List
<
AlarmParam
>
deviceDatas
,
String
type
)
{
public
void
saveData
(
List
<
AlarmParam
>
deviceDatas
,
String
type
)
{
List
<
EquipCommunicationData
>
list
=
deviceDatas
.
stream
().
map
(
param
->
{
List
<
EquipCommunicationData
>
list
=
deviceDatas
.
stream
().
map
(
param
->
{
...
@@ -962,10 +971,10 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -962,10 +971,10 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
if
(
ids
.
size
()
>
0
)
{
if
(
ids
.
size
()
>
0
)
{
fmeaEquipmentPointMapper
.
updateStateByIds
(
state
,
ids
);
fmeaEquipmentPointMapper
.
updateStateByIds
(
state
,
ids
);
}
}
final
Integer
st
=
state
;
final
Integer
st
=
state
;
String
monitor
=
fireEquipMapper
.
findById
(
fireEquipPointMapper
.
getByCode
(
param
.
getPointCode
()).
getFireEquipmentId
()).
getName
();
String
monitor
=
fireEquipMapper
.
findById
(
fireEquipPointMapper
.
getByCode
(
param
.
getPointCode
()).
getFireEquipmentId
()).
getName
();
RsDataQueue
rsDataQueue
=
RsDataQueue
.
getInstance
();
RsDataQueue
rsDataQueue
=
RsDataQueue
.
getInstance
();
fmeaIds
.
forEach
(
fmeaId
->
rsDataQueue
.
addEquipmentMessage
(
fmeaId
,
monitor
,
st
));
fmeaIds
.
forEach
(
fmeaId
->
rsDataQueue
.
addEquipmentMessage
(
fmeaId
,
monitor
,
st
));
}
}
}
}
...
@@ -1061,14 +1070,14 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1061,14 +1070,14 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
List
<
Map
>
list
=
riskSourceMapper
.
queryContingencyWater
();
List
<
Map
>
list
=
riskSourceMapper
.
queryContingencyWater
();
HashOperations
hashOperations
=
redisTemplate
.
opsForHash
();
HashOperations
hashOperations
=
redisTemplate
.
opsForHash
();
for
(
Map
map
:
list
)
{
for
(
Map
map
:
list
)
{
double
area
=
0
;
double
area
=
0
;
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"area"
)))
{
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"area"
)))
{
area
=
Double
.
valueOf
(
map
.
get
(
"area"
).
toString
());
area
=
Double
.
valueOf
(
map
.
get
(
"area"
).
toString
());
}
}
String
maxlevel
=
map
.
get
(
"max_level"
)
!=
null
?
map
.
get
(
"max_level"
).
toString
():
"0.0"
;
String
maxlevel
=
map
.
get
(
"max_level"
)
!=
null
?
map
.
get
(
"max_level"
).
toString
()
:
"0.0"
;
String
level
=
map
.
get
(
"value"
)
!=
null
&&
StringUtil
.
isNumeric
(
map
.
get
(
"value"
).
toString
())?
String
.
format
(
"%.2f"
,
(
Double
.
valueOf
(
map
.
get
(
"value"
).
toString
()))):
maxlevel
;
String
level
=
map
.
get
(
"value"
)
!=
null
&&
StringUtil
.
isNumeric
(
map
.
get
(
"value"
).
toString
())
?
String
.
format
(
"%.2f"
,
(
Double
.
valueOf
(
map
.
get
(
"value"
).
toString
())))
:
maxlevel
;
String
volume
=
String
.
format
(
"%.2f"
,
Double
.
valueOf
(
level
)
*
area
);
String
volume
=
String
.
format
(
"%.2f"
,
Double
.
valueOf
(
level
)
*
area
);
if
(
hashOperations
.
size
(
"Analogue"
)
>
0
)
{
if
(
hashOperations
.
size
(
"Analogue"
)
>
0
)
{
if
(
ObjectUtils
.
isEmpty
(
map
.
get
(
"CODE"
))
||
!
hashOperations
.
hasKey
(
"Analogue"
,
map
.
get
(
"CODE"
)))
{
if
(
ObjectUtils
.
isEmpty
(
map
.
get
(
"CODE"
))
||
!
hashOperations
.
hasKey
(
"Analogue"
,
map
.
get
(
"CODE"
)))
{
map
.
put
(
"level"
,
level
);
map
.
put
(
"level"
,
level
);
...
@@ -1076,8 +1085,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1076,8 +1085,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
continue
;
continue
;
}
}
EquipCommunicationData
data
=
(
EquipCommunicationData
)
hashOperations
.
get
(
"Analogue"
,
map
.
get
(
"CODE"
));
EquipCommunicationData
data
=
(
EquipCommunicationData
)
hashOperations
.
get
(
"Analogue"
,
map
.
get
(
"CODE"
));
map
.
put
(
"level"
,
StringUtil
.
isNumeric
(
data
.
getState
())?
data
.
getState
():
level
);
map
.
put
(
"level"
,
StringUtil
.
isNumeric
(
data
.
getState
())
?
data
.
getState
()
:
level
);
map
.
put
(
"volume"
,
String
.
format
(
"%.2f"
,
(
Double
.
valueOf
(
map
.
get
(
"level"
).
toString
())*
area
)));
map
.
put
(
"volume"
,
String
.
format
(
"%.2f"
,
(
Double
.
valueOf
(
map
.
get
(
"level"
).
toString
())
*
area
)));
}
else
{
}
else
{
map
.
put
(
"level"
,
level
);
map
.
put
(
"level"
,
level
);
map
.
put
(
"volume"
,
volume
);
map
.
put
(
"volume"
,
volume
);
...
@@ -1110,7 +1119,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1110,7 +1119,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
* 修改、添加导致rpn、rpni改变
* 修改、添加导致rpn、rpni改变
*/
*/
@Override
@Override
public
void
notifyFmeaFromUpdate
(
String
toke
,
String
product
,
String
appKey
,
Long
fmeaId
,
String
nofityType
,
String
userName
)
{
public
void
notifyFmeaFromUpdate
(
String
toke
,
String
product
,
String
appKey
,
Long
fmeaId
,
String
nofityType
,
String
userName
)
{
Fmea
fmea
=
fmeaMapper
.
getById
(
fmeaId
);
Fmea
fmea
=
fmeaMapper
.
getById
(
fmeaId
);
if
(
fmea
==
null
)
{
if
(
fmea
==
null
)
{
return
;
return
;
...
@@ -1126,11 +1135,11 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1126,11 +1135,11 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
//1.2未评价过,计算绑定的巡检点项 设备点位故障率
//1.2未评价过,计算绑定的巡检点项 设备点位故障率
if
(
fmea
.
getNewEvaluationOid
()
==
null
)
{
if
(
fmea
.
getNewEvaluationOid
()
==
null
)
{
EvaluationModel
evaluationModel
=
this
.
getEvaluationModel
(
fmeaId
);
EvaluationModel
evaluationModel
=
this
.
getEvaluationModel
(
fmeaId
);
if
(
evaluationModel
!=
null
)
{
//已经绑定点位或者巡检点项且匹配到风险模型,则更新为计算后的结果
if
(
evaluationModel
!=
null
)
{
//已经绑定点位或者巡检点项且匹配到风险模型,则更新为计算后的结果
BigDecimal
newOidValue
=
new
BigDecimal
(
evaluationModel
.
getCoefficient
());
BigDecimal
newOidValue
=
new
BigDecimal
(
evaluationModel
.
getCoefficient
());
rpn
=
newOidValue
.
multiply
(
sidValue
).
multiply
(
didValue
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
rpn
=
newOidValue
.
multiply
(
sidValue
).
multiply
(
didValue
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
fmea
.
setNewEvaluationOid
(
evaluationModel
.
getId
());
fmea
.
setNewEvaluationOid
(
evaluationModel
.
getId
());
}
else
{
//未绑定点位或者巡检点项或者匹配不到风险模型,则更新为rpn与rpni一致
}
else
{
//未绑定点位或者巡检点项或者匹配不到风险模型,则更新为rpn与rpni一致
fmea
.
setNewEvaluationOid
(
fmea
.
getEvaluationOid
());
fmea
.
setNewEvaluationOid
(
fmea
.
getEvaluationOid
());
rpn
=
rpni
;
rpn
=
rpni
;
}
}
...
@@ -1162,11 +1171,11 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1162,11 +1171,11 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
}
}
}
private
JpushMsgBo
getJushMessageInfo
(
MsgParamBo
msgParam
){
private
JpushMsgBo
getJushMessageInfo
(
MsgParamBo
msgParam
)
{
JpushMsgBo
msgBo
=
new
JpushMsgBo
();
JpushMsgBo
msgBo
=
new
JpushMsgBo
();
Optional
<
RiskFactor
>
optional
=
iRiskFactorDao
.
findById
(
msgParam
.
getFmea
().
getRiskFactorsId
());
Optional
<
RiskFactor
>
optional
=
iRiskFactorDao
.
findById
(
msgParam
.
getFmea
().
getRiskFactorsId
());
if
(
optional
.
isPresent
())
{
if
(
optional
.
isPresent
())
{
JpushMsgContentBo
jpushMsgContentBo
=
new
JpushMsgContentBo
(
optional
.
get
().
getName
(),
msgParam
.
getNotifyType
());
JpushMsgContentBo
jpushMsgContentBo
=
new
JpushMsgContentBo
(
optional
.
get
().
getName
(),
msgParam
.
getNotifyType
());
jpushMsgContentBo
.
setExecute
(
msgParam
.
getUserName
());
jpushMsgContentBo
.
setExecute
(
msgParam
.
getUserName
());
jpushMsgContentBo
.
setLevelIsChange
(
msgParam
.
getLevelIsChange
());
jpushMsgContentBo
.
setLevelIsChange
(
msgParam
.
getLevelIsChange
());
jpushMsgContentBo
.
setLevel
(
msgParam
.
getLevel
());
jpushMsgContentBo
.
setLevel
(
msgParam
.
getLevel
());
...
@@ -1219,7 +1228,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1219,7 +1228,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
@Override
@Override
public
void
notifyFmeaFromAbnormal
(
public
void
notifyFmeaFromAbnormal
(
String
toke
,
String
product
,
String
appKey
,
String
toke
,
String
product
,
String
appKey
,
Long
fmeaId
,
String
notifyType
,
String
userName
,
String
relationName
,
String
checkStatus
)
{
Long
fmeaId
,
String
notifyType
,
String
userName
,
String
relationName
,
String
checkStatus
)
{
Fmea
fmea
=
fmeaMapper
.
getById
(
fmeaId
);
Fmea
fmea
=
fmeaMapper
.
getById
(
fmeaId
);
if
(
fmea
==
null
)
{
if
(
fmea
==
null
)
{
return
;
return
;
...
@@ -1269,7 +1278,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1269,7 +1278,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
}
}
}
private
void
saveRpnLog
(
Long
riskSourceId
,
Long
fmeaId
,
BigDecimal
rpn
,
BigDecimal
rpni
,
String
notifyType
)
{
private
void
saveRpnLog
(
Long
riskSourceId
,
Long
fmeaId
,
BigDecimal
rpn
,
BigDecimal
rpni
,
String
notifyType
)
{
RpnChangeLog
rpnChangeLog
=
new
RpnChangeLog
();
RpnChangeLog
rpnChangeLog
=
new
RpnChangeLog
();
rpnChangeLog
.
setRiskSourceId
(
riskSourceId
);
rpnChangeLog
.
setRiskSourceId
(
riskSourceId
);
rpnChangeLog
.
setRpn
(
rpn
);
rpnChangeLog
.
setRpn
(
rpn
);
...
@@ -1325,14 +1334,14 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1325,14 +1334,14 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
if
(
rpnValueBo
.
isEmpty
())
{
if
(
rpnValueBo
.
isEmpty
())
{
return
;
return
;
}
}
Fmea
caluFmea
=
fmeaMapper
.
getById
(
fmeaId
);
Fmea
caluFmea
=
fmeaMapper
.
getById
(
fmeaId
);
Integer
rpnDiffer
=
0
;
Integer
rpnDiffer
=
0
;
if
(
caluFmea
!=
null
)
{
if
(
caluFmea
!=
null
)
{
rpnDiffer
=
caluFmea
.
getRpn
().
intValue
()-
caluFmea
.
getRpni
().
intValue
();
rpnDiffer
=
caluFmea
.
getRpn
().
intValue
()
-
caluFmea
.
getRpni
().
intValue
();
}
}
String
checkStatus
=
""
;
String
checkStatus
=
""
;
if
(
jpushMsgBo
!=
null
)
{
if
(
jpushMsgBo
!=
null
)
{
checkStatus
=
jpushMsgBo
.
getMsg
().
getCheckStatus
();
checkStatus
=
jpushMsgBo
.
getMsg
().
getCheckStatus
();
}
}
BigDecimal
rpn
=
rpnValueBo
.
getRpn
();
BigDecimal
rpn
=
rpnValueBo
.
getRpn
();
BigDecimal
rpni
=
rpnValueBo
.
getRpni
();
BigDecimal
rpni
=
rpnValueBo
.
getRpni
();
...
@@ -1343,8 +1352,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1343,8 +1352,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
riskSource
.
setRpn
(
rpn
);
riskSource
.
setRpn
(
rpn
);
riskSource
.
setRpni
(
rpni
);
riskSource
.
setRpni
(
rpni
);
riskSource
.
setRiskLevelId
(
newRiskLevel
.
getId
());
riskSource
.
setRiskLevelId
(
newRiskLevel
.
getId
());
String
changeType
=
RpnUtils
.
calChangeTypeByLevel
(
oldRiskLevel
.
getLevel
(),
newRiskLevel
.
getLevel
());
String
changeType
=
RpnUtils
.
calChangeTypeByLevel
(
oldRiskLevel
.
getLevel
(),
newRiskLevel
.
getLevel
());
riskSource
.
setFlickerFrequency
(
RpnUtils
.
calRiskPointFrequency
(
rpn
,
rpni
,
changeType
));
riskSource
.
setFlickerFrequency
(
RpnUtils
.
calRiskPointFrequency
(
rpn
,
rpni
,
changeType
));
//1.更新fmea对应风险点rpn、rpni、level
//1.更新fmea对应风险点rpn、rpni、level
riskSourceMapper
.
updateRpn
(
riskSource
);
riskSourceMapper
.
updateRpn
(
riskSource
);
//2.记录风险点rpn变化流水
//2.记录风险点rpn变化流水
...
@@ -1353,12 +1362,12 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1353,12 +1362,12 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
//3.更新父节点rpn、rpni、风险等级
//3.更新父节点rpn、rpni、风险等级
this
.
updateParentRpn
(
riskSource
.
getParentId
());
this
.
updateParentRpn
(
riskSource
.
getParentId
());
//4.极光推送给手机客户端
//4.极光推送给手机客户端
if
(
"recovery"
.
equals
(
notifyType
)
||
"fmeaUpdate"
.
equals
(
notifyType
)
||
(
"alarm"
.
equals
(
notifyType
)&&
rpnDiffer
>
0
)||(
"patrol"
.
equals
(
notifyType
)
&&
rpnDiffer
>
0
&&
CheckStatusEnum
.
UNQUALIFIED
.
getName
().
equals
(
checkStatus
)))
{
if
(
"recovery"
.
equals
(
notifyType
)
||
"fmeaUpdate"
.
equals
(
notifyType
)
||
(
"alarm"
.
equals
(
notifyType
)
&&
rpnDiffer
>
0
)
||
(
"patrol"
.
equals
(
notifyType
)
&&
rpnDiffer
>
0
&&
CheckStatusEnum
.
UNQUALIFIED
.
getName
().
equals
(
checkStatus
)))
{
jpushRiskSourceMessage
(
jpushMsgBo
);
jpushRiskSourceMessage
(
jpushMsgBo
);
}
}
//5.规则告警(消息)
//5.规则告警(消息)
if
(
"recovery"
.
equals
(
notifyType
)
||
"fmeaUpdate"
.
equals
(
notifyType
)
||
(
"alarm"
.
equals
(
notifyType
)&&
rpnDiffer
>
0
)
||(
notifyType
==
"patrol"
&&
rpnDiffer
>
0
&&
CheckStatusEnum
.
UNQUALIFIED
.
getName
().
equals
(
checkStatus
)))
{
if
(
"recovery"
.
equals
(
notifyType
)
||
"fmeaUpdate"
.
equals
(
notifyType
)
||
(
"alarm"
.
equals
(
notifyType
)
&&
rpnDiffer
>
0
)
||
(
notifyType
==
"patrol"
&&
rpnDiffer
>
0
&&
CheckStatusEnum
.
UNQUALIFIED
.
getName
().
equals
(
checkStatus
)))
{
notifyRule
(
riskSourceId
,
rpn
,
rpni
,
notifyType
,
changeType
,
jpushMsgBo
.
getMsg
());
notifyRule
(
riskSourceId
,
rpn
,
rpni
,
notifyType
,
changeType
,
jpushMsgBo
.
getMsg
());
}
}
//6.通知全景监控屏幕数据刷新
//6.通知全景监控屏幕数据刷新
iDataRefreshService
.
refreshViewData
(
DataRefreshTypeEum
.
rpn
.
getCode
());
iDataRefreshService
.
refreshViewData
(
DataRefreshTypeEum
.
rpn
.
getCode
());
...
@@ -1446,6 +1455,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1446,6 +1455,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
}
JpushMsgContentBo
jpushMsgContentBo
=
jpushMsgBo
.
getMsg
();
JpushMsgContentBo
jpushMsgContentBo
=
jpushMsgBo
.
getMsg
();
Set
<
String
>
target
=
jpushMsgBo
.
getTarget
();
Set
<
String
>
target
=
jpushMsgBo
.
getTarget
();
target
.
remove
(
null
);
if
(
jpushMsgContentBo
.
getSend
()){
if
(
jpushMsgContentBo
.
getSend
()){
PushMsgParam
pushMsgParam
=
new
PushMsgParam
();
PushMsgParam
pushMsgParam
=
new
PushMsgParam
();
pushMsgParam
.
setRecivers
(
Lists
.
newArrayList
(
target
));
pushMsgParam
.
setRecivers
(
Lists
.
newArrayList
(
target
));
...
@@ -1528,11 +1538,11 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1528,11 +1538,11 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
riskSourceMapper
.
batchSaveRegionUe4
(
regionBoList
);
riskSourceMapper
.
batchSaveRegionUe4
(
regionBoList
);
}
}
private
EvaluationModel
getEvaluationModel
(
Long
fmeaId
){
private
EvaluationModel
getEvaluationModel
(
Long
fmeaId
)
{
List
<
FmeaEquipmentPoint
>
equipmentPoints
=
fmeaEquipmentPointMapper
.
listFmeaByFmeaId
(
fmeaId
);
List
<
FmeaEquipmentPoint
>
equipmentPoints
=
fmeaEquipmentPointMapper
.
listFmeaByFmeaId
(
fmeaId
);
List
<
FmeaPointInputitem
>
pointInputitems
=
fmeaPointInputitemMapper
.
listFmeaByFmeaId
(
fmeaId
);
List
<
FmeaPointInputitem
>
pointInputitems
=
fmeaPointInputitemMapper
.
listFmeaByFmeaId
(
fmeaId
);
Double
maxRate
=
RpnUtils
.
getMaxRate
(
equipmentPoints
,
pointInputitems
);
Double
maxRate
=
RpnUtils
.
getMaxRate
(
equipmentPoints
,
pointInputitems
);
if
(
maxRate
!=
null
)
{
if
(
maxRate
!=
null
)
{
List
<
EvaluationModel
>
oModels
=
iEvaluationModelDao
.
findAllByType
(
"O"
);
List
<
EvaluationModel
>
oModels
=
iEvaluationModelDao
.
findAllByType
(
"O"
);
EvaluationModel
oEvaluationModel
=
getBetweenModel
(
maxRate
,
oModels
);
EvaluationModel
oEvaluationModel
=
getBetweenModel
(
maxRate
,
oModels
);
return
oEvaluationModel
;
return
oEvaluationModel
;
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IEquipmentService.java
View file @
b0822c9c
...
@@ -103,4 +103,6 @@ public interface IEquipmentService {
...
@@ -103,4 +103,6 @@ public interface IEquipmentService {
EquipCommunicationData
findFireEquipDataByPointCode
(
String
code
);
EquipCommunicationData
findFireEquipDataByPointCode
(
String
code
);
int
countImpEquipByIds
(
String
[]
idArray
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IFireEquipPontService.java
View file @
b0822c9c
...
@@ -59,4 +59,10 @@ public interface IFireEquipPontService {
...
@@ -59,4 +59,10 @@ public interface IFireEquipPontService {
CommonResponse
batchDelete
(
List
<
Long
>
ids
);
CommonResponse
batchDelete
(
List
<
Long
>
ids
);
CommonResponse
listByType
(
Integer
type
);
CommonResponse
listByType
(
Integer
type
);
int
countImpEquipment
(
String
[]
idArray
);
String
findBindRiskSourceStrByPointIds
(
String
[]
idArray
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IFireEquipService.java
View file @
b0822c9c
...
@@ -35,7 +35,7 @@ public interface IFireEquipService {
...
@@ -35,7 +35,7 @@ public interface IFireEquipService {
String
endTime
,
String
endTime
,
CommonPageable
commonPageable
);
CommonPageable
commonPageable
);
Page
queryForEquipmentList
(
String
name
,
String
code
,
String
equipClassify
,
CommonPageable
commonPageable
);
Page
queryForEquipmentList
(
String
name
,
String
code
,
String
equipClassify
,
CommonPageable
commonPageable
,
String
bindStation
);
//查询设备明细
//查询设备明细
Object
queryForDetail
(
String
type
,
Long
id
)
throws
Exception
;
Object
queryForDetail
(
String
type
,
Long
id
)
throws
Exception
;
...
...
YeeAmosFireAutoSysStart/src/main/resources/application-dev.properties
View file @
b0822c9c
...
@@ -15,7 +15,7 @@ eureka.client.healthcheck.enabled = true
...
@@ -15,7 +15,7 @@ eureka.client.healthcheck.enabled = true
eureka.client.fetchRegistry
=
true
eureka.client.fetchRegistry
=
true
eureka.instance.prefer-ip-address
=
true
eureka.instance.prefer-ip-address
=
true
#DB properties:
#DB properties:
spring.datasource.url
=
jdbc:mysql://172.16.11.33:3306/safety-business-2.0?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.datasource.url
=
jdbc:mysql://172.16.11.33:3306/safety-business-2.0
-36
?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.datasource.username
=
root
spring.datasource.username
=
root
spring.datasource.password
=
admin_1234
spring.datasource.password
=
admin_1234
spring.datasource.driver-class-name
=
com.mysql.jdbc.Driver
spring.datasource.driver-class-name
=
com.mysql.jdbc.Driver
...
@@ -33,7 +33,7 @@ spring.data.mongodb.uri = mongodb://172.16.11.33:27017/iecmonitor
...
@@ -33,7 +33,7 @@ spring.data.mongodb.uri = mongodb://172.16.11.33:27017/iecmonitor
params.remoteRuleUrl
=
http://magintursh.xicp.net:18080/
params.remoteRuleUrl
=
http://magintursh.xicp.net:18080/
params.remoteWebsocketUrl
=
http://172.16.10.91:10600/
params.remoteWebsocketUrl
=
http://172.16.10.91:10600/
spring.redis.database
=
1
spring.redis.database
=
5
spring.redis.host
=
172.16.11.33
spring.redis.host
=
172.16.11.33
spring.redis.port
=
6379
spring.redis.port
=
6379
spring.redis.password
=
1234560
spring.redis.password
=
1234560
...
@@ -44,7 +44,7 @@ spring.redis.jedis.pool.min-idle=0
...
@@ -44,7 +44,7 @@ spring.redis.jedis.pool.min-idle=0
spring.redis.timeout
=
1000
spring.redis.timeout
=
1000
#picture upload
#picture upload
file.uploadUrl
=
E
:
\\
upload
\\
files
\\
file.uploadUrl
=
F
:
\\
upload
\\
files
\\
#picture read
#picture read
file.readUrl
=
http://172.16.3.89:8083/file/getFile?in=
file.readUrl
=
http://172.16.3.89:8083/file/getFile?in=
params.isPush
=
true
params.isPush
=
true
...
@@ -57,6 +57,7 @@ emqx.user-name=super
...
@@ -57,6 +57,7 @@ emqx.user-name=super
emqx.password
=
a123456
emqx.password
=
a123456
Push.fegin.name
=
APPMESSAGEPUSHSERVICE-36
Push.fegin.name
=
APPMESSAGEPUSHSERVICE-36
dutyMode.fegin.name
=
AMOSDUTYMODE
dutyMode.fegin.name
=
AMOSDUTYMODE
DutyMode.dutyUrl
=
http://172.16.11.36:10005/
DutyMode.dutyUrl
=
http://172.16.11.36:10005/
...
@@ -64,4 +65,4 @@ DutyMode.dutyUrl=http://172.16.11.36:10005/
...
@@ -64,4 +65,4 @@ DutyMode.dutyUrl=http://172.16.11.36:10005/
rule.definition.load
=
true
rule.definition.load
=
true
rule.definition.model-package
=
com.yeejoin.amos.fas.business.service.model
rule.definition.model-package
=
com.yeejoin.amos.fas.business.service.model
amos.feign.gennerator.use-gateway
=
true
amos.feign.gennerator.use-gateway
=
true
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/application.properties
View file @
b0822c9c
spring.application.name
=
AMOS-AUTOSYS-my
spring.application.name
=
Amos-autosys
server.port
=
8083
server.port
=
8083
spring.profiles.active
=
dev
spring.profiles.active
=
dev
...
@@ -33,24 +34,22 @@ mybatis.type-aliases-package = com.yeejoin.amos.fas.business.entity.mybatis
...
@@ -33,24 +34,22 @@ mybatis.type-aliases-package = com.yeejoin.amos.fas.business.entity.mybatis
mybatis.configuration.mapUnderscoreToCamelCase
=
true
mybatis.configuration.mapUnderscoreToCamelCase
=
true
logging.level.com.yeejoin.amos.fas.business.dao.mapper
=
debug
logging.level.com.yeejoin.amos.fas.business.dao.mapper
=
debug
spring.servlet.multipart.max-file-size
=
20MB
spring.servlet.multipart.max-request-size
=
20MB
#liquibase
#liquibase
spring.liquibase.change-log
=
classpath:/db/changelog/changelog-master.xml
spring.liquibase.change-log
=
classpath:/db/changelog/changelog-master.xml
spring.liquibase.enabled
=
true
spring.liquibase.enabled
=
true
param.system.online.date
=
20
20
-02-12
param.system.online.date
=
20
19
-02-12
spring.servlet.multipart.max-file-size
=
20MB
spring.servlet.multipart.max-request-size
=
20MB
#feginName
visual.fegin.name
=
maas-visual
visual.fegin.name
=
maas-visual
dutyMode.fegin.name
=
AMOSDUTYMODE
spring.http.multipart.maxFileSize
=
10480000
spring.http.multipart.maxFileSize
=
10480000
spring.http.multipart.MaxRequestSize
=
50480000
spring.http.multipart.MaxRequestSize
=
50480000
windows.img.path
=
E
:
\\
windows.img.path
=
F
:
\\
linux.img.path = /
linux.img.path = /
param.safetyIndexChange.cron
=
0 0 2 * * ?
param.safetyIndexChange.cron
=
0 0 2 * * ?
#获取天气地址
param.weather.url
=
http://t.weather.sojson.com/api/weather/city/
param.weather.url
=
http://t.weather.sojson.com/api/weather/city/
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_fire_equip.xml
View file @
b0822c9c
...
@@ -241,10 +241,19 @@
...
@@ -241,10 +241,19 @@
<if
test=
"name!=null"
>
<if
test=
"name!=null"
>
and (fe.`name` like '%${name}%' or fe.`code` like '%${name}%')
and (fe.`name` like '%${name}%' or fe.`code` like '%${name}%')
</if>
</if>
<!-- 筛选未绑定的配套设施
-->
<if
test=
"bindStation != null and bindStation == 'false'"
>
AND (select true from
f_fire_station_equipment fse
left join f_fire_equipment e on fse.fire_equipment_id = e.id
where fse.fire_equipment_id = fe.id AND e.equip_classify != 1 limit 0,1) is not true
</if>
</select>
</select>
<select
id=
"queryForEquipmentPage"
resultType=
"map"
>
<select
id=
"queryForEquipmentPage"
resultType=
"map"
>
select
select * from (
select
fe.*, (
fe.*, (
SELECT
SELECT
'YES'
'YES'
...
@@ -253,19 +262,29 @@
...
@@ -253,19 +262,29 @@
WHERE
WHERE
efe.fire_equipment_id = fe.id limit 0,1
efe.fire_equipment_id = fe.id limit 0,1
) isBind,
) isBind,
frs.name riskSourceName
frs.name riskSourceName,
(select true from
f_fire_station_equipment fse
left join f_fire_equipment e on fse.fire_equipment_id = e.id
where fse.fire_equipment_id = fe.id AND e.equip_classify != 1 limit 0,1) as bindStation
from f_fire_equipment fe
from f_fire_equipment fe
left join f_risk_source frs on frs.id = fe.risk_source_id
left join f_risk_source frs on frs.id = fe.risk_source_id
where 1=1) tmp
<where>
<where>
<if
test=
"equipClassify!=null"
>
<if
test=
"equipClassify!=null"
>
and
fe
.equip_classify in ( ${equipClassify} )
and
tmp
.equip_classify in ( ${equipClassify} )
</if>
</if>
<if
test=
"code!=null"
>
<if
test=
"code!=null"
>
and
fe
.`code` like '%${code}%'
and
tmp
.`code` like '%${code}%'
</if>
</if>
<if
test=
"name!=null"
>
<if
test=
"name!=null"
>
and (fe.`name` like '%${name}%' or fe.`code` like '%${name}%')
and (tmp.`name` like '%${name}%' or tmp.`code` like '%${name}%')
</if>
<!-- 筛选未绑定的配套设施
-->
<if
test=
"bindStation != null and bindStation == 'false'"
>
AND tmp.bindStation is not true
</if>
</if>
</where>
</where>
LIMIT ${start},${length}
LIMIT ${start},${length}
...
@@ -385,6 +404,7 @@
...
@@ -385,6 +404,7 @@
is_indoor,
is_indoor,
name,
name,
maintenance_cycle,
maintenance_cycle,
manufacturer,
number,
number,
unit,
unit,
room,
room,
...
@@ -404,6 +424,7 @@
...
@@ -404,6 +424,7 @@
#{item.isIndoor},
#{item.isIndoor},
#{item.name},
#{item.name},
#{item.maintenanceCycle},
#{item.maintenanceCycle},
#{item.manufacturer},
#{item.number},
#{item.number},
#{item.unit},
#{item.unit},
#{item.room},
#{item.room},
...
@@ -445,6 +466,9 @@
...
@@ -445,6 +466,9 @@
<if
test=
"item.maintenanceCycle != null"
>
<if
test=
"item.maintenanceCycle != null"
>
maintenance_cycle = #{item.maintenanceCycle},
maintenance_cycle = #{item.maintenanceCycle},
</if>
</if>
<if
test=
"item.manufacturer != null"
>
manufacturer = #{item.manufacturer},
</if>
<if
test=
"item.number != null"
>
<if
test=
"item.number != null"
>
number = #{item.number},
number = #{item.number},
</if>
</if>
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_view3d.xml
View file @
b0822c9c
...
@@ -1338,7 +1338,7 @@ from (select concat('riskSource',r.id) as id,r.name,r.code,r.ue4_location as ue4
...
@@ -1338,7 +1338,7 @@ from (select concat('riskSource',r.id) as id,r.name,r.code,r.ue4_location as ue4
)
)
END positionDTO,
END positionDTO,
m.name as label,
m.name as label,
f.name
as protectObjName,
group_concat(f.name)
as protectObjName,
'' as routeName,
'' as routeName,
'' as person,
'' as person,
m.name as title,
m.name as title,
...
@@ -1347,6 +1347,7 @@ from (select concat('riskSource',r.id) as id,r.name,r.code,r.ue4_location as ue4
...
@@ -1347,6 +1347,7 @@ from (select concat('riskSource',r.id) as id,r.name,r.code,r.ue4_location as ue4
left join f_equipment_fire_equipment fe on fe.fire_equipment_id = m.id
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
left join f_equipment f on f.id = fe.equipment_id
where equip_classify = 0
where equip_classify = 0
group By m.code
<if
test=
"protectObjName != null and protectObjName != ''"
>
<if
test=
"protectObjName != null and protectObjName != ''"
>
AND f.name = #{protectObjName}
AND f.name = #{protectObjName}
</if>
</if>
...
...
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