Commit 1089fe4b authored by 高建强's avatar 高建强

Merge branch 'dev_upgrade' of http://172.16.10.76/station/YeeAmosFireAutoSysRoot into dev_upgrade

parents 95e19c5e 66909669
......@@ -1346,6 +1346,10 @@ public class DateUtil {
int toDay = to.get(Calendar.DAY_OF_YEAR);
int year = toYear - fromYear;
int day = toDay - fromDay;
if(day < 0){
day +=365;
year -=1;
}
param.put("year", year);
param.put("day", day);
return param;
......
......@@ -30,7 +30,7 @@ public class BubbleTipAction implements CustomerAction
//@ExposeAction("气泡提示")
@RuleMethod(methodLabel = "气泡提示", project = "青海风险管控")
@RuleMethod(methodLabel = "气泡提示", project = "风险管控")
public void sendBubbleTip(Object bizobj, Boolean showInfo, Object title, String type)
{
BubbleTipResult result = new BubbleTipResult();
......
......@@ -9,7 +9,7 @@ import lombok.Data;
/**
* @author DELL
*/
@RuleFact(value = "检查项",project = "青海风险管控")
@RuleFact(value = "检查项",project = "风险管控")
@Data
public class CheckInputItemRo implements Serializable {
/**
......
......@@ -7,7 +7,7 @@ import lombok.Data;
import java.security.acl.LastOwnerException;
@RuleFact(value = "消防设备",project = "青海风险管控")
@RuleFact(value = "消防设备",project = "风险管控")
@Data
public class FireEquimentDataRo extends BasicsRo
{
......
......@@ -7,7 +7,7 @@ import com.yeejoin.amos.component.rule.RuleFact;
import lombok.Data;
@RuleFact(value = "巡检点",project = "青海风险管控")
@RuleFact(value = "巡检点",project = "风险管控")
@Data
public class ProtalDataRo extends BasicsRo {
......
......@@ -8,7 +8,7 @@ import com.yeejoin.amos.component.rule.RuleFact;
import lombok.Data;
@RuleFact(value = "风险点",project = "青海风险管控")
@RuleFact(value = "风险点",project = "风险管控")
@Data
public class RiskSourceRo extends BasicsRo {
......
......@@ -7,7 +7,7 @@ import com.yeejoin.amos.component.rule.RuleFact;
import lombok.Data;
@RuleFact(value = "风险点-关联巡检点",project = "青海风险管控")
@RuleFact(value = "风险点-关联巡检点",project = "风险管控")
@Data
public class RiskSourceRuleRo extends BasicsRo {
......
......@@ -20,6 +20,8 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.*;
......@@ -40,6 +42,7 @@ public class FireSourceController extends BaseController {
private IWaterResourceService iWaterResourceService;
@Autowired
private IEquipmentService iEquipService;
private final Logger log = LoggerFactory.getLogger(FireSourceController.class);
@Permission
@ApiOperation(httpMethod = "POST", value = "添加消防装备", notes = "添加消防装备")
......@@ -207,9 +210,15 @@ public class FireSourceController extends BaseController {
@Permission
@ApiOperation(httpMethod = "GET", value = "消防状态明细信息", notes = "消防状态明细信息")
@RequestMapping(value = "/info/detail", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse queryForEquipmentList(@ApiParam(value = "设备名称", required = true) @RequestParam Long id,
public CommonResponse queryForEquipmentList(@ApiParam(value = "设备名称", required = true) @RequestParam String id,
@ApiParam(value = "设备编号", required = true) @RequestParam String type) throws Exception {
return CommonResponseUtil.success(iFireEquipService.queryForDetail(type, id));
try{
return CommonResponseUtil.success(iFireEquipService.queryForDetail(type, Long.valueOf(id)));
}catch (Exception e) {
log.error(e.getMessage(),e);
return CommonResponseUtil.failure("消防装备明细查询失败" + e.getMessage());
}
}
}
......@@ -690,8 +690,8 @@ public class RiskSourceController extends BaseController {
@Permission
@ApiOperation(value = "风险预警详情", notes = "风险预警详情")
@GetMapping(value = "/warning/detail", produces = "application/json;charset=UTF-8")
public CommonResponse earlyWarning(@RequestParam Long riskSourceId) {
Map map = riskSourceService.earlyWarning(riskSourceId);
public CommonResponse earlyWarning(@RequestParam String riskSourceId) {
Map map = riskSourceService.earlyWarning(Long.valueOf(riskSourceId));
return CommonResponseUtil.success(map);
}
......
......@@ -6,6 +6,8 @@ import com.yeejoin.amos.fas.business.param.FireEquipmentParam;
import com.yeejoin.amos.fas.business.vo.EquipCommunicationData;
import com.yeejoin.amos.fas.core.common.response.EquipDetailsResponse;
import com.yeejoin.amos.fas.dao.entity.FireEquipment;
import com.yeejoin.amos.fas.dao.entity.FireStation;
import org.apache.ibatis.annotations.Param;
import java.util.HashMap;
......@@ -55,6 +57,8 @@ public interface FireEquipMapper extends BaseMapper {
List<Map> queryForGroupCount(@Param("fireStationId") Long fireStationId);
List<Map> queryStorageEquips(@Param("riskSourceId") Long riskSourceId);
EquipDetailsResponse findEquipDetailsById(@Param("id") Long id);
......@@ -85,4 +89,6 @@ public interface FireEquipMapper extends BaseMapper {
FireEquipment findFireEquipById (@Param("id") Long id);
FireEquipment findVideoById (@Param("id") Long id);
FireStation findFireStationById(@Param("id") Long id);
}
package com.yeejoin.amos.fas.business.dao.mapper;
import com.yeejoin.amos.fas.business.vo.EquipmentSpecificIndexVo;
import com.yeejoin.amos.fas.dao.entity.Equipment;
import com.yeejoin.amos.fas.dao.entity.EquipmentFireEquipment;
import com.yeejoin.amos.fas.dao.entity.FireEquipment;
......@@ -35,5 +36,7 @@ public interface ImpAndFireEquipMapper extends BaseMapper {
public Boolean existsAlarmPointByEqpPointIdAndEquipId(@Param("pointId") long pointId, @Param("equipmentId") long equipmentId);
// Boolean containGroupedPoint(long id);
EquipmentSpecificIndexVo findFireEqupmentByCode(String code);
}
......@@ -147,25 +147,25 @@ public class FireEquipServiceImpl implements IFireEquipService {
switch (fireEquipmentType)
{
case pool:
case hydrant:
Optional<WaterResource> waterResource = this.iWaterResourceDao.findById(id);
if(waterResource.isPresent()){
returnEntity = waterResource.get();
}
break;
FireStation fireStation = fireEquipMapper.findFireStationById(id);
fireStation.setType("2");
fireStation.setFireEquipmentInfo(this.fireEquipMapper.queryStorageEquips(id));
returnEntity = fireStation;
break;
case fireFoamRoom:
FireStation fireStation1 = fireEquipMapper.findFireStationById(id);
fireStation1.setType("2");
fireStation1.setFireEquipmentInfo(this.fireEquipMapper.queryStorageEquips(id));
returnEntity = fireStation1;
break;
case fireChamber:
Optional<FireStation> fireStation1 = iFireStationDao.findById(id);
FireStation fireStation=null;
if(fireStation1.isPresent()){
fireStation=fireStation1.get();
}
fireStation.setFireEquipmentInfo(this.fireEquipMapper.queryForGroupCount(id));
returnEntity = fireStation;
FireStation fireStation11 = fireEquipMapper.findFireStationById(id);
fireStation11.setType("1");
fireStation11.setFireEquipmentInfo(this.fireEquipMapper.queryStorageEquips(id));
returnEntity = fireStation11;
break;
case extinguisher:
case hydrant:
case monitorEquipment:
FireEquipment fireEquipment=fireEquipMapper.findFireEquipById(id);
fireEquipment.setEquipClassify(Integer.parseInt(EquipClassifyEnum.EQUIPMENT.getCode()));
......
......@@ -1025,10 +1025,10 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
@Override
@javax.transaction.Transactional
public String processFireEqumtData(AlarmParam deviceData) throws Exception {
EquipmentSpecificIndexVo equipmentSpecificIndexVo = new EquipmentSpecificIndexVo();
equipmentSpecificIndexVo.setEquipmentSpecificId(Long.valueOf(deviceData.getPointCode()));
equipmentSpecificIndexVo.setType("FIREALARM");
EquipmentSpecificIndexVo equipmentSpecificIndexVo = impAndFireEquipMapper.findFireEqupmentByCode(deviceData.getPointCode());
// new EquipmentSpecificIndexVo();
// equipmentSpecificIndexVo.setEquipmentSpecificId(Long.valueOf(deviceData.getPointCode()));
// equipmentSpecificIndexVo.setType("FIREALARM");
TopicEntityVo topicEntity = new TopicEntityVo();
topicEntity.setMessage(JSON.toJSONString(equipmentSpecificIndexVo));
......
......@@ -126,10 +126,6 @@ public class View3dServiceImpl implements IView3dService {
@Autowired
private RemoteSecurityService remoteSecurityService;
@Value("${station.equipment.code}")
private String equipmentCode;
@Override
@Transactional(rollbackFor = Exception.class)
public CommonResponse setPoint3dPosition(List<BindPointBo> pointBoList) {
......
......@@ -75,13 +75,23 @@ amos.feign.gennerator.use-gateway=true
autoSys.push.type=mqtt
#查询装备分类
#消防视频:xfsp
#消防车:2101
#灭火器:3104
#消火栓:3105
#探测器:8501
data.type.fireChamber=2101
#消防小室:9301
data.type.fireChamber=9301
#消防水池:9302
data.type.pool=9302
#消防泡沫间:9305
#消防视频:xfsp
station.equipment.code=2101,3104,3105,8501,9301,9302,9305,xfsp
data.type.fireFoamRoom=9305
#探测器:8501
data.type.monitorEquipment=8501
#灭火器:3104
data.type.extinguisher=3104
#消火栓:3105
data.type.hydrant=3105
......@@ -554,16 +554,36 @@
ALTER TABLE `f_station_info` ADD COLUMN `safety_user_phone_num` varchar(20) NULL COMMENT '安全负责人联系方式';
</sql>
</changeSet>
<changeSet author="zjw" id="16062323232111">
<changeSet author="keyong" id="1608279637-1">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="f_station_info" columnName="safety_user_phone_num" />
<columnExists tableName="f_station_info" columnName="fire_captain_name" />
</not>
</preConditions>
<comment>修改f_station_info表结构</comment>
<sql>
ALTER TABLE `f_station_info` ADD COLUMN `fire_captain_name` varchar(20) NULL COMMENT '驻站消防队队长姓名';
</sql>
</changeSet>
<changeSet author="keyong" id="1608279637-2">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="f_station_info" columnName="fire_captain_phone_num" />
</not>
</preConditions>
<comment>修改f_station_info表结构</comment>
<sql>
ALTER TABLE `f_station_info` ADD COLUMN `fire_captain_phone_num` varchar(20) NULL COMMENT '驻站消防队队长电话';
</sql>
</changeSet>
<changeSet author="keyong" id="1608279637-3">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="f_station_info" columnName="fire_captain_user_id" />
</not>
</preConditions>
<comment>修改f_station_info表结构</comment>
<sql>
ALTER TABLE `f_station_info` ADD COLUMN `fire_captain_user_id` varchar(20) NULL COMMENT '驻站消防队队长';
</sql>
</changeSet>
......
......@@ -196,7 +196,7 @@
<if test="startTime!=null">
AND d.create_date BETWEEN '${startTime}' AND '${endTime}'
</if>
AND e_value IS NOT NULL
AND e_value IS NOT NULL AND e_value != ''
ORDER BY d.create_date desc
LIMIT ${start},${length}
</select>
......@@ -286,6 +286,24 @@
AND se.fire_equipment_id = fe.id
)
</select>
<select id="queryStorageEquips" resultType="map">
SELECT
wed.`name`,
u.`name` AS unit,
sum(wsd.amount) fireEquipmentCount
FROM
wl_stock_detail wsd
LEFT JOIN wl_equipment_detail wed ON wed.id = wsd.equipment_detail_id
LEFT JOIN wl_equipment we ON we.id = wed.equipment_id
LEFT JOIN wl_unit u ON u.id = we.unit_id
LEFT JOIN wl_warehouse_structure ws ON ws.id = wsd.warehouse_structure_id
WHERE
ws.source_id = #{riskSourceId}
GROUP BY
wsd.equipment_detail_id,
wed.`name`
</select>
<select id="findEquipDetailsById" resultType="com.yeejoin.amos.fas.core.common.response.EquipDetailsResponse">
SELECT
......@@ -583,4 +601,16 @@
video.id = #{id}
</if>
</select>
<select id="findFireStationById" resultType="com.yeejoin.amos.fas.dao.entity.FireStation">
SELECT
wb.`name`,
wb.`code`,
wb.address,
wb.region_id AS riskSourceId
FROM
wl_building wb
WHERE
wb.id = #{id}
</select>
</mapper>
\ No newline at end of file
......@@ -157,5 +157,16 @@
and fe.equipment_id = #{equipmentId}
and ep.id = #{pointId}
</select>
<select id="findFireEqupmentByCode" resultType="com.yeejoin.amos.fas.business.vo.EquipmentSpecificIndexVo">
SELECT
id as equipmentSpecificId,
'FIREALARM' as type
FROM
wl_equipment_specific
WHERE
`code` = #{code}
LIMIT 1
</select>
</mapper>
\ No newline at end of file
......@@ -27,7 +27,7 @@
order by rs.id desc
<choose>
<when test="pageSize==-1"></when>
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when>
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when>
</choose>
</select>
......@@ -172,7 +172,7 @@
GROUP BY
ff1.risk_source_id;
</select>
<resultMap id="riskSourceMap" type="com.yeejoin.amos.fas.core.common.response.RiskSourceTreeResponse">
<result property="id" column="id" />
<result property="parentId" column="parent_id" />
......@@ -191,7 +191,7 @@
<result property="omission" column="omission" />
<result property="unplan" column="unplan" />
</resultMap>
<select id="getRiskSources" resultMap="riskSourceMap">
SELECT
rs.id,
......@@ -213,9 +213,9 @@
where rs.org_code = #{compCode}
ORDER BY rs.sort_num,rs.id ASC
</select>
<select id="getRiskSourcesEquipment" resultMap="riskSourceMap">
SELECT
sum(a.cc) ccount,
a.`name`,
......@@ -240,10 +240,10 @@
a.`name`,
a.position3d,
a.parent_id,
a.id
a.id
</select>
<select id="getCheckPointRiskSource" resultMap="riskSourceMap">
SELECT
sum(a.cc) ccount,
......@@ -280,9 +280,9 @@
a.parent_id,
a.id
</select>
<select id="getRiskSourcesFireEquipmentByType" resultMap="riskSourceMap">
SELECT
sum(a.cc) ccount,
......@@ -338,13 +338,13 @@
FROM
`f_risk_source_point_inputitem` rspi
LEFT JOIN p_point pp ON pp.id = rspi.point_id
LEFT JOIN p_input_item pii ON pii.id = rspi.point_inputitem_id
LEFT JOIN p_input_item pii ON pii.id = rspi.point_inputitem_id
WHERE pii.`name` is not NULL
AND rspi.risk_source_id = #{riskSourceId}
GROUP BY riskId,pointId,pointNo,pointName,depName,username,telephone
<choose>
<when test="pageSize==-1"></when>
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when>
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when>
</choose>
</select>
......@@ -540,7 +540,7 @@
</select>
<select id="queryForUnqualified" resultType="map">
SELECT
(
SELECT
......@@ -564,11 +564,11 @@
LEFT JOIN f_fmea fm ON fm.id = pi.fmea_id
WHERE
pi.`state` = 1
AND fm.risk_source_id = #{riskSourceId};
AND fm.risk_source_id = #{riskSourceId};
</select>
<select id="queryForFmeaEquipAlarm" resultType="map">
SELECT
ed.`name` as 'fireEquipmentName',
ei.`name` as 'name'
......@@ -584,15 +584,15 @@
AND fm.risk_source_id = #{riskSourceId}
GROUP BY fireEquipmentName,name
</select>
<select id="queryRiskAreaRpn" resultType="java.util.HashMap">
SELECT
rs.id,
rs.name,
rs.rpn,
rs.rpni,
rs.name,
rs.rpn,
rs.rpni,
rs.risk_level_id as riskLevelId,
rl.`name` as riskLevelName,
rl.`name` as riskLevelName,
rl.level,
rl.color
FROM
......@@ -601,20 +601,20 @@
WHERE rs.parent_id &gt; 0
order by rs.sort_num,rs.id
</select>
<select id="queryRiskSourceSecondLevel" resultType="java.util.HashMap">
SELECT
rs.id,
rs.name,
rs.rpn,
rs.rpni,
rs.name,
rs.rpn,
rs.rpni,
rs.risk_level_id as riskLevelId,
rl.`name` as riskLevelName,
rl.`name` as riskLevelName,
rl.level,
rl.color
FROM
`f_risk_source` rs
LEFT JOIN f_risk_level rl ON rl.id = rs.risk_level_id
LEFT JOIN f_risk_level rl ON rl.id = rs.risk_level_id
WHERE
rs.parent_id = (
SELECT
......@@ -642,12 +642,12 @@
rf.id = ${factorId}
)
</select>
<select id="queryContingencyWater" resultType="java.util.HashMap">
<!-- SELECT
<!--SELECT
wr.alarm_level,
wr.max_level,
wr.area,
......@@ -664,7 +664,31 @@
wr.alarm_level,
wr.max_level,
wr.area,
wr.`name` -->
wr.`name`-->
SELECT
*
FROM
(
SELECT
building.height AS alarm_level,
building.warn_height AS max_level,
building.area_measure AS area,
building.CODE AS CODE,
building.NAME AS NAME,
3.6 AS
VALUE
FROM
wl_building building
LEFT JOIN wl_equipment_category category ON building.equipment_code = category.id
WHERE
category.CODE = 93020000
) wr
GROUP BY
wr.alarm_level,
wr.max_level,
wr.area,
wr.`name`
</select>
......@@ -728,7 +752,7 @@
</set>
where id = #{id}
</update>
<select id="getRegionList" parameterType="string" resultType="com.yeejoin.amos.fas.core.common.response.RegionTreeResponse">
select
rs.id,rs.name,rs.code,rs.parent_id,rs.ue4_location,rs.ue4_rotation,rs.ue4_extent,
......@@ -737,7 +761,7 @@
IF(ISNULL(rs.route_path) || LENGTH(trim(rs.route_path)) <![CDATA[ <]]> 1,0,1) as is_bind,
</when>
<otherwise>
IF(ISNULL(IF(replace(trim(rs.ue4_rotation),'[]','')='',NULL,rs.ue4_rotation))
IF(ISNULL(IF(replace(trim(rs.ue4_rotation),'[]','')='',NULL,rs.ue4_rotation))
AND ISNULL(IF(replace(trim(rs.ue4_location),'[]','')='',NULL,rs.ue4_location)),0,1) as is_bind,
</otherwise>
</choose>
......@@ -750,7 +774,7 @@
left join f_risk_level rl ON rs.risk_level_id = rl.id
where is_region = 'TRUE' AND (rs.org_code = #{orgCode} OR rs.org_code like CONCAT(#{orgCode},'-%'))
</select>
<select id="findRegionById" resultType="java.util.HashMap">
select
id,name,code,parent_id as parentId,ue4_location as ue4Location,ue4_rotation as ue4Rotation,ue4_extent as ue4Extent,route_path as routePath,
......@@ -759,7 +783,7 @@
IF(ISNULL(route_path) || LENGTH(trim(route_path)) <![CDATA[ <]]> 1,0,1) as isBind,
</when>
<otherwise>
IF(ISNULL(IF(replace(trim(ue4_rotation),'[]','')='',NULL,ue4_rotation))
IF(ISNULL(IF(replace(trim(ue4_rotation),'[]','')='',NULL,ue4_rotation))
AND ISNULL(IF(replace(trim(ue4_location),'[]','')='',NULL,ue4_location)),0,1) as isBind,
</otherwise>
</choose>
......@@ -768,7 +792,7 @@
from f_risk_source r
where id=#{id} AND (org_code = #{orgCode} OR org_code like CONCAT(#{orgCode},'-%'))
</select>
<update id="batchSaveRegionUe4" parameterType="java.util.List">
<foreach collection="list" item="item" index="index" open="" close="" separator=";">
update f_risk_source
......
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