Commit 1e6ac5f6 authored by suhuiguang's avatar suhuiguang

Merge branch 'dev_upgrade' into dev_upgrade-1225

# Conflicts: # YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/RiskSourceServiceImpl.java # YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_view3d.xml
parents 8d48f7ae e179b4bd
......@@ -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());
}
}
}
......@@ -663,8 +663,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);
}
......
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);
}
......@@ -998,21 +998,12 @@ 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");
TopicEntityVo topicEntity = new TopicEntityVo();
topicEntity.setMessage(JSON.toJSONString(equipmentSpecificIndexVo));
String data = JSON.toJSONString(topicEntity);
System.out.println(data);
iEquipmentHandlerService.handlerMqttMessage("", data);
// 格式化发送数据
// sendRiskSourceData(deviceData);
//
// blockingQueue.add(deviceData);
EquipmentSpecificIndexVo equipmentSpecificIndexVo = impAndFireEquipMapper.findFireEqupmentByCode(deviceData.getPointCode());
TopicEntityVo topicEntity = new TopicEntityVo();
topicEntity.setMessage(JSON.toJSONString(equipmentSpecificIndexVo));
String data = JSON.toJSONString(topicEntity);
System.out.println(data);
iEquipmentHandlerService.handlerMqttMessage("",data );
return "SUCCESS";
}
......
......@@ -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>
......
......@@ -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
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