Commit 9d275146 authored by 王果's avatar 王果

36278 子 【验收优化】水池页面添加阈值显示 / 后端接口修改

parent 291504ba
......@@ -736,6 +736,7 @@ public class SupervisionConfigureController extends AbstractBaseController {
if (ObjectUtils.isEmpty(map) || ObjectUtils.isEmpty(map.get("iot_code"))) {
return CommonResponseUtil.success(null);
}
Map<String, Object> poolMaxAndMinMap = fireFightingSystemMapper.getPoolMaxAndMinLimit(equipmentSpecificId);
List<EquipmentSpecificIndex> equipmentSpecificIndexes = equipmentSpecificIndexService.getEquipmentSpeIndexByEquipmentSecificId(Long.valueOf(equipmentSpecificId));
String fieldKey = "";
for (EquipmentSpecificIndex equipmentSpecificIndex : equipmentSpecificIndexes) {
......@@ -786,6 +787,21 @@ public class SupervisionConfigureController extends AbstractBaseController {
map1.put("name", "水池液位");
map1.put("xData", res.stream().map(x -> x.get("time")).collect(Collectors.toList()));
map1.put("yData", res.stream().map(x -> x.get("value")).collect(Collectors.toList()));
List<List<String>> threshold = new ArrayList<>();
List<String> maxMinInfo = new ArrayList<>();
if(map.containsKey("minNum")&&!ObjectUtils.isEmpty(map.get("minNum"))){
maxMinInfo.add(map.get("minNum").toString());
}else {
maxMinInfo.add("0");
}
if(map.containsKey("maxNum")&&!ObjectUtils.isEmpty(map.get("maxNum"))){
maxMinInfo.add(map.get("maxNum").toString());
}else {
maxMinInfo.add("0");
}
threshold.add(maxMinInfo);
map1.put("threshold", threshold);
Map<String, Object> resMap = new HashMap<>();
resMap.put("scyw", map1);
return CommonResponseUtil.success(resMap);
......
......@@ -793,5 +793,7 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
List<LinkedHashMap<String, Object>> getOtherFireEquipStatistic(@Param("collect") List<String> collect, @Param("bizOrgCode")String bizOrgCode);
List<EquipCountBySystemVO> getFireEquipConfigInfo(@Param("codes") List<String> codes, @Param("bizOrgCode")String bizOrgCode);
Map<String, Object> getPoolMaxAndMinLimit(@Param("id") String id);
}
......@@ -6,13 +6,11 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yeejoin.amos.component.robot.BadRequest;
import com.yeejoin.equipmanage.common.entity.Equipment;
import com.yeejoin.equipmanage.common.entity.FireFightingSystemEntity;
import com.yeejoin.equipmanage.common.entity.FireFightingSystemGroupEntity;
import com.yeejoin.equipmanage.common.entity.SystemEquipmentRelationEntity;
import com.yeejoin.equipmanage.common.entity.*;
import com.yeejoin.equipmanage.common.entity.dto.CoreEquipmentsDto;
import com.yeejoin.equipmanage.common.entity.dto.FireFightingSystemGroupModalDto;
import com.yeejoin.equipmanage.common.entity.dto.SystemEquipmentsDto;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificAlarmMapper;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificMapper;
import com.yeejoin.equipmanage.mapper.FireFightingSystemGroupMapper;
import com.yeejoin.equipmanage.mapper.FireFightingSystemMapper;
......@@ -45,6 +43,8 @@ public class FireFightingSystemGroupServiceImpl extends ServiceImpl<FireFighting
private IFireFightingSystemService fireFightingSystemService;
@Autowired
private IEquipmentService equipmentService;
@Autowired
EquipmentSpecificAlarmMapper equipmentSpecificAlarmMapper;
/**
* 获取消防系统列表
......@@ -284,14 +284,19 @@ public class FireFightingSystemGroupServiceImpl extends ServiceImpl<FireFighting
List<Long> entitySystemIds = Arrays.stream(groupEntity.getSystemIds().split(",")).map(Long::parseLong).collect(Collectors.toList());
int size = entitySystemIds.size();
for (int i = 0; i < size; i++) {
Long systemId = entitySystemIds.get(i);
JSONObject system = new JSONObject();
FireFightingSystemEntity systemEntity = systemMap.get(systemId);
int equipmentSpeCount = equipmentSpecificMapper.getSystemAlarmNum(systemId);
Integer count = equipmentSpecificAlarmMapper.selectCount(
Wrappers.<EquipmentSpecificAlarm>lambdaQuery()
.like(EquipmentSpecificAlarm::getSystemIds, systemId)
.eq(EquipmentSpecificAlarm::getStatus, "1")
.likeRight(StringUtils.hasText(bizOrgCode), EquipmentSpecificAlarm::getBizOrgCode, bizOrgCode)
);
List<SystemEquipmentRelationEntity> relationEntities = Objects.nonNull(systemEquipmentMap.get(systemId)) ? systemEquipmentMap.get(systemId) : new ArrayList<>();
system.put("id", systemId);
system.put("alarmCount", count);
system.put("code", systemEntity.getCode());
system.put("typeCode", systemEntity.getSystemTypeCode());
system.put("name", systemEntity.getName());
......
......@@ -7770,4 +7770,24 @@
ORDER BY
update_date DESC
</select>
<select id="getPoolMaxAndMinLimit" resultType="java.util.Map">
SELECT
GROUP_CONCAT( c.iot_code ) AS iotCode,
b.min_water_level AS minNum,
b.max_water_level AS maxNum
FROM
`cb_water_resource` AS a
LEFT JOIN cb_water_resource_pool b ON a.sequence_nbr = b.resource_id
LEFT JOIN wl_equipment_specific c ON FIND_IN_SET( c.id, b.level_device_id )
WHERE
b.level_device_id IS NOT NULL
AND b.level_device_id != ''
AND a.resource_type IN ( 'pool', 'industryPool' )
and c.id = #{id}
GROUP BY
a.sequence_nbr
HAVING
iotCode IS NOT NULL
AND iotCode != ''
</select>
</mapper>
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