Commit e179b4bd authored by maoying's avatar maoying

修改三维接口返回

parent f29517b0
...@@ -20,6 +20,8 @@ import io.swagger.annotations.ApiOperation; ...@@ -20,6 +20,8 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -40,6 +42,7 @@ public class FireSourceController extends BaseController { ...@@ -40,6 +42,7 @@ public class FireSourceController extends BaseController {
private IWaterResourceService iWaterResourceService; private IWaterResourceService iWaterResourceService;
@Autowired @Autowired
private IEquipmentService iEquipService; private IEquipmentService iEquipService;
private final Logger log = LoggerFactory.getLogger(FireSourceController.class);
@Permission @Permission
@ApiOperation(httpMethod = "POST", value = "添加消防装备", notes = "添加消防装备") @ApiOperation(httpMethod = "POST", value = "添加消防装备", notes = "添加消防装备")
...@@ -207,9 +210,15 @@ public class FireSourceController extends BaseController { ...@@ -207,9 +210,15 @@ public class FireSourceController extends BaseController {
@Permission @Permission
@ApiOperation(httpMethod = "GET", value = "消防状态明细信息", notes = "消防状态明细信息") @ApiOperation(httpMethod = "GET", value = "消防状态明细信息", notes = "消防状态明细信息")
@RequestMapping(value = "/info/detail", produces = "application/json;charset=UTF-8", method = RequestMethod.GET) @RequestMapping(value = "/info/detail", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse queryForEquipmentList(@ApiParam(value = "设备名称", required = true) @RequestParam Long id, public CommonResponse queryForEquipmentList(@ApiParam(value = "设备名称", required = true) @RequestParam String id,
@ApiParam(value = "设备编号", required = true) @RequestParam String type) throws Exception { @ApiParam(value = "设备编号", required = true) @RequestParam String type) throws Exception {
return CommonResponseUtil.success(iFireEquipService.queryForDetail(type, id)); try{
return CommonResponseUtil.success(iFireEquipService.queryForDetail(type, Long.valueOf(id)));
}catch (Exception e) {
log.error(e.getMessage(),e);
return CommonResponseUtil.failure("消防装备明细查询失败" + e.getMessage());
}
} }
} }
...@@ -674,8 +674,8 @@ public class RiskSourceController extends BaseController { ...@@ -674,8 +674,8 @@ public class RiskSourceController extends BaseController {
@Permission @Permission
@ApiOperation(value = "风险预警详情", notes = "风险预警详情") @ApiOperation(value = "风险预警详情", notes = "风险预警详情")
@GetMapping(value = "/warning/detail", produces = "application/json;charset=UTF-8") @GetMapping(value = "/warning/detail", produces = "application/json;charset=UTF-8")
public CommonResponse earlyWarning(@RequestParam Long riskSourceId) { public CommonResponse earlyWarning(@RequestParam String riskSourceId) {
Map map = riskSourceService.earlyWarning(riskSourceId); Map map = riskSourceService.earlyWarning(Long.valueOf(riskSourceId));
return CommonResponseUtil.success(map); return CommonResponseUtil.success(map);
} }
......
...@@ -506,12 +506,13 @@ ...@@ -506,12 +506,13 @@
SELECT SELECT
wlesi.id, wlesi.id,
wlesi.`value` status, wlesi.`value` status,
wlesi.create_date changeDate, wlesi.update_date changeDate,
CONCAT(wlei.group_name,wlei.name) label CONCAT(ed.name,' ',wlei.name) label
FROM FROM
wl_equipment_specific_index wlesi wl_equipment_specific_index wlesi
LEFT JOIN wl_equipment_index wlei ON wlesi.equipment_index_id = wlei.id LEFT JOIN wl_equipment_index wlei ON wlesi.equipment_index_id = wlei.id
left join wl_equipment_specific wles on wlesi.equipment_specific_id = wles.id left join wl_equipment_specific wles on wlesi.equipment_specific_id = wles.id
left join wl_equipment_detail ed on ed.id = wles.equipment_detail_id
WHERE WHERE
wles.org_code=#{orgCode} wles.org_code=#{orgCode}
and wlei.type_code!='BREAKDOWN' and wlei.type_code!='BREAKDOWN'
...@@ -1325,7 +1326,7 @@ ...@@ -1325,7 +1326,7 @@
<select id="retrieveAll" resultType="java.util.HashMap"> <select id="retrieveAll" resultType="java.util.HashMap">
select *,'{ "x": 0, "y": 0, "z": 0 }' rotationDTO,'{ "x": 1, "y": 1, "z": 1 }' scaleDTO select *,'{ "x": 0, "y": 0, "z": 0 }' rotationDTO,'{ "x": 1, "y": 1, "z": 1 }' scaleDTO
from (select concat('riskSource-',r.id) as id,r.id as originId,r.name,r.code,r.ue4_location as ue4Location,r.ue4_rotation as ue4Rotation ,'riskSource' as type,r.org_code as orgCode, from (select concat('riskSource-',r.id) as id,concat(r.id) as originId,r.name,r.code,r.ue4_location as ue4Location,r.ue4_rotation as ue4Rotation ,'riskSource' as type,r.org_code as orgCode,
rl.level as level,rl.name as levelStr,r.is_indoor as isIndoor,'风险点' as typeName,'riskSource' as typeCode, rl.level as level,rl.name as levelStr,r.is_indoor as isIndoor,'风险点' as typeName,'riskSource' as typeCode,
CASE CASE
WHEN ( WHEN (
...@@ -1353,7 +1354,8 @@ ...@@ -1353,7 +1354,8 @@
'' as person, '' as person,
r.rpn as title, r.rpn as title,
CONCAT('riskSource-',r.id) as `key`, CONCAT('riskSource-',r.id) as `key`,
r.id as riskSourceId r.id as riskSourceId,
'' as room
from f_risk_source r from f_risk_source r
left join f_risk_level rl ON rl.id = r.risk_level_id left join f_risk_level rl ON rl.id = r.risk_level_id
where r.is_region = 'FALSE' where r.is_region = 'FALSE'
...@@ -1361,7 +1363,7 @@ ...@@ -1361,7 +1363,7 @@
AND rl.level = #{dataLevel} AND rl.level = #{dataLevel}
</if> </if>
UNION all UNION all
select concat('patrol-',p.id) as id,p.id as originId,p.name,p.point_no as code,p.ue4_location as ue4Location,p.ue4_rotation as ue4Rotation ,'patrol' as type,p.org_code as orgCode, select concat('patrol-',p.id) as id,concat(p.id) as originId,p.name,p.point_no as code,p.ue4_location as ue4Location,p.ue4_rotation as ue4Rotation ,'patrol' as type,p.org_code as orgCode,
p.status as level,CONCAT('level_',p.status) as levelStr,p.is_indoor as isIndoor,'巡检点' as typeName,'patrol' as typeCode, p.status as level,CONCAT('level_',p.status) as levelStr,p.is_indoor as isIndoor,'巡检点' as typeName,'patrol' as typeCode,
CASE CASE
WHEN ( WHEN (
...@@ -1394,11 +1396,13 @@ ...@@ -1394,11 +1396,13 @@
when p.status = '3' then '漏检' when p.status = '3' then '漏检'
end as title, end as title,
concat('patrol-',p.id) as `key`, concat('patrol-',p.id) as `key`,
p.risk_source_id as riskSourceId p.risk_source_id as riskSourceId,
r.name as room
from p_point p from p_point p
left join f_risk_source r on r.id = p.risk_source_id
WHERE is_delete = FALSE WHERE is_delete = FALSE
UNION all UNION all
select concat('impEquipment-',id) as id,id as originId,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'impEquipment' as type,org_code as orgCode, select concat('impEquipment-',e.id) as id,concat(e.id) as originId,e.name,e.code,e.ue4_location as ue4Location,e.ue4_rotation as ue4Rotation ,'impEquipment' as type,e.org_code as orgCode,
0 as level,'level_0' as levelStr,e.is_indoor as isIndoor,'重点设备' as typeName,'impEquipment' as typeCode, 0 as level,'level_0' as levelStr,e.is_indoor as isIndoor,'重点设备' as typeName,'impEquipment' as typeCode,
CASE CASE
WHEN ( WHEN (
...@@ -1424,12 +1428,14 @@ ...@@ -1424,12 +1428,14 @@
e.name as protectObjName, e.name as protectObjName,
'' as routeName, '' as routeName,
'' as person, '' as person,
name as title, e.name as title,
concat('impEquipment-',e.id) as `key`, concat('impEquipment-',e.id) as `key`,
e.risk_source_id as riskSourceId e.risk_source_id as riskSourceId,
r.name as room
from f_equipment e from f_equipment e
left join f_risk_source r on r.id = e.risk_source_id
UNION all UNION all
select concat('monitorEquipment-',m.id) as id,m.id as originId,det.name,m.code as code,'' as ue4Location,'' as ue4Rotation ,'monitorEquipment' as type,m.org_code as orgCode, select concat('monitorEquipment-',m.id) as id,concat(m.id) as originId,det.name,m.code as code,'' as ue4Location,'' as ue4Rotation ,'monitorEquipment' as type,m.org_code as orgCode,
null as level , concat('level_',null) as levelStr,null as isIndoor,'探测器' as typeName,'monitorEquipment' as typeCode, null as level , concat('level_',null) as levelStr,null as isIndoor,'探测器' as typeName,'monitorEquipment' as typeCode,
CASE CASE
WHEN ( WHEN (
...@@ -1457,7 +1463,8 @@ ...@@ -1457,7 +1463,8 @@
'' as person, '' as person,
det.name as title, det.name as title,
concat('monitorEquipment-',m.id) as `key`, concat('monitorEquipment-',m.id) as `key`,
str.source_id as riskSourceId str.source_id as riskSourceId,
str.full_name as room
from wl_equipment_specific m from wl_equipment_specific m
left join wl_equipment_detail as det on m.equipment_detail_id = det.id left join wl_equipment_detail as det on m.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
...@@ -1467,12 +1474,12 @@ ...@@ -1467,12 +1474,12 @@
left join f_equipment_fire_equipment fe on fe.fire_equipment_id = m.id left join f_equipment_fire_equipment fe on fe.fire_equipment_id = m.id
left join f_equipment f on f.id = fe.equipment_id left join f_equipment f on f.id = fe.equipment_id
where substr(cat.code ,1,4) = '8501' where substr(cat.code ,1,4) = '8501'
group By m.code
<if test="protectObjName != null and protectObjName != ''"> <if test="protectObjName != null and protectObjName != ''">
AND f.name = #{protectObjName} AND f.name = #{protectObjName}
</if> </if>
group By m.code
UNION all UNION all
select concat('video-',vi.id) as id,vi.id as originId,vi.name,vi.code,null as ue4Location,null as ue4Rotation ,'video' as type,vi.org_code as orgCode, select concat('video-',vi.id) as id,concat(vi.id) as originId,vi.name,vi.code,null as ue4Location,null as ue4Rotation ,'video' as type,vi.org_code as orgCode,
null as level , concat('level_',null) as levelStr,null as isIndoor,'摄像头' as typeName,'video' as typeCode, null as level , concat('level_',null) as levelStr,null as isIndoor,'摄像头' as typeName,'video' as typeCode,
CASE CASE
WHEN ( WHEN (
...@@ -1500,7 +1507,8 @@ ...@@ -1500,7 +1507,8 @@
'' as person, '' as person,
vi.name as title, vi.name as title,
concat('video-',vi.id) as `key`, concat('video-',vi.id) as `key`,
vis.source_id as riskSourceId vis.source_id as riskSourceId,
sou.name as room
from wl_video as vi from wl_video as vi
left join wl_video_source as vis on vi.id = vis.video_id left join wl_video_source as vis on vi.id = vis.video_id
left join f_risk_source as sou on sou.id = vis.source_id left join f_risk_source as sou on sou.id = vis.source_id
...@@ -1508,7 +1516,7 @@ ...@@ -1508,7 +1516,7 @@
group by vi.id group by vi.id
UNION all UNION all
select concat('hydrant-',spe.id) as id,spe.id as originId,det.name,spe.code as code,null as ue4Location,null as ue4Rotation ,'hydrant' as type,spe.org_code as orgCode, select concat('hydrant-',spe.id) as id,concat(spe.id) as originId,det.name,spe.code as code,null as ue4Location,null as ue4Rotation ,'hydrant' as type,spe.org_code as orgCode,
0 as level , 'level_0' as levelStr,null as isIndoor,'消防栓' as typeName,'fireEquipment' as typeCode, 0 as level , 'level_0' as levelStr,null as isIndoor,'消防栓' as typeName,'fireEquipment' as typeCode,
CASE CASE
WHEN ( WHEN (
...@@ -1536,7 +1544,8 @@ ...@@ -1536,7 +1544,8 @@
'' as person, '' as person,
det.name as title, det.name as title,
concat('hydrant-',spe.id) as `key`, concat('hydrant-',spe.id) as `key`,
str.source_id as riskSourceId str.source_id as riskSourceId,
str.full_name as room
from from
wl_equipment_specific as spe wl_equipment_specific as spe
left join wl_equipment_detail as det on spe.equipment_detail_id = det.id left join wl_equipment_detail as det on spe.equipment_detail_id = det.id
...@@ -1546,7 +1555,7 @@ ...@@ -1546,7 +1555,7 @@
left join wl_warehouse_structure as str on sto.warehouse_structure_id = str.id left join wl_warehouse_structure as str on sto.warehouse_structure_id = str.id
where substr(cat.code ,1,4)= '3105' where substr(cat.code ,1,4)= '3105'
UNION all UNION all
select concat('pool-',bu.id) as id,bu.id as originId,bu.name,bu.code,null as ue4Location,null as ue4Rotation,'pool' as type,bu.org_code as orgCode, select concat('pool-',bu.id) as id,concat(bu.id) as originId,bu.name,bu.code,null as ue4Location,null as ue4Rotation,'pool' as type,bu.org_code as orgCode,
0 as level , 'level_0' as levelStr,null as isIndoor,'消防水池' as typeName,'fireEquipment' as typeCode, 0 as level , 'level_0' as levelStr,null as isIndoor,'消防水池' as typeName,'fireEquipment' as typeCode,
CASE CASE
WHEN ( WHEN (
...@@ -1574,12 +1583,13 @@ ...@@ -1574,12 +1583,13 @@
'' as person, '' as person,
bu.name as title, bu.name as title,
concat('pool-',bu.id) as `key`, concat('pool-',bu.id) as `key`,
bu.region_id as riskSourceId bu.region_id as riskSourceId,
bu.address as room
from wl_building as bu from wl_building as bu
left join wl_equipment_category as cat on bu.equipment_code = cat.id left join wl_equipment_category as cat on bu.equipment_code = cat.id
where substr(cat.code ,1,4) = 9302 where substr(cat.code ,1,4) = 9302
UNION all UNION all
select concat('fireCar-',car.id) as id,car.id as originId,car.name,car.car_num as code,null as ue4Location,null as ue4Rotation, 'fireCar' as type,car.org_code as orgCode, select concat('fireCar-',car.id) as id,concat(car.id) as originId,car.name,car.car_num as code,null as ue4Location,null as ue4Rotation, 'fireCar' as type,car.org_code as orgCode,
0 as level , 'level_0' as levelStr,null as isIndoor,'消防车' as typeName,'fireEquipment' as typeCode, 0 as level , 'level_0' as levelStr,null as isIndoor,'消防车' as typeName,'fireEquipment' as typeCode,
CASE CASE
WHEN ( WHEN (
...@@ -1607,12 +1617,13 @@ ...@@ -1607,12 +1617,13 @@
'' as person, '' as person,
car.name as title, car.name as title,
concat('fireCar-',car.id) as `key`, concat('fireCar-',car.id) as `key`,
#{riskSourceId} as riskSourceId #{riskSourceId} as riskSourceId,
'' as room
from wl_car as car from wl_car as car
left join wl_equipment as equ on car.equipment_id = equ.id left join wl_equipment as equ on car.equipment_id = equ.id
left join wl_equipment_category as cat on equ.category_id = cat.id left join wl_equipment_category as cat on equ.category_id = cat.id
UNION all UNION all
select concat('fireEquipment-',spe.id) as id,spe.id as originId,det.name,spe.code as code,null as ue4Location,null as ue4Rotation,'fireEquipment' as type,spe.org_code as orgCode, select concat('extinguisher-',spe.id) as id,concat(spe.id) as originId,det.name,spe.code as code,null as ue4Location,null as ue4Rotation,'extinguisher' as type,spe.org_code as orgCode,
null as level , concat('level_',null) as levelStr,null as isIndoor,'灭火器' as typeName,'fireEquipment' as typeCode, null as level , concat('level_',null) as levelStr,null as isIndoor,'灭火器' as typeName,'fireEquipment' as typeCode,
CASE CASE
WHEN ( WHEN (
...@@ -1639,8 +1650,9 @@ ...@@ -1639,8 +1650,9 @@
'' as routeName, '' as routeName,
'' as person, '' as person,
det.name as title, det.name as title,
concat('fireEquipment-',spe.id) as `key`, concat('extinguisher-',spe.id) as `key`,
str.source_id as riskSourceId str.source_id as riskSourceId,
str.full_name as room
from wl_equipment_specific as spe from wl_equipment_specific as spe
left join wl_equipment_detail as det on spe.equipment_detail_id = det.id left join wl_equipment_detail as det on spe.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
...@@ -1649,7 +1661,7 @@ ...@@ -1649,7 +1661,7 @@
left join wl_warehouse_structure as str on sto.warehouse_structure_id = str.id left join wl_warehouse_structure as str on sto.warehouse_structure_id = str.id
where substr(cat.code ,1,4) = '3104' where substr(cat.code ,1,4) = '3104'
UNION all UNION all
select concat('fireChamber-',bu.id) as id,bu.id as originId,bu.name,bu.code,null as ue4Location,null as ue4Rotation , 'fireChamber' as type,bu.org_code as orgCode, select concat('fireChamber-',bu.id) as id,concat(bu.id) as originId,bu.name,bu.code,null as ue4Location,null as ue4Rotation , 'fireChamber' as type,bu.org_code as orgCode,
0 as level , 'level_0' as levelStr,null as isIndoor,'泡沫间' as typeName,'fireEquipment' as typeCode, 0 as level , 'level_0' as levelStr,null as isIndoor,'泡沫间' as typeName,'fireEquipment' as typeCode,
CASE CASE
WHEN ( WHEN (
...@@ -1677,12 +1689,13 @@ ...@@ -1677,12 +1689,13 @@
'' as person, '' as person,
bu.name as title, bu.name as title,
concat('fireChamber-',bu.id) as `key`, concat('fireChamber-',bu.id) as `key`,
bu.region_id as riskSourceId bu.region_id as riskSourceId,
bu.address as room
from wl_building as bu from wl_building as bu
left join wl_equipment_category as cat on bu.equipment_code = cat.id left join wl_equipment_category as cat on bu.equipment_code = cat.id
where substr(cat.code ,1,4) = 9305 where substr(cat.code ,1,4) = 9305
UNION all UNION all
select concat('fireFoamRoom-',bu.id) as id,bu.id as originId,bu.name,bu.code,null as ue4Location,null as ue4Rotation , 'fireFoamRoom' as type,bu.org_code as orgCode, select concat('fireFoamRoom-',bu.id) as id,concat(bu.id) as originId,bu.name,bu.code,null as ue4Location,null as ue4Rotation , 'fireFoamRoom' as type,bu.org_code as orgCode,
0 as level , 'level_0' as levelStr,null as isIndoor,'消防室' as typeName,'fireEquipment' as typeCode, 0 as level , 'level_0' as levelStr,null as isIndoor,'消防室' as typeName,'fireEquipment' as typeCode,
CASE CASE
WHEN ( WHEN (
...@@ -1710,7 +1723,8 @@ ...@@ -1710,7 +1723,8 @@
'' as person, '' as person,
bu.name as title, bu.name as title,
concat('fireFoamRoom-',bu.id) as `key`, concat('fireFoamRoom-',bu.id) as `key`,
bu.region_id as riskSourceId bu.region_id as riskSourceId,
bu.address as room
from wl_building as bu from wl_building as bu
left join wl_equipment_category as cat on bu.equipment_code = cat.id left join wl_equipment_category as cat on bu.equipment_code = cat.id
where substr(cat.code ,1,4) = '9301' where substr(cat.code ,1,4) = '9301'
......
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