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