Commit 0465b044 authored by KeYong's avatar KeYong

Merge branch 'dev_upgrade' of 172.16.10.76:station/YeeAmosFireAutoSysRoot into eqintegration

# Conflicts: # YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/StationInfo.java
parents 00f018b8 fcd48005
......@@ -5,6 +5,8 @@ import com.yeejoin.amos.component.rule.RuleFact;
import lombok.Data;
import java.security.acl.LastOwnerException;
@RuleFact(value = "消防设备",project = "青海风险管控")
@Data
public class FireEquimentDataRo extends BasicsRo
......@@ -15,7 +17,7 @@ public class FireEquimentDataRo extends BasicsRo
*/
private static final long serialVersionUID = 5243181171363622140L;
private long fireEquimentId;
private Long fireEquimentId;
private String fireEqumentName;
@Label("设备id")
private Long id;//监测点id
......
......@@ -57,8 +57,6 @@ public interface FireEquipMapper extends BaseMapper {
EquipDetailsResponse findEquipDetailsById(@Param("id") Long id);
List<EquipCommunicationData> findAllEquipPointInfo();
EquipCommunicationData findOneByPointCode(@Param("code") String code);
void saveBatch(List<FireEquipmentParam> list);
......
......@@ -12,6 +12,10 @@ import java.util.Optional;
import javax.annotation.PostConstruct;
import com.yeejoin.amos.fas.business.dao.mapper.EquipmentSpecificMapper;
import com.yeejoin.amos.fas.business.vo.EquipmentSpecificVo;
import com.yeejoin.amos.fas.core.util.StringUtil;
import com.yeejoin.amos.fas.dao.entity.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -29,6 +33,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.multipart.MultipartFile;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
......@@ -72,6 +77,8 @@ public class EquipmentServiceImpl implements IEquipmentService {
FireEquipMapper fireEquipMapper;
@Autowired
EquipmentSpecificMapper equipmentSpecificMapper;
@Autowired
IEquipmentDao iEquipmentDao;
@Autowired
IPreplanPictureDao iPreplanPictureDao;
......@@ -206,9 +213,10 @@ public class EquipmentServiceImpl implements IEquipmentService {
Map<String, Object> result = new HashMap<>();
result.put("exits", false);
Equipment equipment = this.iEquipmentDao.getOne(equipmentFireEquipment.getEquipmentId().longValue());
FireEquipment fireEquipment = iFireEquipmentDao.getOne(equipmentFireEquipment.getFireEquipmentId().longValue());
if (equipment == null || fireEquipment == null)
throw new Exception("找不到数据");
String equipmentSpecific = equipmentSpecificMapper.findEquipNameById(equipmentFireEquipment.getFireEquipmentId());
if (equipment == null || StringUtils.isEmpty(equipmentSpecific))
throw new RuntimeException("找不到数据");
this.equipmentFireEquipmentDao.save(equipmentFireEquipment);
//已存在的绑定关系
List<EquipmentFireEquipment> exits = impAndFireEquipMapper.queryForList(String.valueOf(equipmentFireEquipment.getFireEquipmentId()), null);
......@@ -459,21 +467,6 @@ public class EquipmentServiceImpl implements IEquipmentService {
return iEquipmentDao.findAll();
}
@Override
@PostConstruct
public void findAllEquipPointInfo() {
List<EquipCommunicationData> list = fireEquipMapper.findAllEquipPointInfo();
if (!ObjectUtils.isEmpty(list)) {
HashMap<String, EquipCommunicationData> map = new HashMap<>();
list.forEach(data -> {
map.put(data.getPointCode(), data);
});
redisTemplate.opsForHash().putAll("fireEquipData", map);
}
}
@Override
public EquipCommunicationData findFireEquipmentByPointCode(String code) {
// EquipCommunicationData data = (EquipCommunicationData) redisTemplate.opsForHash().get("fireEquipData", code);
......
......@@ -186,6 +186,8 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
} else { // 向三维推送实时值修改
log.info("(监测)Message type is: " + equipmentSpecificIndex.getType());
// 是否关联风险点
notifyAlarm(equipmentSpecificIndex, 0);
Map<String, Object> content = new HashMap<>();
content.put("id", "id");
content.put("label", "eqPointName");
......
......@@ -97,8 +97,6 @@ public interface IEquipmentService {
*/
List<Equipment> findAll();
void findAllEquipPointInfo();
EquipCommunicationData findFireEquipmentByPointCode(String code);
EquipCommunicationData findFireEquipDataByPointCode(String code);
......
......@@ -20,6 +20,11 @@ public class EquipmentSpecificVo {
//是否单件管理(1是多件)
private Integer single;
//IOT编码
private String iotCode;
//装备编码
private String specificCode;
//系统名称
private String systemName;
}
......@@ -28,14 +28,18 @@
</delete>
<select id="getEquipmentBySpe" resultType="com.yeejoin.amos.fas.business.vo.EquipmentSpecificVo">
select
sto.id as id ,
spe.id as id ,
equ.code as code,
det.name as name,
cate.name as type,
if(fire.fire_equipment_id is null ,'NO','YES') as isbind,
ware.full_name as address,
spe.single as single,
sto.amount as amount
sto.amount as amount,
spe.iot_code,
spe.code as specific_code,
spe.system_id,
manage.name as system_name
from
wl_stock_detail as sto
left join wl_equipment_specific as spe on sto.qr_code = spe.qr_code
......@@ -43,7 +47,8 @@
left join wl_equipment_detail as det on sto.equipment_detail_id = det.id
left join wl_equipment as equ on det.equipment_id = equ.id
left join wl_equipment_category as cate on equ.category_id = cate.id
left join f_equipment_fire_equipment as fire on sto.id = fire.fire_equipment_id
left join f_equipment_fire_equipment as fire on spe.id = fire.fire_equipment_id
left join f_equipment_manage as manage on spe.system_id = manage.SEQUENCE_NBR
where sto.amount <![CDATA[>]]> 0
<if test="name != null and name!='null' ">
and det.name like CONCAT('%',#{name},'%' )
......@@ -81,14 +86,14 @@
</select>
<select id="getFireEquiments" resultType="com.yeejoin.amos.fas.business.vo.EquipmentSpeVo">
select
sto.id as id ,
sto.equipment_specific_id as id ,
equ.code as f_code,
det.name as f_name
from
wl_stock_detail as sto
left join wl_equipment_detail as det on sto.equipment_detail_id = det.id
left join wl_equipment as equ on det.equipment_id = equ.id
left join f_equipment_fire_equipment as fire on sto.id = fire.fire_equipment_id
left join f_equipment_fire_equipment as fire on sto.equipment_specific_id = fire.fire_equipment_id
where sto.amount <![CDATA[>]]> 0
<if test="fname != null and fname!='null' ">
and det.name like CONCAT('%',#{fname},'%' )
......@@ -114,9 +119,9 @@
d.important_equipment_id = #{importantEquipId} ) isBound
from
f_equipment_fire_equipment as fire
left join wl_stock_detail as sto on fire.fire_equipment_id = sto.id
left join wl_stock_detail as sto on fire.fire_equipment_id = sto.equipment_specific_id
left join wl_equipment_specific as spe on sto.qr_code = spe.qr_code
left join wl_equipment_specific_index as speind on spe.id = speind.equipment_specific_id
left join wl_equipment_specific_index as speind on sto.equipment_specific_id = speind.equipment_specific_id
left join wl_equipment_index as equindex on speind.equipment_index_id = equindex.id
where equindex.type_code ='BREAKDOWN'
<if test="importantEquipId != null ">
......
......@@ -324,25 +324,6 @@
</where>
</select>
<select id="findAllEquipPointInfo" resultType="com.yeejoin.amos.fas.business.vo.EquipCommunicationData">
SELECT
p.`code` pointCode,
p.`name` pointName,
f.`name` equimentName,
f.id equimentId,
e.id fireEquipmentId,
e.`name` fireEquipmentName,
e.code fireEquipmentCode,
p.type,
d.dict_value alarmType,
p.unit
FROM
f_fire_equipment_point p
LEFT JOIN f_fire_equipment e ON e.id = p.fire_equipment_id
LEFT JOIN f_equipment_fire_equipment fe ON fe.fire_equipment_id = e.id
LEFT JOIN f_equipment f ON f.id = fe.equipment_id
LEFT JOIN f_dict d on d.id = p.alarm_type
</select>
<select id="findOneByPointCode" resultType="com.yeejoin.amos.fas.business.vo.EquipCommunicationData">
SELECT
......
......@@ -438,12 +438,12 @@
</delete>
<select id="getPointsByEquipmentIdAndType" resultType="Map">
<!-- SELECT p.* from
SELECT p.* from
f_fire_equipment_point p
LEFT JOIN f_fire_equipment fe on p.fire_equipment_id = fe.id
LEFT JOIN f_equipment_fire_equipment e on fe.id = e.fire_equipment_id
where e.equipment_id = #{id}
and p.type = #{type} -->
and p.type = #{type}
</select>
</mapper>
\ No newline at end of file
......@@ -974,7 +974,6 @@
fe.is_indoor as inDoor,
case
when fe.equip_classify = 0 then CONCAT('monitorEquipment',fe.id)
when fe.equip_classify = 2 then CONCAT('video',fe.id)
when fe.equip_classify = 3 then CONCAT('fireEquipment',fe.id)
end as `key`,
fe.name,
......@@ -1007,7 +1006,6 @@
fe.name as title,
case
when fe.equip_classify = 0 then 'monitorEquipment'
when fe.equip_classify = 2 then 'video'
when fe.equip_classify = 3 then 'fireEquipment'
end as type,
fe.org_code as orgCode,
......@@ -1117,6 +1115,40 @@
where rs.id is not null
AND s.position3d != '' AND s.position3d is not null
UNION ALL
SELECT
wlv.CODE,
wlv.id,
'' AS inDoor,
CONCAT( 'video', wlv.id ) AS `key`,
wlv.NAME,
'' AS LEVEL,
'' AS levelStr,
'' AS objKey,
CONCAT(
'{"x":',
substring_index( wlv.position3d, ',', 1 ),
',"y":',
substring_index( substring_index( wlv.position3d, ',', - 2 ), ',', 1 ),
',"z":',
substring_index( wlv.position3d, ',', - 1 ),
'}'
)
as positionDTO,
'{ "x": 0, "y": 0, "z": 0 }' rotationDTO,
'{ "x": 1, "y": 1, "z": 1 }' scaleDTO,
FALSE AS `showInfo`,
wlv.NAME AS title,
'video' AS type,
wlv.org_code AS orgCode,
'' AS riskSourceId,
0 AS frequency,
FALSE AS twinkle
FROM
wl_video wlv
WHERE
wlv.position3d != ''
AND wlv.position3d IS NOT NULL
union all
select
w.code,
w.id,
......
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