Commit 0889b12c authored by KeYong's avatar KeYong

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

# Conflicts: # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/EmergencyController.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/EmergencyMapper.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IEmergencyService.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EmergencyServiceImpl.java # amos-boot-system-equip/src/main/resources/mapper/EmergencyMapper.xml
parents a57f56bc 0d88ddc8
...@@ -205,13 +205,25 @@ public class EquipmentSpecificAlarm extends BaseEntity { ...@@ -205,13 +205,25 @@ public class EquipmentSpecificAlarm extends BaseEntity {
/** /**
* 机构/部门名称 * 机构/部门名称
*/ */
@TableField(exist = false) @TableField(value = "biz_org_name")
private String bizOrgName; private String bizOrgName;
/** /**
* 机构编码 * 机构编码
*/ */
@TableField(exist = false) @TableField(value = "biz_org_code")
private String bizOrgCode; private String bizOrgCode;
/**
* 机构code
*/
@TableField(value = "station_code")
private String stationCode;
/**
* 机构名称
*/
@TableField(value = "station_name")
private String stationName;
} }
\ No newline at end of file
package com.yeejoin.equipmanage.common.entity;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.util.Date;
@Data
@Accessors(chain = true)
@TableName("cb_org_usr")
@ApiModel(value="OrgUsr对象", description="部门信息")
public class OrgUsr {
/**
*
*/
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "机构/部门名称")
private String bizOrgName;
@ApiModelProperty(value = "机构编码")
private String bizOrgCode;
@ApiModelProperty(value = "amos中公司/部门ID")
private String amosOrgId;
@ApiModelProperty(value = "amos中公司/部门编码")
private String amosOrgCode;
@ApiModelProperty(value = "机构类型`")
private String bizOrgType;
@ApiModelProperty(value = "所属建筑名称")
private String buildName;
@ApiModelProperty(value = "所属建筑ID")
private String buildId;
@ApiModelProperty(value = "归属机构/部门/人员")
private String parentId;
@ApiModelProperty(value = "扩展属性1")
private String orgExpandAttr1;
@ApiModelProperty(value = "扩展属性2")
private String orgExpandAttr2;
@ApiModelProperty(value = "扩展属性3")
private String orgExpandAttr3;
@ApiModelProperty(value = "扩展属性4")
private String orgExpandAttr4;
private String orgExpandAttr5;
private String orgExpandAttr6;
private String orgExpandAttr7;
private String orgExpandAttr8;
@ApiModelProperty(value = "省市区code,用逗号分隔")
private String pczCode;
@ApiModelProperty(value = "省市区名称,用逗号分隔")
private String pczName;
@ApiModelProperty(value = "唯一编号")
private String code;
@ApiModelProperty(value = "数量")
@TableField(exist = false)
private Long total;
@ApiModelProperty(value = "管理类别")
@TableField(exist = false)
private String managementType;
@TableId(value = "sequence_nbr", type = IdType.ID_WORKER)
protected Long sequenceNbr;
@TableField(value = "rec_date", fill = FieldFill.INSERT_UPDATE)
protected Date recDate;
@TableField(value = "rec_user_id", fill = FieldFill.INSERT_UPDATE)
protected String recUserId;
@TableField(value = "rec_user_name", fill = FieldFill.INSERT_UPDATE)
protected String recUserName;
/**
* 是否删除
*/
@TableField(value = "is_delete")
public Boolean isDelete=false;
@ApiModelProperty(value = "是否可以点击")
@TableField(exist = false)
public Boolean canClick;
}
\ No newline at end of file
package com.yeejoin.equipmanage.common.entity.dto;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.experimental.Accessors;
import java.util.List;
@Data
@AllArgsConstructor
@Accessors(chain = true)
@ApiModel(value="OrgUsrDto", description="树菜单")
public class OrgUsrDto {
private String id;
private String name;
private String parentId;
private List<OrgUsrDto> children;
private String bizOrgCode;
private String code;
public Boolean canClick;
public OrgUsrDto(String id, String name, String parentId, String bizOrgCode, String code, Boolean canClick) {
super();
this.id = id;
this.name = name;
this.parentId = parentId;
this.bizOrgCode = bizOrgCode;
this.code = code;
this.canClick = canClick;
}
public OrgUsrDto() {
}
}
\ No newline at end of file
...@@ -2,12 +2,14 @@ package com.yeejoin.equipmanage.controller; ...@@ -2,12 +2,14 @@ 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.entity.dto.OrgUsrDto;
import com.yeejoin.equipmanage.common.utils.*; import com.yeejoin.equipmanage.common.utils.*;
import com.yeejoin.equipmanage.config.PersonIdentify; import com.yeejoin.equipmanage.config.PersonIdentify;
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.IEquipmentSpecificSerivce; import com.yeejoin.equipmanage.service.IEquipmentSpecificSerivce;
import com.yeejoin.equipmanage.service.IFireFightingSystemService; import com.yeejoin.equipmanage.service.IFireFightingSystemService;
import com.yeejoin.equipmanage.service.IOrgUsrService;
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;
...@@ -48,6 +50,9 @@ public class DCenterController extends AbstractBaseController { ...@@ -48,6 +50,9 @@ public class DCenterController extends AbstractBaseController {
@Autowired @Autowired
IEquipmentSpecificSerivce specificService; IEquipmentSpecificSerivce specificService;
@Autowired
IOrgUsrService iOrgUsrService;
/** /**
* 直流中心告警列表分页,用于直流中心大数据查询分页,不建议再扩展联表查询 * 直流中心告警列表分页,用于直流中心大数据查询分页,不建议再扩展联表查询
*/ */
...@@ -131,4 +136,34 @@ public class DCenterController extends AbstractBaseController { ...@@ -131,4 +136,34 @@ public class DCenterController extends AbstractBaseController {
return CommonResponseUtil.success(fireFightingSystemMapper.getCenterWaterInfo(page, bizOrgCode)); return CommonResponseUtil.success(fireFightingSystemMapper.getCenterWaterInfo(page, bizOrgCode));
} }
/**
* 换流站接入情况总览
*
* @return
*/
@GetMapping(value = "/station/connect/state")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public ResponseModel getStationConnectStatus() {
return CommonResponseUtil.success(fireFightingSystemService.getStationConnectStatus());
}
/**
* 换流站接入状态统计
*
* @return
*/
@GetMapping(value = "/station/status/statistics")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public ResponseModel getStationStatusStatistics() {
return CommonResponseUtil.success(fireFightingSystemService.getStationStatusStatistics());
}
@RequestMapping(value = "/companyTree", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "电力公司树", notes = "电力公司树")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public ResponseModel<List<OrgUsrDto>> companyTreeByUserAndType() {
List<OrgUsrDto> menus = iOrgUsrService.getCompanyTree();
return CommonResponseUtil.success(menus);
}
} }
package com.yeejoin.equipmanage.controller; package com.yeejoin.equipmanage.controller;
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.entity.publics.CommonResponse;
import com.yeejoin.equipmanage.common.utils.CommonResponseUtil; import com.yeejoin.equipmanage.common.utils.CommonResponseUtil;
import com.yeejoin.equipmanage.common.utils.ResponseUtils;
import com.yeejoin.equipmanage.common.vo.UnitAreaTreeVo;
import com.yeejoin.equipmanage.service.IEmergencyService; import com.yeejoin.equipmanage.service.IEmergencyService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.tomcat.util.http.ResponseUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List; import java.util.Map;
/** /**
* *
...@@ -34,6 +33,8 @@ public class EmergencyController extends AbstractBaseController { ...@@ -34,6 +33,8 @@ public class EmergencyController extends AbstractBaseController {
@Autowired @Autowired
IEmergencyService iEmergencyService; IEmergencyService iEmergencyService;
@Autowired
IEmergencyService iEmergencyService;
/** /**
* 通过bizOrgCode过滤 * 通过bizOrgCode过滤
*/ */
...@@ -58,4 +59,86 @@ public class EmergencyController extends AbstractBaseController { ...@@ -58,4 +59,86 @@ public class EmergencyController extends AbstractBaseController {
return CommonResponseUtil.success(iEmergencyService.getCAFSWaterTankInfo(bizOrgCode)); return CommonResponseUtil.success(iEmergencyService.getCAFSWaterTankInfo(bizOrgCode));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("应急物资")
@GetMapping(value = "/emergencyMaterials")
public Map<String, Object> emergencyMaterials(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode ) {
if (ObjectUtils.isEmpty(bizOrgCode)){
ReginParams reginParams = getSelectedOrgInfo();
bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
}
return iEmergencyService.emergencyMaterials(bizOrgCode);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("应急物资-详情")
@GetMapping(value = "/emergencyMaterialsDetails")
public Page<Map<String, Object>> emergencyMaterialsDetails(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode ,
@RequestParam(value = "pageNumber") int pageNumber,
@RequestParam(value = "pageSize") int pageSize) {
Page<Map<String, Object>> page = new Page<>(pageNumber, pageSize);
if (ObjectUtils.isEmpty(bizOrgCode)){
ReginParams reginParams = getSelectedOrgInfo();
bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
}
return iEmergencyService.emergencyMaterialsDetails(page, bizOrgCode);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("消防炮列表")
@GetMapping(value = "/fireMonitor")
public Page<Map<String, Object>> selectFireMonitor(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode,
@RequestParam(value = "pageNumber") int pageNumber,
@RequestParam(value = "pageSize") int pageSize) {
Page<Map<String, Object>> page = new Page<>(pageNumber, pageSize);
if (ObjectUtils.isEmpty(bizOrgCode)){
ReginParams reginParams = getSelectedOrgInfo();
bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
}
return iEmergencyService.selectFireMonitor(page, bizOrgCode);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("泡沫罐列表")
@GetMapping(value = "/selectFoamTank")
public Page<Map<String, Object>> selectFoamTank(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode,
@RequestParam(value = "pageNumber") int pageNumber,
@RequestParam(value = "pageSize") int pageSize
) {
Page<Map<String, Object>> page = new Page<>(pageNumber, pageSize);
if (ObjectUtils.isEmpty(bizOrgCode)){
ReginParams reginParams = getSelectedOrgInfo();
bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
}
return iEmergencyService.selectFoamTank(page, bizOrgCode);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("排油系统列表")
@GetMapping(value = "/selectOilDrainage")
public Page<Map<String, Object>> selectOilDrainage(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode ,
@RequestParam(value = "pageNumber") int pageNumber,
@RequestParam(value = "pageSize") int pageSize) {
Page<Map<String, Object>> page = new Page<>(pageNumber, pageSize);
if (ObjectUtils.isEmpty(bizOrgCode)){
ReginParams reginParams = getSelectedOrgInfo();
bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
}
return iEmergencyService.selectOilDrainage(page, bizOrgCode);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("压力流量")
@GetMapping(value = "/selectPressureFlow")
public Page<Map<String, Object>> selectPressureFlow(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode ,
@RequestParam(value = "pageNumber") int pageNumber,
@RequestParam(value = "pageSize") int pageSize) {
Page<Map<String, Object>> page = new Page<>(pageNumber, pageSize);
if (ObjectUtils.isEmpty(bizOrgCode)){
ReginParams reginParams = getSelectedOrgInfo();
bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
}
return iEmergencyService.selectPressureFlow(page, bizOrgCode);
}
} }
package com.yeejoin.equipmanage.mapper; package com.yeejoin.equipmanage.mapper;
import liquibase.pro.packaged.M;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -10,7 +11,51 @@ import java.util.Map; ...@@ -10,7 +11,51 @@ import java.util.Map;
* Mapper 接口 * Mapper 接口
* *
*/ */
public interface EmergencyMapper { public interface EmergencyMapper extends BaseMapper{
/**
* 应急物资列表
* @param bizOrgCode
* @return
*/
Map<String, Object> selectEmergencyMaterials(@Param("bizOrgCode") String bizOrgCode);
/**
* 应急物资详情
* @param bizOrgCode
* @return
*/
Page<Map<String, Object>> selectEmergencyMaterialsDetails(Page<Map<String, Object>> page, @Param("bizOrgCode") String bizOrgCode);
/**
* 消防炮列表
* @param bizOrgCode
* @return
*/
Page<Map<String, Object>> selectFireMonitor(Page<Map<String, Object>> page, @Param("bizOrgCode") String bizOrgCode);
/**
* 泡沫罐
* @param bizOrgCode
* @return
*/
Page<Map<String, Object>> selectFoamTank(Page<Map<String, Object>> page , @Param("bizOrgCode") String bizOrgCode);
/**
* 排油系统
* @param bizOrgCode
* @return
*/
Page<Map<String, Object>> selectOilDrainage(Page<Map<String, Object>> page , @Param("bizOrgCode") String bizOrgCode);
/**
* 压力流量
* @param page
* @param bizOrgCode
* @return
*/
Page<Map<String, Object>> selectPressureFlow(Page<Map<String, Object>> page , @Param("bizOrgCode") String bizOrgCode);
List<Map<String, Object>> getSystemState(@Param("bizOrgCode") String bizOrgCode); List<Map<String, Object>> getSystemState(@Param("bizOrgCode") String bizOrgCode);
......
...@@ -634,4 +634,8 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -634,4 +634,8 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
Map<String, Object> getWaterlevelUnit(); Map<String, Object> getWaterlevelUnit();
Map<String, Object> getStationConnectStatus();
List<Map<String, Object>> getStationStatusStatistics();
} }
package com.yeejoin.equipmanage.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.equipmanage.common.entity.OrgUsr;
import java.util.List;
public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
List<OrgUsr> getCompanyTree();
}
\ No newline at end of file
package com.yeejoin.equipmanage.service; package com.yeejoin.equipmanage.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -19,4 +21,16 @@ public interface IEmergencyService { ...@@ -19,4 +21,16 @@ public interface IEmergencyService {
* @return * @return
*/ */
List<Map<String, Object>> getCAFSWaterTankInfo(String bizOrgCode); List<Map<String, Object>> getCAFSWaterTankInfo(String bizOrgCode);
Map<String, Object> emergencyMaterials(String bizOrgCode);
Page<Map<String, Object>> emergencyMaterialsDetails(Page<Map<String, Object>> page, String bizOrgCode);
Page<Map<String, Object>> selectFireMonitor(Page<Map<String, Object>> page, String bizOrgCode);
Page<Map<String, Object>> selectFoamTank(Page<Map<String, Object>> page, String bizOrgCode);
Page<Map<String, Object>> selectOilDrainage(Page<Map<String, Object>> page, String bizOrgCode);
Page<Map<String, Object>> selectPressureFlow(Page<Map<String, Object>> page, String bizOrgCode);
} }
...@@ -302,4 +302,8 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE ...@@ -302,4 +302,8 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
Map<String, Object> getSystemDetailByCode(String systemCode); Map<String, Object> getSystemDetailByCode(String systemCode);
Map<String, Object> getStationConnectStatus();
List<Map<String, Object>> getStationStatusStatistics();
} }
package com.yeejoin.equipmanage.service;
import com.yeejoin.equipmanage.common.entity.dto.OrgUsrDto;
import java.util.List;
/**
* 机构/部门/人员表 服务类
*
* @author tb
* @date 2021-06-18
*/
public interface IOrgUsrService {
List<OrgUsrDto> getCompanyTree();
}
package com.yeejoin.equipmanage.service.impl; package com.yeejoin.equipmanage.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.equipmanage.mapper.EmergencyMapper; import com.yeejoin.equipmanage.mapper.EmergencyMapper;
import com.yeejoin.equipmanage.service.IEmergencyService; import com.yeejoin.equipmanage.service.IEmergencyService;
import org.apache.commons.compress.utils.Lists; import org.apache.commons.compress.utils.Lists;
...@@ -32,4 +33,34 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -32,4 +33,34 @@ public class EmergencyServiceImpl implements IEmergencyService {
List<Map<String, Object>> list = emergencyMapper.getCAFSWaterTankInfo(bizOrgCode); List<Map<String, Object>> list = emergencyMapper.getCAFSWaterTankInfo(bizOrgCode);
return Optional.ofNullable(list).orElse(Lists.newArrayList()); return Optional.ofNullable(list).orElse(Lists.newArrayList());
} }
@Override
public Map<String, Object> emergencyMaterials(String bizOrgCode) {
return emergencyMapper.selectEmergencyMaterials(bizOrgCode);
}
@Override
public Page<Map<String, Object>> emergencyMaterialsDetails(Page<Map<String, Object>> page, String bizOrgCode) {
return emergencyMapper.selectEmergencyMaterialsDetails(page , bizOrgCode);
}
@Override
public Page<Map<String, Object>> selectFireMonitor(Page<Map<String, Object>> page, String bizOrgCode) {
return emergencyMapper.selectFireMonitor(page, bizOrgCode);
}
@Override
public Page<Map<String, Object>> selectFoamTank(Page<Map<String, Object>> page, String bizOrgCode) {
return emergencyMapper.selectFoamTank(page, bizOrgCode);
}
@Override
public Page<Map<String, Object>> selectOilDrainage(Page<Map<String, Object>> page, String bizOrgCode) {
return emergencyMapper.selectOilDrainage(page, bizOrgCode);
}
@Override
public Page<Map<String, Object>> selectPressureFlow(Page<Map<String, Object>> page, String bizOrgCode) {
return emergencyMapper.selectPressureFlow(page, bizOrgCode);
}
} }
...@@ -2173,4 +2173,20 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -2173,4 +2173,20 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
}); });
return result; return result;
} }
@Override
public Map<String, Object> getStationConnectStatus() {
Map<String, Object> map = new HashMap<>();
Map<String, Object> resultMap = fireFightingSystemMapper.getStationConnectStatus();
map.put("online", resultMap.get("online"));
map.put("notOnline", resultMap.get("notOnline"));
return map;
}
@Override
public List<Map<String, Object>> getStationStatusStatistics() {
return fireFightingSystemMapper.getStationStatusStatistics();
}
} }
...@@ -899,6 +899,8 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -899,6 +899,8 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
equipmentSpecificAlarm.setEmergencyLevelDescribe(equipmentSpecificIndex.getEmergencyLevelDescribe()); equipmentSpecificAlarm.setEmergencyLevelDescribe(equipmentSpecificIndex.getEmergencyLevelDescribe());
equipmentSpecificAlarm.setBizOrgCode(equipmentSpecificIndex.getBizOrgCode()); equipmentSpecificAlarm.setBizOrgCode(equipmentSpecificIndex.getBizOrgCode());
equipmentSpecificAlarm.setBizOrgName(equipmentSpecificIndex.getBizOrgName()); equipmentSpecificAlarm.setBizOrgName(equipmentSpecificIndex.getBizOrgName());
equipmentSpecificAlarm.setStationCode(stationCode);
equipmentSpecificAlarm.setStationName(stationName);
equipmentSpecificAlarms.add(equipmentSpecificAlarm); equipmentSpecificAlarms.add(equipmentSpecificAlarm);
return equipmentSpecificAlarms; return equipmentSpecificAlarms;
} }
...@@ -1392,7 +1394,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -1392,7 +1394,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
public void updateNodeDateByEquipId(List<EquipmentSpecificIndex> indexList) { public void updateNodeDateByEquipId(List<EquipmentSpecificIndex> indexList) {
if (!ObjectUtils.isEmpty(indexList)) { if (!ObjectUtils.isEmpty(indexList)) {
EquipmentVo equipmentVo = equipmentService.getEquipBySpecific(indexList.get(0).getEquipmentSpecificId()); EquipmentVo equipmentVo = equipmentService.getEquipBySpecific(indexList.get(0).getEquipmentSpecificId());
if (equipmentVo.getIsIot().equals("1")) { if ("1".equals(equipmentVo.getIsIot())) {
List<EquipmentSpecificAlarm> alarmList = equipmentSpecificAlarmService.getEquipListBySpecific(true, List<EquipmentSpecificAlarm> alarmList = equipmentSpecificAlarmService.getEquipListBySpecific(true,
indexList.get(0).getEquipmentSpecificId()); indexList.get(0).getEquipmentSpecificId());
topographyService.updateNodeDateByEquipId(indexList.get(0).getEquipmentSpecificId(), indexList, topographyService.updateNodeDateByEquipId(indexList.get(0).getEquipmentSpecificId(), indexList,
......
package com.yeejoin.equipmanage.service.impl;
import com.yeejoin.equipmanage.common.entity.OrgUsr;
import com.yeejoin.equipmanage.common.entity.dto.OrgUsrDto;
import com.yeejoin.equipmanage.mapper.OrgUsrMapper;
import com.yeejoin.equipmanage.service.IOrgUsrService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.util.*;
import java.util.stream.Collectors;
@Service
public class OrgUsrServiceImpl implements IOrgUsrService {
private final Logger logger = LoggerFactory.getLogger(OrgUsrServiceImpl.class);
@Autowired
OrgUsrMapper orgUsrMapper;
@Override
public List<OrgUsrDto> getCompanyTree(){
List<OrgUsr> list = orgUsrMapper.getCompanyTree();
return buildCompanyTree(list);
}
public static List<OrgUsrDto> buildCompanyTree(List<OrgUsr> list) {
List<OrgUsrDto> menuList = list.stream()
.map(o -> new OrgUsrDto(String.valueOf(o.getSequenceNbr()), o.getBizOrgName(),
ObjectUtils.isEmpty(o.getParentId()) ? "0" : String.valueOf(o.getParentId()),
o.getBizOrgCode(), o.getCode(), o.getCanClick())).collect(Collectors.toList());
List<OrgUsrDto> result = new ArrayList<>();
Map<String, OrgUsrDto> map = new HashMap<>(menuList.size());
menuList.forEach(e -> map.put(e.getId(), e));
Set<? extends Map.Entry<String, ? extends OrgUsrDto>> entries = map.entrySet();
entries.forEach(entry -> {
OrgUsrDto value = entry.getValue();
if (value != null) {
OrgUsrDto treeDto = map.get(value.getParentId());
if (treeDto != null) {
List<OrgUsrDto> children = treeDto.getChildren();
if (children == null) {
children = new ArrayList<>();
treeDto.setChildren(children);
}
children.add(value);
} else {
result.add(value);
}
}
});
return result;
}
}
\ No newline at end of file
...@@ -84,4 +84,313 @@ ...@@ -84,4 +84,313 @@
AND wes.biz_org_code like concat(#{bizOrgCode}, '%') AND wes.biz_org_code like concat(#{bizOrgCode}, '%')
</if> </if>
</select> </select>
<select id="selectEmergencyMaterials" resultType="java.util.Map">
SELECT
( SELECT COUNT( 1 ) FROM `wl_equipment_specific` wel WHERE wel.equipment_code LIKE CONCAT( '3104', '%' )
and wel.biz_org_code like concat(#{bizOrgCode} , '%') ) AS fireExtinguisher,
( SELECT COUNT( 1 ) FROM `wl_equipment_specific` wel WHERE wel.equipment_code LIKE CONCAT( '3105', '%' )
and wel.biz_org_code like concat(#{bizOrgCode} , '%')) AS fireHydrant,
( SELECT COUNT( 1 ) FROM `wl_equipment_specific` wel WHERE wel.equipment_code LIKE CONCAT( '3910', '%' )
and wel.biz_org_code like concat(#{bizOrgCode} , '%')) AS fireShovel,
( SELECT COUNT( 1 ) FROM `wl_equipment_specific` wel WHERE wel.equipment_code LIKE CONCAT( '3904', '%' )
and wel.biz_org_code like concat(#{bizOrgCode} , '%')) AS fireAxe,
( SELECT COUNT( 1 ) FROM `wl_equipment_specific` wel WHERE wel.equipment_code LIKE CONCAT( '3911', '%' )
and wel.biz_org_code like concat(#{bizOrgCode} , '%')) AS fireBucket,
( SELECT COUNT( 1 ) FROM `wl_equipment_specific` wel WHERE wel.equipment_code LIKE CONCAT( '53022', '%' )
and wel.biz_org_code like concat(#{bizOrgCode} , '%')) AS respirator
</select>
<select id="selectEmergencyMaterialsDetails" resultType="java.util.Map">
SELECT
IFNULL(ec.name,'') AS name ,
count( 1 ) AS num,
IFNULL(ws.`name`,'') AS buildingname
FROM
`wl_equipment_specific` wel
LEFT JOIN wl_warehouse_structure ws ON wel.warehouse_structure_id = ws.id
LEFT JOIN wl_equipment_detail wed ON wel.equipment_detail_id = wed.id
LEFT JOIN wl_equipment we ON wed.equipment_Id = we.id
LEFT JOIN wl_equipment_category ec ON we.category_id = ec.id
WHERE
(
wel.equipment_code LIKE CONCAT( '3104', '%' )
OR wel.equipment_code LIKE CONCAT( '3105', '%' )
OR wel.equipment_code LIKE CONCAT( '3910', '%' )
OR wel.equipment_code LIKE CONCAT( '3904', '%' )
OR wel.equipment_code LIKE CONCAT( '3911', '%' )
OR wel.equipment_code LIKE CONCAT( '53022', '%' )
)
AND wel.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' )
GROUP BY
wel.warehouse_structure_id
</select>
<select id="selectFireMonitor" resultType="java.util.Map">
SELECT temp.name, temp.alarm ,
IFNULL((SELECT wesi.value FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = temp.id AND wesi.equipment_index_key = 'CAFS_CAFSFireGun_FireGunPressure'
ORDER BY wesi.update_date desc LIMIT 1),0) AS value,
IFNULL((SELECT wesi.equipment_index_name FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = temp.id AND wesi.is_alarm = 1
ORDER BY wesi.update_date desc LIMIT 1),'--') AS status,
'--' AS flow
FROM(
SELECT wes.id,wes.name ,
CASE
WHEN ( SELECT is_alarm FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key ) = 1
AND wes.realtime_iot_index_value = 'true' THEN
1 ELSE 0
END AS alarm
FROM wl_equipment_specific wes
WHERE
wes.equipment_code LIKE concat( '920322', '%' )
AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' )
) temp
</select>
<select id="selectFoamTank" resultType="java.util.Map">
SELECT
temp.name,
temp.nowLevel,
temp.volume,
CASE
WHEN ( temp.nowLevel = '--' ) THEN
'--'
WHEN ( temp.nowLevel &lt; temp.minLevel ) THEN
'液位低'
WHEN ( temp.nowLevel > temp.maxLevel ) THEN
'液位高' ELSE '正常'
END AS status,
CASE
WHEN ( temp.nowLevel = '--' ) THEN
'--' ELSE format(
IF
(
(
abs( ( ( temp.nowLevel ) / IF ( temp.maxLevel = 0, 1, temp.maxLevel ) ) ) * 100
) > 100,
100,
(
abs( ( ( temp.nowLevel ) / IF ( temp.maxLevel = 0, 1, temp.maxLevel ) ) ) * 100
)
),
2
)
END AS abs
FROM
(
SELECT
wes.id,
wes.name,
IFNULL( ( SELECT value FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND equipment_index_key = 'CAFS_FoamTank_FoamTankLevel' ), '--' ) AS nowLevel,
IFNULL(( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'maxLevel' ) , 0 )AS maxLevel,
IFNULL( ( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'minLevel' ), 0 ) AS minLevel,
IFNULL( ( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'volume' ), 0 ) AS volume
FROM
wl_equipment_specific wes
JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id
WHERE
wes.equipment_code LIKE concat( '920319', '%' )
AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' )
) temp
</select>
<select id="selectOilDrainage" resultType="java.util.Map">
SELECT
wes.id,
wes.name,
IFNULL(
(
SELECT
wesi.equipment_index_name
FROM
wl_equipment_specific_index wesi
WHERE
wesi.equipment_specific_id = wes.id
AND wesi.is_alarm = 1 AND wesi.`value` is not NULL
ORDER BY
wesi.update_date DESC
LIMIT 1
),
'--'
) AS status,
CASE
WHEN ( SELECT is_alarm FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key ) = 1
AND wes.realtime_iot_index_value = 'true' THEN
1 ELSE 0
END AS alarm
FROM
wl_equipment_specific wes
JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id
WHERE
wes.equipment_code LIKE concat( '921003', '%' ) AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' ) UNION
(
SELECT
wes.id,
wes.name,
IFNULL(
(
SELECT
wesi.equipment_index_name
FROM
wl_equipment_specific_index wesi
WHERE
wesi.equipment_specific_id = wes.id
AND wesi.is_alarm = 1 AND wesi.`value` is not NULL
ORDER BY
wesi.update_date DESC
LIMIT 1
),
'--'
) AS status,
CASE
WHEN ( SELECT is_alarm FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key ) = 1
AND wes.realtime_iot_index_value = 'true' THEN
1 ELSE 0
END AS alarm
FROM
wl_equipment_specific wes
JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id
WHERE
wes.equipment_code LIKE concat( '921002', '%' ) AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' )
) UNION
(
SELECT
wes.id,
wes.name,
IFNULL(
(
SELECT
wesi.equipment_index_name
FROM
wl_equipment_specific_index wesi
WHERE
wesi.equipment_specific_id = wes.id
AND wesi.is_alarm = 1 AND wesi.`value` is not NULL
ORDER BY
wesi.update_date DESC
LIMIT 1
),
'--'
) AS status,
CASE
WHEN ( SELECT is_alarm FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key ) = 1
AND wes.realtime_iot_index_value = 'true' THEN
1 ELSE 0
END AS alarm
FROM
wl_equipment_specific wes
JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id
WHERE
wes.equipment_code LIKE concat( '921004', '%' )AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' )
) UNION
(
SELECT
wes.id,
wes.name,
IFNULL(
(
SELECT
wesi.equipment_index_name
FROM
wl_equipment_specific_index wesi
WHERE
wesi.equipment_specific_id = wes.id
AND wesi.is_alarm = 1 AND wesi.`value` is not NULL
ORDER BY
wesi.update_date DESC
LIMIT 1
),
'--'
) AS status,
CASE
WHEN ( SELECT is_alarm FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key ) = 1
AND wes.realtime_iot_index_value = 'true' THEN
1 ELSE 0
END AS alarm
FROM
wl_equipment_specific wes
JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id
WHERE
wes.equipment_code LIKE concat( '921005', '%' )AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' )
)
</select>
<select id="selectPressureFlow" resultType="java.util.Map">
SELECT
temp.id,
temp.name,
temp.nowPressure,
temp.area,
CASE
WHEN temp.nowPressure = '--' THEN
'--'
WHEN temp.nowPressure > temp.maxPressure THEN
'压力高'
WHEN temp.nowPressure &lt; temp.minPressure THEN
'压力低' ELSE '正常'
END AS status,
1 AS type
FROM
(
SELECT
wes.id,
wes.name,
concat_ws( '-', ws.full_name, ed.area ) area,
IFNULL( ( SELECT VALUE FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND equipment_index_key = 'FHS_PipePressureDetector_PipePressure' ), '--' ) AS nowPressure,
IFNULL( ( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'maxPressure' ), 0 ) AS maxPressure,
IFNULL( ( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'minPressure' ), 0 ) AS minPressure
FROM
wl_equipment_specific wes
LEFT JOIN wl_equipment_detail ed ON wes.equipment_detail_id = ed.id
LEFT JOIN wl_warehouse_structure ws ON ws.id = wes.warehouse_structure_id
LEFT JOIN wl_equipment_specific_index ei ON wes.id = ei.equipment_specific_id
LEFT JOIN wl_form_instance_equip fi ON fi.instance_id = wes.id
WHERE
wes.equipment_code LIKE concat( '92011000', '%' ) AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' )
) temp
UNION
SELECT
temp.id,
temp.name,
temp.nowFlow,
temp.area,
CASE
WHEN temp.nowFlow = '--' THEN
'--'
WHEN temp.nowFlow > temp.maxFlow THEN
'流量高'
WHEN temp.nowFlow &lt; temp.minFlow THEN
'流量低' ELSE '正常'
END AS status,
2 AS type
FROM
(
SELECT
wes.id,
wes.NAME,
concat_ws( '-', ws.full_name, ed.area ) area,
IFNULL( ( SELECT VALUE FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND equipment_index_key = 'FHS_FirePoolDevice_WaterFlow' ), '--' ) AS nowFlow,
IFNULL( ( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'maxFlow' ), 0 ) AS maxFlow,
IFNULL( ( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'minFlow' ), 0 ) AS minFlow
FROM
wl_equipment_specific wes
LEFT JOIN wl_equipment_detail ed ON wes.equipment_detail_id = ed.id
LEFT JOIN wl_warehouse_structure ws ON ws.id = wes.warehouse_structure_id
LEFT JOIN wl_equipment_specific_index ei ON wes.id = ei.equipment_specific_id
LEFT JOIN wl_form_instance_equip fi ON fi.instance_id = wes.id
WHERE
wes.equipment_code LIKE concat( '92010700', '%' ) AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' )
) temp
</select>
</mapper> </mapper>
...@@ -284,9 +284,10 @@ ...@@ -284,9 +284,10 @@
wlesal.equipment_specific_name as equipmentSpecificName, wlesal.equipment_specific_name as equipmentSpecificName,
wlesal.location, wlesal.location,
wlesal.station_code AS stationCode, wlesal.station_code AS stationCode,
wlesal.station_name AS stationName wlesal.biz_org_name AS stationName
FROM wl_equipment_specific_alarm_log wlesal FROM wl_equipment_specific_alarm_log wlesal
<where> <where>
wlesal.clean_time IS NULL
<if test="param.alarmType == 'BREAKDOWN'">AND wlesal.type = #{param.alarmType}</if> <if test="param.alarmType == 'BREAKDOWN'">AND wlesal.type = #{param.alarmType}</if>
<if test="param.alarmType == 'FIREALARM'">AND wlesal.type = #{param.alarmType}</if> <if test="param.alarmType == 'FIREALARM'">AND wlesal.type = #{param.alarmType}</if>
<if test="param.isFireAlarm == 'false'">AND wlesal.type != 'FIREALARM'</if> <if test="param.isFireAlarm == 'false'">AND wlesal.type != 'FIREALARM'</if>
......
...@@ -5440,4 +5440,53 @@ ...@@ -5440,4 +5440,53 @@
<select id="getWaterlevelUnit" resultType="java.util.Map"> <select id="getWaterlevelUnit" resultType="java.util.Map">
SELECT unit FROM `wl_equipment_index` WHERE name_key = 'FHS_FirePoolDevice_WaterLevel' SELECT unit FROM `wl_equipment_index` WHERE name_key = 'FHS_FirePoolDevice_WaterLevel'
</select> </select>
<select id="getStationConnectStatus" resultType="java.util.Map">
SELECT
SUM(a.`online`) AS `online`,
SUM(a.`notOnline`) AS `notOnline`
FROM
(
SELECT
IF(si.`online` = 1, 1, 0) 'online',
IF(si.`online` !=1, 1, 0) 'notOnline'
FROM
idx_biz_station_info si
GROUP BY
si.`code`
) a
</select>
<select id="getStationStatusStatistics" resultType="java.util.Map">
SELECT
s.`code`,
s.`name`,
IF
( s.total > 0, 1, 0 ) AS `status`
FROM
(
SELECT
si.id,
si.`code`,
si.`name`,
SUM(
IF
(
( wesa.`status` = 1 AND wesa.equipment_specific_index_value = 'true' ),
1,
0
)
) AS total
FROM
idx_biz_station_info si
LEFT JOIN wl_equipment_specific_alarm wesa ON si.`code` = wesa.station_code
WHERE
si.ONLINE = 1
GROUP BY
si.id
) s
GROUP BY
s.id
</select>
</mapper> </mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.equipmanage.mapper.OrgUsrMapper">
<select id="getCompanyTree" resultType="com.yeejoin.equipmanage.common.entity.OrgUsr">
SELECT
usr.sequence_nbr,
usr.biz_org_name,
usr.biz_org_code,
usr.parent_id,
usr.`code`,
CASE
WHEN ibsi.`code` = usr.`code` THEN
1 ELSE 0
END AS canClick
FROM
cb_org_usr usr
LEFT JOIN idx_biz_station_info ibsi ON ibsi.`code` = usr.`code`
WHERE
usr.biz_org_type = 'COMPANY'
AND usr.is_delete = 0
</select>
</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