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
6f4e6112
Commit
6f4e6112
authored
Dec 30, 2021
by
chenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
9779c339
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
41 deletions
+18
-41
FireFightingSystemServiceImpl.java
...uipmanage/service/impl/FireFightingSystemServiceImpl.java
+18
-41
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/FireFightingSystemServiceImpl.java
View file @
6f4e6112
...
@@ -999,59 +999,30 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
...
@@ -999,59 +999,30 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
public
Object
getEquipmentTypeAndCount
(
String
bizOrgCode
)
throws
Exception
{
public
Object
getEquipmentTypeAndCount
(
String
bizOrgCode
)
throws
Exception
{
List
<
EquipmentCategory
>
equipmentTypeList
=
null
;
List
<
EquipmentCategory
>
equipmentTypeList
=
null
;
if
(
redisUtils
.
hasKey
(
equipTypeAndCount
))
{
//
if (redisUtils.hasKey(equipTypeAndCount)) {
equipmentTypeList
=
JSONArray
.
parseArray
(
JSONArray
.
toJSONString
(
redisUtils
.
get
(
equipTypeAndCount
)),
EquipmentCategory
.
class
);
//
equipmentTypeList = JSONArray.parseArray(JSONArray.toJSONString(redisUtils.get(equipTypeAndCount)), EquipmentCategory.class);
}
else
{
//
} else {
List
<
EquipmentCategory
>
responseList
=
this
.
typeList
();
List
<
EquipmentCategory
>
responseList
=
this
.
typeList
();
if
(
responseList
==
null
||
responseList
.
size
()<
1
)
{
if
(
responseList
==
null
||
responseList
.
size
()<
1
)
{
return
null
;
return
null
;
}
}
equipmentTypeList
=
responseList
.
stream
().
filter
(
i
->!
"20000000"
.
equals
(
i
.
getCode
())
&&
"2"
.
equals
(
i
.
getIndustryCode
())).
collect
(
Collectors
.
toList
());
equipmentTypeList
=
responseList
.
stream
().
filter
(
i
->!
i
.
getCode
().
startsWith
(
"2"
)
&&
"2"
.
equals
(
i
.
getIndustryCode
())).
collect
(
Collectors
.
toList
());
redisUtils
.
set
(
equipTypeAndCount
,
equipmentTypeList
);
// }
}
return
typeListTree
(
equipmentTypeList
,
bizOrgCode
,
SourceTypeEnum
.
EQUIPMENT
);
getCountToChildren
(
equipmentTypeList
,
bizOrgCode
);
return
equipmentTypeList
;
}
}
public
Object
getCountToChildren
(
List
<
EquipmentCategory
>
children
,
String
bizOrgCode
)
throws
Exception
{
for
(
EquipmentCategory
equipmentCategory
:
children
)
{
int
num
=
sourceStatistics
.
equipCategoryStatistics
(
bizOrgCode
,
SourceTypeEnum
.
EQUIPMENT
,
equipmentCategory
.
getCode
());
equipmentCategory
.
setCount
(
Double
.
parseDouble
(
num
+
""
));
List
<
EquipmentCategory
>
childrenList
=
equipmentCategory
.
getChildren
();
if
(
childrenList
!=
null
&&
childrenList
.
size
()>
0
)
{
getCountToChildren
(
childrenList
,
bizOrgCode
);
}
}
return
children
;
}
public
Object
getCarTypeAndCount
(
String
bizOrgCode
)
throws
Exception
{
public
Object
getCarTypeAndCount
(
String
bizOrgCode
)
throws
Exception
{
List
<
EquipmentCategory
>
equipmentTypeList
=
null
;
List
<
EquipmentCategory
>
equipmentTypeList
=
null
;
if
(
redisUtils
.
hasKey
(
carTypeAndCount
))
{
//
if (redisUtils.hasKey(carTypeAndCount)) {
equipmentTypeList
=
JSONArray
.
parseArray
(
JSONArray
.
toJSONString
(
redisUtils
.
get
(
carTypeAndCount
)),
EquipmentCategory
.
class
);
//
equipmentTypeList = JSONArray.parseArray(JSONArray.toJSONString(redisUtils.get(carTypeAndCount)), EquipmentCategory.class);
}
else
{
//
} else {
List
<
EquipmentCategory
>
responseList
=
this
.
typeList
();
List
<
EquipmentCategory
>
responseList
=
this
.
typeList
();
if
(
responseList
==
null
||
responseList
.
size
()<
1
)
{
if
(
responseList
==
null
||
responseList
.
size
()<
1
)
{
return
null
;
return
null
;
}
}
equipmentTypeList
=
responseList
.
stream
().
filter
(
i
->
"20000000"
.
equals
(
i
.
getCode
())
&&
"2"
.
equals
(
i
.
getIndustryCode
())).
collect
(
Collectors
.
toList
());
equipmentTypeList
=
responseList
.
stream
().
filter
(
i
->
i
.
getCode
().
startsWith
(
"2"
)
&&
"2"
.
equals
(
i
.
getIndustryCode
())).
collect
(
Collectors
.
toList
());
redisUtils
.
set
(
carTypeAndCount
,
equipmentTypeList
);
// }
}
return
typeListTree
(
equipmentTypeList
,
bizOrgCode
,
SourceTypeEnum
.
CAR
);
getCountToChildren
(
equipmentTypeList
,
bizOrgCode
);
return
equipmentTypeList
;
}
public
Object
getCarCountToChildren
(
List
<
EquipmentCategory
>
children
,
String
bizOrgCode
)
throws
Exception
{
for
(
EquipmentCategory
equipmentCategory
:
children
)
{
int
num
=
sourceStatistics
.
equipCategoryStatistics
(
bizOrgCode
,
SourceTypeEnum
.
CAR
,
equipmentCategory
.
getCode
());
equipmentCategory
.
setCount
(
Double
.
parseDouble
(
num
+
""
));
List
<
EquipmentCategory
>
childrenList
=
equipmentCategory
.
getChildren
();
if
(
childrenList
!=
null
&&
childrenList
.
size
()>
0
)
{
getCarCountToChildren
(
childrenList
,
bizOrgCode
);
}
}
return
children
;
}
}
...
@@ -1059,9 +1030,14 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
...
@@ -1059,9 +1030,14 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
public
List
<
EquipmentCategory
>
typeList
()
{
public
List
<
EquipmentCategory
>
typeList
()
{
List
<
EquipmentCategory
>
equipmentCategorys
=
this
.
iEquipmentCategoryService
List
<
EquipmentCategory
>
equipmentCategorys
=
this
.
iEquipmentCategoryService
.
getEquipmentCategoryList
(
Integer
.
valueOf
(
equipmentCategoryLeftTypeCode
));
.
getEquipmentCategoryList
(
Integer
.
valueOf
(
equipmentCategoryLeftTypeCode
));
return
equipmentCategorys
;
}
public
List
<
EquipmentCategory
>
typeListTree
(
List
<
EquipmentCategory
>
equipmentCategorys
,
String
bizOrgCode
,
SourceTypeEnum
sourceTypeEnum
)
{
List
<
EquipmentCategory
>
list
=
new
ArrayList
<>();
List
<
EquipmentCategory
>
list
=
new
ArrayList
<>();
Map
<
String
,
List
<
EquipmentCategory
>>
tmpMap
=
new
HashMap
<
String
,
List
<
EquipmentCategory
>>();
Map
<
String
,
List
<
EquipmentCategory
>>
tmpMap
=
new
HashMap
<
String
,
List
<
EquipmentCategory
>>();
equipmentCategorys
.
forEach
(
action
->
{
equipmentCategorys
.
forEach
(
action
->
{
int
num
=
sourceStatistics
.
equipCategoryStatistics
(
bizOrgCode
,
sourceTypeEnum
,
action
.
getCode
());
action
.
setCount
(
Double
.
parseDouble
(
num
+
""
));
if
(
action
.
getParentId
()
==
null
)
{
if
(
action
.
getParentId
()
==
null
)
{
list
.
add
(
action
);
list
.
add
(
action
);
}
else
{
}
else
{
...
@@ -1079,6 +1055,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
...
@@ -1079,6 +1055,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
getChildren
(
list
,
tmpMap
);
getChildren
(
list
,
tmpMap
);
return
list
;
return
list
;
}
}
private
void
getChildren
(
List
<
EquipmentCategory
>
list
,
Map
<
String
,
List
<
EquipmentCategory
>>
tmpMap
)
{
private
void
getChildren
(
List
<
EquipmentCategory
>
list
,
Map
<
String
,
List
<
EquipmentCategory
>>
tmpMap
)
{
for
(
EquipmentCategory
equipmentCategory
:
list
)
{
for
(
EquipmentCategory
equipmentCategory
:
list
)
{
if
(
tmpMap
.
get
(
equipmentCategory
.
getId
().
toString
())
!=
null
if
(
tmpMap
.
get
(
equipmentCategory
.
getId
().
toString
())
!=
null
...
...
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