Commit 6e7ae3b0 authored by 吴江's avatar 吴江

Merge branch 'dev_upgrade' into 'dev_rule'

# Conflicts: # YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/ContingencyInstanceImpl.java # YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/RiskSourceServiceImpl.java
parents eef8eff5 9e592a48
...@@ -16,7 +16,7 @@ public enum StatisticsErrorTypeEum { ...@@ -16,7 +16,7 @@ public enum StatisticsErrorTypeEum {
/** /**
* 设备故障 * 设备故障
*/ */
equip("equip", "设备故障"), equip("equip", "故障告警"),
/** /**
* 火灾告警 * 火灾告警
*/ */
......
...@@ -49,6 +49,23 @@ public class FireEquipmentData extends BasicEntity { ...@@ -49,6 +49,23 @@ public class FireEquipmentData extends BasicEntity {
@Column(name="is_invalid") @Column(name="is_invalid")
private int isInvalid; // 是否有效 private int isInvalid; // 是否有效
/**
* 机构
*/
@Column(name="org_code")
private String orgCode;
public String getOrgCode() {
return orgCode;
}
public void setOrgCode(String orgCode) {
this.orgCode = orgCode;
}
public FireEquipmentData() {
}
public Long getFireEquipmentId() { public Long getFireEquipmentId() {
return fireEquipmentId; return fireEquipmentId;
} }
......
...@@ -11,12 +11,14 @@ public interface ContingencyOriginalMapper extends BaseMapper { ...@@ -11,12 +11,14 @@ public interface ContingencyOriginalMapper extends BaseMapper {
Long queryCountForPage( Long queryCountForPage(
@Param("equipmentId")String equipmentId, @Param("equipmentId")String equipmentId,
@Param("createTime")String createTime); @Param("createTime")String createTime,
@Param("contingencyName")String contingencyName);
List<Map> queryForPage( @Param("equipmentId")String equipmentId, List<Map> queryForPage( @Param("equipmentId")String equipmentId,
@Param("createTime")String createTime, @Param("createTime")String createTime,
@Param("start") long start, @Param("start") long start,
@Param("length") Integer length); @Param("length") Integer length,
@Param("contingencyName")String contingencyName);
} }
...@@ -50,8 +50,8 @@ public class ContingencyOriginalServiceImpl /*extends GenericManagerImpl<Conting ...@@ -50,8 +50,8 @@ public class ContingencyOriginalServiceImpl /*extends GenericManagerImpl<Conting
public Page queryForPage(String contingencyName, String equipmentId, String createTime, CommonPageable pageable) public Page queryForPage(String contingencyName, String equipmentId, String createTime, CommonPageable pageable)
{ {
Long total = contingencyOriginalMapper.queryCountForPage(equipmentId,createTime); Long total = contingencyOriginalMapper.queryCountForPage(equipmentId,createTime,contingencyName);
List<Map> content = contingencyOriginalMapper.queryForPage(equipmentId,createTime,pageable.getOffset(),pageable.getPageSize()); List<Map> content = contingencyOriginalMapper.queryForPage(equipmentId,createTime,pageable.getOffset(),pageable.getPageSize(),contingencyName);
Page result = new PageImpl(content,pageable,total); Page result = new PageImpl(content,pageable,total);
return result; return result;
} }
......
...@@ -491,23 +491,6 @@ public class View3dServiceImpl implements IView3dService { ...@@ -491,23 +491,6 @@ public class View3dServiceImpl implements IView3dService {
return view3dMapper.getCheckErrorTop5(orgCode); return view3dMapper.getCheckErrorTop5(orgCode);
case "fire": case "fire":
return view3dMapper.getFireAlarmTop5(orgCode); return view3dMapper.getFireAlarmTop5(orgCode);
// return JSON.parseArray(" [\r\n" +
// " {\r\n" +
// " \"id\": 35781,\r\n" +
// " \"code\": \"s001\",\r\n" +
// " \"label\": \"设备test\",\r\n" +
// " \"pointId\": \"1\",\r\n" +
// " \"type\": \"check\",\r\n" +
// " \"changeDate\": \"2020-04-23 14:31:31\"\r\n" +
// " },\r\n" +
// " {\r\n" +
// " \"id\": 35780,\r\n" +
// " \"code\": \"s002\",\r\n" +
// " \"label\": \"设备002\",\r\n" +
// " \"pointId\": \"23123\",\r\n" +
// " \"type\": \"check\",\r\n" +
// " \"changeDate\": \"2020-04-23 14:31:27\"\r\n" +
// " }]", SafetyExecuteBo.class);
default: default:
throw new YeeException("不支持的类型 -->"+ type); throw new YeeException("不支持的类型 -->"+ type);
} }
...@@ -525,8 +508,6 @@ public class View3dServiceImpl implements IView3dService { ...@@ -525,8 +508,6 @@ public class View3dServiceImpl implements IView3dService {
@Override @Override
public List<SafetyExecuteBo> getEquipStatusList(String orgCode) { public List<SafetyExecuteBo> getEquipStatusList(String orgCode) {
return view3dMapper.getEquipStatusTop5(orgCode); return view3dMapper.getEquipStatusTop5(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 @Override
...@@ -600,10 +581,14 @@ public class View3dServiceImpl implements IView3dService { ...@@ -600,10 +581,14 @@ public class View3dServiceImpl implements IView3dService {
List<HashMap<String, Object>> retrieveAll = view3dMapper.retrieveAll(type, inputText,pageable.getOffset(),pageable.getPageSize(),orgCode,dataLevel,protectObjName); List<HashMap<String, Object>> retrieveAll = view3dMapper.retrieveAll(type, inputText,pageable.getOffset(),pageable.getPageSize(),orgCode,dataLevel,protectObjName);
retrieveAll.stream().forEach(e->{ retrieveAll.stream().forEach(e->{
String person = (String)e.get("person"); String person = (String)e.get("person");
JSONArray ue4Location = this.getInitJSONArray(String.valueOf(e.get("ue4Location")));
JSONArray ue4Rotation = this.getInitJSONArray(String.valueOf(e.get("ue4Rotation")));
if(person != null && !person.equals("")) { if(person != null && !person.equals("")) {
AgencyUserModel user = remoteSecurityService.getUserById(token, product, appKey, person); AgencyUserModel user = remoteSecurityService.getUserById(token, product, appKey, person);
e.put("person", user != null ? user.getRealName() : ""); e.put("person", user != null ? user.getRealName() : "");
} }
e.put("ue4Location",ue4Location);
e.put("ue4Rotation",ue4Rotation);
}); });
Page result = new PageImpl(retrieveAll,pageable,count); Page result = new PageImpl(retrieveAll,pageable,count);
return CommonResponseUtil.success(result); return CommonResponseUtil.success(result);
......
package com.yeejoin.amos.fas.business.service.intfc; package com.yeejoin.amos.fas.business.service.intfc;
import com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance;
import java.util.List;
import java.util.Map;
public interface IContingencyInstance { public interface IContingencyInstance {
//
ContingencyPlanInstance createInstanceRecord(String instanceNo, String category, String subCategory, String content, String recordType, String icon); // ContingencyPlanInstance createInstanceRecord(String instanceNo, String category, String subCategory, String content, String recordType, String icon);
//
//
//
List<ContingencyPlanInstance> queryForTimeLine(String instanceNo,String recordType) throws Exception; // List<ContingencyPlanInstance> queryForTimeLine(String instanceNo,String recordType) throws Exception;
//
//
void setButtonExecuted(String batchNo,String contingencyPlanId,String code,String buttonState) throws Exception; // void setButtonExecuted(String batchNo,String contingencyPlanId,String code,String buttonState) throws Exception;
void setButtonWait(String batchNo,String contingencyPlanId,String buttonState) throws Exception; // void setButtonWait(String batchNo,String contingencyPlanId,String buttonState) throws Exception;
//
//
void fire(String batchNo,String stepCode, String contingencyPlanId, String buttonCode,String buttonState,String stepStateOnbutton) throws Exception; // void fire(String batchNo,String stepCode, String contingencyPlanId, String buttonCode,String buttonState,String stepStateOnbutton) throws Exception;
//
void updateStep(String step, String batchNo); // void updateStep(String step, String batchNo);
} }
...@@ -15,14 +15,18 @@ ...@@ -15,14 +15,18 @@
1 = 1 1 = 1
<if test="equipmentId!=null"> <if test="equipmentId!=null">
AND t.equipment_Id = ${equipmentId} AND t.equipment_Id = #{equipmentId}
</if> </if>
<if test="createTime!=null"> <if test="createTime!=null">
AND TO_DAYS(t.create_date) = TO_DAYS(${createTime}) AND TO_DAYS(t.create_date) = TO_DAYS(#{createTime})
</if>
<if test="contingencyName!=null and contingencyName!=''">
AND t.fire_Equipment_Name like concat('%',#{contingencyName},'%')
OR t.equipment_Name like concat('%',#{contingencyName},'%')
</if> </if>
order by t.create_date desc order by t.create_date desc
LIMIT ${start},${length} ; LIMIT #{start},#{length} ;
</select> </select>
...@@ -35,11 +39,15 @@ ...@@ -35,11 +39,15 @@
1 = 1 1 = 1
<if test="equipmentId!=null"> <if test="equipmentId!=null">
AND t.equipment_Id = ${equipmentId} AND t.equipment_Id = #{equipmentId}
</if> </if>
<if test="createTime!=null"> <if test="createTime!=null">
AND TO_DAYS(t.create_date) = TO_DAYS(${createTime}) AND TO_DAYS(t.create_date) = TO_DAYS(#{createTime})
</if>
<if test="contingencyName!=null and contingencyName!=''">
AND t.fire_Equipment_Name like concat('%',#{contingencyName},'%')
OR t.equipment_Name like concat('%',#{contingencyName},'%')
</if> </if>
</select> </select>
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
R.id,R.name,R.code,R.parent_id,R.ue4_location,R.ue4_rotation,R.ue4_extent, R.id,R.name,R.code,R.parent_id,R.ue4_location,R.ue4_rotation,R.ue4_extent,
<choose> <choose>
<when test="channelType == '3dpage'"> <when test="channelType == '3dpage'">
IF(ISNULL(route_path) || LENGTH(trim(route_path)) <![CDATA[ <]]> 1,0,1) as is_bind, IF(ISNULL(position3d) || LENGTH(trim(position3d)) <![CDATA[ <]]> 1,0,1) as is_bind,
</when> </when>
<otherwise> <otherwise>
IF(ISNULL(IF(replace(trim(ue4_rotation),'[]','')='',NULL,R.ue4_rotation)) IF(ISNULL(IF(replace(trim(ue4_rotation),'[]','')='',NULL,R.ue4_rotation))
...@@ -115,84 +115,37 @@ ...@@ -115,84 +115,37 @@
AND B.id is not null AND B.id is not null
</when> </when>
<when test="type == 'fireEquipment'"> <when test="type == 'fireEquipment'">
select select tmp.id,tmp.name,tmp.type,tmp.position3d,tmp.ue4_rotation,tmp.ue4_location,tmp.code,R.parent_id,
<!-- R.id, -->
CASE
WHEN ISNULL(C.id) = 0 then C.id
WHEN ISNULL(E.id) = 0 then E.id
WHEN ISNULL(S.id) = 0 then S.id
WHEN ISNULL(W.id) = 0 then W.id
END as id
,R.parent_id,
<choose> <choose>
<when test="channelType == '3dpage'"> <when test="channelType == '3dpage'">
CASE IF(ISNULL(tmp.position3d) || LENGTH(trim(tmp.position3d)) <![CDATA[ <]]> 1,0,1) as isBind
WHEN ISNULL(C.id) = 0 AND ISNULL(C.position3d) OR LENGTH(trim(C.position3d)) <![CDATA[ <]]> 1 then 0
WHEN ISNULL(E.id) = 0 AND ISNULL(E.position3d) OR LENGTH(trim(E.position3d)) <![CDATA[ <]]> 1 then 0
WHEN ISNULL(S.id) = 0 AND ISNULL(S.position3d) OR LENGTH(trim(S.position3d)) <![CDATA[ <]]> 1 then 0
WHEN ISNULL(W.id) = 0 AND ISNULL(W.position3d) OR LENGTH(trim(W.position3d)) <![CDATA[ <]]> 1 then 0
ELSE 1
END as is_bind,
</when> </when>
<otherwise> <otherwise>
CASE IF(ISNULL(IF(replace(trim(tmp.ue4_rotation),'[]','')='',NULL,tmp.ue4_rotation))
WHEN ISNULL(C.id) = 0 then IF(ISNULL(IF(replace(trim(C.ue4_rotation),'[]','')='',NULL,C.ue4_rotation)) AND ISNULL(IF(replace(trim(tmp.ue4_location),'[]','')='',NULL,tmp.ue4_location)),0,1) as isBind
AND ISNULL(IF(replace(trim(C.ue4_rotation),'[]','')='',NULL,C.ue4_location)),0,1)
WHEN ISNULL(E.id) = 0 then IF(ISNULL(IF(replace(trim(E.ue4_rotation),'[]','')='',NULL,E.ue4_rotation))
AND ISNULL(IF(replace(trim(E.ue4_rotation),'[]','')='',NULL,E.ue4_location)),0,1)
WHEN ISNULL(S.id) = 0 then IF(ISNULL(IF(replace(trim(S.ue4_rotation),'[]','')='',NULL,S.ue4_rotation))
AND ISNULL(IF(replace(trim(S.ue4_rotation),'[]','')='',NULL,S.ue4_location)),0,1)
WHEN ISNULL(W.id) = 0 then IF(ISNULL(IF(replace(trim(W.ue4_rotation),'[]','')='',NULL,W.ue4_rotation))
AND ISNULL(IF(replace(trim(W.ue4_rotation),'[]','')='',NULL,W.ue4_location)),0,1)
END as is_bind,
</otherwise> </otherwise>
</choose> </choose>
CASE from (
WHEN ISNULL(C.id) = 0 then 'fireCar' select id,name,'fireCar' as type,position3d,car_num as code,ue4_location,ue4_rotation,risk_source_id
WHEN ISNULL(E.id) = 0 then 'fireEquipment' from f_fire_car
WHEN ISNULL(S.id) = 0 AND S.type = 1 then 'fireChamber' union all
WHEN ISNULL(S.id) = 0 AND S.type = 2 then 'fireFoamRoom' select id,name,'fireEquipment' as type,position3d,code,ue4_location,ue4_rotation,risk_source_id
WHEN ISNULL(W.id) = 0 AND W.type = 1 then 'hydrant' from f_fire_equipment
WHEN ISNULL(W.id) = 0 AND W.type = 2 then 'pool' union all
END as type, select id,name,CASE
CASE WHEN S.type = 1 then 'fireChamber'
WHEN ISNULL(C.id) = 0 then C.name WHEN S.type = 2 then 'fireFoamRoom'
WHEN ISNULL(E.id) = 0 then E.name END as type,position3d,code,ue4_location,ue4_rotation,risk_source_id
WHEN ISNULL(S.id) = 0 then S.name from f_fire_station s
WHEN ISNULL(W.id) = 0 then W.name union all
END as name, select id,name,
CASE CASE
WHEN ISNULL(C.id) = 0 then C.car_num WHEN W.type = 1 then 'hydrant'
WHEN ISNULL(E.id) = 0 then E.code WHEN W.type = 2 then 'pool'
WHEN ISNULL(S.id) = 0 then S.code END as type,position3d,code,ue4_location,ue4_rotation,risk_source_id
WHEN ISNULL(W.id) = 0 then W.code from f_water_resource w
END as code, ) tmp
CASE left join f_risk_source R on R.id = tmp.risk_source_id
WHEN ISNULL(C.id) = 0 then C.ue4_location
WHEN ISNULL(E.id) = 0 then E.ue4_location
WHEN ISNULL(S.id) = 0 then S.ue4_location
WHEN ISNULL(W.id) = 0 then W.ue4_location
END as ue4_location,
CASE
WHEN ISNULL(C.id) = 0 then C.ue4_rotation
WHEN ISNULL(E.id) = 0 then E.ue4_rotation
WHEN ISNULL(S.id) = 0 then S.ue4_rotation
WHEN ISNULL(W.id) = 0 then W.ue4_rotation
END as ue4_rotation,
0 as is_region,
CASE
WHEN ISNULL(C.id) = 0 then C.position3d
WHEN ISNULL(E.id) = 0 then E.position3d
WHEN ISNULL(S.id) = 0 then S.position3d
WHEN ISNULL(W.id) = 0 then W.position3d
END as position3d
from f_risk_source R
left join f_fire_car C on C.risk_source_id = R.id
left join f_fire_equipment E on E.risk_source_id = R.id AND equip_classify = 3
left join f_fire_station S on S.risk_source_id = R.id
left join f_water_resource W on W.risk_source_id = R.id
where 1=1
AND (C.id is not null OR E.id is not null OR S.id is not null OR w.id is not null)
</when> </when>
</choose> </choose>
...@@ -451,34 +404,41 @@ ...@@ -451,34 +404,41 @@
<select id="getAllErrorRiskPoint" resultType="com.yeejoin.amos.fas.business.bo.RiskPointRpnChangeBo" > <select id="getAllErrorRiskPoint" resultType="com.yeejoin.amos.fas.business.bo.RiskPointRpnChangeBo" >
SELECT SELECT
b.id, b.id,
a.`name`, a.`name`,
a.risk_level_id as riskLevelId, a.risk_level_id as riskLevelId,
b.create_date as changeDate b.create_date as changeDate
FROM FROM
f_risk_source a, f_risk_source a,
f_rpn_change_log b (SELECT a.id,a.type,a.risk_source_id,max(a.create_date) as create_date FROM `f_rpn_change_log` a GROUP BY a.risk_source_id) as b
WHERE WHERE
b.risk_source_id = a.id b.risk_source_id = a.id
AND b.type = '0' AND b.type = '0'
and a.org_code = #{orgCode} and a.org_code = #{orgCode}
and DATE_FORMAT(b.create_date,'%Y-%m-%d') = #{date} and DATE_FORMAT(b.create_date,'%Y-%m-%d') = #{date}
</select> </select>
<select id="getAllErrorPatrolPoint" resultType="com.yeejoin.amos.fas.business.bo.CheckErrorBo"> <select id="getAllErrorPatrolPoint" resultType="com.yeejoin.amos.fas.business.bo.CheckErrorBo">
SELECT SELECT
a.id, pc.id,
b.`name`, b.`name`,
a.`is_ok` as status, pc.`is_ok` as status,
a.check_time as changeDate pc.check_time as changeDate
FROM FROM
p_check a, (select
a.id,
a.point_id,
a.`is_ok`,
max(a.check_time) as check_time
FROM
p_check a
where DATE_FORMAT(a.check_time,'%Y-%m-%d') = #{date}
and a.`is_ok` IN ('2', '3')
GROUP BY a.point_id) as pc,
p_point b p_point b
WHERE WHERE
a.`is_ok` IN ('2', '3') pc.point_id = b.id
AND a.point_id = b.id
and b.is_delete = false and b.is_delete = false
and DATE_FORMAT(a.check_time,'%Y-%m-%d') = #{date} and b.org_code = #{orgCode}
and a.org_code = #{orgCode}
</select> </select>
<select id="getAllFaultAlarm" resultType="com.yeejoin.amos.fas.business.bo.CheckErrorBo"> <select id="getAllFaultAlarm" resultType="com.yeejoin.amos.fas.business.bo.CheckErrorBo">
......
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