Commit 9a873feb authored by suhuiguang's avatar suhuiguang

1.修改缺陷

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