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 {
/**
* 设备故障
*/
equip("equip", "设备故障"),
equip("equip", "故障告警"),
/**
* 火灾告警
*/
......
......@@ -49,6 +49,23 @@ public class FireEquipmentData extends BasicEntity {
@Column(name="is_invalid")
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() {
return fireEquipmentId;
}
......
......@@ -11,12 +11,14 @@ public interface ContingencyOriginalMapper extends BaseMapper {
Long queryCountForPage(
@Param("equipmentId")String equipmentId,
@Param("createTime")String createTime);
@Param("createTime")String createTime,
@Param("contingencyName")String contingencyName);
List<Map> queryForPage( @Param("equipmentId")String equipmentId,
@Param("createTime")String createTime,
@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
public Page queryForPage(String contingencyName, String equipmentId, String createTime, CommonPageable pageable)
{
Long total = contingencyOriginalMapper.queryCountForPage(equipmentId,createTime);
List<Map> content = contingencyOriginalMapper.queryForPage(equipmentId,createTime,pageable.getOffset(),pageable.getPageSize());
Long total = contingencyOriginalMapper.queryCountForPage(equipmentId,createTime,contingencyName);
List<Map> content = contingencyOriginalMapper.queryForPage(equipmentId,createTime,pageable.getOffset(),pageable.getPageSize(),contingencyName);
Page result = new PageImpl(content,pageable,total);
return result;
}
......
......@@ -491,23 +491,6 @@ public class View3dServiceImpl implements IView3dService {
return view3dMapper.getCheckErrorTop5(orgCode);
case "fire":
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:
throw new YeeException("不支持的类型 -->"+ type);
}
......@@ -525,8 +508,6 @@ public class View3dServiceImpl implements IView3dService {
@Override
public List<SafetyExecuteBo> getEquipStatusList(String 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
......@@ -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);
retrieveAll.stream().forEach(e->{
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("")) {
AgencyUserModel user = remoteSecurityService.getUserById(token, product, appKey, person);
e.put("person", user != null ? user.getRealName() : "");
}
e.put("ue4Location",ue4Location);
e.put("ue4Rotation",ue4Rotation);
});
Page result = new PageImpl(retrieveAll,pageable,count);
return CommonResponseUtil.success(result);
......
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 {
ContingencyPlanInstance createInstanceRecord(String instanceNo, String category, String subCategory, String content, String recordType, String icon);
List<ContingencyPlanInstance> queryForTimeLine(String instanceNo,String recordType) 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 fire(String batchNo,String stepCode, String contingencyPlanId, String buttonCode,String buttonState,String stepStateOnbutton) throws Exception;
void updateStep(String step, String batchNo);
//
// ContingencyPlanInstance createInstanceRecord(String instanceNo, String category, String subCategory, String content, String recordType, String icon);
//
//
//
// List<ContingencyPlanInstance> queryForTimeLine(String instanceNo,String recordType) 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 fire(String batchNo,String stepCode, String contingencyPlanId, String buttonCode,String buttonState,String stepStateOnbutton) throws Exception;
//
// void updateStep(String step, String batchNo);
}
......@@ -15,14 +15,18 @@
1 = 1
<if test="equipmentId!=null">
AND t.equipment_Id = ${equipmentId}
AND t.equipment_Id = #{equipmentId}
</if>
<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>
order by t.create_date desc
LIMIT ${start},${length} ;
LIMIT #{start},#{length} ;
</select>
......@@ -35,11 +39,15 @@
1 = 1
<if test="equipmentId!=null">
AND t.equipment_Id = ${equipmentId}
AND t.equipment_Id = #{equipmentId}
</if>
<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>
</select>
......
......@@ -10,7 +10,7 @@
R.id,R.name,R.code,R.parent_id,R.ue4_location,R.ue4_rotation,R.ue4_extent,
<choose>
<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>
<otherwise>
IF(ISNULL(IF(replace(trim(ue4_rotation),'[]','')='',NULL,R.ue4_rotation))
......@@ -115,84 +115,37 @@
AND B.id is not null
</when>
<when test="type == 'fireEquipment'">
select
<!-- 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,
select tmp.id,tmp.name,tmp.type,tmp.position3d,tmp.ue4_rotation,tmp.ue4_location,tmp.code,R.parent_id,
<choose>
<when test="channelType == '3dpage'">
CASE
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,
IF(ISNULL(tmp.position3d) || LENGTH(trim(tmp.position3d)) <![CDATA[ <]]> 1,0,1) as isBind
</when>
<otherwise>
CASE
WHEN ISNULL(C.id) = 0 then IF(ISNULL(IF(replace(trim(C.ue4_rotation),'[]','')='',NULL,C.ue4_rotation))
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,
IF(ISNULL(IF(replace(trim(tmp.ue4_rotation),'[]','')='',NULL,tmp.ue4_rotation))
AND ISNULL(IF(replace(trim(tmp.ue4_location),'[]','')='',NULL,tmp.ue4_location)),0,1) as isBind
</otherwise>
</choose>
from (
select id,name,'fireCar' as type,position3d,car_num as code,ue4_location,ue4_rotation,risk_source_id
from f_fire_car
union all
select id,name,'fireEquipment' as type,position3d,code,ue4_location,ue4_rotation,risk_source_id
from f_fire_equipment
union all
select id,name,CASE
WHEN S.type = 1 then 'fireChamber'
WHEN S.type = 2 then 'fireFoamRoom'
END as type,position3d,code,ue4_location,ue4_rotation,risk_source_id
from f_fire_station s
union all
select id,name,
CASE
WHEN ISNULL(C.id) = 0 then 'fireCar'
WHEN ISNULL(E.id) = 0 then 'fireEquipment'
WHEN ISNULL(S.id) = 0 AND S.type = 1 then 'fireChamber'
WHEN ISNULL(S.id) = 0 AND S.type = 2 then 'fireFoamRoom'
WHEN ISNULL(W.id) = 0 AND W.type = 1 then 'hydrant'
WHEN ISNULL(W.id) = 0 AND W.type = 2 then 'pool'
END as type,
CASE
WHEN ISNULL(C.id) = 0 then C.name
WHEN ISNULL(E.id) = 0 then E.name
WHEN ISNULL(S.id) = 0 then S.name
WHEN ISNULL(W.id) = 0 then W.name
END as name,
CASE
WHEN ISNULL(C.id) = 0 then C.car_num
WHEN ISNULL(E.id) = 0 then E.code
WHEN ISNULL(S.id) = 0 then S.code
WHEN ISNULL(W.id) = 0 then W.code
END as code,
CASE
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 W.type = 1 then 'hydrant'
WHEN W.type = 2 then 'pool'
END as type,position3d,code,ue4_location,ue4_rotation,risk_source_id
from f_water_resource w
) tmp
left join f_risk_source R on R.id = tmp.risk_source_id
</when>
</choose>
......@@ -457,7 +410,7 @@
b.create_date as changeDate
FROM
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
b.risk_source_id = a.id
AND b.type = '0'
......@@ -466,19 +419,26 @@
</select>
<select id="getAllErrorPatrolPoint" resultType="com.yeejoin.amos.fas.business.bo.CheckErrorBo">
SELECT
a.id,
pc.id,
b.`name`,
a.`is_ok` as status,
a.check_time as changeDate
pc.`is_ok` as status,
pc.check_time as changeDate
FROM
(select
a.id,
a.point_id,
a.`is_ok`,
max(a.check_time) as check_time
FROM
p_check a,
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
WHERE
a.`is_ok` IN ('2', '3')
AND a.point_id = b.id
pc.point_id = b.id
and b.is_delete = false
and DATE_FORMAT(a.check_time,'%Y-%m-%d') = #{date}
and a.org_code = #{orgCode}
and b.org_code = #{orgCode}
</select>
<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