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
62e61d7b
Commit
62e61d7b
authored
Aug 11, 2022
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
大屏API提供
parent
53bed829
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
239 additions
and
7 deletions
+239
-7
BigScreenVo.java
...n/java/com/yeejoin/equipmanage/common/vo/BigScreenVo.java
+16
-0
BigScreenController.java
...m/yeejoin/equipmanage/controller/BigScreenController.java
+32
-0
FireFightingSystemMapper.java
.../yeejoin/equipmanage/mapper/FireFightingSystemMapper.java
+28
-0
IFireFightingSystemService.java
...ejoin/equipmanage/service/IFireFightingSystemService.java
+8
-7
FireFightingSystemServiceImpl.java
...uipmanage/service/impl/FireFightingSystemServiceImpl.java
+13
-0
FireFightingSystemMapper.xml
...ip/src/main/resources/mapper/FireFightingSystemMapper.xml
+142
-0
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/vo/BigScreenVo.java
0 → 100644
View file @
62e61d7b
package
com
.
yeejoin
.
equipmanage
.
common
.
vo
;
import
lombok.Data
;
import
java.util.Map
;
@Data
public
class
BigScreenVo
{
private
Map
<
String
,
Object
>
systemAlarmInfoNum
;
private
Map
<
String
,
Object
>
pool
;
private
Map
<
String
,
Object
>
industryPool
;
private
Integer
carNum
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/BigScreenController.java
0 → 100644
View file @
62e61d7b
package
com
.
yeejoin
.
equipmanage
.
controller
;
import
com.yeejoin.equipmanage.common.utils.CommonResponseUtil
;
import
com.yeejoin.equipmanage.common.vo.BigScreenVo
;
import
com.yeejoin.equipmanage.service.IFireFightingSystemService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
@RestController
@Api
(
tags
=
"一张图大屏API"
)
@RequestMapping
(
value
=
"/bigScreen"
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
class
BigScreenController
{
@Autowired
private
IFireFightingSystemService
iFireFightingSystemService
;
@GetMapping
(
value
=
"/list"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"系统、消防水池、工业水池、水源总容积、消防车辆"
,
notes
=
"系统、消防水池、工业水池、水源总容积、消防车辆"
)
public
ResponseModel
<
BigScreenVo
>
getSystemAlarmInfoNum
(
@RequestParam
(
required
=
false
,
value
=
"companyCode"
)
String
companyCode
)
{
return
CommonResponseUtil
.
success
(
iFireFightingSystemService
.
getSystemAlarmInfoNum
(
companyCode
));
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/FireFightingSystemMapper.java
View file @
62e61d7b
...
@@ -371,4 +371,32 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
...
@@ -371,4 +371,32 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
* @return
* @return
*/
*/
List
<
EquipmentExportVO
>
exportEquipmentList
(
@Param
(
"dto"
)
EquipTypeAmountPageDTO
dto
);
List
<
EquipmentExportVO
>
exportEquipmentList
(
@Param
(
"dto"
)
EquipTypeAmountPageDTO
dto
);
/**
* 获取系统告警信息
* @param companyCode
* @return
*/
Map
<
String
,
Object
>
getSystemAlarmInfoNum
(
@Param
(
"companyCode"
)
String
companyCode
);
/**
* 消防水池或者工业水池信息
* @param companyCode
* @return
*/
Map
<
String
,
Object
>
getWaterPoolInfoNum
(
@Param
(
"companyCode"
)
String
companyCode
,
@Param
(
"poolType"
)
String
poolType
);
/**
* 消防水源总量统计
* @param companyCode
* @return
*/
Map
<
String
,
Object
>
getWaterPoolVolumeInfo
(
@Param
(
"companyCode"
)
String
companyCode
);
/**
* 获取车辆总数
* @param companyCode
* @return
*/
Integer
getCarNum
(
@Param
(
"companyCode"
)
String
companyCode
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IFireFightingSystemService.java
View file @
62e61d7b
...
@@ -17,13 +17,7 @@ import com.yeejoin.equipmanage.common.entity.vo.EquipTypeImgAmountVO;
...
@@ -17,13 +17,7 @@ import com.yeejoin.equipmanage.common.entity.vo.EquipTypeImgAmountVO;
import
com.yeejoin.equipmanage.common.entity.vo.EquiplistSpecificBySystemVO
;
import
com.yeejoin.equipmanage.common.entity.vo.EquiplistSpecificBySystemVO
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipmentAlarmBySystemIdOrSourceIdVO
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipmentAlarmBySystemIdOrSourceIdVO
;
import
com.yeejoin.equipmanage.common.entity.vo.PointTreeVo
;
import
com.yeejoin.equipmanage.common.entity.vo.PointTreeVo
;
import
com.yeejoin.equipmanage.common.vo.AlarmDataVO
;
import
com.yeejoin.equipmanage.common.vo.*
;
import
com.yeejoin.equipmanage.common.vo.EquipmentManageVo
;
import
com.yeejoin.equipmanage.common.vo.FireFightingSystem3dVo
;
import
com.yeejoin.equipmanage.common.vo.FireFightingSystemTreeVo
;
import
com.yeejoin.equipmanage.common.vo.FireFightingSystemTypeTreeVo
;
import
com.yeejoin.equipmanage.common.vo.FireFightingSystemVo
;
import
com.yeejoin.equipmanage.common.vo.SpeIndexVo
;
public
interface
IFireFightingSystemService
extends
IService
<
FireFightingSystemEntity
>
{
public
interface
IFireFightingSystemService
extends
IService
<
FireFightingSystemEntity
>
{
...
@@ -254,4 +248,11 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
...
@@ -254,4 +248,11 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
Page
<
Map
<
String
,
Object
>>
equipmentState
(
Page
result
,
HashMap
<
String
,
Object
>
hashMap
);
Page
<
Map
<
String
,
Object
>>
equipmentState
(
Page
result
,
HashMap
<
String
,
Object
>
hashMap
);
/**
* 获取系统告警数量等信息
* @param companyCode
* @return
*/
BigScreenVo
getSystemAlarmInfoNum
(
String
companyCode
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/FireFightingSystemServiceImpl.java
View file @
62e61d7b
...
@@ -1322,4 +1322,17 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
...
@@ -1322,4 +1322,17 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
return
fireFightingSystemMapper
.
getWaterInfo
(
page
,
bizOrgCode
,
systemCode
);
return
fireFightingSystemMapper
.
getWaterInfo
(
page
,
bizOrgCode
,
systemCode
);
}
}
@Override
public
BigScreenVo
getSystemAlarmInfoNum
(
String
companyCode
)
{
BigScreenVo
bigScreenVo
=
new
BigScreenVo
();
Map
<
String
,
Object
>
systemAlarmInfoNum
=
fireFightingSystemMapper
.
getSystemAlarmInfoNum
(
companyCode
);
bigScreenVo
.
setSystemAlarmInfoNum
(
systemAlarmInfoNum
);
Map
<
String
,
Object
>
pool
=
fireFightingSystemMapper
.
getWaterPoolInfoNum
(
companyCode
,
"pool"
);
bigScreenVo
.
setPool
(
pool
);
Map
<
String
,
Object
>
industryPool
=
fireFightingSystemMapper
.
getWaterPoolInfoNum
(
companyCode
,
"industryPool"
);
bigScreenVo
.
setIndustryPool
(
industryPool
);
Integer
carNum
=
fireFightingSystemMapper
.
getCarNum
(
companyCode
);
bigScreenVo
.
setCarNum
(
carNum
);
return
bigScreenVo
;
}
}
}
amos-boot-system-equip/src/main/resources/mapper/FireFightingSystemMapper.xml
View file @
62e61d7b
...
@@ -2654,4 +2654,146 @@
...
@@ -2654,4 +2654,146 @@
</select>
</select>
<select
id=
"getSystemAlarmInfoNum"
resultType=
"java.util.Map"
>
SELECT
count( a.alarmNum > 0 OR NULL ) AS exceptionNum,
count( a.id ) AS totalSystemNum,
(
count( a.id ) - count( a.alarmNum
>
0 OR NULL )) AS normalNum,
(
TRUNCATE (
abs(((
count( a.id ) - count( a.alarmNum > 0 OR NULL )) /
IF
(( count( a.id ) = 0 ), 1, count( a.id ) ))),
0
) * 100
) AS normalAbs
FROM
(
SELECT
fs.id,
IFNULL( sum( esa.`status` ), 0 ) AS alarmNum
FROM
f_fire_fighting_system fs
LEFT JOIN cb_org_usr ou ON ou.biz_org_code = fs.biz_org_code
LEFT JOIN wl_equipment_specific_alarm esa ON FIND_IN_SET( fs.id, esa.system_ids )
<where>
<if
test=
"companyCode != null and companyCode != ''"
>
ou.`code` = #{companyCode}
</if>
</where>
GROUP BY
fs.id
) a
</select>
<select
id=
"getWaterPoolInfoNum"
resultType=
"java.util.Map"
>
SELECT
count( 1 ) AS totalNum,
count( a.nowLevel
<
a.minLevel OR NULL ) AS abnomalNum,
count( a.nowLevel
>
= a.minLevel OR NULL ) AS nomalNum,
(
TRUNCATE (
abs(((
count( a.nowLevel
>
= a.minLevel OR NULL )) /
IF
(( count( 1 ) = 0 ), 1, count( 1 ) ))),
0
) * 100
) AS normalAbs
FROM
(
SELECT
`ou`.`code` AS `code`,
ifnull( `rp`.`min_water_level`, 0 ) AS `minLevel`,
ifnull( `rp`.`max_water_level`, 0 ) AS `maxLevel`,
ifnull(
max((
CASE
WHEN ( `ei`.`name_key` = 'FHS_WirelessliquidDetector_WaterLevel' ) THEN
`ei`.`perf_value`
END
)),
ifnull( `rp`.`min_water_level`, 0 )) AS `nowLevel`
FROM
`cb_water_resource` `r`
LEFT JOIN `cb_org_usr` `ou` ON `ou`.`biz_org_code` = `r`.`biz_org_code`
LEFT JOIN `cb_water_resource_pool` `rp` ON `rp`.`resource_id` = `r`.`sequence_nbr`
LEFT JOIN `wl_equipment_specific` `es` ON `es`.`id` = `rp`.`level_device_id`
LEFT JOIN `wl_equipment_detail` `ed` ON `ed`.`id` = `es`.`equipment_detail_id`
LEFT JOIN `wl_equipment_index` `ei` ON `ei`.`equipment_id` = `ed`.`equipment_id`
WHERE
`r`.`is_delete` = 1
AND `ou`.`code` IS NOT NULL
<if
test=
"companyCode != null and companyCode != ''"
>
AND ou.`code` = #{companyCode}
</if>
AND `r`.`resource_type` = #{poolType}
GROUP BY
`r`.`sequence_nbr`
) a
</select>
<select
id=
"getWaterPoolVolumeInfo"
resultType=
"java.util.Map"
>
SELECT
IFNULL( sum( a.margin ), 0 ) AS margin,
IFNULL( sum( volume ), 0 ) AS volume
FROM
(
SELECT
`ou`.`code` AS `code`,
ifnull((
abs((
ifnull(
max((
CASE
WHEN ( `ei`.`name_key` = 'FHS_WirelessliquidDetector_WaterLevel' ) THEN
`ei`.`perf_value`
END
)),
ifnull( `rp`.`min_water_level`, 0 )) /
IF
((
ifnull( `rp`.`max_water_level`, 0 ) = 0
),
1,
ifnull( `rp`.`max_water_level`, 0 )))) * ifnull( `rp`.`volume`, 0 )),
0
) AS `margin`,
ifnull( `rp`.`volume`, 0 ) AS `volume`
FROM
`cb_water_resource` `r`
LEFT JOIN `cb_org_usr` `ou` ON `ou`.`biz_org_code` = `r`.`biz_org_code`
LEFT JOIN `cb_water_resource_pool` `rp` ON `rp`.`resource_id` = `r`.`sequence_nbr`
LEFT JOIN `wl_equipment_specific` `es` ON `es`.`id` = `rp`.`level_device_id`
LEFT JOIN `wl_equipment_detail` `ed` ON `ed`.`id` = `es`.`equipment_detail_id`
LEFT JOIN `wl_equipment_index` `ei` ON `ei`.`equipment_id` = `ed`.`equipment_id`
WHERE
`r`.`resource_type` IN ( 'pool', 'industryPool' )
AND `r`.`is_delete` = 1
AND `ou`.`code` IS NOT NULL
<if
test=
"companyCode != null and companyCode != ''"
>
AND ou.`code` = #{companyCode}
</if>
GROUP BY
`r`.`sequence_nbr`
) a
</select>
<select
id=
"getCarNum"
resultType=
"java.lang.Integer"
>
SELECT
count( wc.id ) as carNum
FROM
wl_car wc
LEFT JOIN cb_org_usr ou ON ou.amos_org_code = wc.org_code
<where>
<if
test=
"companyCode != null and companyCode != ''"
>
ou.`code` = #{companyCode}
</if>
</where>
</select>
</mapper>
</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