金瑞铭需求修改

breach-zhy
zhouhy 5 months ago
parent ecdc356fd2
commit fdd2532ced

@ -0,0 +1,31 @@
package com.ruoyi.common.core.web.page;
import java.util.Map;
/**
* @ClassName : TableDataNameVo
* @Description :
* @Author :
* @Date: 2024-06-17 10:41
*/
public class TableDataNameVo {
private TableDataInfo tableDataInfo;
private Map<String, Object> mapName;
public TableDataInfo getTableDataInfo() {
return tableDataInfo;
}
public void setTableDataInfo(TableDataInfo tableDataInfo) {
this.tableDataInfo = tableDataInfo;
}
public Map<String, Object> getMapName() {
return mapName;
}
public void setMapName(Map<String, Object> mapName) {
this.mapName = mapName;
}
}

@ -16,6 +16,24 @@
</description>
<dependencies>
<!-- 文件上传 -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>4.5.7</version>
</dependency>
<!-- JSON -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.41</version>
</dependency>
<!-- POI -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.16</version>
</dependency>
<!-- SpringCloud Alibaba Nacos -->
<dependency>

@ -1,23 +1,36 @@
package com.ruoyi.business.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.parser.Feature;
import com.ruoyi.business.domain.*;
import com.ruoyi.business.domain.VO.*;
import com.ruoyi.business.service.*;
import com.ruoyi.business.utils.ExcelUtils;
import com.ruoyi.common.core.constant.HwDictConstants;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.common.core.web.page.TableDataNameVo;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.common.security.utils.SecurityUtils;
import com.ruoyi.tdengine.api.domain.TdReturnDataVo;
import io.micrometer.core.instrument.util.StringEscapeUtils;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.data.redis.RedisProperties;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import java.util.*;
import java.util.stream.Collectors;
@RestController
@RequestMapping("/monitorPlatform")
@ -299,4 +312,181 @@ public class HwMonitorPlatformController extends BaseController {
return success(hwScenes);
}
/**
*
* */
@GetMapping("/selectDeviceLatitudeAndLongitude/{sceneId}")
public AjaxResult selectDeviceLatitudeAndLongitude(@PathVariable("sceneId") Long sceneId){
List<BeaconDevice> beaconDevices = hwDeviceService.selectDeviceLatitudeAndLongitude(sceneId);
return success(beaconDevices);
}
/**
* id
* */
@GetMapping("/selectBeaconDevicesHistory")
public TableDataInfo selectBeaconDevicesHistory(@RequestParam(required = false) Map map){
// List<BeaconDevice> beaconDevices = hwDeviceService.selectBeaconDevicesHistory(map);
List<Map<String, Object>> lists = hwDeviceService.selectBeaconDevicesHistory(map);
long total = Long.valueOf(lists.get(lists.size() - 1).get("total").toString());
lists.remove(lists.size() - 1);
TableDataInfo dataTable = getDataTable(lists);
dataTable.setTotal(total);
return dataTable;
}
/**
* id
* */
@GetMapping("/selectMonitorUnit/{deviceId}")
public AjaxResult selectMonitorUnit(@PathVariable("deviceId") Long deviceId){
HwMonitorUnit hwMonitorUnit = hwDeviceService.selectMonitorUnit(deviceId);
return success(hwMonitorUnit);
}
/**
* id
* */
@GetMapping("/selectMonitorElectronic/{deviceId}")
public AjaxResult selectMonitorElectronic(@PathVariable("deviceId") Long deviceId){
return success(hwDeviceService.selectMonitorElectronic(deviceId));
}
/**
*
* */
@GetMapping("/selectHistoryAndTrendAnalysis")
public TableDataNameVo selectHistoryDevice(@RequestParam(required = false) Map map){
List<Map<String, Object>> list = hwDeviceService.selectHistoryDevice(map);
TableDataInfo dataTable = getDataTable(list);
TableDataNameVo tableDataNameVo = new TableDataNameVo();
if (list.size()>1){
long total = Long.valueOf(list.get(list.size() - 1).get("total").toString());
Map<String, Object> mapName = new HashMap<>();
list.remove(list.size() - 1);
if (list.size()>0){
mapName = list.get(list.size() - 1);
list.remove(list.size() - 1);
}
Map<String, Object> mapTotal = new HashMap<String, Object>();
dataTable = getDataTable(list);
dataTable.setTotal(total);
tableDataNameVo.setTableDataInfo(dataTable);
tableDataNameVo.setMapName(mapName);
return tableDataNameVo;
}
else {
map.remove("startTime");
map.remove("endTime");
List<Map<String, Object>> listNull = hwDeviceService.selectHistoryDevice(map);
Map<String, Object> map1 = new HashMap<String, Object>();
if (listNull.size()>1){
map1 = listNull.get(listNull.size() - 2);
}
dataTable.setTotal(0);
list.get(0).remove("total");
tableDataNameVo.setMapName(map1);
tableDataNameVo.setTableDataInfo(dataTable);
return tableDataNameVo;
}
}
/**
*
* */
@GetMapping("/selectComparison")
public AjaxResult selectComparison(){
List<TreeDeviceVo> list = hwDeviceService.selectComparison();
return success(list);
}
/**
*
* */
@PostMapping("/export")
public void export(HttpServletResponse response,@RequestParam Map map)
{
List<Map<String, Object>> list = hwDeviceService.getExportDevice(map);
List<DeviceExport> exportList = new ArrayList<>();
for (int i = 0; i < list.size(); i++){
DeviceExport deviceExport = new DeviceExport();
if (list.get(i).containsKey("deviceId")){
deviceExport.setDeviceId(Long.valueOf(list.get(i).get("deviceId").toString()));
}
if (list.get(i).containsKey("value1")){
deviceExport.setValue1(list.get(i).get("value1").toString());
}
if (list.get(i).containsKey("voltage")){
deviceExport.setVoltage(list.get(i).get("voltage").toString());
}
if (list.get(i).containsKey("longitude")){
deviceExport.setLongitude(list.get(i).get("longitude").toString());
}
if (list.get(i).containsKey("latitude")){
deviceExport.setLatitude(list.get(i).get("latitude").toString());
}
if (list.get(i).containsKey("ts")){
deviceExport.setTs(list.get(i).get("ts").toString());
}
exportList.add(deviceExport);
}
ExcelUtil<DeviceExport> util = new ExcelUtil<DeviceExport>(DeviceExport.class);
System.out.println(exportList.size());
util.exportExcel(response,exportList,"历史数据导出");
}
/**
*
* */
@GetMapping("/getDeviceByAreaId/{tenantId}")
public AjaxResult getDeviceByAreaId(@PathVariable("tenantId") Long tenantId){
List<HwMonitorUnit> deviceList = hwDeviceService.getDeviceByAreaId(tenantId);
return success(deviceList);
}
/**
*
* */
@PostMapping("/AlarmInfosExport")
@RequiresPermissions("business:monitor:alarm")
public void AlarmInfosExport(HttpServletResponse response) {
List<AlarmInfoExportVo> alarmInfoExportVos = hwAlarmInfoService.selectAlarmInfoExport();
ExcelUtil<AlarmInfoExportVo> util = new ExcelUtil<AlarmInfoExportVo>(AlarmInfoExportVo.class);
util.exportExcel(response,alarmInfoExportVos,"报警数据导出");
}
/**
* excelexcel
* */
@PostMapping("/import")
public JSONArray importUser(@RequestPart("file")MultipartFile file,Long tenantId) throws Exception {
JSONArray array = ExcelUtils.readMultipartFile(file);
// System.out.println("导入数据为:" + array);
hwDeviceService.insertRedis(array,tenantId);
return array;
}
/**
* idexcel
* */
@GetMapping("/getRedisFile/{tenantId}")
public JSONObject getRedisFile(@PathVariable("tenantId") Long tenantId)
{
JSONObject o = hwDeviceService.selectRedisFile(tenantId);
if (!o.equals(null)&&!o.equals("")){
return o;
}
else{
return null;
}
}
/**
*
* */
@PostMapping("/selectDeviceByName")
public AjaxResult selectDeviceByName(@RequestBody Map map){
List<HwDevice> deviceList = hwDeviceService.selectMonitorUnitAndDeviceByName(map);
return success(deviceList);
}
}

@ -0,0 +1,103 @@
package com.ruoyi.business.domain;
/**
* @ClassName : BeaconDevice
* @Description :
* @Author :
* @Date: 2024-06-06 15:31
*/
public class BeaconDevice {
private Long deviceId;
private String deviceName;
private Double latitude;
private Double longitude;
private String remark;
private String deviceLocation;
private Long deviceModeId;
private String deviceStatus;
public String getDeviceStatus() {
return deviceStatus;
}
public void setDeviceStatus(String deviceStatus) {
this.deviceStatus = deviceStatus;
}
public Long getDeviceModeId() {
return deviceModeId;
}
public void setDeviceModeId(Long deviceModeId) {
this.deviceModeId = deviceModeId;
}
public String getDeviceLocation() {
return deviceLocation;
}
public void setDeviceLocation(String deviceLocation) {
this.deviceLocation = deviceLocation;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public Long getDeviceId() {
return deviceId;
}
public void setDeviceId(Long deviceId) {
this.deviceId = deviceId;
}
public String getDeviceName() {
return deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public Double getLatitude() {
return latitude;
}
public void setLatitude(Double latitude) {
this.latitude = latitude;
}
public Double getLongitude() {
return longitude;
}
public void setLongitude(Double longitude) {
this.longitude = longitude;
}
@Override
public String toString() {
return "BeaconDevice{" +
"deviceId=" + deviceId +
", deviceName='" + deviceName + '\'' +
", latitude=" + latitude +
", longitude=" + longitude +
", remark='" + remark + '\'' +
", deviceLocation='" + deviceLocation + '\'' +
", deviceModeId=" + deviceModeId +
", deviceStatus='" + deviceStatus + '\'' +
'}';
}
}

@ -124,6 +124,18 @@ public class HwAlarmInfo extends BaseEntity {
private String monitorUnitName;
private String alarmLevelName;
private String alarmTypeName;
/**
*
* */
private String ifDisposalAll;
public String getIfDisposalAll() {
return ifDisposalAll;
}
public void setIfDisposalAll(String ifDisposalAll) {
this.ifDisposalAll = ifDisposalAll;
}
public void setAlarmInfoId(Long alarmInfoId) {
this.alarmInfoId = alarmInfoId;

@ -170,6 +170,25 @@ public class HwDevice extends BaseEntity {
// @Excel(name = "在线状态", readConverterExp = "1=在线,0离线")
private String onlineStatus;
/**
*
* */
private Double longitude;
/**
*
* */
private Double latitude;
private String functionName;
public String getFunctionName() {
return functionName;
}
public void setFunctionName(String functionName) {
this.functionName = functionName;
}
private String monitorUnitName;
private String sceneName;
@ -180,6 +199,43 @@ public class HwDevice extends BaseEntity {
private Long offlineRuleId;
private String publicTime;
//是否报警
private String ifAlarm;
public String getIfAlarm() {
return ifAlarm;
}
public void setIfAlarm(String ifAlarm) {
this.ifAlarm = ifAlarm;
}
public Double getLongitude() {
return longitude;
}
public void setLongitude(Double longitude) {
this.longitude = longitude;
}
public Double getLatitude() {
return latitude;
}
public void setLatitude(Double latitude) {
this.latitude = latitude;
}
public String getPublicTime() {
return publicTime;
}
public void setPublicTime(String publicTime) {
this.publicTime = publicTime;
}
public void setDeviceId(Long deviceId) {
this.deviceId = deviceId;
}

@ -8,7 +8,7 @@ import com.ruoyi.common.core.web.domain.BaseEntity;
/**
* hw_electronic_fence
*
*
* @author xins
* @date 2023-09-19
*/
@ -76,121 +76,131 @@ public class HwElectronicFence extends BaseEntity
private String circleAreaListStr;
private String alarmInfoFlag;//是否有报警信息关联标识
//电子围栏区域信息
private List<HwFenceArea> hwFenceAreaList;
public void setElectronicFenceId(Long electronicFenceId)
public List<HwFenceArea> getHwFenceAreaList() {
return hwFenceAreaList;
}
public void setHwFenceAreaList(List<HwFenceArea> hwFenceAreaList) {
this.hwFenceAreaList = hwFenceAreaList;
}
public void setElectronicFenceId(Long electronicFenceId)
{
this.electronicFenceId = electronicFenceId;
}
public Long getElectronicFenceId()
public Long getElectronicFenceId()
{
return electronicFenceId;
}
public void setElectronicFenceName(String electronicFenceName)
public void setElectronicFenceName(String electronicFenceName)
{
this.electronicFenceName = electronicFenceName;
}
public String getElectronicFenceName()
public String getElectronicFenceName()
{
return electronicFenceName;
}
public void setTenantId(Long tenantId)
public void setTenantId(Long tenantId)
{
this.tenantId = tenantId;
}
public Long getTenantId()
public Long getTenantId()
{
return tenantId;
}
public void setSceneId(Long sceneId)
public void setSceneId(Long sceneId)
{
this.sceneId = sceneId;
}
public Long getSceneId()
public Long getSceneId()
{
return sceneId;
}
public void setFenceType(String fenceType)
public void setFenceType(String fenceType)
{
this.fenceType = fenceType;
}
public String getFenceType()
public String getFenceType()
{
return fenceType;
}
public void setEffectiveTimeFlag(String effectiveTimeFlag)
public void setEffectiveTimeFlag(String effectiveTimeFlag)
{
this.effectiveTimeFlag = effectiveTimeFlag;
}
public String getEffectiveTimeFlag()
public String getEffectiveTimeFlag()
{
return effectiveTimeFlag;
}
public void setTimeZone(String timeZone)
public void setTimeZone(String timeZone)
{
this.timeZone = timeZone;
}
public String getTimeZone()
public String getTimeZone()
{
return timeZone;
}
public void setEffectiveTime(String effectiveTime)
public void setEffectiveTime(String effectiveTime)
{
this.effectiveTime = effectiveTime;
}
public String getEffectiveTime()
public String getEffectiveTime()
{
return effectiveTime;
}
public void setTriggerStatus(String triggerStatus)
public void setTriggerStatus(String triggerStatus)
{
this.triggerStatus = triggerStatus;
}
public String getTriggerStatus()
public String getTriggerStatus()
{
return triggerStatus;
}
public void setFencePushFlag(String fencePushFlag)
public void setFencePushFlag(String fencePushFlag)
{
this.fencePushFlag = fencePushFlag;
}
public String getFencePushFlag()
public String getFencePushFlag()
{
return fencePushFlag;
}
public void setFencePushContent(String fencePushContent)
public void setFencePushContent(String fencePushContent)
{
this.fencePushContent = fencePushContent;
}
public String getFencePushContent()
public String getFencePushContent()
{
return fencePushContent;
}
public void setFenceRecoverContent(String fenceRecoverContent)
public void setFenceRecoverContent(String fenceRecoverContent)
{
this.fenceRecoverContent = fenceRecoverContent;
}
public String getFenceRecoverContent()
public String getFenceRecoverContent()
{
return fenceRecoverContent;
}
public void setFenceField(String fenceField)
public void setFenceField(String fenceField)
{
this.fenceField = fenceField;
}
public String getFenceField()
public String getFenceField()
{
return fenceField;
}

@ -70,6 +70,16 @@ public class HwMonitorUnit extends BaseEntity
private String tenantName;
private boolean normalFlag;//是否正常(如果有报警未处理的则为异常)
private List<HwDevice> devicesList;
public List<HwDevice> getDevicesList() {
return devicesList;
}
public void setDevicesList(List<HwDevice> devicesList) {
this.devicesList = devicesList;
}
private List<HwMonitorUnit> child = new ArrayList<HwMonitorUnit>();
/** 子部门 */
@ -253,4 +263,4 @@ public class HwMonitorUnit extends BaseEntity
.append("monitorUnitField", getMonitorUnitField())
.toString();
}
}
}

@ -1,6 +1,8 @@
package com.ruoyi.business.domain;
import java.math.BigDecimal;
import java.util.List;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
@ -10,7 +12,7 @@ import javax.validation.constraints.NotNull;
/**
* hw_scene
*
*
* @author xins
* @date 2023-08-23
*/
@ -83,138 +85,148 @@ public class HwScene extends BaseEntity
private String selectedDisable;
public void setSceneId(Long sceneId)
private List<HwMonitorUnit> unitList;
public List<HwMonitorUnit> getUnitList() {
return unitList;
}
public void setUnitList(List<HwMonitorUnit> unitList) {
this.unitList = unitList;
}
public void setSceneId(Long sceneId)
{
this.sceneId = sceneId;
}
public Long getSceneId()
public Long getSceneId()
{
return sceneId;
}
public void setSceneName(String sceneName)
public void setSceneName(String sceneName)
{
this.sceneName = sceneName;
}
public String getSceneName()
public String getSceneName()
{
return sceneName;
}
public void setTenantId(Long tenantId)
public void setTenantId(Long tenantId)
{
this.tenantId = tenantId;
}
public Long getTenantId()
public Long getTenantId()
{
return tenantId;
}
public void setSceneModeId(Long sceneModeId)
public void setSceneModeId(Long sceneModeId)
{
this.sceneModeId = sceneModeId;
}
public Long getSceneModeId()
public Long getSceneModeId()
{
return sceneModeId;
}
public void setScenePic(String scenePic)
public void setScenePic(String scenePic)
{
this.scenePic = scenePic;
}
public String getScenePic()
public String getScenePic()
{
return scenePic;
}
public void setDefaultFlag(String defaultFlag)
public void setDefaultFlag(String defaultFlag)
{
this.defaultFlag = defaultFlag;
}
public String getDefaultFlag()
public String getDefaultFlag()
{
return defaultFlag;
}
public void setSceneStatus(String sceneStatus)
public void setSceneStatus(String sceneStatus)
{
this.sceneStatus = sceneStatus;
}
public String getSceneStatus()
public String getSceneStatus()
{
return sceneStatus;
}
public void setAuthMode(String authMode)
public void setAuthMode(String authMode)
{
this.authMode = authMode;
}
public String getAuthMode()
public String getAuthMode()
{
return authMode;
}
public void setModeAccount(String modeAccount)
public void setModeAccount(String modeAccount)
{
this.modeAccount = modeAccount;
}
public String getModeAccount()
public String getModeAccount()
{
return modeAccount;
}
public void setModeKey(String modeKey)
public void setModeKey(String modeKey)
{
this.modeKey = modeKey;
}
public String getModeKey()
public String getModeKey()
{
return modeKey;
}
public void setModeSecret(String modeSecret)
public void setModeSecret(String modeSecret)
{
this.modeSecret = modeSecret;
}
public String getModeSecret()
public String getModeSecret()
{
return modeSecret;
}
public void setPreserveTime(BigDecimal preserveTime)
public void setPreserveTime(BigDecimal preserveTime)
{
this.preserveTime = preserveTime;
}
public BigDecimal getPreserveTime()
public BigDecimal getPreserveTime()
{
return preserveTime;
}
public void setTestPreserveTime(BigDecimal testPreserveTime)
public void setTestPreserveTime(BigDecimal testPreserveTime)
{
this.testPreserveTime = testPreserveTime;
}
public BigDecimal getTestPreserveTime()
public BigDecimal getTestPreserveTime()
{
return testPreserveTime;
}
public void setSceneEnvironment(String sceneEnvironment)
public void setSceneEnvironment(String sceneEnvironment)
{
this.sceneEnvironment = sceneEnvironment;
}
public String getSceneEnvironment()
public String getSceneEnvironment()
{
return sceneEnvironment;
}
public void setSceneField(String sceneField)
public void setSceneField(String sceneField)
{
this.sceneField = sceneField;
}
public String getSceneField()
public String getSceneField()
{
return sceneField;
}

@ -104,6 +104,18 @@ public class HwTenant extends BaseEntity {
// @Excel(name = "预留字段")
private String tenantField;
/**
*
*/
private String tenantMapCode;
public String getTenantMapCode() {
return tenantMapCode;
}
public void setTenantMapCode(String tenantMapCode) {
this.tenantMapCode = tenantMapCode;
}
public void setTenantId(Long tenantId) {
this.tenantId = tenantId;

@ -0,0 +1,90 @@
package com.ruoyi.business.domain.VO;
import com.ruoyi.common.core.annotation.Excel;
import javax.validation.constraints.Email;
/**
* @ClassName : AlarmInfoExportVo
* @Description :
* @Author :
* @Date: 2024-06-14 09:52
*/
public class AlarmInfoExportVo {
@Excel(name = "报警id")
private Long alarmInfoId;
@Excel(name = "报警区域")
private String areaName;
@Excel(name = "计量箱名称")
private String monitorUnitName;
@Excel(name = "报警级别名称")
private String alarmLevelName;
@Excel(name = "报警类型名称")
private String alarmTypeName;
@Excel(name = "报警时间")
private String alarmTime;
public Long getAlarmInfoId() {
return alarmInfoId;
}
public void setAlarmInfoId(Long alarmInfoId) {
this.alarmInfoId = alarmInfoId;
}
public String getAreaName() {
return areaName;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
public String getMonitorUnitName() {
return monitorUnitName;
}
public void setMonitorUnitName(String monitorUnitName) {
this.monitorUnitName = monitorUnitName;
}
public String getAlarmLevelName() {
return alarmLevelName;
}
public void setAlarmLevelName(String alarmLevelName) {
this.alarmLevelName = alarmLevelName;
}
public String getAlarmTypeName() {
return alarmTypeName;
}
public void setAlarmTypeName(String alarmTypeName) {
this.alarmTypeName = alarmTypeName;
}
public String getAlarmTime() {
return alarmTime;
}
public void setAlarmTime(String alarmTime) {
this.alarmTime = alarmTime;
}
@Override
public String toString() {
return "AlarmInfoExportVo{" +
"alarmInfoId=" + alarmInfoId +
", monitorUnitName='" + monitorUnitName + '\'' +
", alarmLevelName='" + alarmLevelName + '\'' +
", alarmTypeName='" + alarmTypeName + '\'' +
", alarmTime='" + alarmTime + '\'' +
'}';
}
}

@ -9,6 +9,7 @@ import java.util.List;
* @Date: 2023-09-04 09:00
*/
public class AllNumsVo {
private Integer beaconDeviceSum;
private String sceneId;
private Integer subSum;
private Integer sum;
@ -37,6 +38,14 @@ public class AllNumsVo {
this.sum = sum;
}
public Integer getBeaconDeviceSum() {
return beaconDeviceSum;
}
public void setBeaconDeviceSum(Integer beaconDeviceSum) {
this.beaconDeviceSum = beaconDeviceSum;
}
@Override
public String toString() {
return "AllNumsVo{" +

@ -0,0 +1,85 @@
package com.ruoyi.business.domain.VO;
import com.ruoyi.common.core.annotation.Excel;
import org.springframework.web.bind.annotation.ExceptionHandler;
/**
* @ClassName : DeviceExport
* @Description :
* @Author :
* @Date: 2024-06-12 13:26
*/
public class DeviceExport {
@Excel(name = "设备ID")
private Long deviceId;
@Excel(name = "温度")
private String value1;
@Excel(name = "电压")
private String voltage;
@Excel(name = "经度")
private String longitude;
@Excel(name = "纬度")
private String latitude;
@Excel(name = "记录时间")
private String ts;
public Long getDeviceId() {
return deviceId;
}
public void setDeviceId(Long deviceId) {
this.deviceId = deviceId;
}
public String getValue1() {
return value1;
}
public void setValue1(String value1) {
this.value1 = value1;
}
public String getVoltage() {
return voltage;
}
public void setVoltage(String voltage) {
this.voltage = voltage;
}
public String getLongitude() {
return longitude;
}
public void setLongitude(String longitude) {
this.longitude = longitude;
}
public String getLatitude() {
return latitude;
}
public void setLatitude(String latitude) {
this.latitude = latitude;
}
public String getTs() {
return ts;
}
public void setTs(String ts) {
this.ts = ts;
}
@Override
public String toString() {
return "DeviceExport{" +
"deviceId=" + deviceId +
", value1='" + value1 + '\'' +
", voltage='" + voltage + '\'' +
", longitude='" + longitude + '\'' +
", latitude='" + latitude + '\'' +
", ts='" + ts + '\'' +
'}';
}
}

@ -0,0 +1,115 @@
package com.ruoyi.business.domain.VO;
import com.ruoyi.business.domain.HwDevice;
import com.ruoyi.business.domain.HwMonitorUnit;
import com.ruoyi.common.core.web.domain.BaseEntity;
import java.util.List;
/**
* @ClassName : TreeAreaVo
* @Description :
* @Author :
* @Date: 2024-06-13 10:20
*/
public class TreeAreaVo {
private Long areaId;
private String areaName;
// private String ancestors;
//
// private Long parentId;
//
// private String areaStatus;
//
// private Long orderNum;
private List<TreeAreaVo> listArea;
private List<HwDevice> deviceList;
private List<HwMonitorUnit> monitorUnitList;
public List<HwMonitorUnit> getMonitorUnitList() {
return monitorUnitList;
}
public void setMonitorUnitList(List<HwMonitorUnit> monitorUnitList) {
this.monitorUnitList = monitorUnitList;
}
public List<HwDevice> getDeviceList() {
return deviceList;
}
public void setDeviceList(List<HwDevice> deviceList) {
this.deviceList = deviceList;
}
public Long getAreaId() {
return areaId;
}
public void setAreaId(Long areaId) {
this.areaId = areaId;
}
public String getAreaName() {
return areaName;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
//
// public String getAncestors() {
// return ancestors;
// }
//
// public void setAncestors(String ancestors) {
// this.ancestors = ancestors;
// }
//
// public Long getParentId() {
// return parentId;
// }
//
// public void setParentId(Long parentId) {
// this.parentId = parentId;
// }
//
// public String getAreaStatus() {
// return areaStatus;
// }
//
// public void setAreaStatus(String areaStatus) {
// this.areaStatus = areaStatus;
// }
//
// public Long getOrderNum() {
// return orderNum;
// }
//
// public void setOrderNum(Long orderNum) {
// this.orderNum = orderNum;
// }
public List<TreeAreaVo> getListArea() {
return listArea;
}
public void setListArea(List<TreeAreaVo> listArea) {
this.listArea = listArea;
}
@Override
public String toString() {
return "TreeAreaVo{" +
"areaId=" + areaId +
", areaName='" + areaName + '\'' +
", listArea=" + listArea +
'}';
}
}

@ -0,0 +1,73 @@
package com.ruoyi.business.domain.VO;
import java.util.List;
/**
* @ClassName : TreeDeviceVo
* @Description :
* @Author :
* @Date: 2024-06-11 17:47
*/
public class TreeDeviceVo {
private Long voId;
private String voName;
private Long parentId;
private List<TreeDeviceVo> voList;
private String prop;
public String getProp() {
return prop;
}
public void setProp(String prop) {
this.prop = prop;
}
public Long getVoId() {
return voId;
}
public void setVoId(Long voId) {
this.voId = voId;
}
public String getVoName() {
return voName;
}
public void setVoName(String voName) {
this.voName = voName;
}
public Long getParentId() {
return parentId;
}
public void setParentId(Long parentId) {
this.parentId = parentId;
}
public List<TreeDeviceVo> getVoList() {
return voList;
}
public void setVoList(List<TreeDeviceVo> voList) {
this.voList = voList;
}
@Override
public String toString() {
return "TreeDeviceVo{" +
"voId=" + voId +
", voName='" + voName + '\'' +
", parentId=" + parentId +
", voList=" + voList +
", prop=" + prop +
'}';
}
}

@ -2,20 +2,21 @@ package com.ruoyi.business.mapper;
import java.util.List;
import com.ruoyi.business.domain.HwAlarmInfo;
import com.ruoyi.business.domain.VO.AlarmInfoExportVo;
import com.ruoyi.business.domain.VO.AlarmInfoVo;
import com.ruoyi.business.domain.VO.AlarmTypeVo;
/**
* Mapper
*
*
* @author xins
* @date 2023-09-15
*/
public interface HwAlarmInfoMapper
public interface HwAlarmInfoMapper
{
/**
*
*
*
* @param alarmInfoId
* @return
*/
@ -23,7 +24,7 @@ public interface HwAlarmInfoMapper
/**
*
*
*
* @param hwAlarmInfo
* @return
*/
@ -31,7 +32,7 @@ public interface HwAlarmInfoMapper
/**
*
*
*
* @param hwAlarmInfo
* @return
*/
@ -39,15 +40,16 @@ public interface HwAlarmInfoMapper
/**
*
*
*
* @param hwAlarmInfo
* @return
*/
public int updateHwAlarmInfo(HwAlarmInfo hwAlarmInfo);
/**
*
*
*
* @param alarmInfoId
* @return
*/
@ -55,7 +57,7 @@ public interface HwAlarmInfoMapper
/**
*
*
*
* @param alarmInfoIds
* @return
*/
@ -74,4 +76,14 @@ public interface HwAlarmInfoMapper
* @return int
*/
public int selectAlarmCountByMonitorUnitId(Long monitorUnitId);
/**
*
* */
List<AlarmInfoExportVo> selectAlarmInfoExport();
/**
*
* */
public int updateHwAlarmInfoAllByDevice(HwAlarmInfo hwAlarmInfo);
}

@ -1,9 +1,15 @@
package com.ruoyi.business.mapper;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.ruoyi.business.domain.HwDevice;
import com.ruoyi.business.domain.VO.DeviceModeVo;
import com.ruoyi.business.domain.VO.HwMonitorUnitVo;
import com.ruoyi.business.domain.VO.TreeAreaVo;
import com.ruoyi.business.domain.VO.TreeDeviceVo;
import org.apache.ibatis.annotations.Param;
/**
* Mapper
@ -108,9 +114,9 @@ public interface HwDeviceMapper
* @return HwDevice
*/
public HwDevice selectHwDeviceByDeviceCode(String deviceCode);
public int selectDeviceNumCount(HwDevice hwDevice);
public int selectAbnormalDeviceNumCount(HwDevice hwDevice);
@ -134,4 +140,34 @@ public interface HwDeviceMapper
* @return List<HwDevice>
*/
public List<HwDevice> selectUnallocatedList(HwDevice hwDevice);
/**
*
* */
List<TreeDeviceVo> selectDeviceList();
/**
*
* */
public String selectPropBydeviceIdAndFunctionName(@Param(value = "deviceModeId") Long deviceModeId,@Param(value = "functionName") String functionName);
/**
*
* */
List<HwDevice> getDeviceByAreaId(@Param(value = "tenantId") Long tenantId,@Param(value = "areaId") Long areaId);
List<TreeAreaVo> getTreeArea(Long areaId);
/**
*
* */
List<HwDevice> getDeviceListInMonitorUnit(Long monitorUnitId);
/**
*
* */
String selectFunctionNameByFunctionIdentifier(String functionIdentifier);
/**
* id
* */
Integer selectDeviceIfAlarm(Long deviceId);
}

@ -114,4 +114,10 @@ public interface HwElectronicFenceMapper
* @return
*/
public int deleteHwFenceAreaByElectronicFenceId(Long electronicFenceId);
/**
* id
* */
List<HwElectronicFence> selectMonitorElectronic(Long deviceId);
}

@ -1,11 +1,13 @@
package com.ruoyi.business.mapper;
import java.util.List;
import java.util.Map;
import com.alibaba.druid.support.http.MonitorClientContextListener;
import com.ruoyi.business.domain.HwMonitorUnit;
import com.ruoyi.business.domain.HwScene;
import com.ruoyi.business.domain.VO.*;
import org.apache.ibatis.annotations.Param;
/**
* Mapper
@ -155,4 +157,31 @@ public interface HwMonitorUnitMapper
*/
public int deleteMonitorUnitById(Long monitorUnitId);
}
/**
*
* */
Integer selectBeaconDeviceNums(Long sceneId);
/**
*
* */
Integer[] selectBeaconDeviceBySceneId(Long sceneId);
/**
* id
* */
HwMonitorUnit selectMonitorUnit(Long deviceId);
/**
* map
* */
List<TreeDeviceVo> selectMonitorUnitReturnMap();
/**
* id
* */
List<HwMonitorUnit> getMonitorUnitByAreaId(@Param(value = "tenantId") Long tenantId, @Param(value = "areaId") Long areaId);
List<HwMonitorUnit> selectMonitorUnitListHavAreaId(Long tenantId);
}

@ -1,8 +1,11 @@
package com.ruoyi.business.mapper;
import java.util.List;
import java.util.Map;
import com.ruoyi.business.domain.HwScene;
import com.ruoyi.business.domain.VO.HwSceneVo;
import com.ruoyi.business.domain.VO.TreeDeviceVo;
/**
* Mapper
@ -66,4 +69,9 @@ public interface HwSceneMapper
* @return
*/
public int deleteHwSceneBySceneIds(Long[] sceneIds);
/**
*
* */
public List<TreeDeviceVo> selectHwSceneListReturnMap();
}

@ -2,19 +2,20 @@ package com.ruoyi.business.service;
import java.util.List;
import com.ruoyi.business.domain.HwAlarmInfo;
import com.ruoyi.business.domain.VO.AlarmInfoExportVo;
import com.ruoyi.business.domain.VO.AlarmTypeVo;
/**
* Service
*
*
* @author xins
* @date 2023-09-15
*/
public interface IHwAlarmInfoService
public interface IHwAlarmInfoService
{
/**
*
*
*
* @param alarmInfoId
* @return
*/
@ -22,7 +23,7 @@ public interface IHwAlarmInfoService
/**
*
*
*
* @param hwAlarmInfo
* @return
*/
@ -30,7 +31,7 @@ public interface IHwAlarmInfoService
/**
*
*
*
* @param hwAlarmInfo
* @return
*/
@ -38,7 +39,7 @@ public interface IHwAlarmInfoService
/**
*
*
*
* @param hwAlarmInfo
* @return
*/
@ -46,7 +47,7 @@ public interface IHwAlarmInfoService
/**
*
*
*
* @param alarmInfoIds
* @return
*/
@ -54,7 +55,7 @@ public interface IHwAlarmInfoService
/**
*
*
*
* @param alarmInfoId
* @return
*/
@ -68,4 +69,10 @@ public interface IHwAlarmInfoService
* @return List<AlarmTypeVo>
*/
public List<AlarmTypeVo> selectAlarmsByAlarmType(Long sceneId);
/**
*
* */
List<AlarmInfoExportVo> selectAlarmInfoExport();
}

@ -1,10 +1,12 @@
package com.ruoyi.business.service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.business.domain.HwDevice;
import com.ruoyi.business.domain.*;
import com.ruoyi.business.domain.VO.*;
import com.ruoyi.common.datascope.annotation.DataScope;
@ -213,4 +215,53 @@ public interface IHwDeviceService {
*/
public List<HwDevice> selectUnallocatedList(HwDevice device);
/**
*
* */
public List<BeaconDevice> selectDeviceLatitudeAndLongitude(Long sceneId);
/**
*
* */
public List<Map<String, Object>> selectBeaconDevicesHistory(Map map);
/**
*
* */
public HwMonitorUnit selectMonitorUnit(Long deviceId);
/**
*
* */
public List<Map<String,Object>> selectHistoryDevice(Map map);
/**
*
* */
public List<TreeDeviceVo> selectComparison();
/**
*
* */
List<Map<String, Object>> getExportDevice(Map map);
/**
*
* */
List<HwMonitorUnit> getDeviceByAreaId(Long tenantId);
/**
* id
* */
List<HwElectronicFence> selectMonitorElectronic(Long deviceId);
/**
* redis
* */
void insertRedis(JSONArray jsonArray,Long tenantId);
JSONObject selectRedisFile(Long tenantId);
/**
* /
* */
List<HwDevice>selectMonitorUnitAndDeviceByName(Map map);
}

@ -6,6 +6,7 @@ import java.util.Set;
import java.util.stream.Collectors;
import com.ruoyi.business.domain.HwAlarmType;
import com.ruoyi.business.domain.VO.AlarmInfoExportVo;
import com.ruoyi.business.domain.VO.AlarmTypeVo;
import com.ruoyi.business.mapper.HwAlarmTypeMapper;
import com.ruoyi.common.core.constant.HwDictConstants;
@ -76,7 +77,14 @@ public class HwAlarmInfoServiceImpl implements IHwAlarmInfoService {
public int updateHwAlarmInfo(HwAlarmInfo hwAlarmInfo) {
hwAlarmInfo.setUpdateTime(DateUtils.getNowDate());
hwAlarmInfo.setHandleStatus(HwDictConstants.ALARM_HANDLE_STATUS_YES);
return hwAlarmInfoMapper.updateHwAlarmInfo(hwAlarmInfo);
if (hwAlarmInfo.getIfDisposalAll().equals("0")){
return hwAlarmInfoMapper.updateHwAlarmInfo(hwAlarmInfo);
}
else {
return hwAlarmInfoMapper.updateHwAlarmInfoAllByDevice(hwAlarmInfo);
}
}
/**
@ -142,4 +150,9 @@ public class HwAlarmInfoServiceImpl implements IHwAlarmInfoService {
}
return list;
}
@Override
public List<AlarmInfoExportVo> selectAlarmInfoExport() {
return hwAlarmInfoMapper.selectAlarmInfoExport();
}
}

@ -3,6 +3,7 @@ package com.ruoyi.business.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.parser.Feature;
import com.ruoyi.business.domain.*;
import com.ruoyi.business.domain.VO.*;
import com.ruoyi.business.mapper.*;
@ -19,17 +20,25 @@ import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.core.utils.NumberUtils;
import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.common.datascope.annotation.DataScope;
import com.ruoyi.common.redis.service.RedisService;
import com.ruoyi.common.security.utils.SecurityUtils;
import com.ruoyi.system.api.domain.SysUser;
import com.ruoyi.tdengine.api.RemoteTdEngineService;
import com.ruoyi.tdengine.api.domain.*;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.data.redis.RedisProperties;
import org.springframework.data.redis.cache.RedisCache;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import sun.reflect.generics.tree.Tree;
import javax.annotation.Resource;
import java.io.File;
import java.sql.Timestamp;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/**
@ -56,7 +65,12 @@ public class HwDeviceServiceImpl implements IHwDeviceService {
private StringRedisTemplate redisTemplate;
@Autowired
private HwAlarmInfoMapper hwAlarmInfoMapper;
@Autowired
private HwElectronicFenceMapper hwElectronicFenceMapper;
@Autowired
private RedisService redisService;
@Autowired
private HwFenceAreaMapper hwFenceAreaMapper;
/**
*
*
@ -65,7 +79,6 @@ public class HwDeviceServiceImpl implements IHwDeviceService {
*/
@Override
public HwDevice selectHwDeviceByDeviceId(Long deviceId) {
return hwDeviceMapper.selectHwDeviceByDeviceId(deviceId);
}
@ -1123,4 +1136,410 @@ public class HwDeviceServiceImpl implements IHwDeviceService {
return hwDeviceMapper.selectUnallocatedList(device);
}
/**
*
*
* */
@Override
public List<BeaconDevice> selectDeviceLatitudeAndLongitude(Long sceneId) {
//根据场景查询下面的设备
HwDevice device = new HwDevice();
device.setSceneId(sceneId);
List<HwDevice> hwDevices = hwDeviceMapper.selectHwDeviceList(device);
Integer[] integers = hwMonitorUnitMapper.selectBeaconDeviceBySceneId(sceneId);
//调用tde查询每个设备的经纬度
if (integers.length!=0){
TdSelectDto tdSelectDto = new TdSelectDto();
tdSelectDto.setDatabaseName(TdEngineConstants.PLATFORM_DB_NAME);
TdField tdField = new TdField();
tdField.setFieldName("longitude");
TdField tdField1 = new TdField();
tdField1.setFieldName("latitude");
List<TdField> fields = new ArrayList<TdField>();
fields.add(tdField);
fields.add(tdField1);
tdSelectDto.setSchemaFieldValues(fields);
List<BeaconDevice> lists = new ArrayList<BeaconDevice>();
for (int i = 0;i<integers.length;i++){
tdSelectDto.setTableName(TdEngineConstants.DEFAULT_TABLE_NAME_PREFIX+integers[i]);
R<?> latestData = remoteTdEngineService.getLatestData(tdSelectDto, SecurityConstants.INNER);
Object data = latestData.getData();
String s = JSONObject.toJSONString(data);
if (latestData.getCode()!=500){
String substring = s.substring(1, s.length() - 1);
if (!substring.isEmpty()){
Map map = JSONObject.parseObject(substring, Map.class);
if (map.size()==2){
BeaconDevice beaconDevice = new BeaconDevice();
beaconDevice.setDeviceId(hwDevices.get(i).getDeviceId());
beaconDevice.setDeviceName(hwDevices.get(i).getDeviceName());
beaconDevice.setLatitude(Double.valueOf( map.get("latitude").toString()));
beaconDevice.setLongitude(Double.valueOf( map.get("longitude").toString()));
beaconDevice.setRemark(hwDevices.get(i).getRemark());
beaconDevice.setDeviceLocation(hwDevices.get(i).getDeviceLocation());
beaconDevice.setDeviceLocation("白银市");
beaconDevice.setDeviceModeId(hwDevices.get(i).getDeviceModeId());
lists.add(beaconDevice);
}
}
}
}
// System.out.println(lists);
return lists;
}
return null;
}
/**
* id
* */
@Override
public List<Map<String, Object>> selectBeaconDevicesHistory(Map map) {
TdHistorySelectDto tdHistorySelectDto = new TdHistorySelectDto();
tdHistorySelectDto.setDatabaseName(TdEngineConstants.PLATFORM_DB_NAME);
tdHistorySelectDto.setTableName(TdEngineConstants.DEFAULT_TABLE_NAME_PREFIX+map.get("deviceId"));
tdHistorySelectDto.setFirstFieldName(TdEngineConstants.DEFAULT_FIRST_FIELD_NAME);
if (map.get("pageSize")!=null){
tdHistorySelectDto.setLimit(Integer.valueOf(map.get("pageSize").toString()));
}
if (map.get("pageSize")!=null&&map.get("pageNum")!=null){
tdHistorySelectDto.setOffset(Integer.valueOf(map.get("pageSize").toString())*(Integer.valueOf(map.get("pageNum").toString())-1));
}
tdHistorySelectDto.setOrderByFieldName(TdEngineConstants.DEFAULT_FIRST_FIELD_NAME);
tdHistorySelectDto.setSort(TdEngineConstants.DEFAULT_ORDER_BY_MODE);
if (map.containsKey("startTime")&&map.get("startTime")!=null){
tdHistorySelectDto.setStartTime(Timestamp.valueOf(map.get("startTime").toString()).getTime());
}
if (map.containsKey("endTime")&&map.get("endTime")!=null){
tdHistorySelectDto.setEndTime(Timestamp.valueOf(map.get("endTime").toString()).getTime());
}
R<TdReturnDataVo> historyData = remoteTdEngineService.getHistoryData(tdHistorySelectDto, SecurityConstants.INNER);
System.out.println("查询历史数据"+map.get("deviceId"));
List<Map<String, Object>> dataList = historyData.getData().dataList;
for (int i = 0; i < dataList.size(); i++){
dataList.get(i).put("deviceId",map.get("deviceId"));
}
int count = historyData.getData().count;
Map<String, Object> map1 = new HashMap<>();
map1.put("total",count);
dataList.add(map1);
return dataList;
}
/**
* id
* */
@Override
public HwMonitorUnit selectMonitorUnit(Long deviceId) {
HwMonitorUnit hwMonitorUnit = hwMonitorUnitMapper.selectMonitorUnit(deviceId);
return hwMonitorUnit;
}
/**
*
* */
@Override
public List<Map<String, Object>> selectHistoryDevice(Map map) {
//1-趋势分析 2历史数据
//如果是趋势分析就删除分页
Long pageSize = 0l;
if (map.get("type")!=null){
if (map.get("type").toString().equals("1")){
map.remove("pageSize");
map.remove("pageNum");
}
else {
pageSize = Long.valueOf(map.get("pageSize").toString());
}
}
String deviceIds = map.get("deviceIds").toString();
String[] str = deviceIds.split(",");
map.replace("pageSize",pageSize/str.length);
List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
Long total = 0l;
for (int i = 0; i < str.length; i++) {
map.put("deviceId",str[i]);
if (i== str.length-2){
map.replace("pageSize",pageSize%str.length);
}
if (map.get("prop")!=null){
//查询类型的字段名
String s = hwDeviceMapper.selectPropBydeviceIdAndFunctionName(Long.valueOf(map.get("deviceId").toString())
, map.get("prop").toString());
map.put("functionIdentifier",s);
}
List<Map<String, Object>> list1 = this.selectBeaconDevicesHistory(map);
total = total+Long.valueOf(list1.get(list1.size()-1).get("total").toString());
list1.remove(list1.size()-1);
List<Map<String, Object>> list2 = new ArrayList<Map<String, Object>>();
//在弹出框中进行对比时,对历史数据进行过滤,根据传入的传感器类型
if (map.get("functionIdentifier")!=null) {
for (int x = 0; x < list1.size(); x++) {
//查看数据中是否拥有所需要的数据,没有进入下一循环
if (list1.get(i).get(map.get("functionIdentifier").toString())==null){
continue;
}
Map<String, Object> map2 = new HashMap<String, Object>();
//获取出需要的数据存入返回值中
map2.put("deviceId", list1.get(x).get("deviceId"));
map2.put("ts", list1.get(x).get("ts"));
map2.put("deviceName", list1.get(x).get("deviceName"));
map2.put("functionName", map.get("prop"));
map2.put("functionIdentifier",
list1.get(x).get(map.get("functionIdentifier").toString()));
list.add(map2);
}
}
else {
list.addAll(list1);
}
}
Map<String, Object> mapName = new HashMap<String, Object>();
if (list.size()>0){
Set<String> strings = list.get(0).keySet();
List<String> list2 = new ArrayList<String>();
list2.addAll(strings);
for (int i = 0; i < list2.size(); i++) {
//查询类型的字段名
String s = hwDeviceMapper.selectFunctionNameByFunctionIdentifier(list2.get(i));
mapName.put(list2.get(i),s);
}
list.add(mapName);
}
if (map.get("type")!=null&&map.get("type").equals("1") ){
for (int i = 0; i < list.size(); i++) {
if (list.get(i).containsKey("valid")){
list.get(i).remove("valid");
}
if (list.get(i).containsKey("acc")){
list.get(i).remove("acc");
}
if (list.get(i).containsKey("version")){
list.get(i).remove("version");
}
if (list.get(i).containsKey("speed")){
list.get(i).remove("speed");
}
}
}
Map<String, Object> mapTotal = new HashMap<String, Object>();
mapTotal.put("total", total);
list.add(mapTotal);
return list;
}
/**
*
* */
@Override
public List<TreeDeviceVo> selectComparison() {
List<TreeDeviceVo> sceneMap = hwSceneMapper.selectHwSceneListReturnMap();
List<TreeDeviceVo> unitMap = hwMonitorUnitMapper.selectMonitorUnitReturnMap();
List<TreeDeviceVo> deviceMap = hwDeviceMapper.selectDeviceList();
for (int i = 0; i < unitMap.size(); i++) {
List<TreeDeviceVo> list = new ArrayList<TreeDeviceVo>();
for (int j = 0; j < deviceMap.size(); j++) {
if (unitMap.get(i).getVoId() == deviceMap.get(j).getParentId()) {
list.add(deviceMap.get(j));
}
}
unitMap.get(i).setVoList(list);
}
for (int i = 0; i < sceneMap.size(); i++) {
List<TreeDeviceVo> list = new ArrayList<TreeDeviceVo>();
for (int j = 0; j < unitMap.size(); j++) {
if (sceneMap.get(i).getVoId().equals(unitMap.get(j).getParentId())) {
list.add(unitMap.get(j));
}
}
sceneMap.get(i).setVoList(list);
}
return sceneMap;
}
/**
* excel
* */
@Override
public List<Map<String, Object>> getExportDevice(Map map) {
map.remove("pageSize");
map.remove("pageNum");
String deviceIds = map.get("deviceIds").toString();
String[] str = deviceIds.split(",");
List<Map<String, Object>> exportList = new ArrayList<Map<String, Object>>();
for (int i = 0; i < str.length; i++) {
map.put("deviceId",str[i]);
List<Map<String, Object>> list1 = this.selectBeaconDevicesHistory(map);
list1.remove(list1.size()-1);
exportList.addAll(list1);
}
return exportList;
}
/**
*
* */
@Override
public List<HwMonitorUnit> getDeviceByAreaId(Long tenantId) {
//如果是管理员,则不对租户进行过滤,即可以看到城市下所有租户的设备信息
if (tenantId==1l)
{
tenantId = null;
}
/**
*
*id
*
* */
HwMonitorUnit hwMonitorUnit = new HwMonitorUnit();
hwMonitorUnit.setTenantId(tenantId);
List<HwMonitorUnit> unitList = hwMonitorUnitMapper.selectMonitorUnitListHavAreaId(tenantId);
for (int i = 0; i < unitList.size(); i++){
List<HwDevice> deviceList = this.getDeviceListInMonitorUnit(unitList.get(i).getMonitorUnitId());
unitList.get(i).setDevicesList(deviceList);
}
// List<TreeAreaVo> treeArea1 = hwDeviceMapper.getTreeArea(areaId);
// for (int i=0;i<treeArea1.size();i++){
// TreeAreaVo treeAreaVo = this.AreaRecursion(treeArea1.get(i),tenantId);
// treeArea.add(treeAreaVo);
// }
return unitList;
}
/**
*
* */
@Override
public List<HwElectronicFence> selectMonitorElectronic(Long deviceId) {
List<HwElectronicFence> hwElectronicFences = hwElectronicFenceMapper.selectMonitorElectronic(deviceId);
for (int i = 0; i < hwElectronicFences.size();i++){
HwFenceArea hwFenceArea = new HwFenceArea();
hwFenceArea.setElectronicFenceId(hwElectronicFences.get(i).getElectronicFenceId());
List<HwFenceArea> hwFenceAreaList = hwFenceAreaMapper.selectHwFenceAreaList(hwFenceArea);
hwElectronicFences.get(i).setHwFenceAreaList(hwFenceAreaList);
}
return hwElectronicFences;
}
//查询监控单元下的信标设备
public List<HwDevice> getDeviceListInMonitorUnit(Long monitorUnitId){
List<HwDevice> deviceListInMonitorUnit = hwDeviceMapper.getDeviceListInMonitorUnit(monitorUnitId);
Map<String, String> map = new HashMap<String, String>();
map.put("pageNum","1");
map.put("pageSize","1");
for (int i=0;i<deviceListInMonitorUnit.size();i++){
map.put("deviceId",deviceListInMonitorUnit.get(i).getDeviceId().toString());
//根据设备id查询该设备是否有报警信息
Integer integer = hwDeviceMapper.selectDeviceIfAlarm(Long.valueOf(map.get("deviceId")));
String ifAlarm = new String();
if (integer>0){
//正常
ifAlarm="1";
}
else {
ifAlarm="0";
}
List<Map<String, Object>> list = this.selectBeaconDevicesHistory(map);
// list.remove(list.size()-1);
System.out.println(list);
for(int j=0;j<list.size();j++){
deviceListInMonitorUnit.get(i).setIfAlarm(ifAlarm);
// System.out.println(list.get(j).get("longitude"));
if (list.get(j).containsKey("longitude")){
System.out.println(deviceListInMonitorUnit.get(j).getDeviceId());
deviceListInMonitorUnit.get(i).setLongitude(Double.valueOf(list.get(j).get("longitude").toString()));
}
if (list.get(j).containsKey("latitude")){
deviceListInMonitorUnit.get(i).setLatitude(Double.valueOf(list.get(j).get("latitude").toString()));
}
}
}
return deviceListInMonitorUnit;
}
/**
* excel
* */
@Override
public void insertRedis(JSONArray jsonArray,Long tenantId){
// redisTemplate.opsForValue().set("test",jsonArray.toJSONString());
if (redisService.hasKey("file"+tenantId)) {
redisService.deleteObject("file"+tenantId);
}
redisService.setCacheObject("file"+tenantId,jsonArray.toJSONString(),99999l, TimeUnit.DAYS);
}
/**
* excel
* */
@Override
public JSONObject selectRedisFile(Long tenantId){
Object o = redisService.getCacheObject("file" + tenantId);
JSONObject array = new JSONObject(true);
array.put("content",o.toString());
String s = o.toString();
String[] split = s.split("},\\{");
String s2 = split[0].substring(1) + "}";
Map<String, Object> map = JSON.parseObject(s2,LinkedHashMap.class, Feature.OrderedField);
Map<Long, String> linkedMap = new LinkedHashMap<Long, String>();
Long along = 1l;
for (String key : map.keySet()){
linkedMap.put(along, key);
along++;
}
array.put("Header",linkedMap);
return array;
}
/**
*
* */
@Override
public List<HwDevice> selectMonitorUnitAndDeviceByName(Map map) {
String name = map.get("name").toString();
HwMonitorUnit hwMonitorUnit= new HwMonitorUnit();
// System.out.println(name);
hwMonitorUnit.setMonitorUnitName(name);
List<HwMonitorUnit> monitorUnits = hwMonitorUnitMapper.selectHwMonitorUnitList(hwMonitorUnit);
HwDevice hwDevice = new HwDevice();
hwDevice.setDeviceName(name);
List<HwDevice> deviceList = hwDeviceMapper.selectHwDeviceList(hwDevice);
List<Long> stringList = new ArrayList<Long>();
for (int i = 0; i < deviceList.size(); i++){
HwMonitorUnit hwMonitorUnit1 = hwMonitorUnitMapper.selectMonitorUnit(deviceList.get(i).getDeviceId());
monitorUnits.add(hwMonitorUnit1);
}
List<HwMonitorUnit> collect = monitorUnits.stream().collect(Collectors.collectingAndThen(
Collectors.toCollection(()->new TreeSet<>(Comparator.comparing(HwMonitorUnit::getMonitorUnitId))
),ArrayList::new));
List<HwDevice> deviceListReturn = new ArrayList<HwDevice>();
for (int i = 0; i < collect.size(); i++){
deviceListReturn.addAll(this.getDeviceListInMonitorUnit(collect.get(i).getMonitorUnitId()));
}
return deviceListReturn;
}
}

@ -131,7 +131,11 @@ public class HwMonitorUnitServiceImpl implements IHwMonitorUnitService {
//查询设备数量(子设备和直连设备),不包括网关
Integer integer = hwMonitorUnitMapper.selectDeviceNums(sceneId) == null ? 0
: hwMonitorUnitMapper.selectDeviceNums(sceneId);
//查询信标设备数量
Integer beaconNums = hwMonitorUnitMapper.selectBeaconDeviceNums(sceneId) ==null ? 0
:hwMonitorUnitMapper.selectBeaconDeviceNums(sceneId);
AllNumsVo vo = new AllNumsVo();
vo.setBeaconDeviceSum(beaconNums);
vo.setSubSum(monitor);
vo.setSum(integer);
return vo;
@ -175,10 +179,13 @@ public class HwMonitorUnitServiceImpl implements IHwMonitorUnitService {
AllNumsVo numsVo = selectAllNums(sceneId);
//获取在线设备数量,获取已发布状态子设备并且关联网关为在线的数量以及在线状态发布状态的直连设备数量之和
int onlineDeviceNum = hwDeviceMapper.getOnlineDeviceNum(sceneId);
//查询信标设备数量
Integer beaconNums = hwMonitorUnitMapper.selectBeaconDeviceNums(sceneId) ==null ? 0
:hwMonitorUnitMapper.selectBeaconDeviceNums(sceneId);
SubDeviceSumVo subDeviceSumVo = new SubDeviceSumVo();
subDeviceSumVo.setSubSum(numsVo.getSubSum());//监控单元数量
subDeviceSumVo.setDeviceNum(numsVo.getSum());//设备数量
subDeviceSumVo.setDeviceNum(beaconNums);//信标设备数量
// subDeviceSumVo.setDeviceNum(numsVo.getSum());//设备数量
subDeviceSumVo.setOnlineDeviceNum(onlineDeviceNum);//在线设备数量
return subDeviceSumVo;

@ -0,0 +1,77 @@
package com.ruoyi.business.utils;
import java.util.LinkedHashMap;
/**
* @author sunnyzyq
* @date 2021/12/17
*/
public class ExcelClassField {
/** 字段名称 */
private String fieldName;
/** 表头名称 */
private String name;
/** 映射关系 */
private LinkedHashMap<String, String> kvMap;
/** 示例值 */
private Object example;
/** 排序 */
private int sort;
/** 是否为注解字段0-否1-是 */
private int hasAnnotation;
public String getFieldName() {
return fieldName;
}
public void setFieldName(String fieldName) {
this.fieldName = fieldName;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public LinkedHashMap<String, String> getKvMap() {
return kvMap;
}
public void setKvMap(LinkedHashMap<String, String> kvMap) {
this.kvMap = kvMap;
}
public Object getExample() {
return example;
}
public void setExample(Object example) {
this.example = example;
}
public int getSort() {
return sort;
}
public void setSort(int sort) {
this.sort = sort;
}
public int getHasAnnotation() {
return hasAnnotation;
}
public void setHasAnnotation(int hasAnnotation) {
this.hasAnnotation = hasAnnotation;
}
}

@ -0,0 +1,28 @@
package com.ruoyi.business.utils;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* @author sunnyzyq
* @date 2021/12/17
*/
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface ExcelExport {
/** 字段名称 */
String value();
/** 导出排序先后: 数字越小越靠前默认按Java类字段顺序导出 */
int sort() default 0;
/** 导出映射格式如0-未知;1-男;2-女 */
String kv() default "";
/** 导出模板示例值(有值的话,直接取该值,不做映射) */
String example() default "";
}

@ -0,0 +1,31 @@
package com.ruoyi.business.utils;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* @author sunnyzyq
* @date 2021/12/17
*/
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface ExcelImport {
/** 字段名称 */
String value();
/** 导出映射格式如0-未知;1-男;2-女 */
String kv() default "";
/** 是否为必填字段(默认为非必填) */
boolean required() default false;
/** 最大长度默认255 */
int maxLength() default 255;
/** 导入唯一性验证(多个字段则取联合验证) */
boolean unique() default false;
}

@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.business.mapper.HwAlarmInfoMapper">
<resultMap type="HwAlarmInfo" id="HwAlarmInfoResult">
<result property="alarmInfoId" column="alarm_info_id" />
<result property="alarmInfoType" column="alarm_info_type" />
@ -41,6 +41,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="alarmCount" column="alarm_count" />
</resultMap>
<resultMap id="AlarmInfoExportVoResult" type="com.ruoyi.business.domain.VO.AlarmInfoExportVo">
<result property="alarmInfoId" column="alarm_info_id" />
<result property="areaName" column="area_name" />
<result property="monitorUnitName" column="monitor_unit_name" />
<result property="alarmLevelName" column="alarm_level_name" />
<result property="alarmTypeName" column="alarm_type_name" />
<result property="alarmTime" column="alarm_time" />
</resultMap>
<sql id="selectHwAlarmInfoVo">
select hai.alarm_info_id, hai.alarm_info_type, hai.alarm_releated_id, hai.device_id,
@ -56,7 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectHwAlarmInfoList" parameterType="HwAlarmInfo" resultMap="HwAlarmInfoResult">
<include refid="selectHwAlarmInfoVo"/>
<where>
<where>
<if test="alarmInfoType != null and alarmInfoType != ''"> and alarm_info_type = #{alarmInfoType}</if>
<if test="alarmReleatedId != null "> and alarm_releated_id = #{alarmReleatedId}</if>
<if test="deviceId != null "> and device_id = #{deviceId}</if>
@ -78,12 +87,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
order by alarm_info_id desc,hal.level_number desc
</select>
<select id="selectHwAlarmInfoByAlarmInfoId" parameterType="Long" resultMap="HwAlarmInfoResult">
<include refid="selectHwAlarmInfoVo"/>
where alarm_info_id = #{alarmInfoId}
</select>
<insert id="insertHwAlarmInfo" parameterType="HwAlarmInfo" useGeneratedKeys="true" keyProperty="alarmInfoId">
insert into hw_alarm_info
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -161,7 +170,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteHwAlarmInfoByAlarmInfoIds" parameterType="String">
delete from hw_alarm_info where alarm_info_id in
delete from hw_alarm_info where alarm_info_id in
<foreach item="alarmInfoId" collection="array" open="(" separator="," close=")">
#{alarmInfoId}
</foreach>
@ -183,5 +192,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
exists (select 1 from hw_device hd where hai.device_id=hd.device_id and hd.device_status='1'
and hd.monitor_unit_id=#{monitorUnitId})
</select>
<select id="selectAlarmInfoExport" resultMap="AlarmInfoExportVoResult">
select hai.alarm_info_id,
hai.alarm_time,
hmu.monitor_unit_name,hal.alarm_level_name,hat.alarm_type_name,ha.area_name
from hw_alarm_info hai left join hw_monitor_unit hmu on hai.monitor_unit_id = hmu.monitor_unit_id
left join hw_alarm_level hal on hai.alarm_level_id=hal.alarm_level_id
left join hw_alarm_type hat on hai.alarm_type_id=hat.alarm_type_id
left join hw_area ha on ha.area_id = hmu.area_id
</select>
<update id="updateHwAlarmInfoAllByDevice" parameterType="HwAlarmInfo">
update hw_alarm_info
<trim prefix="SET" suffixOverrides=",">
<if test="handleStatus != null and handleStatus != ''">handle_status = #{handleStatus},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="alarmInfoField != null">alarm_info_field = #{alarmInfoField},</if>
</trim>
where device_id = (select t.device_id from (select device_id from hw_alarm_info hai where alarm_info_id = #{alarmInfoId})t) and handle_status = 0
</update>
</mapper>
</mapper>

@ -39,6 +39,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="tenantName" column="tenant_name" />
<result property="deviceModeName" column="device_mode_name" />
<result property="monitorUnitName" column="monitor_unit_name" />
<result property="functionName" column="function_name" />
</resultMap>
<resultMap id="TreeDeviceVoResult" type="com.ruoyi.business.domain.VO.TreeDeviceVo">
<result property="voId" column="vo_id" />
<result property="voName" column="vo_name" />
<result property="parentId" column="parent_id" />
<result property="prop" column="prop" />
</resultMap>
<resultMap id="TreeAreaVoResult" type="com.ruoyi.business.domain.VO.TreeAreaVo">
<result property="areaId" column="area_id" />
<result property="areaName" column="area_name" />
<!-- <result property="ancestors" column="ancestors" />-->
<!-- <result property="parentId" column="parent_id" />-->
<!-- <result property="areaStatus" column="area_status" />-->
<!-- <result property="orderNum" column="order_num" />-->
</resultMap>
<!--以下为监控平台接口所用-->
@ -359,4 +374,46 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
${params.tenantDataScope}
</select>
<select id="selectDeviceList" resultMap="TreeDeviceVoResult">
select hd.device_id as vo_id ,hd.monitor_unit_id as parent_id ,hd.device_name as vo_name ,
group_concat(hdmf.function_name separator',') as prop
from hw_device hd
left join hw_device_mode hdm on hd.device_mode_id = hdm.device_mode_id
left join hw_device_mode_function hdmf on hdm.device_mode_id = hdmf.device_mode_id
where hd.device_status != 9
group by hd.device_id
</select>
<select id="selectPropBydeviceIdAndFunctionName" resultType="String">
select function_identifier from hw_device_mode_function hdmf
where function_name = #{functionName} and device_mode_id = (
select device_mode_id from hw_device hd where device_id = #{deviceModeId})
</select>
<select id="getDeviceByAreaId" parameterType="Long" resultMap="HwDeviceResult">
select * from hw_device hd
<where>
and area_id = #{areaId}
and device_status !=9
<if test="tenantId != null and tenantId != ''"> and tenant_id =#{tenantId}</if>
</where>
</select>
<select id="getTreeArea" parameterType="Long" resultMap="TreeAreaVoResult">
select ha2.area_id as area_id,ha2.area_name as area_name from hw_area ha,hw_area ha2
where ha.area_id = ha2.parent_id and ha.area_id = #{areaId}
</select>
<select id="getDeviceListInMonitorUnit" parameterType="Long" resultMap="HwDeviceResult">
select * from hw_device hd where device_mode_id in
(select device_mode_id from hw_device_mode_function hdmf where function_identifier ='latitude')
and device_status !=9
and monitor_unit_id = #{monitorUnitId}
</select>
<select id="selectFunctionNameByFunctionIdentifier" parameterType="String" resultType="String">
select distinct function_name from hw_device_mode_function where function_identifier = #{functionIdentifier}
</select>
<select id="selectDeviceIfAlarm" parameterType="integer" resultType="integer">
select count(*) from (select * from hw_alarm_info hai where device_id = #{deviceId} and handle_status = 0) as a
</select>
</mapper>

@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.business.mapper.HwElectronicFenceMapper">
<resultMap type="HwElectronicFence" id="HwElectronicFenceResult">
<result property="electronicFenceId" column="electronic_fence_id" />
<result property="electronicFenceName" column="electronic_fence_name" />
@ -58,7 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="fenceField != null and fenceField != ''"> and fence_field = #{fenceField}</if>
</where>
</select>
<select id="selectHwElectronicFenceByElectronicFenceId" parameterType="Long" resultMap="HwElectronicFenceHwFenceTargetResult">
select a.electronic_fence_id, a.electronic_fence_name, a.tenant_id, a.scene_id, a.fence_type, a.effective_time_flag, a.time_zone, a.effective_time, a.trigger_status, a.fence_push_flag, a.fence_push_content, a.fence_recover_content, a.remark, a.create_by, a.create_time, a.update_by, a.update_time, a.fence_field,
b.electronic_fence_id as sub_electronic_fence_id, b.target_type as sub_target_type, b.target_id as sub_target_id
@ -66,7 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join hw_fence_target b on b.electronic_fence_id = a.electronic_fence_id
where a.electronic_fence_id = #{electronicFenceId}
</select>
<insert id="insertHwElectronicFence" parameterType="HwElectronicFence" useGeneratedKeys="true" keyProperty="electronicFenceId">
insert into hw_electronic_fence
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -152,7 +152,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteHwFenceTargetByElectronicFenceIds" parameterType="String">
delete from hw_fence_target where electronic_fence_id in
delete from hw_fence_target where electronic_fence_id in
<foreach item="electronicFenceId" collection="array" open="(" separator="," close=")">
#{electronicFenceId}
</foreach>
@ -224,4 +224,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
delete from hw_fence_area where electronic_fence_id = #{electronicFenceId}
</delete>
</mapper>
<select id="selectMonitorElectronic" parameterType="Long" resultMap="HwElectronicFenceResult">
select * from hw_electronic_fence hef
where electronic_fence_id =
(select electronic_fence_id from hw_fence_target hft where target_type = 1 and target_id = #{deviceId})
</select>
</mapper>

@ -60,6 +60,11 @@
<result property="monitorUnitId" column="monitor_unit_id"/>
<result property="num" column="num"/>
</resultMap>
<resultMap id="TreeDeviceVoResult" type="com.ruoyi.business.domain.VO.TreeDeviceVo">
<result property="voId" column="vo_id" />
<result property="voName" column="vo_name" />
<result property="parentId" column="parent_id" />
</resultMap>
<sql id="selectHwMonitorUnitVo">
select monitor_unit_id, monitor_unit_name, scene_id, parent_id, monitor_unit_type_id, area_id, monitor_address, monitor_pic, preserve_time, remark, monitor_unit_status, create_by, create_time, update_by, update_time, monitor_unit_field from hw_monitor_unit hmu
@ -312,4 +317,39 @@
update hw_monitor_unit set monitor_unit_status = '9' where monitor_unit_id = #{monitorUnitId}
</delete>
</mapper>
<select id="selectBeaconDeviceNums" parameterType="Long" resultType="int">
select count(1) from hw_device where device_mode_id =
(select device_mode_id from hw_device_mode where gps_flag = 1 and scene_id = #{sceneId}
) and scene_id = #{sceneId}
</select>
<select id="selectBeaconDeviceBySceneId" parameterType="Long" resultType="int">
select * from hw_device where device_mode_id =
(select device_mode_id from hw_device_mode where gps_flag = 1 and scene_id = #{sceneId}
) and scene_id = #{sceneId}
</select>
<select id="selectMonitorUnit" parameterType="Long" resultMap="HwMonitorUnitResult">
select * from hw_monitor_unit where monitor_unit_id = (
select monitor_unit_id from hw_device where device_id = #{deviceId})
</select>
<select id="selectMonitorUnitReturnMap" resultMap="TreeDeviceVoResult">
select scene_id as parent_id,monitor_unit_id as vo_id,monitor_unit_name as vo_name from hw_monitor_unit where monitor_unit_status =1
</select>
<select id="getMonitorUnitByAreaId" parameterType="Long" resultMap="HwMonitorUnitResult">
select * from hw_monitor_unit
<where>
and area_id = #{areaId}
and monitor_unit_status !=9
<if test="tenantId != null and tenantId != ''"> and tenant_id =#{tenantId}</if>
</where>
</select>
<select id="selectMonitorUnitListHavAreaId" parameterType="Long" resultMap="HwMonitorUnitResult">
select * from hw_monitor_unit
<where>
and monitor_unit_status !=9
and area_id is not null
<if test="tenantId != null and tenantId != ''"> and tenant_id=#{tenantId}</if>
</where>
</select>
</mapper>

@ -52,6 +52,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="contactName" column="contact_name" />
<result property="contactPhone" column="contact_phone" />
</resultMap>
<resultMap id="TreeDeviceVoResult" type="com.ruoyi.business.domain.VO.TreeDeviceVo">
<result property="voId" column="vo_id" />
<result property="voName" column="vo_name" />
<result property="parentId" column="parent_id" />
</resultMap>
<sql id="selectHwSceneVo">
select scene_id, scene_name, tenant_id, scene_mode_id, scene_pic, default_flag, scene_status, auth_mode, mode_account, mode_key, mode_secret, preserve_time, test_preserve_time, remark, create_by, create_time, update_by, update_time, scene_environment, scene_field from hw_scene hs
@ -198,4 +203,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{sceneId}
</foreach>
</delete>
<select id="selectHwSceneListReturnMap" resultMap="TreeDeviceVoResult">
select scene_id as vo_id,scene_name as vo_name from hw_scene hs where scene_status = 1
</select>
</mapper>

@ -25,10 +25,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="tenantBoardTopic" column="tenant_board_topic" />
<result property="tenantBoardPic" column="tenant_board_pic" />
<result property="tenantField" column="tenant_field" />
<result property="tenantMapCode" column="tenant_map_code" />
</resultMap>
<sql id="selectHwTenantVo">
select tenant_id, tenant_type, tenant_name, tenant_industry, contact_name, contact_phone, email, area_id, contact_address, remark, tenant_status, is_register, create_by, create_time, update_by, update_time,tenant_board_topic, tenant_board_pic,tenant_grade, tenant_field from hw_tenant ht
select tenant_id, tenant_type, tenant_name, tenant_industry, contact_name, contact_phone, email, area_id, contact_address, remark, tenant_status, is_register, create_by, create_time, update_by, update_time,tenant_board_topic, tenant_board_pic,tenant_grade, tenant_field ,tenant_map_code from hw_tenant ht
</sql>
<select id="selectHwTenantList" parameterType="HwTenant" resultMap="HwTenantResult">
@ -79,6 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="tenantBoardPic != null and tenantBoardPic != ''">tenant_board_pic,</if>
<if test="tenantGrade != null">tenant_grade,</if>
<if test="tenantField != null">tenant_field,</if>
<if test="tenantMapCode != null">tenant_map_code,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="tenantType != null and tenantType != ''">#{tenantType},</if>
@ -100,6 +102,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="tenantBoardPic != null and tenantBoardPic != ''">#{tenantBoardPic},</if>
<if test="tenantGrade != null">#{tenantGrade},</if>
<if test="tenantField != null">#{tenantField},</if>
<if test="tenantMapCode != null">#{tenantMapCode},</if>
</trim>
</insert>
@ -125,6 +128,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="tenantBoardPic != null and tenantBoardPic != ''">tenant_board_pic = #{tenantBoardPic},</if>
<if test="tenantGrade != null">tenant_grade = #{tenantGrade},</if>
<if test="tenantField != null">tenant_field = #{tenantField},</if>
<if test="tenantMapCode != null">tenant_map_code = #{tenantMapCode},</if>
</trim>
where tenant_id = #{tenantId}
</update>

@ -16,56 +16,56 @@
</description>
<dependencies>
<!-- SpringCloud Alibaba Nacos -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<!-- SpringCloud Alibaba Nacos Config -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<!-- SpringCloud Alibaba Sentinel -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
</dependency>
<!-- SpringBoot Actuator -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- FastDFS -->
<dependency>
<groupId>com.github.tobato</groupId>
<artifactId>fastdfs-client</artifactId>
</dependency>
<!-- Minio -->
<dependency>
<groupId>io.minio</groupId>
<artifactId>minio</artifactId>
<version>${minio.version}</version>
</dependency>
<!-- RuoYi Api System -->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-api-system</artifactId>
</dependency>
<!-- RuoYi Common Swagger -->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common-swagger</artifactId>
</dependency>
</dependencies>
<build>
@ -84,5 +84,5 @@
</plugin>
</plugins>
</build>
</project>
</project>

@ -9,7 +9,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/**
*
*
*
* @author ruoyi
*/
@Configuration
@ -34,7 +34,7 @@ public class ResourcesConfig implements WebMvcConfigurer
registry.addResourceHandler(localFilePrefix + "/**")
.addResourceLocations("file:" + localFilePath + File.separator);
}
/**
*
*/
@ -47,4 +47,4 @@ public class ResourcesConfig implements WebMvcConfigurer
// 设置允许的方法
.allowedMethods("GET");
}
}
}

@ -38,7 +38,7 @@
"dependencies": {
"@amap/amap-jsapi-loader": "^1.0.1",
"@riophae/vue-treeselect": "0.4.0",
"Vue-i18n": "npm:vue-i18n@^8.26.7",
"vue-i18n": "^8.28.2",
"axios": "0.24.0",
"clipboard": "2.0.8",
"core-js": "3.25.3",
@ -59,7 +59,6 @@
"vue": "2.6.12",
"vue-count-to": "1.0.13",
"vue-cropper": "0.5.5",
"vue-i18n": "8.26.7",
"vue-meta": "2.4.0",
"vue-router": "3.4.9",
"vue-seamless-scroll": "^1.1.23",
@ -83,7 +82,6 @@
"sass-loader": "10.1.1",
"script-ext-html-webpack-plugin": "2.1.5",
"svg-sprite-loader": "5.1.1",
"vue-i18n": "8.26.7",
"vue-template-compiler": "2.6.12"
},
"engines": {

@ -36,9 +36,8 @@ module.exports = {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
// target: `http://127.0.0.1:9080`,
// target: `http://10.11.40.120:9080`,
target: `http://10.11.40.120:9080`,
// target: `http://10.11.43.111:8080`,
target: `http://10.11.43.111:9088`,
// target: `http://175.27.215.92:9080`,
changeOrigin: true,
pathRewrite: {

@ -9,7 +9,7 @@ import org.springframework.security.web.authentication.SavedRequestAwareAuthenti
/**
*
*
*
* @author ruoyi
*/
@EnableWebSecurity
@ -36,6 +36,7 @@ public class WebSecurityConfigurer
, adminContextPath + "/login"
, adminContextPath + "/actuator/**"
, adminContextPath + "/instances/**"
).permitAll()
.anyRequest().authenticated()
.and()

Loading…
Cancel
Save