Commit e3cf5c9a authored by 吴俊凯's avatar 吴俊凯

风险rpnr值修改

parent c46de4ff
......@@ -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);
......
......@@ -139,7 +139,7 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
@Value("${station.name}")
private String stationName;
@Value("${spring.application.name}")
private String serviceName;
......@@ -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");
......@@ -331,6 +333,7 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
if (ids.size() > 0) {
fmeaEquipmentPointMapper.updateStateByIds(state, ids);
}
final Integer st = state;
String monitor = equipmentSpecificMapper.findEquipNameById(equipmentSpecificIndex.getEquipmentSpecificId());
RsDataQueue rsDataQueue = RsDataQueue.getInstance();
......
......@@ -28,7 +28,7 @@
</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,
......@@ -47,7 +47,7 @@
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' ">
......@@ -86,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},'%' )
......@@ -119,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 ">
......
......@@ -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
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