Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
a69416f5
Commit
a69416f5
authored
Jul 26, 2022
by
tianyiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
3小屏接口开发:包含(系统名称、系统工作状态、近一月top5、设备状态、水源信息)
parent
9ea52de8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
469 additions
and
92 deletions
+469
-92
ConfigureController.java
...m/yeejoin/equipmanage/controller/ConfigureController.java
+124
-2
FireFightingSystemMapper.java
.../yeejoin/equipmanage/mapper/FireFightingSystemMapper.java
+102
-56
IFireFightingSystemService.java
...ejoin/equipmanage/service/IFireFightingSystemService.java
+12
-0
FireFightingSystemServiceImpl.java
...uipmanage/service/impl/FireFightingSystemServiceImpl.java
+85
-20
FireFightingSystemMapper.xml
...ip/src/main/resources/mapper/FireFightingSystemMapper.xml
+146
-14
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/ConfigureController.java
View file @
a69416f5
...
...
@@ -5,6 +5,7 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import
com.yeejoin.equipmanage.common.utils.*
;
import
com.yeejoin.equipmanage.mapper.FireFightingSystemMapper
;
import
com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmService
;
import
com.yeejoin.equipmanage.service.IFireFightingSystemService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -33,6 +34,9 @@ public class ConfigureController extends AbstractBaseController {
@Autowired
private
IEquipmentSpecificAlarmService
equipmentSpecificAlarmService
;
@Autowired
private
IFireFightingSystemService
iFireFightingSystemService
;
@RequestMapping
(
value
=
"/alarmLogPage"
,
method
=
RequestMethod
.
GET
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表分页查询"
,
produces
=
"application/json;charset=UTF-8"
,
notes
=
"列表分页查询"
)
...
...
@@ -161,12 +165,130 @@ public class ConfigureController extends AbstractBaseController {
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"
3小
水源信息"
)
@ApiOperation
(
value
=
"
概览
水源信息"
)
@GetMapping
(
"/getWaterInfo"
)
public
ResponseModel
getWaterInfo
()
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
bizOrgCode
=
!
ValidationUtil
.
isEmpty
(
reginParams
.
getPersonIdentity
())
&&
StringUtil
.
isNotEmpty
(
reginParams
.
getPersonIdentity
().
getBizOrgCode
())
?
reginParams
.
getPersonIdentity
().
getBizOrgCode
()
:
null
;
return
CommonResponseUtil
.
success
(
fireFightingSystemMapper
.
getWaterInfo
(
bizOrgCode
));
return
CommonResponseUtil
.
success
(
fireFightingSystemMapper
.
getWaterInfo
(
bizOrgCode
,
null
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"3小水源信息"
)
@GetMapping
(
"/getSmallWaterInfo"
)
public
ResponseModel
getSmallWaterInfo
(
@RequestParam
(
required
=
false
)
String
systemCode
)
{
HashMap
<
String
,
Object
>
hashMap
=
new
HashMap
<>();
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
.
PersonIdentity
personIdentity
=
reginParams
.
getPersonIdentity
();
if
(!
ValidationUtil
.
isEmpty
(
personIdentity
))
{
String
bizOrgCode
=
personIdentity
.
getBizOrgCode
();
if
(
StringUtils
.
isNotBlank
(
bizOrgCode
))
{
hashMap
.
put
(
"bizOrgCode"
,
bizOrgCode
);
}
if
(
bizOrgCode
==
null
)
{
return
CommonResponseUtil
.
success
(
null
);
}
}
if
(
StringUtils
.
isNotBlank
(
systemCode
))
{
hashMap
.
put
(
"systemCode"
,
systemCode
);
}
return
CommonResponseUtil
.
success
(
iFireFightingSystemService
.
getSmallWaterInfo
(
hashMap
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
value
=
"获取系统名称(根据系统编码查询)"
)
@GetMapping
(
"/getSystemName"
)
public
ResponseModel
getEquipSystemName
(
@RequestParam
(
required
=
false
)
String
systemCode
)
{
HashMap
<
String
,
Object
>
hashMap
=
new
HashMap
<>();
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
.
PersonIdentity
personIdentity
=
reginParams
.
getPersonIdentity
();
if
(!
ValidationUtil
.
isEmpty
(
personIdentity
))
{
String
bizOrgCode
=
personIdentity
.
getBizOrgCode
();
if
(
StringUtils
.
isNotBlank
(
bizOrgCode
))
{
hashMap
.
put
(
"bizOrgCode"
,
bizOrgCode
);
}
if
(
bizOrgCode
==
null
)
{
return
CommonResponseUtil
.
success
(
null
);
}
}
if
(
StringUtils
.
isNotBlank
(
systemCode
))
{
hashMap
.
put
(
"systemCode"
,
systemCode
);
}
return
CommonResponseUtil
.
success
(
iFireFightingSystemService
.
getSystemName
(
hashMap
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
value
=
"获取系统工作状态(根据系统编码查询)"
)
@GetMapping
(
"/getSystemStatus"
)
public
ResponseModel
getEquipSystemStatus
(
@RequestParam
(
required
=
false
)
String
systemCode
)
{
HashMap
<
String
,
Object
>
hashMap
=
new
HashMap
<>();
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
.
PersonIdentity
personIdentity
=
reginParams
.
getPersonIdentity
();
if
(!
ValidationUtil
.
isEmpty
(
personIdentity
))
{
String
bizOrgCode
=
personIdentity
.
getBizOrgCode
();
if
(
StringUtils
.
isNotBlank
(
bizOrgCode
))
{
hashMap
.
put
(
"bizOrgCode"
,
bizOrgCode
);
}
if
(
bizOrgCode
==
null
)
{
return
CommonResponseUtil
.
success
(
null
);
}
}
if
(
StringUtils
.
isNotBlank
(
systemCode
))
{
hashMap
.
put
(
"systemCode"
,
systemCode
);
}
return
CommonResponseUtil
.
success
(
iFireFightingSystemService
.
getSystemStatus
(
hashMap
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"获取系统近一月告警设备top5(根据系统编码查询)"
)
@GetMapping
(
"/getAlarmOneMonth"
)
public
ResponseModel
getSpecificAlarmOneMonthTOP
(
@RequestParam
(
required
=
false
)
String
systemCode
)
{
HashMap
<
String
,
Object
>
hashMap
=
new
HashMap
<>();
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
.
PersonIdentity
personIdentity
=
reginParams
.
getPersonIdentity
();
if
(!
ValidationUtil
.
isEmpty
(
personIdentity
))
{
String
bizOrgCode
=
personIdentity
.
getBizOrgCode
();
if
(
StringUtils
.
isNotBlank
(
bizOrgCode
))
{
hashMap
.
put
(
"bizOrgCode"
,
bizOrgCode
);
}
if
(
bizOrgCode
==
null
)
{
return
CommonResponseUtil
.
success
(
null
);
}
}
if
(
StringUtils
.
isNotBlank
(
systemCode
))
{
hashMap
.
put
(
"systemCode"
,
systemCode
);
}
return
CommonResponseUtil
.
success
(
iFireFightingSystemService
.
equipAlarmTOP
(
hashMap
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"获取系统设备状态(根据系统编码查询)"
)
@GetMapping
(
"/getEquipmentState"
)
public
ResponseModel
getEquipmentState
(
@RequestParam
(
required
=
false
)
String
systemCode
,
CommonPageable
commonPageable
)
{
if
(
commonPageable
.
getPageNumber
()
==
0
)
{
commonPageable
.
setPageNumber
(
1
);
}
Page
result
=
new
Page
<>(
commonPageable
.
getPageNumber
(),
commonPageable
.
getPageSize
());
HashMap
<
String
,
Object
>
hashMap
=
new
HashMap
<>();
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
.
PersonIdentity
personIdentity
=
reginParams
.
getPersonIdentity
();
if
(!
ValidationUtil
.
isEmpty
(
personIdentity
))
{
String
bizOrgCode
=
personIdentity
.
getBizOrgCode
();
if
(
StringUtils
.
isNotBlank
(
bizOrgCode
))
{
hashMap
.
put
(
"bizOrgCode"
,
bizOrgCode
);
}
if
(
bizOrgCode
==
null
)
{
return
CommonResponseUtil
.
success
(
null
);
}
}
if
(
StringUtils
.
isNotBlank
(
systemCode
))
{
hashMap
.
put
(
"systemCode"
,
systemCode
);
}
return
CommonResponseUtil
.
success
(
iFireFightingSystemService
.
equipmentState
(
result
,
hashMap
));
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/FireFightingSystemMapper.java
View file @
a69416f5
...
...
@@ -10,6 +10,7 @@ import com.yeejoin.equipmanage.common.entity.vo.*;
import
com.yeejoin.equipmanage.common.vo.*
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -76,9 +77,9 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
*
* @return
*/
List
<
PointTreeVo
>
getPointData
(
@Param
(
"id"
)
String
id
,
@Param
(
"instanceId"
)
String
instanceId
);
List
<
PointTreeVo
>
getPointData
(
@Param
(
"id"
)
String
id
,
@Param
(
"instanceId"
)
String
instanceId
);
List
<
PointTreeVo
>
getPointDataNew
(
@Param
(
"id"
)
String
id
,
@Param
(
"instanceId"
)
String
instanceId
,
@Param
(
"displayName"
)
String
displayName
);
List
<
PointTreeVo
>
getPointDataNew
(
@Param
(
"id"
)
String
id
,
@Param
(
"instanceId"
)
String
instanceId
,
@Param
(
"displayName"
)
String
displayName
);
List
<
PointTreeVo
>
getPointDataNum
(
@Param
(
"id"
)
String
id
);
...
...
@@ -105,37 +106,35 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
*/
List
<
AlarmDataVO
>
getSystemById
(
Long
id
);
IPage
<
EquipmentAlarmBySystemIdOrSourceIdVO
>
getEquipmentAlarmBySystemIdOrSourceIdVO
(
@Param
(
"page"
)
IPage
<
EquipmentAlarmBySystemIdOrSourceIdVO
>
page
,
@Param
(
"sourceId"
)
Long
sourceId
,
@Param
(
"systemId"
)
Long
systemId
,
@Param
(
"confirmType"
)
Integer
confirmType
,
@Param
(
"createDate"
)
String
createDate
,
@Param
(
"type"
)
String
type
);
IPage
<
EquipmentAlarmBySystemIdOrSourceIdVO
>
getEquipmentAlarmBySystemIdOrSourceIdVO
(
@Param
(
"page"
)
IPage
<
EquipmentAlarmBySystemIdOrSourceIdVO
>
page
,
@Param
(
"sourceId"
)
Long
sourceId
,
@Param
(
"systemId"
)
Long
systemId
,
@Param
(
"confirmType"
)
Integer
confirmType
,
@Param
(
"createDate"
)
String
createDate
,
@Param
(
"type"
)
String
type
);
IPage
<
EquipTypeImgAmountVO
>
getColaCategoryAmountList
(
@Param
(
"page"
)
IPage
page
,
@Param
(
"hierarchy"
)
int
hierarchy
,
@Param
(
"codeHead"
)
String
codeHead
,
@Param
(
"equipTypeAmountPage"
)
EquipTypeAmountPageDTO
equipTypeAmountPage
);
IPage
<
EquipTypeImgAmountVO
>
getColaCategoryAmountListIot
(
@Param
(
"page"
)
IPage
page
,
@Param
(
"hierarchy"
)
int
hierarchy
,
@Param
(
"codeHead"
)
String
codeHead
,
@Param
(
"equipTypeAmountPage"
)
EquipTypeAmountPageDTO
equipTypeAmountPage
);
IPage
<
EquipTypeImgAmountVO
>
getColaCategoryAmountCarList
(
@Param
(
"page"
)
IPage
page
,
@Param
(
"hierarchy"
)
int
hierarchy
,
@Param
(
"codeHead"
)
String
codeHead
,
@Param
(
"equipTypeAmountPage"
)
EquipTypeAmountPageDTO
equipTypeAmountPage
);
IPage
<
EquipTypeImgAmountVO
>
getColaCategoryAmountList
(
@Param
(
"page"
)
IPage
page
,
@Param
(
"hierarchy"
)
int
hierarchy
,
@Param
(
"codeHead"
)
String
codeHead
,
@Param
(
"equipTypeAmountPage"
)
EquipTypeAmountPageDTO
equipTypeAmountPage
);
IPage
<
EquipTypeImgAmountVO
>
getColaCategoryAmount
EquList
(
@Param
(
"page"
)
IPage
page
,
@Param
(
"hierarchy"
)
int
hierarchy
,
@Param
(
"codeHead"
)
String
codeHead
,
@Param
(
"equipTypeAmountPage"
)
EquipTypeAmountPageDTO
equipTypeAmountPage
);
IPage
<
EquipTypeImgAmountVO
>
getColaCategoryAmount
ListIot
(
@Param
(
"page"
)
IPage
page
,
@Param
(
"hierarchy"
)
int
hierarchy
,
@Param
(
"codeHead"
)
String
codeHead
,
@Param
(
"equipTypeAmountPage"
)
EquipTypeAmountPageDTO
equipTypeAmountPage
);
IPage
<
EquipTypeImgAmountVO
>
getColaCategoryAmountCarList
(
@Param
(
"page"
)
IPage
page
,
@Param
(
"hierarchy"
)
int
hierarchy
,
@Param
(
"codeHead"
)
String
codeHead
,
@Param
(
"equipTypeAmountPage"
)
EquipTypeAmountPageDTO
equipTypeAmountPage
);
IPage
<
EquipTypeImgAmountVO
>
getColaCategoryAmountEquList
(
@Param
(
"page"
)
IPage
page
,
@Param
(
"hierarchy"
)
int
hierarchy
,
@Param
(
"codeHead"
)
String
codeHead
,
@Param
(
"equipTypeAmountPage"
)
EquipTypeAmountPageDTO
equipTypeAmountPage
);
List
<
FireFightingSystem
>
getFireFightingSystemDetail
(
@Param
(
"fireFightingSystemVo"
)
FireFightingSystemVo
fireFightingSystemVo
);
List
<
FireFightingSystem
>
getFireFightingSystemDetail
(
@Param
(
"fireFightingSystemVo"
)
FireFightingSystemVo
fireFightingSystemVo
);
List
<
FireFightingSystemEntity
>
getFightingSysByCodes
(
@Param
(
"ids"
)
String
[]
idsArr
);
...
...
@@ -144,13 +143,12 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
List
<
FireFightingSystem3dVo
>
get3dFightingSystemList
(
@Param
(
"list"
)
List
<
String
>
collect
);
List
<
SpeIndexVo
>
getSpeIndexIn
(
@Param
(
"list"
)
List
<
Long
>
idList
);
Map
<
String
,
Object
>
getFireSystemState
();
Map
<
String
,
Object
>
getFireOnlSystem
();
Map
<
String
,
Object
>
getFireOnlSystemThreeSmall
();
Map
<
String
,
Object
>
getFireCafsSystem
();
...
...
@@ -162,77 +160,87 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
Map
<
String
,
Object
>
getFireAcsSystem
();
Map
<
String
,
Object
>
getFireFhsSystem
();
Map
<
String
,
Object
>
getTodayConfirmAlarmInfo
();
Map
<
String
,
Object
>
getPoolInfo
();
FireFightingSystemVo
getFightingSysInfo
(
@Param
(
"code"
)
String
code
,
@Param
(
"id"
)
Long
id
);
/**
* 火灾报警系统3小 ,装备定义数量
* @return Map<String,Object>
*
* @return Map<String, Object>
*/
Map
<
String
,
Object
>
fireAlarmSysEquipmentNumber
();
Map
<
String
,
Object
>
fireAlarmSysEquipmentNumber
();
/**
* 火灾报警系统3小,指标
* @return Map<String,Object>
*
* @return Map<String, Object>
*/
Map
<
String
,
Object
>
fireAlarmSysIndexNumber
();
Map
<
String
,
Object
>
fireAlarmSysIndexNumber
();
/**
* 消防水系统-》12号消防水池
* @return Map<String,Object>
* 消防水系统-》12号消防水池
*
* @return Map<String, Object>
*/
Map
<
String
,
Object
>
fireWaterSysPool
();
Map
<
String
,
Object
>
fireWaterSysPool
();
/**
* 消防水系统-》消防管网
* @return Map<String,Object>
* 消防水系统-》消防管网
*
* @return Map<String, Object>
*/
Map
<
String
,
Object
>
fireWaterSysPipeNetwork
();
Map
<
String
,
Object
>
fireWaterSysPipeNetwork
();
/**
* 消防水系统-》消火栓按钮
* @return Map<String,Object>
*
* @return Map<String, Object>
*/
Map
<
String
,
Object
>
fireWaterSysHydrant
();
Map
<
String
,
Object
>
fireWaterSysHydrant
();
/**
* 消防水系统-》水泵房采集装置
* @return Map<String,Object>
*
* @return Map<String, Object>
*/
Map
<
String
,
Object
>
fireWaterSysCollectingDevice
();
Map
<
String
,
Object
>
fireWaterSysCollectingDevice
();
/**
* 消防水系统-》消防泵、稳压泵,大屏用
* @return Map<String,Object>
*
* @return Map<String, Object>
*/
Map
<
String
,
Object
>
fireWaterSysWaterPump
();
Map
<
String
,
Object
>
fireWaterSysWaterPump
();
/**
* 预混泡沫灭火系统3小
* @return Map<String,Object>
*
* @return Map<String, Object>
*/
Map
<
String
,
Object
>
fireFoamSysEquipmentIndexNumber
();
Map
<
String
,
Object
>
fireFoamSysEquipmentIndexNumber
();
/**
* 其他系统总数及指标数量
* @return Map<String,Object>
*
* @return Map<String, Object>
*/
Map
<
String
,
Object
>
otherSysIndexNumAndTotal
();
Map
<
String
,
Object
>
otherSysIndexNumAndTotal
();
/**
* 预混泡沫灭火系统概览
* @return Map<String,Object>
*
* @return Map<String, Object>
*/
Map
<
String
,
Object
>
fireFoamSysEquipmentNumber
();
Map
<
String
,
Object
>
fireFoamSysEquipmentNumber
();
/**
* 根据bizorgcode获取系统分类数量
*
* @param bizOrgCode
* @return
*/
...
...
@@ -240,6 +248,7 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
/**
* 获取系统告警信息
*
* @param bizOrgCode
* @return
*/
...
...
@@ -247,6 +256,7 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
/**
* 获取设备告警待确认和未处理信息
*
* @param bizOrgCode
* @return
*/
...
...
@@ -254,6 +264,7 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
/**
* 获取消防力量信息(队伍值班等)
*
* @param bizOrgCode
* @return
*/
...
...
@@ -261,6 +272,7 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
/**
* 消防车辆信息
*
* @param bizOrgCode
* @return
*/
...
...
@@ -268,6 +280,7 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
/**
* 物联监控页面消防车辆信息
*
* @param bizOrgCode
* @return
*/
...
...
@@ -275,8 +288,41 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
/**
* 获取水源信息
*
* @param bizOrgCode
* @return
*/
List
<
Map
<
String
,
Object
>>
getWaterInfo
(
@Param
(
"bizOrgCode"
)
String
bizOrgCode
);
List
<
Map
<
String
,
Object
>>
getWaterInfo
(
@Param
(
"bizOrgCode"
)
String
bizOrgCode
,
@Param
(
"systemCode"
)
String
systemCode
);
/**
* 获取系统名称及该系统工作状态
*
* @return
*/
Map
<
String
,
Object
>
getFireSystemInfo
(
HashMap
<
String
,
Object
>
hashMap
);
/**
* 获取系统近一月告警设备top5
*
* @param hashMap
* @return
*/
List
<
Map
<
String
,
Object
>>
equipAlarmTOP
(
HashMap
<
String
,
Object
>
hashMap
);
/**
* 获取设备id
*
* @param hashMap
* @return
*/
String
equipmentId
(
HashMap
<
String
,
Object
>
hashMap
);
/**
* 获取系统设备状态
*
* @param page
* @param id
* @return
*/
Page
<
Map
<
String
,
Object
>>
equipmentState
(
Page
page
,
String
id
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IFireFightingSystemService.java
View file @
a69416f5
package
com
.
yeejoin
.
equipmanage
.
service
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto
;
import
com.yeejoin.amos.feign.morphic.model.ResourceDTO
;
...
...
@@ -10,6 +11,8 @@ import com.yeejoin.equipmanage.common.entity.dto.EquipTypeAmountPageDTO;
import
com.yeejoin.equipmanage.common.entity.vo.*
;
import
com.yeejoin.equipmanage.common.vo.*
;
import
java.util.HashMap
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -233,5 +236,14 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
Object
refreshCarTypeAndCount
(
String
bizOrgCode
)
throws
Exception
;
Map
<
String
,
Object
>
getSystemName
(
HashMap
<
String
,
Object
>
hashMap
);
Map
<
String
,
Object
>
getSystemStatus
(
HashMap
<
String
,
Object
>
hashMap
);
Map
<
String
,
Object
>
equipAlarmTOP
(
HashMap
<
String
,
Object
>
hashMap
);
List
<
Map
<
String
,
Object
>>
getSmallWaterInfo
(
HashMap
<
String
,
Object
>
hashMap
);
Page
<
Map
<
String
,
Object
>>
equipmentState
(
Page
result
,
HashMap
<
String
,
Object
>
hashMap
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/FireFightingSystemServiceImpl.java
View file @
a69416f5
...
...
@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.google.common.base.Joiner
;
import
com.google.common.collect.Lists
;
...
...
@@ -25,6 +26,7 @@ import com.yeejoin.equipmanage.common.entity.*;
import
com.yeejoin.equipmanage.common.entity.dto.EquipTypeAmountPageDTO
;
import
com.yeejoin.equipmanage.common.entity.vo.*
;
import
com.yeejoin.equipmanage.common.enums.*
;
import
com.yeejoin.equipmanage.common.utils.CommonPageInfoParam
;
import
com.yeejoin.equipmanage.common.utils.StringUtil
;
import
com.yeejoin.equipmanage.common.vo.*
;
import
com.yeejoin.equipmanage.mapper.*
;
...
...
@@ -280,7 +282,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
FeignClientResult
<
AgencyUserModel
>
result
=
Privilege
.
agencyUserClient
.
queryByUserId
(
vo
.
getChargePerson
());
AgencyUserModel
userModel
=
result
==
null
?
new
AgencyUserModel
()
:
result
.
getResult
();
if
(
userModel
!=
null
&&
userModel
.
getRealName
()!=
null
)
{
if
(
userModel
!=
null
&&
userModel
.
getRealName
()
!=
null
)
{
vo
.
setChargePersonName
(
userModel
.
getRealName
());
}
...
...
@@ -400,27 +402,27 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
// responses.add(p);
// });
// List<PointTreeVo> regionList = responses.stream().filter(r -> "TRUE".equals(r.getIsRegion())).collect(Collectors.toList());
List
<
PointTreeVo
>
buildList
=
buildingMapper
.
getBuildList
(
orgCode
,
null
);
return
transferListToPointTree
(
buildList
,
id
,
null
);
List
<
PointTreeVo
>
buildList
=
buildingMapper
.
getBuildList
(
orgCode
,
null
);
return
transferListToPointTree
(
buildList
,
id
,
null
);
}
@Override
public
List
<
SpeIndexVo
>
getSpeIndex
(
Long
id
,
int
flag
)
{
public
List
<
SpeIndexVo
>
getSpeIndex
(
Long
id
,
int
flag
)
{
// 因此处代码其他地方有调用 增加表示判断 flag == 1 为 消防点位图处需要iot编码所用
if
(
flag
==
1
){
if
(
flag
==
1
)
{
List
<
SpeIndexVo
>
speIndexVos
=
makeStatus
(
fireFightingSystemMapper
.
getSpeIndex
(
id
));
if
(!
ValidationUtil
.
isEmpty
(
speIndexVos
)){
if
(!
ValidationUtil
.
isEmpty
(
speIndexVos
))
{
EquipmentSpecific
equipmentSpecific
=
equipmentSpecificSerivce
.
getBaseMapper
().
selectById
(
id
);
if
(!
ValidationUtil
.
isEmpty
(
equipmentSpecific
)){
if
(!
ValidationUtil
.
isEmpty
(
equipmentSpecific
))
{
SpeIndexVo
speIndexVo
=
new
SpeIndexVo
();
speIndexVo
.
setName
(
"设备编码"
);
speIndexVo
.
setValue
(
equipmentSpecific
.
getCode
());
speIndexVos
.
add
(
0
,
speIndexVo
);
speIndexVos
.
add
(
0
,
speIndexVo
);
}
}
return
speIndexVos
;
}
return
makeStatus
(
fireFightingSystemMapper
.
getSpeIndex
(
id
));
return
makeStatus
(
fireFightingSystemMapper
.
getSpeIndex
(
id
));
}
private
void
insertFiles
(
FireFightingSystemVo
vo
)
{
...
...
@@ -495,9 +497,9 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
* @param id
* @return
*/
public
List
<
PointTreeVo
>
transferListToPointTree
(
List
<
PointTreeVo
>
allRiskSource
,
String
id
,
String
instanceId
)
{
public
List
<
PointTreeVo
>
transferListToPointTree
(
List
<
PointTreeVo
>
allRiskSource
,
String
id
,
String
instanceId
)
{
//TODO id为空,为消防建筑使用;id不为空,为点位图使用
List
<
PointTreeVo
>
pointData
=
fireFightingSystemMapper
.
getPointData
(
id
,
instanceId
);
List
<
PointTreeVo
>
pointData
=
fireFightingSystemMapper
.
getPointData
(
id
,
instanceId
);
if
(!
CollectionUtils
.
isEmpty
(
pointData
))
{
// 查询所有wl_source_scene,判断是否绑定
LambdaQueryWrapper
<
SourceScene
>
wrapper
=
new
LambdaQueryWrapper
<>();
...
...
@@ -516,7 +518,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
}
// 优化不查指标
for
(
PointTreeVo
p
:
pointData
)
{
Long
buildOrSysId
=
p
.
getParentId
();
Long
buildOrSysId
=
p
.
getParentId
();
Long
equipSpecificId
=
p
.
getSequenceNbr
();
Map
map
=
new
HashMap
(
7
);
map
.
put
(
"imgPath"
,
p
.
getImgPath
());
...
...
@@ -582,9 +584,9 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
* @param id
* @return
*/
public
List
<
PointTreeVo
>
transferListToPointTreeNew
(
List
<
PointTreeVo
>
allRiskSource
,
String
id
,
String
instanceId
,
String
displayName
)
{
public
List
<
PointTreeVo
>
transferListToPointTreeNew
(
List
<
PointTreeVo
>
allRiskSource
,
String
id
,
String
instanceId
,
String
displayName
)
{
//TODO id为空,为消防建筑使用;id不为空,为点位图使用
List
<
PointTreeVo
>
pointData
=
fireFightingSystemMapper
.
getPointDataNew
(
id
,
instanceId
,
displayName
);
List
<
PointTreeVo
>
pointData
=
fireFightingSystemMapper
.
getPointDataNew
(
id
,
instanceId
,
displayName
);
if
(!
CollectionUtils
.
isEmpty
(
pointData
))
{
// 查询所有wl_source_scene,判断是否绑定
List
<
SourceScene
>
sourceSceneList
=
sourceSceneMapper
.
selectList
(
null
);
...
...
@@ -782,7 +784,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
try
{
FeignUtil
.
remoteCall
(()
->
Morphic
.
morphicSubjectClient
.
delete
(
entity
.
getSceneId
()));
}
catch
(
Exception
e
)
{
log
.
error
(
"远程调用 MORPHIC 服务的删除操作出错:"
+
e
.
getMessage
().
toString
(),
e
);
log
.
error
(
"远程调用 MORPHIC 服务的删除操作出错:"
+
e
.
getMessage
().
toString
(),
e
);
}
}
formInstanceMapper
.
clearSystemId
(
id
);
...
...
@@ -851,9 +853,10 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
});
return
list
;
}
@Override
public
IPage
<
EquipTypeImgAmountVO
>
getColaCategoryAmountListIot
(
int
hierarchy
,
String
codeHead
,
EquipTypeAmountPageDTO
equipTypeAmountPage
)
{
EquipTypeAmountPageDTO
equipTypeAmountPage
)
{
String
type
=
equipTypeAmountPage
.
getType
();
if
(!
""
.
equals
(
type
)
&&
"car"
.
equals
(
type
))
{
equipTypeAmountPage
.
setSystemId
(
null
);
...
...
@@ -868,6 +871,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
});
return
list
;
}
@Override
public
IPage
<
EquipTypeImgAmountVO
>
getColaCategoryAmountCarList
(
int
hierarchy
,
String
codeHead
,
EquipTypeAmountPageDTO
equipTypeAmountPage
)
{
...
...
@@ -1139,8 +1143,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
// return JSONArray.parseArray(
// JSONArray.toJSONString(redisUtils.get(equipTypeAndCount + bizOrgCode)), EquipmentCategory.class);
// } else {
return
refreshEquipmentTypeAndCount
(
bizOrgCode
);
// }
return
refreshEquipmentTypeAndCount
(
bizOrgCode
);
// }
}
@Override
...
...
@@ -1150,8 +1154,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
return
null
;
}
List
<
EquipmentCategory
>
equipmentTypeList
=
responseList
.
stream
()
.
filter
(
i
->
!
i
.
getCode
().
startsWith
(
"2"
)
&&
"2"
.
equals
(
i
.
getIndustryCode
()))
.
filter
(
m
->
!
m
.
getCode
().
startsWith
(
"9306"
)
&&
"2"
.
equals
(
m
.
getIndustryCode
()))
.
filter
(
i
->
!
i
.
getCode
().
startsWith
(
"2"
)
&&
"2"
.
equals
(
i
.
getIndustryCode
()))
.
filter
(
m
->
!
m
.
getCode
().
startsWith
(
"9306"
)
&&
"2"
.
equals
(
m
.
getIndustryCode
()))
.
collect
(
Collectors
.
toList
());
List
<
EquipmentCategory
>
list
=
typeListTree
(
equipmentTypeList
,
bizOrgCode
,
SourceTypeEnum
.
EQUIPMENT
);
redisUtils
.
set
(
equipTypeAndCount
+
bizOrgCode
,
list
,
86400
);
...
...
@@ -1263,4 +1267,65 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
}
return
this
.
baseMapper
.
selectList
(
wrapper
);
}
@Override
public
Map
<
String
,
Object
>
getSystemStatus
(
HashMap
<
String
,
Object
>
hashMap
)
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
fireFightingSystemMapper
.
getFireSystemInfo
(
hashMap
);
if
(!
map
.
isEmpty
())
{
ArrayList
<
Object
>
status
=
new
ArrayList
<>();
status
.
add
(
map
.
get
(
"status"
));
resultMap
.
put
(
"values"
,
status
);
resultMap
.
put
(
"labels"
,
status
);
}
return
resultMap
;
}
@Override
public
Map
<
String
,
Object
>
getSystemName
(
HashMap
<
String
,
Object
>
hashMap
)
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
fireFightingSystemMapper
.
getFireSystemInfo
(
hashMap
);
if
(!
map
.
isEmpty
())
{
resultMap
.
put
(
"name"
,
map
.
get
(
"name"
));
}
return
resultMap
;
}
@Override
public
Map
<
String
,
Object
>
equipAlarmTOP
(
HashMap
<
String
,
Object
>
hashMap
)
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
list
=
fireFightingSystemMapper
.
equipAlarmTOP
(
hashMap
);
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
LinkedHashSet
<
String
>
yAxis
=
new
LinkedHashSet
<>();
ArrayList
<
String
>
xAxis
=
new
ArrayList
<>();
String
yKey
=
""
;
String
xResult
=
""
;
for
(
Map
<
String
,
Object
>
stringObjectMap
:
list
)
{
yKey
=
stringObjectMap
.
get
(
"equipName"
).
toString
();
xResult
=
stringObjectMap
.
get
(
"total"
).
toString
();
yAxis
.
add
(
yKey
);
xAxis
.
add
(
xResult
);
}
resultMap
.
put
(
"xAxis"
,
xAxis
);
resultMap
.
put
(
"yAxis"
,
yAxis
);
}
return
resultMap
;
}
@Override
public
Page
<
Map
<
String
,
Object
>>
equipmentState
(
Page
res
,
HashMap
<
String
,
Object
>
hashMap
)
{
Page
result
=
new
Page
<>(
res
.
getCurrent
(),
res
.
getSize
());
String
id
=
fireFightingSystemMapper
.
equipmentId
(
hashMap
);
Page
<
Map
<
String
,
Object
>>
mapPage
=
fireFightingSystemMapper
.
equipmentState
(
result
,
id
);
return
mapPage
;
}
@Override
public
List
<
Map
<
String
,
Object
>>
getSmallWaterInfo
(
HashMap
<
String
,
Object
>
hashMap
)
{
String
bizOrgCode
=
hashMap
.
get
(
"bizOrgCode"
).
toString
();
String
systemCode
=
hashMap
.
get
(
"systemCode"
).
toString
();
return
fireFightingSystemMapper
.
getWaterInfo
(
bizOrgCode
,
systemCode
);
}
}
amos-boot-system-equip/src/main/resources/mapper/FireFightingSystemMapper.xml
View file @
a69416f5
...
...
@@ -1051,45 +1051,45 @@
GROUP BY
fs.id;
</select>
<select
id=
"getFireSystemState"
resultType=
"Map"
>
select * from v_fire_system_state
</select>
<select
id=
"getFireOnlSystem"
resultType=
"Map"
>
select * from v_fire_onl_num
</select>
<select
id=
"getFireCafsSystem"
resultType=
"Map"
>
select * from v_fire_cafs_num
</select>
<select
id=
"getFireFfsSystem"
resultType=
"Map"
>
select * from v_fire_ffs_num
</select>
<select
id=
"getFireFasSystem"
resultType=
"Map"
>
select * from v_fire_fas_num
</select>
<select
id=
"getFireAcsSystem"
resultType=
"Map"
>
select * from v_fire_acs_num
</select>
<select
id=
"getFireFhsSystem"
resultType=
"Map"
>
select * from v_fire_fhs_num
</select>
<select
id=
"getTodayConfirmAlarmInfo"
resultType=
"Map"
>
select * from v_equip_alarm_today_statistics
</select>
<select
id=
"getPoolInfo"
resultType=
"Map"
>
select * from v_fire_fhs_yl_num
</select>
<select
id=
"getFightingSysInfo"
resultType=
"com.yeejoin.equipmanage.common.vo.FireFightingSystemVo"
>
select * from v_fire_system_info fs
<where>
...
...
@@ -1101,7 +1101,7 @@
</if>
</where>
</select>
<select
id=
"getFireOnlSystemThreeSmall"
resultType=
"Map"
>
select * from v_fire_onl_three_small
</select>
...
...
@@ -1804,7 +1804,7 @@
where
si.equipment_index_key = 'ES_Elevator_Shield'
and si.`value` = 'true'
) AS `dtpb`,
(
select
...
...
@@ -2560,6 +2560,7 @@
LEFT JOIN wl_equipment_index ei ON ei.equipment_id = ed.equipment_id
LEFT JOIN wl_equipment e ON e.id = ei.equipment_id
LEFT JOIN wl_equipment_category ec ON ec.id = e.category_id
LEFT JOIN f_fire_fighting_system fs ON fs.biz_org_code = r.biz_org_code
WHERE
r.resource_type IN ( 'pool', 'industryPool' )
AND r.is_delete = 1
...
...
@@ -2567,7 +2568,138 @@
<if
test=
"bizOrgCode!=null and bizOrgCode!=''"
>
AND r.biz_org_code = #{bizOrgCode,jdbcType=VARCHAR}
</if>
<if
test=
"systemCode!=null and systemCode!=''"
>
AND fs.code = #{systemCode,jdbcType=VARCHAR}
</if>
GROUP BY
r.sequence_nbr
</select>
<select
id=
"getFireSystemInfo"
resultType=
"java.util.Map"
>
select `nz`.name,`nz`.status from ( SELECT
`fs`.`id` AS `id`,
`fs`.`code` AS `code`,
`fs`.`biz_org_code` AS `biz_org_code`,
`fs`.`name` AS `name`,
`fs`.`install_date` AS `installdate`,
`fs`.`charge_person_name` AS `chargeperson`,
`fs`.`charge_person_phone` AS `chargepersonphone`,
`mim`.`name` AS `maintenanceunit`,
`mic`.`name` AS `constructionunit`,(
CASE
WHEN ((
SELECT
count( 1 )
FROM
`wl_equipment_specific_alarm`
WHERE
((
`wl_equipment_specific_alarm`.`status` = 1
)
AND (
0 != find_in_set( `fs`.`id`, `wl_equipment_specific_alarm`.`system_ids` )))) > 0
) THEN
'异常' ELSE '正常'
END
) AS `status`
FROM
((
`f_fire_fighting_system` `fs`
LEFT JOIN `wl_manufacturer_info` `mic` ON ((
`mic`.`id` = `fs`.`maintenance_unit`
)))
LEFT JOIN `wl_manufacturer_info` `mim` ON ((
`mim`.`id` = `fs`.`construction_unit`
)))) `nz` where `nz`.code = #{systemCode} and `nz`.biz_org_code = #{bizOrgCode}
</select>
<select
id=
"equipAlarmTOP"
resultType=
"java.util.Map"
>
SELECT
ifnull( `a`.`fightSysName`, NULL ) AS `fightSysName`,
ifnull( `a`.`fightSysCode`, NULL ) AS `fightSysCode`,
ifnull( `a`.`fightSysId`, NULL ) AS `fightSysId`,
ifnull( `a`.`report_date`, NULL ) AS `reportDate`,
`a`.`equipName` AS `equipName`,
sum( `a`.`total` ) AS `total`
FROM
(
SELECT
`rd`.`index_type` AS `indxKey`,
`rd`.`index_name` AS `index_name`,
`rd`.`equipment_specific_name` AS `equipName`,
count( DISTINCT `rd`.`equipment_specific_id` ) AS `total`,
`rd`.`report_date` AS `report_date`,
`fs`.`name` AS `fightSysName`,
`fs`.`code` AS `fightSysCode`,
`fs`.`id` AS `fightSysId`,
`rd`.`equipment_specific_id` AS `equipId`
FROM
(
`wl_equipment_alarm_report_day` `rd`
LEFT JOIN `f_fire_fighting_system` `fs` ON ((
0 != find_in_set( `fs`.`id`, `rd`.`system_ids` ))))
WHERE
(((
curdate() - INTERVAL 30 DAY
)
<
= cast( `rd`.`report_date` AS date ))
AND ( `fs`.`code` = #{systemCode} )
AND ( `fs`.`biz_org_code` = #{bizOrgCode} )
AND ((
`rd`.`index_type` LIKE '%Fault'
)
OR ( `rd`.`index_type` LIKE '%FireAlarm' )
OR ( `rd`.`index_type` LIKE '%Shield' ))
AND ( `rd`.`value` = 'true' ))
GROUP BY
`rd`.`equipment_specific_id`,
`rd`.`report_date`
) `a`
GROUP BY
`a`.`equipId`
ORDER BY
`total` DESC
LIMIT 5
</select>
<select
id=
"equipmentId"
resultType=
"String"
>
select
id
from
f_fire_fighting_system
where
code = #{systemCode} and
biz_org_code = #{bizOrgCode}
</select>
<select
id=
"equipmentState"
resultType=
"java.util.Map"
>
SELECT
b.equipName,
(CASE WHEN
b.totalNum > 0 THEN
'异常' ELSE '正常' END) `status`,
b.totalNum AS totalNum
FROM
(
SELECT
a.equipName,
count( wesl.id ) AS totalNum
FROM
(
SELECT
wes.`name` AS equipName,
wed.equipment_id AS equipmentId
FROM
wl_equipment_specific wes
LEFT JOIN wl_equipment_detail wed ON wed.id = wes.equipment_detail_id
WHERE
FIND_IN_SET( #{id}, wes.system_id ) > 0
GROUP BY
wed.equipment_id
) a
LEFT JOIN wl_equipment_specific_alarm_log wesl ON wesl.equipment_id = a.equipmentId
GROUP BY
a.equipmentId
) b
</select>
</mapper>
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