Commit 5b620747 authored by KeYong's avatar KeYong

Merge remote-tracking branch 'origin/develop_dl' into develop_dl

parents cf725971 19745381
......@@ -74,6 +74,6 @@ public class WaterResourcePoolDto extends BaseDto {
@ApiModelProperty("水池液位显示装置名称")
private String levelDeviceName;
@ApiModelProperty(value = "最高报警水位(m)")
@ApiModelProperty(value = "出口流量(L/s)")
private Float outputFlowRate;
}
......@@ -8,7 +8,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
*
*
*
* @author system_generator
* @date 2021-06-29
......@@ -111,4 +111,10 @@ public class WaterResourcePool extends BaseEntity {
*/
@TableField("level_device_name")
private String levelDeviceName;
/**
* 出口流量(L/s)
*/
@TableField("output_flow_rate")
private Float outputFlowRate;
}
......@@ -61,11 +61,13 @@ public class FireResourceSupervisionController extends BaseController {
ReginParams reginParams = getSelectedOrgInfo();
bizOrgCode = !ValidationUtil.isEmpty(reginParams.getPersonIdentity()) && StringUtils.isNotEmpty(reginParams.getPersonIdentity().getBizOrgCode()) ? reginParams.getPersonIdentity().getBizOrgCode() : null;
}
FireResourceStatsDTO fireSystemStats = iFireResourceSupervisionService.getFireSystemStats(bizOrgCode);
FireResourceStatsDTO fireEquipStats = iFireResourceSupervisionService.getFireEquipStats(bizOrgCode);
FireResourceStatsDTO fireCarStats = iFireResourceSupervisionService.getFireCarStats(bizOrgCode);
FireResourceStatsDTO socialPowerStats = socialPowerService.getStatistics(bizOrgCode);
Map<String, FireResourceStatsDTO> result = new HashMap<String, FireResourceStatsDTO>() {{
put("fireSystemStats", fireSystemStats);
put("fireEquipStats", fireEquipStats);
put("fireCarStats", fireCarStats);
put("socialPowerStats", socialPowerStats);
......
......@@ -110,15 +110,13 @@ public class SupervisionConfigureController extends AbstractBaseController {
// 计算可使用时间:储水量(L) / 出口流量(L/s), 单位为小时
float outputFlowRate = Float.parseFloat(m.getOrDefault("outputFlowRate", "0").toString());
if (levelAbsLiter.compareTo(new BigDecimal(0)) != 0 && outputFlowRate != 0) {
long availableSeconds = (long) (levelAbsLiter.divide(new BigDecimal(outputFlowRate), 0, RoundingMode.HALF_UP).doubleValue());
long availableHours = availableSeconds / 3600;
if (availableHours > 24) {
m.put("availableTime", availableHours / 24 + " d" + availableHours % 24 + " h");
} else {
m.put("availableTime", availableHours + "h");
}
double availableSeconds = levelAbsLiter.divide(new BigDecimal(outputFlowRate), 0, RoundingMode.HALF_UP).doubleValue();
double availableHours = availableSeconds / 3600.0;
m.put("availableTime", String.format("%.1fh", availableHours)); // 启动一台时
m.put("availableTimeOnStartTwo", String.format("%.1fh", availableHours / 2)); // 启动两台时
} else {
m.put("availableTime", "--");
m.put("availableTimeOnStartTwo", "--");
}
}
}
......@@ -127,9 +125,9 @@ public class SupervisionConfigureController extends AbstractBaseController {
@PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "监盘概览泡沫罐和水箱信息")
@GetMapping("/getFoamTank")
public ResponseModel getFoamTankBySuper(@RequestParam(value = "pageNumber", required = false) Long pageNumber,
@ApiOperation(value = "CAFS水箱和CAFS泡沫罐信息")
@GetMapping("/cafs/watertank-foamtank")
public ResponseModel getCAFSWaterTankAndFormTank(@RequestParam(value = "pageNumber", required = false) Long pageNumber,
@RequestParam(value = "pageSize", required = false) Long pageSize,
@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode
) {
......@@ -138,7 +136,7 @@ public class SupervisionConfigureController extends AbstractBaseController {
bizOrgCode = !ValidationUtil.isEmpty(reginParams.getPersonIdentity()) && StringUtil.isNotEmpty(reginParams.getPersonIdentity().getBizOrgCode()) ? reginParams.getPersonIdentity().getBizOrgCode() : null;
}
Page page = new Page<>(pageNumber, pageSize);
Page<Map<String, Object>> page1 = fireFightingSystemMapper.getFoamTank(page, bizOrgCode);
Page<Map<String, Object>> page1 = fireFightingSystemMapper.getCAFSWaterTankAndFormTank(page, bizOrgCode);
List<Map<String, Object>> res = page1.getRecords();
if (!res.isEmpty()) {
for (Map<String, Object> m : res) {
......@@ -168,13 +166,8 @@ public class SupervisionConfigureController extends AbstractBaseController {
}
float outputFlowRate = Float.parseFloat(String.valueOf(m.get("outputFlowRate")));
if (levelAbsLiter.compareTo(new BigDecimal(0)) != 0 && outputFlowRate != 0) {
long availableSeconds = (long) (levelAbsLiter.divide(new BigDecimal(outputFlowRate), 0, RoundingMode.HALF_UP).doubleValue());
long availableHours = availableSeconds / 3600;
if (availableHours > 24) {
m.put("availableTime", availableHours / 24 + " d" + availableHours % 24 + " h");
} else {
m.put("availableTime", availableHours + "h");
}
double availableSeconds = (levelAbsLiter.divide(new BigDecimal(outputFlowRate), 0, RoundingMode.HALF_UP).doubleValue());
m.put("availableTime", String.format("%.1fh", availableSeconds / 3600.0));
} else {
m.put("availableTime", "--");
}
......
......@@ -349,12 +349,12 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
Page<Map<String, Object>> getWaterInfoBySuper(Page page, @Param("bizOrgCode") String bizOrgCode);
/**
* 监盘概览泡沫罐和水箱信息
* CAFS水箱和CAFS泡沫罐信息
* @param page
* @param bizOrgCode
* @return
*/
Page<Map<String, Object>> getFoamTank(Page page, @Param("bizOrgCode") String bizOrgCode);
Page<Map<String, Object>> getCAFSWaterTankAndFormTank(Page page, @Param("bizOrgCode") String bizOrgCode);
/**
* 监盘概览泡沫罐和水箱信息(监盘概览)
......
......@@ -66,9 +66,9 @@ public class IFireResourceSupervisionServiceImpl implements IFireResourceSupervi
private FireResourceStatsDTO buildFireResourceStatsDTO(Map<String, Object> resultMap) {
FireResourceStatsDTO fireResourceStats = new FireResourceStatsDTO();
fireResourceStats.setTotalCounts(Long.valueOf(resultMap.get("totalCount").toString()));
fireResourceStats.setYellowCounts(Long.valueOf(resultMap.get("yellowCodeCount").toString()) );
fireResourceStats.setRedCounts(Long.valueOf(resultMap.get("redCodeCount").toString()));
fireResourceStats.setTotalCounts(Long.parseLong(resultMap.get("totalCount").toString()));
fireResourceStats.setYellowCounts(Long.parseLong(resultMap.get("yellowCodeCount").toString()) );
fireResourceStats.setRedCounts(Long.parseLong(resultMap.get("redCodeCount").toString()));
long expCount = fireResourceStats.getYellowCounts() + fireResourceStats.getRedCounts();
double abnormalRatio = 0;
......
......@@ -5001,8 +5001,8 @@
status ASC
</select>
<select id="getFoamTank" resultType="java.util.Map">
select
<select id="getCAFSWaterTankAndFormTank" resultType="java.util.Map">
SELECT
*,
(
CASE
......@@ -5012,7 +5012,7 @@
ELSE '4'
END
) AS status
from
FROM
(
SELECT
a.id,
......@@ -5053,7 +5053,7 @@
LEFT JOIN wl_equipment_category ec ON e.category_id = ec.id
LEFT JOIN wl_form_instance_equip fi ON fi.instance_id = es.id
WHERE
ed.`code` LIKE '92031900%'
ed.code LIKE '92031900%'
AND es.biz_org_code LIKE concat(#{bizOrgCode}, '%')
AND es.iot_code IS NOT NULL
GROUP BY
......@@ -5077,37 +5077,33 @@
ELSE '正常'
END
) AS levelStatus,
a.type AS type
'waterTank' AS type
FROM
(
SELECT
r.name,
IFNULL( rp.min_water_level, 0 ) AS minLevel,
IFNULL( rp.max_water_level, 0 ) AS maxLevel,
IFNULL( rp.output_flow_rate, 0 ) AS outputFlowRate,
IFNULL( rp.volume, 0 ) AS volume,
(
SELECT
FORMAT( avg( IFNULL( ei.`value`, 0 ) ), 2 )
FROM
wl_equipment_specific_index ei
WHERE
( ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' OR ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' )
AND FIND_IN_SET( ei.equipment_specific_id, rp.level_device_id ) > 0
) AS nowLevel,
ed.name,
es.iot_code,
es.id,
ec.image,
r.resource_type AS type,
r.sequence_nbr AS id
ei.unit,
max( CASE WHEN ei.equipment_index_key = 'CAFS_WaterTank_WaterTankLevel' THEN ei.value END ) AS nowLevel,
max( CASE WHEN fi.field_name = 'minLevel' THEN fi.field_value END ) AS minLevel,
max( CASE WHEN fi.field_name = 'maxLevel' THEN fi.field_value END ) AS maxLevel,
max( CASE WHEN fi.field_name = 'outputFlowRate' THEN fi.field_value END ) AS outputFlowRate,
max( CASE WHEN fi.field_name = 'volume' THEN fi.field_value END ) AS volume
FROM
cb_water_resource r
LEFT JOIN cb_water_resource_pool rp ON rp.resource_id = r.sequence_nbr
LEFT JOIN wl_equipment_category ec ON ec.id = r.equip_category_id
wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON es.equipment_detail_id = ed.id
LEFT JOIN wl_equipment_specific_index ei ON es.id = ei.equipment_specific_id
LEFT JOIN wl_equipment e ON e.id = ed.equipment_id
LEFT JOIN wl_equipment_category ec ON e.category_id = ec.id
LEFT JOIN wl_form_instance_equip fi ON fi.instance_id = es.id
WHERE
r.resource_type = 'waterTank'
AND r.biz_org_code LIKE concat(#{bizOrgCode}, '%')
AND r.is_delete = 1
ed.code LIKE '92032000%'
AND es.biz_org_code LIKE concat(#{bizOrgCode}, '%')
AND es.iot_code IS NOT NULL
GROUP BY
r.sequence_nbr
es.id
) a
ORDER BY
levelStatus DESC
......@@ -6483,11 +6479,11 @@
<select id="getEquipStats" resultType="java.util.Map">
SELECT
count(1) AS totalCount,
0 AS yellowCodeCount,
0 AS redCodeCount
sum(case equip_status when '1' then 1 else 0 end) AS yellowCodeCount,
sum(case equip_status when '2' then 1 else 0 end) AS redCodeCount
FROM
wl_equipment_specific wes
LEFT JOIN wl_equipment_detail wed ON wed.id = wes.equipment_detail_id
wl_equipment_specific wes
LEFT JOIN wl_equipment_detail wed ON wed.id = wes.equipment_detail_id
<where>
<if test="list != null and list.size > 0">
<foreach collection="list" item="item" index="index" open="(" close=")" separator="OR">
......
......@@ -39,8 +39,8 @@
<select id="getStatistics" resultType="com.yeejoin.equipmanage.common.entity.dto.FireResourceStatsDTO">
SELECT
COUNT(1) AS totalCounts,
0 AS yellowCounts,
0 AS redCountsrr
sum(case power_status when '1' then 1 else 0 end) AS yellowCounts,
sum(case power_status when '2' then 1 else 0 end) AS redCounts
FROM wl_social_power wsp
<where>
<if test="bizOrgCode != null and bizOrgCode != ''">
......
......@@ -3918,7 +3918,7 @@
</sql>
</changeSet>
<changeSet author="ltw" id="202403120101">
<changeSet author="lixm" id="202403120101">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="cb_water_resource_pool" columnName="output_flow_rate"/>
......@@ -3931,7 +3931,7 @@
</sql>
</changeSet>
<changeSet author="tym" id="202403120102">
<changeSet author="lixm" id="202403120102">
<preConditions onFail="MARK_RAN">
<tableExists tableName="wl_form_group_column_equip" />
<not>
......@@ -3944,4 +3944,17 @@
</sql>
</changeSet>
<changeSet author="lixm" id="202403150101">
<preConditions onFail="MARK_RAN">
<tableExists tableName="wl_form_group_column_equip" />
<not>
<primaryKeyExists primaryKeyName="sequence_nbr" tableName="wl_form_group_column_equip"/>
</not>
</preConditions>
<comment>wl_form_group_column_equip 添加表单字段</comment>
<sql>
REPLACE INTO `wl_form_group_column_equip` (`id`, `field_name`, `field_label`, `data_type`, `group_id`, `query_strategy`, `not_null`, `group_code`, `creator_id`, `create_date`) VALUES (133000000361, 'outputFlowRate', '出口流量(L/s)', 'inputNumber', 132828674828, 'eq', b'0', '92032000', 2581805, '2024-03-12 18:10:05');
</sql>
</changeSet>
</databaseChangeLog>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment