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
408734f5
Commit
408734f5
authored
Sep 26, 2024
by
KeYong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改消防器材接口排序问题
parent
76cf9c14
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
152 additions
and
19 deletions
+152
-19
DataDictionaryController.java
.../boot/biz/common/controller/DataDictionaryController.java
+13
-0
Menu.java
...ain/java/com/yeejoin/amos/boot/biz/common/utils/Menu.java
+29
-2
TreeParser.java
...va/com/yeejoin/amos/boot/biz/common/utils/TreeParser.java
+69
-0
FireResourceSupervisionController.java
...pmanage/controller/FireResourceSupervisionController.java
+2
-1
JcsFeign.java
...src/main/java/com/yeejoin/equipmanage/fegin/JcsFeign.java
+1
-1
FireFightingSystemMapper.java
.../yeejoin/equipmanage/mapper/FireFightingSystemMapper.java
+4
-1
IFireResourceSupervisionService.java
.../equipmanage/service/IFireResourceSupervisionService.java
+2
-1
IFireResourceSupervisionServiceImpl.java
...age/service/impl/IFireResourceSupervisionServiceImpl.java
+24
-7
FireFightingSystemMapper.xml
...ip/src/main/resources/mapper/FireFightingSystemMapper.xml
+8
-6
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/controller/DataDictionaryController.java
View file @
408734f5
...
...
@@ -243,6 +243,19 @@ public class DataDictionaryController extends BaseController {
}
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/dataDictionaryIdFillMenuHasSort"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据字典类型查询字典,id为SequenceNbr"
,
notes
=
"根据字典类型查询字典,id为SequenceNbr"
)
public
ResponseModel
<
Object
>
getDictionaryWithTreeFillIdHasSort
(
@RequestParam
String
type
)
throws
Exception
{
QueryWrapper
<
DataDictionary
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"type"
,
type
);
queryWrapper
.
orderByAsc
(
"sort_num"
);
Collection
<
DataDictionary
>
list
=
iDataDictionaryService
.
list
(
queryWrapper
);
List
<
Menu
>
menus
=
TreeParser
.
getSortTree
(
null
,
list
,
DataDictionary
.
class
.
getName
(),
"getSequenceNbr"
,
2
,
"getName"
,
"getParent"
,
"getSortNum"
,
null
,
"getCode"
);
return
ResponseHelper
.
buildResponse
(
menus
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/dataDictionary"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据字典类型查询字典2"
,
notes
=
"根据字典类型查询字典2"
)
...
...
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/utils/Menu.java
View file @
408734f5
...
...
@@ -17,13 +17,21 @@ public class Menu {
public
Boolean
isRoot
;
public
List
<
Menu
>
children
;
public
String
treeCode
;
public
int
num
;
public
Integer
sortNum
;
public
int
num
;
public
int
getNum
()
{
return
num
;
}
public
void
setNum
(
int
num
)
{
this
.
num
=
num
;
}
public
Integer
getSortNum
()
{
return
sortNum
;
}
public
void
setSortNum
(
Integer
sortNum
)
{
this
.
sortNum
=
sortNum
;
}
public
Menu
(
Long
id
,
String
name
,
Long
parentId2
,
int
num
)
{
super
();
this
.
id
=
id
;
...
...
@@ -31,6 +39,16 @@ public class Menu {
this
.
parentId
=
parentId2
;
this
.
num
=
num
;
}
public
Menu
(
Long
id
,
String
name
,
Long
parentId2
,
int
num
,
Integer
sortNum
)
{
super
();
this
.
id
=
id
;
this
.
name
=
name
;
this
.
parentId
=
parentId2
;
this
.
num
=
num
;
this
.
sortNum
=
sortNum
;
}
public
Menu
(
Long
id
,
String
name
,
Long
parentId2
,
int
num
,
String
treeCode
)
{
super
();
this
.
id
=
id
;
...
...
@@ -39,6 +57,16 @@ public class Menu {
this
.
num
=
num
;
this
.
treeCode
=
treeCode
;
}
public
Menu
(
Long
id
,
String
name
,
Long
parentId2
,
int
num
,
String
treeCode
,
Integer
sortNum
)
{
super
();
this
.
id
=
id
;
this
.
name
=
name
;
this
.
parentId
=
parentId2
;
this
.
num
=
num
;
this
.
treeCode
=
treeCode
;
this
.
sortNum
=
sortNum
;
}
public
Menu
(
Long
id
,
String
name
,
Long
parentId
,
List
<
Menu
>
children
,
int
num
)
{
super
();
this
.
id
=
id
;
...
...
@@ -56,7 +84,6 @@ public class Menu {
this
.
children
=
children
;
this
.
num
=
num
;
}
public
Long
getId
()
{
return
id
;
}
...
...
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/utils/TreeParser.java
View file @
408734f5
...
...
@@ -104,6 +104,75 @@ public class TreeParser {
return
resultList
;
}
@SuppressWarnings
(
"unchecked"
)
public
static
List
<
Menu
>
getSortTree
(
Long
topId
,
@SuppressWarnings
(
"rawtypes"
)
Collection
entityList
,
String
packageURL
,
String
IDMethodName
,
int
IDHierarchy
,
String
NAMEMethodName
,
String
PARENTIDMethodName
,
String
SORTMethodName
,
List
<
FirefightersTreeDto
>
list
,
String
treeCode
)
throws
Exception
{
List
<
Menu
>
resultList
=
new
ArrayList
<>();
@SuppressWarnings
(
"rawtypes"
)
Class
clazz
=
Class
.
forName
(
packageURL
);
Method
IDMethodNameme
=
null
;
switch
(
IDHierarchy
)
{
case
1
:
IDMethodNameme
=
clazz
.
getDeclaredMethod
(
IDMethodName
);
break
;
case
2
:
IDMethodNameme
=
clazz
.
getSuperclass
().
getDeclaredMethod
(
IDMethodName
);
break
;
case
3
:
IDMethodNameme
=
clazz
.
getSuperclass
().
getSuperclass
().
getDeclaredMethod
(
IDMethodName
);
break
;
default
:
IDMethodNameme
=
clazz
.
getDeclaredMethod
(
IDMethodName
);
break
;
}
Method
NAMEMethodNameme
=
clazz
.
getDeclaredMethod
(
NAMEMethodName
);
Method
SORTMethodNamee
=
clazz
.
getDeclaredMethod
(
SORTMethodName
);
Method
PARENTIDMethodNameme
=
clazz
.
getDeclaredMethod
(
PARENTIDMethodName
);
Method
treeCodeName
=
null
;
if
(
treeCode
!=
null
){
treeCodeName
=
clazz
.
getDeclaredMethod
(
treeCode
);
}
//获取顶层元素集合
Long
parentId
;
for
(
Object
ob
:
entityList
)
{
Object
entity
=
clazz
.
cast
(
ob
);
parentId
=
PARENTIDMethodNameme
.
invoke
(
entity
)
!=
null
?
Long
.
valueOf
(
String
.
valueOf
(
PARENTIDMethodNameme
.
invoke
(
entity
)))
:
null
;
if
(
parentId
==
null
||
parentId
.
equals
(
topId
)
)
{
//陈浩2021-12-01修改 topId == parentId 的判断
String
codeString
=
String
.
valueOf
(
IDMethodNameme
.
invoke
(
entity
));
Integer
num
=
0
;
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
for
(
FirefightersTreeDto
map
:
list
)
{
if
(
null
!=
map
.
getJobTitleCode
()
&&
map
.
getJobTitleCode
().
equals
(
codeString
))
{
num
=
Integer
.
valueOf
((
String
)
map
.
getNum
());
break
;
}
}
;
}
Menu
menu
=
null
;
if
(
treeCodeName
!=
null
){
String
treeCodeNamedat
=
String
.
valueOf
(
treeCodeName
.
invoke
(
entity
));
menu
=
new
Menu
(
Long
.
valueOf
(
codeString
),
String
.
valueOf
(
NAMEMethodNameme
.
invoke
(
entity
)),
parentId
,
num
,
treeCodeNamedat
,
Integer
.
valueOf
(
String
.
valueOf
(
SORTMethodNamee
.
invoke
(
entity
))));
}
else
{
menu
=
new
Menu
(
Long
.
valueOf
(
codeString
),
String
.
valueOf
(
NAMEMethodNameme
.
invoke
(
entity
)),
parentId
,
num
,
Integer
.
valueOf
(
String
.
valueOf
(
SORTMethodNamee
.
invoke
(
entity
))));
}
resultList
.
add
(
menu
);
}
}
//获取每个顶层元素的子数据集合
for
(
Menu
entity
:
resultList
)
{
entity
.
setChildren
(
getSub
(
entity
.
getId
(),
entityList
,
packageURL
,
IDMethodName
,
IDHierarchy
,
NAMEMethodName
,
PARENTIDMethodName
,
list
,
treeCode
));
}
return
resultList
;
}
public
static
List
<
Menu
>
getTreeTeam
(
Long
topId
,
@SuppressWarnings
(
"rawtypes"
)
Collection
entityList
,
String
packageURL
,
String
IDMethodName
,
int
IDHierarchy
,
String
NAMEMethodName
,
String
PARENTIDMethodName
,
List
<
FirefightersTreeDto
>
list
,
String
treeCode
)
throws
Exception
{
List
<
Menu
>
resultList
=
new
ArrayList
<>();
@SuppressWarnings
(
"rawtypes"
)
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/FireResourceSupervisionController.java
View file @
408734f5
...
...
@@ -20,6 +20,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.HashMap
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -84,7 +85,7 @@ public class FireResourceSupervisionController extends BaseController {
ReginParams
reginParams
=
getSelectedOrgInfo
();
bizOrgCode
=
!
ValidationUtil
.
isEmpty
(
reginParams
.
getPersonIdentity
())
&&
StringUtils
.
isNotEmpty
(
reginParams
.
getPersonIdentity
().
getBizOrgCode
())
?
reginParams
.
getPersonIdentity
().
getBizOrgCode
()
:
null
;
}
List
<
Map
<
String
,
Object
>>
fireEquipStats
=
iFireResourceSupervisionService
.
getFireEquipStatistic
(
type
,
bizOrgCode
);
List
<
LinkedHash
Map
<
String
,
Object
>>
fireEquipStats
=
iFireResourceSupervisionService
.
getFireEquipStatistic
(
type
,
bizOrgCode
);
return
ResponseHelper
.
buildResponse
(
fireEquipStats
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/fegin/JcsFeign.java
View file @
408734f5
...
...
@@ -206,7 +206,7 @@ public interface JcsFeign {
@GetMapping
(
value
=
"/org-usr/getCompany"
)
FeignClientResult
getCompany
(
@RequestParam
(
value
=
"bizOrgCode"
)
String
bizOrgCode
);
@GetMapping
(
value
=
"/data-dictionary/dataDictionaryIdFillMenu"
)
@GetMapping
(
value
=
"/data-dictionary/dataDictionaryIdFillMenu
HasSort
"
)
FeignClientResult
<
List
<
DataDictionary
>>
dataDictionaryIdFillMenu
(
@RequestParam
(
value
=
"type"
)
String
type
);
@GetMapping
(
value
=
"/data-dictionary/getDictListByType"
)
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/FireFightingSystemMapper.java
View file @
408734f5
...
...
@@ -12,6 +12,7 @@ import org.apache.ibatis.annotations.Param;
import
java.math.BigDecimal
;
import
java.util.HashMap
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -743,7 +744,9 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
Page
<
Map
<
String
,
Object
>>
getEquipmentRunLogBySysInfo
(
Page
page
,
@Param
(
"bizOrgCode"
)
String
bizOrgCode
,
@Param
(
"systemCode"
)
String
systemCode
,
@Param
(
"fireEquipmentName"
)
String
fireEquipmentName
,
@Param
(
"startTime"
)
String
startTime
,
@Param
(
"endTime"
)
String
endTime
);
List
<
Map
<
String
,
Object
>>
getFireEquipStatistic
(
@Param
(
"collect"
)
List
<
String
>
collect
,
@Param
(
"bizOrgCode"
)
String
bizOrgCode
);
List
<
LinkedHashMap
<
String
,
Object
>>
getFireEquipStatistic
(
@Param
(
"collect"
)
List
<
String
>
collect
,
@Param
(
"bizOrgCode"
)
String
bizOrgCode
);
List
<
LinkedHashMap
<
String
,
Object
>>
getOtherFireEquipStatistic
(
@Param
(
"collect"
)
List
<
String
>
collect
,
@Param
(
"bizOrgCode"
)
String
bizOrgCode
);
List
<
EquipCountBySystemVO
>
getFireEquipConfigInfo
(
@Param
(
"codes"
)
List
<
String
>
codes
,
@Param
(
"bizOrgCode"
)
String
bizOrgCode
);
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IFireResourceSupervisionService.java
View file @
408734f5
...
...
@@ -2,6 +2,7 @@ package com.yeejoin.equipmanage.service;
import
com.yeejoin.equipmanage.common.entity.dto.FireResourceStatsDTO
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -29,5 +30,5 @@ public interface IFireResourceSupervisionService {
FireResourceStatsDTO
getFireEquipStats
(
String
bizOrgCode
);
List
<
Map
<
String
,
Object
>>
getFireEquipStatistic
(
String
type
,
String
bizOrgCode
);
List
<
LinkedHash
Map
<
String
,
Object
>>
getFireEquipStatistic
(
String
type
,
String
bizOrgCode
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/IFireResourceSupervisionServiceImpl.java
View file @
408734f5
...
...
@@ -7,6 +7,7 @@ import com.yeejoin.equipmanage.common.utils.StringUtil;
import
com.yeejoin.equipmanage.fegin.JcsFeign
;
import
com.yeejoin.equipmanage.mapper.FireFightingSystemMapper
;
import
com.yeejoin.equipmanage.service.IFireResourceSupervisionService
;
import
liquibase.pro.packaged.X
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -15,10 +16,7 @@ import org.springframework.util.StringUtils;
import
java.math.RoundingMode
;
import
java.text.DecimalFormat
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
@Slf4j
@Service
...
...
@@ -75,16 +73,35 @@ public class IFireResourceSupervisionServiceImpl implements IFireResourceSupervi
}
@Override
public
List
<
Map
<
String
,
Object
>>
getFireEquipStatistic
(
String
type
,
String
bizOrgCode
)
{
public
List
<
LinkedHash
Map
<
String
,
Object
>>
getFireEquipStatistic
(
String
type
,
String
bizOrgCode
)
{
List
<
DataDictionary
>
dictionaryList
=
jcsFeignClient
.
dataDictionaryIdFillMenu
(
StringUtil
.
isNotEmpty
(
type
)
?
type
:
"ZYGL_XFQC"
).
getResult
();
List
<
String
>
list
=
new
ArrayList
<>();
Map
<
Integer
,
String
>
sortMap
=
new
TreeMap
<>(
new
Comparator
<
Integer
>(){
@Override
public
int
compare
(
Integer
o1
,
Integer
o2
)
{
return
o1
-
o2
;
//按照key顺序排列,o2-o1是逆序, o1-o2是正序
}
});
if
(!
CollectionUtils
.
isEmpty
(
dictionaryList
))
{
dictionaryList
.
forEach
(
x
->
{
list
.
add
(
x
.
getTreeCode
());
sortMap
.
put
(
x
.
getSortNum
(),
x
.
getTreeCode
());
});
}
List
<
Map
<
String
,
Object
>>
resultMap
=
fireFightingSystemMapper
.
getFireEquipStatistic
(
list
,
bizOrgCode
);
return
resultMap
;
List
<
LinkedHashMap
<
String
,
Object
>>
resultMap
=
fireFightingSystemMapper
.
getFireEquipStatistic
(
list
,
bizOrgCode
);
List
<
LinkedHashMap
<
String
,
Object
>>
resp
=
new
ArrayList
<>();
if
(!
sortMap
.
isEmpty
())
{
sortMap
.
entrySet
().
forEach
(
x
->
{
resultMap
.
forEach
(
y
->
{
if
(
x
.
getValue
().
equalsIgnoreCase
(
String
.
valueOf
(
y
.
get
(
"code"
))))
{
resp
.
add
(
y
);
}
});
});
}
List
<
LinkedHashMap
<
String
,
Object
>>
otherMapData
=
fireFightingSystemMapper
.
getOtherFireEquipStatistic
(
list
,
bizOrgCode
);
resp
.
addAll
(
otherMapData
);
return
resp
;
}
private
FireResourceStatsDTO
buildFireResourceStatsDTO
(
Map
<
String
,
Object
>
resultMap
)
{
...
...
amos-boot-system-equip/src/main/resources/mapper/FireFightingSystemMapper.xml
View file @
408734f5
...
...
@@ -6781,7 +6781,7 @@
ORDER BY d.create_date desc
</select>
<select
id=
"getFireEquipStatistic"
resultType=
"Map"
>
<select
id=
"getFireEquipStatistic"
resultType=
"
java.util.LinkedHash
Map"
>
SELECT
a.`name` AS `name`,
wes.equipment_code AS `code`,
...
...
@@ -6815,8 +6815,10 @@
AND wes.biz_org_code like concat (#{bizOrgCode},'%')
</if>
GROUP BY
wes.equipment_code
UNION ALL
wes.equipment_code
</select>
<select
id=
"getOtherFireEquipStatistic"
resultType=
"java.util.LinkedHashMap"
>
SELECT
'其他' AS `name`,
'' AS `code`,
...
...
@@ -6845,10 +6847,10 @@
</where>
) a ON a.`code` = wes.equipment_code
WHERE
a.`name` IS NOT NULL AND wes.system_id IS NOT NULL
a.`name` IS NOT NULL AND wes.system_id IS NOT NULL
<if
test=
"bizOrgCode != null and bizOrgCode != ''"
>
AND wes.biz_org_code like concat (#{bizOrgCode},'%')
</if>
AND wes.biz_org_code like concat (#{bizOrgCode},'%')
</if>
</select>
<select
id=
"getFireEquipConfigInfo"
resultMap=
"EquipCountBySystemId"
>
...
...
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