Merge remote-tracking branch 'origin/breach-zhy'
# Conflicts: # ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/controller/LayoutConfigController.java # ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/controller/LayoutDescController.java # ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/domain/LayoutConfig.java # ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/domain/LayoutDesc.java # ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/mapper/LayoutConfigDao.java # ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/mapper/LayoutDescDao.java # ruoyi-modules/hw-basic/src/main/resources/mapper/basic/LayoutConfigDao.xml # ruoyi-modules/hw-basic/src/main/resources/mapper/basic/LayoutDescDao.xml # ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/domain/HwDevice.java # ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/domain/HwElectronicFence.java # ruoyi-modules/hw-business/src/main/resources/mapper/business/HwDeviceMapper.xml # ruoyi-modules/hw-business/src/main/resources/mapper/business/HwElectronicFenceMapper.xml # ruoyi-ui/vue.config.jsmaster
commit
f4eb21a6c4
@ -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;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,112 @@
|
||||
package com.ruoyi.business.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ruoyi.business.domain.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
||||
|
||||
import com.ruoyi.business.service.IHwAlarmInfoService;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 报警信息Controller
|
||||
*
|
||||
* @author zangch
|
||||
* @date 2024-09-05
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/alarmInformation")
|
||||
public class HwAlarmInfomationController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IHwAlarmInfoService hwAlarmInfoService;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询报警信息列表
|
||||
*/
|
||||
@RequiresPermissions("business:alarmInformation:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(HwAlarmInfo hwAlarmInfo)
|
||||
{
|
||||
startPage();
|
||||
List<HwAlarmInfo> list = hwAlarmInfoService.selectHwAlarmInfoList(hwAlarmInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出报警信息列表
|
||||
*/
|
||||
@RequiresPermissions("business:alarmInformation:export")
|
||||
@Log(title = "报警信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, HwAlarmInfo hwAlarmInfo)
|
||||
{
|
||||
List<HwAlarmInfo> list = hwAlarmInfoService.selectHwAlarmInfoList(hwAlarmInfo);
|
||||
ExcelUtil<HwAlarmInfo> util = new ExcelUtil<HwAlarmInfo>(HwAlarmInfo.class);
|
||||
util.exportExcel(response, list, "报警信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取报警信息详细信息
|
||||
*/
|
||||
@RequiresPermissions("business:alarmInformation:query")
|
||||
@GetMapping(value = "/{alarmInfoId}")
|
||||
public AjaxResult getInfo(@PathVariable("alarmInfoId") Long alarmInfoId)
|
||||
{
|
||||
return success(hwAlarmInfoService.selectHwAlarmInfoByAlarmInfoId(alarmInfoId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增报警信息
|
||||
*/
|
||||
@RequiresPermissions("business:alarmInformation:add")
|
||||
@Log(title = "报警信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody HwAlarmInfo hwAlarmInfo)
|
||||
{
|
||||
return toAjax(hwAlarmInfoService.insertHwAlarmInfo(hwAlarmInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改报警信息
|
||||
*/
|
||||
@RequiresPermissions("business:alarmInformation:edit")
|
||||
@Log(title = "报警信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody HwAlarmInfo hwAlarmInfo)
|
||||
{
|
||||
return toAjax(hwAlarmInfoService.updateHwAlarmInformation(hwAlarmInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除报警信息
|
||||
*/
|
||||
@RequiresPermissions("business:alarmInformation:remove")
|
||||
@Log(title = "报警信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{alarmInfoIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] alarmInfoIds)
|
||||
{
|
||||
return toAjax(hwAlarmInfoService.deleteHwAlarmInfoByAlarmInfoIds(alarmInfoIds));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,112 @@
|
||||
package com.ruoyi.business.controller;
|
||||
|
||||
import com.ruoyi.business.domain.HwMonitorUnitAttribute;
|
||||
import com.ruoyi.business.service.HwMonitorUnitAttributeService;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 监控单元属性表(HwMonitorUnitAttribute)表控制层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-09-04 13:20:30
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("hwMonitorUnitAttribute")
|
||||
public class HwMonitorUnitAttributeController {
|
||||
/**
|
||||
* 服务对象
|
||||
*/
|
||||
@Resource
|
||||
private HwMonitorUnitAttributeService hwMonitorUnitAttributeService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param hwMonitorUnitAttribute 筛选条件
|
||||
* @param pageRequest 分页对象
|
||||
* @return 查询结果
|
||||
*/
|
||||
@GetMapping
|
||||
public ResponseEntity<Page<HwMonitorUnitAttribute>> queryByPage(HwMonitorUnitAttribute hwMonitorUnitAttribute, PageRequest pageRequest) {
|
||||
return ResponseEntity.ok(this.hwMonitorUnitAttributeService.queryByPage(hwMonitorUnitAttribute, pageRequest));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 单条数据
|
||||
*/
|
||||
@GetMapping("{id}")
|
||||
public ResponseEntity<HwMonitorUnitAttribute> queryById(@PathVariable("id") Long id) {
|
||||
return ResponseEntity.ok(this.hwMonitorUnitAttributeService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param hwMonitorUnitAttribute 实体
|
||||
* @return 新增结果
|
||||
*/
|
||||
@PostMapping
|
||||
public ResponseEntity<HwMonitorUnitAttribute> add(HwMonitorUnitAttribute hwMonitorUnitAttribute) {
|
||||
return ResponseEntity.ok(this.hwMonitorUnitAttributeService.insert(hwMonitorUnitAttribute));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑数据
|
||||
*
|
||||
* @param hwMonitorUnitAttribute 实体
|
||||
* @return 编辑结果
|
||||
*/
|
||||
@PutMapping
|
||||
public ResponseEntity<HwMonitorUnitAttribute> edit(HwMonitorUnitAttribute hwMonitorUnitAttribute) {
|
||||
return ResponseEntity.ok(this.hwMonitorUnitAttributeService.update(hwMonitorUnitAttribute));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 删除是否成功
|
||||
*/
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Boolean> deleteById(Long id) {
|
||||
return ResponseEntity.ok(this.hwMonitorUnitAttributeService.deleteById(id));
|
||||
}
|
||||
|
||||
@PostMapping("/addUnitAttribute")
|
||||
public AjaxResult addUnitAttribute(@RequestBody HwMonitorUnitAttribute hwMonitorUnitAttribute){
|
||||
int rows = hwMonitorUnitAttributeService.addUnitAttribute(hwMonitorUnitAttribute);
|
||||
return AjaxResult.success(rows);
|
||||
}
|
||||
|
||||
@GetMapping("/selectAttributeByUnitId")
|
||||
public AjaxResult selectAttributeByUnitId(Long monitorUnitId){
|
||||
List<HwMonitorUnitAttribute> attributes = hwMonitorUnitAttributeService.selectAttributeByUnitId(monitorUnitId);
|
||||
if (attributes.size()==0){
|
||||
return AjaxResult.success(Collections.emptyList());
|
||||
}
|
||||
return AjaxResult.success(attributes);
|
||||
}
|
||||
|
||||
@PostMapping("/updateAttributeByUniitId")
|
||||
public AjaxResult updateAttributeByUniitId(@RequestBody HwMonitorUnitAttribute hwMonitorUnitAttribute){
|
||||
return AjaxResult.success(hwMonitorUnitAttributeService.updateAttributeByUniitId(hwMonitorUnitAttribute));
|
||||
}
|
||||
|
||||
@DeleteMapping("/deleteAttributeByUniitId/{attributeId}")
|
||||
public AjaxResult deleteAttributeByUniitId(@PathVariable Long attributeId){
|
||||
return AjaxResult.success(hwMonitorUnitAttributeService.deleteAttributeByUniitId(attributeId));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,42 @@
|
||||
package com.ruoyi.business.controller;
|
||||
|
||||
import com.ruoyi.business.domain.HwOfflineRule;
|
||||
import com.ruoyi.business.service.HwOfflineRuleService;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/offlineRule")
|
||||
public class HwOfflineRuleController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private HwOfflineRuleService hwOfflineRuleService;
|
||||
|
||||
@GetMapping("list")
|
||||
public TableDataInfo list(HwOfflineRule hwOfflineRule){
|
||||
startPage();
|
||||
List<HwOfflineRule> hwOfflineRules = hwOfflineRuleService.selectRuleList(hwOfflineRule);
|
||||
return getDataTable(hwOfflineRules);
|
||||
}
|
||||
@GetMapping("/{offlineRuleId}")
|
||||
public HwOfflineRule selectOfflineRuleById(@PathVariable("offlineRuleId") Long offlineRuleId){
|
||||
HwOfflineRule hwOfflineRule = hwOfflineRuleService.selectOfflineRuleById(offlineRuleId);
|
||||
return hwOfflineRule;
|
||||
}
|
||||
|
||||
@DeleteMapping("/{offlineRuleId}")
|
||||
public int deleteOfflineRuleById(@PathVariable("offlineRuleId") Long offlineRuleId){
|
||||
return hwOfflineRuleService.deleteOfflineRuleById(offlineRuleId);
|
||||
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public int addOfflineRule(@RequestBody HwOfflineRule hwOfflineRule){
|
||||
return hwOfflineRuleService.addOfflineRule(hwOfflineRule);
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,131 @@
|
||||
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;
|
||||
|
||||
private String ifAlarm;
|
||||
|
||||
private String monitorUnitName;
|
||||
private Boolean alarmElectronFence;
|
||||
public Boolean getAlarmElectronFence() {
|
||||
return alarmElectronFence;
|
||||
}
|
||||
|
||||
public void setAlarmElectronFence(Boolean alarmElectronFence) {
|
||||
this.alarmElectronFence = alarmElectronFence;
|
||||
}
|
||||
|
||||
public String getIfAlarm() {
|
||||
return ifAlarm;
|
||||
}
|
||||
|
||||
public void setIfAlarm(String ifAlarm) {
|
||||
this.ifAlarm = ifAlarm;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
public String getMonitorUnitName() {
|
||||
return monitorUnitName;
|
||||
}
|
||||
|
||||
public void setMonitorUnitName(String monitorUnitName) {
|
||||
this.monitorUnitName = monitorUnitName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BeaconDevice{" +
|
||||
"deviceId=" + deviceId +
|
||||
", deviceName='" + deviceName + '\'' +
|
||||
", latitude=" + latitude +
|
||||
", longitude=" + longitude +
|
||||
", remark='" + remark + '\'' +
|
||||
", deviceLocation='" + deviceLocation + '\'' +
|
||||
", deviceModeId=" + deviceModeId +
|
||||
", deviceStatus='" + deviceStatus + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,114 @@
|
||||
package com.ruoyi.business.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 监控单元属性表(HwMonitorUnitAttribute)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-09-04 13:20:33
|
||||
*/
|
||||
public class HwMonitorUnitAttribute implements Serializable {
|
||||
private static final long serialVersionUID = -41167481835416588L;
|
||||
/**
|
||||
* 监控单元属性ID
|
||||
*/
|
||||
private Long attributeId;
|
||||
/**
|
||||
* 监控单元ID
|
||||
*/
|
||||
private Long monitorUnitId;
|
||||
/**
|
||||
* 监控单元属性名称
|
||||
*/
|
||||
private String attributeName;
|
||||
/**
|
||||
* 监控单元属性值
|
||||
*/
|
||||
private String attributeValue;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createBy;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private String updateBy;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
public Long getAttributeId() {
|
||||
return attributeId;
|
||||
}
|
||||
|
||||
public void setAttributeId(Long attributeId) {
|
||||
this.attributeId = attributeId;
|
||||
}
|
||||
|
||||
public Long getMonitorUnitId() {
|
||||
return monitorUnitId;
|
||||
}
|
||||
|
||||
public void setMonitorUnitId(Long monitorUnitId) {
|
||||
this.monitorUnitId = monitorUnitId;
|
||||
}
|
||||
|
||||
public String getAttributeName() {
|
||||
return attributeName;
|
||||
}
|
||||
|
||||
public void setAttributeName(String attributeName) {
|
||||
this.attributeName = attributeName;
|
||||
}
|
||||
|
||||
public String getAttributeValue() {
|
||||
return attributeValue;
|
||||
}
|
||||
|
||||
public void setAttributeValue(String attributeValue) {
|
||||
this.attributeValue = attributeValue;
|
||||
}
|
||||
|
||||
public String getCreateBy() {
|
||||
return createBy;
|
||||
}
|
||||
|
||||
public void setCreateBy(String createBy) {
|
||||
this.createBy = createBy;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getUpdateBy() {
|
||||
return updateBy;
|
||||
}
|
||||
|
||||
public void setUpdateBy(String updateBy) {
|
||||
this.updateBy = updateBy;
|
||||
}
|
||||
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,125 @@
|
||||
package com.ruoyi.business.domain.VO;
|
||||
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Email;
|
||||
|
||||
/**
|
||||
* @ClassName : AlarmInfoExportVo
|
||||
* @Description :
|
||||
* @Author :
|
||||
* @Date: 2024-06-14 09:52
|
||||
*/
|
||||
@Data
|
||||
public class AlarmInfoExportVo {
|
||||
@Excel(name = "报警id")
|
||||
private Long alarmInfoId;
|
||||
|
||||
@Excel(name = "报警位置")
|
||||
private String monitorUnitName;
|
||||
|
||||
// @Excel(name = "报警级别名称")
|
||||
// private String alarmLevelName;
|
||||
|
||||
@Excel(name = "报警类型名称")
|
||||
private String alarmTypeName;
|
||||
|
||||
@Excel(name = "报警时间")
|
||||
private String alarmTime;
|
||||
|
||||
@Excel(name = "ID")
|
||||
private String monitorUnitId;
|
||||
|
||||
@Excel(name = "状态")
|
||||
private String monitorUnitStatus;
|
||||
|
||||
@Excel(name = "类型")
|
||||
private String monitorUnitTypeName;
|
||||
|
||||
@Excel(name = "报警区域")
|
||||
private String areaName;
|
||||
|
||||
// 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;
|
||||
// }
|
||||
|
||||
// public String getMonitor_unit_id() {
|
||||
// return monitor_unit_id;
|
||||
// }
|
||||
//
|
||||
// public void setMonitor_unit_id(String monitor_unit_id) {
|
||||
// this.monitor_unit_id = monitor_unit_id;
|
||||
// }
|
||||
//
|
||||
// public String getMonitor_unit_status() {
|
||||
// return monitor_unit_status;
|
||||
// }
|
||||
//
|
||||
// public void setMonitor_unit_status(String monitor_unit_status) {
|
||||
// this.monitor_unit_status = monitor_unit_status;
|
||||
// }
|
||||
//
|
||||
// public String getMonitor_unit_type_name() {
|
||||
// return monitor_unit_type_name;
|
||||
// }
|
||||
//
|
||||
// public void setMonitor_unit_type_name(String monitor_unit_type_name) {
|
||||
// this.monitor_unit_type_name = monitor_unit_type_name;
|
||||
// }
|
||||
|
||||
// @Override
|
||||
// public String toString() {
|
||||
// return "AlarmInfoExportVo{" +
|
||||
// "alarmInfoId=" + alarmInfoId +
|
||||
// ", monitorUnitName='" + monitorUnitName + '\'' +
|
||||
// ", alarmLevelName='" + alarmLevelName + '\'' +
|
||||
// ", alarmTypeName='" + alarmTypeName + '\'' +
|
||||
// ", alarmTime='" + alarmTime + '\'' +
|
||||
// '}';
|
||||
// }
|
||||
}
|
||||
@ -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 +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package com.ruoyi.business.mapper;
|
||||
|
||||
import com.ruoyi.business.domain.HwOfflineRule;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface HwOfflineRuleMapper {
|
||||
|
||||
List<HwOfflineRule> selectHwOfflineRuleJoinList(HwOfflineRule hwOfflineRule);
|
||||
|
||||
|
||||
HwOfflineRule selectOfflineRuleById(Long offlineRuleId);
|
||||
|
||||
int deleteOfflineRuleById(Long offlineRuleId);
|
||||
|
||||
int addOfflineRule(HwOfflineRule hwOfflineRule);
|
||||
}
|
||||
@ -0,0 +1,68 @@
|
||||
package com.ruoyi.business.service;
|
||||
|
||||
|
||||
import com.ruoyi.business.domain.HwMonitorUnitAttribute;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 监控单元属性表(HwMonitorUnitAttribute)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-09-04 13:20:34
|
||||
*/
|
||||
public interface HwMonitorUnitAttributeService {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param attributeId 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
HwMonitorUnitAttribute queryById(Long attributeId);
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param hwMonitorUnitAttribute 筛选条件
|
||||
* @param pageRequest 分页对象
|
||||
* @return 查询结果
|
||||
*/
|
||||
Page<HwMonitorUnitAttribute> queryByPage(HwMonitorUnitAttribute hwMonitorUnitAttribute, PageRequest pageRequest);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param hwMonitorUnitAttribute 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
HwMonitorUnitAttribute insert(HwMonitorUnitAttribute hwMonitorUnitAttribute);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param hwMonitorUnitAttribute 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
HwMonitorUnitAttribute update(HwMonitorUnitAttribute hwMonitorUnitAttribute);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param attributeId 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean deleteById(Long attributeId);
|
||||
|
||||
int addUnitAttribute(HwMonitorUnitAttribute hwMonitorUnitAttribute);
|
||||
|
||||
List<HwMonitorUnitAttribute> selectAttributeByUnitId(Long monitorUnitId);
|
||||
|
||||
int updateAttributeByUniitId(HwMonitorUnitAttribute hwMonitorUnitAttribute);
|
||||
|
||||
int deleteAttributeByUniitId(Long attributeId);
|
||||
|
||||
List<HwMonitorUnitAttribute> selectAttributes(Long unitId);
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package com.ruoyi.business.service;
|
||||
|
||||
import com.ruoyi.business.domain.HwOfflineRule;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface HwOfflineRuleService {
|
||||
List<HwOfflineRule> selectRuleList(HwOfflineRule hwOfflineRule);
|
||||
|
||||
HwOfflineRule selectOfflineRuleById(Long offlineRuleId);
|
||||
|
||||
int deleteOfflineRuleById(Long offlineRuleId);
|
||||
|
||||
int addOfflineRule(HwOfflineRule hwOfflineRule);
|
||||
}
|
||||
@ -0,0 +1,116 @@
|
||||
package com.ruoyi.business.service.impl;
|
||||
|
||||
|
||||
import com.ruoyi.business.domain.HwMonitorUnitAttribute;
|
||||
import com.ruoyi.business.mapper.HwMonitorUnitAttributeDao;
|
||||
import com.ruoyi.business.service.HwMonitorUnitAttributeService;
|
||||
import com.ruoyi.common.security.utils.SecurityUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 监控单元属性表(HwMonitorUnitAttribute)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-09-04 13:20:34
|
||||
*/
|
||||
@Service("hwMonitorUnitAttributeService")
|
||||
public class HwMonitorUnitAttributeServiceImpl implements HwMonitorUnitAttributeService {
|
||||
@Resource
|
||||
private HwMonitorUnitAttributeDao hwMonitorUnitAttributeDao;
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param attributeId 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public HwMonitorUnitAttribute queryById(Long attributeId) {
|
||||
return this.hwMonitorUnitAttributeDao.queryById(attributeId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param hwMonitorUnitAttribute 筛选条件
|
||||
* @param pageRequest 分页对象
|
||||
* @return 查询结果
|
||||
*/
|
||||
@Override
|
||||
public Page<HwMonitorUnitAttribute> queryByPage(HwMonitorUnitAttribute hwMonitorUnitAttribute, PageRequest pageRequest) {
|
||||
long total = this.hwMonitorUnitAttributeDao.count(hwMonitorUnitAttribute);
|
||||
return new PageImpl<>(this.hwMonitorUnitAttributeDao.queryAllByLimit(hwMonitorUnitAttribute, pageRequest), pageRequest, total);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param hwMonitorUnitAttribute 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public HwMonitorUnitAttribute insert(HwMonitorUnitAttribute hwMonitorUnitAttribute) {
|
||||
this.hwMonitorUnitAttributeDao.insert(hwMonitorUnitAttribute);
|
||||
return hwMonitorUnitAttribute;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param hwMonitorUnitAttribute 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public HwMonitorUnitAttribute update(HwMonitorUnitAttribute hwMonitorUnitAttribute) {
|
||||
this.hwMonitorUnitAttributeDao.update(hwMonitorUnitAttribute);
|
||||
return this.queryById(hwMonitorUnitAttribute.getAttributeId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param attributeId 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteById(Long attributeId) {
|
||||
return this.hwMonitorUnitAttributeDao.deleteById(attributeId) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int addUnitAttribute(HwMonitorUnitAttribute hwMonitorUnitAttribute) {
|
||||
hwMonitorUnitAttribute.setCreateBy(SecurityUtils.getUsername());
|
||||
hwMonitorUnitAttribute.setCreateTime(new Date());
|
||||
return hwMonitorUnitAttributeDao.insert(hwMonitorUnitAttribute);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HwMonitorUnitAttribute> selectAttributeByUnitId(Long monitorUnitId) {
|
||||
return hwMonitorUnitAttributeDao.selectAttributeByUnitId(monitorUnitId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateAttributeByUniitId(HwMonitorUnitAttribute hwMonitorUnitAttribute) {
|
||||
return hwMonitorUnitAttributeDao.updateAttributeByUniitId(hwMonitorUnitAttribute);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HwMonitorUnitAttribute> selectAttributes(Long aLong) {
|
||||
return hwMonitorUnitAttributeDao.selectAttributes(aLong);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteAttributeByUniitId(Long unitId) {
|
||||
return hwMonitorUnitAttributeDao.deleteAttributeByUniitId(unitId);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package com.ruoyi.business.service.impl;
|
||||
|
||||
import com.ruoyi.business.domain.HwOfflineRule;
|
||||
import com.ruoyi.business.mapper.HwOfflineRuleMapper;
|
||||
import com.ruoyi.business.service.HwOfflineRuleService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
@Service
|
||||
public class HwOfflineRuleServiceImpl implements HwOfflineRuleService {
|
||||
@Autowired
|
||||
private HwOfflineRuleMapper hwOfflineRuleMapper;
|
||||
@Override
|
||||
public List<HwOfflineRule> selectRuleList(HwOfflineRule hwOfflineRule) {
|
||||
List<HwOfflineRule> hwOfflineRules = hwOfflineRuleMapper.selectHwOfflineRuleJoinList(hwOfflineRule);
|
||||
return hwOfflineRules;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HwOfflineRule selectOfflineRuleById(Long offlineRuleId) {
|
||||
return hwOfflineRuleMapper.selectOfflineRuleById(offlineRuleId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteOfflineRuleById(Long offlineRuleId) {
|
||||
return hwOfflineRuleMapper.deleteOfflineRuleById(offlineRuleId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int addOfflineRule(HwOfflineRule hwOfflineRule) {
|
||||
return hwOfflineRuleMapper.addOfflineRule(hwOfflineRule);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,89 @@
|
||||
package com.ruoyi.business.utils;
|
||||
|
||||
import com.ruoyi.business.mapper.HwAlarmInfoMapper;
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
|
||||
public class UnitExcelUtils {
|
||||
@Autowired
|
||||
private HwAlarmInfoMapper hwAlarmInfoMapper;
|
||||
|
||||
public void exportAlarmInfos(HttpServletResponse response, HashMap<String, List<LinkedHashMap>> map) throws IOException {
|
||||
Workbook bk = new XSSFWorkbook();
|
||||
for (String aLong : map.keySet()) {
|
||||
List<LinkedHashMap> list3 = map.get(aLong);
|
||||
Sheet unitId = bk.createSheet(aLong);
|
||||
int row = 0;
|
||||
for (row = 0;row < list3.size();row++){
|
||||
if (row == 0){
|
||||
LinkedHashMap map1 = list3.get(row);
|
||||
ArrayList list1 = new ArrayList<>(map1.keySet());
|
||||
int size = map1.keySet().size();
|
||||
int cellIndex = 0;
|
||||
Row row1 = unitId.createRow(row);
|
||||
Row row2 = unitId.createRow(1);
|
||||
for (cellIndex = 0;cellIndex < size;cellIndex++){
|
||||
String key = list1.get(cellIndex).toString();
|
||||
row1.createCell(cellIndex).setCellValue(key);
|
||||
Object value = map1.get(key);
|
||||
if (value instanceof String){
|
||||
row2.createCell(cellIndex).setCellValue((String) map1.get(key));
|
||||
}else if (value instanceof Long){
|
||||
row2.createCell(cellIndex).setCellValue((Long) map1.get(key));
|
||||
}else if(value instanceof Date){
|
||||
row2.createCell(cellIndex).setCellValue((Date) map1.get(key));
|
||||
}else {
|
||||
row2.createCell(cellIndex).setCellValue("");
|
||||
}
|
||||
}
|
||||
|
||||
}else {
|
||||
LinkedHashMap map1 = list3.get(row);
|
||||
ArrayList list1 = new ArrayList<>(map1.keySet());
|
||||
int size = map1.keySet().size();
|
||||
int cellIndex = 0;
|
||||
Row row1 = unitId.createRow(row+1);
|
||||
for (cellIndex = 0;cellIndex < size;cellIndex++){
|
||||
String key = list1.get(cellIndex).toString();
|
||||
Object value = map1.get(key);
|
||||
if (value instanceof String){
|
||||
row1.createCell(cellIndex).setCellValue((String) map1.get(key));
|
||||
}else if (value instanceof Long){
|
||||
row1.createCell(cellIndex).setCellValue((Long) map1.get(key));
|
||||
}
|
||||
else if(value instanceof Date){
|
||||
row1.createCell(cellIndex).setCellValue((Date) map1.get(key));
|
||||
}
|
||||
else {
|
||||
row1.createCell(cellIndex).setCellValue("");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
// FileOutputStream stream = new FileOutputStream("告警信息");
|
||||
bk.write(response.getOutputStream());
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
bk.close();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,193 @@
|
||||
<?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.ruoyi.business.mapper.HwMonitorUnitAttributeDao">
|
||||
|
||||
<resultMap type="com.ruoyi.business.domain.HwMonitorUnitAttribute" id="HwMonitorUnitAttributeMap">
|
||||
<result property="attributeId" column="attribute_id" jdbcType="INTEGER"/>
|
||||
<result property="monitorUnitId" column="monitor_unit_id" jdbcType="INTEGER"/>
|
||||
<result property="attributeName" column="attribute_name" jdbcType="VARCHAR"/>
|
||||
<result property="attributeValue" column="attribute_value" jdbcType="VARCHAR"/>
|
||||
<result property="createBy" column="create_by" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<!--查询单个-->
|
||||
<select id="queryById" resultMap="HwMonitorUnitAttributeMap">
|
||||
select
|
||||
attribute_id, monitor_unit_id, attribute_name, attribute_value, create_by, create_time, update_by, update_time
|
||||
from hw_monitor_unit_attribute
|
||||
where attribute_id = #{attributeId}
|
||||
</select>
|
||||
|
||||
<!--查询指定行数据-->
|
||||
<select id="queryAllByLimit" resultMap="HwMonitorUnitAttributeMap">
|
||||
select
|
||||
attribute_id, monitor_unit_id, attribute_name, attribute_value, create_by, create_time, update_by, update_time
|
||||
from hw_monitor_unit_attribute
|
||||
<where>
|
||||
<if test="attributeId != null">
|
||||
and attribute_id = #{attributeId}
|
||||
</if>
|
||||
<if test="monitorUnitId != null">
|
||||
and monitor_unit_id = #{monitorUnitId}
|
||||
</if>
|
||||
<if test="attributeName != null and attributeName != ''">
|
||||
and attribute_name = #{attributeName}
|
||||
</if>
|
||||
<if test="attributeValue != null and attributeValue != ''">
|
||||
and attribute_value = #{attributeValue}
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
and create_by = #{createBy}
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
and create_time = #{createTime}
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
and update_by = #{updateBy}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
and update_time = #{updateTime}
|
||||
</if>
|
||||
</where>
|
||||
limit #{pageable.offset}, #{pageable.pageSize}
|
||||
</select>
|
||||
|
||||
<!--统计总行数-->
|
||||
<select id="count" resultType="java.lang.Long">
|
||||
select count(1)
|
||||
from hw_monitor_unit_attribute
|
||||
<where>
|
||||
<if test="attributeId != null">
|
||||
and attribute_id = #{attributeId}
|
||||
</if>
|
||||
<if test="monitorUnitId != null">
|
||||
and monitor_unit_id = #{monitorUnitId}
|
||||
</if>
|
||||
<if test="attributeName != null and attributeName != ''">
|
||||
and attribute_name = #{attributeName}
|
||||
</if>
|
||||
<if test="attributeValue != null and attributeValue != ''">
|
||||
and attribute_value = #{attributeValue}
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
and create_by = #{createBy}
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
and create_time = #{createTime}
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
and update_by = #{updateBy}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
and update_time = #{updateTime}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectAttributeByUnitId" resultType="com.ruoyi.business.domain.HwMonitorUnitAttribute"
|
||||
parameterType="java.lang.Long">
|
||||
select * from hw_monitor_unit_attribute where monitor_unit_id = #{monitorUnitId}
|
||||
</select>
|
||||
<select id="selectAttributes" resultType="com.ruoyi.business.domain.HwMonitorUnitAttribute"
|
||||
parameterType="java.lang.Long">
|
||||
select * from hw_monitor_unit_attribute where monitor_unit_id = #{unitId}
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="attributeId" useGeneratedKeys="true">
|
||||
insert into hw_monitor_unit_attribute(monitor_unit_id, attribute_name, attribute_value, create_by, create_time, update_by, update_time)
|
||||
values (#{monitorUnitId}, #{attributeName}, #{attributeValue}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="attributeId" useGeneratedKeys="true">
|
||||
insert into hw_monitor_unit_attribute(monitor_unit_id, attribute_name, attribute_value, create_by, create_time, update_by, update_time)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.monitorUnitId}, #{entity.attributeName}, #{entity.attributeValue}, #{entity.createBy}, #{entity.createTime}, #{entity.updateBy}, #{entity.updateTime})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<insert id="insertOrUpdateBatch" keyProperty="attributeId" useGeneratedKeys="true">
|
||||
insert into hw_monitor_unit_attribute(monitor_unit_id, attribute_name, attribute_value, create_by, create_time, update_by, update_time)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.monitorUnitId}, #{entity.attributeName}, #{entity.attributeValue}, #{entity.createBy}, #{entity.createTime}, #{entity.updateBy}, #{entity.updateTime})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
monitor_unit_id = values(monitor_unit_id),
|
||||
attribute_name = values(attribute_name),
|
||||
attribute_value = values(attribute_value),
|
||||
create_by = values(create_by),
|
||||
create_time = values(create_time),
|
||||
update_by = values(update_by),
|
||||
update_time = values(update_time)
|
||||
</insert>
|
||||
|
||||
<!--通过主键修改数据-->
|
||||
<update id="update">
|
||||
update hw_monitor_unit_attribute
|
||||
<set>
|
||||
<if test="monitorUnitId != null">
|
||||
monitor_unit_id = #{monitorUnitId},
|
||||
</if>
|
||||
<if test="attributeName != null and attributeName != ''">
|
||||
attribute_name = #{attributeName},
|
||||
</if>
|
||||
<if test="attributeValue != null and attributeValue != ''">
|
||||
attribute_value = #{attributeValue},
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
create_by = #{createBy},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime},
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
update_by = #{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime},
|
||||
</if>
|
||||
</set>
|
||||
where attribute_id = #{attributeId}
|
||||
</update>
|
||||
<update id="updateAttributeByUniitId" parameterType="com.ruoyi.business.domain.HwMonitorUnitAttribute">
|
||||
update hw_monitor_unit_attribute
|
||||
<set>
|
||||
<if test="monitorUnitId != null">
|
||||
monitor_unit_id = #{monitorUnitId},
|
||||
</if>
|
||||
<if test="attributeName != null and attributeName != ''">
|
||||
attribute_name = #{attributeName},
|
||||
</if>
|
||||
<if test="attributeValue != null and attributeValue != ''">
|
||||
attribute_value = #{attributeValue},
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
create_by = #{createBy},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime},
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
update_by = #{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime},
|
||||
</if>
|
||||
</set>
|
||||
where attribute_id = #{attributeId}
|
||||
</update>
|
||||
|
||||
<!--通过主键删除-->
|
||||
<delete id="deleteById">
|
||||
delete from hw_monitor_unit_attribute where attribute_id = #{attributeId}
|
||||
</delete>
|
||||
<delete id="deleteAttributeByUniitId" parameterType="java.lang.Long">
|
||||
delete from hw_monitor_unit_attribute where attribute_id = #{attributeId}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
||||
@ -0,0 +1,34 @@
|
||||
package com.ruoyi.dataprocess.domain;
|
||||
|
||||
|
||||
public class AlarmMsgTemplateParam {
|
||||
private String parentname;
|
||||
|
||||
private String sensorID;
|
||||
|
||||
private String warning;
|
||||
|
||||
public String getParentname() {
|
||||
return parentname;
|
||||
}
|
||||
|
||||
public void setParentname(String parentname) {
|
||||
this.parentname = parentname;
|
||||
}
|
||||
|
||||
public String getSensorID() {
|
||||
return sensorID;
|
||||
}
|
||||
|
||||
public void setSensorID(String sensorID) {
|
||||
this.sensorID = sensorID;
|
||||
}
|
||||
|
||||
public String getWarning() {
|
||||
return warning;
|
||||
}
|
||||
|
||||
public void setWarning(String warning) {
|
||||
this.warning = warning;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue