Commit c3af6eac authored by suhuiguang's avatar suhuiguang

1.颗粒模式,重点设备模式-全景监控

parent 0376c9e1
......@@ -45,4 +45,5 @@ public class FasConstant {
public static final String RISK_SOURCE_STATUS_NORMAL = "NORMAL";//风险点状态-正常
public static final String RISK_SOURCE_STATUS_ANOMALY = "ANOMALY";//风险点状态-正常
public static final String PLAN_SOURCE_TYPE = "plan_source_type";//预案资源类型
public static final String ALL_POINT = "all";
}
......@@ -16,6 +16,8 @@ import com.yeejoin.amos.fas.business.vo.ReginParams;
import com.yeejoin.amos.fas.common.enums.ResourceTypeDefEnum;
import io.swagger.annotations.Api;
import java.util.HashMap;
import java.util.List;
@RestController
......@@ -145,10 +147,17 @@ public class View3dController extends BaseController {
public CommonResponse getExceptionRegion(){
ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams);
//TODO:测试数据待删除
orgCode = "1*2";
List<ExceptionRegionVo> exceptionRegionVoList = view3dService.getExceptionRegion(orgCode);
return CommonResponseUtil.success(exceptionRegionVoList);
}
@ApiOperation(value = "按照点类型查询点列表",notes = "按照点类型查询点列表")
@GetMapping(value = "point/list")
public CommonResponse get3dPointsByType(@RequestParam(required = false,defaultValue = "all") String type){
ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams);
List<HashMap<String,Object>> pointList = view3dService.get3dPointsByType(orgCode,type);
return CommonResponseUtil.success(pointList);
}
}
......@@ -86,4 +86,10 @@ public interface View3dMapper extends BaseMapper{
*/
List<SafetyExecuteBo> getCheckErrorTop5(String orgCode);
/**
* 按照类型查询点
* @param params {orgCode,type}
* @return 列表
*/
List<HashMap<String, Object>> getPintsByType(Map<String, Object> params);
}
package com.yeejoin.amos.fas.business.service.impl;
import static org.hamcrest.CoreMatchers.either;
import static org.springframework.test.web.client.match.MockRestRequestMatchers.method;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.alibaba.fastjson.JSONObject;
import com.itextpdf.text.pdf.PdfStructTreeController.returnType;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.google.common.collect.Lists;
......@@ -23,24 +8,23 @@ import com.yeejoin.amos.fas.business.bo.BindPointBo;
import com.yeejoin.amos.fas.business.bo.CheckErrorBo;
import com.yeejoin.amos.fas.business.bo.RiskPointRpnChangeBo;
import com.yeejoin.amos.fas.business.bo.SafetyExecuteBo;
import com.yeejoin.amos.fas.business.constants.FasConstant;
import com.yeejoin.amos.fas.business.dao.mapper.PatrolMapper;
import com.yeejoin.amos.fas.business.dao.mapper.View3dMapper;
import com.yeejoin.amos.fas.business.dao.repository.*;
import com.yeejoin.amos.fas.business.service.intfc.IView3dService;
import com.yeejoin.amos.fas.business.vo.ErrorContentVo;
import com.yeejoin.amos.fas.business.vo.ExceptionRegionVo;
import com.yeejoin.amos.fas.business.vo.SafetyIndexDetailVo;
import com.yeejoin.amos.fas.business.vo.TodaySafetyIndexVo;
import com.yeejoin.amos.fas.common.enums.CheckStatusEnum;
import com.yeejoin.amos.fas.common.enums.PlanTaskDetailStatusEnum;
import com.yeejoin.amos.fas.common.enums.RpnChangeTypeEum;
import com.yeejoin.amos.fas.common.enums.StatisticsErrorTypeEum;
import com.yeejoin.amos.fas.common.enums.*;
import com.yeejoin.amos.fas.core.common.request.DateUtil;
import com.yeejoin.amos.fas.core.util.*;
import com.yeejoin.amos.fas.core.common.response.RegionTreeResponse;
import com.yeejoin.amos.fas.core.util.CommonResponse;
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 springfox.documentation.spring.web.json.Json;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
......@@ -50,11 +34,9 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import com.yeejoin.amos.fas.business.dao.mapper.View3dMapper;
import com.yeejoin.amos.fas.common.enums.ResourceTypeDefEnum;
import com.yeejoin.amos.fas.core.common.response.RegionTreeResponse;
import com.yeejoin.amos.fas.core.util.CommonResponse;
import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author DELL
......@@ -444,4 +426,28 @@ public class View3dServiceImpl implements IView3dService {
" \"securityPersonNumber\": 20,\r\n" +
" }");
}
@Override
public List<HashMap<String, Object>> get3dPointsByType(String orgCode,String type) {
List<HashMap<String, Object>> points = new ArrayList<>();
points = this.getPointsByType(orgCode,type);
return points;
}
private List<HashMap<String, Object>> getPointsByType(String orgCode,String type){
//1.查询数据
List<HashMap<String, Object>> points = new ArrayList<>();
Map<String,Object> params = new HashMap<>();
params.put("orgCode",orgCode);
params.put("type", FasConstant.ALL_POINT.equalsIgnoreCase(type) ? null : type);
points = view3dMapper.getPintsByType(params);
//2.坐标相关字段转json
points.forEach(point ->{
JSONArray ue4Location = this.getInitJSONArray(String.valueOf(point.get("ue4Location")));
JSONArray ue4Rotation = this.getInitJSONArray(String.valueOf(point.get("ue4Rotation")));
point.put("ue4Location",ue4Location);
point.put("ue4Rotation",ue4Rotation);
});
return points;
}
}
......@@ -93,4 +93,12 @@ public interface IView3dService {
List<SafetyExecuteBo> getSafetyExecuteListTop5(String type, String orgCode);
Object getStatisticsDuty();
/**
* 查询类型的点
* @param orgCode 机构
* @param type 点类型
* @return list
*/
List<HashMap<String, Object>> get3dPointsByType(String orgCode,String type);
}
......@@ -173,5 +173,13 @@
);
</sql>
</changeSet>
<changeSet id="1587882668717-1" author="suhuiguang">
<createIndex
indexName="idx_type"
tableName="f_fire_station"
tablespace="A String"
unique="false">
<column name="type"/>
</createIndex>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
......@@ -303,5 +303,33 @@
ORDER BY p.check_time desc
limit 0,5
</select>
<select id="getPintsByType" resultType="hashmap">
select CONCAT(type,'-',id) as `key`,sp.* from
(select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'riskSource' as type,org_code as orgCode from f_risk_source where is_region = 'FALSE'
UNION all
select id,name,point_no as code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'patrol' as type,org_code as orgCode from p_point WHERE is_delete = FALSE
UNION all
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'impEquipment' as type,org_code as orgCode from f_equipment
UNION all
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'monitorEquipment' as type,org_code as orgCode from f_fire_equipment where equip_classify = 0
UNION all
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'video' as type,org_code as orgCode from f_fire_equipment where equip_classify = 2
UNION all
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'hydrant' as type,org_code as orgCode 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 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 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 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 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 from f_fire_station where type = 1
) as sp
where
sp.orgCode = #{orgCode}
<if test="type!=null">and sp.type =#{type}</if>
</select>
</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