Commit 66536eee authored by KeYong's avatar KeYong

Merge branch 'develop_station' into developer

# Conflicts: # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/CarMapper.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/EquipmentSpecificMapper.java # amos-boot-system-equip/src/main/resources/application-dev.properties # amos-boot-system-equip/src/main/resources/changelog/wl-3.0.1.xml # amos-boot-system-equip/src/main/resources/mapper/CarMapper.xml
parents 57ef3521 aa2d214c
......@@ -155,4 +155,8 @@ public class EquipmentSpecific extends BaseEntity {
@ApiModelProperty(value = "系统名称")
@TableField(exist = false)
private String systemName;
@ApiModelProperty(value = "设备值说明")
@TableField("value_label")
private String valueLabel;
}
package com.yeejoin.equipmanage.controller;
import com.yeejoin.equipmanage.common.utils.CommonResponseUtil;
import com.yeejoin.equipmanage.service.IEquipmentInfoOnPlanService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List;
import java.util.Map;
/**
* @author keyong
* @title: EquipmentInfoOnPlanController
* <pre>
* @description: TODO
* </pre>
* @date 2022/5/12 10:49
*/
@RestController
@Api(tags = "预案界面装备信息展示")
@RequestMapping(value = "/fire/plan")
public class EquipmentInfoOnPlanController {
@Autowired
private IEquipmentInfoOnPlanService equipmentInfoOnPlanService;
@ApiOperation(httpMethod = "GET", value = "消防炮信息", notes = "消防炮信息")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value ="/monitor", method = RequestMethod.GET)
public ResponseModel getFireMonitorInfo(@RequestParam(required=false) Long fireEquipmentId) {
List<Map<String, Object>> list = equipmentInfoOnPlanService.getFireMonitorInfo(fireEquipmentId);
return ResponseHelper.buildResponse(list);
}
@ApiOperation(httpMethod = "GET", value = "消防泵信息", notes = "消防泵信息")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value ="/pump")
public ResponseModel getFirePumpInfo() {
List<Map<String, Object>> list = equipmentInfoOnPlanService.getFirePumpInfo();
return CommonResponseUtil.success(list);
}
@ApiOperation(httpMethod = "GET", value = "其他设备信息", notes = "其他设备信息")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value ="/journal")
public ResponseModel getOtherEquipInfo() {
List<Map<String, Object>> list = equipmentInfoOnPlanService.getOtherEquipInfo();
return CommonResponseUtil.success(list);
}
@ApiOperation(httpMethod = "GET", value = "消防力量和车辆启停信息", notes = "消防力量和车辆启停信息")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value ="/power/info")
public ResponseModel getFirePowerAndCarInfo() {
Map<String, Object> list = equipmentInfoOnPlanService.getFirePowerAndCarInfo();
return CommonResponseUtil.success(list);
}
}
......@@ -72,7 +72,13 @@ public interface CarMapper extends BaseMapper<Car> {
List<CarFusionDto> selectCarAndCarProperty();
List<Map<String, Object>> queryCompanyCarStaData();
List<Map<String, Object>> queryCompanyIotStaData();
List<Map<String, Object>> getCarState();
List<Map<String, Object>> getFirePowerInfo();
}
......@@ -8,7 +8,9 @@ import com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarmLog;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @author keyong
......@@ -32,4 +34,8 @@ public interface EquipmentSpecificAlarmLogMapper extends BaseMapper<EquipmentSpe
List<FireEquipmentFireAlarm> getFireEquipAlarmLogDetailsById(@Param("list") List<Long> ids);
Map<String, Object> getPlanRecord();
List<Map<String, Object>> getOtherEquipInfo(@Param("date") String date, @Param("equipmentId") Long equipmentId);
}
......@@ -10,6 +10,7 @@ import com.yeejoin.equipmanage.common.entity.*;
import com.yeejoin.equipmanage.common.entity.dto.EquipmentSpecificDTO;
import com.yeejoin.equipmanage.common.entity.vo.*;
import com.yeejoin.equipmanage.common.vo.*;
import liquibase.pro.packaged.M;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -206,6 +207,11 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> {
List<EquiplistSpecificBySystemVO> getListByWarehouseStructureId(Long floorId);
List<Map<String,String>> getStationInfo();
List<Map<String, Object>> getFireMonitorInfo(@Param("fireEquipmentId") Long fireEquipmentId, @Param("list") String[] strings);
List<Map<String, Object>> getFirePumpInfo(@Param("list") String[] strings);
}
package com.yeejoin.equipmanage.service;
import java.util.List;
import java.util.Map;
/**
* @author keyong
* @title: EquipmentInfoOnPlanService
* <pre>
* @description: TODO
* </pre>
* @date 2022/5/12 11:43
*/
public interface IEquipmentInfoOnPlanService {
/**
* 消防炮信息
* @return
*/
List<Map<String, Object>> getFireMonitorInfo(Long fireEquipmentId);
/**
* 消防泵信息
* @return
*/
List<Map<String, Object>> getFirePumpInfo();
/**
* 其他设备信息
* @return
*/
List<Map<String, Object>> getOtherEquipInfo();
/**
* 消防力量和车辆启停信息
* @return
*/
Map<String, Object> getFirePowerAndCarInfo();
}
package com.yeejoin.equipmanage.service.impl;
import com.google.common.collect.Maps;
import com.yeejoin.equipmanage.common.utils.DateUtils;
import com.yeejoin.equipmanage.mapper.CarMapper;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificAlarmLogMapper;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificMapper;
import com.yeejoin.equipmanage.service.IEquipmentInfoOnPlanService;
import org.apache.commons.compress.utils.Lists;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* @author keyong
* @title: EquipmentInfoOnPlanServiceImpl
* <pre>
* @description: TODO
* </pre>
* @date 2022/5/12 11:43
*/
@Service("EquipmentInfoOnPlanService")
public class EquipmentInfoOnPlanServiceImpl implements IEquipmentInfoOnPlanService {
@Autowired
private EquipmentSpecificMapper equipmentSpecificMapper;
@Autowired
private EquipmentSpecificAlarmLogMapper equipmentSpecificAlarmLogMapper;
@Autowired
private CarMapper carMapper;
@Value("${equipment.plan.monitor}")
String monitorCodes;
@Value("${equipment.plan.pump}")
String pumpCodes;
@Override
public List<Map<String, Object>> getFireMonitorInfo(Long fireEquipmentId) {
String[] strings = monitorCodes.split(",");
List<Map<String, Object>> list = equipmentSpecificMapper.getFireMonitorInfo(fireEquipmentId, strings);
return Optional.ofNullable(list).orElse(Lists.newArrayList());
}
@Override
public List<Map<String, Object>> getFirePumpInfo() {
String[] strings = pumpCodes.split(",");
List<Map<String, Object>> list = equipmentSpecificMapper.getFirePumpInfo(strings);
return Optional.ofNullable(list).orElse(Lists.newArrayList());
}
@Override
public List<Map<String, Object>> getOtherEquipInfo() {
Map<String, Object> map = equipmentSpecificAlarmLogMapper.getPlanRecord();
Date startTime = null;
Long equipmentId = null;
if (!ValidationUtil.isEmpty(map)) {
try {
startTime = DateUtils.dateParse(String.valueOf(map.get("startTime")), DateUtils.DATE_TIME_T_PATTERN);
equipmentId = Long.valueOf(String.valueOf(map.get("equipmentId")));
} catch (Exception e) {
e.printStackTrace();
}
}
String dateParam = startTime == null ? null : new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(startTime);
List<Map<String, Object>> list = equipmentSpecificAlarmLogMapper.getOtherEquipInfo(dateParam, equipmentId);
return Optional.ofNullable(list).orElse(Lists.newArrayList());
}
@Override
public Map<String, Object> getFirePowerAndCarInfo() {
List<Map<String, Object>> firePowerMap = carMapper.getFirePowerInfo();
List<Map<String, Object>> carStateMap = carMapper.getCarState();
Map<String, Object> map = new HashMap<>();
map.put("firePower", Optional.ofNullable(firePowerMap).orElse(Lists.newArrayList()));
map.put("carState", Optional.ofNullable(carStateMap).orElse(Lists.newArrayList()));
return map;
}
}
......@@ -1642,6 +1642,7 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
es.setRealtimeIotIndexValue(index.getValue());
es.setRealtimeIotIndexId(index.getEquipmentIndexId());
es.setRealtimeIotIndexUpdateDate(index.getUpdateDate());
es.setValueLabel(index.getValueLabel());
equipmentSpecificMapper.updateById(es);
}
}
......
......@@ -85,3 +85,7 @@ param.nrvideo.url=http://198.87.103.158:8001;
#南瑞视频平台通过视频id获取flv格式视频播放地址
param.nrflvbyvoideoid.url=http://192.168.4.159:10010/api/media/live
# 预案消防炮、消防泵设备维度类型
equipment.plan.monitor=92030200,92032200
equipment.plan.pump=92010600,92030600,92130400,92140200,92150300
......@@ -2814,7 +2814,6 @@
</sql>
</changeSet>
<changeSet author="chenzhao" id="2022-04-21-1">
<preConditions onFail="MARK_RAN">
<tableExists tableName="wl_form_group_column"/>
......@@ -2824,4 +2823,30 @@
REPLACE INTO `wl_form_group_column`(`id`, `field_name`, `field_label`, `data_type`, `group_id`, `query_strategy`, `not_null`, `group_code`, `creator_id`, `create_date`) VALUES (133000000347, 'inwhichBuild', '所在建筑', 'String', 132828674824, 'eq', b'0', 'r_tank', 2581805, '2022-04-18 11:29:34');
</sql>
</changeSet>
<changeSet author="keyong" id="1652339928-1">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="wl_equipment_specific" columnName="value_label"/>
</not>
</preConditions>
<comment>wl_equipment_specific add column value_label</comment>
<sql>
alter table `wl_equipment_specific` add column `value_label` varchar(255) DEFAULT NULL COMMENT '设备值说明' after `realtime_iot_index_value`;
</sql>
</changeSet>
<changeSet author="keyong" id="1652339928-2">
<preConditions onFail="MARK_RAN">
<tableExists tableName="wl_equipment_specific" />
</preConditions>
<comment>wl_equipment_specific同步value_label列数据</comment>
<sql>
UPDATE
wl_equipment_specific wes
SET
wes.value_label = ( SELECT value_label FROM wl_equipment_specific_index wesi
WHERE
wesi.equipment_specific_id = wes.id AND wesi.equipment_index_id = wes.realtime_iot_index_id );
</sql>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
......@@ -619,6 +619,7 @@
from wl_car wc LEFT JOIN wl_car_property wcp on wc.id = wcp.car_id
where wcp.equipment_index_key in ('FAS_Car_Video', 'FAS_Car_GIS');
</select>
<select id="queryCompanyCarStaData" resultType="java.util.Map">
SELECT
s.biz_org_code as bizOrgCode,
......@@ -670,7 +671,20 @@
and e.category_id = c.id
and s.biz_org_code is not null
GROUP BY s.biz_org_code ,c.code
</select>
<select id="getCarState" resultType="Map">
SELECT
*
FROM
v_fire_firecar_num
</select>
<select id="getFirePowerInfo" resultType="Map">
SELECT
department_name departmentName,
total,
on_duty onDuty
FROM
v_duty_person
</select>
</mapper>
......@@ -148,4 +148,36 @@
</if>
</where>
</select>
<select id="getPlanRecord" resultType="Map">
SELECT
start_time startTime,
equipment_code equipmentCode,
equipment_name equipmentName,
equipment_id equipmentId,
fire_equipment_id fireEquipmentId
FROM
c_plan_operation_record cpor
WHERE
cpor.status = 0
ORDER BY cpor.create_date DESC
LIMIT 1
</select>
<select id="getOtherEquipInfo" resultType="com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarmLog">
SELECT
*
FROM
wl_equipment_specific_alarm_log weal
<where>
weal.type != 'HearBeat'
<if test="date != null">
AND weal.create_date <![CDATA[>=]]> DATE_FORMAT(#{date}, '%Y-%m-%d %H:%i:%S')
</if>
<if test="equipmentId != null">
AND weal.equipment_specific_id = #{equipmentId}
</if>
</where>
ORDER BY weal.create_date DESC
</select>
</mapper>
\ No newline at end of file
......@@ -1526,4 +1526,57 @@
f_station_info
LIMIT 1
</select>
<select id="getFireMonitorInfo" resultType="Map">
SELECT
wes.id,
wes.name,
wes.position,
wes.equipment_code equipmentCode,
wes.realtime_iot_index_name realtimeIotIndexName,
wes.realtime_iot_index_key realtimeIotIndexKey,
wes.realtime_iot_index_value realtimeIotIndexValue,
wes.value_label valueLabel,
wes.realtime_iot_es_index_id realtimeIotSpecificIndexId,
wes.realtime_iot_index_update_date realtiemIotIndexUpdateDate,
wes.realtime_iot_index_id realtimeIotIndexId
FROM
wl_equipment_specific wes
LEFT JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id
<where>
<if test="list != null and list.length > 0">
<foreach collection="list" item="item" index="index" open="(" close=")" separator="OR">
wes.equipment_code LIKE <![CDATA[CONCAT(#{item},'%')]]>
</foreach>
</if>
<if test="fireEquipmentId != null and fireEquipmentId != ''">
AND wes.id = #{fireEquipmentId}
</if>
</where>
ORDER BY realtiemIotIndexUpdateDate DESC
</select>
<select id="getFirePumpInfo" resultType="Map">
SELECT
wes.id,
wes.name,
wes.position,
wes.equipment_code equipmentCode,
wes.realtime_iot_index_name realtimeIotIndexName,
wes.realtime_iot_index_key realtimeIotIndexKey,
wes.realtime_iot_index_value realtimeIotIndexValue,
wes.value_label valueLabel,
wes.realtime_iot_es_index_id realtimeIotSpecificIndexId,
wes.realtime_iot_index_update_date realtiemIotIndexUpdateDate,
wes.realtime_iot_index_id realtimeIotIndexId
FROM
wl_equipment_specific wes
<where>
<if test="list != null and list.length > 0">
<foreach collection="list" item="item" index="index" open="(" close=")" separator="OR">
wes.equipment_code LIKE <![CDATA[CONCAT(#{item},'%')]]>
</foreach>
</if>
</where>
ORDER BY realtiemIotIndexUpdateDate DESC
</select>
</mapper>
\ No newline at end of file
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