Commit 13dcc79b authored by 单奇雲's avatar 单奇雲

调试接口

parent 0cb2f733
......@@ -209,7 +209,7 @@ public class View3dController extends BaseController {
ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams);
orgCode = "1*2";
return CommonResponseUtil.success(view3dService.get3dPointsByModel(orgCode,model));
return view3dService.get3dPointsByModel(orgCode,model);
}
@Scheduled(cron = "${param.safetyIndexChange.cron}")
......@@ -248,12 +248,17 @@ public class View3dController extends BaseController {
@RequestParam(required = false) String type,
@RequestParam(required = false) String inputText,
@RequestParam(required = true) int current,
@RequestParam(required = true) int pageSize
@RequestParam(required = true) int pageSize,
@RequestParam(required = false) String dataLevel,
@RequestParam(required = false) String protectObjName
) {
ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams);
String token = this.getToken();
String appKey = this.getAppKey();
String product = this.getProduct();
orgCode = "1*2";
return view3dService.retrieveAll(type,inputText,current,pageSize,orgCode);
return view3dService.retrieveAll(type,inputText,current,pageSize,orgCode,dataLevel,protectObjName,token,appKey,product);
}
......
......@@ -117,7 +117,7 @@ public interface View3dMapper extends BaseMapper{
List<Node3DVoResponse> findViewDataByType(String type,Long riskSourceId,String orgCode);
Long retrieveAllCount(String type, String inputText,String orgCode);
Long retrieveAllCount(String type, String inputText,String orgCode,String dataLevel,String protectObjName);
List<HashMap<String, Object>> retrieveAll(String type, String inputText, long start, int length,String orgCode);
List<HashMap<String, Object>> retrieveAll(String type, String inputText, long start, int length,String orgCode,String dataLevel,String protectObjName);
}
......@@ -36,6 +36,7 @@ import com.yeejoin.amos.fas.business.dao.mapper.RiskSourceMapper;
import com.yeejoin.amos.fas.business.dao.mapper.View3dMapper;
import com.yeejoin.amos.fas.business.dao.repository.*;
import com.yeejoin.amos.fas.business.feign.IDutyModeServer;
import com.yeejoin.amos.fas.business.feign.RemoteSecurityService;
import com.yeejoin.amos.fas.business.feign.RemoteWebSocketServer;
import com.yeejoin.amos.fas.business.service.intfc.IDataRefreshService;
import com.yeejoin.amos.fas.business.service.intfc.IView3dService;
......@@ -50,6 +51,8 @@ import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
import com.yeejoin.amos.fas.core.util.StringUtil;
import com.yeejoin.amos.fas.dao.entity.*;
import com.yeejoin.amos.fas.exception.YeeException;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
......@@ -105,6 +108,8 @@ public class View3dServiceImpl implements IView3dService {
private IDataRefreshService iDataRefreshService;
@Autowired
private RiskSourceMapper riskSourceMapper;
@Autowired
private RemoteSecurityService remoteSecurityService;
@Override
@Transactional(rollbackFor = Exception.class)
......@@ -565,10 +570,17 @@ public class View3dServiceImpl implements IView3dService {
}
@Override
public CommonResponse retrieveAll(String type, String inputText, int current, int pageSize,String orgCode) {
public CommonResponse retrieveAll(String type, String inputText, int current, int pageSize,String orgCode,String dataLevel,String protectObjName,String token,String appKey,String product) {
CommonPageable pageable = new CommonPageable( current, pageSize);
Long count = view3dMapper.retrieveAllCount(type,inputText,orgCode);
List<HashMap<String, Object>> retrieveAll = view3dMapper.retrieveAll(type, inputText,pageable.getOffset(),pageable.getPageSize(),orgCode);
Long count = view3dMapper.retrieveAllCount(type,inputText,orgCode,dataLevel,protectObjName);
List<HashMap<String, Object>> retrieveAll = view3dMapper.retrieveAll(type, inputText,pageable.getOffset(),pageable.getPageSize(),orgCode,dataLevel,protectObjName);
retrieveAll.stream().forEach(e->{
String person = (String)e.get("person");
if(person != null && !person.equals("")) {
AgencyUserModel user = remoteSecurityService.getUserById(token, product, appKey, person);
e.put("person", user != null ? user.getRealName() : "");
}
});
Page result = new PageImpl(retrieveAll,pageable,count);
return CommonResponseUtil.success(result);
}
......
......@@ -149,12 +149,14 @@ public interface IView3dService {
* 检索
* @param type类型
* @param inputText关键字
* @param dataLevel风险等级
* @param protectObjName设备名称
* @param current
* @param pageSize
* @param orgCode
* @return
*/
CommonResponse retrieveAll(String type, String inputText, int current, int pageSize,String orgCode);
CommonResponse retrieveAll(String type, String inputText, int current, int pageSize,String orgCode,String dataLevel,String protectObjName,String token,String appKey,String product);
/**
* 等级查询
......
package com.yeejoin.amos.fas.business.vo;
import java.util.List;
import com.alibaba.druid.util.StringUtils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.yeejoin.amos.fas.business.util.StringUtil;
import com.yeejoin.amos.fas.core.common.response.CoordDTO;
public class View3dNodeVo {
......@@ -19,6 +18,7 @@ public class View3dNodeVo {
private String[] relationKeys;
private String level;
private String levelStr;
private CoordDTO position;
/**
* 顶牌内容
*/
......@@ -131,4 +131,18 @@ public class View3dNodeVo {
this.levelStr = levelStr;
}
/**
* @return the position
*/
public CoordDTO getPosition() {
return position;
}
/**
* @param position the position to set
*/
public void setPosition(String position) {
this.position = position == null?null:JSON.parseObject(position, CoordDTO.class);
}
}
......@@ -558,15 +558,57 @@
</select>
<select id="getImpEqu3dPoints" resultType="com.yeejoin.amos.fas.business.vo.View3dNodeVo">
SELECT id,name,code,ue4_location,ue4_rotation,'monitorEquipment' as type,
null as relationKeys
SELECT id,name,code,ue4_location,ue4_rotation,'monitorEquipment' as type,'monitorEquipment' as level,
null as relationKeys,
CASE
WHEN (
ISNULL(fe.position3d) || LENGTH(trim(fe.position3d)) <![CDATA[ <]]> 1
) THEN
NULL
ELSE
CONCAT(
'{"x":',
substring_index(fe.position3d, ',', 1),
',"y":',
substring_index(
substring_index(fe.position3d, ',', - 2),
',',
1
),
',"z":',
substring_index(fe.position3d, ',', - 1),
'}'
)
END position,
concat('monitorEquipment-',fe.id) as `key`
FROM f_fire_equipment fe
WHERE fe.id IN (
select fire_equipment_id from f_equipment_fire_equipment
) AND org_code like CONCAT(#{orgCode},'%')
UNION ALL
SELECT e.id,e.name,e.code,e.ue4_location,e.ue4_rotation,'impEquipment' as type,
TMP.relationKeys
SELECT e.id,e.name,e.code,e.ue4_location,e.ue4_rotation,'impEquipment' as type,'impEquipment' as level,
TMP.relationKeys,
CASE
WHEN (
ISNULL(e.position3d) || LENGTH(trim(e.position3d)) <![CDATA[ <]]> 1
) THEN
NULL
ELSE
CONCAT(
'{"x":',
substring_index(e.position3d, ',', 1),
',"y":',
substring_index(
substring_index(e.position3d, ',', - 2),
',',
1
),
',"z":',
substring_index(e.position3d, ',', - 1),
'}'
)
END position,
concat('impEquipment-',e.id) as `key`
FROM f_equipment e
LEFT JOIN
(select GROUP_CONCAT(fire_equipment_id) as relationKeys,equipment_id from f_equipment_fire_equipment GROUP BY equipment_id) tmp
......@@ -578,17 +620,87 @@
when 1 then 'hydrant'
when 2 then 'pool'
end as type,
null as relationKeys
case type
when 1 then 'hydrant'
when 2 then 'pool'
end as level,
null as relationKeys,
CASE
WHEN (
ISNULL(position3d) || LENGTH(trim(position3d)) <![CDATA[ <]]> 1
) THEN
NULL
ELSE
CONCAT(
'{"x":',
substring_index(position3d, ',', 1),
',"y":',
substring_index(
substring_index(position3d, ',', - 2),
',',
1
),
',"z":',
substring_index(position3d, ',', - 1),
'}'
)
END position,
case type
when 1 then concat('hydrant-',id)
when 2 then concat('pool-',id)
end as `key`
FROM f_water_resource
WHERE org_code like CONCAT(#{orgCode},'%')
UNION ALL
SELECT id,name,code,ue4_location,ue4_rotation,'fireChamber' as type,
null as relationKeys
SELECT id,name,code,ue4_location,ue4_rotation,'fireChamber' as type,'fireChamber' as level,
null as relationKeys,
CASE
WHEN (
ISNULL(position3d) || LENGTH(trim(position3d)) <![CDATA[ <]]> 1
) THEN
NULL
ELSE
CONCAT(
'{"x":',
substring_index(position3d, ',', 1),
',"y":',
substring_index(
substring_index(position3d, ',', - 2),
',',
1
),
',"z":',
substring_index(position3d, ',', - 1),
'}'
)
END position,
concat('fireChamber-',id) as `key`
FROM f_fire_station
WHERE type = 1 AND org_code like CONCAT(#{orgCode},'%')
UNION ALL
SELECT id,name,car_num as code,ue4_location,ue4_rotation,'fireCar' as type,
null as relationKeys
SELECT id,name,car_num as code,ue4_location,ue4_rotation,'fireCar' as type,'fireCar' as level,
null as relationKeys,
CASE
WHEN (
ISNULL(position3d) || LENGTH(trim(position3d)) <![CDATA[ <]]> 1
) THEN
NULL
ELSE
CONCAT(
'{"x":',
substring_index(position3d, ',', 1),
',"y":',
substring_index(
substring_index(position3d, ',', - 2),
',',
1
),
',"z":',
substring_index(position3d, ',', - 1),
'}'
)
END position,
concat('fireCar-',id) as `key`
FROM f_fire_car
WHERE org_code like CONCAT(#{orgCode},'%')
</select>
......@@ -653,8 +765,9 @@
AND e.org_code like CONCAT(#{orgCode},'%')
) tmp
where 1=1
<if test="riskSourceId != null"></if>
<if test="riskSourceId != null">
AND FIND_IN_SET(tmp.risk_source_id,queryRiskSourceChildrenIds(#{riskSourceId}))
</if>
<if test="type != null">
AND tmp.type = #{type}
</if>
......@@ -826,6 +939,9 @@
from f_risk_source r
left join f_risk_level rl ON rl.id = r.risk_level_id
where r.is_region = 'FALSE'
<if test="dataLevel != null and dataLevel != ''">
AND rl.level = #{dataLevel}
</if>
UNION all
select p.name,p.point_no as code,'patrol' as typeCode,p.org_code as orgCode
from p_point p
......@@ -834,8 +950,14 @@
select name,code,'impEquipment' as typeCode,org_code as orgCode
from f_equipment e
UNION all
select name,code,'monitorEquipment' as typeCode,org_code as orgCode
from f_fire_equipment where equip_classify = 0
select m.name,m.code,'monitorEquipment' as typeCode,m.org_code as orgCode
from f_fire_equipment m
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
where equip_classify = 0
<if test="protectObjName != null and protectObjName != ''">
AND f.name = #{protectObjName}
</if>
UNION all
select name,code,'video' as typeCode,org_code as orgCode
from f_fire_equipment where equip_classify = 2
......@@ -865,7 +987,7 @@
OR tmp.name LIKE '%${inputText}%'
)
</if>
<if test="type!=null">
<if test="type!=null and type!=''">
AND tmp.typeCode = #{type}
</if>
<if test="orgCode!=null">
......@@ -876,7 +998,7 @@
<select id="retrieveAll" resultType="java.util.HashMap">
select *,'{ "x": 0, "y": 0, "z": 0 }' rotationDTO,'{ "x": 1, "y": 1, "z": 1 }' scaleDTO
from (select r.id,r.name,r.code,r.ue4_location as ue4Location,r.ue4_rotation as ue4Rotation ,'riskSource' as type,r.org_code as orgCode,
rl.level,CONCAT('level_',rl.level) as levelStr,r.is_indoor as isIndoor,'风险点' as typeName,'riskSource' as typeCode,
rl.name as level,CONCAT('level_',rl.level) as levelStr,r.is_indoor as isIndoor,'风险点' as typeName,'riskSource' as typeCode,
CASE
WHEN (
ISNULL(r.position3d) || LENGTH(trim(r.position3d)) <![CDATA[ <]]> 1
......@@ -896,10 +1018,18 @@ from (select r.id,r.name,r.code,r.ue4_location as ue4Location,r.ue4_rotation as
substring_index(r.position3d, ',', - 1),
'}'
)
END positionDTO
END positionDTO,
r.name as label,
'' as protectObjName,
'' as routeName,
'' as person,
'' as title
from f_risk_source r
left join f_risk_level rl ON rl.id = r.risk_level_id
where r.is_region = 'FALSE'
<if test="dataLevel != null and dataLevel != ''">
AND rl.level = #{dataLevel}
</if>
UNION all
select p.id,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,
......@@ -922,7 +1052,17 @@ from (select r.id,r.name,r.code,r.ue4_location as ue4Location,r.ue4_rotation as
substring_index(p.coordinates, ',', - 1),
'}'
)
END positionDTO
END positionDTO,
p.name as label,
'' as protectObjName,
p.route_name as routeName,
p.charge_person_id as person,
case
when p.status = '0' then '未执行'
when p.status = '1' then '合格'
when p.status = '2' then '不合格'
when p.status = '3' then '漏检'
end as title
from p_point p
WHERE is_delete = FALSE
UNION all
......@@ -947,56 +1087,81 @@ from (select r.id,r.name,r.code,r.ue4_location as ue4Location,r.ue4_rotation as
substring_index(e.position3d, ',', - 1),
'}'
)
END positionDTO
END positionDTO,
e.name as label,
'' as protectObjName,
'' as routeName,
'' as person,
'' as title
from f_equipment e
UNION all
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'monitorEquipment' as type,org_code as orgCode,
equip_status as level , concat('level_',equip_status) as levelStr,is_indoor as isIndoor,'探测器' as typeName,'monitorEquipment' as typeCode,
select m.id,m.name,m.code,m.ue4_location as ue4Location,m.ue4_rotation as ue4Rotation ,'monitorEquipment' as type,m.org_code as orgCode,
m.equip_status as level , concat('level_',m.equip_status) as levelStr,m.is_indoor as isIndoor,'探测器' as typeName,'monitorEquipment' as typeCode,
CASE
WHEN (
ISNULL(position3d) || LENGTH(trim(position3d)) <![CDATA[ <]]> 1
ISNULL(m.position3d) || LENGTH(trim(m.position3d)) <![CDATA[ <]]> 1
) THEN
NULL
ELSE
CONCAT(
'{"x":',
substring_index(position3d, ',', 1),
substring_index(m.position3d, ',', 1),
',"y":',
substring_index(
substring_index(position3d, ',', - 2),
substring_index(m.position3d, ',', - 2),
',',
1
),
',"z":',
substring_index(position3d, ',', - 1),
substring_index(m.position3d, ',', - 1),
'}'
)
END positionDTO
from f_fire_equipment where equip_classify = 0
END positionDTO,
m.name as label,
f.name as protectObjName,
'' as routeName,
'' as person,
'' as title
from f_fire_equipment m
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
where equip_classify = 0
<if test="protectObjName != null and protectObjName != ''">
AND f.name = #{protectObjName}
</if>
UNION all
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'video' as type,org_code as orgCode,
equip_status as level , concat('level_',equip_status) as levelStr,is_indoor as isIndoor,'摄像头' as typeName,'video' as typeCode,
select m.id,m.name,m.code,m.ue4_location as ue4Location,m.ue4_rotation as ue4Rotation ,'video' as type,m.org_code as orgCode,
m.equip_status as level , concat('level_',m.equip_status) as levelStr,m.is_indoor as isIndoor,'摄像头' as typeName,'video' as typeCode,
CASE
WHEN (
ISNULL(position3d) || LENGTH(trim(position3d)) <![CDATA[ <]]> 1
ISNULL(m.position3d) || LENGTH(trim(m.position3d)) <![CDATA[ <]]> 1
) THEN
NULL
ELSE
CONCAT(
'{"x":',
substring_index(position3d, ',', 1),
substring_index(m.position3d, ',', 1),
',"y":',
substring_index(
substring_index(position3d, ',', - 2),
substring_index(m.position3d, ',', - 2),
',',
1
),
',"z":',
substring_index(position3d, ',', - 1),
substring_index(m.position3d, ',', - 1),
'}'
)
END positionDTO
from f_fire_equipment where equip_classify = 2
END positionDTO,
m.name as label,
f.name as protectObjName,
'' as routeName,
'' as person,
'' as title
from f_fire_equipment m
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
where m.equip_classify = 2
UNION all
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'hydrant' as type,org_code as orgCode,
0 as level , 'level_0' as levelStr,is_indoor as isIndoor,'消防栓' as typeName,'fireEquipment' as typeCode,
......@@ -1019,7 +1184,12 @@ from (select r.id,r.name,r.code,r.ue4_location as ue4Location,r.ue4_rotation as
substring_index(position3d, ',', - 1),
'}'
)
END positionDTO
END positionDTO,
name as label,
'' as protectObjName,
'' as routeName,
'' as person,
'' as title
from f_water_resource where type = 1
UNION all
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,'pool' as type,org_code as orgCode,
......@@ -1043,7 +1213,12 @@ from (select r.id,r.name,r.code,r.ue4_location as ue4Location,r.ue4_rotation as
substring_index(position3d, ',', - 1),
'}'
)
END positionDTO
END positionDTO,
name as label,
'' as protectObjName,
'' as routeName,
'' as person,
'' as title
from f_water_resource where type = 2
UNION all
select id,name,car_num as code,ue4_location as ue4Location,ue4_rotation as ue4Rotation, 'fireCar' as type,org_code as orgCode,
......@@ -1067,7 +1242,12 @@ from (select r.id,r.name,r.code,r.ue4_location as ue4Location,r.ue4_rotation as
substring_index(position3d, ',', - 1),
'}'
)
END positionDTO
END positionDTO,
name as label,
'' as protectObjName,
'' as routeName,
'' as person,
'' as title
from f_fire_car
UNION all
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,'fireEquipment' as type,org_code as orgCode,
......@@ -1091,7 +1271,12 @@ from (select r.id,r.name,r.code,r.ue4_location as ue4Location,r.ue4_rotation as
substring_index(position3d, ',', - 1),
'}'
)
END positionDTO
END positionDTO,
name as label,
'' as protectObjName,
'' as routeName,
'' as person,
'' as title
from f_fire_equipment where equip_classify = 3
UNION all
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation , 'fireChamber' as type,org_code as orgCode,
......@@ -1115,7 +1300,12 @@ from (select r.id,r.name,r.code,r.ue4_location as ue4Location,r.ue4_rotation as
substring_index(position3d, ',', - 1),
'}'
)
END positionDTO
END positionDTO,
name as label,
'' as protectObjName,
'' as routeName,
'' as person,
'' as title
from f_fire_station where type = 2
UNION all
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'fireFoamRoom' as type,org_code as orgCode,
......@@ -1139,7 +1329,12 @@ from (select r.id,r.name,r.code,r.ue4_location as ue4Location,r.ue4_rotation as
substring_index(position3d, ',', - 1),
'}'
)
END positionDTO
END positionDTO,
name as label,
'' as protectObjName,
'' as routeName,
'' as person,
'' as title
from f_fire_station where type = 1
) as tmp
where 1=1
......@@ -1149,7 +1344,7 @@ from (select r.id,r.name,r.code,r.ue4_location as ue4Location,r.ue4_rotation as
OR tmp.name LIKE '%${inputText}%'
)
</if>
<if test="type!=null">
<if test="type!=null and type!=''">
AND tmp.typeCode = #{type}
</if>
<if test="orgCode!=null">
......
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