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
d82d8697
Commit
d82d8697
authored
May 11, 2020
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、删除9000服务相关接口
2、计算rpn修改
parent
84e09ca1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
183 additions
and
776 deletions
+183
-776
RiskSource.java
...main/java/com/yeejoin/amos/fas/dao/entity/RiskSource.java
+14
-0
RpnChangeLog.java
...in/java/com/yeejoin/amos/fas/dao/entity/RpnChangeLog.java
+15
-6
Node3dVoController.java
...join/amos/fas/business/controller/Node3dVoController.java
+0
-98
Node3dVoMapper.java
.../yeejoin/amos/fas/business/dao/mapper/Node3dVoMapper.java
+0
-123
EquipmentServiceImpl.java
.../amos/fas/business/service/impl/EquipmentServiceImpl.java
+4
-91
FireCarServiceImpl.java
...in/amos/fas/business/service/impl/FireCarServiceImpl.java
+16
-65
FireEquipServiceImpl.java
.../amos/fas/business/service/impl/FireEquipServiceImpl.java
+1
-13
FireStationServiceImpl.java
...mos/fas/business/service/impl/FireStationServiceImpl.java
+12
-27
Node3dVoServiceImpl.java
...n/amos/fas/business/service/impl/Node3dVoServiceImpl.java
+0
-200
RiskSourceServiceImpl.java
...amos/fas/business/service/impl/RiskSourceServiceImpl.java
+29
-46
WaterResourceServiceImpl.java
...s/fas/business/service/impl/WaterResourceServiceImpl.java
+10
-21
Node3dVoService.java
...join/amos/fas/business/service/intfc/Node3dVoService.java
+0
-57
RpnUtils.java
...ain/java/com/yeejoin/amos/fas/business/util/RpnUtils.java
+51
-10
fas-2.0.1.xml
...utoSysStart/src/main/resources/db/changelog/fas-2.0.1.xml
+28
-1
fas-sql-task.xml
...SysStart/src/main/resources/db/changelog/fas-sql-task.xml
+0
-18
dbTemplate_node3d.xml
...sStart/src/main/resources/db/mapper/dbTemplate_node3d.xml
+0
-0
dbTemplate_risk_source.xml
...t/src/main/resources/db/mapper/dbTemplate_risk_source.xml
+3
-0
No files found.
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/RiskSource.java
View file @
d82d8697
...
@@ -72,6 +72,12 @@ public class RiskSource extends BasicEntity {
...
@@ -72,6 +72,12 @@ public class RiskSource extends BasicEntity {
@Lob
@Lob
private
String
ue4Extent
;
private
String
ue4Extent
;
/**
* 闪烁频率
*/
@Column
(
name
=
"flicker_frequency"
)
private
Integer
flickerFrequency
;
private
List
<
Fmea
>
fmeaList
;
private
List
<
Fmea
>
fmeaList
;
private
List
<
RpnChangeLog
>
rpnChangeLogList
;
private
List
<
RpnChangeLog
>
rpnChangeLogList
;
...
@@ -83,6 +89,14 @@ public class RiskSource extends BasicEntity {
...
@@ -83,6 +89,14 @@ public class RiskSource extends BasicEntity {
return
rpni
;
return
rpni
;
}
}
public
Integer
getFlickerFrequency
()
{
return
flickerFrequency
;
}
public
void
setFlickerFrequency
(
Integer
flickerFrequency
)
{
this
.
flickerFrequency
=
flickerFrequency
;
}
public
void
setRpni
(
BigDecimal
rpni
)
{
public
void
setRpni
(
BigDecimal
rpni
)
{
this
.
rpni
=
rpni
;
this
.
rpni
=
rpni
;
}
}
...
...
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/RpnChangeLog.java
View file @
d82d8697
...
@@ -2,12 +2,7 @@ package com.yeejoin.amos.fas.dao.entity;
...
@@ -2,12 +2,7 @@ package com.yeejoin.amos.fas.dao.entity;
import
com.fasterxml.jackson.annotation.JsonBackReference
;
import
com.fasterxml.jackson.annotation.JsonBackReference
;
import
javax.persistence.Column
;
import
javax.persistence.*
;
import
javax.persistence.Entity
;
import
javax.persistence.JoinColumn
;
import
javax.persistence.ManyToOne
;
import
javax.persistence.NamedQuery
;
import
javax.persistence.Table
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
...
@@ -35,8 +30,22 @@ public class RpnChangeLog extends BasicEntity {
...
@@ -35,8 +30,22 @@ public class RpnChangeLog extends BasicEntity {
@Column
(
name
=
"trigger_by"
)
@Column
(
name
=
"trigger_by"
)
private
Long
triggerBy
;
private
Long
triggerBy
;
/**
* 触发变化类型(巡检、告警、评价、删除)
*/
@Column
(
name
=
"trigger_type"
)
private
String
triggerType
;
private
int
type
;
private
int
type
;
public
String
getTriggerType
()
{
return
triggerType
;
}
public
void
setTriggerType
(
String
triggerType
)
{
this
.
triggerType
=
triggerType
;
}
private
RiskSource
riskSource
;
private
RiskSource
riskSource
;
public
RpnChangeLog
()
{
public
RpnChangeLog
()
{
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/Node3dVoController.java
deleted
100644 → 0
View file @
84e09ca1
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
import
com.yeejoin.amos.fas.business.service.intfc.Node3dVoService
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
@RequestMapping
(
"/api/node3d"
)
@Api
(
tags
=
"3d模型数据"
)
public
class
Node3dVoController
extends
BaseController
{
private
final
Logger
log
=
LoggerFactory
.
getLogger
(
Node3dVoController
.
class
);
@Autowired
Node3dVoService
node3dVoService
;
/**
* 同步新增的3d数据
*
* @param dataType
* @return
*/
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"同步新增的3d数据"
,
notes
=
"同步新增的3d数据"
)
@RequestMapping
(
value
=
"/incremental/{dataType}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
incrementalCreate
(
@ApiParam
(
value
=
"数据类型"
,
required
=
true
)
@PathVariable
String
dataType
)
{
node3dVoService
.
incrementalCreate
(
dataType
);
return
CommonResponseUtil
.
success
(
"SUCCESS"
);
}
/**
* 同步已经删除的的3d数据
*
* @return
*/
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"同步已经删除的的3d数据"
,
notes
=
"同步已经删除的的3d数据"
)
@RequestMapping
(
value
=
"/incremental/{dataType}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
DELETE
)
public
CommonResponse
incrementalRemove
(
@ApiParam
(
value
=
"数据类型"
,
required
=
true
)
@PathVariable
String
dataType
)
{
node3dVoService
.
incrementalRemove
(
dataType
);
return
CommonResponseUtil
.
success
(
"SUCCESS"
);
}
/**
* 同步需要更新的的3d数据
*
* @return
*/
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"同步需要更新的的3d数据"
,
notes
=
"同步需要更新的的3d数据"
)
@RequestMapping
(
value
=
"/incremental/{dataType}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
PUT
)
public
CommonResponse
incrementalUpdate
(
@ApiParam
(
value
=
"数据类型"
,
required
=
true
)
@PathVariable
String
dataType
)
throws
Exception
{
node3dVoService
.
incrementalUpdate
(
dataType
);
return
CommonResponseUtil
.
success
(
"SUCCESS"
);
}
/**
* 同步指定的数据类型,增加,删除,更新
*
* @return
*/
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"同步需要更新的的3d数据"
,
notes
=
"同步需要更新的的3d数据"
)
@RequestMapping
(
value
=
"/incremental/dataType/{dataType}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
PUT
)
public
CommonResponse
incrementalDataType
(
@ApiParam
(
value
=
"数据类型"
,
required
=
true
)
@PathVariable
String
dataType
)
throws
Exception
{
node3dVoService
.
incrementalDataType
(
dataType
);
return
CommonResponseUtil
.
success
(
"SUCCESS"
);
}
/**
* 对所有数据类型进行同步,新增,更新,删除
*
* @return
*/
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"对所有数据类型进行同步,新增,更新,删除"
,
notes
=
"对所有数据类型进行同步,新增,更新,删除"
)
@RequestMapping
(
value
=
"/whole/incremental"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
PUT
)
public
CommonResponse
wholeIncremental
()
throws
Exception
{
node3dVoService
.
wholeIncremental
();
return
CommonResponseUtil
.
success
(
"SUCCESS"
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/Node3dVoMapper.java
deleted
100644 → 0
View file @
84e09ca1
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
mapper
;
import
org.apache.ibatis.annotations.Param
;
public
interface
Node3dVoMapper
extends
BaseMapper
{
/**
* 风险点数据同步--新增
*/
Integer
incrementalCreateRiskSource
(
@Param
(
"rsId"
)
Long
rsId
);
/**
* 风险点数据同步--删除
*/
Integer
incrementalDeleteRiskSource
(
@Param
(
"rsId"
)
Long
rsId
);
/**
* 风险点数据同步--更新
*/
Integer
incrementalUpdateRiskSource
(
@Param
(
"rsId"
)
Long
rsId
,
@Param
(
"frequency"
)
Integer
frequency
);
/**
* 消防设备--新增
*/
Integer
incrementalCreateFierEqumt
(
@Param
(
"feId"
)
Long
feId
);
/**
* 消防设备--删除
*/
Integer
incrementalDeleteFierEqumt
(
@Param
(
"feId"
)
Long
feId
);
/**
* 消防设备--更新
*/
Integer
incrementalUpdateFierEqumt
(
@Param
(
"feId"
)
Long
feId
);
/**
* 重点设备--新增
*/
Integer
incrementalCreateImpEqumt
(
@Param
(
"equipId"
)
Long
equipId
);
/**
* 重点设备--删除
*/
Integer
incrementalDeleteImpEqumt
(
@Param
(
"equipId"
)
Long
equipId
);
/**
* 重点设备--更新
*/
Integer
incrementalUpdateImpEqumt
(
@Param
(
"equipId"
)
Long
equipId
);
/**
*消防车--新增
*/
Integer
incrementalCreateFireCar
(
@Param
(
"carId"
)
Long
carId
);
/**
* 消防车--删除
*/
Integer
incrementalDeleteFireCar
(
@Param
(
"carId"
)
Long
carId
);
/**
* 消防车--更新
*/
Integer
incrementalUpdateFireCar
(
@Param
(
"carId"
)
Long
carId
);
/**
*消防室和泡沫间--新增
*/
Integer
incrementalCreateStation
(
@Param
(
"fsId"
)
Long
fsId
);
/**
* 消防室和泡沫间--删除
*/
Integer
incrementalDeleteStation
(
@Param
(
"fsId"
)
Long
fsId
);
/**
* 消防室和泡沫间--更新
*/
Integer
incrementalUpdateStation
(
@Param
(
"fsId"
)
Long
fsId
);
/**
*水资源--新增
*/
Integer
incrementalCreateWater
(
@Param
(
"wrId"
)
Long
wrId
);
/**
* 消防室和泡沫间--删除
*/
Integer
incrementalDeleteWater
(
@Param
(
"wrId"
)
Long
wrId
);
/**
* 消防室和泡沫间--更新
*/
Integer
incrementalUpdateWater
(
@Param
(
"wrId"
)
Long
wrId
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/EquipmentServiceImpl.java
View file @
d82d8697
...
@@ -5,7 +5,6 @@ import com.yeejoin.amos.fas.business.constants.FasConstant;
...
@@ -5,7 +5,6 @@ import com.yeejoin.amos.fas.business.constants.FasConstant;
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.ImpAndFireEquipMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.ImpAndFireEquipMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.ImpEquipMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.ImpEquipMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.Node3dVoMapper
;
import
com.yeejoin.amos.fas.business.dao.mongo.EquipCommunicationDao
;
import
com.yeejoin.amos.fas.business.dao.mongo.EquipCommunicationDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IEquipmentDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IEquipmentDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IEquipmentFireEquipmentDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IEquipmentFireEquipmentDao
;
...
@@ -18,7 +17,6 @@ import com.yeejoin.amos.fas.core.common.request.CommonPageable;
...
@@ -18,7 +17,6 @@ import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import
com.yeejoin.amos.fas.core.common.response.EquipDetailsResponse
;
import
com.yeejoin.amos.fas.core.common.response.EquipDetailsResponse
;
import
com.yeejoin.amos.fas.core.util.DaoCriteria
;
import
com.yeejoin.amos.fas.core.util.DaoCriteria
;
import
com.yeejoin.amos.fas.core.util.query.BaseQuerySpecification
;
import
com.yeejoin.amos.fas.core.util.query.BaseQuerySpecification
;
import
com.yeejoin.amos.fas.dao.entity.Dict
;
import
com.yeejoin.amos.fas.dao.entity.Equipment
;
import
com.yeejoin.amos.fas.dao.entity.Equipment
;
import
com.yeejoin.amos.fas.dao.entity.EquipmentFireEquipment
;
import
com.yeejoin.amos.fas.dao.entity.EquipmentFireEquipment
;
import
com.yeejoin.amos.fas.dao.entity.FireEquipment
;
import
com.yeejoin.amos.fas.dao.entity.FireEquipment
;
...
@@ -46,12 +44,7 @@ import org.springframework.web.multipart.MultipartFile;
...
@@ -46,12 +44,7 @@ import org.springframework.web.multipart.MultipartFile;
import
javax.annotation.PostConstruct
;
import
javax.annotation.PostConstruct
;
import
java.io.File
;
import
java.io.File
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
@Service
(
"equipService"
)
@Service
(
"equipService"
)
public
class
EquipmentServiceImpl
implements
IEquipmentService
{
public
class
EquipmentServiceImpl
implements
IEquipmentService
{
...
@@ -79,9 +72,6 @@ public class EquipmentServiceImpl implements IEquipmentService {
...
@@ -79,9 +72,6 @@ public class EquipmentServiceImpl implements IEquipmentService {
ImpAndFireEquipMapper
impAndFireEquipMapper
;
ImpAndFireEquipMapper
impAndFireEquipMapper
;
@Autowired
@Autowired
Node3dVoMapper
node3dVoMapper
;
@Autowired
private
IPreplanPictureDao
preplanPictureDao
;
private
IPreplanPictureDao
preplanPictureDao
;
@Autowired
@Autowired
...
@@ -90,7 +80,6 @@ public class EquipmentServiceImpl implements IEquipmentService {
...
@@ -90,7 +80,6 @@ public class EquipmentServiceImpl implements IEquipmentService {
@Autowired
@Autowired
private
MongoTemplate
mongoTemplate
;
private
MongoTemplate
mongoTemplate
;
@Autowired
@Autowired
private
EquipCommunicationDao
equipCommunicationDao
;
private
EquipCommunicationDao
equipCommunicationDao
;
...
@@ -103,11 +92,6 @@ public class EquipmentServiceImpl implements IEquipmentService {
...
@@ -103,11 +92,6 @@ public class EquipmentServiceImpl implements IEquipmentService {
public
Equipment
save
(
Equipment
equipment
)
{
public
Equipment
save
(
Equipment
equipment
)
{
Long
eqId
=
equipment
.
getId
();
Long
eqId
=
equipment
.
getId
();
equipment
=
iEquipmentDao
.
saveAndFlush
(
equipment
);
equipment
=
iEquipmentDao
.
saveAndFlush
(
equipment
);
if
(
eqId
==
null
||
eqId
==
0
)
{
node3dVoMapper
.
incrementalCreateImpEqumt
(
equipment
.
getId
());
}
else
{
node3dVoMapper
.
incrementalUpdateImpEqumt
(
eqId
);
}
return
equipment
;
return
equipment
;
}
}
...
@@ -123,21 +107,16 @@ public class EquipmentServiceImpl implements IEquipmentService {
...
@@ -123,21 +107,16 @@ public class EquipmentServiceImpl implements IEquipmentService {
}
}
@Override
public
String
[]
delete
(
String
[]
idArray
)
throws
Exception
{
public
String
[]
delete
(
String
[]
idArray
)
throws
Exception
{
for
(
String
id
:
idArray
)
{
for
(
String
id
:
idArray
)
{
Optional
<
Equipment
>
equipment1
=
iEquipmentDao
.
findById
(
Long
.
parseLong
(
id
));
Optional
<
Equipment
>
equipment1
=
iEquipmentDao
.
findById
(
Long
.
parseLong
(
id
));
Equipment
equipment
=
null
;
Equipment
equipment
=
null
;
if
(
equipment1
.
isPresent
()){
if
(
equipment1
.
isPresent
()){
equipment
=
equipment1
.
get
();
equipment
=
equipment1
.
get
();
}
}
if
(
equipment
!=
null
)
{
if
(
equipment
!=
null
)
{
this
.
iEquipmentDao
.
deleteById
(
Long
.
parseLong
(
id
));
this
.
iEquipmentDao
.
deleteById
(
Long
.
parseLong
(
id
));
node3dVoMapper
.
incrementalDeleteImpEqumt
(
Long
.
parseLong
(
id
));
}
else
{
}
else
{
throw
new
Exception
(
"找不到指定的对象:"
+
id
);
throw
new
Exception
(
"找不到指定的对象:"
+
id
);
}
}
...
@@ -199,26 +178,21 @@ public class EquipmentServiceImpl implements IEquipmentService {
...
@@ -199,26 +178,21 @@ public class EquipmentServiceImpl implements IEquipmentService {
result
.
put
(
"exits"
,
false
);
result
.
put
(
"exits"
,
false
);
Equipment
equipment
=
this
.
iEquipmentDao
.
getOne
(
equipmentFireEquipment
.
getEquipmentId
().
longValue
());
Equipment
equipment
=
this
.
iEquipmentDao
.
getOne
(
equipmentFireEquipment
.
getEquipmentId
().
longValue
());
FireEquipment
fireEquipment
=
iFireEquipmentDao
.
getOne
(
equipmentFireEquipment
.
getFireEquipmentId
().
longValue
());
FireEquipment
fireEquipment
=
iFireEquipmentDao
.
getOne
(
equipmentFireEquipment
.
getFireEquipmentId
().
longValue
());
if
(
equipment
==
null
||
fireEquipment
==
null
)
if
(
equipment
==
null
||
fireEquipment
==
null
)
throw
new
Exception
(
"找不到数据"
);
throw
new
Exception
(
"找不到数据"
);
this
.
equipmentFireEquipmentDao
.
save
(
equipmentFireEquipment
);
this
.
equipmentFireEquipmentDao
.
save
(
equipmentFireEquipment
);
//已存在的绑定关系
//已存在的绑定关系
List
<
EquipmentFireEquipment
>
exits
=
impAndFireEquipMapper
.
queryForList
(
String
.
valueOf
(
equipmentFireEquipment
.
getFireEquipmentId
()),
null
);
List
<
EquipmentFireEquipment
>
exits
=
impAndFireEquipMapper
.
queryForList
(
String
.
valueOf
(
equipmentFireEquipment
.
getFireEquipmentId
()),
null
);
if
(!
CollectionUtils
.
isEmpty
(
exits
))
if
(!
CollectionUtils
.
isEmpty
(
exits
))
result
.
put
(
"exits"
,
true
);
result
.
put
(
"exits"
,
true
);
result
.
put
(
"newModel"
,
equipmentFireEquipment
);
result
.
put
(
"newModel"
,
equipmentFireEquipment
);
resultList
.
add
(
result
);
resultList
.
add
(
result
);
}
}
return
resultList
;
return
resultList
;
}
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
List
<
Long
>
removeFireEqmtBind
(
Long
equipmentId
,
String
[]
fireEquipmentIds
)
{
public
List
<
Long
>
removeFireEqmtBind
(
Long
equipmentId
,
String
[]
fireEquipmentIds
)
{
List
<
Long
>
ids
=
new
ArrayList
<>();
List
<
Long
>
ids
=
new
ArrayList
<>();
...
@@ -243,6 +217,7 @@ public class EquipmentServiceImpl implements IEquipmentService {
...
@@ -243,6 +217,7 @@ public class EquipmentServiceImpl implements IEquipmentService {
* @param equipmentId
* @param equipmentId
* @return
* @return
*/
*/
@Override
public
Page
queryBindFirEqumtList
(
CommonPageable
commonPageable
,
Long
equipmentId
)
{
public
Page
queryBindFirEqumtList
(
CommonPageable
commonPageable
,
Long
equipmentId
)
{
long
start
=
-
1
;
long
start
=
-
1
;
int
length
=
-
1
;
int
length
=
-
1
;
...
@@ -389,68 +364,6 @@ public class EquipmentServiceImpl implements IEquipmentService {
...
@@ -389,68 +364,6 @@ public class EquipmentServiceImpl implements IEquipmentService {
}
}
return
equipment
;
return
equipment
;
}
}
/*@Override
public Equipment saveEquipmentAndImg(ImgParam imgs, Equipment equipment) {
// TODO Auto-generated method stub
if(imgs==null ){
equipment = save(equipment);
if(equipment.getCreateDate()==null){
equipment.setCreateDate(iEquipmentDao.findOne(equipment.getId()).getCreateDate()==null?new Date():iEquipmentDao.findOne(equipment.getId()).getCreateDate());
}
}else{
MultipartFile file = imgs.getFile();
int type = imgs.getType();
String remark = imgs.getRemark();
equipment = save(equipment);
if(equipment.getCreateDate()==null){
equipment.setCreateDate(iEquipmentDao.findOne(equipment.getId()).getCreateDate()==null?new Date():iEquipmentDao.findOne(equipment.getId()).getCreateDate());
}
Long equipmentId = Long.valueOf(equipment.getId());
PreplanPicture pp = preplanPictureDao.selectOne(equipmentId, type);
if(pp == null){
pp = new PreplanPicture();
pp.setEquipmentId(equipmentId);
pp.setType(type);
pp.setRemark(remark);
pp.setCreateDate(new Date());
}
String path = FasConstant.UPLOAD_ROOT_PATH + File.separator + FasConstant.UPLOAD_EQUIPMENT_PATH + File.separator
+ equipment.getId();
String filePath = getRootPath() + path;
String fileType = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."),
file.getOriginalFilename().length());
String fileName = File.separator + type+fileType;
try {
File dest = new File(filePath + File.separator + fileName);
if (!dest.exists()) {
if (dest.getParentFile() != null && !dest.getParentFile().exists()) {
dest.getParentFile().mkdirs();
}
dest.createNewFile();
}
file.transferTo(dest);
} catch (IOException e) {
throw new YeeException("上传图片失败");
}
String picture = path + fileName;
pp.setPicture(picture);
pp.setRemark(remark);
preplanPictureDao.saveAndFlush(pp);
equipment = iEquipmentDao.saveAndFlush(equipment);
}
return equipment;
}*/
@Override
@Override
public
List
<
Map
<
String
,
Object
>>
findEquipVideoList
()
{
public
List
<
Map
<
String
,
Object
>>
findEquipVideoList
()
{
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/FireCarServiceImpl.java
View file @
d82d8697
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
impl
;
import
java.io.File
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.assertj.core.util.Sets
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.multipart.MultipartFile
;
import
com.google.common.base.Joiner
;
import
com.google.common.base.Joiner
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
com.yeejoin.amos.fas.business.constants.FasConstant
;
import
com.yeejoin.amos.fas.business.constants.FasConstant
;
import
com.yeejoin.amos.fas.business.dao.mapper.FireCarMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.FireCarMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.Node3dVoMapper
;
import
com.yeejoin.amos.fas.business.dao.repository.IFireCarDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IFireCarDao
;
import
com.yeejoin.amos.fas.business.feign.RemoteSecurityService
;
import
com.yeejoin.amos.fas.business.feign.RemoteSecurityService
;
import
com.yeejoin.amos.fas.business.param.CommonPageInfoParam
;
import
com.yeejoin.amos.fas.business.param.CommonPageInfoParam
;
...
@@ -35,7 +11,19 @@ import com.yeejoin.amos.fas.business.service.intfc.IFireCarService;
...
@@ -35,7 +11,19 @@ import com.yeejoin.amos.fas.business.service.intfc.IFireCarService;
import
com.yeejoin.amos.fas.business.vo.FireCarDetailVo
;
import
com.yeejoin.amos.fas.business.vo.FireCarDetailVo
;
import
com.yeejoin.amos.fas.dao.entity.FireCar
;
import
com.yeejoin.amos.fas.dao.entity.FireCar
;
import
com.yeejoin.amos.fas.exception.YeeException
;
import
com.yeejoin.amos.fas.exception.YeeException
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.assertj.core.util.Sets
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.File
;
import
java.io.IOException
;
import
java.util.*
;
@Service
(
"fireCarService"
)
@Service
(
"fireCarService"
)
...
@@ -53,19 +41,12 @@ public class FireCarServiceImpl implements IFireCarService {
...
@@ -53,19 +41,12 @@ public class FireCarServiceImpl implements IFireCarService {
private
String
linuxImgPath
;
private
String
linuxImgPath
;
@Autowired
@Autowired
Node3dVoMapper
node3dVoMapper
;
@Autowired
private
RemoteSecurityService
remoteSecurityService
;
private
RemoteSecurityService
remoteSecurityService
;
public
FireCar
save
(
FireCar
fireCar
)
public
FireCar
save
(
FireCar
fireCar
)
{
{
Long
carId
=
fireCar
.
getId
();
Long
carId
=
fireCar
.
getId
();
fireCar
=
iFireCarDao
.
saveAndFlush
(
fireCar
);
iFireCarDao
.
save
(
fireCar
);
if
(
carId
==
null
||
carId
==
0
){
node3dVoMapper
.
incrementalCreateFireCar
(
fireCar
.
getId
());
}
else
{
node3dVoMapper
.
incrementalUpdateFireCar
(
carId
);
}
return
fireCar
;
return
fireCar
;
}
}
...
@@ -85,17 +66,13 @@ public class FireCarServiceImpl implements IFireCarService {
...
@@ -85,17 +66,13 @@ public class FireCarServiceImpl implements IFireCarService {
for
(
String
id:
idArray
)
for
(
String
id:
idArray
)
{
{
Optional
<
FireCar
>
fireCar1
=
iFireCarDao
.
findById
(
Long
.
parseLong
(
id
));
Optional
<
FireCar
>
fireCar1
=
iFireCarDao
.
findById
(
Long
.
parseLong
(
id
));
FireCar
fireCar
=
null
;
FireCar
fireCar
=
null
;
if
(
fireCar1
.
isPresent
()){
if
(
fireCar1
.
isPresent
()){
fireCar
=
fireCar1
.
get
();
fireCar
=
fireCar1
.
get
();
}
}
if
(
fireCar
!=
null
)
if
(
fireCar
!=
null
)
{
{
this
.
iFireCarDao
.
deleteById
(
Long
.
parseLong
(
id
));
this
.
iFireCarDao
.
deleteById
(
Long
.
parseLong
(
id
));
node3dVoMapper
.
incrementalDeleteFireCar
(
Long
.
parseLong
(
id
));
}
else
}
else
{
{
throw
new
Exception
(
"找不到指定的对象:"
+
id
);
throw
new
Exception
(
"找不到指定的对象:"
+
id
);
...
@@ -110,43 +87,23 @@ public class FireCarServiceImpl implements IFireCarService {
...
@@ -110,43 +87,23 @@ public class FireCarServiceImpl implements IFireCarService {
@Override
@Override
public
Page
<
HashMap
<
String
,
Object
>>
queryFireCar
(
String
toke
,
String
product
,
String
appKey
,
CommonPageInfoParam
param
)
{
public
Page
<
HashMap
<
String
,
Object
>>
queryFireCar
(
String
toke
,
String
product
,
String
appKey
,
CommonPageInfoParam
param
)
{
long
total
=
fireCarMapper
.
countPageData
(
param
);
long
total
=
fireCarMapper
.
countPageData
(
param
);
List
<
HashMap
<
String
,
Object
>>
content
=
fireCarMapper
.
getFireCarPage
(
param
);
List
<
HashMap
<
String
,
Object
>>
content
=
fireCarMapper
.
getFireCarPage
(
param
);
if
(!
CollectionUtils
.
isEmpty
(
content
))
{
if
(!
CollectionUtils
.
isEmpty
(
content
))
{
Set
<
String
>
deptIds
=
Sets
.
newHashSet
(
Lists
.
transform
(
content
,
Map
->
Map
.
get
(
"dept_id"
)+
""
));
Set
<
String
>
deptIds
=
Sets
.
newHashSet
(
Lists
.
transform
(
content
,
Map
->
Map
.
get
(
"dept_id"
)+
""
));
deptIds
.
remove
(
""
);
deptIds
.
remove
(
""
);
deptIds
.
remove
(
null
);
deptIds
.
remove
(
null
);
Map
<
String
,
String
>
deptMap
=
new
HashMap
<
String
,
String
>();
Map
<
String
,
String
>
deptMap
=
new
HashMap
<
String
,
String
>();
if
(!
CollectionUtils
.
isEmpty
(
deptIds
)){
if
(!
CollectionUtils
.
isEmpty
(
deptIds
)){
List
<
LinkedHashMap
>
deptList
=
remoteSecurityService
.
listDepartmentByDeptIds
(
toke
,
product
,
appKey
,
Joiner
.
on
(
","
).
join
(
deptIds
));
List
<
LinkedHashMap
>
deptList
=
remoteSecurityService
.
listDepartmentByDeptIds
(
toke
,
product
,
appKey
,
Joiner
.
on
(
","
).
join
(
deptIds
));
for
(
int
i
=
0
;
i
<
deptList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
deptList
.
size
();
i
++)
{
deptMap
.
put
(
deptList
.
get
(
i
).
get
(
"sequenceNbr"
).
toString
(),
deptList
.
get
(
i
).
get
(
"departmentName"
).
toString
());
deptMap
.
put
(
deptList
.
get
(
i
).
get
(
"sequenceNbr"
).
toString
(),
deptList
.
get
(
i
).
get
(
"departmentName"
).
toString
());
}
}
}
}
Map
<
String
,
String
>
deptMapNew
=
deptMap
;
Map
<
String
,
String
>
deptMapNew
=
deptMap
;
content
.
forEach
(
e
->
{
content
.
forEach
(
e
->
{
e
.
put
(
"departmentName"
,
deptMapNew
.
get
(
e
.
get
(
"dept_id"
)));
e
.
put
(
"departmentName"
,
deptMapNew
.
get
(
e
.
get
(
"dept_id"
)));
});
});
}
}
Page
<
HashMap
<
String
,
Object
>>
result
=
new
PageImpl
<
HashMap
<
String
,
Object
>>(
content
,
param
,
total
);
Page
<
HashMap
<
String
,
Object
>>
result
=
new
PageImpl
<
HashMap
<
String
,
Object
>>(
content
,
param
,
total
);
return
result
;
return
result
;
}
}
...
@@ -193,14 +150,8 @@ public class FireCarServiceImpl implements IFireCarService {
...
@@ -193,14 +150,8 @@ public class FireCarServiceImpl implements IFireCarService {
}
}
}
}
fireCar
.
setPhotoPath
(
photoPath
);
fireCar
.
setPhotoPath
(
photoPath
);
fireCar
=
iFireCarDao
.
saveAndFlush
(
fireCar
);
iFireCarDao
.
save
(
fireCar
);
if
(
carId
==
null
||
carId
==
0
){
node3dVoMapper
.
incrementalCreateFireCar
(
fireCar
.
getId
());
}
else
{
node3dVoMapper
.
incrementalUpdateFireCar
(
carId
);
}
return
fireCar
;
return
fireCar
;
}
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/FireEquipServiceImpl.java
View file @
d82d8697
...
@@ -2,7 +2,6 @@ package com.yeejoin.amos.fas.business.service.impl;
...
@@ -2,7 +2,6 @@ package com.yeejoin.amos.fas.business.service.impl;
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.ImpEquipMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.ImpEquipMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.Node3dVoMapper
;
import
com.yeejoin.amos.fas.business.dao.repository.IFireEquipmentDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IFireEquipmentDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IFireStationDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IFireStationDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IWaterResourceDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IWaterResourceDao
;
...
@@ -41,20 +40,10 @@ public class FireEquipServiceImpl implements IFireEquipService {
...
@@ -41,20 +40,10 @@ public class FireEquipServiceImpl implements IFireEquipService {
@Autowired
@Autowired
IFireStationDao
iFireStationDao
;
IFireStationDao
iFireStationDao
;
@Autowired
Node3dVoMapper
node3dVoMapper
;
public
FireEquipment
save
(
FireEquipment
fireEquipment
)
{
public
FireEquipment
save
(
FireEquipment
fireEquipment
)
{
Long
id
=
fireEquipment
.
getId
();
Long
id
=
fireEquipment
.
getId
();
fireEquipment
=
iFireEquipmentDao
.
saveAndFlush
(
fireEquipment
);
iFireEquipmentDao
.
save
(
fireEquipment
);
if
(
id
==
null
||
id
==
0
){
node3dVoMapper
.
incrementalCreateFierEqumt
(
fireEquipment
.
getId
());
}
else
{
node3dVoMapper
.
incrementalUpdateFierEqumt
(
id
);
}
return
fireEquipment
;
return
fireEquipment
;
}
}
...
@@ -77,7 +66,6 @@ public class FireEquipServiceImpl implements IFireEquipService {
...
@@ -77,7 +66,6 @@ public class FireEquipServiceImpl implements IFireEquipService {
if
(
fireEquipment
!=
null
)
{
if
(
fireEquipment
!=
null
)
{
this
.
iFireEquipmentDao
.
deleteById
(
Long
.
parseLong
(
id
));
this
.
iFireEquipmentDao
.
deleteById
(
Long
.
parseLong
(
id
));
node3dVoMapper
.
incrementalDeleteFierEqumt
(
Long
.
parseLong
(
id
));
}
else
{
}
else
{
throw
new
Exception
(
"找不到指定的对象:"
+
id
);
throw
new
Exception
(
"找不到指定的对象:"
+
id
);
}
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/FireStationServiceImpl.java
View file @
d82d8697
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
impl
;
import
java.io.File
;
import
java.io.IOException
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.web.multipart.MultipartFile
;
import
com.yeejoin.amos.fas.business.constants.FasConstant
;
import
com.yeejoin.amos.fas.business.constants.FasConstant
;
import
com.yeejoin.amos.fas.business.dao.mapper.FireStationEquipmentMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.FireStationEquipmentMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.FireStationMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.FireStationMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.Node3dVoMapper
;
import
com.yeejoin.amos.fas.business.dao.repository.IFireEquipmentDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IFireEquipmentDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IFireStationDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IFireStationDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IFireStationEquipmentDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IFireStationEquipmentDao
;
...
@@ -29,6 +12,17 @@ import com.yeejoin.amos.fas.dao.entity.FireEquipment;
...
@@ -29,6 +12,17 @@ import com.yeejoin.amos.fas.dao.entity.FireEquipment;
import
com.yeejoin.amos.fas.dao.entity.FireStation
;
import
com.yeejoin.amos.fas.dao.entity.FireStation
;
import
com.yeejoin.amos.fas.dao.entity.FireStationFireEquipment
;
import
com.yeejoin.amos.fas.dao.entity.FireStationFireEquipment
;
import
com.yeejoin.amos.fas.exception.YeeException
;
import
com.yeejoin.amos.fas.exception.YeeException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.File
;
import
java.io.IOException
;
import
java.util.*
;
@Service
(
"fireStationService"
)
@Service
(
"fireStationService"
)
public
class
FireStationServiceImpl
implements
IFireStationService
{
public
class
FireStationServiceImpl
implements
IFireStationService
{
...
@@ -48,9 +42,6 @@ public class FireStationServiceImpl implements IFireStationService {
...
@@ -48,9 +42,6 @@ public class FireStationServiceImpl implements IFireStationService {
@Autowired
@Autowired
IFireEquipmentDao
iFireEquipmentDao
;
IFireEquipmentDao
iFireEquipmentDao
;
@Autowired
Node3dVoMapper
node3dVoMapper
;
@Value
(
"${windows.img.path}"
)
@Value
(
"${windows.img.path}"
)
private
String
winImgPath
;
private
String
winImgPath
;
...
@@ -59,12 +50,7 @@ public class FireStationServiceImpl implements IFireStationService {
...
@@ -59,12 +50,7 @@ public class FireStationServiceImpl implements IFireStationService {
public
FireStation
save
(
FireStation
fireStation
)
{
public
FireStation
save
(
FireStation
fireStation
)
{
Long
id
=
fireStation
.
getId
();
Long
id
=
fireStation
.
getId
();
fireStation
=
iFireStationDao
.
saveAndFlush
(
fireStation
);
iFireStationDao
.
saveAndFlush
(
fireStation
);
if
(
id
==
null
||
id
==
0
)
{
node3dVoMapper
.
incrementalCreateStation
(
fireStation
.
getId
());
}
else
{
node3dVoMapper
.
incrementalUpdateStation
(
id
);
}
return
fireStation
;
return
fireStation
;
}
}
...
@@ -134,7 +120,6 @@ public class FireStationServiceImpl implements IFireStationService {
...
@@ -134,7 +120,6 @@ public class FireStationServiceImpl implements IFireStationService {
}
}
if
(
fireStation
!=
null
)
{
if
(
fireStation
!=
null
)
{
this
.
iFireStationDao
.
deleteById
(
Long
.
parseLong
(
id
));
this
.
iFireStationDao
.
deleteById
(
Long
.
parseLong
(
id
));
node3dVoMapper
.
incrementalDeleteStation
(
Long
.
parseLong
(
id
));
}
else
{
}
else
{
throw
new
Exception
(
"找不到指定的监测点:"
+
id
);
throw
new
Exception
(
"找不到指定的监测点:"
+
id
);
}
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/Node3dVoServiceImpl.java
deleted
100644 → 0
View file @
84e09ca1
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
impl
;
import
com.yeejoin.amos.fas.business.dao.mapper.Node3dVoMapper
;
import
com.yeejoin.amos.fas.business.service.intfc.Node3dVoService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
java.util.concurrent.Callable
;
@Service
(
"node3dVoService"
)
public
class
Node3dVoServiceImpl
implements
Node3dVoService
{
@Autowired
private
Node3dVoMapper
node3dVoMapper
;
@Override
public
Integer
incrementalCreate
(
String
dataType
)
{
Integer
result
=
0
;
switch
(
dataType
)
{
case
DATATYPE_FIREEQUMT:
result
=
node3dVoMapper
.
incrementalCreateFierEqumt
(
null
);
break
;
case
DATATYPE_IMPEQUMT:
result
=
node3dVoMapper
.
incrementalCreateImpEqumt
(
null
);
break
;
case
DATATYPE_RISKSOURCE:
result
=
node3dVoMapper
.
incrementalCreateRiskSource
(
null
);
break
;
case
DATATYPE_FIRECAR:
result
=
node3dVoMapper
.
incrementalCreateFireCar
(
null
);
break
;
case
DATATYPE_STATION:
result
=
node3dVoMapper
.
incrementalCreateStation
(
null
);
break
;
case
DATATYPE_WATER:
result
=
node3dVoMapper
.
incrementalCreateWater
(
null
);
break
;
}
return
result
;
}
@Override
public
Integer
incrementalRemove
(
String
dataType
)
{
Integer
result
=
0
;
switch
(
dataType
)
{
case
DATATYPE_FIREEQUMT:
result
=
node3dVoMapper
.
incrementalDeleteFierEqumt
(
null
);
break
;
case
DATATYPE_IMPEQUMT:
result
=
node3dVoMapper
.
incrementalDeleteImpEqumt
(
null
);
break
;
case
DATATYPE_RISKSOURCE:
result
=
node3dVoMapper
.
incrementalDeleteRiskSource
(
null
);
break
;
case
DATATYPE_FIRECAR:
result
=
node3dVoMapper
.
incrementalDeleteFireCar
(
null
);
break
;
case
DATATYPE_STATION:
result
=
node3dVoMapper
.
incrementalDeleteStation
(
null
);
break
;
case
DATATYPE_WATER:
result
=
node3dVoMapper
.
incrementalDeleteWater
(
null
);
break
;
}
return
result
;
}
@Override
public
Integer
incrementalUpdate
(
String
dataType
)
{
Integer
result
=
0
;
switch
(
dataType
)
{
case
DATATYPE_FIREEQUMT:
result
=
node3dVoMapper
.
incrementalUpdateFierEqumt
(
null
);
break
;
case
DATATYPE_IMPEQUMT:
result
=
node3dVoMapper
.
incrementalUpdateImpEqumt
(
null
);
break
;
case
DATATYPE_RISKSOURCE:
result
=
node3dVoMapper
.
incrementalUpdateRiskSource
(
null
,
null
);
break
;
case
DATATYPE_FIRECAR:
result
=
node3dVoMapper
.
incrementalUpdateFireCar
(
null
);
break
;
case
DATATYPE_STATION:
result
=
node3dVoMapper
.
incrementalUpdateStation
(
null
);
break
;
case
DATATYPE_WATER:
result
=
node3dVoMapper
.
incrementalUpdateWater
(
null
);
break
;
}
return
result
;
}
/**
*
* @param dataType
* @return
*/
@Override
public
Integer
incrementalDataType
(
String
dataType
)
{
Integer
result
=
0
;
switch
(
dataType
)
{
case
DATATYPE_FIREEQUMT:
result
+=
node3dVoMapper
.
incrementalCreateFierEqumt
(
null
)==
null
?
0
:
node3dVoMapper
.
incrementalCreateFierEqumt
(
null
);
result
+=
node3dVoMapper
.
incrementalUpdateFierEqumt
(
null
)==
null
?
0
:
node3dVoMapper
.
incrementalUpdateFierEqumt
(
null
);
result
+=
node3dVoMapper
.
incrementalDeleteFierEqumt
(
null
)==
null
?
0
:
node3dVoMapper
.
incrementalDeleteFierEqumt
(
null
);
break
;
case
DATATYPE_IMPEQUMT:
result
+=
node3dVoMapper
.
incrementalCreateImpEqumt
(
null
)==
null
?
0
:
node3dVoMapper
.
incrementalCreateImpEqumt
(
null
);
result
+=
node3dVoMapper
.
incrementalUpdateImpEqumt
(
null
)==
null
?
0
:
node3dVoMapper
.
incrementalUpdateImpEqumt
(
null
);
result
+=
node3dVoMapper
.
incrementalDeleteImpEqumt
(
null
)==
null
?
0
:
node3dVoMapper
.
incrementalDeleteImpEqumt
(
null
);
break
;
case
DATATYPE_RISKSOURCE:
result
+=
node3dVoMapper
.
incrementalCreateRiskSource
(
null
)==
null
?
0
:
node3dVoMapper
.
incrementalCreateRiskSource
(
null
);
result
+=
node3dVoMapper
.
incrementalUpdateRiskSource
(
null
,
null
)==
null
?
0
:
node3dVoMapper
.
incrementalUpdateRiskSource
(
null
,
null
);
result
+=
node3dVoMapper
.
incrementalDeleteRiskSource
(
null
)==
null
?
0
:
node3dVoMapper
.
incrementalDeleteRiskSource
(
null
);
break
;
case
DATATYPE_FIRECAR:
result
+=
node3dVoMapper
.
incrementalCreateFireCar
(
null
)==
null
?
0
:
node3dVoMapper
.
incrementalCreateFireCar
(
null
);
result
+=
node3dVoMapper
.
incrementalUpdateFireCar
(
null
)==
null
?
0
:
node3dVoMapper
.
incrementalUpdateFireCar
(
null
);
result
+=
node3dVoMapper
.
incrementalDeleteFireCar
(
null
)==
null
?
0
:
node3dVoMapper
.
incrementalDeleteFireCar
(
null
);
break
;
case
DATATYPE_STATION:
result
+=
node3dVoMapper
.
incrementalCreateStation
(
null
)==
null
?
0
:
node3dVoMapper
.
incrementalCreateStation
(
null
);
result
+=
node3dVoMapper
.
incrementalUpdateStation
(
null
)==
null
?
0
:
node3dVoMapper
.
incrementalUpdateStation
(
null
);
result
+=
node3dVoMapper
.
incrementalDeleteStation
(
null
)==
null
?
0
:
node3dVoMapper
.
incrementalDeleteStation
(
null
);
break
;
case
DATATYPE_WATER:
result
+=
node3dVoMapper
.
incrementalCreateWater
(
null
)==
null
?
0
:
node3dVoMapper
.
incrementalCreateWater
(
null
);
result
+=
node3dVoMapper
.
incrementalUpdateWater
(
null
)==
null
?
0
:
node3dVoMapper
.
incrementalUpdateWater
(
null
);
result
+=
node3dVoMapper
.
incrementalDeleteWater
(
null
)==
null
?
0
:
node3dVoMapper
.
incrementalDeleteWater
(
null
);
break
;
}
return
result
;
}
@Override
public
Integer
wholeIncremental
()
{
Integer
result
=
0
;
//消防设备
result
+=
node3dVoMapper
.
incrementalCreateFierEqumt
(
null
)==
null
?
0
:
node3dVoMapper
.
incrementalCreateFierEqumt
(
null
);
result
+=
node3dVoMapper
.
incrementalUpdateFierEqumt
(
null
)==
null
?
0
:
node3dVoMapper
.
incrementalUpdateFierEqumt
(
null
);
result
+=
node3dVoMapper
.
incrementalDeleteFierEqumt
(
null
)==
null
?
0
:
node3dVoMapper
.
incrementalDeleteFierEqumt
(
null
);
//重点设备
result
+=
node3dVoMapper
.
incrementalCreateImpEqumt
(
null
)==
null
?
0
:
node3dVoMapper
.
incrementalCreateImpEqumt
(
null
);
result
+=
node3dVoMapper
.
incrementalUpdateImpEqumt
(
null
)==
null
?
0
:
node3dVoMapper
.
incrementalUpdateImpEqumt
(
null
);
result
+=
node3dVoMapper
.
incrementalDeleteImpEqumt
(
null
)==
null
?
0
:
node3dVoMapper
.
incrementalDeleteImpEqumt
(
null
);
//风险点
result
+=
node3dVoMapper
.
incrementalCreateRiskSource
(
null
)==
null
?
0
:
node3dVoMapper
.
incrementalCreateRiskSource
(
null
);
result
+=
node3dVoMapper
.
incrementalUpdateRiskSource
(
null
,
null
)==
null
?
0
:
node3dVoMapper
.
incrementalUpdateRiskSource
(
null
,
null
);
result
+=
node3dVoMapper
.
incrementalDeleteRiskSource
(
null
)==
null
?
0
:
node3dVoMapper
.
incrementalDeleteRiskSource
(
null
);
//消防车
result
+=
node3dVoMapper
.
incrementalCreateFireCar
(
null
)==
null
?
0
:
node3dVoMapper
.
incrementalCreateFireCar
(
null
);
result
+=
node3dVoMapper
.
incrementalUpdateFireCar
(
null
)==
null
?
0
:
node3dVoMapper
.
incrementalUpdateFireCar
(
null
);
result
+=
node3dVoMapper
.
incrementalDeleteFireCar
(
null
)==
null
?
0
:
node3dVoMapper
.
incrementalDeleteFireCar
(
null
);
//消防室和泡沫间
result
+=
node3dVoMapper
.
incrementalCreateStation
(
null
)==
null
?
0
:
node3dVoMapper
.
incrementalCreateStation
(
null
);
result
+=
node3dVoMapper
.
incrementalUpdateStation
(
null
)==
null
?
0
:
node3dVoMapper
.
incrementalUpdateStation
(
null
);
result
+=
node3dVoMapper
.
incrementalDeleteStation
(
null
)==
null
?
0
:
node3dVoMapper
.
incrementalDeleteStation
(
null
);
//水资源
result
+=
node3dVoMapper
.
incrementalCreateWater
(
null
)==
null
?
0
:
node3dVoMapper
.
incrementalCreateWater
(
null
);
result
+=
node3dVoMapper
.
incrementalUpdateWater
(
null
)==
null
?
0
:
node3dVoMapper
.
incrementalUpdateWater
(
null
);
result
+=
node3dVoMapper
.
incrementalDeleteWater
(
null
)==
null
?
0
:
node3dVoMapper
.
incrementalDeleteWater
(
null
);
return
result
;
}
@Override
public
Integer
updateByRiskSourceId
(
Long
riskSourceId
,
Integer
frequency
)
{
Integer
result
=
0
;
result
=
node3dVoMapper
.
incrementalUpdateRiskSource
(
riskSourceId
,
frequency
);
return
result
;
}
@Async
@Override
public
Integer
syncData
(
Callable
<
Integer
>
callable
)
throws
Exception
{
return
callable
.
call
();
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/RiskSourceServiceImpl.java
View file @
d82d8697
...
@@ -20,7 +20,10 @@ import com.yeejoin.amos.fas.business.jpush.PushMsgParam;
...
@@ -20,7 +20,10 @@ import com.yeejoin.amos.fas.business.jpush.PushMsgParam;
import
com.yeejoin.amos.fas.business.param.AlarmParam
;
import
com.yeejoin.amos.fas.business.param.AlarmParam
;
import
com.yeejoin.amos.fas.business.param.CommonPageInfoParam
;
import
com.yeejoin.amos.fas.business.param.CommonPageInfoParam
;
import
com.yeejoin.amos.fas.business.param.FmeaBindParam
;
import
com.yeejoin.amos.fas.business.param.FmeaBindParam
;
import
com.yeejoin.amos.fas.business.service.intfc.*
;
import
com.yeejoin.amos.fas.business.service.intfc.IContingencyInstance
;
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.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.DateUtils
;
import
com.yeejoin.amos.fas.business.util.JexlUtil
;
import
com.yeejoin.amos.fas.business.util.JexlUtil
;
...
@@ -98,9 +101,6 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -98,9 +101,6 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
private
FireEquipMapper
fireEquipMapper
;
private
FireEquipMapper
fireEquipMapper
;
@Autowired
@Autowired
private
Node3dVoService
node3dVoService
;
@Autowired
private
IFireEquipmentDao
iFireEquipmentDao
;
private
IFireEquipmentDao
iFireEquipmentDao
;
@Autowired
@Autowired
...
@@ -193,15 +193,6 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -193,15 +193,6 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
riskSource
.
setStatus
(
oldRiskSource
.
getStatus
());
riskSource
.
setStatus
(
oldRiskSource
.
getStatus
());
}
}
iRiskSourceDao
.
saveAndFlush
(
riskSource
);
iRiskSourceDao
.
saveAndFlush
(
riskSource
);
//同步数据
if
(
id
==
0
)
{
node3dVoService
.
syncData
(()
->
node3dVoService
.
incrementalCreate
(
Node3dVoService
.
DATATYPE_RISKSOURCE
));
}
else
{
node3dVoService
.
syncData
(()
->
node3dVoService
.
incrementalUpdate
(
Node3dVoService
.
DATATYPE_RISKSOURCE
));
iDataRefreshService
.
refreshViewData
(
DataRefreshTypeEum
.
rpn
.
getCode
());
}
return
riskSource
;
return
riskSource
;
}
}
...
@@ -217,12 +208,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -217,12 +208,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
}
iRiskSourceDao
.
deleteById
(
rId
);
iRiskSourceDao
.
deleteById
(
rId
);
}
}
//1.重新计算rpn
//1.同步数据
node3dVoService
.
syncData
(()
->
node3dVoService
.
incrementalRemove
(
Node3dVoService
.
DATATYPE_RISKSOURCE
));
//2.3d屏数据刷新
iDataRefreshService
.
refreshViewData
(
DataRefreshTypeEum
.
rpn
.
getCode
());
//3.重新计算rpn
List
<
Long
>
existIds
=
parentIds
.
stream
().
filter
(
e
->
List
<
Long
>
existIds
=
parentIds
.
stream
().
filter
(
e
->
iRiskSourceDao
.
findById
(
e
).
isPresent
()
iRiskSourceDao
.
findById
(
e
).
isPresent
()
).
collect
(
Collectors
.
toList
());
).
collect
(
Collectors
.
toList
());
...
@@ -1047,7 +1033,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1047,7 +1033,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
BigDecimal
sidValue
=
new
BigDecimal
(
fmea
.
getSidValue
());
BigDecimal
sidValue
=
new
BigDecimal
(
fmea
.
getSidValue
());
BigDecimal
didValue
=
new
BigDecimal
(
fmea
.
getDidValue
());
BigDecimal
didValue
=
new
BigDecimal
(
fmea
.
getDidValue
());
//1.1计算rpni
//1.1计算rpni
BigDecimal
rpni
=
oidValue
.
multiply
(
sidValue
).
multiply
(
didValue
);
BigDecimal
rpni
=
oidValue
.
multiply
(
sidValue
).
multiply
(
didValue
)
.
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
)
;
BigDecimal
rpn
;
BigDecimal
rpn
;
//1.2计算rpn:为空则rpni = rpn;不为空则重新计算s*d*newo
//1.2计算rpn:为空则rpni = rpn;不为空则重新计算s*d*newo
if
(
fmea
.
getNewEvaluationOid
()
==
null
)
{
if
(
fmea
.
getNewEvaluationOid
()
==
null
)
{
...
@@ -1055,7 +1041,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1055,7 +1041,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
rpn
=
rpni
;
rpn
=
rpni
;
}
else
{
}
else
{
BigDecimal
newOidValue
=
new
BigDecimal
(
fmea
.
getNewOidValue
());
BigDecimal
newOidValue
=
new
BigDecimal
(
fmea
.
getNewOidValue
());
rpn
=
newOidValue
.
multiply
(
sidValue
).
multiply
(
didValue
);
rpn
=
newOidValue
.
multiply
(
sidValue
).
multiply
(
didValue
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
;
}
}
List
<
RiskLevel
>
levels
=
riskLevelDao
.
findAll
();
List
<
RiskLevel
>
levels
=
riskLevelDao
.
findAll
();
RiskLevel
newLevel
=
RpnUtils
.
getBetweenLevel
(
rpn
,
levels
);
RiskLevel
newLevel
=
RpnUtils
.
getBetweenLevel
(
rpn
,
levels
);
...
@@ -1129,7 +1116,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1129,7 +1116,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
BigDecimal
newOidValue
=
new
BigDecimal
(
oEvaluationModel
.
getCoefficient
());
BigDecimal
newOidValue
=
new
BigDecimal
(
oEvaluationModel
.
getCoefficient
());
BigDecimal
sidValue
=
new
BigDecimal
(
fmea
.
getSidValue
());
BigDecimal
sidValue
=
new
BigDecimal
(
fmea
.
getSidValue
());
BigDecimal
didValue
=
new
BigDecimal
(
fmea
.
getDidValue
());
BigDecimal
didValue
=
new
BigDecimal
(
fmea
.
getDidValue
());
BigDecimal
rpn
=
newOidValue
.
multiply
(
sidValue
).
multiply
(
didValue
);
BigDecimal
rpn
=
newOidValue
.
multiply
(
sidValue
).
multiply
(
didValue
)
.
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
)
;
List
<
RiskLevel
>
levels
=
riskLevelDao
.
findAll
();
List
<
RiskLevel
>
levels
=
riskLevelDao
.
findAll
();
RiskLevel
newLevel
=
RpnUtils
.
getBetweenLevel
(
rpn
,
levels
);
RiskLevel
newLevel
=
RpnUtils
.
getBetweenLevel
(
rpn
,
levels
);
fmea
.
setRpn
(
rpn
);
fmea
.
setRpn
(
rpn
);
...
@@ -1149,13 +1136,14 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1149,13 +1136,14 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
}
}
}
private
void
saveRpnLog
(
Long
riskSourceId
,
Long
fmeaId
,
BigDecimal
rpn
,
BigDecimal
rpni
)
{
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
);
rpnChangeLog
.
setRpni
(
rpni
);
rpnChangeLog
.
setRpni
(
rpni
);
rpnChangeLog
.
setType
(
RpnUtils
.
getChangeType
(
rpn
,
rpni
));
rpnChangeLog
.
setType
(
RpnUtils
.
getChangeType
(
rpn
,
rpni
));
rpnChangeLog
.
setTriggerBy
(
fmeaId
);
rpnChangeLog
.
setTriggerBy
(
fmeaId
);
rpnChangeLog
.
setTriggerType
(
notifyType
);
rpnChangeLog
.
setFmeaId
(
fmeaId
);
rpnChangeLog
.
setFmeaId
(
fmeaId
);
iRpnChangeLogDao
.
save
(
rpnChangeLog
);
iRpnChangeLogDao
.
save
(
rpnChangeLog
);
}
}
...
@@ -1188,12 +1176,15 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1188,12 +1176,15 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
riskSource
.
setRpn
(
null
);
riskSource
.
setRpn
(
null
);
riskSource
.
setRpni
(
null
);
riskSource
.
setRpni
(
null
);
riskSource
.
setRiskLevelId
(
null
);
riskSource
.
setRiskLevelId
(
null
);
riskSource
.
setFlickerFrequency
(
0
);
//1.更新fmea对应风险点rpn、rpni、level
//1.更新fmea对应风险点rpn、rpni、level
riskSourceMapper
.
updateRpn
(
riskSource
);
riskSourceMapper
.
updateRpn
(
riskSource
);
//2.记录风险点rpn变化流水
//2.记录风险点rpn变化流水
this
.
saveRpnLog
(
riskSource
.
getId
(),
fmeaId
,
resetValue
,
resetValue
);
this
.
saveRpnLog
(
riskSource
.
getId
(),
fmeaId
,
resetValue
,
resetValue
,
notifyType
);
//3.更新父节点rpn、rpni、风险等级
//3.更新父节点rpn、rpni、风险等级
this
.
updateParentRpn
(
riskSource
.
getParentId
());
this
.
updateParentRpn
(
riskSource
.
getParentId
());
//4.知全景监控屏幕数据刷新
iDataRefreshService
.
refreshViewData
(
DataRefreshTypeEum
.
rpn
.
getCode
());
}
else
{
//fmea评价、巡检、告警
}
else
{
//fmea评价、巡检、告警
RpnCalculationBo
rpnValueBo
=
RpnUtils
.
calRpnAndRpni
(
fmeas
);
RpnCalculationBo
rpnValueBo
=
RpnUtils
.
calRpnAndRpni
(
fmeas
);
if
(
rpnValueBo
.
isEmpty
())
{
if
(
rpnValueBo
.
isEmpty
())
{
...
@@ -1208,16 +1199,20 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1208,16 +1199,20 @@ 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
());
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变化流水
this
.
saveRpnLog
(
riskSource
.
getId
(),
fmeaId
,
rpn
,
rpni
);
this
.
saveRpnLog
(
riskSource
.
getId
(),
fmeaId
,
rpn
,
rpni
,
notifyType
);
//3.更新父节点rpn、rpni、风险等级
//3.更新父节点rpn、rpni、风险等级
this
.
updateParentRpn
(
riskSource
.
getParentId
());
this
.
updateParentRpn
(
riskSource
.
getParentId
());
//4.极光推送给手机客户端
//4.极光推送给手机客户端
jpushRiskSourceMessage
(
"风险预警"
,
jpushTargets
);
jpushRiskSourceMessage
(
"风险预警"
,
jpushTargets
);
//5.规则告警(消息)TODO
//5.规则告警(消息)TODO
notifyRule
(
riskSourceId
,
rpn
,
rpni
,
oldRiskLevel
.
getLevel
(),
newRiskLevel
.
getLevel
(),
notifyType
);
notifyRule
(
riskSourceId
,
rpn
,
rpni
,
notifyType
,
changeType
);
//6.通知全景监控屏幕数据刷新
iDataRefreshService
.
refreshViewData
(
DataRefreshTypeEum
.
rpn
.
getCode
());
}
}
}
}
}
}
...
@@ -1232,6 +1227,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1232,6 +1227,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
public
void
notifyRiskSourceDelete
(
Long
parentId
)
{
public
void
notifyRiskSourceDelete
(
Long
parentId
)
{
//1.风险点删除触发更新父节点rpn、rpni、风险等级
//1.风险点删除触发更新父节点rpn、rpni、风险等级
this
.
updateParentRpn
(
parentId
);
this
.
updateParentRpn
(
parentId
);
//2.通知全景监控屏幕数据刷新
iDataRefreshService
.
refreshViewData
(
DataRefreshTypeEum
.
rpn
.
getCode
());
}
}
private
void
updateParentRpn
(
long
parentId
)
{
private
void
updateParentRpn
(
long
parentId
)
{
...
@@ -1289,7 +1286,6 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1289,7 +1286,6 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
ids
.
add
(
riskSource
.
getId
());
ids
.
add
(
riskSource
.
getId
());
}
}
}
}
iDataRefreshService
.
refreshViewData
(
DataRefreshTypeEum
.
rpn
.
getCode
());
}
}
/**
/**
...
@@ -1310,31 +1306,18 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1310,31 +1306,18 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
/**
/**
* 规则告警
* 规则告警
*/
*/
private
void
notifyRule
(
Long
id
,
BigDecimal
rpnr
,
BigDecimal
rpni
,
Integer
oldLevel
,
Integer
newLevel
,
String
private
void
notifyRule
(
notifyType
)
{
Long
id
,
int
level
=
oldLevel
-
newLevel
;
BigDecimal
rpnr
,
String
changeType
;
BigDecimal
rpni
,
if
(
level
>
0
)
{
String
notifyType
,
changeType
=
"up"
;
String
changeType
)
{
}
else
if
(
level
==
0
)
{
changeType
=
"no"
;
}
else
{
changeType
=
"down"
;
}
RiskSourceRuleRo
riskSourceRuleRo
=
new
RiskSourceRuleRo
();
RiskSourceRuleRo
riskSourceRuleRo
=
new
RiskSourceRuleRo
();
riskSourceRuleRo
.
setId
(
id
);
riskSourceRuleRo
.
setId
(
id
);
riskSourceRuleRo
.
setRpnr
(
rpnr
);
riskSourceRuleRo
.
setRpnr
(
rpnr
);
riskSourceRuleRo
.
setRpni
(
rpni
);
riskSourceRuleRo
.
setRpni
(
rpni
);
riskSourceRuleRo
.
setLevelChangeType
(
changeType
);
riskSourceRuleRo
.
setLevelChangeType
(
changeType
);
riskSourceRuleRo
.
setNotifyType
(
notifyType
);
riskSourceRuleRo
.
setNotifyType
(
notifyType
);
BigDecimal
rg
=
rpnr
.
subtract
(
rpni
);
int
frequency
=
0
;
if
(
"up"
.
equals
(
changeType
)
&&
rg
.
intValue
()
>
0
)
{
frequency
=
3
;
}
else
if
(
"no"
.
equals
(
changeType
)
&&
rg
.
intValue
()
>
0
)
{
frequency
=
1
;
}
node3dVoService
.
updateByRiskSourceId
(
riskSourceRuleRo
.
getId
(),
frequency
);
try
{
try
{
remoteRuleServer
.
fireRule
(
riskSourceRuleRo
,
"风险管控/riskSource"
);
remoteRuleServer
.
fireRule
(
riskSourceRuleRo
,
"风险管控/riskSource"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/WaterResourceServiceImpl.java
View file @
d82d8697
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
impl
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.stereotype.Service
;
import
com.yeejoin.amos.fas.business.dao.mapper.Node3dVoMapper
;
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.IWaterResourceDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IWaterResourceDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IWaterResourceEquipmentDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IWaterResourceEquipmentDao
;
...
@@ -19,6 +8,15 @@ import com.yeejoin.amos.fas.core.common.request.CommonPageable;
...
@@ -19,6 +8,15 @@ import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import
com.yeejoin.amos.fas.core.util.StringUtil
;
import
com.yeejoin.amos.fas.core.util.StringUtil
;
import
com.yeejoin.amos.fas.dao.entity.WaterResource
;
import
com.yeejoin.amos.fas.dao.entity.WaterResource
;
import
com.yeejoin.amos.fas.dao.entity.WaterResourceEquipment
;
import
com.yeejoin.amos.fas.dao.entity.WaterResourceEquipment
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
@Service
(
"waterResourceService"
)
@Service
(
"waterResourceService"
)
public
class
WaterResourceServiceImpl
implements
IWaterResourceService
{
public
class
WaterResourceServiceImpl
implements
IWaterResourceService
{
...
@@ -33,20 +31,12 @@ public class WaterResourceServiceImpl implements IWaterResourceService {
...
@@ -33,20 +31,12 @@ public class WaterResourceServiceImpl implements IWaterResourceService {
@Autowired
@Autowired
IWaterResourceEquipmentDao
iWaterResourceEquipmentDao
;
IWaterResourceEquipmentDao
iWaterResourceEquipmentDao
;
@Autowired
Node3dVoMapper
node3dVoMapper
;
@Override
public
WaterResource
save
(
WaterResource
waterResource
)
public
WaterResource
save
(
WaterResource
waterResource
)
{
{
Long
id
=
waterResource
.
getId
();
Long
id
=
waterResource
.
getId
();
waterResource
=
iWaterResourceDao
.
saveAndFlush
(
waterResource
);
waterResource
=
iWaterResourceDao
.
saveAndFlush
(
waterResource
);
if
(
id
==
null
||
id
==
0
){
node3dVoMapper
.
incrementalCreateWater
(
waterResource
.
getId
());
}
else
{
node3dVoMapper
.
incrementalUpdateWater
(
id
);
}
return
waterResource
;
return
waterResource
;
}
}
...
@@ -68,7 +58,6 @@ public class WaterResourceServiceImpl implements IWaterResourceService {
...
@@ -68,7 +58,6 @@ public class WaterResourceServiceImpl implements IWaterResourceService {
if
(
waterResource
!=
null
)
if
(
waterResource
!=
null
)
{
{
this
.
iWaterResourceDao
.
deleteById
(
Long
.
parseLong
(
id
));
this
.
iWaterResourceDao
.
deleteById
(
Long
.
parseLong
(
id
));
node3dVoMapper
.
incrementalDeleteWater
(
Long
.
parseLong
(
id
));
}
else
}
else
{
{
throw
new
Exception
(
"找不到指定的监测点:"
+
id
);
throw
new
Exception
(
"找不到指定的监测点:"
+
id
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/Node3dVoService.java
deleted
100644 → 0
View file @
84e09ca1
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
intfc
;
import
java.util.concurrent.Callable
;
public
interface
Node3dVoService
{
String
DATATYPE_RISKSOURCE
=
"RISKSOURCE"
;
//数据类型-风险点
String
DATATYPE_FIREEQUMT
=
"FIREEQUMT"
;
//数据类型-消防设备
String
DATATYPE_IMPEQUMT
=
"IMPEQUMT"
;
//数据类型-重点设备
String
DATATYPE_FIRECAR
=
"FIRECAR"
;
//数据类型-消防车
String
DATATYPE_STATION
=
"STATION"
;
//数据类型-消防室和泡沫间
String
DATATYPE_WATER
=
"WATER"
;
//数据类型-水资源
/**
* 同步新增的3d数据
* @param dataType
* @return
*/
Integer
incrementalCreate
(
String
dataType
);
/**
* 同步已经删除的的3d数据
* @param dataType
* @return
*/
Integer
incrementalRemove
(
String
dataType
);
/**
* 同步需要更新的的3d数据
* @param dataType
* @return
*/
Integer
incrementalUpdate
(
String
dataType
);
/**
* 同步指定数据类型,新增,删除,更新
* @param dataType
* @return
*/
Integer
incrementalDataType
(
String
dataType
);
/**
* 对所有数据类型进行同步,新增,更新,删除
* @return
*/
Integer
wholeIncremental
();
Integer
updateByRiskSourceId
(
Long
riskSourceId
,
Integer
frequency
);
Integer
syncData
(
Callable
<
Integer
>
callable
)
throws
Exception
;
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/util/RpnUtils.java
View file @
d82d8697
...
@@ -17,10 +17,11 @@ import java.util.List;
...
@@ -17,10 +17,11 @@ import java.util.List;
public
class
RpnUtils
{
public
class
RpnUtils
{
/**
/**
* 计算风险值
* 计算风险值
*
* @param fmeas
* @param fmeas
* @return RpnCalculationBo
* @return RpnCalculationBo
*/
*/
public
static
RpnCalculationBo
calRpnAndRpni
(
List
<
Fmea
>
fmeas
){
public
static
RpnCalculationBo
calRpnAndRpni
(
List
<
Fmea
>
fmeas
)
{
BigDecimal
maxSidValue
=
new
BigDecimal
(
"0"
);
BigDecimal
maxSidValue
=
new
BigDecimal
(
"0"
);
BigDecimal
maxDidValue
=
new
BigDecimal
(
"0"
);
BigDecimal
maxDidValue
=
new
BigDecimal
(
"0"
);
BigDecimal
totalOidValue
=
new
BigDecimal
(
"0"
);
BigDecimal
totalOidValue
=
new
BigDecimal
(
"0"
);
...
@@ -48,10 +49,10 @@ public class RpnUtils {
...
@@ -48,10 +49,10 @@ public class RpnUtils {
if
(
count
==
0
)
{
if
(
count
==
0
)
{
return
rpnValue
;
return
rpnValue
;
}
}
BigDecimal
averageOidValue
=
totalOidValue
.
divide
(
BigDecimal
.
valueOf
(
count
),
2
,
BigDecimal
.
ROUND_HALF_UP
);
BigDecimal
averageOidValue
=
totalOidValue
.
divide
(
BigDecimal
.
valueOf
(
count
),
2
,
BigDecimal
.
ROUND_HALF_UP
);
BigDecimal
averageNewOidValue
=
totalNewOidValue
.
divide
(
BigDecimal
.
valueOf
(
count
),
2
,
BigDecimal
.
ROUND_HALF_UP
);
BigDecimal
averageNewOidValue
=
totalNewOidValue
.
divide
(
BigDecimal
.
valueOf
(
count
),
2
,
BigDecimal
.
ROUND_HALF_UP
);
BigDecimal
rpn
=
maxDidValue
.
multiply
(
maxSidValue
).
multiply
(
averageNewOidValue
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
BigDecimal
rpn
=
maxDidValue
.
multiply
(
maxSidValue
).
multiply
(
averageNewOidValue
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
BigDecimal
rpni
=
maxDidValue
.
multiply
(
maxSidValue
).
multiply
(
averageOidValue
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
BigDecimal
rpni
=
maxDidValue
.
multiply
(
maxSidValue
).
multiply
(
averageOidValue
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
rpnValue
.
setRpn
(
rpn
);
rpnValue
.
setRpn
(
rpn
);
rpnValue
.
setRpni
(
rpni
);
rpnValue
.
setRpni
(
rpni
);
return
rpnValue
;
return
rpnValue
;
...
@@ -59,6 +60,7 @@ public class RpnUtils {
...
@@ -59,6 +60,7 @@ public class RpnUtils {
/**
/**
* 计算最大故障率
* 计算最大故障率
*
* @param equipmentPoints
* @param equipmentPoints
* @param pointInputitems
* @param pointInputitems
* @return
* @return
...
@@ -107,6 +109,7 @@ public class RpnUtils {
...
@@ -107,6 +109,7 @@ public class RpnUtils {
/**
/**
* 获得风险等级
* 获得风险等级
*
* @param rpni
* @param rpni
* @param levels
* @param levels
* @return
* @return
...
@@ -127,18 +130,56 @@ public class RpnUtils {
...
@@ -127,18 +130,56 @@ public class RpnUtils {
/**
/**
* 获取风险变化类型
* 获取风险变化类型
* @param rpn
*
* @param rpni
* @param rpn 实时
* @return
* @param rpni 固有
* @return int
*/
*/
public
static
int
getChangeType
(
BigDecimal
rpn
,
BigDecimal
rpni
)
{
public
static
int
getChangeType
(
BigDecimal
rpn
,
BigDecimal
rpni
)
{
if
(
rpn
.
subtract
(
rpni
).
doubleValue
()
>
0
)
{
if
(
rpn
.
subtract
(
rpni
).
doubleValue
()
>
0
)
{
return
RpnChangeLogTypeEum
.
upper
.
getCode
();
return
RpnChangeLogTypeEum
.
upper
.
getCode
();
}
else
if
(
rpn
.
subtract
(
rpni
).
doubleValue
()
<
0
)
{
}
else
if
(
rpn
.
subtract
(
rpni
).
doubleValue
()
<
0
)
{
return
RpnChangeLogTypeEum
.
down
.
getCode
();
return
RpnChangeLogTypeEum
.
down
.
getCode
();
}
else
{
}
else
{
return
RpnChangeLogTypeEum
.
unChange
.
getCode
();
return
RpnChangeLogTypeEum
.
unChange
.
getCode
();
}
}
}
}
/**
* 计算变化类型
* @param oldLevel 原有等级
* @param newLevel 现有等级
* @return up、no、down
*/
public
static
String
calChangeTypeByLevel
(
Integer
oldLevel
,
Integer
newLevel
){
int
level
=
oldLevel
-
newLevel
;
String
changeType
;
if
(
level
>
0
)
{
changeType
=
"up"
;
}
else
if
(
level
==
0
)
{
changeType
=
"no"
;
}
else
{
changeType
=
"down"
;
}
return
changeType
;
}
/**
* 计算闪烁频率
* @param rpnr 实时
* @param rpni 固有
* @param changeType 变化类型
* @return int
*/
public
static
int
calRiskPointFrequency
(
BigDecimal
rpnr
,
BigDecimal
rpni
,
String
changeType
)
{
BigDecimal
rg
=
rpnr
.
subtract
(
rpni
);
int
frequency
=
0
;
if
(
"up"
.
equals
(
changeType
)
&&
rg
.
intValue
()
>
0
)
{
frequency
=
3
;
}
else
if
(
"no"
.
equals
(
changeType
)
&&
rg
.
intValue
()
>
0
)
{
frequency
=
1
;
}
return
frequency
;
}
}
}
YeeAmosFireAutoSysStart/src/main/resources/db/changelog/fas-2.0.1.xml
View file @
d82d8697
...
@@ -206,7 +206,9 @@
...
@@ -206,7 +206,9 @@
</changeSet>
</changeSet>
<changeSet
author=
"suhuiguang"
id=
"1588990926789-1"
>
<changeSet
author=
"suhuiguang"
id=
"1588990926789-1"
>
<preConditions
onFail=
"MARK_RAN"
>
<preConditions
onFail=
"MARK_RAN"
>
<columnExists
tableName=
"f_risk_level "
columnName=
"manage_level"
/>
<not>
<columnExists
tableName=
"f_risk_level "
columnName=
"manage_level"
/>
</not>
</preConditions>
</preConditions>
<comment>
f_risk_level add column manage_level 管控级别
</comment>
<comment>
f_risk_level add column manage_level 管控级别
</comment>
<sql>
<sql>
...
@@ -214,4 +216,28 @@
...
@@ -214,4 +216,28 @@
add COLUMN `manage_level` tinyint(4) DEFAULT NULL COMMENT '管控级别';
add COLUMN `manage_level` tinyint(4) DEFAULT NULL COMMENT '管控级别';
</sql>
</sql>
</changeSet>
</changeSet>
<changeSet
author=
"suhuiguang"
id=
"1589165258908-1"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"f_rpn_change_log "
columnName=
"trigger_type"
/>
</not>
</preConditions>
<comment>
f_rpn_change_log add column trigger_type 触发类型
</comment>
<sql>
ALTER TABLE `f_rpn_change_log`
add COLUMN `trigger_type` varchar(20) DEFAULT NULL COMMENT '触发类型:巡检、告警、评价、删除' after `trigger_by`;
</sql>
</changeSet>
<changeSet
author=
"suhuiguang"
id=
"1589165258908-2"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"f_risk_source "
columnName=
"flicker_frequency"
/>
</not>
</preConditions>
<comment>
f_risk_source add column flicker_frequency 闪烁频率
</comment>
<sql>
ALTER TABLE `f_risk_source`
add COLUMN `flicker_frequency` int(11) DEFAULT 0 COMMENT '闪烁频率' after `status`;
</sql>
</changeSet>
</databaseChangeLog>
</databaseChangeLog>
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/db/changelog/fas-sql-task.xml
View file @
d82d8697
...
@@ -81,24 +81,6 @@
...
@@ -81,24 +81,6 @@
</sql>
</sql>
</changeSet>
</changeSet>
<changeSet
author=
"lierwei"
id=
"1561717968-1"
runOnChange=
"true"
>
<comment>
f_risk_source 触发器创建
</comment>
<sql
endDelimiter=
"#"
>
DROP TRIGGER IF EXISTS `trigger_risk_source_status_update`;
CREATE TRIGGER `trigger_risk_source_status_update` AFTER UPDATE ON `f_risk_source` FOR EACH ROW BEGIN
IF NEW.status = 'NORMAL' THEN
UPDATE toip_biz_node3dvo SET `node_state` = 'NORMAL' WHERE type = 'riskSource' and oid = NEW.id;
END IF;
IF NEW.status = null or NEW.status = '' THEN
UPDATE toip_biz_node3dvo SET `node_state` = 'NORMAL' WHERE type = 'riskSource' and oid = NEW.id;
END IF;
IF NEW.status = 'ANOMALY' THEN
UPDATE toip_biz_node3dvo SET `node_state` = NEW.rpni WHERE type = 'riskSource' and oid = NEW.id;
END IF;
END#
</sql>
</changeSet>
<changeSet
author=
"tianbo"
id=
"1561717770000-1"
runOnChange=
"true"
>
<changeSet
author=
"tianbo"
id=
"1561717770000-1"
runOnChange=
"true"
>
<comment>
f_fire_equipment_point_update 触发器创建(修改判断条件为->value等于'true')
</comment>
<comment>
f_fire_equipment_point_update 触发器创建(修改判断条件为->value等于'true')
</comment>
<sql
endDelimiter=
"#"
>
<sql
endDelimiter=
"#"
>
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_node3d.xml
deleted
100644 → 0
View file @
84e09ca1
This diff is collapsed.
Click to expand it.
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_risk_source.xml
View file @
d82d8697
...
@@ -672,6 +672,9 @@
...
@@ -672,6 +672,9 @@
<if
test=
"riskLevelId != null"
>
<if
test=
"riskLevelId != null"
>
risk_level_id = #{riskLevelId},
risk_level_id = #{riskLevelId},
</if>
</if>
<if
test=
"flicker_frequency != null"
>
flicker_frequency = #{flicker_frequency}
</if>
</set>
</set>
where id = #{id}
where id = #{id}
</update>
</update>
...
...
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