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
1bf2a96d
Commit
1bf2a96d
authored
Sep 23, 2024
by
李秀明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
统一消防资源-消防器材设备统计逻辑
parent
4fc4df38
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
71 additions
and
22 deletions
+71
-22
FireFightingSystemController.java
.../equipmanage/controller/FireFightingSystemController.java
+16
-3
EquipmentSpecificMapper.java
...m/yeejoin/equipmanage/mapper/EquipmentSpecificMapper.java
+1
-0
FireFightingSystemMapper.java
.../yeejoin/equipmanage/mapper/FireFightingSystemMapper.java
+1
-1
IFireFightingSystemService.java
...ejoin/equipmanage/service/IFireFightingSystemService.java
+2
-2
FireFightingSystemGroupServiceImpl.java
...nage/service/impl/FireFightingSystemGroupServiceImpl.java
+8
-1
FireFightingSystemServiceImpl.java
...uipmanage/service/impl/FireFightingSystemServiceImpl.java
+6
-3
EquipmentSpecificMapper.xml
...uip/src/main/resources/mapper/EquipmentSpecificMapper.xml
+25
-5
FireFightingSystemMapper.xml
...ip/src/main/resources/mapper/FireFightingSystemMapper.xml
+12
-7
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/FireFightingSystemController.java
View file @
1bf2a96d
...
@@ -130,8 +130,15 @@ public class FireFightingSystemController extends AbstractBaseController {
...
@@ -130,8 +130,15 @@ public class FireFightingSystemController extends AbstractBaseController {
@RequestMapping
(
value
=
"/getEquipcountBySystemId"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/getEquipcountBySystemId"
,
method
=
RequestMethod
.
GET
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
"根据系统id查询分组设备数量"
)
@ApiOperation
(
"根据系统id查询分组设备数量"
)
public
List
<
EquipCountBySystemVO
>
getEquipCountBySystemId
(
Long
systemId
)
{
public
List
<
EquipCountBySystemVO
>
getEquipCountBySystemId
(
return
fireFightingSystemService
.
getEquipCountBySystemId
(
systemId
);
@RequestParam
(
value
=
"systemId"
,
required
=
false
)
Long
systemId
,
@RequestParam
(
value
=
"bizOrgCode"
,
required
=
false
)
String
bizOrgCode
)
{
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isBlank
(
bizOrgCode
))
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
bizOrgCode
=
!
ValidationUtil
.
isEmpty
(
reginParams
.
getPersonIdentity
())
&&
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isNotEmpty
(
reginParams
.
getPersonIdentity
().
getBizOrgCode
())
?
reginParams
.
getPersonIdentity
().
getBizOrgCode
()
:
null
;
}
return
fireFightingSystemService
.
getEquipCountBySystemId
(
systemId
,
bizOrgCode
);
}
}
@RequestMapping
(
value
=
"/getEquipCountPageBySystemId"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/getEquipCountPageBySystemId"
,
method
=
RequestMethod
.
GET
)
...
@@ -947,8 +954,14 @@ public class FireFightingSystemController extends AbstractBaseController {
...
@@ -947,8 +954,14 @@ public class FireFightingSystemController extends AbstractBaseController {
@ApiOperation
(
value
=
"按照组态格式获取设备详情"
,
notes
=
"按照组态格式获取设备详情"
)
@ApiOperation
(
value
=
"按照组态格式获取设备详情"
,
notes
=
"按照组态格式获取设备详情"
)
@GetMapping
(
value
=
"/getSystemById"
)
@GetMapping
(
value
=
"/getSystemById"
)
public
Map
<
String
,
Object
>
getSystemById
(
Long
id
)
{
public
Map
<
String
,
Object
>
getSystemById
(
Long
id
)
{
String
bizOrgCode
=
""
;
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
.
PersonIdentity
personIdentity
=
reginParams
.
getPersonIdentity
();
if
(!
ValidationUtil
.
isEmpty
(
personIdentity
))
{
bizOrgCode
=
personIdentity
.
getBizOrgCode
();
}
FireFightingSystemEntity
fireFightingSystem
=
fireFightingSystemService
.
getById
(
id
);
FireFightingSystemEntity
fireFightingSystem
=
fireFightingSystemService
.
getById
(
id
);
List
<
AlarmDataVO
>
list1
=
fireFightingSystemService
.
getSystemById
(
id
);
List
<
AlarmDataVO
>
list1
=
fireFightingSystemService
.
getSystemById
(
id
,
bizOrgCode
);
Map
<
String
,
Object
>
res
=
new
LinkedHashMap
<>();
Map
<
String
,
Object
>
res
=
new
LinkedHashMap
<>();
Boolean
status
=
Boolean
.
TRUE
;
Boolean
status
=
Boolean
.
TRUE
;
List
<
Object
>
ite
=
new
ArrayList
<>();
List
<
Object
>
ite
=
new
ArrayList
<>();
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/EquipmentSpecificMapper.java
View file @
1bf2a96d
...
@@ -30,6 +30,7 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> {
...
@@ -30,6 +30,7 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> {
int
getEquipmentSpeCount
(
Map
<
String
,
Object
>
map
);
int
getEquipmentSpeCount
(
Map
<
String
,
Object
>
map
);
List
<
Map
<
String
,
Object
>>
getEquipmentCount
(
@Param
(
"bizOrgCode"
)
String
bizOrgCode
);
List
<
Map
<
String
,
Object
>>
getEquipmentCount
(
@Param
(
"bizOrgCode"
)
String
bizOrgCode
);
List
<
Map
<
String
,
Long
>>
getEquipmentCountBySystemId
(
@Param
(
"bizOrgCode"
)
String
bizOrgCode
,
@Param
(
"systemIds"
)
List
<
Long
>
systemIds
);
IPage
<
ComplementCodeVO
>
selectEquipmentSpecific
(
Page
page
,
EquipmentSpecificDTO
equipmentSpecificDTO
);
IPage
<
ComplementCodeVO
>
selectEquipmentSpecific
(
Page
page
,
EquipmentSpecificDTO
equipmentSpecificDTO
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/FireFightingSystemMapper.java
View file @
1bf2a96d
...
@@ -51,7 +51,7 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
...
@@ -51,7 +51,7 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
* @param systemId
* @param systemId
* @return
* @return
*/
*/
List
<
EquipCountBySystemVO
>
getEquipCountBySystemId
(
Long
systemId
);
List
<
EquipCountBySystemVO
>
getEquipCountBySystemId
(
Long
systemId
,
String
bizOrgCode
);
Page
<
EquipCountBySystemVO
>
getEquipCountPageBySystemId
(
@Param
(
"page"
)
Page
<
Object
>
page
,
@Param
(
"systemId"
)
Long
systemId
,
@Param
(
"bizOrgCode"
)
String
bizOrgCode
);
Page
<
EquipCountBySystemVO
>
getEquipCountPageBySystemId
(
@Param
(
"page"
)
Page
<
Object
>
page
,
@Param
(
"systemId"
)
Long
systemId
,
@Param
(
"bizOrgCode"
)
String
bizOrgCode
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IFireFightingSystemService.java
View file @
1bf2a96d
...
@@ -57,7 +57,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
...
@@ -57,7 +57,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
* @param systemId
* @param systemId
* @return
* @return
*/
*/
List
<
EquipCountBySystemVO
>
getEquipCountBySystemId
(
Long
systemId
);
List
<
EquipCountBySystemVO
>
getEquipCountBySystemId
(
Long
systemId
,
String
bizOrgCode
);
/**
/**
* 根据系统id查询分组设备数量
* 根据系统id查询分组设备数量
...
@@ -128,7 +128,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
...
@@ -128,7 +128,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
* @param id
* @param id
* @return
* @return
*/
*/
List
<
AlarmDataVO
>
getSystemById
(
Long
id
);
List
<
AlarmDataVO
>
getSystemById
(
Long
id
,
String
bizOrgCode
);
IPage
<
EquipmentAlarmBySystemIdOrSourceIdVO
>
getEquipmentAlarmBySystemIdOrSourceIdVO
(
IPage
<
EquipmentAlarmBySystemIdOrSourceIdVO
>
page
,
Long
sourceId
,
Long
systemId
,
Integer
confirmType
,
String
createDate
,
String
type
,
String
equipmentId
);
IPage
<
EquipmentAlarmBySystemIdOrSourceIdVO
>
getEquipmentAlarmBySystemIdOrSourceIdVO
(
IPage
<
EquipmentAlarmBySystemIdOrSourceIdVO
>
page
,
Long
sourceId
,
Long
systemId
,
Integer
confirmType
,
String
createDate
,
String
type
,
String
equipmentId
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/FireFightingSystemGroupServiceImpl.java
View file @
1bf2a96d
...
@@ -256,11 +256,13 @@ public class FireFightingSystemGroupServiceImpl extends ServiceImpl<FireFighting
...
@@ -256,11 +256,13 @@ public class FireFightingSystemGroupServiceImpl extends ServiceImpl<FireFighting
String
uniqueKey
=
id
+
"@"
+
equipmentId
;
String
uniqueKey
=
id
+
"@"
+
equipmentId
;
if
(
equipmentCountMap
.
containsKey
(
uniqueKey
))
{
if
(
equipmentCountMap
.
containsKey
(
uniqueKey
))
{
Map
<
String
,
Object
>
objectMap
=
equipmentCountMap
.
get
(
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
()));
long
count
=
Long
.
parseLong
(
map
.
getOrDefault
(
"count"
,
"0"
).
toString
())
+
Long
.
parseLong
(
objectMap
.
getOrDefault
(
"count"
,
0
).
toString
());
objectMap
.
put
(
"count"
,
count
);
}
}
equipmentCountMap
.
put
(
uniqueKey
,
map
);
equipmentCountMap
.
put
(
uniqueKey
,
map
);
}
}
}
}
List
<
Map
<
String
,
Long
>>
systemEquipCountMaps
=
equipmentSpecificMapper
.
getEquipmentCountBySystemId
(
bizOrgCode
,
systemIds
);
// 构建分组对象
// 构建分组对象
JSONArray
groups
=
new
JSONArray
();
JSONArray
groups
=
new
JSONArray
();
...
@@ -309,6 +311,11 @@ public class FireFightingSystemGroupServiceImpl extends ServiceImpl<FireFighting
...
@@ -309,6 +311,11 @@ public class FireFightingSystemGroupServiceImpl extends ServiceImpl<FireFighting
}
}
}
}
system
.
put
(
"equipments"
,
equipments
);
system
.
put
(
"equipments"
,
equipments
);
systemEquipCountMaps
.
forEach
(
map
->
{
if
(
String
.
valueOf
(
map
.
get
(
"systemId"
)).
equals
(
systemId
.
toString
()))
{
system
.
put
(
"equipmentCount"
,
map
.
getOrDefault
(
"count"
,
0L
));
}
});
systems
.
add
(
system
);
systems
.
add
(
system
);
}
}
groups
.
add
(
group
);
groups
.
add
(
group
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/FireFightingSystemServiceImpl.java
View file @
1bf2a96d
...
@@ -196,8 +196,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
...
@@ -196,8 +196,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
private
StockDetailMapper
stockDetailMapper
;
private
StockDetailMapper
stockDetailMapper
;
@Override
@Override
public
List
<
EquipCountBySystemVO
>
getEquipCountBySystemId
(
Long
systemId
)
{
public
List
<
EquipCountBySystemVO
>
getEquipCountBySystemId
(
Long
systemId
,
String
bizOrgCode
)
{
return
this
.
baseMapper
.
getEquipCountBySystemId
(
systemId
);
return
this
.
baseMapper
.
getEquipCountBySystemId
(
systemId
,
bizOrgCode
);
}
}
@Override
@Override
...
@@ -1221,13 +1221,15 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
...
@@ -1221,13 +1221,15 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
}
}
@Override
@Override
public
List
<
AlarmDataVO
>
getSystemById
(
Long
id
)
{
public
List
<
AlarmDataVO
>
getSystemById
(
Long
id
,
String
bizOrgCode
)
{
List
<
AlarmDataVO
>
list
=
this
.
baseMapper
.
getSystemById
(
id
);
List
<
AlarmDataVO
>
list
=
this
.
baseMapper
.
getSystemById
(
id
);
// 部件总数
// 部件总数
Integer
equipmentCount
=
equipmentSpecificMapper
.
selectCount
(
Integer
equipmentCount
=
equipmentSpecificMapper
.
selectCount
(
Wrappers
.<
EquipmentSpecific
>
lambdaQuery
()
Wrappers
.<
EquipmentSpecific
>
lambdaQuery
()
.
eq
(
EquipmentSpecific:
:
getSystemId
,
id
)
.
eq
(
EquipmentSpecific:
:
getSystemId
,
id
)
.
isNotNull
(
EquipmentSpecific:
:
getEquipmentCode
)
.
eq
(
EquipmentSpecific:
:
getSingle
,
true
)
.
eq
(
EquipmentSpecific:
:
getSingle
,
true
)
.
likeRight
(
StringUtils
.
hasText
(
bizOrgCode
),
EquipmentSpecific:
:
getBizOrgCode
,
bizOrgCode
)
);
);
// 未复归设备
// 未复归设备
List
<
EquipmentSpecificAlarm
>
equipSpecIds
=
equipmentSpecificAlarmMapper
.
selectList
(
List
<
EquipmentSpecificAlarm
>
equipSpecIds
=
equipmentSpecificAlarmMapper
.
selectList
(
...
@@ -1235,6 +1237,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
...
@@ -1235,6 +1237,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
.
select
(
EquipmentSpecificAlarm:
:
getEquipmentSpecificId
)
.
select
(
EquipmentSpecificAlarm:
:
getEquipmentSpecificId
)
.
like
(
EquipmentSpecificAlarm:
:
getSystemIds
,
id
)
.
like
(
EquipmentSpecificAlarm:
:
getSystemIds
,
id
)
.
eq
(
EquipmentSpecificAlarm:
:
getStatus
,
"1"
)
.
eq
(
EquipmentSpecificAlarm:
:
getStatus
,
"1"
)
.
likeRight
(
StringUtils
.
hasText
(
bizOrgCode
),
EquipmentSpecificAlarm:
:
getBizOrgCode
,
bizOrgCode
)
);
);
int
count
=
(
int
)
equipSpecIds
.
stream
().
map
(
EquipmentSpecificAlarm:
:
getEquipmentSpecificId
).
distinct
().
count
();
int
count
=
(
int
)
equipSpecIds
.
stream
().
map
(
EquipmentSpecificAlarm:
:
getEquipmentSpecificId
).
distinct
().
count
();
list
.
add
(
new
AlarmDataVO
(
"部件总数"
,
equipmentCount
+
" 个"
,
false
));
list
.
add
(
new
AlarmDataVO
(
"部件总数"
,
equipmentCount
+
" 个"
,
false
));
...
...
amos-boot-system-equip/src/main/resources/mapper/EquipmentSpecificMapper.xml
View file @
1bf2a96d
...
@@ -118,17 +118,37 @@
...
@@ -118,17 +118,37 @@
u.name AS unit
u.name AS unit
FROM
FROM
wl_equipment_specific wesp
wl_equipment_specific wesp
LEFT JOIN wl_equipment_detail wsd ON wesp.equipment_detail_id = wsd.id
LEFT JOIN wl_equipment we ON we.code = wesp.equipment_code
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 AND wesp.system_id IS NOT NULL
we.id IS NOT NULL AND wesp.system_id IS NOT NULL
AND wesp.single = true
<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
id=
"getEquipmentCountBySystemId"
resultType=
"Map"
>
SELECT
wesp.system_id AS systemId,
count(1) AS count
FROM
wl_equipment_specific wesp
LEFT JOIN wl_equipment we ON we.code = wesp.equipment_code
<where>
we.id IS NOT NULL AND wesp.system_id IS NOT NULL AND wesp.single = true
<if
test=
"bizOrgCode != null and bizOrgCode != ''"
>
AND wesp.biz_org_code like concat(#{bizOrgCode},'%')
</if>
<if
test=
"systemIds != null and systemIds.size() > 0"
>
AND (
<foreach
collection=
"systemIds"
item=
"systemId"
separator=
"OR"
>
find_in_set(wesp.system_id, #{systemId})
</foreach>
)
</if>
</where>
GROUP BY 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 @
1bf2a96d
...
@@ -104,13 +104,17 @@
...
@@ -104,13 +104,17 @@
cate.NAME AS equipmentCateGoryName
cate.NAME AS equipmentCateGoryName
FROM
FROM
wl_equipment_specific AS spe
wl_equipment_specific AS spe
LEFT JOIN wl_equipment_detail AS det ON spe.equipment_detail_id = det.id
LEFT JOIN wl_equipment AS wle ON wle.code = spe.equipment_code
LEFT JOIN wl_equipment AS wle ON wle.id = det.equipment_id
LEFT JOIN wl_equipment_category cate ON cate.id = wle.category_id
LEFT JOIN wl_equipment_category cate ON cate.id = wle.category_id
LEFT JOIN wl_unit as unit ON wle.unit_id = unit.id
LEFT JOIN wl_unit as unit ON wle.unit_id = unit.id
where
<where>
find_in_set(#{systemId},spe.system_id) and spe.single = true
wle.id is not null
group by wle.id
and find_in_set(#{systemId},spe.system_id) and spe.single = true
<if
test=
"bizOrgCode != null and bizOrgCode != ''"
>
AND spe.biz_org_code like concat (#{bizOrgCode},'%')
</if>
</where>
group by wle.code
</select>
</select>
<select
id=
"getEquipCountPageBySystemId"
resultMap=
"EquipCountBySystemId"
>
<select
id=
"getEquipCountPageBySystemId"
resultMap=
"EquipCountBySystemId"
>
SELECT
SELECT
...
@@ -128,14 +132,15 @@
...
@@ -128,14 +132,15 @@
LEFT JOIN wl_equipment_category cate ON cate.id = wle.category_id
LEFT JOIN wl_equipment_category cate ON cate.id = wle.category_id
LEFT JOIN wl_unit as unit ON wle.unit_id = unit.id
LEFT JOIN wl_unit as unit ON wle.unit_id = unit.id
<where>
<where>
wle.id is not null and spe.single = true and spe.system_id is not null
<if
test=
"systemId != null and systemId != ''"
>
<if
test=
"systemId != null and systemId != ''"
>
find_in_set(#{systemId},spe.system_id) and spe.single = true
AND find_in_set(#{systemId},spe.system_id)
</if>
</if>
<if
test=
"bizOrgCode != null and bizOrgCode != ''"
>
<if
test=
"bizOrgCode != null and bizOrgCode != ''"
>
AND spe.biz_org_code like concat (#{bizOrgCode},'%')
AND spe.biz_org_code like concat (#{bizOrgCode},'%')
</if>
</if>
</where>
</where>
wle.`code`
group by wle.code
</select>
</select>
<insert
id=
"save"
>
<insert
id=
"save"
>
INSERT INTO
INSERT INTO
...
...
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