Commit 83213b63 authored by 单奇雲's avatar 单奇雲

新增接口,调试接口

parent 0376c9e1
...@@ -38,6 +38,7 @@ public class View3dController extends BaseController { ...@@ -38,6 +38,7 @@ public class View3dController extends BaseController {
public CommonResponse getRegionTree() { public CommonResponse getRegionTree() {
ReginParams reginParams =getSelectedOrgInfo(); ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams); String orgCode = this.getOrgCode(reginParams);
orgCode = "10";
return CommonResponseUtil.success(riskSourceService.findRegionTree(orgCode)); return CommonResponseUtil.success(riskSourceService.findRegionTree(orgCode));
} }
...@@ -46,6 +47,7 @@ public class View3dController extends BaseController { ...@@ -46,6 +47,7 @@ public class View3dController extends BaseController {
public CommonResponse getRegionDetail(@PathVariable("riskSourceId") Long riskSourceId) { public CommonResponse getRegionDetail(@PathVariable("riskSourceId") Long riskSourceId) {
ReginParams reginParams =getSelectedOrgInfo(); ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams); String orgCode = this.getOrgCode(reginParams);
orgCode = "10";
return CommonResponseUtil.success(riskSourceService.findRegionById(riskSourceId,orgCode)); return CommonResponseUtil.success(riskSourceService.findRegionById(riskSourceId,orgCode));
} }
...@@ -72,6 +74,7 @@ public class View3dController extends BaseController { ...@@ -72,6 +74,7 @@ public class View3dController extends BaseController {
if(ResourceTypeDefEnum.containsTypeCode(type)) { if(ResourceTypeDefEnum.containsTypeCode(type)) {
ReginParams reginParams =getSelectedOrgInfo(); ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams); String orgCode = this.getOrgCode(reginParams);
orgCode = "10";
return CommonResponseUtil.success(view3dService.getPointTreeByType(type,orgCode)); return CommonResponseUtil.success(view3dService.getPointTreeByType(type,orgCode));
} }
return CommonResponseUtil.failure(type + " 类型不存在"); return CommonResponseUtil.failure(type + " 类型不存在");
...@@ -82,6 +85,7 @@ public class View3dController extends BaseController { ...@@ -82,6 +85,7 @@ public class View3dController extends BaseController {
public CommonResponse getPointDetail(String type,Long pointId) { public CommonResponse getPointDetail(String type,Long pointId) {
ReginParams reginParams =getSelectedOrgInfo(); ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams); String orgCode = this.getOrgCode(reginParams);
orgCode = "1*2";
return CommonResponseUtil.success(view3dService.getPointDetailByTypeAndId(type,pointId,orgCode)); return CommonResponseUtil.success(view3dService.getPointDetailByTypeAndId(type,pointId,orgCode));
} }
...@@ -90,6 +94,7 @@ public class View3dController extends BaseController { ...@@ -90,6 +94,7 @@ public class View3dController extends BaseController {
public CommonResponse safetyIndexWeek(String type,Long pointId) { public CommonResponse safetyIndexWeek(String type,Long pointId) {
ReginParams reginParams =getSelectedOrgInfo(); ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams); String orgCode = this.getOrgCode(reginParams);
orgCode = "10";
return CommonResponseUtil.success(view3dService.getSafetyIndexWeek(orgCode)); return CommonResponseUtil.success(view3dService.getSafetyIndexWeek(orgCode));
} }
...@@ -98,6 +103,7 @@ public class View3dController extends BaseController { ...@@ -98,6 +103,7 @@ public class View3dController extends BaseController {
public CommonResponse getSafetyIndexInfoByDate(@RequestParam(name = "date",required = false) String date){ public CommonResponse getSafetyIndexInfoByDate(@RequestParam(name = "date",required = false) String date){
ReginParams reginParams =getSelectedOrgInfo(); ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams); String orgCode = this.getOrgCode(reginParams);
orgCode = "1*2";
return CommonResponseUtil.success(view3dService.getSafetyIndexInfoByDate(orgCode,date)); return CommonResponseUtil.success(view3dService.getSafetyIndexInfoByDate(orgCode,date));
} }
...@@ -131,6 +137,7 @@ public class View3dController extends BaseController { ...@@ -131,6 +137,7 @@ public class View3dController extends BaseController {
public CommonResponse getSafetyExecuteListTop5(@PathVariable("type")String type){ public CommonResponse getSafetyExecuteListTop5(@PathVariable("type")String type){
ReginParams reginParams =getSelectedOrgInfo(); ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams); String orgCode = this.getOrgCode(reginParams);
orgCode = "1*2";
return CommonResponseUtil.success(view3dService.getSafetyExecuteListTop5(type,orgCode)); return CommonResponseUtil.success(view3dService.getSafetyExecuteListTop5(type,orgCode));
} }
...@@ -150,5 +157,21 @@ public class View3dController extends BaseController { ...@@ -150,5 +157,21 @@ public class View3dController extends BaseController {
List<ExceptionRegionVo> exceptionRegionVoList = view3dService.getExceptionRegion(orgCode); List<ExceptionRegionVo> exceptionRegionVoList = view3dService.getExceptionRegion(orgCode);
return CommonResponseUtil.success(exceptionRegionVoList); return CommonResponseUtil.success(exceptionRegionVoList);
} }
@ApiOperation(value = "异常区域信息查询",notes = "异常区域信息查询")
@GetMapping(value = "equipStatus/list")
public CommonResponse getEquipStatusList(){
ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams);
return CommonResponseUtil.success(view3dService.getEquipStatusList(orgCode));
}
@ApiOperation(value = "资源显示",notes = "资源显示")
@GetMapping(value = "initViewNode")
public CommonResponse initViewNode(String type){
ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams);
orgCode = "1*2";
return CommonResponseUtil.success(view3dService.initViewNode(type,orgCode));
}
} }
...@@ -7,6 +7,7 @@ import java.util.Map; ...@@ -7,6 +7,7 @@ import java.util.Map;
import com.yeejoin.amos.fas.business.bo.CheckErrorBo; import com.yeejoin.amos.fas.business.bo.CheckErrorBo;
import com.yeejoin.amos.fas.business.bo.RiskPointRpnChangeBo; import com.yeejoin.amos.fas.business.bo.RiskPointRpnChangeBo;
import com.yeejoin.amos.fas.business.bo.SafetyExecuteBo; import com.yeejoin.amos.fas.business.bo.SafetyExecuteBo;
import com.yeejoin.amos.fas.business.vo.View3dNodeVo;
import com.yeejoin.amos.fas.dao.entity.RiskSource; import com.yeejoin.amos.fas.dao.entity.RiskSource;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -86,4 +87,6 @@ public interface View3dMapper extends BaseMapper{ ...@@ -86,4 +87,6 @@ public interface View3dMapper extends BaseMapper{
*/ */
List<SafetyExecuteBo> getCheckErrorTop5(String orgCode); List<SafetyExecuteBo> getCheckErrorTop5(String orgCode);
List<View3dNodeVo> initViewImpEquipmentNode(String orgCode);
} }
...@@ -16,6 +16,8 @@ import java.math.BigDecimal; ...@@ -16,6 +16,8 @@ import java.math.BigDecimal;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import javax.persistence.criteria.CriteriaBuilder.Case;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
...@@ -30,6 +32,7 @@ import com.yeejoin.amos.fas.business.vo.ErrorContentVo; ...@@ -30,6 +32,7 @@ import com.yeejoin.amos.fas.business.vo.ErrorContentVo;
import com.yeejoin.amos.fas.business.vo.ExceptionRegionVo; import com.yeejoin.amos.fas.business.vo.ExceptionRegionVo;
import com.yeejoin.amos.fas.business.vo.SafetyIndexDetailVo; import com.yeejoin.amos.fas.business.vo.SafetyIndexDetailVo;
import com.yeejoin.amos.fas.business.vo.TodaySafetyIndexVo; import com.yeejoin.amos.fas.business.vo.TodaySafetyIndexVo;
import com.yeejoin.amos.fas.business.vo.View3dNodeVo;
import com.yeejoin.amos.fas.common.enums.CheckStatusEnum; import com.yeejoin.amos.fas.common.enums.CheckStatusEnum;
import com.yeejoin.amos.fas.common.enums.PlanTaskDetailStatusEnum; import com.yeejoin.amos.fas.common.enums.PlanTaskDetailStatusEnum;
import com.yeejoin.amos.fas.common.enums.RpnChangeTypeEum; import com.yeejoin.amos.fas.common.enums.RpnChangeTypeEum;
...@@ -229,12 +232,14 @@ public class View3dServiceImpl implements IView3dService { ...@@ -229,12 +232,14 @@ public class View3dServiceImpl implements IView3dService {
@Override @Override
public HashMap<String, Object> getPointDetailByTypeAndId(String type, Long pointId,String orgCode) { public HashMap<String, Object> getPointDetailByTypeAndId(String type, Long pointId,String orgCode) {
HashMap<String, Object> detail = view3dMapper.getPointDetailByTypeAndId(type,pointId,orgCode); HashMap<String, Object> detail = view3dMapper.getPointDetailByTypeAndId(type,pointId,orgCode);
String ue4Location = (String)detail.get("ue4Location"); if(detail != null) {
detail.put("ue4Location", ue4Location == null ? new JSONArray() : JSON.parseArray(ue4Location)); String ue4Location = (String)detail.get("ue4Location");
String ue4Rotation = (String)detail.get("ue4Rotation"); detail.put("ue4Location", ue4Location == null ? new JSONArray() : JSON.parseArray(ue4Location));
detail.put("ue4Rotation", ue4Rotation == null ? new JSONArray() : JSON.parseArray(ue4Rotation)); String ue4Rotation = (String)detail.get("ue4Rotation");
String ue4Extent = (String)detail.get("ue4Extent"); detail.put("ue4Rotation", ue4Rotation == null ? new JSONArray() : JSON.parseArray(ue4Rotation));
detail.put("ue4Extent", ue4Location == null ? new JSONArray() : JSON.parseArray(ue4Extent)); String ue4Extent = (String)detail.get("ue4Extent");
detail.put("ue4Extent", ue4Location == null ? new JSONArray() : JSON.parseArray(ue4Extent));
}
return detail; return detail;
} }
...@@ -444,4 +449,21 @@ public class View3dServiceImpl implements IView3dService { ...@@ -444,4 +449,21 @@ public class View3dServiceImpl implements IView3dService {
" \"securityPersonNumber\": 20,\r\n" + " \"securityPersonNumber\": 20,\r\n" +
" }"); " }");
} }
@Override
public Object getEquipStatusList(String orgCode) {
return JSON.parseArray("[{\"id\":1,\"label\":\"设备1 label\",\"changeDate\":\"2020-04-26 10:00:00\"}"
+ ",{\"id\":2,\"label\":\"设备2 label\",\"changeDate\":\"2020-04-25 10:00:00\"}]");
}
@Override
public List<View3dNodeVo> initViewNode(String type, String orgCode) {
switch (type) {
case "impEquipment":
return view3dMapper.initViewImpEquipmentNode(orgCode);
default:
break;
}
return null;
}
} }
...@@ -6,6 +6,7 @@ import com.yeejoin.amos.fas.business.bo.SafetyExecuteBo; ...@@ -6,6 +6,7 @@ import com.yeejoin.amos.fas.business.bo.SafetyExecuteBo;
import com.yeejoin.amos.fas.business.vo.ExceptionRegionVo; import com.yeejoin.amos.fas.business.vo.ExceptionRegionVo;
import com.yeejoin.amos.fas.business.vo.SafetyIndexDetailVo; import com.yeejoin.amos.fas.business.vo.SafetyIndexDetailVo;
import com.yeejoin.amos.fas.business.vo.TodaySafetyIndexVo; import com.yeejoin.amos.fas.business.vo.TodaySafetyIndexVo;
import com.yeejoin.amos.fas.business.vo.View3dNodeVo;
import com.yeejoin.amos.fas.core.common.response.RegionTreeResponse; import com.yeejoin.amos.fas.core.common.response.RegionTreeResponse;
import com.yeejoin.amos.fas.core.util.CommonResponse; import com.yeejoin.amos.fas.core.util.CommonResponse;
import java.util.HashMap; import java.util.HashMap;
...@@ -93,4 +94,8 @@ public interface IView3dService { ...@@ -93,4 +94,8 @@ public interface IView3dService {
List<SafetyExecuteBo> getSafetyExecuteListTop5(String type, String orgCode); List<SafetyExecuteBo> getSafetyExecuteListTop5(String type, String orgCode);
Object getStatisticsDuty(); Object getStatisticsDuty();
Object getEquipStatusList(String orgCode);
List<View3dNodeVo> initViewNode(String type, String orgCode);
} }
package com.yeejoin.amos.fas.business.vo;
import com.alibaba.druid.util.StringUtils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
public class View3dNodeVo {
private Long id;
private String name;
private String code;
private JSONArray ue4Location = new JSONArray();
private JSONArray ue4Rotation = new JSONArray();
private String type;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public JSONArray getUe4Location() {
return ue4Location;
}
public void setUe4Location(String ue4Location) {
this.ue4Location = StringUtils.isEmpty(ue4Location) ? new JSONArray() : JSONArray.parseArray(ue4Location);
}
public JSONArray getUe4Rotation() {
return ue4Rotation;
}
public void setUe4Rotation(String ue4Rotation) {
this.ue4Rotation = StringUtils.isEmpty(ue4Rotation) ? new JSONArray() : JSON.parseArray(ue4Rotation);
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
from f_risk_source R from f_risk_source R
left join p_point B on B.risk_source_id = R.id AND R.is_region='TRUE' left join p_point B on B.risk_source_id = R.id AND R.is_region='TRUE'
where 1=1 where 1=1
AND B.id is not null AND B.id is not null AND B.is_delete = 0
</when> </when>
<when test="type == 'impEquipment'"> <when test="type == 'impEquipment'">
select select
...@@ -140,7 +140,7 @@ ...@@ -140,7 +140,7 @@
<when test="type == 'patrol'"> <when test="type == 'patrol'">
select id,name,point_no as code,ue4_location as ue4Location,ue4_rotation as ue4Rotation select id,name,point_no as code,ue4_location as ue4Location,ue4_rotation as ue4Rotation
from p_point from p_point
where 1=1 where 1=1 and is_delete = 0
</when> </when>
<when test="type == 'impEquipment'"> <when test="type == 'impEquipment'">
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation
...@@ -180,12 +180,12 @@ ...@@ -180,12 +180,12 @@
<when test="type == 'fireChamber'"> <when test="type == 'fireChamber'">
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation
from f_fire_station from f_fire_station
where type = 2 where type = 1
</when> </when>
<when test="type == 'fireFoamRoom'"> <when test="type == 'fireFoamRoom'">
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation
from f_fire_station from f_fire_station
where type = 1 where type = 2
</when> </when>
</choose> </choose>
<if test="pointId != null"> <if test="pointId != null">
...@@ -198,14 +198,13 @@ ...@@ -198,14 +198,13 @@
<select id="getSafetyIndexWeek" resultType="java.util.HashMap"> <select id="getSafetyIndexWeek" resultType="java.util.HashMap">
<![CDATA[ <![CDATA[
SELECT temp1.*,S.safety_index as value SELECT temp1.*,IFNULL(S.safety_index,0) as value
FROM ( FROM (
SELECT @s :=@s + 1 as `index`, DATE(DATE_SUB(CURRENT_DATE, INTERVAL @s DAY)) AS date SELECT @s :=@s + 1 as `index`, DATE(DATE_SUB(CURRENT_DATE, INTERVAL @s DAY)) AS date
FROM mysql.help_topic,(SELECT @s := 0) temp FROM mysql.help_topic,(SELECT @s := 0) temp
WHERE @s < 7 WHERE @s < 7
) temp1 ) temp1
left join f_safety_index_change_log S on s.collect_date = temp1.date left join f_safety_index_change_log S on s.collect_date = temp1.date AND S.org_code = #{orgCode}
WHERE S.org_code = #{orgCode}
ORDER BY temp1.date ORDER BY temp1.date
]]> ]]>
</select> </select>
...@@ -299,9 +298,39 @@ ...@@ -299,9 +298,39 @@
SELECT p.id,I.point_no as code,I.name as label,p.point_id,'check' as type,p.check_time as changeDate SELECT p.id,I.point_no as code,I.name as label,p.point_id,'check' as type,p.check_time as changeDate
FROM p_check p FROM p_check p
left join p_point I ON I.id = p.point_id left join p_point I ON I.id = p.point_id
where p.org_code = #{org_code} or p.org_code like CONCAT(#{orgCode},'-','%') where p.is_ok IN ('2', '3')
AND I.is_delete = 0
AND p.org_code = #{org_code} or p.org_code like CONCAT(#{orgCode},'-','%')
ORDER BY p.check_time desc ORDER BY p.check_time desc
limit 0,5 limit 0,5
</select> </select>
<select id="initViewImpEquipmentNode" resultType="com.yeejoin.amos.fas.business.vo.View3dNodeVo">
SELECT id,name,code,ue4_location,ue4_rotation,'monitorEquipment' as type
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 id,name,code,ue4_location,ue4_rotation,'impEquipment' as type
FROM f_equipment
WHERE org_code like CONCAT(#{orgCode},'%')
UNION ALL
SELECT id,name,code,ue4_location,ue4_rotation,
case type
when 1 then 'hydrant'
when 2 then 'pool'
end as type
FROM f_water_resource
WHERE org_code like CONCAT(#{orgCode},'%')
UNION ALL
SELECT id,name,code,ue4_location,ue4_rotation,'fireChamber' as type
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
FROM f_fire_car
WHERE org_code like CONCAT(#{orgCode},'%')
</select>
</mapper> </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