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
d62febe5
Commit
d62febe5
authored
Sep 06, 2024
by
wanghao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1 基础信息维护-用户管理-燃气用户 大屏展示数据结构 接口联调
parent
53bb98eb
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
4 deletions
+46
-4
TDetectorUserVillageSafetyDeviceInfoVo.java
...tem/domain/vo/TDetectorUserVillageSafetyDeviceInfoVo.java
+21
-0
TDetectorUserServiceImpl.java
.../zehong/system/service/impl/TDetectorUserServiceImpl.java
+21
-4
TDetectorUserMapper.xml
.../src/main/resources/mapper/system/TDetectorUserMapper.xml
+4
-0
No files found.
zh-baseversion-system/src/main/java/com/zehong/system/domain/vo/TDetectorUserVillageSafetyDeviceInfoVo.java
View file @
d62febe5
...
@@ -36,6 +36,17 @@ public class TDetectorUserVillageSafetyDeviceInfoVo {
...
@@ -36,6 +36,17 @@ public class TDetectorUserVillageSafetyDeviceInfoVo {
*/
*/
private
String
address
;
private
String
address
;
/**
* 用户的 经纬度
*/
private
String
userLongitude
;
/**
* 用户的 经纬度
*/
private
String
userLatitude
;
/**
/**
* 村庄id
* 村庄id
*/
*/
...
@@ -51,6 +62,16 @@ public class TDetectorUserVillageSafetyDeviceInfoVo {
...
@@ -51,6 +62,16 @@ public class TDetectorUserVillageSafetyDeviceInfoVo {
*/
*/
private
String
regionName
;
private
String
regionName
;
/**
* 村的 经纬度
*/
private
String
longitude
;
/**
* 村的 经纬度
*/
private
String
latitude
;
/**
/**
* 安全装置 id
* 安全装置 id
*/
*/
...
...
zh-baseversion-system/src/main/java/com/zehong/system/service/impl/TDetectorUserServiceImpl.java
View file @
d62febe5
...
@@ -266,12 +266,14 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
...
@@ -266,12 +266,14 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
for
(
Map
.
Entry
<
Long
,
List
<
TDetectorUserVillageSafetyDeviceInfoVo
>>
longListEntry
:
collect1
.
entrySet
())
{
for
(
Map
.
Entry
<
Long
,
List
<
TDetectorUserVillageSafetyDeviceInfoVo
>>
longListEntry
:
collect1
.
entrySet
())
{
Long
key1
=
longListEntry
.
getKey
();
List
<
TDetectorUserVillageSafetyDeviceInfoVo
>
value1
=
longListEntry
.
getValue
();
List
<
TDetectorUserVillageSafetyDeviceInfoVo
>
value1
=
longListEntry
.
getValue
();
// 先过滤掉 没有经纬度的
List
<
TDetectorUserVillageSafetyDeviceInfoVo
>
collect5
=
value1
.
stream
().
filter
(
item
->
item
.
getUserLatitude
()
!=
null
&&
item
.
getUserLongitude
()
!=
null
).
collect
(
Collectors
.
toList
());
// 过滤掉 没有装置的
// 过滤掉 没有装置的
List
<
TDetectorUserVillageSafetyDeviceInfoVo
>
collect2
=
value1
.
stream
().
filter
(
item
->
item
.
getGasUserSafetyDeviceId
()
==
null
).
collect
(
Collectors
.
toList
());
List
<
TDetectorUserVillageSafetyDeviceInfoVo
>
collect2
=
collect5
.
stream
().
filter
(
item
->
item
.
getGasUserSafetyDeviceId
()
==
null
).
collect
(
Collectors
.
toList
());
// 没有装置的 直接 封装用户数据
// 没有装置的 直接 封装用户数据
if
(
collect2
.
size
()
>
0
)
{
if
(
collect2
.
size
()
>
0
)
{
...
@@ -282,13 +284,20 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
...
@@ -282,13 +284,20 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
userListItem
.
put
(
"nickName"
,
tDetectorUserVillageSafetyDeviceInfoVo
.
getNickName
());
userListItem
.
put
(
"nickName"
,
tDetectorUserVillageSafetyDeviceInfoVo
.
getNickName
());
userListItem
.
put
(
"phone"
,
tDetectorUserVillageSafetyDeviceInfoVo
.
getPhone
());
userListItem
.
put
(
"phone"
,
tDetectorUserVillageSafetyDeviceInfoVo
.
getPhone
());
userListItem
.
put
(
"address"
,
tDetectorUserVillageSafetyDeviceInfoVo
.
getAddress
());
userListItem
.
put
(
"address"
,
tDetectorUserVillageSafetyDeviceInfoVo
.
getAddress
());
userListItem
.
put
(
"longitude"
,
tDetectorUserVillageSafetyDeviceInfoVo
.
getUserLongitude
());
userListItem
.
put
(
"latitude"
,
tDetectorUserVillageSafetyDeviceInfoVo
.
getUserLatitude
());
if
(
"2"
.
equals
(
tDetectorUserVillageSafetyDeviceInfoVo
.
getUserType
()))
{
userListItem
.
put
(
"iconType"
,
"61"
);
}
else
if
(
"4"
.
equals
(
tDetectorUserVillageSafetyDeviceInfoVo
.
getUserType
()))
{
userListItem
.
put
(
"iconType"
,
"18"
);
}
userListItem
.
put
(
"safetyDeviceList"
,
safetyDeviceMapList
);
userListItem
.
put
(
"safetyDeviceList"
,
safetyDeviceMapList
);
userList
.
add
(
userListItem
);
userList
.
add
(
userListItem
);
}
}
}
}
// 过滤掉 有装置的
// 过滤掉 有装置的
List
<
TDetectorUserVillageSafetyDeviceInfoVo
>
collect3
=
value1
.
stream
().
filter
(
item
->
item
.
getGasUserSafetyDeviceId
()
!=
null
).
collect
(
Collectors
.
toList
());
List
<
TDetectorUserVillageSafetyDeviceInfoVo
>
collect3
=
collect5
.
stream
().
filter
(
item
->
item
.
getGasUserSafetyDeviceId
()
!=
null
).
collect
(
Collectors
.
toList
());
if
(
collect3
.
size
()
>
0
)
{
if
(
collect3
.
size
()
>
0
)
{
...
@@ -303,6 +312,8 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
...
@@ -303,6 +312,8 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
userListItem
.
put
(
"nickName"
,
value2
.
get
(
0
).
getNickName
()
==
null
?
""
:
value2
.
get
(
0
).
getNickName
());
userListItem
.
put
(
"nickName"
,
value2
.
get
(
0
).
getNickName
()
==
null
?
""
:
value2
.
get
(
0
).
getNickName
());
userListItem
.
put
(
"phone"
,
value2
.
get
(
0
).
getPhone
()
==
null
?
""
:
value2
.
get
(
0
).
getPhone
());
userListItem
.
put
(
"phone"
,
value2
.
get
(
0
).
getPhone
()
==
null
?
""
:
value2
.
get
(
0
).
getPhone
());
userListItem
.
put
(
"address"
,
value2
.
get
(
0
).
getAddress
()
==
null
?
""
:
value2
.
get
(
0
).
getAddress
());
userListItem
.
put
(
"address"
,
value2
.
get
(
0
).
getAddress
()
==
null
?
""
:
value2
.
get
(
0
).
getAddress
());
userListItem
.
put
(
"longitude"
,
value2
.
get
(
0
).
getUserLongitude
()
==
null
?
""
:
value2
.
get
(
0
).
getUserLongitude
());
userListItem
.
put
(
"latitude"
,
value2
.
get
(
0
).
getUserLatitude
()
==
null
?
""
:
value2
.
get
(
0
).
getUserLatitude
());
userListItem
.
put
(
"safetyDeviceList"
,
safetyDeviceMapList
);
userListItem
.
put
(
"safetyDeviceList"
,
safetyDeviceMapList
);
userList
.
add
(
userListItem
);
userList
.
add
(
userListItem
);
...
@@ -420,8 +431,11 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
...
@@ -420,8 +431,11 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
// 如果没关联村的就不展示了
// 如果没关联村的就不展示了
List
<
TDetectorUserVillageSafetyDeviceInfoVo
>
collect
=
residentsUsers
.
stream
().
filter
(
item
->
item
.
getVillageId
()
!=
null
).
collect
(
Collectors
.
toList
());
List
<
TDetectorUserVillageSafetyDeviceInfoVo
>
collect
=
residentsUsers
.
stream
().
filter
(
item
->
item
.
getVillageId
()
!=
null
).
collect
(
Collectors
.
toList
());
// 村没有经纬度的就不展示了
List
<
TDetectorUserVillageSafetyDeviceInfoVo
>
collect5
=
collect
.
stream
().
filter
(
item
->
item
.
getLatitude
()
!=
null
&&
item
.
getLongitude
()
!=
null
).
collect
(
Collectors
.
toList
());
//按照 村id 分组
//按照 村id 分组
Map
<
Long
,
List
<
TDetectorUserVillageSafetyDeviceInfoVo
>>
collect1
=
collect
.
stream
().
collect
(
Collectors
.
groupingBy
(
TDetectorUserVillageSafetyDeviceInfoVo:
:
getVillageId
));
Map
<
Long
,
List
<
TDetectorUserVillageSafetyDeviceInfoVo
>>
collect1
=
collect
5
.
stream
().
collect
(
Collectors
.
groupingBy
(
TDetectorUserVillageSafetyDeviceInfoVo:
:
getVillageId
));
for
(
Map
.
Entry
<
Long
,
List
<
TDetectorUserVillageSafetyDeviceInfoVo
>>
longListEntry
:
collect1
.
entrySet
())
{
for
(
Map
.
Entry
<
Long
,
List
<
TDetectorUserVillageSafetyDeviceInfoVo
>>
longListEntry
:
collect1
.
entrySet
())
{
List
<
TDetectorUserVillageSafetyDeviceInfoVo
>
villageList
=
longListEntry
.
getValue
();
List
<
TDetectorUserVillageSafetyDeviceInfoVo
>
villageList
=
longListEntry
.
getValue
();
...
@@ -431,6 +445,9 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
...
@@ -431,6 +445,9 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
villageMapListItem
.
put
(
"villageId"
,
key1
);
villageMapListItem
.
put
(
"villageId"
,
key1
);
villageMapListItem
.
put
(
"villageName"
,
villageList
.
get
(
0
).
getVillageName
());
villageMapListItem
.
put
(
"villageName"
,
villageList
.
get
(
0
).
getVillageName
());
villageMapListItem
.
put
(
"address"
,
villageList
.
get
(
0
).
getRegionName
());
villageMapListItem
.
put
(
"address"
,
villageList
.
get
(
0
).
getRegionName
());
villageMapListItem
.
put
(
"longitude"
,
villageList
.
get
(
0
).
getLongitude
());
villageMapListItem
.
put
(
"latitude"
,
villageList
.
get
(
0
).
getLatitude
());
villageMapListItem
.
put
(
"iconType"
,
"6"
);
int
userNum
=
0
;
int
userNum
=
0
;
int
deviceNum
=
0
;
int
deviceNum
=
0
;
...
...
zh-baseversion-system/src/main/resources/mapper/system/TDetectorUserMapper.xml
View file @
d62febe5
...
@@ -306,9 +306,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -306,9 +306,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
dUser.nick_name as nickName,
dUser.nick_name as nickName,
dUser.phone,
dUser.phone,
dUser.address,
dUser.address,
dUser.longitude as userLongitude,
dUser.latitude as userLatitude,
dUser.user_type as userType,
dUser.user_type as userType,
userVillage.f_village_id as villageId,
userVillage.f_village_id as villageId,
userVillage.f_village_name as villageName,
userVillage.f_village_name as villageName,
userVillage.longitude,
userVillage.latitude,
region.f_name AS regionName ,
region.f_name AS regionName ,
safetyDeviceInfo.f_gasUser_safety_device_id as gasUserSafetyDeviceId,
safetyDeviceInfo.f_gasUser_safety_device_id as gasUserSafetyDeviceId,
safetyDeviceInfo.f_iot_no as iotNo,
safetyDeviceInfo.f_iot_no as iotNo,
...
...
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