Commit e8f4185b authored by maoying's avatar maoying

合并develop_station分支代码

parents e3933cb6 73d45681
...@@ -31,7 +31,7 @@ public class BuildingVideoVO { ...@@ -31,7 +31,7 @@ public class BuildingVideoVO {
private String token; private String token;
@ApiModelProperty("位置") @ApiModelProperty("位置")
private String location ; private String location = "";
@ApiModelProperty("设备id") @ApiModelProperty("设备id")
private Long specificId; private Long specificId;
......
...@@ -33,8 +33,8 @@ public class EquipmentInfoOnPlanController { ...@@ -33,8 +33,8 @@ public class EquipmentInfoOnPlanController {
@ApiOperation(httpMethod = "GET", value = "消防炮信息", notes = "消防炮信息") @ApiOperation(httpMethod = "GET", value = "消防炮信息", notes = "消防炮信息")
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value ="/monitor", method = RequestMethod.GET) @RequestMapping(value ="/monitor", method = RequestMethod.GET)
public ResponseModel getFireMonitorInfo(@RequestParam(required=false) Long fireEquipmentId) { public ResponseModel getFireMonitorInfo(@RequestParam(required=false) Long equipmentId) {
List<Map<String, Object>> list = equipmentInfoOnPlanService.getFireMonitorInfo(fireEquipmentId); List<Map<String, Object>> list = equipmentInfoOnPlanService.getFireMonitorInfo(equipmentId);
return ResponseHelper.buildResponse(list); return ResponseHelper.buildResponse(list);
} }
......
...@@ -106,4 +106,6 @@ public interface EquipmentSpecificIndexMapper extends BaseMapper<EquipmentSpecif ...@@ -106,4 +106,6 @@ public interface EquipmentSpecificIndexMapper extends BaseMapper<EquipmentSpecif
List<EquipmentIndexVO> getEquipIndexByIdIn(@Param("list") List<Long> specificIndexIds); List<EquipmentIndexVO> getEquipIndexByIdIn(@Param("list") List<Long> specificIndexIds);
List<Map<String, Object>> getEquipSpecificIndexByUpdateDateDesc();
} }
package com.yeejoin.equipmanage.mapper; package com.yeejoin.equipmanage.mapper;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.equipmanage.common.datasync.entity.FireEquipment; import com.yeejoin.equipmanage.common.datasync.entity.FireEquipment;
import com.yeejoin.equipmanage.common.dto.EquipmentSpecificDto; import com.yeejoin.equipmanage.common.dto.EquipmentSpecificDto;
import com.yeejoin.equipmanage.common.dto.UserDto; import com.yeejoin.equipmanage.common.dto.UserDto;
import com.yeejoin.equipmanage.common.entity.*; import com.yeejoin.equipmanage.common.entity.EquipmentCategory;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecific;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex;
import com.yeejoin.equipmanage.common.entity.MaintenanceResourceData;
import com.yeejoin.equipmanage.common.entity.dto.EquipmentSpecificDTO; import com.yeejoin.equipmanage.common.entity.dto.EquipmentSpecificDTO;
import com.yeejoin.equipmanage.common.entity.vo.*; import com.yeejoin.equipmanage.common.entity.vo.ComplementCodeVO;
import com.yeejoin.equipmanage.common.vo.*; import com.yeejoin.equipmanage.common.entity.vo.EquiplistSpecificBySystemVO;
import liquibase.pro.packaged.M; import com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo;
import org.apache.ibatis.annotations.Mapper; import com.yeejoin.equipmanage.common.entity.vo.PointTreeVo;
import org.apache.ibatis.annotations.Param; import com.yeejoin.equipmanage.common.entity.vo.SourceNameByEquipSpeIdVO;
import com.yeejoin.equipmanage.common.vo.EquipCategoryVo;
import java.util.HashMap; import com.yeejoin.equipmanage.common.vo.EquipFor3DVO;
import java.util.LinkedHashMap; import com.yeejoin.equipmanage.common.vo.EquipmentDetailVo;
import java.util.List; import com.yeejoin.equipmanage.common.vo.EquipmentOnCarVo;
import java.util.Map; import com.yeejoin.equipmanage.common.vo.EquipmentSpecific3dVo;
import com.yeejoin.equipmanage.common.vo.MaintenanceResourceDataVo;
/** /**
* 消防资源配置 Mapper 接口 * 消防资源配置 Mapper 接口
...@@ -210,7 +222,8 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> { ...@@ -210,7 +222,8 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> {
List<Map<String,String>> getStationInfo(); List<Map<String,String>> getStationInfo();
List<Map<String, Object>> getFireMonitorInfo(@Param("fireEquipmentId") Long fireEquipmentId, @Param("list") String[] strings);
List<Map<String, Object>> getFireMonitorInfo(@Param("equipmentId") Long fireEquipmentId, @Param("list") String[] strings);
List<Map<String, Object>> getFirePumpInfo(@Param("list") String[] strings); List<Map<String, Object>> getFirePumpInfo(@Param("list") String[] strings);
......
...@@ -4,6 +4,7 @@ import com.google.common.collect.Maps; ...@@ -4,6 +4,7 @@ import com.google.common.collect.Maps;
import com.yeejoin.equipmanage.common.utils.DateUtils; import com.yeejoin.equipmanage.common.utils.DateUtils;
import com.yeejoin.equipmanage.mapper.CarMapper; import com.yeejoin.equipmanage.mapper.CarMapper;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificAlarmLogMapper; import com.yeejoin.equipmanage.mapper.EquipmentSpecificAlarmLogMapper;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificIndexMapper;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificMapper; import com.yeejoin.equipmanage.mapper.EquipmentSpecificMapper;
import com.yeejoin.equipmanage.service.IEquipmentInfoOnPlanService; import com.yeejoin.equipmanage.service.IEquipmentInfoOnPlanService;
import org.apache.commons.compress.utils.Lists; import org.apache.commons.compress.utils.Lists;
...@@ -33,6 +34,9 @@ public class EquipmentInfoOnPlanServiceImpl implements IEquipmentInfoOnPlanServi ...@@ -33,6 +34,9 @@ public class EquipmentInfoOnPlanServiceImpl implements IEquipmentInfoOnPlanServi
private EquipmentSpecificAlarmLogMapper equipmentSpecificAlarmLogMapper; private EquipmentSpecificAlarmLogMapper equipmentSpecificAlarmLogMapper;
@Autowired @Autowired
EquipmentSpecificIndexMapper equipmentSpecificIndexMapper;
@Autowired
private CarMapper carMapper; private CarMapper carMapper;
@Value("${equipment.plan.monitor}") @Value("${equipment.plan.monitor}")
...@@ -42,9 +46,9 @@ public class EquipmentInfoOnPlanServiceImpl implements IEquipmentInfoOnPlanServi ...@@ -42,9 +46,9 @@ public class EquipmentInfoOnPlanServiceImpl implements IEquipmentInfoOnPlanServi
String pumpCodes; String pumpCodes;
@Override @Override
public List<Map<String, Object>> getFireMonitorInfo(Long fireEquipmentId) { public List<Map<String, Object>> getFireMonitorInfo(Long equipmentId) {
String[] strings = monitorCodes.split(","); String[] strings = monitorCodes.split(",");
List<Map<String, Object>> list = equipmentSpecificMapper.getFireMonitorInfo(fireEquipmentId, strings); List<Map<String, Object>> list = equipmentSpecificMapper.getFireMonitorInfo(equipmentId, strings);
return Optional.ofNullable(list).orElse(Lists.newArrayList()); return Optional.ofNullable(list).orElse(Lists.newArrayList());
} }
...@@ -57,19 +61,7 @@ public class EquipmentInfoOnPlanServiceImpl implements IEquipmentInfoOnPlanServi ...@@ -57,19 +61,7 @@ public class EquipmentInfoOnPlanServiceImpl implements IEquipmentInfoOnPlanServi
@Override @Override
public List<Map<String, Object>> getOtherEquipInfo() { public List<Map<String, Object>> getOtherEquipInfo() {
Map<String, Object> map = equipmentSpecificAlarmLogMapper.getPlanRecord(); List<Map<String, Object>> list = equipmentSpecificIndexMapper.getEquipSpecificIndexByUpdateDateDesc();
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()); return Optional.ofNullable(list).orElse(Lists.newArrayList());
} }
......
...@@ -311,6 +311,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -311,6 +311,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
public void publishDataToCanvas(List<EquipmentSpecificIndex> indexList) { public void publishDataToCanvas(List<EquipmentSpecificIndex> indexList) {
if (!ObjectUtils.isEmpty(indexList)) { if (!ObjectUtils.isEmpty(indexList)) {
TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
@Override
public void afterCommit() {
EquipmentSpecificIndex index = indexList.stream().filter(x -> x.getUpdateDate() != null) EquipmentSpecificIndex index = indexList.stream().filter(x -> x.getUpdateDate() != null)
.sorted(Comparator.comparing(EquipmentSpecificIndex::getUpdateDate).reversed()) .sorted(Comparator.comparing(EquipmentSpecificIndex::getUpdateDate).reversed())
.collect(Collectors.toList()).get(0); .collect(Collectors.toList()).get(0);
...@@ -336,17 +339,10 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -336,17 +339,10 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
} }
Map<String, Object> map = JSON.parseObject(JSON.toJSONString(equipmentStateVo)); Map<String, Object> map = JSON.parseObject(JSON.toJSONString(equipmentStateVo));
map.put(canvasTopic, topicObject); map.put(canvasTopic, topicObject);
TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
@Override
public void afterCompletion(int status) {
if (TransactionSynchronization.STATUS_COMMITTED == status) {
// 发送数据至画布 // 发送数据至画布
mqttSendGateway.sendToMqtt(canvasTopic, JSON.toJSONString(map)); mqttSendGateway.sendToMqtt(canvasTopic, JSON.toJSONString(map));
} }
}
}); });
} }
} }
......
...@@ -433,5 +433,27 @@ WHERE wles.id=#{id} ...@@ -433,5 +433,27 @@ WHERE wles.id=#{id}
</if> </if>
</where> </where>
</select> </select>
<select id="getEquipSpecificIndexByUpdateDateDesc" resultType="java.util.HashMap">
SELECT
esi.id,
es.`name` AS equipmentSpecificName,
esi.equipment_index_name AS equipmentSpecificIndexName,
IF (
esi.value_label = ''
OR esi.value_label IS NULL,
esi.`value`,
esi.value_label
) AS valueLabel,
es.position AS location,
esi.update_date AS createDate
FROM
`wl_equipment_specific_index` esi
LEFT JOIN wl_equipment_specific es ON es.id = esi.equipment_specific_id
WHERE
esi.`value` IS NOT NULL
ORDER BY
esi.update_date DESC
LIMIT 50
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -1549,8 +1549,8 @@ ...@@ -1549,8 +1549,8 @@
wes.equipment_code LIKE <![CDATA[CONCAT(#{item},'%')]]> wes.equipment_code LIKE <![CDATA[CONCAT(#{item},'%')]]>
</foreach> </foreach>
</if> </if>
<if test="fireEquipmentId != null and fireEquipmentId != ''"> <if test="equipmentId != null and equipmentId != ''">
AND wes.id = #{fireEquipmentId} AND fire.equipment_id = #{equipmentId}
</if> </if>
</where> </where>
ORDER BY realtiemIotIndexUpdateDate DESC ORDER BY realtiemIotIndexUpdateDate DESC
......
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