Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gassafety
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
耿迪迪
gassafety
Commits
e04b77c3
Commit
e04b77c3
authored
Aug 06, 2021
by
王晓倩
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
68ff9026
ac7f0330
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
1281 additions
and
64 deletions
+1281
-64
TDeviceAlarmController.java
...web/controller/dataMonitoring/TDeviceAlarmController.java
+9
-0
TMonitorDeviceController.java
...ehong/web/controller/device/TMonitorDeviceController.java
+135
-0
WebSocketController.java
.../zehong/web/controller/websocket/WebSocketController.java
+15
-15
TMonitorDevice.java
...rc/main/java/com/zehong/system/domain/TMonitorDevice.java
+154
-0
RelationTMonitorDevice.java
...com/zehong/system/domain/form/RelationTMonitorDevice.java
+50
-0
TMonitorDeviceFrom.java
...ava/com/zehong/system/domain/form/TMonitorDeviceFrom.java
+38
-0
TDeviceAlarmMapper.java
...ain/java/com/zehong/system/mapper/TDeviceAlarmMapper.java
+6
-0
TMonitorDeviceMapper.java
...n/java/com/zehong/system/mapper/TMonitorDeviceMapper.java
+61
-0
ITDeviceAlarmService.java
.../java/com/zehong/system/service/ITDeviceAlarmService.java
+6
-0
ITMonitorDeviceService.java
...ava/com/zehong/system/service/ITMonitorDeviceService.java
+61
-0
TDeviceAlarmServiceImpl.java
...m/zehong/system/service/impl/TDeviceAlarmServiceImpl.java
+9
-0
TMonitorDeviceServiceImpl.java
...zehong/system/service/impl/TMonitorDeviceServiceImpl.java
+96
-0
TDeviceAlarmMapper.xml
...m/src/main/resources/mapper/system/TDeviceAlarmMapper.xml
+20
-0
TMonitorDeviceMapper.xml
...src/main/resources/mapper/system/TMonitorDeviceMapper.xml
+89
-0
deviceAlarm.js
gassafety-web/src/api/dataMonitoring/deviceAlarm.js
+12
-1
deviceMonitor.js
gassafety-web/src/api/device/deviceMonitor.js
+61
-0
index.vue
gassafety-web/src/views/device/devicemonitor/index.vue
+459
-48
No files found.
gassafety-admin/src/main/java/com/zehong/web/controller/dataMonitoring/TDeviceAlarmController.java
View file @
e04b77c3
...
...
@@ -102,4 +102,13 @@ public class TDeviceAlarmController extends BaseController
{
return
toAjax
(
tDeviceAlarmService
.
deleteTDeviceAlarmByIds
(
alarmIds
));
}
/**
* 查询报警设备
* @return TDeviceAlarm
*/
@GetMapping
(
"selectAlarmDevice"
)
public
List
<
TDeviceAlarm
>
selectAlarmDevice
(){
return
tDeviceAlarmService
.
selectAlarmDevice
();
}
}
gassafety-admin/src/main/java/com/zehong/web/controller/device/TMonitorDeviceController.java
0 → 100644
View file @
e04b77c3
package
com
.
zehong
.
web
.
controller
.
device
;
import
java.util.List
;
import
com.zehong.system.domain.form.RelationTMonitorDevice
;
import
com.zehong.system.domain.form.TMonitorDeviceFrom
;
import
com.zehong.system.service.ITDeviceInfoService
;
import
com.zehong.system.service.impl.TPipeServiceImpl
;
import
org.springframework.security.access.prepost.PreAuthorize
;
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.zehong.common.annotation.Log
;
import
com.zehong.common.core.controller.BaseController
;
import
com.zehong.common.core.domain.AjaxResult
;
import
com.zehong.common.enums.BusinessType
;
import
com.zehong.system.domain.TMonitorDevice
;
import
com.zehong.system.service.ITMonitorDeviceService
;
import
com.zehong.common.utils.poi.ExcelUtil
;
import
com.zehong.common.core.page.TableDataInfo
;
/**
* 设备监控Controller
*
* @author zehong
* @date 2021-08-05
*/
@RestController
@RequestMapping
(
"/system/device"
)
public
class
TMonitorDeviceController
extends
BaseController
{
@Autowired
private
ITMonitorDeviceService
tMonitorDeviceService
;
@Autowired
private
ITDeviceInfoService
itDeviceInfoService
;
@Autowired
private
TPipeServiceImpl
tPipeService
;
/**
* 查询设备监控列表
*/
@PreAuthorize
(
"@ss.hasPermi('system:device:list')"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
TMonitorDevice
tMonitorDevice
)
{
startPage
();
List
<
TMonitorDevice
>
list
=
tMonitorDeviceService
.
selectTMonitorDeviceList
(
tMonitorDevice
);
for
(
TMonitorDevice
device:
list
){
device
.
setDeviceName
(
itDeviceInfoService
.
selectTDeviceInfoById
(
device
.
getDeviceId
().
intValue
()).
getDeviceName
());
device
.
setRelationDeviceName
(
itDeviceInfoService
.
selectTDeviceInfoById
(
device
.
getRelationDeviceId
().
intValue
()).
getDeviceName
());
device
.
setRelationPipeName
(
tPipeService
.
selectTPipeById
(
device
.
getRelationPipeId
().
intValue
()).
getPipeName
());
}
return
getDataTable
(
list
);
}
/**
* 导出设备监控列表
*/
@PreAuthorize
(
"@ss.hasPermi('system:device:export')"
)
@Log
(
title
=
"设备监控"
,
businessType
=
BusinessType
.
EXPORT
)
@GetMapping
(
"/export"
)
public
AjaxResult
export
(
TMonitorDevice
tMonitorDevice
)
{
List
<
TMonitorDevice
>
list
=
tMonitorDeviceService
.
selectTMonitorDeviceList
(
tMonitorDevice
);
ExcelUtil
<
TMonitorDevice
>
util
=
new
ExcelUtil
<
TMonitorDevice
>(
TMonitorDevice
.
class
);
return
util
.
exportExcel
(
list
,
"设备监控数据"
);
}
/**
* 获取设备监控详细信息
*/
@PreAuthorize
(
"@ss.hasPermi('system:device:query')"
)
@GetMapping
(
value
=
"/{monitorId}"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"monitorId"
)
Long
monitorId
)
{
return
AjaxResult
.
success
(
tMonitorDeviceService
.
selectTMonitorDeviceById
(
monitorId
));
}
/**
* 新增设备监控
*/
@PreAuthorize
(
"@ss.hasPermi('system:device:add')"
)
@Log
(
title
=
"设备监控"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
public
AjaxResult
add
(
@RequestBody
TMonitorDevice
tMonitorDevice
)
{
return
toAjax
(
tMonitorDeviceService
.
insertTMonitorDevice
(
tMonitorDevice
));
}
@PostMapping
(
"/batchAdd"
)
public
AjaxResult
batchAdd
(
@RequestBody
TMonitorDeviceFrom
tMonitorDeviceFrom
){
for
(
RelationTMonitorDevice
relationTMonitorDevice
:
tMonitorDeviceFrom
.
getRelationDevices
()){
TMonitorDevice
tMonitorDevice
=
new
TMonitorDevice
();
tMonitorDevice
.
setDeviceId
(
tMonitorDeviceFrom
.
getDeviceId
());
tMonitorDevice
.
setDeviceThreshold
(
tMonitorDeviceFrom
.
getDeviceThreshold
());
tMonitorDevice
.
setRelationDeviceId
(
relationTMonitorDevice
.
getRelationDeviceId
());
tMonitorDevice
.
setRelationDeviceThreshold
(
relationTMonitorDevice
.
getRelationDeviceThreshold
());
tMonitorDevice
.
setRelationPipeId
(
relationTMonitorDevice
.
getRelationPipeId
());
tMonitorDevice
.
setRelationPipeThreshold
(
relationTMonitorDevice
.
getRelationPipeThreshold
());
tMonitorDeviceService
.
insertTMonitorDevice
(
tMonitorDevice
);
}
return
AjaxResult
.
success
();
}
/**
* 修改设备监控
*/
@PreAuthorize
(
"@ss.hasPermi('system:device:edit')"
)
@Log
(
title
=
"设备监控"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
public
AjaxResult
edit
(
@RequestBody
TMonitorDevice
tMonitorDevice
)
{
return
toAjax
(
tMonitorDeviceService
.
updateTMonitorDevice
(
tMonitorDevice
));
}
/**
* 删除设备监控
*/
@PreAuthorize
(
"@ss.hasPermi('system:device:remove')"
)
@Log
(
title
=
"设备监控"
,
businessType
=
BusinessType
.
DELETE
)
@DeleteMapping
(
"/{monitorIds}"
)
public
AjaxResult
remove
(
@PathVariable
Long
[]
monitorIds
)
{
return
toAjax
(
tMonitorDeviceService
.
deleteTMonitorDeviceByIds
(
monitorIds
));
}
}
gassafety-admin/src/main/java/com/zehong/web/controller/websocket/WebSocketController.java
View file @
e04b77c3
package
com
.
zehong
.
web
.
controller
.
websocket
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.zehong.system.domain.TDeviceAlarm
;
import
com.zehong.system.domain.vo.DeviceAlarmVo
;
import
com.zehong.system.service.ITDeviceAlarmService
;
import
com.zehong.system.service.ITDeviceInfoService
;
import
com.zehong.system.service.ITPipeService
;
import
com.zehong.system.service.WebSocketServer
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
@RestController
@RequestMapping
(
"/websocket"
)
public
class
WebSocketController
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
WebSocketController
.
class
);
@Autowired
private
WebSocketServer
webSocketServer
;
...
...
@@ -35,12 +35,8 @@ public class WebSocketController {
@GetMapping
(
"/send"
)
public
void
send
(
int
alarmId
){
DeviceAlarmVo
alarm
=
null
;
try
{
alarm
=
itDeviceAlarmService
.
selectTDeviceAlarmById
(
alarmId
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
DeviceAlarmVo
alarm
=
itDeviceAlarmService
.
selectTDeviceAlarmById
(
alarmId
);
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"alarmInfo"
,
alarm
);
if
(
PIPE_TYPE
.
equals
(
alarm
.
getAlarmType
())){
...
...
@@ -49,5 +45,9 @@ public class WebSocketController {
json
.
put
(
"deviceInfo"
,
itDeviceInfoService
.
selectTDeviceInfoById
(
alarm
.
getDeviceId
()));
}
webSocketServer
.
batchSendMessage
(
alarm
.
toString
());
}
catch
(
Exception
e
)
{
log
.
error
(
"wesocket发送失败!"
);
}
}
}
gassafety-system/src/main/java/com/zehong/system/domain/TMonitorDevice.java
0 → 100644
View file @
e04b77c3
package
com
.
zehong
.
system
.
domain
;
import
java.math.BigDecimal
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
com.zehong.common.annotation.Excel
;
import
com.zehong.common.core.domain.BaseEntity
;
/**
* 设备监控对象 t_monitor_device
*
* @author zehong
* @date 2021-08-05
*/
public
class
TMonitorDevice
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/** 设备监控id */
private
Long
monitorId
;
/** 设备id */
@Excel
(
name
=
"设备id"
)
private
Long
deviceId
;
/** 设备阈值 */
@Excel
(
name
=
"设备阈值"
)
private
BigDecimal
deviceThreshold
;
/** 关联管道id */
@Excel
(
name
=
"关联管道id"
)
private
Long
relationPipeId
;
/** 关联管道阈值 */
@Excel
(
name
=
"关联管道阈值"
)
private
BigDecimal
relationPipeThreshold
;
/** 关联设备id */
@Excel
(
name
=
"关联设备id"
)
private
Long
relationDeviceId
;
/** 关联设备阈值 */
@Excel
(
name
=
"关联设备阈值"
)
private
BigDecimal
relationDeviceThreshold
;
private
String
relationPipeName
;
private
String
deviceName
;
private
String
relationDeviceName
;
public
String
getRelationPipeName
()
{
return
relationPipeName
;
}
public
void
setRelationPipeName
(
String
relationPipeName
)
{
this
.
relationPipeName
=
relationPipeName
;
}
public
String
getDeviceName
()
{
return
deviceName
;
}
public
void
setDeviceName
(
String
deviceName
)
{
this
.
deviceName
=
deviceName
;
}
public
String
getRelationDeviceName
()
{
return
relationDeviceName
;
}
public
void
setRelationDeviceName
(
String
relationDeviceName
)
{
this
.
relationDeviceName
=
relationDeviceName
;
}
public
void
setMonitorId
(
Long
monitorId
)
{
this
.
monitorId
=
monitorId
;
}
public
Long
getMonitorId
()
{
return
monitorId
;
}
public
void
setDeviceId
(
Long
deviceId
)
{
this
.
deviceId
=
deviceId
;
}
public
Long
getDeviceId
()
{
return
deviceId
;
}
public
void
setDeviceThreshold
(
BigDecimal
deviceThreshold
)
{
this
.
deviceThreshold
=
deviceThreshold
;
}
public
BigDecimal
getDeviceThreshold
()
{
return
deviceThreshold
;
}
public
void
setRelationPipeId
(
Long
relationPipeId
)
{
this
.
relationPipeId
=
relationPipeId
;
}
public
Long
getRelationPipeId
()
{
return
relationPipeId
;
}
public
void
setRelationPipeThreshold
(
BigDecimal
relationPipeThreshold
)
{
this
.
relationPipeThreshold
=
relationPipeThreshold
;
}
public
BigDecimal
getRelationPipeThreshold
()
{
return
relationPipeThreshold
;
}
public
void
setRelationDeviceId
(
Long
relationDeviceId
)
{
this
.
relationDeviceId
=
relationDeviceId
;
}
public
Long
getRelationDeviceId
()
{
return
relationDeviceId
;
}
public
void
setRelationDeviceThreshold
(
BigDecimal
relationDeviceThreshold
)
{
this
.
relationDeviceThreshold
=
relationDeviceThreshold
;
}
public
BigDecimal
getRelationDeviceThreshold
()
{
return
relationDeviceThreshold
;
}
@Override
public
String
toString
()
{
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
)
.
append
(
"monitorId"
,
getMonitorId
())
.
append
(
"deviceId"
,
getDeviceId
())
.
append
(
"deviceThreshold"
,
getDeviceThreshold
())
.
append
(
"relationPipeId"
,
getRelationPipeId
())
.
append
(
"relationPipeThreshold"
,
getRelationPipeThreshold
())
.
append
(
"relationDeviceId"
,
getRelationDeviceId
())
.
append
(
"relationDeviceThreshold"
,
getRelationDeviceThreshold
())
.
append
(
"createTime"
,
getCreateTime
())
.
append
(
"updateTime"
,
getUpdateTime
())
.
toString
();
}
}
gassafety-system/src/main/java/com/zehong/system/domain/form/RelationTMonitorDevice.java
0 → 100644
View file @
e04b77c3
package
com
.
zehong
.
system
.
domain
.
form
;
import
java.math.BigDecimal
;
public
class
RelationTMonitorDevice
{
/** 关联管道id */
private
Long
relationPipeId
;
/** 关联管道阈值 */
private
BigDecimal
relationPipeThreshold
;
/** 关联设备id */
private
Long
relationDeviceId
;
/** 关联设备阈值 */
private
BigDecimal
relationDeviceThreshold
;
public
Long
getRelationPipeId
()
{
return
relationPipeId
;
}
public
void
setRelationPipeId
(
Long
relationPipeId
)
{
this
.
relationPipeId
=
relationPipeId
;
}
public
BigDecimal
getRelationPipeThreshold
()
{
return
relationPipeThreshold
;
}
public
void
setRelationPipeThreshold
(
BigDecimal
relationPipeThreshold
)
{
this
.
relationPipeThreshold
=
relationPipeThreshold
;
}
public
Long
getRelationDeviceId
()
{
return
relationDeviceId
;
}
public
void
setRelationDeviceId
(
Long
relationDeviceId
)
{
this
.
relationDeviceId
=
relationDeviceId
;
}
public
BigDecimal
getRelationDeviceThreshold
()
{
return
relationDeviceThreshold
;
}
public
void
setRelationDeviceThreshold
(
BigDecimal
relationDeviceThreshold
)
{
this
.
relationDeviceThreshold
=
relationDeviceThreshold
;
}
}
gassafety-system/src/main/java/com/zehong/system/domain/form/TMonitorDeviceFrom.java
0 → 100644
View file @
e04b77c3
package
com
.
zehong
.
system
.
domain
.
form
;
import
java.math.BigDecimal
;
import
java.util.List
;
public
class
TMonitorDeviceFrom
{
/** 设备id */
private
Long
deviceId
;
/** 设备阈值 */
private
BigDecimal
deviceThreshold
;
private
List
<
RelationTMonitorDevice
>
relationDevices
;
public
Long
getDeviceId
()
{
return
deviceId
;
}
public
void
setDeviceId
(
Long
deviceId
)
{
this
.
deviceId
=
deviceId
;
}
public
BigDecimal
getDeviceThreshold
()
{
return
deviceThreshold
;
}
public
void
setDeviceThreshold
(
BigDecimal
deviceThreshold
)
{
this
.
deviceThreshold
=
deviceThreshold
;
}
public
List
<
RelationTMonitorDevice
>
getRelationDevices
()
{
return
relationDevices
;
}
public
void
setRelationDevices
(
List
<
RelationTMonitorDevice
>
relationDevices
)
{
this
.
relationDevices
=
relationDevices
;
}
}
gassafety-system/src/main/java/com/zehong/system/mapper/TDeviceAlarmMapper.java
View file @
e04b77c3
...
...
@@ -58,4 +58,10 @@ public interface TDeviceAlarmMapper
* @return 结果
*/
public
int
deleteTDeviceAlarmByIds
(
int
[]
alarmIds
);
/**
* 查询报警设备
* @return TDeviceAlarm
*/
List
<
TDeviceAlarm
>
selectAlarmDevice
();
}
gassafety-system/src/main/java/com/zehong/system/mapper/TMonitorDeviceMapper.java
0 → 100644
View file @
e04b77c3
package
com
.
zehong
.
system
.
mapper
;
import
java.util.List
;
import
com.zehong.system.domain.TMonitorDevice
;
/**
* 设备监控Mapper接口
*
* @author zehong
* @date 2021-08-05
*/
public
interface
TMonitorDeviceMapper
{
/**
* 查询设备监控
*
* @param monitorId 设备监控ID
* @return 设备监控
*/
public
TMonitorDevice
selectTMonitorDeviceById
(
Long
monitorId
);
/**
* 查询设备监控列表
*
* @param tMonitorDevice 设备监控
* @return 设备监控集合
*/
public
List
<
TMonitorDevice
>
selectTMonitorDeviceList
(
TMonitorDevice
tMonitorDevice
);
/**
* 新增设备监控
*
* @param tMonitorDevice 设备监控
* @return 结果
*/
public
int
insertTMonitorDevice
(
TMonitorDevice
tMonitorDevice
);
/**
* 修改设备监控
*
* @param tMonitorDevice 设备监控
* @return 结果
*/
public
int
updateTMonitorDevice
(
TMonitorDevice
tMonitorDevice
);
/**
* 删除设备监控
*
* @param monitorId 设备监控ID
* @return 结果
*/
public
int
deleteTMonitorDeviceById
(
Long
monitorId
);
/**
* 批量删除设备监控
*
* @param monitorIds 需要删除的数据ID
* @return 结果
*/
public
int
deleteTMonitorDeviceByIds
(
Long
[]
monitorIds
);
}
gassafety-system/src/main/java/com/zehong/system/service/ITDeviceAlarmService.java
View file @
e04b77c3
...
...
@@ -59,4 +59,10 @@ public interface ITDeviceAlarmService
* @return 结果
*/
public
int
deleteTDeviceAlarmById
(
int
alarmId
);
/**
* 查询报警设备
* @return TDeviceAlarm
*/
List
<
TDeviceAlarm
>
selectAlarmDevice
();
}
gassafety-system/src/main/java/com/zehong/system/service/ITMonitorDeviceService.java
0 → 100644
View file @
e04b77c3
package
com
.
zehong
.
system
.
service
;
import
java.util.List
;
import
com.zehong.system.domain.TMonitorDevice
;
/**
* 设备监控Service接口
*
* @author zehong
* @date 2021-08-05
*/
public
interface
ITMonitorDeviceService
{
/**
* 查询设备监控
*
* @param monitorId 设备监控ID
* @return 设备监控
*/
public
TMonitorDevice
selectTMonitorDeviceById
(
Long
monitorId
);
/**
* 查询设备监控列表
*
* @param tMonitorDevice 设备监控
* @return 设备监控集合
*/
public
List
<
TMonitorDevice
>
selectTMonitorDeviceList
(
TMonitorDevice
tMonitorDevice
);
/**
* 新增设备监控
*
* @param tMonitorDevice 设备监控
* @return 结果
*/
public
int
insertTMonitorDevice
(
TMonitorDevice
tMonitorDevice
);
/**
* 修改设备监控
*
* @param tMonitorDevice 设备监控
* @return 结果
*/
public
int
updateTMonitorDevice
(
TMonitorDevice
tMonitorDevice
);
/**
* 批量删除设备监控
*
* @param monitorIds 需要删除的设备监控ID
* @return 结果
*/
public
int
deleteTMonitorDeviceByIds
(
Long
[]
monitorIds
);
/**
* 删除设备监控信息
*
* @param monitorId 设备监控ID
* @return 结果
*/
public
int
deleteTMonitorDeviceById
(
Long
monitorId
);
}
gassafety-system/src/main/java/com/zehong/system/service/impl/TDeviceAlarmServiceImpl.java
View file @
e04b77c3
...
...
@@ -143,4 +143,13 @@ public class TDeviceAlarmServiceImpl implements ITDeviceAlarmService
{
return
tDeviceAlarmMapper
.
deleteTDeviceAlarmById
(
alarmId
);
}
/**
* 查询报警设备
* @return TDeviceAlarm
*/
@Override
public
List
<
TDeviceAlarm
>
selectAlarmDevice
(){
return
tDeviceAlarmMapper
.
selectAlarmDevice
();
}
}
gassafety-system/src/main/java/com/zehong/system/service/impl/TMonitorDeviceServiceImpl.java
0 → 100644
View file @
e04b77c3
package
com
.
zehong
.
system
.
service
.
impl
;
import
java.util.List
;
import
com.zehong.common.utils.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.zehong.system.mapper.TMonitorDeviceMapper
;
import
com.zehong.system.domain.TMonitorDevice
;
import
com.zehong.system.service.ITMonitorDeviceService
;
/**
* 设备监控Service业务层处理
*
* @author zehong
* @date 2021-08-05
*/
@Service
public
class
TMonitorDeviceServiceImpl
implements
ITMonitorDeviceService
{
@Autowired
private
TMonitorDeviceMapper
tMonitorDeviceMapper
;
/**
* 查询设备监控
*
* @param monitorId 设备监控ID
* @return 设备监控
*/
@Override
public
TMonitorDevice
selectTMonitorDeviceById
(
Long
monitorId
)
{
return
tMonitorDeviceMapper
.
selectTMonitorDeviceById
(
monitorId
);
}
/**
* 查询设备监控列表
*
* @param tMonitorDevice 设备监控
* @return 设备监控
*/
@Override
public
List
<
TMonitorDevice
>
selectTMonitorDeviceList
(
TMonitorDevice
tMonitorDevice
)
{
return
tMonitorDeviceMapper
.
selectTMonitorDeviceList
(
tMonitorDevice
);
}
/**
* 新增设备监控
*
* @param tMonitorDevice 设备监控
* @return 结果
*/
@Override
public
int
insertTMonitorDevice
(
TMonitorDevice
tMonitorDevice
)
{
tMonitorDevice
.
setCreateTime
(
DateUtils
.
getNowDate
());
return
tMonitorDeviceMapper
.
insertTMonitorDevice
(
tMonitorDevice
);
}
/**
* 修改设备监控
*
* @param tMonitorDevice 设备监控
* @return 结果
*/
@Override
public
int
updateTMonitorDevice
(
TMonitorDevice
tMonitorDevice
)
{
tMonitorDevice
.
setUpdateTime
(
DateUtils
.
getNowDate
());
return
tMonitorDeviceMapper
.
updateTMonitorDevice
(
tMonitorDevice
);
}
/**
* 批量删除设备监控
*
* @param monitorIds 需要删除的设备监控ID
* @return 结果
*/
@Override
public
int
deleteTMonitorDeviceByIds
(
Long
[]
monitorIds
)
{
return
tMonitorDeviceMapper
.
deleteTMonitorDeviceByIds
(
monitorIds
);
}
/**
* 删除设备监控信息
*
* @param monitorId 设备监控ID
* @return 结果
*/
@Override
public
int
deleteTMonitorDeviceById
(
Long
monitorId
)
{
return
tMonitorDeviceMapper
.
deleteTMonitorDeviceById
(
monitorId
);
}
}
gassafety-system/src/main/resources/mapper/system/TDeviceAlarmMapper.xml
View file @
e04b77c3
...
...
@@ -97,4 +97,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{alarmId}
</foreach>
</delete>
<select
id=
"selectAlarmDevice"
resultMap=
"TDeviceAlarmResult"
>
SELECT
alarm_id,
device_id,
device_type,
order_id,
alarm_type,
alarm_value,
start_time,
end_time,
deal_status,
update_time,
create_time
FROM
t_device_alarm
WHERE
end_time IS NULL
</select>
</mapper>
\ No newline at end of file
gassafety-system/src/main/resources/mapper/system/TMonitorDeviceMapper.xml
0 → 100644
View file @
e04b77c3
<?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.zehong.system.mapper.TMonitorDeviceMapper"
>
<resultMap
type=
"TMonitorDevice"
id=
"TMonitorDeviceResult"
>
<result
property=
"monitorId"
column=
"monitor_id"
/>
<result
property=
"deviceId"
column=
"device_id"
/>
<result
property=
"deviceThreshold"
column=
"device_threshold"
/>
<result
property=
"relationPipeId"
column=
"relation_pipe_id"
/>
<result
property=
"relationPipeThreshold"
column=
"relation_pipe_threshold"
/>
<result
property=
"relationDeviceId"
column=
"relation_device_id"
/>
<result
property=
"relationDeviceThreshold"
column=
"relation_device_threshold"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
</resultMap>
<sql
id=
"selectTMonitorDeviceVo"
>
select monitor_id, device_id, device_threshold, relation_pipe_id, relation_pipe_threshold, relation_device_id, relation_device_threshold, create_time, update_time from t_monitor_device
</sql>
<select
id=
"selectTMonitorDeviceList"
parameterType=
"TMonitorDevice"
resultMap=
"TMonitorDeviceResult"
>
<include
refid=
"selectTMonitorDeviceVo"
/>
<where>
<if
test=
"deviceId != null "
>
and device_id = #{deviceId}
</if>
<if
test=
"deviceThreshold != null "
>
and device_threshold = #{deviceThreshold}
</if>
<if
test=
"relationPipeId != null "
>
and relation_pipe_id = #{relationPipeId}
</if>
<if
test=
"relationPipeThreshold != null "
>
and relation_pipe_threshold = #{relationPipeThreshold}
</if>
<if
test=
"relationDeviceId != null "
>
and relation_device_id = #{relationDeviceId}
</if>
<if
test=
"relationDeviceThreshold != null "
>
and relation_device_threshold = #{relationDeviceThreshold}
</if>
</where>
</select>
<select
id=
"selectTMonitorDeviceById"
parameterType=
"Long"
resultMap=
"TMonitorDeviceResult"
>
<include
refid=
"selectTMonitorDeviceVo"
/>
where monitor_id = #{monitorId}
</select>
<insert
id=
"insertTMonitorDevice"
parameterType=
"TMonitorDevice"
useGeneratedKeys=
"true"
keyProperty=
"monitorId"
>
insert into t_monitor_device
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"deviceId != null"
>
device_id,
</if>
<if
test=
"deviceThreshold != null"
>
device_threshold,
</if>
<if
test=
"relationPipeId != null"
>
relation_pipe_id,
</if>
<if
test=
"relationPipeThreshold != null"
>
relation_pipe_threshold,
</if>
<if
test=
"relationDeviceId != null"
>
relation_device_id,
</if>
<if
test=
"relationDeviceThreshold != null"
>
relation_device_threshold,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"updateTime != null"
>
update_time,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"deviceId != null"
>
#{deviceId},
</if>
<if
test=
"deviceThreshold != null"
>
#{deviceThreshold},
</if>
<if
test=
"relationPipeId != null"
>
#{relationPipeId},
</if>
<if
test=
"relationPipeThreshold != null"
>
#{relationPipeThreshold},
</if>
<if
test=
"relationDeviceId != null"
>
#{relationDeviceId},
</if>
<if
test=
"relationDeviceThreshold != null"
>
#{relationDeviceThreshold},
</if>
<if
test=
"createTime != null"
>
#{createTime},
</if>
<if
test=
"updateTime != null"
>
#{updateTime},
</if>
</trim>
</insert>
<update
id=
"updateTMonitorDevice"
parameterType=
"TMonitorDevice"
>
update t_monitor_device
<trim
prefix=
"SET"
suffixOverrides=
","
>
<if
test=
"deviceId != null"
>
device_id = #{deviceId},
</if>
<if
test=
"deviceThreshold != null"
>
device_threshold = #{deviceThreshold},
</if>
<if
test=
"relationPipeId != null"
>
relation_pipe_id = #{relationPipeId},
</if>
<if
test=
"relationPipeThreshold != null"
>
relation_pipe_threshold = #{relationPipeThreshold},
</if>
<if
test=
"relationDeviceId != null"
>
relation_device_id = #{relationDeviceId},
</if>
<if
test=
"relationDeviceThreshold != null"
>
relation_device_threshold = #{relationDeviceThreshold},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime},
</if>
</trim>
where monitor_id = #{monitorId}
</update>
<delete
id=
"deleteTMonitorDeviceById"
parameterType=
"Long"
>
delete from t_monitor_device where monitor_id = #{monitorId}
</delete>
<delete
id=
"deleteTMonitorDeviceByIds"
parameterType=
"String"
>
delete from t_monitor_device where monitor_id in
<foreach
item=
"monitorId"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{monitorId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
gassafety-web/src/api/dataMonitoring/deviceAlarm.js
View file @
e04b77c3
...
...
@@ -51,3 +51,14 @@ export function exportDeviceAlarm(query) {
params
:
query
})
}
//查询报警设备
export
function
selectAlarmDevice
()
{
return
request
({
url
:
'/dataMonitoring/deviceAlarm/selectAlarmDevice'
,
method
:
'get'
,
params
:
query
})
}
gassafety-web/src/api/device/deviceMonitor.js
0 → 100644
View file @
e04b77c3
import
request
from
'@/utils/request'
// 查询设备监控列表
export
function
listDevice
(
query
)
{
return
request
({
url
:
'/system/device/list'
,
method
:
'get'
,
params
:
query
})
}
// 查询设备监控详细
export
function
getDevice
(
monitorId
)
{
return
request
({
url
:
'/system/device/'
+
monitorId
,
method
:
'get'
})
}
// 新增设备监控
export
function
addDevice
(
data
)
{
return
request
({
url
:
'/system/device'
,
method
:
'post'
,
data
:
data
})
}
export
function
batchAdd
(
data
)
{
return
request
({
url
:
'/system/device/batchAdd'
,
method
:
'post'
,
data
:
data
})
}
// 修改设备监控
export
function
updateDevice
(
data
)
{
return
request
({
url
:
'/system/device'
,
method
:
'put'
,
data
:
data
})
}
// 删除设备监控
export
function
delDevice
(
monitorId
)
{
return
request
({
url
:
'/system/device/'
+
monitorId
,
method
:
'delete'
})
}
// 导出设备监控
export
function
exportDevice
(
query
)
{
return
request
({
url
:
'/system/device/export'
,
method
:
'get'
,
params
:
query
})
}
gassafety-web/src/views/device/devicemonitor/index.vue
View file @
e04b77c3
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment