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
de0c8893
Commit
de0c8893
authored
Jan 09, 2024
by
李秀明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 设备告警接口新增参数与逻辑修改
parent
8c08ee7e
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
80 additions
and
37 deletions
+80
-37
EquipmentAlarmLogDto.java
...n/equipmanage/common/entity/dto/EquipmentAlarmLogDto.java
+2
-0
BigScreenController.java
...m/yeejoin/equipmanage/controller/BigScreenController.java
+6
-2
FireFightingSystemMapper.java
.../yeejoin/equipmanage/mapper/FireFightingSystemMapper.java
+1
-1
WarehouseStructureMapper.java
.../yeejoin/equipmanage/mapper/WarehouseStructureMapper.java
+1
-1
IFireFightingSystemService.java
...ejoin/equipmanage/service/IFireFightingSystemService.java
+1
-1
ESeqServiceImpl.java
...com/yeejoin/equipmanage/service/impl/ESeqServiceImpl.java
+28
-25
FireFightingSystemServiceImpl.java
...uipmanage/service/impl/FireFightingSystemServiceImpl.java
+4
-4
FireFightingSystemMapper.xml
...ip/src/main/resources/mapper/FireFightingSystemMapper.xml
+27
-3
WarehouseStructureMapper.xml
...ip/src/main/resources/mapper/WarehouseStructureMapper.xml
+10
-0
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/dto/EquipmentAlarmLogDto.java
View file @
de0c8893
...
...
@@ -17,6 +17,8 @@ public class EquipmentAlarmLogDto {
private
String
time
;
@ApiModelProperty
(
value
=
"名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"设备位置"
)
private
String
location
;
@ApiModelProperty
(
value
=
"事件内容"
)
private
String
content
;
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/BigScreenController.java
View file @
de0c8893
...
...
@@ -155,8 +155,12 @@ public class BigScreenController extends AbstractBaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"卡片BigSystem报警处理情况统计"
)
@GetMapping
(
"/statistic/alarm"
)
public
ResponseModel
getSystemAlarmStatistic
(
@RequestParam
(
value
=
"systemCode"
,
required
=
false
)
String
systemCode
)
{
return
CommonResponseUtil
.
success
(
iFireFightingSystemService
.
getSystemAlarmStatistic
(
systemCode
));
public
ResponseModel
getSystemAlarmStatistic
(
@RequestParam
(
value
=
"systemCode"
,
required
=
false
)
String
systemCode
,
@RequestParam
(
value
=
"startDate"
,
required
=
false
)
String
startDate
,
@RequestParam
(
value
=
"endDate"
,
required
=
false
)
String
endDate
)
{
return
CommonResponseUtil
.
success
(
iFireFightingSystemService
.
getSystemAlarmStatistic
(
systemCode
,
startDate
,
endDate
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/FireFightingSystemMapper.java
View file @
de0c8893
...
...
@@ -708,7 +708,7 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
Page
<
Map
<
String
,
Object
>>
getWaterInfoPage
(
Page
page
,
@Param
(
"bizOrgCode"
)
String
bizOrgCode
,
@Param
(
"type"
)
String
type
,
@Param
(
"status"
)
String
status
);
Map
<
String
,
String
>
getSystemAlarmStatistic
(
@Param
(
"systemCode"
)
String
systemCode
);
Map
<
String
,
String
>
getSystemAlarmStatistic
(
@Param
(
"systemCode"
)
String
systemCode
,
@Param
(
"startDate"
)
String
startDate
,
@Param
(
"endDate"
)
String
endDate
);
List
<
Map
<
String
,
Object
>>
getSystemAlarmTrend
(
@Param
(
"systemCode"
)
String
systemCode
,
@Param
(
"updateTime"
)
String
updateTime
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/WarehouseStructureMapper.java
View file @
de0c8893
...
...
@@ -10,5 +10,5 @@ import com.yeejoin.equipmanage.common.entity.WarehouseStructure;
* @date 2020-07-07
*/
public
interface
WarehouseStructureMapper
extends
BaseMapper
<
WarehouseStructure
>
{
WarehouseStructure
selectByEquipmentId
(
Long
equipmentId
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IFireFightingSystemService.java
View file @
de0c8893
...
...
@@ -338,7 +338,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
Page
<
Map
<
String
,
Object
>>
getWaterInfoPage
(
Page
<
Map
<
String
,
Object
>>
page
,
String
bizOrgCode
,
String
type
,
String
status
);
List
<
Map
<
String
,
String
>>
getSystemAlarmStatistic
(
String
systemCode
);
List
<
Map
<
String
,
String
>>
getSystemAlarmStatistic
(
String
systemCode
,
String
startDate
,
String
endDate
);
Map
<
String
,
Object
>
getSystemAlarmTrend
(
String
systemCode
,
String
updateTime
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/ESeqServiceImpl.java
View file @
de0c8893
...
...
@@ -7,10 +7,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.yeejoin.equipmanage.common.dto.EquiplistSpecificBySystemESVO
;
import
com.yeejoin.equipmanage.common.entity.EquipmentIndex
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex
;
import
com.yeejoin.equipmanage.common.entity.WarehouseStructure
;
import
com.yeejoin.equipmanage.common.entity.dto.EquipmentAlarmLogDto
;
import
com.yeejoin.equipmanage.common.exception.BaseException
;
import
com.yeejoin.equipmanage.dao.ESequiplistSpecificBySystemRepository
;
import
com.yeejoin.equipmanage.mapper.EquipmentIndexMapper
;
import
com.yeejoin.equipmanage.mapper.WarehouseStructureMapper
;
import
com.yeejoin.equipmanage.service.IESeqService
;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
import
org.elasticsearch.index.query.QueryBuilders
;
...
...
@@ -30,6 +32,7 @@ import org.springframework.data.elasticsearch.core.query.Query;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
java.text.SimpleDateFormat
;
...
...
@@ -51,6 +54,8 @@ public class ESeqServiceImpl implements IESeqService {
@Autowired
private
EquipmentIndexMapper
equipmentIndexMapper
;
@Autowired
private
WarehouseStructureMapper
warehouseStructureMapper
;
@Value
(
"${es.ESEquiplistSpecific.flag}"
)
private
Boolean
flag
;
...
...
@@ -89,38 +94,36 @@ public class ESeqServiceImpl implements IESeqService {
)
.
withPageable
(
PageRequest
.
of
(
current
-
1
,
pageSize
))
.
withSort
(
SortBuilders
.
fieldSort
(
"time"
).
order
(
SortOrder
.
DESC
));
List
<
EquipmentAlarmLogDto
>
list
=
new
LinkedList
<
EquipmentAlarmLogDto
>();
try
{
SearchHits
<
EquiplistSpecificBySystemESVO
>
searchHits
=
elasticsearchTemplate
.
search
(
queryBuilder
.
build
(),
EquiplistSpecificBySystemESVO
.
class
);
List
<
EquipmentAlarmLogDto
>
list
=
new
LinkedList
<>();
try
{
SearchHits
<
EquiplistSpecificBySystemESVO
>
searchHits
=
elasticsearchTemplate
.
search
(
queryBuilder
.
build
(),
EquiplistSpecificBySystemESVO
.
class
);
for
(
SearchHit
<
EquiplistSpecificBySystemESVO
>
searchHit
:
searchHits
.
getSearchHits
())
{
for
(
SearchHit
<
EquiplistSpecificBySystemESVO
>
searchHit
:
searchHits
.
getSearchHits
())
{
JSONObject
jsonObject
=
(
JSONObject
)
JSON
.
toJSON
(
searchHit
.
getContent
());
EquiplistSpecificBySystemESVO
equiplistSpecificBySystemESVO
=
JSON
.
toJavaObject
(
jsonObject
,
EquiplistSpecificBySystemESVO
.
class
);
EquipmentAlarmLogDto
da
=
new
EquipmentAlarmLogDto
();
da
.
setId
(
UUID
.
randomUUID
().
toString
());
da
.
setName
(
equiplistSpecificBySystemESVO
.
getEquipmentSpecificName
());
SimpleDateFormat
ft
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
Date
daf
=
new
Date
(
equiplistSpecificBySystemESVO
.
getTime
());
String
time
=
ft
.
format
(
daf
);
da
.
setTime
(
time
);
// String value=equiplistSpecificBySystemESVO.getValue();
// value= getReadableStatus(value );
// da.setContent(equiplistSpecificBySystemESVO.getEquipmentIndexName()+":"+value);
QueryWrapper
<
EquipmentIndex
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
"name_key"
,
equiplistSpecificBySystemESVO
.
getEquipmentIndexKey
());
wrapper
.
last
(
"limit 1"
);
EquipmentIndex
index
=
equipmentIndexMapper
.
selectOne
(
wrapper
);
da
.
setContent
(
index
.
getTypeName
());
list
.
add
(
da
);
EquipmentAlarmLogDto
da
=
new
EquipmentAlarmLogDto
();
da
.
setId
(
String
.
valueOf
(
equiplistSpecificBySystemESVO
.
getEquipmentSpecificId
()));
da
.
setName
(
equiplistSpecificBySystemESVO
.
getEquipmentSpecificName
());
SimpleDateFormat
ft
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
Date
daf
=
new
Date
(
equiplistSpecificBySystemESVO
.
getTime
());
String
time
=
ft
.
format
(
daf
);
da
.
setTime
(
time
);
QueryWrapper
<
EquipmentIndex
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
"name_key"
,
equiplistSpecificBySystemESVO
.
getEquipmentIndexKey
());
wrapper
.
last
(
"limit 1"
);
EquipmentIndex
index
=
equipmentIndexMapper
.
selectOne
(
wrapper
);
da
.
setContent
(
index
.
getTypeName
());
WarehouseStructure
warehouseStructure
=
warehouseStructureMapper
.
selectByEquipmentId
(
equiplistSpecificBySystemESVO
.
getEquipmentSpecificId
());
if
(
warehouseStructure
!=
null
)
{
da
.
setLocation
(
StringUtils
.
hasText
(
warehouseStructure
.
getFullName
())
?
warehouseStructure
.
getFullName
()
:
""
);
}
list
.
add
(
da
);
}
pageBean
.
setRecords
(
list
);
pageBean
.
setTotal
(
searchHits
.
getTotalHits
());
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
BadRequest
(
"系统异常"
);
throw
new
BadRequest
(
"系统异常"
);
}
return
pageBean
;
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/FireFightingSystemServiceImpl.java
View file @
de0c8893
...
...
@@ -2533,8 +2533,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
return
fireFightingSystemMapper
.
getWaterInfoPage
(
page
,
bizOrgCode
,
type
,
status
);
}
@Override
public
List
<
Map
<
String
,
String
>>
getSystemAlarmStatistic
(
String
systemCode
)
{
Map
<
String
,
String
>
map
=
fireFightingSystemMapper
.
getSystemAlarmStatistic
(
systemCode
);
public
List
<
Map
<
String
,
String
>>
getSystemAlarmStatistic
(
String
systemCode
,
String
startDate
,
String
endDate
)
{
Map
<
String
,
String
>
map
=
fireFightingSystemMapper
.
getSystemAlarmStatistic
(
systemCode
,
startDate
,
endDate
);
List
<
Map
<
String
,
String
>>
list
=
new
ArrayList
<>();
Map
<
String
,
String
>
entryMap
=
new
HashMap
<>();
entryMap
.
put
(
"key"
,
"1"
);
...
...
@@ -2546,7 +2546,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
Map
<
String
,
String
>
entryMap1
=
new
HashMap
<>();
entryMap1
.
put
(
"key"
,
"2"
);
entryMap1
.
put
(
"type"
,
"handled"
);
entryMap1
.
put
(
"name"
,
"已
处理
"
);
entryMap1
.
put
(
"name"
,
"已
消除
"
);
entryMap1
.
put
(
"value"
,
map
.
get
(
"handledNum"
));
entryMap1
.
put
(
"unit"
,
""
);
list
.
add
(
entryMap1
);
...
...
@@ -2561,7 +2561,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
entryMap3
.
put
(
"key"
,
"4"
);
entryMap3
.
put
(
"type"
,
"faultEquip"
);
entryMap3
.
put
(
"name"
,
"故障设备"
);
entryMap3
.
put
(
"value"
,
map
.
get
(
"
alarm
EquipNum"
));
entryMap3
.
put
(
"value"
,
map
.
get
(
"
fault
EquipNum"
));
entryMap3
.
put
(
"unit"
,
""
);
list
.
add
(
entryMap3
);
return
list
;
...
...
amos-boot-system-equip/src/main/resources/mapper/FireFightingSystemMapper.xml
View file @
de0c8893
...
...
@@ -6179,8 +6179,26 @@
<select
id=
"getSystemAlarmStatistic"
resultType=
"Map"
>
SELECT
COUNT(wlesal.id) AS totalNum,
IFNULL((select COUNT(DISTINCT wl.equipment_specific_id) from wl_equipment_specific_alarm_log wl where
wl.`status` = 1 AND system_codes LIKE CONCAT('%', #{systemCode}, '%')), 0) AS alarmEquipNum,
IFNULL(
(
SELECT
COUNT(DISTINCT wl.equipment_specific_id)
FROM
wl_equipment_specific_alarm_log wl
<where>
wl.type = 'BREAKDOWN'
<if
test=
"systemCode != null and systemCode != ''"
>
AND wl.system_codes LIKE CONCAT('%', #{systemCode}, '%')
</if>
<if
test=
"startDate != null and startDate != ''"
>
AND wl.create_date
>
= #{startDate}
</if>
<if
test=
"endDate != null and endDate != ''"
>
AND wl.create_date
<
= #{endDate}
</if>
</where>
)
, 0) AS faultEquipNum,
IFNULL(SUM(IF(wlesal.clean_time IS NULL,1,0)), 0) AS unClearNum,
IFNULL(SUM(IF(wlesal.confirm_type IS NOT NULL,1,0)), 0) AS handledNum
FROM
...
...
@@ -6188,7 +6206,13 @@
LEFT JOIN f_fire_fighting_system fs ON FIND_IN_SET( fs.id, wlesal.system_ids )
<where>
<if
test=
"systemCode != null and systemCode != ''"
>
fs.code = #{systemCode}
AND fs.code = #{systemCode}
</if>
<if
test=
"startDate != null and startDate != ''"
>
AND wlesal.create_date
>
= #{startDate}
</if>
<if
test=
"endDate != null and endDate != ''"
>
AND wlesal.create_date
<
= #{endDate}
</if>
</where>
</select>
...
...
amos-boot-system-equip/src/main/resources/mapper/WarehouseStructureMapper.xml
View file @
de0c8893
...
...
@@ -2,4 +2,14 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.equipmanage.mapper.WarehouseStructureMapper"
>
<select
id=
"selectByEquipmentId"
resultType=
"com.yeejoin.equipmanage.common.entity.WarehouseStructure"
>
SELECT
ws.*
FROM
wl_equipment_specific es
LEFT JOIN wl_warehouse_structure ws ON es.warehouse_structure_id = ws.id
WHERE
es.id = #{equipmentSpecificId}
LIMIT 1
</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