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
e9e89cc2
Commit
e9e89cc2
authored
Aug 17, 2021
by
王晓倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口查询管道类型、管道压力,设备类型
parent
7a059a08
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
84 additions
and
27 deletions
+84
-27
ITDeviceInfoService.java
...n/java/com/zehong/system/service/ITDeviceInfoService.java
+1
-1
TDeviceInfoServiceImpl.java
...om/zehong/system/service/impl/TDeviceInfoServiceImpl.java
+29
-2
TPipeServiceImpl.java
...java/com/zehong/system/service/impl/TPipeServiceImpl.java
+51
-2
index.vue
gassafety-web/src/views/device/deviceInfo/index.vue
+1
-8
index.vue
gassafety-web/src/views/device/pipe/index.vue
+2
-14
No files found.
gassafety-system/src/main/java/com/zehong/system/service/ITDeviceInfoService.java
View file @
e9e89cc2
...
...
@@ -20,7 +20,7 @@ public interface ITDeviceInfoService
* @param deviceId 设备信息ID
* @return 设备信息
*/
public
TDeviceInf
o
selectTDeviceInfoById
(
int
deviceId
);
public
DeviceInfoV
o
selectTDeviceInfoById
(
int
deviceId
);
/**
* 查询设备信息列表
...
...
gassafety-system/src/main/java/com/zehong/system/service/impl/TDeviceInfoServiceImpl.java
View file @
e9e89cc2
...
...
@@ -2,9 +2,12 @@ package com.zehong.system.service.impl;
import
java.util.*
;
import
com.zehong.common.core.domain.entity.SysDictData
;
import
com.zehong.common.utils.StringUtils
;
import
com.zehong.system.domain.TPipe
;
import
com.zehong.system.domain.vo.DeviceInfoVo
;
import
com.zehong.system.mapper.TPipeMapper
;
import
com.zehong.system.service.ISysDictTypeService
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -25,6 +28,8 @@ public class TDeviceInfoServiceImpl implements ITDeviceInfoService
private
TDeviceInfoMapper
tDeviceInfoMapper
;
@Autowired
private
TPipeMapper
tPipeMapper
;
@Autowired
private
ISysDictTypeService
iSysDictTypeService
;
/**
* 查询设备信息
...
...
@@ -33,9 +38,22 @@ public class TDeviceInfoServiceImpl implements ITDeviceInfoService
* @return 设备信息
*/
@Override
public
TDeviceInf
o
selectTDeviceInfoById
(
int
deviceId
)
public
DeviceInfoV
o
selectTDeviceInfoById
(
int
deviceId
)
{
return
tDeviceInfoMapper
.
selectTDeviceInfoById
(
deviceId
);
DeviceInfoVo
deviceInfoVo
=
new
DeviceInfoVo
();
TDeviceInfo
tDeviceInfo
=
tDeviceInfoMapper
.
selectTDeviceInfoById
(
deviceId
);
BeanUtils
.
copyProperties
(
tDeviceInfo
,
deviceInfoVo
);
if
(
StringUtils
.
isNotEmpty
(
tDeviceInfo
.
getDeviceType
()))
{
List
<
SysDictData
>
sysDictDataList
=
iSysDictTypeService
.
selectDictDataByType
(
"t_device_type"
);
for
(
SysDictData
sysDictData
:
sysDictDataList
)
{
if
(
tDeviceInfo
.
getDeviceType
().
equals
(
sysDictData
.
getDictValue
()))
{
deviceInfoVo
.
setDeviceType
(
sysDictData
.
getDictLabel
());
}
}
}
return
deviceInfoVo
;
}
/**
...
...
@@ -59,6 +77,15 @@ public class TDeviceInfoServiceImpl implements ITDeviceInfoService
TPipe
pipe
=
tPipeMapper
.
selectTPipeById
(
device
.
getPipeId
());
deviceInfoVo
.
setPipeName
(
pipe
.
getPipeName
());
if
(
StringUtils
.
isNotEmpty
(
device
.
getDeviceType
()))
{
List
<
SysDictData
>
sysDictDataList
=
iSysDictTypeService
.
selectDictDataByType
(
"t_device_type"
);
for
(
SysDictData
sysDictData
:
sysDictDataList
)
{
if
(
device
.
getDeviceType
().
equals
(
sysDictData
.
getDictValue
()))
{
deviceInfoVo
.
setDeviceType
(
sysDictData
.
getDictLabel
());
}
}
}
list
.
add
(
deviceInfoVo
);
}
}
...
...
gassafety-system/src/main/java/com/zehong/system/service/impl/TPipeServiceImpl.java
View file @
e9e89cc2
package
com
.
zehong
.
system
.
service
.
impl
;
import
java.util.List
;
import
com.zehong.common.core.domain.entity.SysDictData
;
import
com.zehong.common.utils.StringUtils
;
import
com.zehong.system.service.ISysDictTypeService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.zehong.system.mapper.TPipeMapper
;
...
...
@@ -18,6 +22,8 @@ public class TPipeServiceImpl implements ITPipeService
{
@Autowired
private
TPipeMapper
tPipeMapper
;
@Autowired
private
ISysDictTypeService
iSysDictTypeService
;
/**
* 查询管道信息
...
...
@@ -28,7 +34,24 @@ public class TPipeServiceImpl implements ITPipeService
@Override
public
TPipe
selectTPipeById
(
int
pipeId
)
{
return
tPipeMapper
.
selectTPipeById
(
pipeId
);
TPipe
tPipe
=
tPipeMapper
.
selectTPipeById
(
pipeId
);
if
(
StringUtils
.
isNotEmpty
(
tPipe
.
getPipeType
()))
{
List
<
SysDictData
>
sysDictDataList
=
iSysDictTypeService
.
selectDictDataByType
(
"t_pipe_type"
);
for
(
SysDictData
sysDictData
:
sysDictDataList
)
{
if
(
tPipe
.
getPipeType
().
equals
(
sysDictData
.
getDictValue
()))
{
tPipe
.
setPipeType
(
sysDictData
.
getDictLabel
());
}
}
}
if
(
StringUtils
.
isNotEmpty
(
tPipe
.
getPipePressure
()))
{
List
<
SysDictData
>
sysDictDataList
=
iSysDictTypeService
.
selectDictDataByType
(
"t_pipe_pressure"
);
for
(
SysDictData
sysDictData
:
sysDictDataList
)
{
if
(
tPipe
.
getPipePressure
().
equals
(
sysDictData
.
getDictValue
()))
{
tPipe
.
setPipePressure
(
sysDictData
.
getDictLabel
());
}
}
}
return
tPipe
;
}
/**
...
...
@@ -40,7 +63,33 @@ public class TPipeServiceImpl implements ITPipeService
@Override
public
List
<
TPipe
>
selectTPipeList
(
TPipe
tPipe
)
{
return
tPipeMapper
.
selectTPipeList
(
tPipe
);
List
<
TPipe
>
tPipeList
=
tPipeMapper
.
selectTPipeList
(
tPipe
);
if
(
tPipeList
.
size
()
!=
0
){
for
(
TPipe
pipe
:
tPipeList
){
if
(
StringUtils
.
isNotEmpty
(
pipe
.
getPipeType
()))
{
List
<
SysDictData
>
sysDictDataList
=
iSysDictTypeService
.
selectDictDataByType
(
"t_pipe_type"
);
for
(
SysDictData
sysDictData
:
sysDictDataList
)
{
if
(
pipe
.
getPipeType
().
equals
(
sysDictData
.
getDictValue
()))
{
pipe
.
setPipeType
(
sysDictData
.
getDictLabel
());
}
}
}
if
(
StringUtils
.
isNotEmpty
(
pipe
.
getPipePressure
()))
{
List
<
SysDictData
>
sysDictDataList
=
iSysDictTypeService
.
selectDictDataByType
(
"t_pipe_pressure"
);
for
(
SysDictData
sysDictData
:
sysDictDataList
)
{
if
(
pipe
.
getPipePressure
().
equals
(
sysDictData
.
getDictValue
()))
{
pipe
.
setPipePressure
(
sysDictData
.
getDictLabel
());
}
}
}
}
}
return
tPipeList
;
}
/**
...
...
gassafety-web/src/views/device/deviceInfo/index.vue
View file @
e9e89cc2
...
...
@@ -86,14 +86,7 @@
<el-table-column
label=
"设备名称"
align=
"center"
prop=
"deviceName"
/>
<el-table-column
label=
"所属管道"
align=
"center"
prop=
"pipeName"
/>
<el-table-column
label=
"设备编号"
align=
"center"
prop=
"deviceCode"
/>
<el-table-column
label=
"设备类型"
align=
"center"
prop=
"deviceType"
>
<template
slot-scope=
"scope"
>
<span
v-if=
"scope.row.deviceType == 1"
>
调压箱
</span>
<span
v-if=
"scope.row.deviceType == 2"
>
阀门井
</span>
<span
v-if=
"scope.row.deviceType == 3"
>
流量计
</span>
<span
v-if=
"scope.row.deviceType == 4"
>
智能燃气表
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"设备类型"
align=
"center"
prop=
"deviceType"
/>
<el-table-column
label=
"设备型号"
align=
"center"
prop=
"deviceModel"
/>
<el-table-column
label=
"所在地址"
align=
"center"
prop=
"deviceAddr"
/>
<el-table-column
label=
"安装时间"
align=
"center"
prop=
"installationTime"
width=
"180"
>
...
...
gassafety-web/src/views/device/pipe/index.vue
View file @
e9e89cc2
...
...
@@ -85,20 +85,8 @@
<el-table
v-loading=
"loading"
:data=
"pipeList"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
label=
"管道名称"
align=
"center"
prop=
"pipeName"
/>
<el-table-column
label=
"管道编号"
align=
"center"
prop=
"pipeCode"
/>
<el-table-column
label=
"管道类型"
align=
"center"
prop=
"pipeType"
>
<template
slot-scope=
"scope"
>
<span
v-if=
"scope.row.pipeType == 1"
>
地埋管线
</span>
<span
v-if=
"scope.row.pipeType == 2"
>
地表管线
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"管道压力"
align=
"center"
prop=
"pipePressure"
>
<
template
slot-scope=
"scope"
>
<span
v-if=
"scope.row.pipePressure == 1"
>
低压
</span>
<span
v-if=
"scope.row.pipePressure == 2"
>
中压
</span>
<span
v-if=
"scope.row.pipePressure == 3"
>
次高压
</span>
<span
v-if=
"scope.row.pipePressure == 4"
>
高压
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"管道类型"
align=
"center"
prop=
"pipeType"
/>
<el-table-column
label=
"管道压力"
align=
"center"
prop=
"pipePressure"
/>
<el-table-column
label=
"管道长度"
align=
"center"
prop=
"pipeLength"
/>
<el-table-column
label=
"所在地址"
align=
"center"
prop=
"pipeAddr"
/>
<el-table-column
label=
"安装时间"
align=
"center"
prop=
"installationTime"
width=
"180"
>
...
...
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