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