Commit 38bedb55 authored by suhuiguang's avatar suhuiguang

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

parent 0970fef0
...@@ -14,6 +14,7 @@ import org.springframework.http.MediaType; ...@@ -14,6 +14,7 @@ import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.Map; import java.util.Map;
...@@ -37,7 +38,7 @@ public class ConfirmAlarmController extends AbstractBaseController { ...@@ -37,7 +38,7 @@ public class ConfirmAlarmController extends AbstractBaseController {
@GetMapping(value = "/getDetailsById") @GetMapping(value = "/getDetailsById")
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "根据id,type查询确警页面相关数据") @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); return iConfirmAlarmService.getDetailsById(alamId, equipId, type, area);
} }
...@@ -63,30 +64,38 @@ public class ConfirmAlarmController extends AbstractBaseController { ...@@ -63,30 +64,38 @@ public class ConfirmAlarmController extends AbstractBaseController {
@GetMapping(value = "/getFireAlarm") @GetMapping(value = "/getFireAlarm")
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "未处理消防告警") @ApiOperation(value = "未处理消防告警")
public Map<String,Object> getFireAlarm() { public Map<String, Object> getFireAlarm() {
Map<String,Object> map = new LinkedHashMap<>(); Map<String, Object> map = new LinkedHashMap<>();
map.put("FireAlarmNum",iConfirmAlarmService.getFireAlarm().intValue()); map.put("FireAlarmNum", iConfirmAlarmService.getFireAlarm().intValue());
return map; return map;
} }
@GetMapping(value = "/getFaultAlarm") @GetMapping(value = "/getFaultAlarm")
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "未处理故障告警") @ApiOperation(value = "未处理故障告警")
public Map<String,Object> getFaultAlarm() { public Map<String, Object> getFaultAlarm() {
Map<String,Object> map = new LinkedHashMap<>(); Map<String, Object> map = new LinkedHashMap<>();
map.put("FaultAlarmNum",iConfirmAlarmService.getFaultAlarm().intValue()); map.put("FaultAlarmNum", iConfirmAlarmService.getFaultAlarm().intValue());
return map; return map;
} }
@GetMapping(value = "/getMonitorEvent") @GetMapping(value = "/getMonitorEvent")
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "未处理物联告警") @ApiOperation(value = "未处理物联告警")
public Map<String,Object> getMonitorEvent() { public Map<String, Object> getMonitorEvent() {
Map<String,Object> map = new LinkedHashMap<>(); Map<String, Object> map = new LinkedHashMap<>();
LambdaQueryWrapper<MonitorEvent> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<MonitorEvent> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(MonitorEvent::getEventState,"未处理"); queryWrapper.eq(MonitorEvent::getEventState, "未处理");
int monitorEventNum = monitorEventService.getBaseMapper().selectCount(queryWrapper); int monitorEventNum = monitorEventService.getBaseMapper().selectCount(queryWrapper);
map.put("monitorEventNum",monitorEventNum); map.put("monitorEventNum", monitorEventNum);
return map; 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; ...@@ -12,4 +12,5 @@ import com.yeejoin.equipmanage.common.entity.SourceScene;
public interface SourceSceneMapper extends BaseMapper<SourceScene> { public interface SourceSceneMapper extends BaseMapper<SourceScene> {
SourceScene queryEquipmentScene(Long equipmentSpecificId);
} }
...@@ -29,4 +29,6 @@ public interface IConfirmAlarmService extends IService<EquipmentSpecificAlarm> { ...@@ -29,4 +29,6 @@ public interface IConfirmAlarmService extends IService<EquipmentSpecificAlarm> {
* 未处理物联告警 * 未处理物联告警
*/ */
Integer getFaultAlarm(); Integer getFaultAlarm();
Map<String, Object> getEquipSceneAndRelationVideo(Long equipmentSpecificId);
} }
...@@ -58,9 +58,6 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ ...@@ -58,9 +58,6 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
@Autowired @Autowired
private ISyncDataService syncDataService;
@Autowired
MqttSendGateway mqttSendGateway; MqttSendGateway mqttSendGateway;
@Autowired @Autowired
...@@ -109,6 +106,9 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ ...@@ -109,6 +106,9 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
@Autowired @Autowired
private IFormInstanceService instanceService; private IFormInstanceService instanceService;
@Autowired
private SourceSceneMapper sourceSceneMapper;
@Override @Override
public Map<String, Object> getDetailsById(Long alarmId, Long equipId, String type, String area) { public Map<String, Object> getDetailsById(Long alarmId, Long equipId, String type, String area) {
final String videoType = "video"; final String videoType = "video";
...@@ -293,6 +293,22 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ ...@@ -293,6 +293,22 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
return confirmAlarmMapper.getFaultAlarm(); 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){ // public void sendIotSystemAlarm(EquipmentSpecificAlarmLog ent, String userId, String appKey, String product, String token){
//// Token serverToken = remoteSecurityService.getServerToken(); //// Token serverToken = remoteSecurityService.getServerToken();
// ResponseModel<List<UserDto>> responseModel = null; // ResponseModel<List<UserDto>> responseModel = null;
......
...@@ -2,4 +2,15 @@ ...@@ -2,4 +2,15 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!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"> <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> </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