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
84d8190b
Commit
84d8190b
authored
Sep 29, 2022
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
巡检优化
parent
959c820d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
8 deletions
+32
-8
EquipmentCategoryController.java
...n/equipmanage/controller/EquipmentCategoryController.java
+4
-8
EquipmentCategoryMapper.java
...m/yeejoin/equipmanage/mapper/EquipmentCategoryMapper.java
+12
-0
EquipmentCategoryMapper.xml
...uip/src/main/resources/mapper/EquipmentCategoryMapper.xml
+16
-0
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/EquipmentCategoryController.java
View file @
84d8190b
...
...
@@ -454,13 +454,13 @@ public class EquipmentCategoryController extends AbstractBaseController {
List
<
EquipmentCategory
>
list
=
new
ArrayList
<>();
List
<
EquipmentCategory
>
result
=
new
ArrayList
<>();
Map
<
String
,
List
<
EquipmentCategory
>>
tmpMap
=
new
HashMap
<
String
,
List
<
EquipmentCategory
>>();
final
Integer
[]
countAll
=
{
0
};
equipmentCategorys
.
forEach
(
action
->
{
String
beginName
=
action
.
getName
();
String
subCode
=
action
.
getCode
().
replaceAll
(
"0+$"
,
""
);
int
count
=
StringUtils
.
isNotEmpty
(
bizOrgCode
)?
equipmentCategoryMapper
.
countByCategoryCode
(
subCode
,
bizOrgCode
)
:
0
;
action
.
setName
(
action
.
getName
()
+
"("
+
count
+
")"
);
countAll
[
0
]
=
count
+
countAll
[
0
];
if
(
beginName
.
equals
(
"消防设施"
)
||
beginName
.
equals
(
"消防系统"
))
{
action
.
setPatrolNum
(
count
);
action
.
setParentId
(-
1L
);
...
...
@@ -481,8 +481,7 @@ public class EquipmentCategoryController extends AbstractBaseController {
EquipmentCategory
equipmentCategory
=
new
EquipmentCategory
();
equipmentCategory
.
setChildren
(
list
);
equipmentCategory
.
setCode
(
"-1"
);
equipmentCategory
.
setName
(
"消防设施("
+
countAll
[
0
]
+
")"
);
equipmentCategory
.
setPatrolNum
(
countAll
[
0
]);
equipmentCategory
.
setName
(
"消防设施("
+
((
StringUtils
.
isNotEmpty
(
bizOrgCode
)?
equipmentCategoryMapper
.
countByFacilitiesType
(
bizOrgCode
)
:
0
)
+
")"
));
equipmentCategory
.
setId
(-
1L
);
equipmentCategory
.
setHasLowerClassification
(
true
);
equipmentCategory
.
setParentId
(-
3L
);
...
...
@@ -497,11 +496,9 @@ public class EquipmentCategoryController extends AbstractBaseController {
List
<
EquipmentCategory
>
list
=
new
ArrayList
<>();
List
<
EquipmentCategory
>
result
=
new
ArrayList
<>();
Map
<
String
,
List
<
EquipmentCategory
>>
tmpMap
=
new
HashMap
<
String
,
List
<
EquipmentCategory
>>();
final
Integer
[]
countAll
=
{
0
};
equipmentCategorys
.
forEach
(
action
->
{
String
subCode
=
action
.
getCode
().
replaceAll
(
"0+$"
,
""
);
int
count
=
StringUtils
.
isNotEmpty
(
bizOrgCode
)?
equipmentCategoryMapper
.
countByCategoryCode
(
subCode
,
bizOrgCode
)
:
0
;
countAll
[
0
]
=
countAll
[
0
]
+
count
;
action
.
setName
(
action
.
getName
()
+
"("
+
count
+
")"
);
if
(
action
.
getParentId
()
==
null
)
{
action
.
setPatrolNum
(
count
);
...
...
@@ -522,9 +519,8 @@ public class EquipmentCategoryController extends AbstractBaseController {
EquipmentCategory
equipmentCategory
=
new
EquipmentCategory
();
equipmentCategory
.
setChildren
(
list
);
equipmentCategory
.
setCode
(
"-2"
);
equipmentCategory
.
setName
(
"消防装备("
+
countAll
[
0
]
+
")"
);
equipmentCategory
.
setName
(
"消防装备("
+
(
StringUtils
.
isNotEmpty
(
bizOrgCode
)?
equipmentCategoryMapper
.
countByEquipType
(
bizOrgCode
)
:
0
)
+
")"
);
equipmentCategory
.
setId
(-
2L
);
equipmentCategory
.
setPatrolNum
(
countAll
[
0
]);
equipmentCategory
.
setHasLowerClassification
(
true
);
equipmentCategory
.
setParentId
(-
3L
);
result
.
add
(
equipmentCategory
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/EquipmentCategoryMapper.java
View file @
84d8190b
...
...
@@ -73,6 +73,18 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> {
int
countByCustomType
(
@Param
(
"bizOrgCode"
)
String
bizOrgCode
);
/**
* 装备
* @return
*/
int
countByEquipType
(
@Param
(
"bizOrgCode"
)
String
bizOrgCode
);
/**
* 设施
* @return
*/
int
countByFacilitiesType
(
@Param
(
"bizOrgCode"
)
String
bizOrgCode
);
/**
* 所有数量
* @return
*/
...
...
amos-boot-system-equip/src/main/resources/mapper/EquipmentCategoryMapper.xml
View file @
84d8190b
...
...
@@ -531,4 +531,20 @@
AND is_delete = '0'
AND input_type!='1'
</select>
<select
id=
"countByEquipType"
resultType=
"int"
>
select count(*) from p_input_item
where equipment_type is not null
AND biz_org_code like concat(#{bizOrgCode}, '%')
AND is_delete = '0'
AND input_type!='1'
</select>
<select
id=
"countByFacilitiesType"
resultType=
"int"
>
select count(*) from p_input_item
where facilities_type is not null
AND biz_org_code like concat(#{bizOrgCode}, '%')
AND is_delete = '0'
AND input_type!='1'
</select>
</mapper>
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