Commit 9ae17467 authored by 高建强's avatar 高建强

item:三维预案核对修改执行

parent fa0c367b
......@@ -9,6 +9,7 @@ import com.yeejoin.amos.fas.business.feign.IEquipManageFeign;
import com.yeejoin.amos.fas.business.param.CommonPageInfoParam;
import com.yeejoin.amos.fas.business.service.intfc.IFireEquipService;
import com.yeejoin.amos.fas.business.util.FireEquipmentType;
import com.yeejoin.amos.fas.business.vo.EquipmentSpecificIndexVo;
import com.yeejoin.amos.fas.business.vo.FireStationVo;
import com.yeejoin.amos.fas.common.enums.EquipClassifyEnum;
import com.yeejoin.amos.fas.core.common.request.CommonPageable;
......@@ -18,6 +19,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -25,6 +27,11 @@ import java.util.Map;
@Service("fireEquipService")
public class FireEquipServiceImpl implements IFireEquipService {
/**
* 液位
*/
private final static String NAME_KEY = "WaterLevel";
@Autowired
FireEquipMapper fireEquipMapper;
......@@ -123,29 +130,42 @@ public class FireEquipServiceImpl implements IFireEquipService {
FireEquipmentType fireEquipmentType = FireEquipmentType.valueOf(type);
switch (fireEquipmentType) {
case pool:
case fireFoamRoom:
Object obj = equipManageFeign.findByInstanceId(id).get("result");
if (obj != null) {
ObjectMapper objectMapper = new ObjectMapper();
FireStationVo fireStationVo = objectMapper.convertValue(obj, FireStationVo.class);
fireStationVo.setType("2");
fireStationVo.setFireEquipmentInfo(this.fireEquipMapper.queryStorageEquips(id));
List<Map> equipDetails = this.fireEquipMapper.queryStorageEquips(fireStationVo.getRiskSourceId());
fireStationVo.setFireEquipmentInfo(equipDetails);
// 获取水池实时液位
List<Object> equipDetailIdList = new ArrayList<>();
if (equipDetails != null && !equipDetails.isEmpty()) {
equipDetails.stream().forEach(map -> equipDetailIdList.add(map.get("id")));
List<EquipmentSpecificIndexVo> specificIndexVos = equipmentSpecificIndexMapper.findByDetailIdInAndNameKey(equipDetailIdList, NAME_KEY);
if (specificIndexVos != null && !specificIndexVos.isEmpty()) {
fireStationVo.setLevel(specificIndexVos.get(0).getValue().concat(" ").concat(specificIndexVos.get(0).getEquipmentIndexUnitName()));
}
}
returnEntity = fireStationVo;
}
break;
// case fireFoamRoom:
// FireStation fireStation1 = fireEquipMapper.findFireStationById(id);
// fireStation1.setType("2");
// fireStation1.setFireEquipmentInfo(this.fireEquipMapper.queryStorageEquips(id));
// returnEntity = fireStation1;
// break;
case fireChamber:
case fireFoamRoom:
Object obj1 = equipManageFeign.findByInstanceId(id).get("result");
if (obj1 != null) {
ObjectMapper objectMapper = new ObjectMapper();
FireStationVo fireStationVo = objectMapper.convertValue(obj1, FireStationVo.class);
fireStationVo.setType("2");
List<Map> equipDetails = this.fireEquipMapper.queryStorageEquips(fireStationVo.getRiskSourceId());
fireStationVo.setFireEquipmentInfo(equipDetails);
returnEntity = fireStationVo;
}
case fireChamber:
Object obj2 = equipManageFeign.findByInstanceId(id).get("result");
if (obj2 != null) {
ObjectMapper objectMapper = new ObjectMapper();
FireStationVo fireStationVo = objectMapper.convertValue(obj2, FireStationVo.class);
fireStationVo.setType("1");
fireStationVo.setFireEquipmentInfo(this.fireEquipMapper.queryStorageEquips(id));
fireStationVo.setFireEquipmentInfo(this.fireEquipMapper.queryStorageEquips(fireStationVo.getRiskSourceId()));
returnEntity = fireStationVo;
}
break;
......
......@@ -466,7 +466,7 @@ public class View3dServiceImpl implements IView3dService {
List<Map<String, Object>> stateList = PlanTaskDetailStatusEnum.getEnumList();
stateList.forEach(s -> {
if(statisticsCheck !=null ) {
Long value = 0l;
Long value = 0L;
for(HashMap<String, Object> sc:statisticsCheck) {
String typeString = sc.get("type").toString();
String enumType = s.get("type").toString();
......
......@@ -49,4 +49,9 @@ public class FireStationVo {
private List<Map> fireEquipmentInfo;
/**
* 实时液位(m)
*/
private String level;
}
\ No newline at end of file
......@@ -314,12 +314,14 @@
LEFT JOIN wl_equipment we ON we.id = wed.equipment_id
LEFT JOIN wl_unit u ON u.id = we.unit_id
LEFT JOIN wl_warehouse_structure ws ON ws.id = wsd.warehouse_structure_id
LEFT JOIN f_risk_source as sce on sce.source_id = ws.source_id
WHERE
sce.id = #{riskSourceId}
GROUP BY
wsd.equipment_detail_id,
wed.`name`
<where>
<if test="riskSourceId != null">
AND ws.source_id = #{riskSourceId}
</if>
</where>
GROUP BY
wsd.equipment_detail_id,
wed.`name`
</select>
<!-- <select id="findEquipDetailsById" resultType="com.yeejoin.amos.fas.core.common.response.EquipDetailsResponse">-->
......
......@@ -485,42 +485,76 @@
<select id="getFireAlarmTop5" resultType="com.yeejoin.amos.fas.business.bo.SafetyExecuteBo">
SELECT
ala.id,
ala.equipment_specific_id AS pointId,
'monitorEquipment' AS type,
spe.CODE,
ala.equipment_specific_index_name,
CONCAT( ala.equipment_specific_index_name, '(', ala.equipment_specific_name, ')' ) AS label,
ala.update_date AS changeDate
FROM
wl_equipment_specific_alarm AS ala
LEFT JOIN wl_equipment_specific AS spe ON ala.equipment_specific_id = spe.id
WHERE ala.status = true
AND (ala.org_code = #{orgCode} OR ala.org_code like CONCAT(#{orgCode},'-%'))
AND ala.type = 'FIREALARM'
ORDER BY ala.update_date DESC
limit 0,5
ala.id,
ala.equipment_specific_id AS pointId,
'monitorEquipment' AS type,
spe. CODE,
ala.equipment_specific_index_name,
CONCAT(
ala.equipment_specific_index_name,
'(',
ala.equipment_specific_name,
')',
IF (
(
ISNULL(ws.full_name)
AND ISNULL(sd.description)
),
'',
CONCAT(
'【',
IFNULL(ws.full_name, ''),
' ',
IFNULL(sd.description, ''),
'】'
)
)
) AS label,
ala.create_date AS changeDate
FROM
wl_equipment_specific_alarm AS ala
LEFT JOIN wl_equipment_specific AS spe ON ala.equipment_specific_id = spe.id
LEFT JOIN wl_stock_detail sd ON sd.equipment_specific_id = spe.id
LEFT JOIN wl_warehouse_structure ws ON ws.id = sd.warehouse_structure_id
WHERE ala.status = true
AND (ala.org_code = #{orgCode} OR ala.org_code like CONCAT(#{orgCode},'-%'))
AND ala.type = 'FIREALARM'
ORDER BY ala.create_date DESC
limit 0,5
</select>
<select id="getEquipStatusTop5" resultType="com.yeejoin.amos.fas.business.bo.SafetyExecuteBo">
SELECT
wlesi.id,
wlesi.`value` status,
wlesi.`value` STATUS,
wlesi.update_date changeDate,
CONCAT(ed.name,' ',wlei.name) label
CONCAT(ed. NAME, ' ', wlei. NAME,IF((ISNULL(ws.full_name) AND ISNULL(sd.description)),'',CONCAT(
'【',
IFNULL(ws.full_name, ''),
' ',
IFNULL(sd.description, ''),
'】'
))) label
FROM
wl_equipment_specific_index wlesi
LEFT JOIN wl_equipment_index wlei ON wlesi.equipment_index_id = wlei.id
left join wl_equipment_specific wles on wlesi.equipment_specific_id = wles.id
left join wl_equipment_detail ed on ed.id = wles.equipment_detail_id
LEFT JOIN wl_equipment_index wlei ON wlesi.equipment_index_id = wlei.id
LEFT JOIN wl_equipment_specific wles ON wlesi.equipment_specific_id = wles.id
LEFT JOIN wl_equipment_detail ed ON ed.id = wles.equipment_detail_id
LEFT JOIN wl_stock_detail sd ON sd.equipment_specific_id = wles.id
LEFT JOIN wl_warehouse_structure ws ON ws.id = sd.warehouse_structure_id
WHERE
wles.org_code=#{orgCode}
and wlei.type_code!='BREAKDOWN'
and wlei.type_code!='FIREALARM'
and (wlesi.`value` = 'true'
OR wlesi.`value` = 'false')
ORDER BY wlesi.update_date DESC
limit 0,5
wles.org_code = '10'
AND wlei.type_code != 'BREAKDOWN'
AND wlei.type_code != 'FIREALARM'
AND (
wlesi.`value` = 'true'
OR wlesi.`value` = 'false'
)
ORDER BY
wlesi.update_date DESC
LIMIT 0,
5
</select>
<!-- <select id="getPintsByType" resultType="hashmap">-->
......
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