Commit 540c0de4 authored by zhangsen's avatar zhangsen

Merge remote-tracking branch 'origin/develop_dl_plan6' into develop_dl_plan6

parents cf7aaf55 2bcb9e96
...@@ -87,7 +87,14 @@ ...@@ -87,7 +87,14 @@
order by u.rec_date desc order by u.rec_date desc
)a where a.sequenceNbr is not null )a where a.sequenceNbr is not null
<if test="map.fieldsValue != null"> <if test="map.fieldsValue != null">
<foreach collection="map.fieldsValue.keys" item="item">AND a.${item} = #{map.fieldsValue[${item}]}</foreach> <foreach collection="map.fieldsValue.keys" item="item">
<if test="item != 'bizOrgName'">
AND a.${item} = #{map.fieldsValue[${item}]}
</if>
</foreach>
</if> </if>
</select> </select>
...@@ -164,7 +171,14 @@ ...@@ -164,7 +171,14 @@
order by u.rec_date desc order by u.rec_date desc
)a where a.sequenceNbr is not null )a where a.sequenceNbr is not null
<if test="map.fieldsValue != null"> <if test="map.fieldsValue != null">
<foreach collection="map.fieldsValue.keys" item="item">AND a.${item} = #{map.fieldsValue[${item}]}</foreach> <foreach collection="map.fieldsValue.keys" item="item">
<if test="item != 'bizOrgName'">
AND a.${item} = #{map.fieldsValue[${item}]}
</if>
</foreach>
</if> </if>
LIMIT #{map.pageNum}, #{map.pageSize} LIMIT #{map.pageNum}, #{map.pageSize}
</select> </select>
......
...@@ -3,6 +3,8 @@ package com.yeejoin.equipmanage.controller; ...@@ -3,6 +3,8 @@ package com.yeejoin.equipmanage.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.equipmanage.common.utils.*; import com.yeejoin.equipmanage.common.utils.*;
import com.yeejoin.equipmanage.config.PersonIdentify;
import com.yeejoin.equipmanage.mapper.FireFightingSystemMapper;
import com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmService; import com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmService;
import com.yeejoin.equipmanage.service.IEquipmentSpecificSerivce; import com.yeejoin.equipmanage.service.IEquipmentSpecificSerivce;
import com.yeejoin.equipmanage.service.IFireFightingSystemService; import com.yeejoin.equipmanage.service.IFireFightingSystemService;
...@@ -38,6 +40,9 @@ public class DCenterController extends AbstractBaseController { ...@@ -38,6 +40,9 @@ public class DCenterController extends AbstractBaseController {
private IEquipmentSpecificAlarmService equipmentSpecificAlarmService; private IEquipmentSpecificAlarmService equipmentSpecificAlarmService;
@Autowired @Autowired
private FireFightingSystemMapper fireFightingSystemMapper;
@Autowired
IFireFightingSystemService fireFightingSystemService; IFireFightingSystemService fireFightingSystemService;
@Autowired @Autowired
...@@ -110,5 +115,20 @@ public class DCenterController extends AbstractBaseController { ...@@ -110,5 +115,20 @@ public class DCenterController extends AbstractBaseController {
public ResponseModel getEquipmentStatisticsInfo(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode) throws Exception { public ResponseModel getEquipmentStatisticsInfo(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode) throws Exception {
return CommonResponseUtil.success(specificService.getEquipmentStatisticsInfo(bizOrgCode)); return CommonResponseUtil.success(specificService.getEquipmentStatisticsInfo(bizOrgCode));
} }
@PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "消防水池液位")
@GetMapping("/equip/water/info")
public ResponseModel getWaterInfo(CommonPageable commonPageable, @RequestParam(required = false) String bizOrgCode) {
if (commonPageable.getPageNumber() == 0) {
commonPageable.setPageNumber(1);
}
if (StringUtils.isEmpty(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo();
bizOrgCode = !ValidationUtil.isEmpty(reginParams.getPersonIdentity()) && StringUtil.isNotEmpty(reginParams.getPersonIdentity().getBizOrgCode()) ? reginParams.getPersonIdentity().getBizOrgCode() : null;
}
Page page = new Page<>(commonPageable.getPageNumber(), commonPageable.getPageSize());
return CommonResponseUtil.success(fireFightingSystemMapper.getCenterWaterInfo(page, bizOrgCode));
}
} }
...@@ -213,12 +213,10 @@ public class SupervisionConfigureController extends AbstractBaseController { ...@@ -213,12 +213,10 @@ public class SupervisionConfigureController extends AbstractBaseController {
request8.setName("specificIndexKey"); request8.setName("specificIndexKey");
request8.setValue(StringUtil.isNotEmpty(typeCode) ? StringUtils.trimToNull(typeCode) : null); request8.setValue(StringUtil.isNotEmpty(typeCode) ? StringUtils.trimToNull(typeCode) : null);
queryRequests.add(request8); queryRequests.add(request8);
if (!ValidationUtil.isEmpty(reginParams.getPersonIdentity())) { CommonRequest request13 = new CommonRequest();
CommonRequest request13 = new CommonRequest(); request13.setName("bizOrgCode");
request13.setName("bizOrgCode"); request13.setValue(ObjectUtils.isEmpty(bizOrgCode) ? reginParams.getPersonIdentity().getBizOrgCode() : bizOrgCode);
request13.setValue(StringUtil.isNotEmpty(reginParams.getPersonIdentity().getBizOrgCode()) ? reginParams.getPersonIdentity().getBizOrgCode() : null); queryRequests.add(request13);
queryRequests.add(request13);
}
CommonPageInfoParam param = CommonPageParamUtil.fillCommonPageInfoParam(queryRequests, commonPageable); CommonPageInfoParam param = CommonPageParamUtil.fillCommonPageInfoParam(queryRequests, commonPageable);
return CommonResponseUtil.success(equipmentSpecificAlarmService.fireAlarmLogPage(param)); return CommonResponseUtil.success(equipmentSpecificAlarmService.fireAlarmLogPage(param));
} }
...@@ -240,11 +238,11 @@ public class SupervisionConfigureController extends AbstractBaseController { ...@@ -240,11 +238,11 @@ public class SupervisionConfigureController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "概览稳压泵信息") @ApiOperation(value = "概览稳压泵信息")
@GetMapping("/getPressurePumpInfo") @GetMapping("/getPressurePumpInfo")
public ResponseModel getPressurePumpInfo(CommonPageable commonPageable,@RequestParam(required = false) String bizOrgCode) { public ResponseModel getPressurePumpInfo(CommonPageable commonPageable, @RequestParam(required = false) String bizOrgCode) {
if (commonPageable.getPageNumber() == 0) { if (commonPageable.getPageNumber() == 0) {
commonPageable.setPageNumber(1); commonPageable.setPageNumber(1);
} }
if(ObjectUtils.isEmpty(bizOrgCode)){ if (ObjectUtils.isEmpty(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity(); ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (!ValidationUtil.isEmpty(personIdentity)) { if (!ValidationUtil.isEmpty(personIdentity)) {
...@@ -335,7 +333,7 @@ public class SupervisionConfigureController extends AbstractBaseController { ...@@ -335,7 +333,7 @@ public class SupervisionConfigureController extends AbstractBaseController {
boolean time = false; boolean time = false;
if (!ObjectUtils.isEmpty(stateMap) && stateMap.containsKey("update_date") && stateMap.containsKey("equipment_index_name")) { if (!ObjectUtils.isEmpty(stateMap) && stateMap.containsKey("update_date") && stateMap.containsKey("equipment_index_name")) {
item.put("update_time", String.valueOf(stateMap.get("update_date")).replaceAll("T", " ")); item.put("update_time", String.valueOf(stateMap.get("update_date")).replaceAll("T", " "));
if(!ObjectUtils.isEmpty(stateMap.get("value"))){ if (!ObjectUtils.isEmpty(stateMap.get("value"))) {
item.put("equipment_index_name", stateMap.get("equipment_index_name")); item.put("equipment_index_name", stateMap.get("equipment_index_name"));
} else { } else {
item.put("equipment_index_name", "无信号"); item.put("equipment_index_name", "无信号");
......
...@@ -623,4 +623,6 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -623,4 +623,6 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
Map<String, Object> getSystemRunningInfoList(); Map<String, Object> getSystemRunningInfoList();
List<Map<String, Object>> getFireCarInfoByYJYA(@Param("bizOrgCode") String bizOrgCode); List<Map<String, Object>> getFireCarInfoByYJYA(@Param("bizOrgCode") String bizOrgCode);
Page<Map<String, Object>> getCenterWaterInfo(Page page, String bizOrgCode);
} }
...@@ -214,6 +214,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -214,6 +214,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
@Value("${isSendIot:false}") @Value("${isSendIot:false}")
private Boolean isSendIot; private Boolean isSendIot;
@Value("${is.open.telemetering:false}")
private Boolean isOpenTelemetering;
private static Boolean jcsSwitch; private static Boolean jcsSwitch;
@Value("${systemctl.jcs.switch}") @Value("${systemctl.jcs.switch}")
public void setJcsSwitch(Boolean jcsSwitch){ public void setJcsSwitch(Boolean jcsSwitch){
...@@ -392,36 +395,43 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -392,36 +395,43 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
// 遥测遥信数据推送云端kafka // 遥测遥信数据推送云端kafka
JSONObject jsonObjectXf = new JSONObject(); JSONObject jsonObjectXf = new JSONObject();
jsonObjectXf.put("data_class", "realdata"); jsonObjectXf.put("data_class", "realdata");
// 遥测
if(equipmentSpeIndex.getIsTrend() == 1) { if(equipmentSpeIndex.getIsTrend() == 1) {
jsonObjectXf.put("data_type", "analog");
} else { } else {
String date = DateUtils.date2LongStr(new Date()); jsonObjectXf.put("data_type", "state");
jsonObjectXf.put("op_type", "subscribe_emergency"); }
JSONObject jsonObjectCondition = new JSONObject();
jsonObjectCondition.put("station_psr_id", stationCode);
jsonObjectCondition.put("station_name", stationName);
jsonObjectCondition.put("data_upload_time", date );
jsonObjectXf.put("condition",jsonObjectCondition);
JSONObject jsonObjectData = new JSONObject();
jsonObjectData.put("psrId", stationCode);
jsonObjectData.put("astId", equipmentSpecificIndex.getSpecificCode());
jsonObjectData.put("equipType", equipmentSpecificIndex.getEquipmentCode());
jsonObjectData.put("name", equipmentSpecificIndex.getEquipmentSpecificName()+"-"+equipmentSpecificIndex.getEquipmentSpecificIndexName());
if(value.equals("true")) {
jsonObjectData.put("value","1");
} else if (value.equals("false")) {
jsonObjectData.put("value","0");
} else {
jsonObjectData.put("value", value);
}
jsonObjectData.put("measurementType",equipmentSpecificIndex.getEquipmentIndexKey());
jsonObjectData.put("dateTime",date);
jsonObjectData.put("quality","0"); // 量测质量码:0 有效,1 无效
List<JSONObject> jsonObjects = Arrays.asList(jsonObjectData);
jsonObjectXf.put("data", jsonObjects); String date = DateUtils.date2LongStr(new Date());
jsonObjectXf.put("op_type", "subscribe_emergency");
JSONObject jsonObjectCondition = new JSONObject();
jsonObjectCondition.put("station_psr_id", stationCode);
jsonObjectCondition.put("station_name", stationName);
jsonObjectCondition.put("data_upload_time", date );
jsonObjectXf.put("condition",jsonObjectCondition);
JSONObject jsonObjectData = new JSONObject();
jsonObjectData.put("psrId", stationCode);
jsonObjectData.put("astId", equipmentSpecificIndex.getSpecificCode());
jsonObjectData.put("equipType", equipmentSpecificIndex.getEquipmentCode());
jsonObjectData.put("name", equipmentSpecificIndex.getEquipmentSpecificName()+"-"+equipmentSpecificIndex.getEquipmentSpecificIndexName());
if(value.equals("true")) {
jsonObjectData.put("value","1");
} else if (value.equals("false")) {
jsonObjectData.put("value","0");
} else {
jsonObjectData.put("value", value);
}
jsonObjectData.put("measurementType",equipmentSpecificIndex.getEquipmentIndexKey());
jsonObjectData.put("dateTime",date);
jsonObjectData.put("quality","0"); // 量测质量码:0 有效,1 无效
List<JSONObject> jsonObjects = Arrays.asList(jsonObjectData);
jsonObjectXf.put("data", jsonObjects);
// 遥测
if(!isOpenTelemetering && equipmentSpeIndex.getIsTrend() == 1) {
} else {
try { try {
emqKeeper.getMqttClient().publish("emq.xf.created",jsonObjectXf.toString().getBytes(),1,false); emqKeeper.getMqttClient().publish("emq.xf.created",jsonObjectXf.toString().getBytes(),1,false);
log.info("遥测遥信数据推送云端kafka成功"); log.info("遥测遥信数据推送云端kafka成功");
......
...@@ -114,4 +114,7 @@ equipment.pressurepump.stop=FHS_PressurePump_Stop ...@@ -114,4 +114,7 @@ equipment.pressurepump.stop=FHS_PressurePump_Stop
# 站端标识 # 站端标识
state.code=JP state.code=JP
state.name=NAME state.name=NAME
\ No newline at end of file
# 是否开启遥测数据上报
is.open.telemetering=false
\ No newline at end of file
...@@ -1367,7 +1367,6 @@ ...@@ -1367,7 +1367,6 @@
SELECT SELECT
`wlesal`.id as alarmLogId, `wlesal`.id as alarmLogId,
equipment_specific_index_name, equipment_specific_index_name,
wles.biz_org_name,
equipment_specific_name, equipment_specific_name,
DATE_FORMAT(`wlesal`.`create_date`,'%m-%d %H:%i:%s') alarm_time, DATE_FORMAT(`wlesal`.`create_date`,'%m-%d %H:%i:%s') alarm_time,
location, location,
...@@ -1385,7 +1384,7 @@ ...@@ -1385,7 +1384,7 @@
AND wlesal.type = #{param.fireEquipmentSpecificIndexKey} AND wlesal.type = #{param.fireEquipmentSpecificIndexKey}
</if> </if>
<if test="param.bizOrgCode != null and param.bizOrgCode != ''"> <if test="param.bizOrgCode != null and param.bizOrgCode != ''">
AND wles.biz_org_code like concat (#{param.bizOrgCode},'%') AND wlesal.biz_org_code like concat (#{param.bizOrgCode},'%')
</if> </if>
</where> </where>
ORDER BY ORDER BY
......
...@@ -5287,4 +5287,82 @@ ...@@ -5287,4 +5287,82 @@
GROUP BY GROUP BY
`wc`.`id` `wc`.`id`
</select> </select>
<select id="getCenterWaterInfo" resultType="java.util.Map">
SELECT
a.`name`,
(
CASE
WHEN a.nowLevel IS NULL THEN
'--'
WHEN a.nowLevel >= IFNULL( a.minLevel, 0 )
AND a.maxLevel IS NULL THEN
'100'
WHEN IFNULL( a.minLevel, 0 ) > a.nowLevel
AND a.maxLevel IS NULL THEN
'--' ELSE IFNULL((
FORMAT(
abs(
IFNULL(
a.nowLevel,
IFNULL( a.minLevel, 0 )) /
IF
(
IFNULL( a.maxLevel, 0 ) = 0,
1,
IFNULL( a.maxLevel, 0 ))) * 100,
2
)
),
0
)
END
) AS levelAbs,
IFNULL( a.nowLevel, '--' ) nowLevel,
(
CASE
WHEN a.nowLevel IS NULL
OR a.minLevel IS NULL THEN
'--'
WHEN IFNULL( a.minLevel, 0 ) > IFNULL(
a.nowLevel,
IFNULL( a.minLevel, 0 )) THEN
'缺水' ELSE '正常'
END
) AS levelStatus
FROM
(
SELECT
r.`name`,
IFNULL( rp.min_water_level, 0 ) AS minLevel,
IFNULL( rp.max_water_level, 0 ) AS maxLevel,
(
SELECT
FORMAT( avg( IFNULL( ei.`value`, 0 )), 2 )
FROM
wl_equipment_specific_index ei
WHERE
( ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' OR ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' )
AND FIND_IN_SET( ei.equipment_specific_id, rp.level_device_id ) > 0
) AS nowLevel,
rp.level_device_id
FROM
cb_water_resource r
LEFT JOIN cb_water_resource_pool rp ON rp.resource_id = r.sequence_nbr
WHERE
r.resource_type IN ( 'pool', 'industryPool' )
AND r.is_delete = 1
AND r.`biz_org_code` IS NOT NULL
<if test="bizOrgCode!=null and bizOrgCode!=''">
AND r.biz_org_code like concat(#{bizOrgCode}, '%')
</if>
GROUP BY
r.sequence_nbr
) a ORDER BY
levelStatus DESC
</select>
</mapper> </mapper>
...@@ -47,6 +47,7 @@ public class TdcDrawingController extends BaseController { ...@@ -47,6 +47,7 @@ public class TdcDrawingController extends BaseController {
* *
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@RequestMapping(value = "/save", method = RequestMethod.POST) @RequestMapping(value = "/save", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "新增", notes = "新增") @ApiOperation(httpMethod = "POST", value = "新增", notes = "新增")
public boolean saveTdcDrawing(HttpServletRequest request, @RequestBody TdcDrawing tdcDrawing) { public boolean saveTdcDrawing(HttpServletRequest request, @RequestBody TdcDrawing tdcDrawing) {
...@@ -59,10 +60,11 @@ public class TdcDrawingController extends BaseController { ...@@ -59,10 +60,11 @@ public class TdcDrawingController extends BaseController {
* @param id * @param id
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE) @RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
@ApiOperation(httpMethod = "DELETE", value = "根据id删除", notes = "根据id删除") @ApiOperation(httpMethod = "DELETE", value = "根据id删除", notes = "根据id删除")
public boolean deleteById(HttpServletRequest request, @PathVariable Long id) { public ResponseModel<Boolean> deleteById(HttpServletRequest request, @PathVariable List<Long> id) {
return iTdcDrawingService.removeById(id); return ResponseHelper.buildResponse(iTdcDrawingService.removeByIds(id));
} }
...@@ -71,6 +73,7 @@ public class TdcDrawingController extends BaseController { ...@@ -71,6 +73,7 @@ public class TdcDrawingController extends BaseController {
* *
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@RequestMapping(value = "/updateById", method = RequestMethod.PUT) @RequestMapping(value = "/updateById", method = RequestMethod.PUT)
@ApiOperation(httpMethod = "PUT", value = "修改", notes = "修改") @ApiOperation(httpMethod = "PUT", value = "修改", notes = "修改")
public boolean updateByIdTdcDrawing(HttpServletRequest request, @RequestBody TdcDrawing tdcDrawing) { public boolean updateByIdTdcDrawing(HttpServletRequest request, @RequestBody TdcDrawing tdcDrawing) {
...@@ -84,6 +87,7 @@ public class TdcDrawingController extends BaseController { ...@@ -84,6 +87,7 @@ public class TdcDrawingController extends BaseController {
* @param id * @param id
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@RequestMapping(value = "/{id}", method = RequestMethod.GET) @RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据id查询", notes = "根据id查询") @ApiOperation(httpMethod = "GET", value = "根据id查询", notes = "根据id查询")
public TdcDrawing selectById(HttpServletRequest request, @PathVariable Long id) { public TdcDrawing selectById(HttpServletRequest request, @PathVariable Long id) {
......
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