Commit a69416f5 authored by tianyiming's avatar tianyiming

3小屏接口开发:包含(系统名称、系统工作状态、近一月top5、设备状态、水源信息)

parent 9ea52de8
...@@ -5,6 +5,7 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams; ...@@ -5,6 +5,7 @@ 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.mapper.FireFightingSystemMapper; import com.yeejoin.equipmanage.mapper.FireFightingSystemMapper;
import com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmService; import com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmService;
import com.yeejoin.equipmanage.service.IFireFightingSystemService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -33,6 +34,9 @@ public class ConfigureController extends AbstractBaseController { ...@@ -33,6 +34,9 @@ public class ConfigureController extends AbstractBaseController {
@Autowired @Autowired
private IEquipmentSpecificAlarmService equipmentSpecificAlarmService; private IEquipmentSpecificAlarmService equipmentSpecificAlarmService;
@Autowired
private IFireFightingSystemService iFireFightingSystemService;
@RequestMapping(value = "/alarmLogPage", method = RequestMethod.GET) @RequestMapping(value = "/alarmLogPage", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "列表分页查询", produces = "application/json;charset=UTF-8", notes = "列表分页查询") @ApiOperation(httpMethod = "GET", value = "列表分页查询", produces = "application/json;charset=UTF-8", notes = "列表分页查询")
...@@ -161,12 +165,130 @@ public class ConfigureController extends AbstractBaseController { ...@@ -161,12 +165,130 @@ public class ConfigureController extends AbstractBaseController {
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "3小水源信息") @ApiOperation(value = "概览水源信息")
@GetMapping("/getWaterInfo") @GetMapping("/getWaterInfo")
public ResponseModel getWaterInfo() { public ResponseModel getWaterInfo() {
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
String bizOrgCode = !ValidationUtil.isEmpty(reginParams.getPersonIdentity()) && StringUtil.isNotEmpty(reginParams.getPersonIdentity().getBizOrgCode()) ? reginParams.getPersonIdentity().getBizOrgCode() : null; String bizOrgCode = !ValidationUtil.isEmpty(reginParams.getPersonIdentity()) && StringUtil.isNotEmpty(reginParams.getPersonIdentity().getBizOrgCode()) ? reginParams.getPersonIdentity().getBizOrgCode() : null;
return CommonResponseUtil.success(fireFightingSystemMapper.getWaterInfo(bizOrgCode)); return CommonResponseUtil.success(fireFightingSystemMapper.getWaterInfo(bizOrgCode, null));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "3小水源信息")
@GetMapping("/getSmallWaterInfo")
public ResponseModel getSmallWaterInfo(@RequestParam(required = false) String systemCode) {
HashMap<String, Object> hashMap = new HashMap<>();
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (!ValidationUtil.isEmpty(personIdentity)) {
String bizOrgCode = personIdentity.getBizOrgCode();
if (StringUtils.isNotBlank(bizOrgCode)) {
hashMap.put("bizOrgCode", bizOrgCode);
}
if (bizOrgCode == null) {
return CommonResponseUtil.success(null);
}
}
if (StringUtils.isNotBlank(systemCode)) {
hashMap.put("systemCode", systemCode);
}
return CommonResponseUtil.success(iFireFightingSystemService.getSmallWaterInfo(hashMap));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "获取系统名称(根据系统编码查询)")
@GetMapping("/getSystemName")
public ResponseModel getEquipSystemName(@RequestParam(required = false) String systemCode) {
HashMap<String, Object> hashMap = new HashMap<>();
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (!ValidationUtil.isEmpty(personIdentity)) {
String bizOrgCode = personIdentity.getBizOrgCode();
if (StringUtils.isNotBlank(bizOrgCode)) {
hashMap.put("bizOrgCode", bizOrgCode);
}
if (bizOrgCode == null) {
return CommonResponseUtil.success(null);
}
}
if (StringUtils.isNotBlank(systemCode)) {
hashMap.put("systemCode", systemCode);
}
return CommonResponseUtil.success(iFireFightingSystemService.getSystemName(hashMap));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "获取系统工作状态(根据系统编码查询)")
@GetMapping("/getSystemStatus")
public ResponseModel getEquipSystemStatus(@RequestParam(required = false) String systemCode) {
HashMap<String, Object> hashMap = new HashMap<>();
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (!ValidationUtil.isEmpty(personIdentity)) {
String bizOrgCode = personIdentity.getBizOrgCode();
if (StringUtils.isNotBlank(bizOrgCode)) {
hashMap.put("bizOrgCode", bizOrgCode);
}
if (bizOrgCode == null) {
return CommonResponseUtil.success(null);
}
}
if (StringUtils.isNotBlank(systemCode)) {
hashMap.put("systemCode", systemCode);
}
return CommonResponseUtil.success(iFireFightingSystemService.getSystemStatus(hashMap));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "获取系统近一月告警设备top5(根据系统编码查询)")
@GetMapping("/getAlarmOneMonth")
public ResponseModel getSpecificAlarmOneMonthTOP(@RequestParam(required = false) String systemCode) {
HashMap<String, Object> hashMap = new HashMap<>();
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (!ValidationUtil.isEmpty(personIdentity)) {
String bizOrgCode = personIdentity.getBizOrgCode();
if (StringUtils.isNotBlank(bizOrgCode)) {
hashMap.put("bizOrgCode", bizOrgCode);
}
if (bizOrgCode == null) {
return CommonResponseUtil.success(null);
}
}
if (StringUtils.isNotBlank(systemCode)) {
hashMap.put("systemCode", systemCode);
}
return CommonResponseUtil.success(iFireFightingSystemService.equipAlarmTOP(hashMap));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "获取系统设备状态(根据系统编码查询)")
@GetMapping("/getEquipmentState")
public ResponseModel getEquipmentState(@RequestParam(required = false) String systemCode, CommonPageable commonPageable) {
if (commonPageable.getPageNumber() == 0) {
commonPageable.setPageNumber(1);
}
Page result = new Page<>(commonPageable.getPageNumber(), commonPageable.getPageSize());
HashMap<String, Object> hashMap = new HashMap<>();
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (!ValidationUtil.isEmpty(personIdentity)) {
String bizOrgCode = personIdentity.getBizOrgCode();
if (StringUtils.isNotBlank(bizOrgCode)) {
hashMap.put("bizOrgCode", bizOrgCode);
}
if (bizOrgCode == null) {
return CommonResponseUtil.success(null);
}
}
if (StringUtils.isNotBlank(systemCode)) {
hashMap.put("systemCode", systemCode);
}
return CommonResponseUtil.success(iFireFightingSystemService.equipmentState(result, hashMap));
} }
} }
...@@ -10,6 +10,7 @@ import com.yeejoin.equipmanage.common.entity.vo.*; ...@@ -10,6 +10,7 @@ import com.yeejoin.equipmanage.common.entity.vo.*;
import com.yeejoin.equipmanage.common.vo.*; import com.yeejoin.equipmanage.common.vo.*;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -76,9 +77,9 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -76,9 +77,9 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
* *
* @return * @return
*/ */
List<PointTreeVo> getPointData(@Param("id") String id,@Param("instanceId") String instanceId); List<PointTreeVo> getPointData(@Param("id") String id, @Param("instanceId") String instanceId);
List<PointTreeVo> getPointDataNew(@Param("id") String id,@Param("instanceId") String instanceId,@Param("displayName") String displayName); List<PointTreeVo> getPointDataNew(@Param("id") String id, @Param("instanceId") String instanceId, @Param("displayName") String displayName);
List<PointTreeVo> getPointDataNum(@Param("id") String id); List<PointTreeVo> getPointDataNum(@Param("id") String id);
...@@ -105,37 +106,35 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -105,37 +106,35 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
*/ */
List<AlarmDataVO> getSystemById(Long id); List<AlarmDataVO> getSystemById(Long id);
IPage<EquipmentAlarmBySystemIdOrSourceIdVO> getEquipmentAlarmBySystemIdOrSourceIdVO(@Param("page")IPage<EquipmentAlarmBySystemIdOrSourceIdVO> page IPage<EquipmentAlarmBySystemIdOrSourceIdVO> getEquipmentAlarmBySystemIdOrSourceIdVO(@Param("page") IPage<EquipmentAlarmBySystemIdOrSourceIdVO> page
, @Param("sourceId")Long sourceId , @Param("sourceId") Long sourceId
, @Param("systemId")Long systemId , @Param("systemId") Long systemId
, @Param("confirmType")Integer confirmType , @Param("confirmType") Integer confirmType
, @Param("createDate")String createDate , @Param("createDate") String createDate
, @Param("type")String type); , @Param("type") String type);
IPage<EquipTypeImgAmountVO> getColaCategoryAmountList(@Param("page")IPage page, IPage<EquipTypeImgAmountVO> getColaCategoryAmountList(@Param("page") IPage page,
@Param("hierarchy")int hierarchy, @Param("hierarchy") int hierarchy,
@Param("codeHead")String codeHead, @Param("codeHead") String codeHead,
@Param("equipTypeAmountPage")EquipTypeAmountPageDTO equipTypeAmountPage); @Param("equipTypeAmountPage") EquipTypeAmountPageDTO equipTypeAmountPage);
IPage<EquipTypeImgAmountVO> getColaCategoryAmountListIot(@Param("page")IPage page,
@Param("hierarchy")int hierarchy,
@Param("codeHead")String codeHead,
@Param("equipTypeAmountPage")EquipTypeAmountPageDTO equipTypeAmountPage);
IPage<EquipTypeImgAmountVO> getColaCategoryAmountCarList(@Param("page")IPage page,
@Param("hierarchy")int hierarchy,
@Param("codeHead")String codeHead,
@Param("equipTypeAmountPage")EquipTypeAmountPageDTO equipTypeAmountPage);
IPage<EquipTypeImgAmountVO> getColaCategoryAmountEquList(@Param("page")IPage page, IPage<EquipTypeImgAmountVO> getColaCategoryAmountListIot(@Param("page") IPage page,
@Param("hierarchy")int hierarchy, @Param("hierarchy") int hierarchy,
@Param("codeHead")String codeHead, @Param("codeHead") String codeHead,
@Param("equipTypeAmountPage")EquipTypeAmountPageDTO equipTypeAmountPage); @Param("equipTypeAmountPage") EquipTypeAmountPageDTO equipTypeAmountPage);
IPage<EquipTypeImgAmountVO> getColaCategoryAmountCarList(@Param("page") IPage page,
@Param("hierarchy") int hierarchy,
@Param("codeHead") String codeHead,
@Param("equipTypeAmountPage") EquipTypeAmountPageDTO equipTypeAmountPage);
IPage<EquipTypeImgAmountVO> getColaCategoryAmountEquList(@Param("page") IPage page,
@Param("hierarchy") int hierarchy,
@Param("codeHead") String codeHead,
@Param("equipTypeAmountPage") EquipTypeAmountPageDTO equipTypeAmountPage);
List<FireFightingSystem> getFireFightingSystemDetail(@Param("fireFightingSystemVo") FireFightingSystemVo fireFightingSystemVo);
List<FireFightingSystem> getFireFightingSystemDetail(@Param("fireFightingSystemVo")FireFightingSystemVo fireFightingSystemVo);
List<FireFightingSystemEntity> getFightingSysByCodes(@Param("ids") String[] idsArr); List<FireFightingSystemEntity> getFightingSysByCodes(@Param("ids") String[] idsArr);
...@@ -144,13 +143,12 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -144,13 +143,12 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
List<FireFightingSystem3dVo> get3dFightingSystemList(@Param("list") List<String> collect); List<FireFightingSystem3dVo> get3dFightingSystemList(@Param("list") List<String> collect);
List<SpeIndexVo> getSpeIndexIn(@Param("list") List<Long> idList); List<SpeIndexVo> getSpeIndexIn(@Param("list") List<Long> idList);
Map<String, Object> getFireSystemState(); Map<String, Object> getFireSystemState();
Map<String, Object> getFireOnlSystem(); Map<String, Object> getFireOnlSystem();
Map<String, Object> getFireOnlSystemThreeSmall(); Map<String, Object> getFireOnlSystemThreeSmall();
Map<String, Object> getFireCafsSystem(); Map<String, Object> getFireCafsSystem();
...@@ -162,77 +160,87 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -162,77 +160,87 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
Map<String, Object> getFireAcsSystem(); Map<String, Object> getFireAcsSystem();
Map<String, Object> getFireFhsSystem(); Map<String, Object> getFireFhsSystem();
Map<String, Object> getTodayConfirmAlarmInfo(); Map<String, Object> getTodayConfirmAlarmInfo();
Map<String, Object> getPoolInfo(); Map<String, Object> getPoolInfo();
FireFightingSystemVo getFightingSysInfo(@Param("code") String code, @Param("id") Long id); FireFightingSystemVo getFightingSysInfo(@Param("code") String code, @Param("id") Long id);
/** /**
* 火灾报警系统3小 ,装备定义数量 * 火灾报警系统3小 ,装备定义数量
* @return Map<String,Object> *
* @return Map<String, Object>
*/ */
Map<String,Object> fireAlarmSysEquipmentNumber(); Map<String, Object> fireAlarmSysEquipmentNumber();
/** /**
* 火灾报警系统3小,指标 * 火灾报警系统3小,指标
* @return Map<String,Object> *
* @return Map<String, Object>
*/ */
Map<String,Object> fireAlarmSysIndexNumber(); Map<String, Object> fireAlarmSysIndexNumber();
/** /**
* 消防水系统-》12号消防水池 * 消防水系统-》12号消防水池
* @return Map<String,Object> *
* @return Map<String, Object>
*/ */
Map<String,Object> fireWaterSysPool(); Map<String, Object> fireWaterSysPool();
/** /**
* 消防水系统-》消防管网 * 消防水系统-》消防管网
* @return Map<String,Object> *
* @return Map<String, Object>
*/ */
Map<String,Object> fireWaterSysPipeNetwork(); Map<String, Object> fireWaterSysPipeNetwork();
/** /**
* 消防水系统-》消火栓按钮 * 消防水系统-》消火栓按钮
* @return Map<String,Object> *
* @return Map<String, Object>
*/ */
Map<String,Object> fireWaterSysHydrant(); Map<String, Object> fireWaterSysHydrant();
/** /**
* 消防水系统-》水泵房采集装置 * 消防水系统-》水泵房采集装置
* @return Map<String,Object> *
* @return Map<String, Object>
*/ */
Map<String,Object> fireWaterSysCollectingDevice(); Map<String, Object> fireWaterSysCollectingDevice();
/** /**
* 消防水系统-》消防泵、稳压泵,大屏用 * 消防水系统-》消防泵、稳压泵,大屏用
* @return Map<String,Object> *
* @return Map<String, Object>
*/ */
Map<String,Object> fireWaterSysWaterPump(); Map<String, Object> fireWaterSysWaterPump();
/** /**
* 预混泡沫灭火系统3小 * 预混泡沫灭火系统3小
* @return Map<String,Object> *
* @return Map<String, Object>
*/ */
Map<String,Object> fireFoamSysEquipmentIndexNumber(); Map<String, Object> fireFoamSysEquipmentIndexNumber();
/** /**
* 其他系统总数及指标数量 * 其他系统总数及指标数量
* @return Map<String,Object> *
* @return Map<String, Object>
*/ */
Map<String,Object> otherSysIndexNumAndTotal(); Map<String, Object> otherSysIndexNumAndTotal();
/** /**
* 预混泡沫灭火系统概览 * 预混泡沫灭火系统概览
* @return Map<String,Object>
* *
* @return Map<String, Object>
*/ */
Map<String,Object> fireFoamSysEquipmentNumber(); Map<String, Object> fireFoamSysEquipmentNumber();
/** /**
* 根据bizorgcode获取系统分类数量 * 根据bizorgcode获取系统分类数量
*
* @param bizOrgCode * @param bizOrgCode
* @return * @return
*/ */
...@@ -240,6 +248,7 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -240,6 +248,7 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
/** /**
* 获取系统告警信息 * 获取系统告警信息
*
* @param bizOrgCode * @param bizOrgCode
* @return * @return
*/ */
...@@ -247,6 +256,7 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -247,6 +256,7 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
/** /**
* 获取设备告警待确认和未处理信息 * 获取设备告警待确认和未处理信息
*
* @param bizOrgCode * @param bizOrgCode
* @return * @return
*/ */
...@@ -254,6 +264,7 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -254,6 +264,7 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
/** /**
* 获取消防力量信息(队伍值班等) * 获取消防力量信息(队伍值班等)
*
* @param bizOrgCode * @param bizOrgCode
* @return * @return
*/ */
...@@ -261,6 +272,7 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -261,6 +272,7 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
/** /**
* 消防车辆信息 * 消防车辆信息
*
* @param bizOrgCode * @param bizOrgCode
* @return * @return
*/ */
...@@ -268,6 +280,7 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -268,6 +280,7 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
/** /**
* 物联监控页面消防车辆信息 * 物联监控页面消防车辆信息
*
* @param bizOrgCode * @param bizOrgCode
* @return * @return
*/ */
...@@ -275,8 +288,41 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -275,8 +288,41 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
/** /**
* 获取水源信息 * 获取水源信息
*
* @param bizOrgCode * @param bizOrgCode
* @return * @return
*/ */
List<Map<String, Object>> getWaterInfo(@Param("bizOrgCode") String bizOrgCode); List<Map<String, Object>> getWaterInfo(@Param("bizOrgCode") String bizOrgCode, @Param("systemCode") String systemCode);
/**
* 获取系统名称及该系统工作状态
*
* @return
*/
Map<String, Object> getFireSystemInfo(HashMap<String, Object> hashMap);
/**
* 获取系统近一月告警设备top5
*
* @param hashMap
* @return
*/
List<Map<String, Object>> equipAlarmTOP(HashMap<String, Object> hashMap);
/**
* 获取设备id
*
* @param hashMap
* @return
*/
String equipmentId(HashMap<String, Object> hashMap);
/**
* 获取系统设备状态
*
* @param page
* @param id
* @return
*/
Page<Map<String, Object>> equipmentState(Page page, String id);
} }
package com.yeejoin.equipmanage.service; package com.yeejoin.equipmanage.service;
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.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto; import com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto;
import com.yeejoin.amos.feign.morphic.model.ResourceDTO; import com.yeejoin.amos.feign.morphic.model.ResourceDTO;
...@@ -10,6 +11,8 @@ import com.yeejoin.equipmanage.common.entity.dto.EquipTypeAmountPageDTO; ...@@ -10,6 +11,8 @@ import com.yeejoin.equipmanage.common.entity.dto.EquipTypeAmountPageDTO;
import com.yeejoin.equipmanage.common.entity.vo.*; import com.yeejoin.equipmanage.common.entity.vo.*;
import com.yeejoin.equipmanage.common.vo.*; import com.yeejoin.equipmanage.common.vo.*;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -233,5 +236,14 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE ...@@ -233,5 +236,14 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
Object refreshCarTypeAndCount(String bizOrgCode) throws Exception; Object refreshCarTypeAndCount(String bizOrgCode) throws Exception;
Map<String, Object> getSystemName(HashMap<String, Object> hashMap);
Map<String, Object> getSystemStatus(HashMap<String, Object> hashMap);
Map<String, Object> equipAlarmTOP(HashMap<String, Object> hashMap);
List<Map<String, Object>> getSmallWaterInfo(HashMap<String, Object> hashMap);
Page<Map<String, Object>> equipmentState(Page result, HashMap<String, Object> hashMap);
} }
...@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject; ...@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
...@@ -25,6 +26,7 @@ import com.yeejoin.equipmanage.common.entity.*; ...@@ -25,6 +26,7 @@ import com.yeejoin.equipmanage.common.entity.*;
import com.yeejoin.equipmanage.common.entity.dto.EquipTypeAmountPageDTO; import com.yeejoin.equipmanage.common.entity.dto.EquipTypeAmountPageDTO;
import com.yeejoin.equipmanage.common.entity.vo.*; import com.yeejoin.equipmanage.common.entity.vo.*;
import com.yeejoin.equipmanage.common.enums.*; import com.yeejoin.equipmanage.common.enums.*;
import com.yeejoin.equipmanage.common.utils.CommonPageInfoParam;
import com.yeejoin.equipmanage.common.utils.StringUtil; import com.yeejoin.equipmanage.common.utils.StringUtil;
import com.yeejoin.equipmanage.common.vo.*; import com.yeejoin.equipmanage.common.vo.*;
import com.yeejoin.equipmanage.mapper.*; import com.yeejoin.equipmanage.mapper.*;
...@@ -280,7 +282,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -280,7 +282,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
FeignClientResult<AgencyUserModel> result = Privilege.agencyUserClient.queryByUserId(vo.getChargePerson()); FeignClientResult<AgencyUserModel> result = Privilege.agencyUserClient.queryByUserId(vo.getChargePerson());
AgencyUserModel userModel = result == null ? new AgencyUserModel() : result.getResult(); AgencyUserModel userModel = result == null ? new AgencyUserModel() : result.getResult();
if(userModel!=null&&userModel.getRealName()!=null){ if (userModel != null && userModel.getRealName() != null) {
vo.setChargePersonName(userModel.getRealName()); vo.setChargePersonName(userModel.getRealName());
} }
...@@ -400,27 +402,27 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -400,27 +402,27 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
// responses.add(p); // responses.add(p);
// }); // });
// List<PointTreeVo> regionList = responses.stream().filter(r -> "TRUE".equals(r.getIsRegion())).collect(Collectors.toList()); // List<PointTreeVo> regionList = responses.stream().filter(r -> "TRUE".equals(r.getIsRegion())).collect(Collectors.toList());
List<PointTreeVo> buildList = buildingMapper.getBuildList(orgCode,null); List<PointTreeVo> buildList = buildingMapper.getBuildList(orgCode, null);
return transferListToPointTree(buildList, id,null); return transferListToPointTree(buildList, id, null);
} }
@Override @Override
public List<SpeIndexVo> getSpeIndex(Long id,int flag) { public List<SpeIndexVo> getSpeIndex(Long id, int flag) {
// 因此处代码其他地方有调用 增加表示判断 flag == 1 为 消防点位图处需要iot编码所用 // 因此处代码其他地方有调用 增加表示判断 flag == 1 为 消防点位图处需要iot编码所用
if (flag == 1){ if (flag == 1) {
List<SpeIndexVo> speIndexVos = makeStatus(fireFightingSystemMapper.getSpeIndex(id)); List<SpeIndexVo> speIndexVos = makeStatus(fireFightingSystemMapper.getSpeIndex(id));
if (!ValidationUtil.isEmpty(speIndexVos)){ if (!ValidationUtil.isEmpty(speIndexVos)) {
EquipmentSpecific equipmentSpecific = equipmentSpecificSerivce.getBaseMapper().selectById(id); EquipmentSpecific equipmentSpecific = equipmentSpecificSerivce.getBaseMapper().selectById(id);
if (!ValidationUtil.isEmpty(equipmentSpecific)){ if (!ValidationUtil.isEmpty(equipmentSpecific)) {
SpeIndexVo speIndexVo = new SpeIndexVo(); SpeIndexVo speIndexVo = new SpeIndexVo();
speIndexVo.setName("设备编码"); speIndexVo.setName("设备编码");
speIndexVo.setValue(equipmentSpecific.getCode()); speIndexVo.setValue(equipmentSpecific.getCode());
speIndexVos.add(0,speIndexVo); speIndexVos.add(0, speIndexVo);
} }
} }
return speIndexVos; return speIndexVos;
} }
return makeStatus(fireFightingSystemMapper.getSpeIndex(id)); return makeStatus(fireFightingSystemMapper.getSpeIndex(id));
} }
private void insertFiles(FireFightingSystemVo vo) { private void insertFiles(FireFightingSystemVo vo) {
...@@ -495,9 +497,9 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -495,9 +497,9 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
* @param id * @param id
* @return * @return
*/ */
public List<PointTreeVo> transferListToPointTree(List<PointTreeVo> allRiskSource, String id,String instanceId) { public List<PointTreeVo> transferListToPointTree(List<PointTreeVo> allRiskSource, String id, String instanceId) {
//TODO id为空,为消防建筑使用;id不为空,为点位图使用 //TODO id为空,为消防建筑使用;id不为空,为点位图使用
List<PointTreeVo> pointData = fireFightingSystemMapper.getPointData(id,instanceId); List<PointTreeVo> pointData = fireFightingSystemMapper.getPointData(id, instanceId);
if (!CollectionUtils.isEmpty(pointData)) { if (!CollectionUtils.isEmpty(pointData)) {
// 查询所有wl_source_scene,判断是否绑定 // 查询所有wl_source_scene,判断是否绑定
LambdaQueryWrapper<SourceScene> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SourceScene> wrapper = new LambdaQueryWrapper<>();
...@@ -516,7 +518,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -516,7 +518,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
} }
// 优化不查指标 // 优化不查指标
for (PointTreeVo p : pointData) { for (PointTreeVo p : pointData) {
Long buildOrSysId = p.getParentId(); Long buildOrSysId = p.getParentId();
Long equipSpecificId = p.getSequenceNbr(); Long equipSpecificId = p.getSequenceNbr();
Map map = new HashMap(7); Map map = new HashMap(7);
map.put("imgPath", p.getImgPath()); map.put("imgPath", p.getImgPath());
...@@ -582,9 +584,9 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -582,9 +584,9 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
* @param id * @param id
* @return * @return
*/ */
public List<PointTreeVo> transferListToPointTreeNew(List<PointTreeVo> allRiskSource, String id,String instanceId,String displayName) { public List<PointTreeVo> transferListToPointTreeNew(List<PointTreeVo> allRiskSource, String id, String instanceId, String displayName) {
//TODO id为空,为消防建筑使用;id不为空,为点位图使用 //TODO id为空,为消防建筑使用;id不为空,为点位图使用
List<PointTreeVo> pointData = fireFightingSystemMapper.getPointDataNew(id,instanceId,displayName); List<PointTreeVo> pointData = fireFightingSystemMapper.getPointDataNew(id, instanceId, displayName);
if (!CollectionUtils.isEmpty(pointData)) { if (!CollectionUtils.isEmpty(pointData)) {
// 查询所有wl_source_scene,判断是否绑定 // 查询所有wl_source_scene,判断是否绑定
List<SourceScene> sourceSceneList = sourceSceneMapper.selectList(null); List<SourceScene> sourceSceneList = sourceSceneMapper.selectList(null);
...@@ -782,7 +784,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -782,7 +784,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
try { try {
FeignUtil.remoteCall(() -> Morphic.morphicSubjectClient.delete(entity.getSceneId())); FeignUtil.remoteCall(() -> Morphic.morphicSubjectClient.delete(entity.getSceneId()));
} catch (Exception e) { } catch (Exception e) {
log.error("远程调用 MORPHIC 服务的删除操作出错:"+e.getMessage().toString(),e); log.error("远程调用 MORPHIC 服务的删除操作出错:" + e.getMessage().toString(), e);
} }
} }
formInstanceMapper.clearSystemId(id); formInstanceMapper.clearSystemId(id);
...@@ -851,9 +853,10 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -851,9 +853,10 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
}); });
return list; return list;
} }
@Override @Override
public IPage<EquipTypeImgAmountVO> getColaCategoryAmountListIot(int hierarchy, String codeHead, public IPage<EquipTypeImgAmountVO> getColaCategoryAmountListIot(int hierarchy, String codeHead,
EquipTypeAmountPageDTO equipTypeAmountPage) { EquipTypeAmountPageDTO equipTypeAmountPage) {
String type = equipTypeAmountPage.getType(); String type = equipTypeAmountPage.getType();
if (!"".equals(type) && "car".equals(type)) { if (!"".equals(type) && "car".equals(type)) {
equipTypeAmountPage.setSystemId(null); equipTypeAmountPage.setSystemId(null);
...@@ -868,6 +871,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -868,6 +871,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
}); });
return list; return list;
} }
@Override @Override
public IPage<EquipTypeImgAmountVO> getColaCategoryAmountCarList(int hierarchy, String codeHead, public IPage<EquipTypeImgAmountVO> getColaCategoryAmountCarList(int hierarchy, String codeHead,
EquipTypeAmountPageDTO equipTypeAmountPage) { EquipTypeAmountPageDTO equipTypeAmountPage) {
...@@ -1139,8 +1143,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1139,8 +1143,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
// return JSONArray.parseArray( // return JSONArray.parseArray(
// JSONArray.toJSONString(redisUtils.get(equipTypeAndCount + bizOrgCode)), EquipmentCategory.class); // JSONArray.toJSONString(redisUtils.get(equipTypeAndCount + bizOrgCode)), EquipmentCategory.class);
// } else { // } else {
return refreshEquipmentTypeAndCount(bizOrgCode); return refreshEquipmentTypeAndCount(bizOrgCode);
// } // }
} }
@Override @Override
...@@ -1150,8 +1154,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1150,8 +1154,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
return null; return null;
} }
List<EquipmentCategory> equipmentTypeList = responseList.stream() List<EquipmentCategory> equipmentTypeList = responseList.stream()
.filter(i -> !i.getCode().startsWith("2") && "2".equals(i.getIndustryCode())) .filter(i -> !i.getCode().startsWith("2") && "2".equals(i.getIndustryCode()))
.filter(m->!m.getCode().startsWith("9306") && "2".equals(m.getIndustryCode())) .filter(m -> !m.getCode().startsWith("9306") && "2".equals(m.getIndustryCode()))
.collect(Collectors.toList()); .collect(Collectors.toList());
List<EquipmentCategory> list = typeListTree(equipmentTypeList, bizOrgCode, SourceTypeEnum.EQUIPMENT); List<EquipmentCategory> list = typeListTree(equipmentTypeList, bizOrgCode, SourceTypeEnum.EQUIPMENT);
redisUtils.set(equipTypeAndCount + bizOrgCode, list, 86400); redisUtils.set(equipTypeAndCount + bizOrgCode, list, 86400);
...@@ -1263,4 +1267,65 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1263,4 +1267,65 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
} }
return this.baseMapper.selectList(wrapper); return this.baseMapper.selectList(wrapper);
} }
@Override
public Map<String, Object> getSystemStatus(HashMap<String, Object> hashMap) {
Map<String, Object> resultMap = new HashMap<>();
Map<String, Object> map = fireFightingSystemMapper.getFireSystemInfo(hashMap);
if (!map.isEmpty()) {
ArrayList<Object> status = new ArrayList<>();
status.add(map.get("status"));
resultMap.put("values", status);
resultMap.put("labels", status);
}
return resultMap;
}
@Override
public Map<String, Object> getSystemName(HashMap<String, Object> hashMap) {
Map<String, Object> resultMap = new HashMap<>();
Map<String, Object> map = fireFightingSystemMapper.getFireSystemInfo(hashMap);
if (!map.isEmpty()) {
resultMap.put("name", map.get("name"));
}
return resultMap;
}
@Override
public Map<String, Object> equipAlarmTOP(HashMap<String, Object> hashMap) {
Map<String, Object> resultMap = new HashMap<>();
List<Map<String, Object>> list = fireFightingSystemMapper.equipAlarmTOP(hashMap);
if (!CollectionUtils.isEmpty(list)) {
LinkedHashSet<String> yAxis = new LinkedHashSet<>();
ArrayList<String> xAxis = new ArrayList<>();
String yKey = "";
String xResult = "";
for (Map<String, Object> stringObjectMap : list) {
yKey = stringObjectMap.get("equipName").toString();
xResult = stringObjectMap.get("total").toString();
yAxis.add(yKey);
xAxis.add(xResult);
}
resultMap.put("xAxis", xAxis);
resultMap.put("yAxis", yAxis);
}
return resultMap;
}
@Override
public Page<Map<String, Object>> equipmentState(Page res, HashMap<String, Object> hashMap) {
Page result = new Page<>(res.getCurrent(), res.getSize());
String id = fireFightingSystemMapper.equipmentId(hashMap);
Page<Map<String, Object>> mapPage = fireFightingSystemMapper.equipmentState(result, id);
return mapPage;
}
@Override
public List<Map<String, Object>> getSmallWaterInfo(HashMap<String, Object> hashMap) {
String bizOrgCode = hashMap.get("bizOrgCode").toString();
String systemCode = hashMap.get("systemCode").toString();
return fireFightingSystemMapper.getWaterInfo(bizOrgCode, systemCode);
}
} }
...@@ -1051,45 +1051,45 @@ ...@@ -1051,45 +1051,45 @@
GROUP BY GROUP BY
fs.id; fs.id;
</select> </select>
<select id="getFireSystemState" resultType="Map"> <select id="getFireSystemState" resultType="Map">
select * from v_fire_system_state select * from v_fire_system_state
</select> </select>
<select id="getFireOnlSystem" resultType="Map"> <select id="getFireOnlSystem" resultType="Map">
select * from v_fire_onl_num select * from v_fire_onl_num
</select> </select>
<select id="getFireCafsSystem" resultType="Map"> <select id="getFireCafsSystem" resultType="Map">
select * from v_fire_cafs_num select * from v_fire_cafs_num
</select> </select>
<select id="getFireFfsSystem" resultType="Map"> <select id="getFireFfsSystem" resultType="Map">
select * from v_fire_ffs_num select * from v_fire_ffs_num
</select> </select>
<select id="getFireFasSystem" resultType="Map"> <select id="getFireFasSystem" resultType="Map">
select * from v_fire_fas_num select * from v_fire_fas_num
</select> </select>
<select id="getFireAcsSystem" resultType="Map"> <select id="getFireAcsSystem" resultType="Map">
select * from v_fire_acs_num select * from v_fire_acs_num
</select> </select>
<select id="getFireFhsSystem" resultType="Map"> <select id="getFireFhsSystem" resultType="Map">
select * from v_fire_fhs_num select * from v_fire_fhs_num
</select> </select>
<select id="getTodayConfirmAlarmInfo" resultType="Map"> <select id="getTodayConfirmAlarmInfo" resultType="Map">
select * from v_equip_alarm_today_statistics select * from v_equip_alarm_today_statistics
</select> </select>
<select id="getPoolInfo" resultType="Map"> <select id="getPoolInfo" resultType="Map">
select * from v_fire_fhs_yl_num select * from v_fire_fhs_yl_num
</select> </select>
<select id="getFightingSysInfo" resultType="com.yeejoin.equipmanage.common.vo.FireFightingSystemVo"> <select id="getFightingSysInfo" resultType="com.yeejoin.equipmanage.common.vo.FireFightingSystemVo">
select * from v_fire_system_info fs select * from v_fire_system_info fs
<where> <where>
...@@ -1101,7 +1101,7 @@ ...@@ -1101,7 +1101,7 @@
</if> </if>
</where> </where>
</select> </select>
<select id="getFireOnlSystemThreeSmall" resultType="Map"> <select id="getFireOnlSystemThreeSmall" resultType="Map">
select * from v_fire_onl_three_small select * from v_fire_onl_three_small
</select> </select>
...@@ -1804,7 +1804,7 @@ ...@@ -1804,7 +1804,7 @@
where where
si.equipment_index_key = 'ES_Elevator_Shield' si.equipment_index_key = 'ES_Elevator_Shield'
and si.`value` = 'true' and si.`value` = 'true'
) AS `dtpb`, ) AS `dtpb`,
( (
select select
...@@ -2560,6 +2560,7 @@ ...@@ -2560,6 +2560,7 @@
LEFT JOIN wl_equipment_index ei ON ei.equipment_id = ed.equipment_id LEFT JOIN wl_equipment_index ei ON ei.equipment_id = ed.equipment_id
LEFT JOIN wl_equipment e ON e.id = ei.equipment_id LEFT JOIN wl_equipment e ON e.id = ei.equipment_id
LEFT JOIN wl_equipment_category ec ON ec.id = e.category_id LEFT JOIN wl_equipment_category ec ON ec.id = e.category_id
LEFT JOIN f_fire_fighting_system fs ON fs.biz_org_code = r.biz_org_code
WHERE WHERE
r.resource_type IN ( 'pool', 'industryPool' ) r.resource_type IN ( 'pool', 'industryPool' )
AND r.is_delete = 1 AND r.is_delete = 1
...@@ -2567,7 +2568,138 @@ ...@@ -2567,7 +2568,138 @@
<if test="bizOrgCode!=null and bizOrgCode!=''"> <if test="bizOrgCode!=null and bizOrgCode!=''">
AND r.biz_org_code = #{bizOrgCode,jdbcType=VARCHAR} AND r.biz_org_code = #{bizOrgCode,jdbcType=VARCHAR}
</if> </if>
<if test="systemCode!=null and systemCode!=''">
AND fs.code = #{systemCode,jdbcType=VARCHAR}
</if>
GROUP BY GROUP BY
r.sequence_nbr r.sequence_nbr
</select> </select>
<select id="getFireSystemInfo" resultType="java.util.Map">
select `nz`.name,`nz`.status from ( SELECT
`fs`.`id` AS `id`,
`fs`.`code` AS `code`,
`fs`.`biz_org_code` AS `biz_org_code`,
`fs`.`name` AS `name`,
`fs`.`install_date` AS `installdate`,
`fs`.`charge_person_name` AS `chargeperson`,
`fs`.`charge_person_phone` AS `chargepersonphone`,
`mim`.`name` AS `maintenanceunit`,
`mic`.`name` AS `constructionunit`,(
CASE
WHEN ((
SELECT
count( 1 )
FROM
`wl_equipment_specific_alarm`
WHERE
((
`wl_equipment_specific_alarm`.`status` = 1
)
AND (
0 != find_in_set( `fs`.`id`, `wl_equipment_specific_alarm`.`system_ids` )))) > 0
) THEN
'异常' ELSE '正常'
END
) AS `status`
FROM
((
`f_fire_fighting_system` `fs`
LEFT JOIN `wl_manufacturer_info` `mic` ON ((
`mic`.`id` = `fs`.`maintenance_unit`
)))
LEFT JOIN `wl_manufacturer_info` `mim` ON ((
`mim`.`id` = `fs`.`construction_unit`
)))) `nz` where `nz`.code = #{systemCode} and `nz`.biz_org_code = #{bizOrgCode}
</select>
<select id="equipAlarmTOP" resultType="java.util.Map">
SELECT
ifnull( `a`.`fightSysName`, NULL ) AS `fightSysName`,
ifnull( `a`.`fightSysCode`, NULL ) AS `fightSysCode`,
ifnull( `a`.`fightSysId`, NULL ) AS `fightSysId`,
ifnull( `a`.`report_date`, NULL ) AS `reportDate`,
`a`.`equipName` AS `equipName`,
sum( `a`.`total` ) AS `total`
FROM
(
SELECT
`rd`.`index_type` AS `indxKey`,
`rd`.`index_name` AS `index_name`,
`rd`.`equipment_specific_name` AS `equipName`,
count( DISTINCT `rd`.`equipment_specific_id` ) AS `total`,
`rd`.`report_date` AS `report_date`,
`fs`.`name` AS `fightSysName`,
`fs`.`code` AS `fightSysCode`,
`fs`.`id` AS `fightSysId`,
`rd`.`equipment_specific_id` AS `equipId`
FROM
(
`wl_equipment_alarm_report_day` `rd`
LEFT JOIN `f_fire_fighting_system` `fs` ON ((
0 != find_in_set( `fs`.`id`, `rd`.`system_ids` ))))
WHERE
(((
curdate() - INTERVAL 30 DAY
) &lt;= cast( `rd`.`report_date` AS date ))
AND ( `fs`.`code` = #{systemCode} )
AND ( `fs`.`biz_org_code` = #{bizOrgCode} )
AND ((
`rd`.`index_type` LIKE '%Fault'
)
OR ( `rd`.`index_type` LIKE '%FireAlarm' )
OR ( `rd`.`index_type` LIKE '%Shield' ))
AND ( `rd`.`value` = 'true' ))
GROUP BY
`rd`.`equipment_specific_id`,
`rd`.`report_date`
) `a`
GROUP BY
`a`.`equipId`
ORDER BY
`total` DESC
LIMIT 5
</select>
<select id="equipmentId" resultType="String">
select
id
from
f_fire_fighting_system
where
code = #{systemCode} and
biz_org_code = #{bizOrgCode}
</select>
<select id="equipmentState" resultType="java.util.Map">
SELECT
b.equipName,
(CASE WHEN
b.totalNum > 0 THEN
'异常' ELSE '正常' END) `status`,
b.totalNum AS totalNum
FROM
(
SELECT
a.equipName,
count( wesl.id ) AS totalNum
FROM
(
SELECT
wes.`name` AS equipName,
wed.equipment_id AS equipmentId
FROM
wl_equipment_specific wes
LEFT JOIN wl_equipment_detail wed ON wed.id = wes.equipment_detail_id
WHERE
FIND_IN_SET( #{id}, wes.system_id ) > 0
GROUP BY
wed.equipment_id
) a
LEFT JOIN wl_equipment_specific_alarm_log wesl ON wesl.equipment_id = a.equipmentId
GROUP BY
a.equipmentId
) b
</select>
</mapper> </mapper>
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