Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
19470ed7
Commit
19470ed7
authored
May 24, 2024
by
KeYong
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop_dl' of
http://36.40.66.175:5000/moa/amos-boot-biz
into develop_dl
parents
e6f6c5f7
346bfd7a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
15 deletions
+30
-15
FireFightingSystemGroupServiceImpl.java
...nage/service/impl/FireFightingSystemGroupServiceImpl.java
+23
-9
EquipmentSpecificMapper.xml
...uip/src/main/resources/mapper/EquipmentSpecificMapper.xml
+3
-2
FireFightingSystemMapper.xml
...ip/src/main/resources/mapper/FireFightingSystemMapper.xml
+4
-4
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/FireFightingSystemGroupServiceImpl.java
View file @
19470ed7
...
@@ -41,9 +41,9 @@ public class FireFightingSystemGroupServiceImpl extends ServiceImpl<FireFighting
...
@@ -41,9 +41,9 @@ public class FireFightingSystemGroupServiceImpl extends ServiceImpl<FireFighting
private
IFireFightingSystemService
fireFightingSystemService
;
private
IFireFightingSystemService
fireFightingSystemService
;
/**
/**
* 获取
未绑定分组的
系统列表
* 获取
消防
系统列表
*
*
* @param bizOrgCode
* @param bizOrgCode
bizOrgCode
*/
*/
@Override
@Override
public
JSONArray
selectUnboundSystems
(
String
bizOrgCode
)
{
public
JSONArray
selectUnboundSystems
(
String
bizOrgCode
)
{
...
@@ -65,6 +65,7 @@ public class FireFightingSystemGroupServiceImpl extends ServiceImpl<FireFighting
...
@@ -65,6 +65,7 @@ public class FireFightingSystemGroupServiceImpl extends ServiceImpl<FireFighting
jsonObject
.
put
(
"id"
,
system
.
getId
());
jsonObject
.
put
(
"id"
,
system
.
getId
());
jsonObject
.
put
(
"name"
,
system
.
getName
());
jsonObject
.
put
(
"name"
,
system
.
getName
());
if
(!
systemIds
.
contains
(
system
.
getId
()))
{
if
(!
systemIds
.
contains
(
system
.
getId
()))
{
// isBound: 是否已绑定分组
jsonObject
.
put
(
"isBound"
,
true
);
jsonObject
.
put
(
"isBound"
,
true
);
}
else
{
}
else
{
jsonObject
.
put
(
"isBound"
,
false
);
jsonObject
.
put
(
"isBound"
,
false
);
...
@@ -133,7 +134,7 @@ public class FireFightingSystemGroupServiceImpl extends ServiceImpl<FireFighting
...
@@ -133,7 +134,7 @@ public class FireFightingSystemGroupServiceImpl extends ServiceImpl<FireFighting
// 分组信息入库
// 分组信息入库
FireFightingSystemGroupEntity
fireFightingSystemGroupEntity
=
FireFightingSystemGroupEntity
.
builder
()
FireFightingSystemGroupEntity
fireFightingSystemGroupEntity
=
FireFightingSystemGroupEntity
.
builder
()
.
groupName
(
fireFightingSystemGroupModalDto
.
getGroupName
())
.
groupName
(
fireFightingSystemGroupModalDto
.
getGroupName
())
.
groupCode
(
System
.
currentTimeMillis
()
+
""
)
// TODO
.
groupCode
(
new
StringBuilder
(
String
.
valueOf
(
System
.
currentTimeMillis
())).
reverse
().
toString
())
.
displayType
(
fireFightingSystemGroupModalDto
.
getDisplayType
())
.
displayType
(
fireFightingSystemGroupModalDto
.
getDisplayType
())
.
systemIds
(
String
.
join
(
","
,
sortedSystemIds
))
.
systemIds
(
String
.
join
(
","
,
sortedSystemIds
))
.
remarks
(
""
)
.
remarks
(
""
)
...
@@ -193,6 +194,7 @@ public class FireFightingSystemGroupServiceImpl extends ServiceImpl<FireFighting
...
@@ -193,6 +194,7 @@ public class FireFightingSystemGroupServiceImpl extends ServiceImpl<FireFighting
* @return 分组列表
* @return 分组列表
*/
*/
@Override
@Override
@SuppressWarnings
(
"unchecked"
)
public
JSONArray
listGroup
(
String
bizOrgCode
)
{
public
JSONArray
listGroup
(
String
bizOrgCode
)
{
List
<
FireFightingSystemGroupEntity
>
groupEntities
=
fireFightingSystemGroupMapper
.
selectList
(
List
<
FireFightingSystemGroupEntity
>
groupEntities
=
fireFightingSystemGroupMapper
.
selectList
(
Wrappers
.<
FireFightingSystemGroupEntity
>
lambdaQuery
()
Wrappers
.<
FireFightingSystemGroupEntity
>
lambdaQuery
()
...
@@ -228,12 +230,24 @@ public class FireFightingSystemGroupServiceImpl extends ServiceImpl<FireFighting
...
@@ -228,12 +230,24 @@ public class FireFightingSystemGroupServiceImpl extends ServiceImpl<FireFighting
}
}
}
}
// List to Map -> key:
equipmentId, value: 装备定义数量
// List to Map -> key:
systemId@equipmentId, value: 装备定义数量Map
List
<
Map
<
String
,
Object
>>
equipmentCountList
=
equipmentSpecificMapper
.
getEquipmentCount
(
bizOrgCode
);
List
<
Map
<
String
,
Object
>>
equipmentCountList
=
equipmentSpecificMapper
.
getEquipmentCount
(
bizOrgCode
);
Map
<
Long
,
Map
<
String
,
Object
>>
equipmentCountMap
=
equipmentCountList
.
stream
().
map
(
map
->
new
HashMap
<
Long
,
Map
<
String
,
Object
>>()
{{
Map
<
String
,
Map
<
String
,
Object
>>
equipmentCountMap
=
new
HashMap
<>();
put
(
Long
.
valueOf
(
map
.
get
(
"equipmentId"
).
toString
()),
map
);
for
(
Map
<
String
,
Object
>
map
:
equipmentCountList
)
{
}}).
collect
(
Collectors
.
toMap
(
map
->
map
.
keySet
().
iterator
().
next
(),
map
->
map
.
values
().
iterator
().
next
()));
String
equipmentId
=
map
.
getOrDefault
(
"equipmentId"
,
""
).
toString
();
String
systemId
=
map
.
getOrDefault
(
"systemId"
,
""
).
toString
();
String
[]
ids
=
systemId
.
split
(
","
);
for
(
String
id
:
ids
)
{
String
uniqueKey
=
id
+
"@"
+
equipmentId
;
if
(
equipmentCountMap
.
containsKey
(
uniqueKey
))
{
Map
<
String
,
Object
>
objectMap
=
equipmentCountMap
.
get
(
uniqueKey
);
objectMap
.
put
(
"count"
,
Long
.
parseLong
(
map
.
getOrDefault
(
"count"
,
"0"
).
toString
())
+
Long
.
parseLong
(
objectMap
.
getOrDefault
(
"count"
,
0
).
toString
()));
}
equipmentCountMap
.
put
(
uniqueKey
,
map
);
}
}
// 构建分组对象
JSONArray
groups
=
new
JSONArray
();
JSONArray
groups
=
new
JSONArray
();
for
(
FireFightingSystemGroupEntity
groupEntity
:
groupEntities
)
{
for
(
FireFightingSystemGroupEntity
groupEntity
:
groupEntities
)
{
JSONObject
group
=
new
JSONObject
();
JSONObject
group
=
new
JSONObject
();
...
@@ -263,8 +277,8 @@ public class FireFightingSystemGroupServiceImpl extends ServiceImpl<FireFighting
...
@@ -263,8 +277,8 @@ public class FireFightingSystemGroupServiceImpl extends ServiceImpl<FireFighting
List
<
Map
<
String
,
Object
>>
equipments
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
equipments
=
new
ArrayList
<>();
for
(
SystemEquipmentRelationEntity
relationEntity
:
relationEntities
)
{
for
(
SystemEquipmentRelationEntity
relationEntity
:
relationEntities
)
{
Long
equipmentId
=
relationEntity
.
getEquipmentId
();
Long
equipmentId
=
relationEntity
.
getEquipmentId
();
if
(
equipmentCountMap
.
containsKey
(
equipmentId
))
{
if
(
equipmentCountMap
.
containsKey
(
systemId
+
"@"
+
equipmentId
))
{
Map
<
String
,
Object
>
equipmentMap
=
equipmentCountMap
.
get
(
equipmentId
);
Map
<
String
,
Object
>
equipmentMap
=
equipmentCountMap
.
get
(
systemId
+
"@"
+
equipmentId
);
Map
<
String
,
Object
>
equipment
=
new
HashMap
<>();
Map
<
String
,
Object
>
equipment
=
new
HashMap
<>();
equipment
.
put
(
"id"
,
equipmentMap
.
get
(
"equipmentId"
));
equipment
.
put
(
"id"
,
equipmentMap
.
get
(
"equipmentId"
));
equipment
.
put
(
"name"
,
equipmentMap
.
get
(
"equipmentName"
));
equipment
.
put
(
"name"
,
equipmentMap
.
get
(
"equipmentName"
));
...
...
amos-boot-system-equip/src/main/resources/mapper/EquipmentSpecificMapper.xml
View file @
19470ed7
...
@@ -113,6 +113,7 @@
...
@@ -113,6 +113,7 @@
SELECT
SELECT
we.id AS equipmentId,
we.id AS equipmentId,
we.name AS equipmentName,
we.name AS equipmentName,
wesp.system_id AS systemId,
count(1) AS count,
count(1) AS count,
u.name AS unit
u.name AS unit
FROM
FROM
...
@@ -121,13 +122,13 @@
...
@@ -121,13 +122,13 @@
LEFT JOIN wl_equipment we ON wsd.equipment_id = we.id
LEFT JOIN wl_equipment we ON wsd.equipment_id = we.id
LEFT JOIN wl_unit u on u.id = we.unit_id
LEFT JOIN wl_unit u on u.id = we.unit_id
<where>
<where>
we.id IS NOT NULL
we.id IS NOT NULL
AND wesp.system_id IS NOT NULL
<if
test=
"bizOrgCode != null and bizOrgCode != ''"
>
<if
test=
"bizOrgCode != null and bizOrgCode != ''"
>
AND wesp.biz_org_code like concat(#{bizOrgCode},'%')
AND wesp.biz_org_code like concat(#{bizOrgCode},'%')
</if>
</if>
</where>
</where>
GROUP BY
GROUP BY
we.code
we.code
, wesp.system_id
</select>
</select>
<select
id=
"selectEquipmentSpecific"
resultMap=
"ComplementCode"
>
<select
id=
"selectEquipmentSpecific"
resultMap=
"ComplementCode"
>
SELECT
SELECT
...
...
amos-boot-system-equip/src/main/resources/mapper/FireFightingSystemMapper.xml
View file @
19470ed7
...
@@ -96,10 +96,10 @@
...
@@ -96,10 +96,10 @@
<select
id=
"getEquipCountBySystemId"
resultMap=
"EquipCountBySystemId"
>
<select
id=
"getEquipCountBySystemId"
resultMap=
"EquipCountBySystemId"
>
SELECT
SELECT
wle.id equipment_id,
wle.id equipment_id,
det
.NAME equipment_name,
wle
.NAME equipment_name,
count(spe.id) num,
count(spe.id) num,
unit.name unit_name,
unit.name unit_name,
wle.img,
wle.
shbz_img
img,
cate.NAME AS equipmentCateGoryName
cate.NAME AS equipmentCateGoryName
FROM
FROM
wl_equipment_specific AS spe
wl_equipment_specific AS spe
...
@@ -114,10 +114,10 @@
...
@@ -114,10 +114,10 @@
<select
id=
"getEquipCountPageBySystemId"
resultMap=
"EquipCountBySystemId"
>
<select
id=
"getEquipCountPageBySystemId"
resultMap=
"EquipCountBySystemId"
>
SELECT
SELECT
wle.id equipment_id,
wle.id equipment_id,
det
.NAME equipment_name,
wle
.NAME equipment_name,
count(spe.id) num,
count(spe.id) num,
unit.name unit_name,
unit.name unit_name,
wle.img,
wle.
shbz_img
img,
cate.NAME AS equipmentCateGoryName
cate.NAME AS equipmentCateGoryName
FROM
FROM
wl_equipment_specific AS spe
wl_equipment_specific AS spe
...
...
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