Commit b3ab5049 authored by 单奇雲's avatar 单奇雲

冲突

parents 83213b63 ba29bcd8
...@@ -44,5 +44,6 @@ public class FasConstant { ...@@ -44,5 +44,6 @@ public class FasConstant {
public static final String RISK_SOURCE_STATUS_NORMAL = "NORMAL";//风险点状态-正常 public static final String RISK_SOURCE_STATUS_NORMAL = "NORMAL";//风险点状态-正常
public static final String RISK_SOURCE_STATUS_ANOMALY = "ANOMALY";//风险点状态-正常 public static final String RISK_SOURCE_STATUS_ANOMALY = "ANOMALY";//风险点状态-正常
public static final String PLAN_SOURCE_TYPE = "plan_source_type";//预案资源类型 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; ...@@ -16,6 +16,8 @@ import com.yeejoin.amos.fas.business.vo.ReginParams;
import com.yeejoin.amos.fas.common.enums.ResourceTypeDefEnum; import com.yeejoin.amos.fas.common.enums.ResourceTypeDefEnum;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import java.util.HashMap;
import java.util.List; import java.util.List;
@RestController @RestController
...@@ -152,8 +154,6 @@ public class View3dController extends BaseController { ...@@ -152,8 +154,6 @@ public class View3dController extends BaseController {
public CommonResponse getExceptionRegion(){ public CommonResponse getExceptionRegion(){
ReginParams reginParams =getSelectedOrgInfo(); ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams); String orgCode = this.getOrgCode(reginParams);
//TODO:测试数据待删除
orgCode = "1*2";
List<ExceptionRegionVo> exceptionRegionVoList = view3dService.getExceptionRegion(orgCode); List<ExceptionRegionVo> exceptionRegionVoList = view3dService.getExceptionRegion(orgCode);
return CommonResponseUtil.success(exceptionRegionVoList); return CommonResponseUtil.success(exceptionRegionVoList);
} }
...@@ -174,4 +174,14 @@ public class View3dController extends BaseController { ...@@ -174,4 +174,14 @@ public class View3dController extends BaseController {
orgCode = "1*2"; orgCode = "1*2";
return CommonResponseUtil.success(view3dService.initViewNode(type,orgCode)); return CommonResponseUtil.success(view3dService.initViewNode(type,orgCode));
} }
@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);
}
} }
...@@ -89,4 +89,10 @@ public interface View3dMapper extends BaseMapper{ ...@@ -89,4 +89,10 @@ public interface View3dMapper extends BaseMapper{
List<View3dNodeVo> initViewImpEquipmentNode(String orgCode); List<View3dNodeVo> initViewImpEquipmentNode(String orgCode);
/**
* 按照类型查询点
* @param params {orgCode,type}
* @return 列表
*/
List<HashMap<String, Object>> getPintsByType(Map<String, Object> params);
} }
...@@ -1778,7 +1778,6 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -1778,7 +1778,6 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
if(regionDetail != null) { if(regionDetail != null) {
Long isBind = (Long) regionDetail.get("isBind"); Long isBind = (Long) regionDetail.get("isBind");
regionDetail.put("isBind", isBind == 0 ? false : true); regionDetail.put("isBind", isBind == 0 ? false : true);
String ue4Location = (String)regionDetail.get("ue4Location"); String ue4Location = (String)regionDetail.get("ue4Location");
regionDetail.put("ue4Location", ue4Location == null ? new JSONArray() : JSON.parseArray(ue4Location)); regionDetail.put("ue4Location", ue4Location == null ? new JSONArray() : JSON.parseArray(ue4Location));
String ue4Rotation = (String)regionDetail.get("ue4Rotation"); String ue4Rotation = (String)regionDetail.get("ue4Rotation");
......
...@@ -17,7 +17,6 @@ import java.util.*; ...@@ -17,7 +17,6 @@ import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import javax.persistence.criteria.CriteriaBuilder.Case; 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;
...@@ -25,7 +24,9 @@ import com.yeejoin.amos.fas.business.bo.BindPointBo; ...@@ -25,7 +24,9 @@ import com.yeejoin.amos.fas.business.bo.BindPointBo;
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.constants.FasConstant;
import com.yeejoin.amos.fas.business.dao.mapper.PatrolMapper; 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.dao.repository.*;
import com.yeejoin.amos.fas.business.service.intfc.IView3dService; import com.yeejoin.amos.fas.business.service.intfc.IView3dService;
import com.yeejoin.amos.fas.business.vo.ErrorContentVo; import com.yeejoin.amos.fas.business.vo.ErrorContentVo;
...@@ -37,13 +38,14 @@ import com.yeejoin.amos.fas.common.enums.CheckStatusEnum; ...@@ -37,13 +38,14 @@ 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;
import com.yeejoin.amos.fas.common.enums.StatisticsErrorTypeEum; 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.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.dao.entity.*;
import com.yeejoin.amos.fas.exception.YeeException; import com.yeejoin.amos.fas.exception.YeeException;
import springfox.documentation.spring.web.json.Json;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -53,11 +55,9 @@ import org.springframework.stereotype.Service; ...@@ -53,11 +55,9 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import com.yeejoin.amos.fas.business.dao.mapper.View3dMapper; import java.math.BigDecimal;
import com.yeejoin.amos.fas.common.enums.ResourceTypeDefEnum; import java.util.*;
import com.yeejoin.amos.fas.core.common.response.RegionTreeResponse; import java.util.stream.Collectors;
import com.yeejoin.amos.fas.core.util.CommonResponse;
import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
/** /**
* @author DELL * @author DELL
...@@ -466,4 +466,28 @@ public class View3dServiceImpl implements IView3dService { ...@@ -466,4 +466,28 @@ public class View3dServiceImpl implements IView3dService {
} }
return null; return null;
} }
@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;
}
} }
...@@ -116,10 +116,25 @@ public interface IRiskSourceService { ...@@ -116,10 +116,25 @@ public interface IRiskSourceService {
void notifyRiskSource(Long riskSourceId, String notifyType, String jpushTarget); void notifyRiskSource(Long riskSourceId, String notifyType, String jpushTarget);
/**
* 按照机构重新区域树
* @param orgCode 机构
* @return 树
*/
List<RegionTreeResponse> findRegionTree(String orgCode); List<RegionTreeResponse> findRegionTree(String orgCode);
/**
* 区域详情重新
* @param id 主键
* @param orgCode 机构
* @return map
*/
HashMap<String, Object> findRegionById(Long id,String orgCode); HashMap<String, Object> findRegionById(Long id,String orgCode);
/**
* 批量保存区域信息
* @param regionBoList 参数数组
*/
void batchSaveRegionUe4(List<BindRegionBo> regionBoList); void batchSaveRegionUe4(List<BindRegionBo> regionBoList);
} }
...@@ -98,4 +98,11 @@ public interface IView3dService { ...@@ -98,4 +98,11 @@ public interface IView3dService {
Object getEquipStatusList(String orgCode); Object getEquipStatusList(String orgCode);
List<View3dNodeVo> initViewNode(String type, String orgCode); List<View3dNodeVo> initViewNode(String type, String orgCode);
/**
* 查询类型的点
* @param orgCode 机构
* @param type 点类型
* @return list
*/
List<HashMap<String, Object>> get3dPointsByType(String orgCode,String type);
} }
...@@ -173,5 +173,13 @@ ...@@ -173,5 +173,13 @@
); );
</sql> </sql>
</changeSet> </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> </databaseChangeLog>
\ No newline at end of file
...@@ -271,17 +271,21 @@ ...@@ -271,17 +271,21 @@
WHERE WHERE
a.`is_ok` IN ('2', '3') a.`is_ok` IN ('2', '3')
AND a.point_id = b.id AND a.point_id = b.id
and b.is_delete = false
and DATE_FORMAT(a.check_time,'%Y-%m-%d') = #{date} and DATE_FORMAT(a.check_time,'%Y-%m-%d') = #{date}
and a.org_code = #{orgCode} and a.org_code = #{orgCode}
</select> </select>
<select id="getStatisticsCheck" resultType="java.util.HashMap"> <select id="getStatisticsCheck" resultType="java.util.HashMap">
SELECT t.finish_status as type, count(1) as value <![CDATA[
SELECT d.status as type, count(1) as value
FROM p_plan_task_detail d FROM p_plan_task_detail d
left JOIN p_plan_task t on t.id=d.task_no left JOIN p_plan_task t on t.id=d.task_no
WHERE DATEDIFF(t.begin_time,CURRENT_DATE) = 0 AND DATEDIFF(t.end_time,CURRENT_DATE) = 0 WHERE
AND (t.org_code = #{org_code} or t.org_code like CONCAT(#{orgCode},'-','%')) DATEDIFF(t.begin_time,CURRENT_DATE) <= 0 AND DATEDIFF(t.end_time,CURRENT_DATE) >= 0
GROUP BY t.finish_status AND (t.org_code = #{org_code} or t.org_code like CONCAT(#{orgCode},'-','%'))
GROUP BY d.status
]]>
</select> </select>
<select id="getRiskErrorTop5" resultType="com.yeejoin.amos.fas.business.bo.SafetyExecuteBo"> <select id="getRiskErrorTop5" resultType="com.yeejoin.amos.fas.business.bo.SafetyExecuteBo">
...@@ -304,6 +308,34 @@ ...@@ -304,6 +308,34 @@
ORDER BY p.check_time desc ORDER BY p.check_time desc
limit 0,5 limit 0,5
</select> </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>
<select id="initViewImpEquipmentNode" resultType="com.yeejoin.amos.fas.business.vo.View3dNodeVo"> <select id="initViewImpEquipmentNode" resultType="com.yeejoin.amos.fas.business.vo.View3dNodeVo">
SELECT id,name,code,ue4_location,ue4_rotation,'monitorEquipment' as type SELECT id,name,code,ue4_location,ue4_rotation,'monitorEquipment' as type
......
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