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
8ae87a00
Commit
8ae87a00
authored
Sep 03, 2021
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug2407 筛选参数解析异常 修改筛选条件方法 XML中添加了selectAllPage 方法 data代表排序条件 lift 升降序
parent
5d1ba33a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
111 additions
and
122 deletions
+111
-122
AlertCalledMapper.xml
...e-jcs-api/src/main/resources/mapper/AlertCalledMapper.xml
+9
-9
AlertCalledServiceImpl.java
...t/module/jcs/biz/service/impl/AlertCalledServiceImpl.java
+102
-113
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/resources/mapper/AlertCalledMapper.xml
View file @
8ae87a00
...
...
@@ -126,16 +126,16 @@
<if
test=
"alertSourceCode!= null "
>
and alert_source_code = #{alertSourceCode}
</if>
<if
test=
"data != null and lift == 'ascend'"
>
order by #{data} ASC limit #{current},#{size}
</if>
<if
test=
"data != null and lift == 'descend'"
>
order by #{data} DESC limit #{current},#{size}
</if>
<if
test=
"data == null "
>
order by call_time DESC limit #{current},#{size}
</if>
</where>
<if
test=
"data != null and lift == 'ascend'"
>
order by #{data} ASC limit #{current},#{size}
</if>
<if
test=
"data != null and lift == 'descend'"
>
order by #{data} DESC limit #{current},#{size}
</if>
<if
test=
"data == null "
>
order by call_time DESC limit #{current},#{size}
</if>
</select>
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/AlertCalledServiceImpl.java
View file @
8ae87a00
...
...
@@ -132,16 +132,21 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
/**
* 接警记录 列表分页查询
**/
/* bug2407 筛选参数解析异常 修改筛选条件方法 XML中添加了selectAllPage 方法 data代表排序条件 lift 升降序 陈召 2021-09-03 开始*/
public
IPage
<
AlertCalled
>
queryForCalledList
(
Page
pageBean
,
Integer
alertStatus
,
String
alertTypeCode
,
String
alertSourceCode
,
String
startTime
,
String
endTime
,
String
sort
)
{
String
[]
split
=
sort
.
split
(
","
);
String
data
=
RedisKey
.
humpToLine
(
split
[
0
]);
String
lift
=
split
[
1
];
List
<
AlertCalled
>
list
=
alertCalledMapper
.
selectAllPage
(
pageBean
.
getCurrent
(),
pageBean
.
getSize
(),
alertStatus
,
alertTypeCode
,
alertSourceCode
,
startTime
,
endTime
,
data
,
lift
);
public
IPage
<
AlertCalled
>
queryForCalledList
(
Page
pageBean
,
Integer
alertStatus
,
String
alertTypeCode
,
String
alertSourceCode
,
String
startTime
,
String
endTime
,
String
sort
)
{
String
data
=
null
;
String
lift
=
null
;
if
(
StringUtils
.
isNotEmpty
(
sort
))
{
String
[]
split
=
sort
.
split
(
","
);
data
=
RedisKey
.
humpToLine
(
split
[
0
]);
lift
=
split
[
1
];
}
List
<
AlertCalled
>
list
=
alertCalledMapper
.
selectAllPage
(
pageBean
.
getCurrent
(),
pageBean
.
getSize
(),
alertStatus
,
alertTypeCode
,
alertSourceCode
,
startTime
,
endTime
,
data
,
lift
);
IPage
<
AlertCalled
>
iPage
=
new
Page
<>();
iPage
.
setRecords
(
list
);
iPage
.
setTotal
(
list
.
size
());
...
...
@@ -150,8 +155,6 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
}
/**
* 根据灾情id 查询灾情详情
**/
...
...
@@ -416,11 +419,11 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
listdate
.
add
(
new
KeyValueLabel
(
"联系电话"
,
"contactPhone"
,
alertCalled
.
getContactPhone
()));
listdate
.
add
(
new
KeyValueLabel
(
"联系人电话"
,
"contactPhone"
,
alertCalled
.
getContactPhone
()));
list
.
stream
().
forEach
(
AlertFormValue
->
{
String
valueCode
=
AlertFormValue
.
getFieldValueCode
();
if
(
null
==
valueCode
)
{
valueCode
=
AlertFormValue
.
getFieldValue
();
}
listdate
.
add
(
new
KeyValueLabel
(
AlertFormValue
.
getFieldName
(),
AlertFormValue
.
getFieldCode
(),
valueCode
));
String
valueCode
=
AlertFormValue
.
getFieldValueCode
();
if
(
null
==
valueCode
)
{
valueCode
=
AlertFormValue
.
getFieldValue
();
}
listdate
.
add
(
new
KeyValueLabel
(
AlertFormValue
.
getFieldName
(),
AlertFormValue
.
getFieldCode
(),
valueCode
));
});
map
.
put
(
"data"
,
listdate
);
return
map
;
...
...
@@ -476,108 +479,94 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
}
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
public
Boolean
controlEquip
()
throws
Exception
{
/**
* 获取控制器设备
*/
List
<
ControllerEquipDto
>
controllerEquipDtoList
=
controllerEquipService
.
queryAllForList
();
Map
<
Long
,
List
<
String
>>
controllerEquipMap
=
new
HashMap
<>();
for
(
ControllerEquipDto
controllerEquipDto
:
controllerEquipDtoList
)
{
List
<
String
>
numList
=
controllerEquipMap
.
get
(
controllerEquipDto
.
getControllerSeq
());
if
(
ValidationUtil
.
isEmpty
(
numList
))
{
numList
=
new
ArrayList
<>();
}
numList
.
add
(
controllerEquipDto
.
getNum
());
controllerEquipMap
.
put
(
controllerEquipDto
.
getControllerSeq
(),
numList
);
}
/**
* 获取联动控制器
*/
List
<
ControllerDto
>
controllerDtoList
=
controllerService
.
queryAllForList
();
StringBuilder
bellNumSb
=
new
StringBuilder
();
StringBuilder
broadcastNumSb
=
new
StringBuilder
();
for
(
ControllerDto
controllerDto
:
controllerDtoList
)
{
//消防警铃
if
(
controllerDto
.
getType
().
equals
(
ControllerTypeEnum
.
BELL
.
getCode
()))
{
List
<
String
>
bellNumList
=
controllerEquipMap
.
get
(
controllerDto
.
getSequenceNbr
());
if
(!
ValidationUtil
.
isEmpty
(
bellNumList
))
{
for
(
String
num
:
bellNumList
)
{
bellNumSb
.
append
(
num
).
append
(
","
);
}
}
}
//广播
if
(
controllerDto
.
getType
().
equals
(
ControllerTypeEnum
.
BROADCAST
.
getCode
()))
{
List
<
String
>
broadcastList
=
controllerEquipMap
.
get
(
controllerDto
.
getSequenceNbr
());
if
(!
ValidationUtil
.
isEmpty
(
broadcastList
))
{
for
(
String
num
:
broadcastList
)
{
broadcastNumSb
.
append
(
num
).
append
(
","
);
}
}
}
}
/**
* 打开消防警铃
*/
if
(!
ValidationUtil
.
isEmpty
(
bellNumSb
.
toString
()))
{
String
bellNum
=
bellNumSb
.
toString
();
bellNum
=
bellNum
.
substring
(
0
,
bellNum
.
length
()
-
1
);
jcsControlServerClient
.
sendBellAction
(
bellNum
,
"1"
);
}
/**
* 播放广播
*/
if
(!
ValidationUtil
.
isEmpty
(
broadcastNumSb
.
toString
()))
{
String
broadcastNum
=
broadcastNumSb
.
toString
();
broadcastNum
=
broadcastNum
.
substring
(
0
,
broadcastNum
.
length
()
-
1
);
jcsControlServerClient
.
sendFileAction
(
broadcastNum
,
"1490075199246.mp3"
);
}
/**
* 打开北站车库门
*/
List
<
ControllerDto
>
northDoor
=
controllerService
.
queryForList
(
"3"
,
ControllerTypeEnum
.
DOOR
.
getCode
());
if
(!
ValidationUtil
.
isEmpty
(
northDoor
))
{
ControllerDto
controllerDto
=
northDoor
.
get
(
0
);
//打开北站车库门
jcsControlServerClient
.
writeStateAction
(
controllerDto
.
getIp
(),
controllerDto
.
getPort
(),
100
,
"1,1,1,1"
);
//打开北站车库门弱电警铃
jcsControlServerClient
.
writeStateAction
(
controllerDto
.
getIp
(),
controllerDto
.
getPort
(),
107
,
"1"
);
}
/**
* 打开南站车库门
*/
List
<
ControllerDto
>
southDoor
=
controllerService
.
queryForList
(
"2"
,
ControllerTypeEnum
.
DOOR
.
getCode
());
if
(!
ValidationUtil
.
isEmpty
(
southDoor
))
{
ControllerDto
controllerDto
=
southDoor
.
get
(
0
);
//打开南站车库门
jcsControlServerClient
.
writeStateAction
(
controllerDto
.
getIp
(),
controllerDto
.
getPort
(),
100
,
"1"
);
//打开南站车库门弱电警铃
jcsControlServerClient
.
writeStateAction
(
controllerDto
.
getIp
(),
controllerDto
.
getPort
(),
107
,
"1"
);
}
return
true
;
public
Boolean
controlEquip
()
throws
Exception
{
/**
* 获取控制器设备
*/
List
<
ControllerEquipDto
>
controllerEquipDtoList
=
controllerEquipService
.
queryAllForList
();
Map
<
Long
,
List
<
String
>>
controllerEquipMap
=
new
HashMap
<>();
for
(
ControllerEquipDto
controllerEquipDto
:
controllerEquipDtoList
)
{
List
<
String
>
numList
=
controllerEquipMap
.
get
(
controllerEquipDto
.
getControllerSeq
());
if
(
ValidationUtil
.
isEmpty
(
numList
))
{
numList
=
new
ArrayList
<>();
}
numList
.
add
(
controllerEquipDto
.
getNum
());
controllerEquipMap
.
put
(
controllerEquipDto
.
getControllerSeq
(),
numList
);
}
/**
* 获取联动控制器
*/
List
<
ControllerDto
>
controllerDtoList
=
controllerService
.
queryAllForList
();
StringBuilder
bellNumSb
=
new
StringBuilder
();
StringBuilder
broadcastNumSb
=
new
StringBuilder
();
for
(
ControllerDto
controllerDto
:
controllerDtoList
)
{
//消防警铃
if
(
controllerDto
.
getType
().
equals
(
ControllerTypeEnum
.
BELL
.
getCode
()))
{
List
<
String
>
bellNumList
=
controllerEquipMap
.
get
(
controllerDto
.
getSequenceNbr
());
if
(!
ValidationUtil
.
isEmpty
(
bellNumList
))
{
for
(
String
num
:
bellNumList
)
{
bellNumSb
.
append
(
num
).
append
(
","
);
}
}
}
//广播
if
(
controllerDto
.
getType
().
equals
(
ControllerTypeEnum
.
BROADCAST
.
getCode
()))
{
List
<
String
>
broadcastList
=
controllerEquipMap
.
get
(
controllerDto
.
getSequenceNbr
());
if
(!
ValidationUtil
.
isEmpty
(
broadcastList
))
{
for
(
String
num
:
broadcastList
)
{
broadcastNumSb
.
append
(
num
).
append
(
","
);
}
}
}
}
/**
* 打开消防警铃
*/
if
(!
ValidationUtil
.
isEmpty
(
bellNumSb
.
toString
()))
{
String
bellNum
=
bellNumSb
.
toString
();
bellNum
=
bellNum
.
substring
(
0
,
bellNum
.
length
()
-
1
);
jcsControlServerClient
.
sendBellAction
(
bellNum
,
"1"
);
}
/**
* 播放广播
*/
if
(!
ValidationUtil
.
isEmpty
(
broadcastNumSb
.
toString
()))
{
String
broadcastNum
=
broadcastNumSb
.
toString
();
broadcastNum
=
broadcastNum
.
substring
(
0
,
broadcastNum
.
length
()
-
1
);
jcsControlServerClient
.
sendFileAction
(
broadcastNum
,
"1490075199246.mp3"
);
}
/**
* 打开北站车库门
*/
List
<
ControllerDto
>
northDoor
=
controllerService
.
queryForList
(
"3"
,
ControllerTypeEnum
.
DOOR
.
getCode
());
if
(!
ValidationUtil
.
isEmpty
(
northDoor
))
{
ControllerDto
controllerDto
=
northDoor
.
get
(
0
);
//打开北站车库门
jcsControlServerClient
.
writeStateAction
(
controllerDto
.
getIp
(),
controllerDto
.
getPort
(),
100
,
"1,1,1,1"
);
//打开北站车库门弱电警铃
jcsControlServerClient
.
writeStateAction
(
controllerDto
.
getIp
(),
controllerDto
.
getPort
(),
107
,
"1"
);
}
/**
* 打开南站车库门
*/
List
<
ControllerDto
>
southDoor
=
controllerService
.
queryForList
(
"2"
,
ControllerTypeEnum
.
DOOR
.
getCode
());
if
(!
ValidationUtil
.
isEmpty
(
southDoor
))
{
ControllerDto
controllerDto
=
southDoor
.
get
(
0
);
//打开南站车库门
jcsControlServerClient
.
writeStateAction
(
controllerDto
.
getIp
(),
controllerDto
.
getPort
(),
100
,
"1"
);
//打开南站车库门弱电警铃
jcsControlServerClient
.
writeStateAction
(
controllerDto
.
getIp
(),
controllerDto
.
getPort
(),
107
,
"1"
);
}
return
true
;
}
/**
* 警情重新定位
*
* @param alertId 警情id
* @param alertId
警情id
* @param longitude 经度
* @param latitude 纬度
* @param latitude
纬度
* @return
*/
public
Boolean
reLocate
(
String
alertId
,
String
longitude
,
String
latitude
)
{
...
...
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