Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
zh-baseversion-project
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
王浩
zh-baseversion-project
Commits
002fc467
Commit
002fc467
authored
Jul 13, 2024
by
wanghao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1 大屏端 全局搜素 设备,场站,用户信息,监控 ,以及点击查看 详情功能初步实现,待跟前段界面联调测试。
parent
68628511
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
453 additions
and
24 deletions
+453
-24
TDeviceInfoController.java
...ehong/web/controller/supervise/TDeviceInfoController.java
+27
-8
TYehuaqiDeviceController.java
...ehong/web/controller/system/TYehuaqiDeviceController.java
+1
-1
PipeInterfaceMapper.java
...in/java/com/zehong/system/mapper/PipeInterfaceMapper.java
+7
-0
TDeviceInfoMapper.java
...main/java/com/zehong/system/mapper/TDeviceInfoMapper.java
+8
-0
IPipeInterfaceService.java
...java/com/zehong/system/service/IPipeInterfaceService.java
+2
-0
ITDeviceInfoService.java
...n/java/com/zehong/system/service/ITDeviceInfoService.java
+14
-0
PipeInterfaceServiceImpl.java
.../zehong/system/service/impl/PipeInterfaceServiceImpl.java
+5
-0
TDeviceInfoServiceImpl.java
...om/zehong/system/service/impl/TDeviceInfoServiceImpl.java
+300
-4
TYehuaqiUserServiceImpl.java
...m/zehong/system/service/impl/TYehuaqiUserServiceImpl.java
+6
-11
PipeInterfaceMapper.xml
.../src/main/resources/mapper/system/PipeInterfaceMapper.xml
+8
-0
TDeviceInfoMapper.xml
...em/src/main/resources/mapper/system/TDeviceInfoMapper.xml
+75
-0
No files found.
zh-baseversion-admin/src/main/java/com/zehong/web/controller/supervise/TDeviceInfoController.java
View file @
002fc467
...
...
@@ -10,25 +10,22 @@ import com.zehong.common.core.domain.model.LoginUser;
import
com.zehong.common.utils.SecurityUtils
;
import
com.zehong.common.utils.ServletUtils
;
import
com.zehong.framework.web.service.TokenService
;
import
com.zehong.system.domain.Listaw
;
import
com.zehong.system.domain.TDetailInfoList
;
import
com.zehong.system.domain.TDeviceInfoS
;
import
com.zehong.system.service.ITDetectorInfoService
;
import
com.zehong.system.service.ITDetectorUserService
;
import
com.zehong.system.service.ITEmployedPeopleInfoService
;
import
com.zehong.system.domain.*
;
import
com.zehong.system.service.*
;
import
com.zehong.web.codeconfig.CodeConFig
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.aspectj.weaver.loadtime.Aj
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
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.TDeviceInfo
;
import
com.zehong.system.service.ITDeviceInfoService
;
import
com.zehong.common.utils.poi.ExcelUtil
;
import
com.zehong.common.core.page.TableDataInfo
;
import
javax.annotation.Resource
;
/**
* 设备信息Controller
*
...
...
@@ -52,6 +49,9 @@ public class TDeviceInfoController extends BaseController
@Autowired
private
TokenService
tokenService
;
@Resource
private
ITDeviceUserService
tDeviceUserService
;
/**
* 查询设备信息列表
*/
...
...
@@ -65,6 +65,25 @@ public class TDeviceInfoController extends BaseController
List
<
TDeviceInfo
>
list
=
tDeviceInfoService
.
selectTDeviceInfoList
(
tDeviceInfo
);
return
getDataTable
(
list
);
}
/**
*
* 大屏端 全局搜素 设备,场站,用户信息,监控 步骤一
* */
@GetMapping
(
"/queryBasicInforByNameForBigWindows"
)
public
AjaxResult
queryBasicInforByNameForBigWindows
(
String
name
)
{
return
AjaxResult
.
success
(
tDeviceInfoService
.
queryBasicInforByNameForBigWindows
(
name
));
}
/**
*
* 大屏端 全局搜素 设备,场站,用户信息,监控 步骤二
* */
@GetMapping
(
"/queryBasicInforByNameForBigWindows"
)
public
AjaxResult
queryBasicInforByTypeAndIdForBigWindows
(
String
type
,
String
id
)
{
return
AjaxResult
.
success
(
tDeviceInfoService
.
queryBasicInforByTypeAndIdForBigWindows
(
type
,
id
));
}
@GetMapping
(
"/alllist"
)
public
AjaxResult
alllist
(
TDeviceInfo
tDeviceInfo
)
{
...
...
zh-baseversion-admin/src/main/java/com/zehong/web/controller/system/TYehuaqiDeviceController.java
View file @
002fc467
...
...
@@ -27,7 +27,7 @@ import com.zehong.common.core.page.TableDataInfo;
* @date 2022-09-14
*/
@RestController
@RequestMapping
(
"/system/yehuaqiDevice"
)
@RequestMapping
(
"/
system/yehuaqiDevice"
)
public
class
TYehuaqiDeviceController
extends
BaseController
{
...
...
zh-baseversion-system/src/main/java/com/zehong/system/mapper/PipeInterfaceMapper.java
View file @
002fc467
...
...
@@ -25,6 +25,13 @@ public interface PipeInterfaceMapper {
*/
List
<
PipeDate
>
getPipeForSelect
(
String
enterId
);
/**
* 按照企业id he
* @param pipeId
* @return
*/
PipeDate
getPipeBypipeId
(
@Param
(
"pipeId"
)
String
pipeId
);
/**
* 获取分组数据
* @return
...
...
zh-baseversion-system/src/main/java/com/zehong/system/mapper/TDeviceInfoMapper.java
View file @
002fc467
...
...
@@ -6,6 +6,7 @@ import java.util.Map;
import
com.zehong.system.domain.TDeviceInfo
;
import
com.zehong.system.domain.TDeviceInfoS
;
import
com.zehong.system.domain.vo.TDetectorUserVO
;
import
org.apache.ibatis.annotations.MapKey
;
import
org.apache.ibatis.annotations.Param
;
/**
...
...
@@ -38,6 +39,13 @@ public interface TDeviceInfoMapper
* @return 设备信息集合
*/
public
List
<
TDeviceInfo
>
selectTDeviceInfoList
(
TDeviceInfo
tDeviceInfo
);
/**
*
* 大屏端 全局搜素 设备,场站,用户信息,监控 步骤一
* */
@MapKey
(
value
=
"id"
)
public
List
<
Map
<
String
,
Object
>>
queryBasicInforByNameForBigWindows
(
@Param
(
value
=
"name"
)
String
name
);
public
List
<
TDeviceInfo
>
selectDeviceList
(
TDeviceInfo
tDeviceInfo
);
/**
...
...
zh-baseversion-system/src/main/java/com/zehong/system/service/IPipeInterfaceService.java
View file @
002fc467
...
...
@@ -21,6 +21,8 @@ public interface IPipeInterfaceService {
*/
List
<
PipeDate
>
getPipeForSelect
(
String
enterId
);
PipeDate
getPipeBypipeId
(
String
pipeId
);
/**
* 获取分组数据
* @return
...
...
zh-baseversion-system/src/main/java/com/zehong/system/service/ITDeviceInfoService.java
View file @
002fc467
...
...
@@ -30,6 +30,20 @@ public interface ITDeviceInfoService
* @return 设备信息集合
*/
public
List
<
TDeviceInfo
>
selectTDeviceInfoList
(
TDeviceInfo
tDeviceInfo
);
/**
*
* 大屏端 全局搜素 设备,场站,用户信息,监控 步骤一
* */
public
Map
<
Object
,
List
<
Map
<
String
,
Object
>>>
queryBasicInforByNameForBigWindows
(
String
name
);
/**
*
* 大屏端 全局搜素 设备,场站,用户信息,监控 步骤二
* */
public
Object
queryBasicInforByTypeAndIdForBigWindows
(
String
type
,
String
id
);
public
List
<
TDeviceInfo
>
selectDeviceList
(
TDeviceInfo
tDeviceInfo
);
/**
...
...
zh-baseversion-system/src/main/java/com/zehong/system/service/impl/PipeInterfaceServiceImpl.java
View file @
002fc467
...
...
@@ -36,6 +36,11 @@ public class PipeInterfaceServiceImpl implements IPipeInterfaceService {
return
pipeDates
;
}
@Override
public
PipeDate
getPipeBypipeId
(
String
pipeId
)
{
return
pipeInterfaceMapper
.
getPipeBypipeId
(
pipeId
);
}
/**
* 获取分组数据
* @return
...
...
zh-baseversion-system/src/main/java/com/zehong/system/service/impl/TDeviceInfoServiceImpl.java
View file @
002fc467
package
com
.
zehong
.
system
.
service
.
impl
;
import
java.lang.reflect.Field
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
com.zehong.common.core.domain.entity.SysUser
;
import
com.zehong.common.core.domain.model.LoginUser
;
import
com.zehong.common.utils.DateUtils
;
import
com.zehong.system.domain.TDeviceInfoS
;
import
com.zehong.common.utils.SecurityUtils
;
import
com.zehong.common.utils.ServletUtils
;
import
com.zehong.system.domain.*
;
import
com.zehong.system.service.*
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.zehong.system.mapper.TDeviceInfoMapper
;
import
com.zehong.system.domain.TDeviceInfo
;
import
com.zehong.system.service.ITDeviceInfoServi
ce
;
import
javax.annotation.Resour
ce
;
/**
* 设备信息Service业务层处理
...
...
@@ -21,9 +30,25 @@ import com.zehong.system.service.ITDeviceInfoService;
@Service
public
class
TDeviceInfoServiceImpl
implements
ITDeviceInfoService
{
@
Autowired
@
Resource
private
TDeviceInfoMapper
tDeviceInfoMapper
;
@Resource
IPipeInterfaceService
iPipeInterfaceService
;
@Resource
private
ITDetectorUserService
tDetectorUserService
;
@Resource
private
ITDeviceUserService
tDeviceUserService
;
@Resource
private
ITVideoManagerService
itVideoManagerService
;
@Resource
private
ITYehuaqiUserService
yehuaqiUserService
;
/**
* 查询设备信息
*
...
...
@@ -47,6 +72,277 @@ public class TDeviceInfoServiceImpl implements ITDeviceInfoService
{
return
tDeviceInfoMapper
.
selectTDeviceInfoList
(
tDeviceInfo
);
}
/**
*
* 大屏端 全局搜素 设备,场站,用户信息,监控 步骤一
* */
@Override
public
Map
<
Object
,
List
<
Map
<
String
,
Object
>>>
queryBasicInforByNameForBigWindows
(
String
name
)
{
Map
<
Object
,
List
<
Map
<
String
,
Object
>>>
stringListHashMap
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
maps
=
tDeviceInfoMapper
.
queryBasicInforByNameForBigWindows
(
name
);
if
(
maps
.
size
()
>
0
)
{
stringListHashMap
=
maps
.
stream
().
collect
(
Collectors
.
groupingBy
((
item
->
item
.
get
(
"type"
))));
}
return
stringListHashMap
;
}
/**
*
* 大屏端 全局搜素 设备,场站,用户信息,监控 步骤二
* */
@Override
public
Object
queryBasicInforByTypeAndIdForBigWindows
(
String
type
,
String
id
)
{
// 1 是阀门井 2 是调压箱 都是查询 device 表
if
((
"1"
.
equals
(
type
)
||
"2"
.
equals
(
type
))
&&
id
!=
null
)
{
return
initPressureFlow
(
id
);
}
// 3 是场站
if
((
"3"
.
equals
(
type
))
&&
id
!=
null
)
{
return
initTSiteStationInfoData
(
id
);
}
// 4 5 6 是居民用户,商业用户,工业用户
if
((
"4"
.
equals
(
type
)
||
"5"
.
equals
(
type
)
||
"6"
.
equals
(
type
))
&&
id
!=
null
)
{
TDetectorUser
tDetectorUser
=
new
TDetectorUser
();
tDetectorUser
.
setUserId
(
Long
.
parseLong
(
id
));
return
tDetectorUserService
.
detectorUserList
(
tDetectorUser
);
}
//7 是监控
if
(
"7"
.
equals
(
type
))
{
return
itVideoManagerService
.
selectTVideoManagerById
(
Long
.
parseLong
(
id
));
}
//8 是餐饮单位液化气用户
if
(
"8"
.
equals
(
type
)
&&
id
!=
null
)
{
TYehuaqiUser
tYehuaqiUser
=
new
TYehuaqiUser
();
tYehuaqiUser
.
setUserId
(
Long
.
parseLong
(
id
));
List
<
TYehuaqiUser
>
tYehuaqiUsers
=
yehuaqiUserService
.
selectAllUserList
(
tYehuaqiUser
);
if
(
tYehuaqiUsers
.
size
()
>
0
)
{
return
tYehuaqiUsers
.
get
(
0
);
}
}
//9 是管道
if
(
"9"
.
equals
(
type
)
&&
id
!=
null
)
{
return
iPipeInterfaceService
.
getPipeBypipeId
(
id
);
}
return
null
;
}
/**
* 封装场站信息
* @param deviceId 设备id
* @return object
*/
private
Object
initTSiteStationInfoData
(
String
deviceId
)
{
TSiteStationInfoDataList
tSiteStationInfoDataList
=
new
TSiteStationInfoDataList
();
List
<
TSiteStationInfoData
>
TSiteStationInfoDataList
=
new
ArrayList
<>();
//查询场站下级设备数据
List
<
PressureFlow
>
pressureFlows
=
iPipeInterfaceService
.
selecttSiteStationInfoDataList
(
deviceId
);
//临时存储压力表数据数组
List
<
PressureFlow
>
pressureList
=
new
ArrayList
<>();
//临时存储流量计数据数组
List
<
PressureFlow
>
flowmeterList
=
new
ArrayList
<>();
//临时存储探测器数据数组
List
<
PressureFlow
>
detectorList
=
new
ArrayList
();
/**循环下级全部数据*/
for
(
int
s
=
0
;
s
<
pressureFlows
.
size
();
s
++){
//判断是压力表还是流量计 1压力表 2流量计 3探测器
if
(
pressureFlows
.
get
(
s
).
getDeviceType
().
equals
(
"1"
)){
pressureList
.
add
(
pressureFlows
.
get
(
s
));
}
else
if
(
pressureFlows
.
get
(
s
).
getDeviceType
().
equals
(
"2"
)){
flowmeterList
.
add
(
pressureFlows
.
get
(
s
));
}
else
if
(
pressureFlows
.
get
(
s
).
getDeviceType
().
equals
(
"3"
)){
detectorList
.
add
(
pressureFlows
.
get
(
s
));
}
}
//创建下级数据list数组
List
<
SubordinateEquipmentList
>
subordinateEquipmentLists
=
new
ArrayList
<>();
/**循环三次 每次代表 1压力表 2流量计 3探测器*/
for
(
int
t
=
0
;
t
<
3
;
t
++){
SubordinateEquipmentList
subordinateEquipmentList
=
new
SubordinateEquipmentList
();
if
(
t
==
0
){
/**添加压力表数据*/
if
(
pressureList
.
size
()!=
0
){
/**查询下级在线设备数量*/
int
onLine
=
iPipeInterfaceService
.
selectOnlineQuantity
(
pressureList
,
0
);
subordinateEquipmentList
.
setOnlineEquipment
(
onLine
);
/**查询下级离线设备数量*/
int
offLine
=
iPipeInterfaceService
.
selectOnlineQuantity
(
pressureList
,
1
);
subordinateEquipmentList
.
setOfflineEquipment
(
offLine
);
/**查询历史报警数量*/
int
historicalAlarm
=
iPipeInterfaceService
.
selectHistoricalAlarm
(
pressureList
);
subordinateEquipmentList
.
setHistoricalAlarm
(
historicalAlarm
);
/**查询已处理报警*/
int
processAlarm
=
iPipeInterfaceService
.
selectProcessAlarm
(
pressureList
);
subordinateEquipmentList
.
setAlarmProcessed
(
processAlarm
);
/**查询报警中*/
int
inAlarm
=
iPipeInterfaceService
.
selectInAlarm
(
pressureList
);
subordinateEquipmentList
.
setInAlarm
(
inAlarm
);
subordinateEquipmentList
.
setNumberPressureGauges
(
pressureList
.
size
());
}
subordinateEquipmentList
.
setDataType
(
1
);
}
else
if
(
t
==
1
){
/**添加流量计数据*/
if
(
flowmeterList
.
size
()!=
0
){
/**查询下级在线设备数量*/
int
onLine
=
iPipeInterfaceService
.
selectOnlineQuantity
(
flowmeterList
,
0
);
subordinateEquipmentList
.
setOnlineEquipment
(
onLine
);
/**查询下级离线设备数量*/
int
offLine
=
iPipeInterfaceService
.
selectOnlineQuantity
(
flowmeterList
,
1
);
subordinateEquipmentList
.
setOfflineEquipment
(
offLine
);
/**查询历史报警数量*/
int
historicalAlarm
=
iPipeInterfaceService
.
selectHistoricalAlarm
(
flowmeterList
);
subordinateEquipmentList
.
setHistoricalAlarm
(
historicalAlarm
);
/**查询已处理报警*/
int
processAlarm
=
iPipeInterfaceService
.
selectProcessAlarm
(
flowmeterList
);
subordinateEquipmentList
.
setAlarmProcessed
(
processAlarm
);
/**查询报警中*/
int
inAlarm
=
iPipeInterfaceService
.
selectInAlarm
(
flowmeterList
);
subordinateEquipmentList
.
setInAlarm
(
inAlarm
);
subordinateEquipmentList
.
setNumberPressureGauges
(
flowmeterList
.
size
());
}
subordinateEquipmentList
.
setDataType
(
2
);
}
else
if
(
t
==
2
){
/**添加探测器数据*/
if
(
detectorList
.
size
()!=
0
){
/**查询下级在线设备数量*/
int
onLine
=
iPipeInterfaceService
.
selectOnlineQuantity
(
detectorList
,
0
);
subordinateEquipmentList
.
setOnlineEquipment
(
onLine
);
/**查询下级离线设备数量*/
int
offLine
=
iPipeInterfaceService
.
selectOnlineQuantity
(
detectorList
,
1
);
subordinateEquipmentList
.
setOfflineEquipment
(
offLine
);
/**查询历史报警数量*/
int
historicalAlarm
=
iPipeInterfaceService
.
selectHistoricalAlarm
(
detectorList
);
subordinateEquipmentList
.
setHistoricalAlarm
(
historicalAlarm
);
/**查询已处理报警*/
int
processAlarm
=
iPipeInterfaceService
.
selectProcessAlarm
(
detectorList
);
subordinateEquipmentList
.
setAlarmProcessed
(
processAlarm
);
/**查询报警中*/
int
inAlarm
=
iPipeInterfaceService
.
selectInAlarm
(
detectorList
);
subordinateEquipmentList
.
setInAlarm
(
inAlarm
);
subordinateEquipmentList
.
setNumberPressureGauges
(
detectorList
.
size
());
}
subordinateEquipmentList
.
setDataType
(
3
);
}
subordinateEquipmentLists
.
add
(
subordinateEquipmentList
);
}
TSiteStationInfoData
deviceData
=
new
TSiteStationInfoData
();
deviceData
.
setSubordinateEquipmentList
(
subordinateEquipmentLists
);
TSiteStationInfoDataList
.
add
(
deviceData
);
tSiteStationInfoDataList
.
setData
(
TSiteStationInfoDataList
);
return
tSiteStationInfoDataList
;
}
/**
* 封装 阀门井和调压箱数据
* @param deviceId 设备id
* @return object
*/
private
Object
initPressureFlow
(
String
deviceId
)
{
//最后返回的封装类型
DeviceList
deviceList
=
new
DeviceList
();
List
<
DeviceData
>
DeviceList
=
new
ArrayList
<>();
//查询关联设备下级数据方法
List
<
PressureFlow
>
pressureFlows
=
iPipeInterfaceService
.
selectPressureFlow
(
deviceId
);
//临时存储压力表数据数组
List
<
PressureFlow
>
pressureList
=
new
ArrayList
<>();
//临时存储流量计数据数组
List
<
PressureFlow
>
flowmeterList
=
new
ArrayList
<>();
//临时存储探测器数据数组
List
<
PressureFlow
>
detectorList
=
new
ArrayList
();
/**循环下级全部数据*/
for
(
int
s
=
0
;
s
<
pressureFlows
.
size
();
s
++){
//判断是压力表还是流量计 1压力表 2流量计 3探测器
if
(
pressureFlows
.
get
(
s
).
getDeviceType
().
equals
(
"1"
)){
pressureList
.
add
(
pressureFlows
.
get
(
s
));
}
else
if
(
pressureFlows
.
get
(
s
).
getDeviceType
().
equals
(
"2"
)){
flowmeterList
.
add
(
pressureFlows
.
get
(
s
));
}
else
if
(
pressureFlows
.
get
(
s
).
getDeviceType
().
equals
(
"3"
)){
detectorList
.
add
(
pressureFlows
.
get
(
s
));
}
}
//创建下级数据list数组
List
<
SubordinateEquipmentList
>
subordinateEquipmentLists
=
new
ArrayList
<>();
/**循环三次 每次代表 1压力表 2流量计 3探测器*/
for
(
int
t
=
0
;
t
<
3
;
t
++){
SubordinateEquipmentList
subordinateEquipmentList
=
new
SubordinateEquipmentList
();
if
(
t
==
0
){
/**添加压力表数据*/
if
(
pressureList
.
size
()!=
0
){
/**查询下级在线设备数量*/
int
onLine
=
iPipeInterfaceService
.
selectOnlineQuantity
(
pressureList
,
0
);
subordinateEquipmentList
.
setOnlineEquipment
(
onLine
);
/**查询下级离线设备数量*/
int
offLine
=
iPipeInterfaceService
.
selectOnlineQuantity
(
pressureList
,
1
);
subordinateEquipmentList
.
setOfflineEquipment
(
offLine
);
/**查询历史报警数量*/
int
historicalAlarm
=
iPipeInterfaceService
.
selectHistoricalAlarm
(
pressureList
);
subordinateEquipmentList
.
setHistoricalAlarm
(
historicalAlarm
);
/**查询已处理报警*/
int
processAlarm
=
iPipeInterfaceService
.
selectProcessAlarm
(
pressureList
);
subordinateEquipmentList
.
setAlarmProcessed
(
processAlarm
);
/**查询报警中*/
int
inAlarm
=
iPipeInterfaceService
.
selectInAlarm
(
pressureList
);
subordinateEquipmentList
.
setInAlarm
(
inAlarm
);
subordinateEquipmentList
.
setNumberPressureGauges
(
pressureList
.
size
());
}
subordinateEquipmentList
.
setDataType
(
1
);
}
else
if
(
t
==
1
){
/**添加流量计数据*/
if
(
flowmeterList
.
size
()!=
0
){
/**查询下级在线设备数量*/
int
onLine
=
iPipeInterfaceService
.
selectOnlineQuantity
(
flowmeterList
,
0
);
subordinateEquipmentList
.
setOnlineEquipment
(
onLine
);
/**查询下级离线设备数量*/
int
offLine
=
iPipeInterfaceService
.
selectOnlineQuantity
(
flowmeterList
,
1
);
subordinateEquipmentList
.
setOfflineEquipment
(
offLine
);
/**查询历史报警数量*/
int
historicalAlarm
=
iPipeInterfaceService
.
selectHistoricalAlarm
(
flowmeterList
);
subordinateEquipmentList
.
setHistoricalAlarm
(
historicalAlarm
);
/**查询已处理报警*/
int
processAlarm
=
iPipeInterfaceService
.
selectProcessAlarm
(
flowmeterList
);
subordinateEquipmentList
.
setAlarmProcessed
(
processAlarm
);
/**查询报警中*/
int
inAlarm
=
iPipeInterfaceService
.
selectInAlarm
(
flowmeterList
);
subordinateEquipmentList
.
setInAlarm
(
inAlarm
);
subordinateEquipmentList
.
setNumberPressureGauges
(
flowmeterList
.
size
());
}
subordinateEquipmentList
.
setDataType
(
2
);
}
else
if
(
t
==
2
){
/**添加探测器数据*/
if
(
detectorList
.
size
()!=
0
){
/**查询下级在线设备数量*/
int
onLine
=
iPipeInterfaceService
.
selectOnlineQuantity
(
detectorList
,
0
);
subordinateEquipmentList
.
setOnlineEquipment
(
onLine
);
/**查询下级离线设备数量*/
int
offLine
=
iPipeInterfaceService
.
selectOnlineQuantity
(
detectorList
,
1
);
subordinateEquipmentList
.
setOfflineEquipment
(
offLine
);
/**查询历史报警数量*/
int
historicalAlarm
=
iPipeInterfaceService
.
selectHistoricalAlarm
(
detectorList
);
subordinateEquipmentList
.
setHistoricalAlarm
(
historicalAlarm
);
/**查询已处理报警*/
int
processAlarm
=
iPipeInterfaceService
.
selectProcessAlarm
(
detectorList
);
subordinateEquipmentList
.
setAlarmProcessed
(
processAlarm
);
/**查询报警中*/
int
inAlarm
=
iPipeInterfaceService
.
selectInAlarm
(
detectorList
);
subordinateEquipmentList
.
setInAlarm
(
inAlarm
);
subordinateEquipmentList
.
setNumberPressureGauges
(
detectorList
.
size
());
}
subordinateEquipmentList
.
setDataType
(
3
);
}
subordinateEquipmentLists
.
add
(
subordinateEquipmentList
);
}
DeviceData
deviceData
=
new
DeviceData
();
deviceData
.
setSubordinateEquipmentList
(
subordinateEquipmentLists
);
DeviceList
.
add
(
deviceData
);
deviceList
.
setData
(
DeviceList
);
return
deviceList
;
}
@Override
public
List
<
TDeviceInfo
>
selectDeviceList
(
TDeviceInfo
tDeviceInfo
)
{
...
...
zh-baseversion-system/src/main/java/com/zehong/system/service/impl/TYehuaqiUserServiceImpl.java
View file @
002fc467
package
com
.
zehong
.
system
.
service
.
impl
;
import
java.util.ArrayList
;
import
java.util.List
;
import
com.zehong.common.utils.DateUtils
;
import
com.zehong.system.domain.TDetectorUser
;
import
com.zehong.system.domain.TYehuaqiDevice
;
import
com.zehong.system.domain.vo.TDetectorUserVO
;
import
com.zehong.system.domain.vo.TYehuaqiUserVO
;
import
com.zehong.system.mapper.TYehuaqiDeviceMapper
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.zehong.system.mapper.TYehuaqiUserMapper
;
...
...
@@ -56,12 +51,12 @@ public class TYehuaqiUserServiceImpl implements ITYehuaqiUserService
public
List
<
TYehuaqiUser
>
selectAllUserList
(
TYehuaqiUser
tYehuaqiUser
)
{
List
<
TYehuaqiUser
>
list
=
tYehuaqiUserMapper
.
selectTYehuaqiUserListTwo
(
tYehuaqiUser
);
//
for (TYehuaqiUser user : list){
//
TYehuaqiDevice d = new TYehuaqiDevice();
//
d.setUserId(user.getUserId());
//
List<TYehuaqiDevice> devices = tYehuaqiDeviceMapper.selectTYehuaqiDeviceList(d);
//
user.setDeviceNum(devices.size());
//
}
for
(
TYehuaqiUser
user
:
list
){
TYehuaqiDevice
d
=
new
TYehuaqiDevice
();
d
.
setUserId
(
user
.
getUserId
());
List
<
TYehuaqiDevice
>
devices
=
tYehuaqiDeviceMapper
.
selectTYehuaqiDeviceList
(
d
);
user
.
setDeviceNum
(
devices
.
size
());
}
return
list
;
}
...
...
zh-baseversion-system/src/main/resources/mapper/system/PipeInterfaceMapper.xml
View file @
002fc467
...
...
@@ -135,6 +135,14 @@
</if>
</select>
<select
id=
"getPipeBypipeId"
parameterType=
"PipeDate"
resultMap=
"PipeDateResult"
>
select format(pipe_length,2)pipe_length,pipe_pressure,beyond_enterprise_id,pipe_id,pipe_diameter,pipe_material,
buried_depth,pipe_trend,build_date,pipe_addr,coordinates,remarks,build_unit,beyond_enterprise_name,
pipe_name,detaild_address,ind_reg_auth,ind_reg_auth_per,ind_reg_auth_per_con,key_areas_gas_usage,
aff_gas_com,aff_gas_com_sec_per,aff_gas_com_sec_per_con,sec_check_time,unit_gas_user_res,unit_gas_user_res_con from t_pipe_info
where pipe_id = #{pipeId}
</select>
<!--获取分组数据-->
<select
id=
"selectGroupPipeData"
parameterType=
"PipeDate"
resultMap=
"PipeDateResult"
>
select beyond_enterprise_id,pipe_id,pipe_diameter,pipe_material,buried_depth,pipe_trend,build_date,pipe_addr,coordinates,remarks,build_unit,beyond_enterprise_name from t_pipe_info
...
...
zh-baseversion-system/src/main/resources/mapper/system/TDeviceInfoMapper.xml
View file @
002fc467
...
...
@@ -59,6 +59,81 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
order by a.device_id desc
</select>
<select
id=
"queryBasicInforByNameForBigWindows"
resultType=
"map"
>
SELECT
device_id AS id,
device_name AS NAME,
CONCAT( '[[', longitude, ', ', latitude, ']]' ) AS coordinates,
device_type AS type
FROM
t_device_info
WHERE
<if
test=
"name != null and name != ''"
>
device_name like concat('%', #{name}, '%') AND
</if>
longitude IS NOT NULL
AND latitude IS NOT NULL UNION
SELECT
site_station_id AS id,
site_station_name AS NAME,
CONCAT( '[[', longitude, ', ', latitude, ']]' ) AS coordinates,
'3' AS type
FROM
t_site_station_info
WHERE
<if
test=
"name != null and name != ''"
>
site_station_name like concat('%', #{name}, '%') AND
</if>
longitude IS NOT NULL
AND latitude IS NOT NULL UNION
SELECT
user_id AS id,
nick_name AS NAME,
CONCAT( '[[', longitude, ', ', latitude, ']]' ) AS coordinates,
CASE
user_type
WHEN '1' THEN
'4'
WHEN '2' THEN
'5'
WHEN '3' THEN
'6'
END AS type
FROM
t_detector_user
WHERE
<if
test=
"name != null and name != ''"
>
nick_name like concat('%', #{name}, '%') AND
</if>
longitude IS NOT NULL
AND latitude IS NOT NULL UNION
SELECT
video_manager_id AS id,
video_name AS NAME,
CONCAT( '[[', longitude, ', ', latitude, ']]' ) AS coordinates,
'7' AS type
FROM
t_video_manager
WHERE
<if
test=
"name != null and name != ''"
>
video_name like concat('%', #{name}, '%') AND
</if>
longitude IS NOT NULL
AND latitude IS NOT NULL UNION
SELECT
user_id AS id,
nick_name AS NAME,
CONCAT( '[[', longitude, ', ', latitude, ']]' ) AS coordinates,
'8' AS type
FROM
t_yehuaqi_user
WHERE
<if
test=
"name != null and name != ''"
>
nick_name like concat('%', #{name}, '%') AND
</if>
longitude IS NOT NULL
AND latitude IS NOT NULL UNION
SELECT
pipe_id AS id,
pipe_addr AS NAME,
coordinates,
'9' AS type
FROM
t_pipe_info
WHERE
<if
test=
"name != null and name != ''"
>
pipe_addr like concat('%', #{name}, '%') AND
</if>
coordinates IS NOT NULL
</select>
<select
id=
"selectDeviceList"
parameterType=
"TDeviceInfo"
resultMap=
"TDeviceInfoResult"
>
SELECT * FROM t_device_info WHERE device_name like concat('%', #{deviceName}, '%')
</select>
...
...
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