Commit 38bedb55 authored by suhuiguang's avatar suhuiguang

1.新增接口:查询装备下的画布及设备头信息

parent 0970fef0
......@@ -14,6 +14,7 @@ import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import java.util.LinkedHashMap;
import java.util.Map;
......@@ -37,7 +38,7 @@ public class ConfirmAlarmController extends AbstractBaseController {
@GetMapping(value = "/getDetailsById")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "根据id,type查询确警页面相关数据")
public Map<String, Object> getDetailsById(@RequestParam Long alamId, @RequestParam(required=false) Long equipId, @RequestParam(required=false) String type, @RequestParam String area) {
public Map<String, Object> getDetailsById(@RequestParam Long alamId, @RequestParam(required = false) Long equipId, @RequestParam(required = false) String type, @RequestParam String area) {
return iConfirmAlarmService.getDetailsById(alamId, equipId, type, area);
}
......@@ -63,30 +64,38 @@ public class ConfirmAlarmController extends AbstractBaseController {
@GetMapping(value = "/getFireAlarm")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "未处理消防告警")
public Map<String,Object> getFireAlarm() {
Map<String,Object> map = new LinkedHashMap<>();
map.put("FireAlarmNum",iConfirmAlarmService.getFireAlarm().intValue());
return map;
public Map<String, Object> getFireAlarm() {
Map<String, Object> map = new LinkedHashMap<>();
map.put("FireAlarmNum", iConfirmAlarmService.getFireAlarm().intValue());
return map;
}
@GetMapping(value = "/getFaultAlarm")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "未处理故障告警")
public Map<String,Object> getFaultAlarm() {
Map<String,Object> map = new LinkedHashMap<>();
map.put("FaultAlarmNum",iConfirmAlarmService.getFaultAlarm().intValue());
public Map<String, Object> getFaultAlarm() {
Map<String, Object> map = new LinkedHashMap<>();
map.put("FaultAlarmNum", iConfirmAlarmService.getFaultAlarm().intValue());
return map;
}
@GetMapping(value = "/getMonitorEvent")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "未处理物联告警")
public Map<String,Object> getMonitorEvent() {
Map<String,Object> map = new LinkedHashMap<>();
public Map<String, Object> getMonitorEvent() {
Map<String, Object> map = new LinkedHashMap<>();
LambdaQueryWrapper<MonitorEvent> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(MonitorEvent::getEventState,"未处理");
int monitorEventNum = monitorEventService.getBaseMapper().selectCount(queryWrapper);
map.put("monitorEventNum",monitorEventNum);
queryWrapper.eq(MonitorEvent::getEventState, "未处理");
int monitorEventNum = monitorEventService.getBaseMapper().selectCount(queryWrapper);
map.put("monitorEventNum", monitorEventNum);
return map;
}
@GetMapping(value = "/{equipmentSpecificId}/relation")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "查询设备画布及关联摄像头信息")
public Map<String, Object> getEquipSceneAndRelationVideo(@PathVariable Long equipmentSpecificId) {
return iConfirmAlarmService.getEquipSceneAndRelationVideo(equipmentSpecificId);
}
}
......@@ -12,4 +12,5 @@ import com.yeejoin.equipmanage.common.entity.SourceScene;
public interface SourceSceneMapper extends BaseMapper<SourceScene> {
SourceScene queryEquipmentScene(Long equipmentSpecificId);
}
......@@ -29,4 +29,6 @@ public interface IConfirmAlarmService extends IService<EquipmentSpecificAlarm> {
* 未处理物联告警
*/
Integer getFaultAlarm();
Map<String, Object> getEquipSceneAndRelationVideo(Long equipmentSpecificId);
}
......@@ -58,9 +58,6 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
@Autowired
private ISyncDataService syncDataService;
@Autowired
MqttSendGateway mqttSendGateway;
@Autowired
......@@ -109,6 +106,9 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
@Autowired
private IFormInstanceService instanceService;
@Autowired
private SourceSceneMapper sourceSceneMapper;
@Override
public Map<String, Object> getDetailsById(Long alarmId, Long equipId, String type, String area) {
final String videoType = "video";
......@@ -293,6 +293,22 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
return confirmAlarmMapper.getFaultAlarm();
}
@Override
public Map<String, Object> getEquipSceneAndRelationVideo(Long equipmentSpecificId) {
Map<String, Object> res = new HashMap<>();
// 设备关联的摄像头
List<AlamVideoVO> video = videoMapper.getVideoBySpeId(equipmentSpecificId);
video.forEach(action -> {
action.setVedioFormat(vedioFormat);
action.setUrl(videoService.getVideoUrl(action.getName(), action.getPresetPosition(), action.getUrl(), action.getCode()));
});
res.put("video", video);
// 设备所在楼层画布
SourceScene scene = sourceSceneMapper.queryEquipmentScene(equipmentSpecificId);
res.put("scene", scene);
return res;
}
// public void sendIotSystemAlarm(EquipmentSpecificAlarmLog ent, String userId, String appKey, String product, String token){
//// Token serverToken = remoteSecurityService.getServerToken();
// ResponseModel<List<UserDto>> responseModel = null;
......
......@@ -2,4 +2,15 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.equipmanage.mapper.SourceSceneMapper">
<select id="queryEquipmentScene" resultType="com.yeejoin.equipmanage.common.entity.SourceScene">
SELECT
sou.id,
sou.scene_id
FROM
wl_source_scene sou
WHERE
find_in_set(#{equipmentSpecificId},sou.point_in_scene)>0
and EXISTS (SELECT distinct fi.instance_id from wl_form_instance fi where fi.instance_id = sou.source_id)
limit 1
</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