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
37db670d
Commit
37db670d
authored
Oct 11, 2023
by
KeYong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
0896769b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
10 deletions
+57
-10
OrgMenuDto.java
...java/com/yeejoin/amos/boot/biz/common/dto/OrgMenuDto.java
+11
-0
FireFightingSystemServiceImpl.java
...uipmanage/service/impl/FireFightingSystemServiceImpl.java
+40
-6
FireFightingSystemMapper.xml
...ip/src/main/resources/mapper/FireFightingSystemMapper.xml
+6
-4
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/dto/OrgMenuDto.java
View file @
37db670d
...
@@ -26,6 +26,7 @@ public class OrgMenuDto {
...
@@ -26,6 +26,7 @@ public class OrgMenuDto {
private
String
bizOrgType
;
private
String
bizOrgType
;
private
String
bizOrgCode
;
private
String
bizOrgCode
;
private
Integer
num
;
private
Integer
num
;
private
String
code
;
public
Boolean
getLeaf
()
{
public
Boolean
getLeaf
()
{
return
ObjectUtils
.
isEmpty
(
children
);
return
ObjectUtils
.
isEmpty
(
children
);
...
@@ -61,6 +62,16 @@ public class OrgMenuDto {
...
@@ -61,6 +62,16 @@ public class OrgMenuDto {
this
.
leaf
=
leaf
;
this
.
leaf
=
leaf
;
}
}
public
OrgMenuDto
(
Long
key
,
String
title
,
Long
parentId
,
boolean
leaf
,
String
bizOrgCode
,
String
code
)
{
super
();
this
.
key
=
key
;
this
.
title
=
title
;
this
.
parentId
=
parentId
;
this
.
leaf
=
leaf
;
this
.
bizOrgCode
=
bizOrgCode
;
this
.
code
=
code
;
}
public
OrgMenuDto
(
Long
key
,
String
title
,
Long
parentId
,
String
bizOrgType
)
{
public
OrgMenuDto
(
Long
key
,
String
title
,
Long
parentId
,
String
bizOrgType
)
{
this
.
key
=
key
;
this
.
key
=
key
;
this
.
title
=
title
;
this
.
title
=
title
;
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/FireFightingSystemServiceImpl.java
View file @
37db670d
...
@@ -2514,11 +2514,12 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
...
@@ -2514,11 +2514,12 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
@Override
@Override
public
List
<
OrgMenuDto
>
getSystemEquipTree
(
String
systemCode
)
{
public
List
<
OrgMenuDto
>
getSystemEquipTree
(
String
systemCode
)
{
FeignClientResult
<
List
<
OrgUsrDto
>>
feignClientResult
=
jcsFeignClient
.
getCompanyDeptListWithAuth
(
authKey
,
"COMPANY"
,
"dl"
);
// 此卡片在站端使用,由于远程调用jcs耗时,所以暂注释掉
String
bizOrgCode
=
feignClientResult
.
getResult
().
get
(
0
).
getBizOrgCode
();
// FeignClientResult<List<OrgUsrDto>> feignClientResult = jcsFeignClient.getCompanyDeptListWithAuth(authKey, "COMPANY", "dl");
// String bizOrgCode = feignClientResult.getResult().get(0).getBizOrgCode();
List
<
OrgMenuDto
>
resList
=
new
ArrayList
<>();
List
<
OrgMenuDto
>
resList
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
list
=
fireFightingSystemMapper
.
getEquipmentAndEquipSpeTree
(
bizOrgCode
,
systemCode
);
List
<
Map
<
String
,
Object
>>
list
=
fireFightingSystemMapper
.
getEquipmentAndEquipSpeTree
(
null
,
systemCode
);
List
<
OrgMenuDto
>
childrenRes
=
systemAndEquipmentTree
(
list
);
List
<
OrgMenuDto
>
childrenRes
=
systemAndEquipmentTree
New
(
list
);
OrgMenuDto
dto
=
new
OrgMenuDto
();
OrgMenuDto
dto
=
new
OrgMenuDto
();
FireFightingSystemEntity
entity
=
fireFightingSystemMapper
.
selectOne
(
new
QueryWrapper
<
FireFightingSystemEntity
>().
eq
(
"code"
,
systemCode
));
FireFightingSystemEntity
entity
=
fireFightingSystemMapper
.
selectOne
(
new
QueryWrapper
<
FireFightingSystemEntity
>().
eq
(
"code"
,
systemCode
));
dto
.
setKey
(
entity
.
getId
());
dto
.
setKey
(
entity
.
getId
());
...
@@ -2533,6 +2534,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
...
@@ -2533,6 +2534,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
if
(
0
<
list
.
size
())
{
if
(
0
<
list
.
size
())
{
childrenRes
=
childrenRes
.
stream
().
map
(
x
->
{
childrenRes
=
childrenRes
.
stream
().
map
(
x
->
{
x
.
setParentId
(
entity
.
getId
());
x
.
setParentId
(
entity
.
getId
());
x
.
setIsLeaf
(
true
);
x
.
setLeaf
(
true
);
x
.
setNum
(
x
.
getChildren
().
size
()
>
0
?
x
.
getChildren
().
size
()
:
0
);
x
.
setNum
(
x
.
getChildren
().
size
()
>
0
?
x
.
getChildren
().
size
()
:
0
);
return
x
;
return
x
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
...
@@ -2544,9 +2547,40 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
...
@@ -2544,9 +2547,40 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
@Override
@Override
public
Page
<
Map
<
String
,
Object
>>
getEquipmentsBySystemInfo
(
Page
page
,
String
systemCode
,
String
equipmentCode
)
{
public
Page
<
Map
<
String
,
Object
>>
getEquipmentsBySystemInfo
(
Page
page
,
String
systemCode
,
String
equipmentCode
)
{
FeignClientResult
<
List
<
OrgUsrDto
>>
feignClientResult
=
jcsFeignClient
.
getCompanyDeptListWithAuth
(
authKey
,
"COMPANY"
,
"dl"
);
//
FeignClientResult<List<OrgUsrDto>> feignClientResult = jcsFeignClient.getCompanyDeptListWithAuth(authKey, "COMPANY", "dl");
String
bizOrgCode
=
feignClientResult
.
getResult
().
get
(
0
).
getBizOrgCode
();
//
String bizOrgCode = feignClientResult.getResult().get(0).getBizOrgCode();
return
fireFightingSystemMapper
.
getEquipmentsBySystemInfo
(
page
,
null
,
systemCode
,
equipmentCode
);
return
fireFightingSystemMapper
.
getEquipmentsBySystemInfo
(
page
,
null
,
systemCode
,
equipmentCode
);
}
}
public
static
List
<
OrgMenuDto
>
systemAndEquipmentTreeNew
(
List
<
Map
<
String
,
Object
>>
list
)
{
List
<
OrgMenuDto
>
menuList
=
list
.
stream
()
.
map
(
o
->
new
OrgMenuDto
(
Long
.
parseLong
(
o
.
get
(
"id"
).
toString
()),
o
.
get
(
"name"
).
toString
(),
ObjectUtils
.
isEmpty
(
o
.
get
(
"parentId"
))
?
0L
:
Long
.
parseLong
(
o
.
get
(
"parentId"
).
toString
()),
false
,
o
.
get
(
"bizOrgCode"
).
toString
(),
ObjectUtils
.
isEmpty
(
o
.
get
(
"code"
))
?
""
:
o
.
get
(
"code"
).
toString
()))
.
collect
(
Collectors
.
toList
());
List
<
OrgMenuDto
>
result
=
new
ArrayList
<>();
Map
<
Long
,
OrgMenuDto
>
map
=
new
HashMap
<>(
menuList
.
size
());
menuList
.
forEach
(
e
->
map
.
put
(
e
.
getKey
(),
e
));
Set
<?
extends
Map
.
Entry
<
Long
,
?
extends
OrgMenuDto
>>
entries
=
map
.
entrySet
();
// 此处多线程,会value 出现null 的情况
// entries.parallelStream().forEach(entry -> {
entries
.
forEach
(
entry
->
{
OrgMenuDto
value
=
entry
.
getValue
();
if
(
value
!=
null
)
{
OrgMenuDto
treeDto
=
map
.
get
(
value
.
getParentId
());
if
(
treeDto
!=
null
)
{
List
<
OrgMenuDto
>
children
=
treeDto
.
getChildren
();
if
(
children
==
null
)
{
children
=
new
ArrayList
<>();
treeDto
.
setChildren
(
children
);
}
children
.
add
(
value
);
}
else
{
result
.
add
(
value
);
}
}
});
return
result
;
}
}
}
amos-boot-system-equip/src/main/resources/mapper/FireFightingSystemMapper.xml
View file @
37db670d
...
@@ -5987,19 +5987,20 @@
...
@@ -5987,19 +5987,20 @@
JOIN wl_equipment_detail AS det ON wes.equipment_detail_id = det.id
JOIN wl_equipment_detail AS det ON wes.equipment_detail_id = det.id
JOIN wl_equipment AS wle ON wle.id = det.equipment_id
JOIN wl_equipment AS wle ON wle.id = det.equipment_id
LEFT JOIN f_fire_fighting_system fs ON FIND_IN_SET(fs.id, wes.system_id)
LEFT JOIN f_fire_fighting_system fs ON FIND_IN_SET(fs.id, wes.system_id)
WHERE
<where>
<if
test=
"bizOrgCode!=null and bizOrgCode!=''"
>
<if
test=
"bizOrgCode!=null and bizOrgCode!=''"
>
wes.biz_org_code like concat(#{bizOrgCode}, '%')
wes.biz_org_code like concat(#{bizOrgCode}, '%')
</if>
</if>
<if
test=
"systemCode != null and systemCode != ''"
>
<if
test=
"systemCode != null and systemCode != ''"
>
AND fs.`code` = #{systemCode}
AND fs.`code` = #{systemCode}
</if>
</if>
</where>
) UNION
) UNION
(
(
SELECT
SELECT
wes.id,
wes.id,
wes.`name`,
wes.`name`,
w
es
.`code`,
w
le
.`code`,
0,
0,
wle.id AS parentId,
wle.id AS parentId,
wes.biz_org_code bizOrgCode
wes.biz_org_code bizOrgCode
...
@@ -6008,13 +6009,14 @@
...
@@ -6008,13 +6009,14 @@
LEFT JOIN wl_equipment_detail AS det ON wes.equipment_detail_id = det.id
LEFT JOIN wl_equipment_detail AS det ON wes.equipment_detail_id = det.id
LEFT JOIN wl_equipment AS wle ON wle.id = det.equipment_id
LEFT JOIN wl_equipment AS wle ON wle.id = det.equipment_id
LEFT JOIN f_fire_fighting_system fs ON FIND_IN_SET(fs.id, wes.system_id)
LEFT JOIN f_fire_fighting_system fs ON FIND_IN_SET(fs.id, wes.system_id)
WHERE
<where>
<if
test=
"bizOrgCode!=null and bizOrgCode!=''"
>
<if
test=
"bizOrgCode!=null and bizOrgCode!=''"
>
wes.biz_org_code like concat(#{bizOrgCode}, '%')
wes.biz_org_code like concat(#{bizOrgCode}, '%')
</if>
</if>
<if
test=
"systemCode != null and systemCode != ''"
>
<if
test=
"systemCode != null and systemCode != ''"
>
AND fs.`code` = #{systemCode}
AND fs.`code` = #{systemCode}
</if>
</if>
</where>
)
)
)a
)a
JOIN mysql.help_topic b ON b.help_topic_id
<
(
JOIN mysql.help_topic b ON b.help_topic_id
<
(
...
@@ -6036,7 +6038,7 @@
...
@@ -6036,7 +6038,7 @@
'正常'
'正常'
ELSE '异常'
ELSE '异常'
END AS equipStatus,
END AS equipStatus,
detail.
standard
IFNULL(detail.standard, '') AS
standard
FROM
FROM
wl_equipment_specific spec
wl_equipment_specific spec
JOIN wl_equipment_detail detail ON spec.equipment_detail_id = detail.id
JOIN wl_equipment_detail detail ON spec.equipment_detail_id = detail.id
...
...
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