Commit 9a873feb authored by suhuiguang's avatar suhuiguang

1.修改缺陷

parent dc845199
...@@ -94,10 +94,8 @@ public class View3dController extends BaseController { ...@@ -94,10 +94,8 @@ public class View3dController extends BaseController {
@ApiOperation(value = "按照不同类型查询点详情", notes = "按照不同类型查询点详情") @ApiOperation(value = "按照不同类型查询点详情", notes = "按照不同类型查询点详情")
@GetMapping(value = "point/detail") @GetMapping(value = "point/detail")
public CommonResponse getPointDetail(String type,Long pointId) { public CommonResponse getPointDetail(@RequestParam String type,@RequestParam Long pointId) {
ReginParams reginParams =getSelectedOrgInfo(); return CommonResponseUtil.success(view3dService.getPointDetailByTypeAndId(type,pointId));
String orgCode = this.getOrgCode(reginParams);
return CommonResponseUtil.success(view3dService.getPointDetailByTypeAndId(type,pointId,orgCode));
} }
@ApiOperation(value = "一周安全指数趋势查询", notes = "一周安全指数趋势查询") @ApiOperation(value = "一周安全指数趋势查询", notes = "一周安全指数趋势查询")
......
...@@ -27,10 +27,9 @@ public interface View3dMapper extends BaseMapper{ ...@@ -27,10 +27,9 @@ public interface View3dMapper extends BaseMapper{
* 获取点详情 * 获取点详情
* @param type * @param type
* @param pointId * @param pointId
* @param orgCode * @return map
* @return
*/ */
HashMap<String, Object> getPointDetailByTypeAndId(@Param("type")String type, @Param("pointId")Long pointId,@Param("orgCode")String orgCode); HashMap<String, Object> getPointDetailByTypeAndId(@Param("type")String type, @Param("pointId")Long pointId);
/** /**
* 统计风险上升异常数量(风险点)-日期+机构 * 统计风险上升异常数量(风险点)-日期+机构
......
...@@ -846,7 +846,6 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -846,7 +846,6 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
if ("alarm_type_trouble".equals(fireEquipmentPointType)) { if ("alarm_type_trouble".equals(fireEquipmentPointType)) {
//通知刷新3d页面相关故障数据 //通知刷新3d页面相关故障数据
notifyAlarm(fireEquipmentPoint, deviceData); notifyAlarm(fireEquipmentPoint, deviceData);
iDataRefreshService.refreshViewData(DataRefreshTypeEum.trouble.getCode());
}else{ }else{
//通知刷新3d页面告警数据 //通知刷新3d页面告警数据
iDataRefreshService.refreshViewData(DataRefreshTypeEum.alarm.getCode()); iDataRefreshService.refreshViewData(DataRefreshTypeEum.alarm.getCode());
......
...@@ -32,6 +32,7 @@ import com.yeejoin.amos.fas.core.util.StringUtil; ...@@ -32,6 +32,7 @@ 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 com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.apache.commons.lang.StringUtils;
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;
...@@ -260,8 +261,8 @@ public class View3dServiceImpl implements IView3dService { ...@@ -260,8 +261,8 @@ 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) {
HashMap<String, Object> detail = view3dMapper.getPointDetailByTypeAndId(type,pointId,orgCode); HashMap<String, Object> detail = view3dMapper.getPointDetailByTypeAndId(type,pointId);
if(detail != null) { if(detail != null) {
String ue4Location = (String)detail.get("ue4Location"); String ue4Location = (String)detail.get("ue4Location");
detail.put("ue4Location", ue4Location == null ? new JSONArray() : JSON.parseArray(ue4Location)); detail.put("ue4Location", ue4Location == null ? new JSONArray() : JSON.parseArray(ue4Location));
...@@ -269,6 +270,7 @@ public class View3dServiceImpl implements IView3dService { ...@@ -269,6 +270,7 @@ public class View3dServiceImpl implements IView3dService {
detail.put("ue4Rotation", ue4Rotation == null ? new JSONArray() : JSON.parseArray(ue4Rotation)); detail.put("ue4Rotation", ue4Rotation == null ? new JSONArray() : JSON.parseArray(ue4Rotation));
String ue4Extent = (String)detail.get("ue4Extent"); String ue4Extent = (String)detail.get("ue4Extent");
detail.put("ue4Extent", ue4Location == null ? new JSONArray() : JSON.parseArray(ue4Extent)); detail.put("ue4Extent", ue4Location == null ? new JSONArray() : JSON.parseArray(ue4Extent));
detail.put("position3d", this.strPositionToArry(detail.get("position3d")));
} }
return detail; return detail;
} }
...@@ -309,7 +311,7 @@ public class View3dServiceImpl implements IView3dService { ...@@ -309,7 +311,7 @@ public class View3dServiceImpl implements IView3dService {
} }
@Override @Override
public synchronized List<SafetyIndexDetailVo> getSafetyIndexDetail(String type,String orgCode) { public List<SafetyIndexDetailVo> getSafetyIndexDetail(String type,String orgCode) {
List<SafetyIndexDetailVo> resultList = Lists.newArrayList(); List<SafetyIndexDetailVo> resultList = Lists.newArrayList();
String dateStr = DateUtil.getDateFormat(new Date(),DateUtil.DATE_DEFAULT_FORMAT); String dateStr = DateUtil.getDateFormat(new Date(),DateUtil.DATE_DEFAULT_FORMAT);
Map<String,Object> params = new HashMap<>(); Map<String,Object> params = new HashMap<>();
...@@ -480,7 +482,7 @@ public class View3dServiceImpl implements IView3dService { ...@@ -480,7 +482,7 @@ public class View3dServiceImpl implements IView3dService {
return view3dMapper.getRiskErrorTop5(orgCode); return view3dMapper.getRiskErrorTop5(orgCode);
case "check"://巡检异常 case "check"://巡检异常
return view3dMapper.getCheckErrorTop5(orgCode); return view3dMapper.getCheckErrorTop5(orgCode);
case "fire": case "fire"://火灾告警
return view3dMapper.getFireAlarmTop5(orgCode); return view3dMapper.getFireAlarmTop5(orgCode);
default: default:
throw new YeeException("不支持的类型 -->"+ type); throw new YeeException("不支持的类型 -->"+ type);
...@@ -647,5 +649,14 @@ public class View3dServiceImpl implements IView3dService { ...@@ -647,5 +649,14 @@ public class View3dServiceImpl implements IView3dService {
} }
} }
} }
private JSONArray strPositionToArry(Object position3d){
JSONArray jsonArray = new JSONArray();
if(StringUtil.isNotEmpty(position3d)){
String[] arryStr = position3d.toString().split(",");
List<Double> collect = Arrays.stream(arryStr).map(Double::parseDouble).collect(Collectors.toList());
jsonArray.addAll(collect);
}
return jsonArray;
}
} }
...@@ -45,10 +45,9 @@ public interface IView3dService { ...@@ -45,10 +45,9 @@ public interface IView3dService {
* 获取点详情 * 获取点详情
* @param type 树类型 * @param type 树类型
* @param pointId 点id * @param pointId 点id
* @param orgCode 登录机构 * @return map
* @return
*/ */
HashMap<String, Object> getPointDetailByTypeAndId(String type, Long pointId,String orgCode); HashMap<String, Object> getPointDetailByTypeAndId(String type, Long pointId);
/** /**
* 今日安全指数 * 今日安全指数
......
...@@ -171,9 +171,6 @@ ...@@ -171,9 +171,6 @@
<if test="pointId != null"> <if test="pointId != null">
AND rs.id = #{pointId} AND rs.id = #{pointId}
</if> </if>
<if test="orgCode != null">
AND (rs.org_code = #{orgCode} OR rs.org_code like CONCAT(#{orgCode},'-%'))
</if>
</when> </when>
<when test="type == 'patrol'"> <when test="type == 'patrol'">
select id,name,point_no as code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,coordinates as position3d, select id,name,point_no as code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,coordinates as position3d,
...@@ -203,9 +200,6 @@ ...@@ -203,9 +200,6 @@
<if test="pointId != null"> <if test="pointId != null">
AND id = #{pointId} AND id = #{pointId}
</if> </if>
<if test="orgCode != null">
AND (org_code = #{orgCode} OR org_code like CONCAT(#{orgCode},'-%'))
</if>
</when> </when>
<when test="type == 'impEquipment'"> <when test="type == 'impEquipment'">
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d, select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,
...@@ -219,9 +213,6 @@ ...@@ -219,9 +213,6 @@
<if test="pointId != null"> <if test="pointId != null">
AND id = #{pointId} AND id = #{pointId}
</if> </if>
<if test="orgCode != null">
AND (org_code = #{orgCode} OR org_code like CONCAT(#{orgCode},'-%'))
</if>
</when> </when>
<when test="type == 'monitorEquipment'"> <when test="type == 'monitorEquipment'">
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d, select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,
...@@ -235,9 +226,6 @@ ...@@ -235,9 +226,6 @@
<if test="pointId != null"> <if test="pointId != null">
AND id = #{pointId} AND id = #{pointId}
</if> </if>
<if test="orgCode != null">
AND (org_code = #{orgCode} OR org_code like CONCAT(#{orgCode},'-%'))
</if>
</when> </when>
<when test="type == 'video'"> <when test="type == 'video'">
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d, select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,
...@@ -251,9 +239,6 @@ ...@@ -251,9 +239,6 @@
<if test="pointId != null"> <if test="pointId != null">
AND id = #{pointId} AND id = #{pointId}
</if> </if>
<if test="orgCode != null">
AND (org_code = #{orgCode} OR org_code like CONCAT(#{orgCode},'-%'))
</if>
</when> </when>
<when test="type == 'hydrant'"> <when test="type == 'hydrant'">
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d, select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,
...@@ -267,9 +252,6 @@ ...@@ -267,9 +252,6 @@
<if test="pointId != null"> <if test="pointId != null">
AND id = #{pointId} AND id = #{pointId}
</if> </if>
<if test="orgCode != null">
AND (org_code = #{orgCode} OR org_code like CONCAT(#{orgCode},'-%'))
</if>
</when> </when>
<when test="type == 'pool'"> <when test="type == 'pool'">
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d, select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,
...@@ -283,9 +265,6 @@ ...@@ -283,9 +265,6 @@
<if test="pointId != null"> <if test="pointId != null">
AND id = #{pointId} AND id = #{pointId}
</if> </if>
<if test="orgCode != null">
AND (org_code = #{orgCode} OR org_code like CONCAT(#{orgCode},'-%'))
</if>
</when> </when>
<when test="type == 'fireCar'"> <when test="type == 'fireCar'">
select id,name,car_num as code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d, select id,name,car_num as code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,
...@@ -299,9 +278,6 @@ ...@@ -299,9 +278,6 @@
<if test="pointId != null"> <if test="pointId != null">
AND id = #{pointId} AND id = #{pointId}
</if> </if>
<if test="orgCode != null">
AND (org_code = #{orgCode} OR org_code like CONCAT(#{orgCode},'-%'))
</if>
</when> </when>
<when test="type == 'fireEquipment'"> <when test="type == 'fireEquipment'">
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d, select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,
...@@ -315,9 +291,6 @@ ...@@ -315,9 +291,6 @@
<if test="pointId != null"> <if test="pointId != null">
AND id = #{pointId} AND id = #{pointId}
</if> </if>
<if test="orgCode != null">
AND (org_code = #{orgCode} OR org_code like CONCAT(#{orgCode},'-%'))
</if>
</when> </when>
<when test="type == 'fireChamber'"> <when test="type == 'fireChamber'">
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d, select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,
...@@ -331,9 +304,6 @@ ...@@ -331,9 +304,6 @@
<if test="pointId != null"> <if test="pointId != null">
AND id = #{pointId} AND id = #{pointId}
</if> </if>
<if test="orgCode != null">
AND (org_code = #{orgCode} OR org_code like CONCAT(#{orgCode},'-%'))
</if>
</when> </when>
<when test="type == 'fireFoamRoom'"> <when test="type == 'fireFoamRoom'">
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d, select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,
...@@ -347,9 +317,6 @@ ...@@ -347,9 +317,6 @@
<if test="pointId != null"> <if test="pointId != null">
AND id = #{pointId} AND id = #{pointId}
</if> </if>
<if test="orgCode != null">
AND (org_code = #{orgCode} OR org_code like CONCAT(#{orgCode},'-%'))
</if>
</when> </when>
</choose> </choose>
</select> </select>
...@@ -497,7 +464,7 @@ ...@@ -497,7 +464,7 @@
<select id="getCheckErrorTop5" resultType="com.yeejoin.amos.fas.business.bo.SafetyExecuteBo"> <select id="getCheckErrorTop5" resultType="com.yeejoin.amos.fas.business.bo.SafetyExecuteBo">
SELECT p.id,I.point_no as code, SELECT p.id,I.point_no as code,
IF(p.is_ok = '2', CONCAT(I.name,' 不合格') ,CONCAT(I.name,' 漏检') ) as label, IF(p.is_ok = '2', CONCAT(I.name,' 不合格') ,CONCAT(I.name,' 漏检') ) as label,
p.point_id,'check' as type,p.check_time as changeDate p.point_id,'patrol' 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.is_ok IN ('2', '3') where p.is_ok IN ('2', '3')
...@@ -509,7 +476,8 @@ ...@@ -509,7 +476,8 @@
<select id="getFireAlarmTop5" resultType="com.yeejoin.amos.fas.business.bo.SafetyExecuteBo"> <select id="getFireAlarmTop5" resultType="com.yeejoin.amos.fas.business.bo.SafetyExecuteBo">
SELECT SELECT
a.fire_equipment_id id, a.id,
a.fire_equipment_id as pointId,
a.fire_equipment_code code, a.fire_equipment_code code,
a.fire_equipment_point_name as `label`, a.fire_equipment_point_name as `label`,
a.update_date as changeDate, a.update_date as changeDate,
...@@ -1162,7 +1130,7 @@ ...@@ -1162,7 +1130,7 @@
<if test="riskSourceId != null"> <if test="riskSourceId != null">
AND FIND_IN_SET(temp.riskSourceId,queryRiskSourceChildrenIds(#{riskSourceId})) AND FIND_IN_SET(temp.riskSourceId,queryRiskSourceChildrenIds(#{riskSourceId}))
</if> </if>
<if test="type != null and type !='fireResource'"> <if test="type != null and type !='fireResource' and type !=''">
AND temp.type = #{type} AND temp.type = #{type}
</if> </if>
<if test="type == 'fireResource'"> <if test="type == 'fireResource'">
......
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