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
f04e98b3
Commit
f04e98b3
authored
Sep 29, 2021
by
tangwei
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://172.16.10.76/moa/amos-boot-biz
into developer
parents
06cef7da
b56f1577
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
538 additions
and
130 deletions
+538
-130
RedisKey.java
...java/com/yeejoin/amos/boot/biz/common/utils/RedisKey.java
+2
-0
AlertPaperInfoDto.java
...ejoin/amos/boot/module/tzs/api/dto/AlertPaperInfoDto.java
+57
-0
EsElevatorDto.java
...m/yeejoin/amos/boot/module/tzs/api/dto/EsElevatorDto.java
+21
-0
SignatureDto.java
...om/yeejoin/amos/boot/module/tzs/api/dto/SignatureDto.java
+22
-0
EsElevator.java
...m/yeejoin/amos/boot/module/tzs/api/entity/EsElevator.java
+1
-1
AlertCalledMapper.java
...in/amos/boot/module/tzs/api/mapper/AlertCalledMapper.java
+8
-5
IAlertCalledService.java
...amos/boot/module/tzs/api/service/IAlertCalledService.java
+2
-0
AlertCalledMapper.xml
...e-tzs-api/src/main/resources/mapper/AlertCalledMapper.xml
+116
-14
RescueStationMapper.xml
...tzs-api/src/main/resources/mapper/RescueStationMapper.xml
+2
-0
AlertCalledController.java
...boot/module/tzs/biz/controller/AlertCalledController.java
+63
-15
ElevatorController.java
...os/boot/module/tzs/biz/controller/ElevatorController.java
+5
-7
RescueStationController.java
...ot/module/tzs/biz/controller/RescueStationController.java
+26
-0
WechatController.java
...amos/boot/module/tzs/biz/controller/WechatController.java
+58
-22
AlertCalledServiceImpl.java
...t/module/tzs/biz/service/impl/AlertCalledServiceImpl.java
+91
-27
DispatchTaskServiceImpl.java
.../module/tzs/biz/service/impl/DispatchTaskServiceImpl.java
+17
-7
ESElevatorServiceImpl.java
...ot/module/tzs/biz/service/impl/ESElevatorServiceImpl.java
+40
-25
application-dev.properties
...-system-tzs/src/main/resources/application-dev.properties
+7
-7
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/utils/RedisKey.java
View file @
f04e98b3
...
@@ -32,6 +32,8 @@ public class RedisKey {
...
@@ -32,6 +32,8 @@ public class RedisKey {
public
static
final
String
CTI_TOKEN
=
"cti_token"
;
public
static
final
String
CTI_TOKEN
=
"cti_token"
;
/**微信公众平台 token */
/**微信公众平台 token */
public
static
final
String
WECHAT_TOKEN
=
"wechat_token"
;
public
static
final
String
WECHAT_TOKEN
=
"wechat_token"
;
/**微信公众平台 token */
public
static
final
String
WECHAT_JS_TOKEN
=
"wechat_js_token"
;
/** 驼峰转下划线(简单写法,效率低于 ) */
/** 驼峰转下划线(简单写法,效率低于 ) */
public
static
String
humpToLine
(
String
str
)
{
public
static
String
humpToLine
(
String
str
)
{
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/dto/AlertPaperInfoDto.java
0 → 100644
View file @
f04e98b3
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.Date
;
/**
* @author litw
* @date 2021-09-28.
*/
@Data
public
class
AlertPaperInfoDto
{
@ApiModelProperty
(
value
=
"警情id"
)
private
Long
alertId
;
@ApiModelProperty
(
value
=
"所属区域代码"
)
private
String
regionCode
;
@ApiModelProperty
(
value
=
"电梯应急救援识别码"
)
private
Integer
rescueCode
;
@ApiModelProperty
(
value
=
"警情类别code"
)
private
String
alarmTypeCode
;
@ApiModelProperty
(
value
=
"所属区域"
)
private
String
area
;
@ApiModelProperty
(
value
=
"地址"
)
private
String
address
;
@ApiModelProperty
(
value
=
"报警时间"
)
private
Date
callTime
;
@ApiModelProperty
(
value
=
"救援倒计时"
)
private
String
rescueTime
;
@ApiModelProperty
(
value
=
"被困人数"
)
private
String
trappedNum
;
@ApiModelProperty
(
value
=
"死亡人数"
)
private
String
dieNum
;
@ApiModelProperty
(
value
=
"受伤人数"
)
private
String
injuredNum
;
@ApiModelProperty
(
value
=
"经度"
)
private
String
longitude
;
@ApiModelProperty
(
value
=
"纬度"
)
private
String
latitude
;
@ApiModelProperty
(
value
=
"停留时间"
)
private
String
stopTime
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/dto/EsElevatorDto.java
View file @
f04e98b3
...
@@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel;
...
@@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.util.Date
;
/**
/**
* @author litw
* @author litw
* @date 2021-09-26.
* @date 2021-09-26.
...
@@ -17,6 +19,13 @@ public class EsElevatorDto {
...
@@ -17,6 +19,13 @@ public class EsElevatorDto {
*
*
*/
*/
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
/**
* 电梯id
*/
@ApiModelProperty
(
value
=
"电梯id"
)
private
Long
sequenceNbr
;
/**
/**
* 注册编码
* 注册编码
*/
*/
...
@@ -83,4 +92,16 @@ public class EsElevatorDto {
...
@@ -83,4 +92,16 @@ public class EsElevatorDto {
@ApiModelProperty
(
value
=
"警情id"
)
@ApiModelProperty
(
value
=
"警情id"
)
private
String
alertId
;
private
String
alertId
;
/**
* 是否当天
*/
@ApiModelProperty
(
value
=
"是否当天"
)
private
Boolean
isToday
;
/**
* 发生时间
*/
@ApiModelProperty
(
value
=
"发生时间"
)
private
Date
happenTime
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/dto/SignatureDto.java
0 → 100644
View file @
f04e98b3
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* 获取微信扫一扫签名信息
*/
@Data
@ApiModel
(
value
=
"SignatureDto"
,
description
=
"获取微信扫一扫签名信息"
)
public
class
SignatureDto
{
@ApiModelProperty
(
value
=
"时间戳"
)
private
String
timestamp
;
@ApiModelProperty
(
value
=
"随机字符串"
)
private
String
noncestr
;
@ApiModelProperty
(
value
=
"url地址"
)
private
String
url
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/entity/EsElevator.java
View file @
f04e98b3
...
@@ -48,7 +48,7 @@ public class EsElevator {
...
@@ -48,7 +48,7 @@ public class EsElevator {
/**
/**
* 所属区域代码
* 所属区域代码
*/
*/
@Field
(
type
=
FieldType
.
Text
)
@Field
(
type
=
FieldType
.
Text
,
searchAnalyzer
=
"ik_max_word"
,
analyzer
=
"ik_max_word"
)
private
String
regionCode
;
private
String
regionCode
;
/**
/**
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/mapper/AlertCalledMapper.java
View file @
f04e98b3
...
@@ -62,10 +62,13 @@ public interface AlertCalledMapper extends BaseMapper<AlertCalled> {
...
@@ -62,10 +62,13 @@ public interface AlertCalledMapper extends BaseMapper<AlertCalled> {
String
alertStage
,
String
alertStage
,
String
alertStatus
,
String
alertStatus
,
String
address
);
String
address
);
Map
<
String
,
Integer
>
getTodayEmergencyCount
();
Map
<
String
,
Integer
>
getTodayEmergencyCount
(
String
regionCode
);
Map
<
String
,
Integer
>
getImportantEventCount
();
Map
<
String
,
Integer
>
getImportantEventCount
(
String
regionCode
);
Map
<
String
,
Integer
>
getImportantEventDetail
();
List
<
Map
<
String
,
Object
>>
getImportantEventDetail
(
String
type
,
String
regionCode
);
List
<
Map
<
String
,
Object
>>
getTodayEmergencyDetail
(
String
rescueTotal
,
String
rescueComplete
,
String
regionCode
);
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/service/IAlertCalledService.java
View file @
f04e98b3
...
@@ -63,4 +63,6 @@ public interface IAlertCalledService {
...
@@ -63,4 +63,6 @@ public interface IAlertCalledService {
AlertHandlerDto
getHandlerInfo
(
String
alertId
);
AlertHandlerDto
getHandlerInfo
(
String
alertId
);
Object
getCalledInfo
();
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/resources/mapper/AlertCalledMapper.xml
View file @
f04e98b3
...
@@ -260,12 +260,12 @@
...
@@ -260,12 +260,12 @@
<select
id=
"getTodayEmergencyCount"
resultType=
"java.util.Map"
>
<select
id=
"getTodayEmergencyCount"
resultType=
"java.util.Map"
>
SELECT
SELECT
COUNT(alarm_type_code = '960') as sleepyTncidentTotal,
COUNT(
tz.
alarm_type_code = '960') as sleepyTncidentTotal,
sum(
sum(
CASE
CASE
WHEN
WHEN
alarm_type_code = '960'
tz.
alarm_type_code = '960'
AND alert_stage_code IN ('861', '862')
AND alert_stage_code IN ('86
0','86
1', '862')
THEN
THEN
1
1
ELSE
ELSE
...
@@ -274,9 +274,9 @@
...
@@ -274,9 +274,9 @@
) as rescueTotal ,
) as rescueTotal ,
sum(
sum(
CASE
CASE
WHEN alarm_type_code = '960'
WHEN
tz.
alarm_type_code = '960'
AND
AND
alert_stage_code in
tz.
alert_stage_code in
('864','865','866') THEN
('864','865','866') THEN
1
1
ELSE
ELSE
...
@@ -285,45 +285,147 @@
...
@@ -285,45 +285,147 @@
) as
) as
rescueComplete
rescueComplete
FROM
FROM
tz_alert_called where is_delete=0
tz_alert_called tz left join tcb_elevator el on tz.equipment_id = el.sequence_nbr where tz.is_delete=0
and tz.call_time >= (select current_date())
and (select date_add(current_date(), interval 1 day)) >= tz.call_time
<if
test=
"regionCode != null and regionCode != ''"
>
AND el.region_code like CONCAT(CONCAT('%',#{regionCode}),'%')
</if>
</select>
</select>
<select
id=
"getImportantEventCount"
resultType=
"java.util.Map"
>
<select
id=
"getImportantEventCount"
resultType=
"java.util.Map"
>
select count(1) as importantEventCount from (
SELECT
SELECT
count(afv.alert_called_id) as importantEventCount
ac.*
FROM
FROM
tz_alert_called ac
tz_alert_called ac
LEFT
JOIN (
INNER
JOIN (
SELECT
SELECT
*
alert_called_id
FROM
FROM
tz_alert_form_value
tz_alert_form_value
WHERE
WHERE
tz_alert_form_value.field_value IS NOT NULL
tz_alert_form_value.field_value IS NOT NULL
AND tz_alert_form_value.field_value != ''
AND tz_alert_form_value.field_value != ''
AND field_code IN ('injured_num', 'die_num')
AND tz_alert_form_value.field_value != '0'
AND field_code IN ('injured_num', 'die_num')
and tz_alert_form_value.is_delete=0
and tz_alert_form_value.is_delete=0
group by alert_called_id
) afv ON ac.sequence_nbr = afv.alert_called_id
) afv ON ac.sequence_nbr = afv.alert_called_id
WHERE
WHERE
ac.alarm_type_code = '960' and ac.is_delete=0
ac.alarm_type_code = '960' and ac.is_delete=0
) tzs left join tcb_elevator te on tzs.equipment_id = te.sequence_nbr
where 1=1
and tzs.call_time >= (select current_date())
and (select date_add(current_date(), interval 1 day)) >= tzs.call_time
<if
test=
"regionCode != null and regionCode != ''"
>
AND te.region_code like CONCAT(CONCAT('%',#{regionCode}),'%')
</if>
</select>
</select>
<select
id=
"getImportantEventDetail"
resultType=
"java.util.Map"
>
<select
id=
"getImportantEventDetail"
resultType=
"java.util.Map"
>
select tzs.contact_phone,tzs.rec_user_name,
tzs.type,tzs.emergency_person,tzs.alarm_type,tzs.alert_source,tzs.address,
tzs.device_id,tzs.contact_user,tzs.alarm_type_code,tzs.sequence_nbr,date_format(tzs.call_time,"%Y-%m-%d %H:%i:%S") call_time,
tzs.rec_user_id,tzs.registration_code,tzs.emergency_call,tzs.type_code,tzs.equipment_id
,te.latitude ,te.region_code ,te.longitude,tzs.injured from (
SELECT
SELECT
ac.*
ac.*
,'有伤亡' as injured
FROM
FROM
tz_alert_called ac
tz_alert_called ac
LEFT
JOIN (
INNER
JOIN (
SELECT
SELECT
*
alert_called_id
FROM
FROM
tz_alert_form_value
tz_alert_form_value
WHERE
WHERE
tz_alert_form_value.field_value IS NOT NULL
tz_alert_form_value.field_value IS NOT NULL
AND tz_alert_form_value.field_value != ''
AND tz_alert_form_value.field_value != ''
AND field_code IN ('injured_num', 'die_num')
AND tz_alert_form_value.field_value != '0'
AND field_code IN ('injured_num', 'die_num')
and tz_alert_form_value.is_delete=0
and tz_alert_form_value.is_delete=0
group by alert_called_id
) afv ON ac.sequence_nbr = afv.alert_called_id
) afv ON ac.sequence_nbr = afv.alert_called_id
WHERE
WHERE
ac.alarm_type_code = '960' and ac.is_delete=0
ac.alarm_type_code = '960' and ac.is_delete=0
) tzs left join tcb_elevator te on tzs.equipment_id = te.sequence_nbr
where 1=1
and tzs.call_time >= (select current_date())
and (select date_add(current_date(), interval 1 day)) >= tzs.call_time
<if
test=
"regionCode != null and regionCode != ''"
>
AND te.region_code like CONCAT(CONCAT('%',#{regionCode}),'%')
</if>
</select>
<select
id=
"getTodayEmergencyDetail"
resultType=
"java.util.Map"
>
select tzs.contact_phone,tzs.rec_user_name,
tzs.type,tzs.emergency_person,tzs.alarm_type,tzs.alert_source,tzs.address,
tzs.device_id,tzs.contact_user,tzs.alarm_type_code,tzs.sequence_nbr,date_format(tzs.call_time,"%Y-%m-%d %H:%i:%S") call_time,
tzs.rec_user_id,tzs.registration_code,tzs.emergency_call,tzs.type_code,tzs.equipment_id
,te.latitude ,te.region_code ,te.longitude,tzs.injured from (
SELECT
ac.*,'有伤亡' as injured
FROM
tz_alert_called ac
INNER JOIN (
SELECT
alert_called_id
FROM
tz_alert_form_value
WHERE
tz_alert_form_value.field_value IS NOT NULL
AND tz_alert_form_value.field_value != ''
AND field_code IN ('injured_num', 'die_num')
and tz_alert_form_value.is_delete=0
group by alert_called_id
) afv ON ac.sequence_nbr = afv.alert_called_id
WHERE
ac.alarm_type_code = '960' and ac.is_delete=0
) tzs left join tcb_elevator te on tzs.equipment_id = te.sequence_nbr
where 1=1
and tzs.call_time >= (select current_date())
and (select date_add(current_date(), interval 1 day)) >= tzs.call_time
<if
test=
"regionCode != null and regionCode != ''"
>
AND te.region_code like CONCAT(CONCAT('%',#{regionCode}),'%')
</if>
<if
test=
"rescueTotal != null and rescueTotal != ''"
>
AND tzs.alert_stage_code in ('861','862')
</if>
<if
test=
"rescueComplete != null and rescueComplete != ''"
>
AND tzs.alert_stage_code in ('864','865','866')
</if>
union all
select tzs.contact_phone,tzs.rec_user_name,
tzs.type,tzs.emergency_person,tzs.alarm_type,tzs.alert_source,tzs.address,
tzs.device_id,tzs.contact_user,tzs.alarm_type_code,tzs.sequence_nbr,date_format(tzs.call_time,"%Y-%m-%d %H:%i:%S") call_time,
tzs.rec_user_id,tzs.registration_code,tzs.emergency_call,tzs.type_code,tzs.equipment_id
,te.latitude ,te.region_code ,te.longitude,tzs.injured from (
select *,'无伤亡' as injured from tz_alert_called where sequence_nbr not in (
SELECT
alert_called_id
FROM
tz_alert_form_value
WHERE
tz_alert_form_value.field_value IS NOT NULL
AND tz_alert_form_value.field_value != ''
AND field_code IN ('injured_num', 'die_num')
and tz_alert_form_value.is_delete=0
group by alert_called_id
)
) tzs left join tcb_elevator te on tzs.equipment_id = te.sequence_nbr
where 1=1
and tzs.call_time >= (select current_date())
and (select date_add(current_date(), interval 1 day)) >= tzs.call_time
<if
test=
"regionCode != null and regionCode != ''"
>
AND te.region_code like CONCAT(CONCAT('%',#{regionCode}),'%')
</if>
<if
test=
"rescueTotal != null and rescueTotal != ''"
>
AND tzs.alert_stage_code in ('861','862')
</if>
<if
test=
"rescueComplete != null and rescueComplete != ''"
>
AND tzs.alert_stage_code in ('864','865','866')
</if>
</select>
</select>
</mapper>
</mapper>
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/resources/mapper/RescueStationMapper.xml
View file @
f04e98b3
...
@@ -9,6 +9,8 @@
...
@@ -9,6 +9,8 @@
tcb_rescue_station.address,
tcb_rescue_station.address,
tcb_rescue_station.rescue_leader_id,
tcb_rescue_station.rescue_leader_id,
tcb_rescue_station.rescue_leader,
tcb_rescue_station.rescue_leader,
tcb_rescue_station.longitude,
tcb_rescue_station.latitude,
tcb_rescue_station.rescue_leader_phone,
tcb_rescue_station.rescue_leader_phone,
(
(
ACOS(
ACOS(
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/AlertCalledController.java
View file @
f04e98b3
...
@@ -17,6 +17,7 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCallInfoDto;
...
@@ -17,6 +17,7 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCallInfoDto;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledObjsDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledObjsDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertPaperInfoDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledRequestDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledRequestDto
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled
;
...
@@ -92,6 +93,9 @@ public class AlertCalledController extends BaseController {
...
@@ -92,6 +93,9 @@ public class AlertCalledController extends BaseController {
@Autowired
@Autowired
WechatRelationServiceImpl
wechatRelationService
;
WechatRelationServiceImpl
wechatRelationService
;
@Autowired
ElevatorServiceImpl
elevatorService
;
/**
/**
* 新增警情接警填报记录
* 新增警情接警填报记录
*
*
...
@@ -155,6 +159,39 @@ public class AlertCalledController extends BaseController {
...
@@ -155,6 +159,39 @@ public class AlertCalledController extends BaseController {
return
ResponseHelper
.
buildResponse
(
alertCalledDtoReturn
);
return
ResponseHelper
.
buildResponse
(
alertCalledDtoReturn
);
}
}
/**
* 警情信息
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/getAlertInfo"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"警情信息"
,
notes
=
"警情信息"
)
public
ResponseModel
<
AlertPaperInfoDto
>
getAlertInfo
(
@RequestParam
Long
alertId
)
{
AlertCalled
alertCalled
=
iAlertCalledService
.
getById
(
alertId
);
AlertPaperInfoDto
alertPaperInfoDto
=
new
AlertPaperInfoDto
();
alertPaperInfoDto
.
setAlertId
(
alertCalled
.
getSequenceNbr
());
iAlertCalledService
.
selectAlertCalledByIdNew
(
alertPaperInfoDto
);
LambdaQueryWrapper
<
Elevator
>
queryWrapper1
=
new
LambdaQueryWrapper
<>();
queryWrapper1
.
eq
(
Elevator:
:
getSequenceNbr
,
alertCalled
.
getEquipmentId
());
Elevator
elevator
=
elevatorService
.
getOne
(
queryWrapper1
);
alertPaperInfoDto
.
setArea
(
elevator
.
getProvince
()
+
elevator
.
getCity
()
+
elevator
.
getDistrict
());
alertPaperInfoDto
.
setAddress
(
alertCalled
.
getAddress
());
alertPaperInfoDto
.
setCallTime
(
alertCalled
.
getCallTime
());
alertPaperInfoDto
.
setLatitude
(
elevator
.
getLatitude
());
alertPaperInfoDto
.
setLongitude
(
elevator
.
getLongitude
());
alertPaperInfoDto
.
setAlarmTypeCode
(
alertCalled
.
getAlarmTypeCode
());
alertPaperInfoDto
.
setRegionCode
(
elevator
.
getRegionCode
());
alertPaperInfoDto
.
setRescueCode
(
elevator
.
getRescueCode
());
return
ResponseHelper
.
buildResponse
(
alertPaperInfoDto
);
}
/**
/**
*
*
* <pre>
* <pre>
...
@@ -458,21 +495,21 @@ public class AlertCalledController extends BaseController {
...
@@ -458,21 +495,21 @@ public class AlertCalledController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/getTodayEmergencyCount"
)
@GetMapping
(
value
=
"/getTodayEmergencyCount"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"今日应急统计"
,
notes
=
"今日应急统计"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"今日应急统计"
,
notes
=
"今日应急统计"
)
public
ResponseModel
<
Object
>
getTodayEmergencyCount
()
{
public
ResponseModel
<
Object
>
getTodayEmergencyCount
(
@RequestParam
String
regionCode
)
{
return
ResponseHelper
.
buildResponse
(
iAlertCalledService
.
getTodayEmergencyCount
());
return
ResponseHelper
.
buildResponse
(
iAlertCalledService
.
getTodayEmergencyCount
(
regionCode
));
}
/**
* 重大事件
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/getImportantEventCount"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"重要大事件统计"
,
notes
=
"重要大事件统计"
)
public
ResponseModel
<
Object
>
getImportantEventCount
()
{
return
ResponseHelper
.
buildResponse
(
iAlertCalledService
.
getImportantEventCount
());
}
}
//
// /**
// * 重大事件
// */
// @TycloudOperation(ApiLevel = UserType.AGENCY)
// @GetMapping(value = "/getImportantEventCount")
// @ApiOperation(httpMethod = "GET", value = "重要大事件统计", notes = "重要大事件统计")
// public ResponseModel<Object> getImportantEventCount() {
// return ResponseHelper.buildResponse(iAlertCalledService.getImportantEventCount());
//
// }
/**
/**
* 获取重大事件或者今日应急的统计详情信息
* 获取重大事件或者今日应急的统计详情信息
...
@@ -480,8 +517,8 @@ public class AlertCalledController extends BaseController {
...
@@ -480,8 +517,8 @@ public class AlertCalledController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/getImportantEventOrTodayEmergencyCount"
)
@GetMapping
(
value
=
"/getImportantEventOrTodayEmergencyCount"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"重要大事件统计"
,
notes
=
"重要大事件统计"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"重要大事件统计"
,
notes
=
"重要大事件统计"
)
public
ResponseModel
<
Object
>
getImportantEventOrTodayEmergencyCount
(
@RequestParam
String
type
)
{
public
ResponseModel
<
Object
>
getImportantEventOrTodayEmergencyCount
(
@RequestParam
String
type
,
@RequestParam
String
regionCode
)
{
return
ResponseHelper
.
buildResponse
(
iAlertCalledService
.
getImportantEventOrTodayEmergencyCount
(
type
));
return
ResponseHelper
.
buildResponse
(
iAlertCalledService
.
getImportantEventOrTodayEmergencyCount
(
type
,
regionCode
));
}
}
...
@@ -495,4 +532,15 @@ public class AlertCalledController extends BaseController {
...
@@ -495,4 +532,15 @@ public class AlertCalledController extends BaseController {
public
ResponseModel
<
Object
>
getHandlerInfo
(
@RequestParam
String
alertId
)
{
public
ResponseModel
<
Object
>
getHandlerInfo
(
@RequestParam
String
alertId
)
{
return
ResponseHelper
.
buildResponse
(
iAlertCalledService
.
getHandlerInfo
(
alertId
));
return
ResponseHelper
.
buildResponse
(
iAlertCalledService
.
getHandlerInfo
(
alertId
));
}
}
/**
* 获取接警未派遣事件
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/getCalledInfo"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取接警未派遣事件"
,
notes
=
"获取接警未派遣事件"
)
public
ResponseModel
<
Object
>
getCalledInfo
()
{
return
ResponseHelper
.
buildResponse
(
iAlertCalledService
.
getCalledInfo
());
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/ElevatorController.java
View file @
f04e98b3
...
@@ -356,7 +356,7 @@ public class ElevatorController extends BaseController {
...
@@ -356,7 +356,7 @@ public class ElevatorController extends BaseController {
public
void
init
()
{
public
void
init
()
{
IPage
<
Elevator
>
elevatorPage
=
new
Page
<>();
IPage
<
Elevator
>
elevatorPage
=
new
Page
<>();
Integer
count
=
elevatorService
.
count
();
Integer
count
=
elevatorService
.
count
();
for
(
int
i
=
0
;
i
<=
count
%
500
;
i
++
)
{
for
(
int
i
=
0
;
i
<=
2
;
i
++
)
{
elevatorPage
.
setCurrent
(
i
);
elevatorPage
.
setCurrent
(
i
);
elevatorPage
.
setSize
(
500
);
elevatorPage
.
setSize
(
500
);
elevatorPage
=
elevatorService
.
page
(
elevatorPage
);
elevatorPage
=
elevatorService
.
page
(
elevatorPage
);
...
@@ -369,19 +369,17 @@ public class ElevatorController extends BaseController {
...
@@ -369,19 +369,17 @@ public class ElevatorController extends BaseController {
/**
/**
* ES
分页
查询电梯信息
* ES查询电梯信息
*
*
* @param current 当前页
* @param size 每页大小
* @param elevatorDto 查询参数
* @param elevatorDto 查询参数
* @return 查询结果
* @return 查询结果
*/
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/query_elevator_list_es"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/query_elevator_list_es"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"ES
分页查询电梯信息"
,
notes
=
"ES分页
查询电梯信息"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"ES
查询电梯信息"
,
notes
=
"ES
查询电梯信息"
)
public
ResponseModel
<
IPage
<
EsElevatorDto
>>
queryElevatorListEs
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
public
ResponseModel
<
List
<
EsElevatorDto
>>
queryElevatorListEs
(
@RequestBody
EsElevatorDto
elevatorDto
){
@RequestBody
EsElevatorDto
elevatorDto
){
Page
<
EsElevatorDto
>
page
=
esElevatorService
.
queryByKeys
(
elevatorDto
,
current
,
size
);
List
<
EsElevatorDto
>
page
=
esElevatorService
.
queryByKeys
(
elevatorDto
);
return
ResponseHelper
.
buildResponse
(
page
);
return
ResponseHelper
.
buildResponse
(
page
);
}
}
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/RescueStationController.java
View file @
f04e98b3
...
@@ -30,6 +30,8 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
...
@@ -30,6 +30,8 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.LinkedList
;
import
java.util.List
;
/**
/**
...
@@ -241,5 +243,29 @@ public class RescueStationController extends BaseController {
...
@@ -241,5 +243,29 @@ public class RescueStationController extends BaseController {
return
ResponseHelper
.
buildResponse
(
iRescueStationService
.
getListByLatLonDistance
(
latitude
,
longitude
,
distance
));
return
ResponseHelper
.
buildResponse
(
iRescueStationService
.
getListByLatLonDistance
(
latitude
,
longitude
,
distance
));
}
}
/**
* 根据警情id和距离返回救援机构信息
* @param alertId
* @return
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/alert/{alertId}/distance"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据警情id和距离返回5个救援机构信息"
,
notes
=
"根据警情id和距离返回5个救援机构信息"
)
public
ResponseModel
<
Object
>
selectByAlertIdDistance
(
@PathVariable
Long
alertId
)
{
// 获取根据警情获取电梯信息
Elevator
elevator
=
elevatorServiceImpl
.
selectByAlertId
(
alertId
);
String
longitude
=
elevator
.
getLongitude
();
String
latitude
=
elevator
.
getLatitude
();
// 根据经纬度和距离返回救援机构信息
List
<
RescueStationDto
>
rescueStationDtos
=
new
LinkedList
<>();
List
<
RescueStationDto
>
list
=
iRescueStationService
.
getListByLatLonDistance
(
latitude
,
longitude
,
1000
);
if
(
list
.
size
()
>
5
)
{
for
(
int
i
=
0
;
i
<
5
;
i
++
)
{
rescueStationDtos
.
add
(
list
.
get
(
i
));
}
}
return
ResponseHelper
.
buildResponse
(
list
.
size
()
>
5
?
rescueStationDtos:
list
);
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/WechatController.java
View file @
f04e98b3
...
@@ -9,6 +9,7 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
...
@@ -9,6 +9,7 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import
com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto
;
import
com.yeejoin.amos.boot.module.common.api.service.ISourceFileService
;
import
com.yeejoin.amos.boot.module.common.api.service.ISourceFileService
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.SignatureDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.WechatAccessDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.WechatAccessDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.WechatMessageDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.WechatMessageDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskDto
;
...
@@ -37,6 +38,8 @@ import io.swagger.annotations.ApiOperation;
...
@@ -37,6 +38,8 @@ import io.swagger.annotations.ApiOperation;
import
io.swagger.annotations.ApiParam
;
import
io.swagger.annotations.ApiParam
;
import
org.apache.commons.codec.digest.DigestUtils
;
import
org.apache.commons.codec.digest.DigestUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -64,6 +67,7 @@ import java.io.ByteArrayInputStream;
...
@@ -64,6 +67,7 @@ import java.io.ByteArrayInputStream;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.Comparator
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Iterator
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.List
;
...
@@ -77,6 +81,8 @@ import java.util.Map;
...
@@ -77,6 +81,8 @@ import java.util.Map;
@RequestMapping
(
value
=
"/wechatBack"
)
@RequestMapping
(
value
=
"/wechatBack"
)
public
class
WechatController
extends
BaseController
{
public
class
WechatController
extends
BaseController
{
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
WechatController
.
class
);
private
long
time
=
600
l
;
private
long
time
=
600
l
;
@Value
(
"${tzs.wechat.token}"
)
@Value
(
"${tzs.wechat.token}"
)
...
@@ -136,35 +142,65 @@ public class WechatController extends BaseController {
...
@@ -136,35 +142,65 @@ public class WechatController extends BaseController {
}
}
}
}
/**
* 获取微信签名
* @param timestamp
* @param noncestr
* @param url
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
ANONYMOUS
,
needAuth
=
false
)
@TycloudOperation
(
ApiLevel
=
UserType
.
ANONYMOUS
,
needAuth
=
false
)
@
Ge
tMapping
(
value
=
"/getSignature"
)
@
Pos
tMapping
(
value
=
"/getSignature"
)
@ApiOperation
(
httpMethod
=
"
GE
T"
,
value
=
"获取微信签名"
,
notes
=
"获取微信签名"
)
@ApiOperation
(
httpMethod
=
"
POS
T"
,
value
=
"获取微信签名"
,
notes
=
"获取微信签名"
)
public
String
getSignature
(
@RequestParam
String
timestamp
,
@RequestParam
String
noncestr
,
@RequestParam
String
url
)
{
public
ResponseModel
<
String
>
getSignature
(
@RequestBody
SignatureDto
signatureDto
)
{
List
<
String
>
params
=
new
ArrayList
<
String
>();
List
<
String
>
params
=
new
ArrayList
<
String
>();
try
{
try
{
if
(!
redisUtils
.
hasKey
(
RedisKey
.
WECHAT_TOKEN
)){
String
ticket
=
null
;
throw
new
BadRequest
(
"token不存在或已失效"
);
if
(
redisUtils
.
hasKey
(
RedisKey
.
WECHAT_JS_TOKEN
))
{
}
ticket
=
redisUtils
.
get
(
RedisKey
.
WECHAT_JS_TOKEN
).
toString
();
String
token
=
redisUtils
.
get
(
RedisKey
.
WECHAT_TOKEN
).
toString
();
}
else
{
String
result
=
HttpUtils
.
doGet
(
WECHAT_TICKETURL
+
token
+
"&type=jsapi"
);
if
(!
redisUtils
.
hasKey
(
RedisKey
.
WECHAT_TOKEN
)){
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
result
);
this
.
getAccessToken
();
String
ticket
=
jsonObject
.
get
(
"ticket"
).
toString
();
}
String
token
=
redisUtils
.
get
(
RedisKey
.
WECHAT_TOKEN
).
toString
();
String
result
=
HttpUtils
.
doGet
(
WECHAT_TICKETURL
+
token
+
"&type=jsapi"
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
result
);
ticket
=
jsonObject
.
get
(
"ticket"
).
toString
();
redisUtils
.
set
(
RedisKey
.
WECHAT_JS_TOKEN
,
ticket
,
600
l
);
}
params
.
add
(
"jsapi_ticket="
+
ticket
);
params
.
add
(
"jsapi_ticket="
+
ticket
);
params
.
add
(
noncestr
);
params
.
add
(
"noncestr="
+
signatureDto
.
getNoncestr
());
params
.
add
(
timestamp
);
params
.
add
(
"timestamp="
+
signatureDto
.
getTimestamp
());
params
.
add
(
url
);
params
.
add
(
"url="
+
signatureDto
.
getUrl
());
Collections
.
sort
(
params
);
logger
.
error
(
"jsapi_ticket="
+
ticket
);
logger
.
error
(
"noncestr="
+
signatureDto
.
getNoncestr
());
logger
.
error
(
"timestamp="
+
signatureDto
.
getTimestamp
());
logger
.
error
(
"url="
+
signatureDto
.
getUrl
());
Collections
.
sort
(
params
,
new
Comparator
<
String
>()
{
@Override
public
int
compare
(
String
o1
,
String
o2
)
{
char
[]
chars1
=
o1
.
toCharArray
();
char
[]
chars2
=
o2
.
toCharArray
();
int
i
=
0
;
while
(
i
<
chars1
.
length
&&
i
<
chars2
.
length
){
if
(
chars1
[
i
]>
chars2
[
i
]){
return
1
;
}
else
if
(
chars1
[
i
]<
chars2
[
i
]){
return
-
1
;
}
else
{
i
++;
}
}
if
(
i
==
chars1
.
length
){
//o1到头
return
-
1
;
}
if
(
i
==
chars2
.
length
){
//o2到头
return
1
;
}
return
0
;
}
});
String
tokenStr
=
StringUtils
.
join
(
params
,
"&"
);
String
tokenStr
=
StringUtils
.
join
(
params
,
"&"
);
logger
.
error
(
tokenStr
);
tokenStr
=
DigestUtils
.
sha1Hex
(
tokenStr
);
tokenStr
=
DigestUtils
.
sha1Hex
(
tokenStr
);
return
tokenStr
;
return
ResponseHelper
.
buildResponse
(
tokenStr
)
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
BadRequest
(
e
.
getMessage
());
throw
new
BadRequest
(
e
.
getMessage
());
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/AlertCalledServiceImpl.java
View file @
f04e98b3
...
@@ -18,6 +18,7 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledObjsDto;
...
@@ -18,6 +18,7 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledObjsDto;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertHandlerDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertHandlerDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertHandlerInfoDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertHandlerInfoDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertPaperInfoDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.FormValue
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.FormValue
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.AlertFormValue
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.AlertFormValue
;
...
@@ -43,7 +44,6 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
...
@@ -43,7 +44,6 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
...
@@ -139,6 +139,28 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
...
@@ -139,6 +139,28 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
}
}
}
}
public
void
selectAlertCalledByIdNew
(
AlertPaperInfoDto
alertCalled
)
{
// 警情基本信息
LambdaQueryWrapper
<
AlertFormValue
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
AlertFormValue:
:
getAlertCalledId
,
alertCalled
.
getAlertId
());
// 警情动态表单数据
List
<
AlertFormValue
>
list
=
iAlertFormValueService
.
list
(
queryWrapper
);
if
(
list
!=
null
&&
list
.
size
()>
0
)
{
for
(
AlertFormValue
alertFormValue
:
list
)
{
if
(
alertFormValue
.
getFieldCode
().
equals
(
"trapped_num"
))
{
alertCalled
.
setTrappedNum
(
alertFormValue
.
getFieldValue
());
}
if
(
alertFormValue
.
getFieldCode
().
equals
(
"injured_num"
))
{
alertCalled
.
setInjuredNum
(
alertFormValue
.
getFieldValue
());
}
if
(
alertFormValue
.
getFieldCode
().
equals
(
"die_num"
))
{
alertCalled
.
setDieNum
(
alertFormValue
.
getFieldValue
());
}
}
}
}
@Override
@Override
public
AlertCalledFormDto
selectAlertCalledByIdNoCache
(
Long
id
)
{
public
AlertCalledFormDto
selectAlertCalledByIdNoCache
(
Long
id
)
{
// 警情基本信息
// 警情基本信息
...
@@ -258,8 +280,8 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
...
@@ -258,8 +280,8 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
if
(
null
==
called
)
{
if
(
null
==
called
)
{
throw
new
BadRequest
(
"警情不存在"
);
throw
new
BadRequest
(
"警情不存在"
);
}
}
map
.
put
(
"
接警
"
,
called
.
getCallTime
());
map
.
put
(
"
answerThePolice
"
,
called
.
getCallTime
());
map
.
put
(
"
上报
"
,
called
.
getRecDate
());
map
.
put
(
"
report
"
,
called
.
getRecDate
());
LambdaQueryWrapper
<
DispatchPaper
>
queryWrapper
=
new
LambdaQueryWrapper
();
LambdaQueryWrapper
<
DispatchPaper
>
queryWrapper
=
new
LambdaQueryWrapper
();
queryWrapper
.
eq
(
DispatchPaper:
:
getAlertId
,
Long
.
valueOf
(
alertId
));
queryWrapper
.
eq
(
DispatchPaper:
:
getAlertId
,
Long
.
valueOf
(
alertId
));
...
@@ -278,9 +300,9 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
...
@@ -278,9 +300,9 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
if
(
null
!=
dispatchTask
&&
dispatchTask
.
size
()
>
0
)
{
if
(
null
!=
dispatchTask
&&
dispatchTask
.
size
()
>
0
)
{
List
<
DispatchTask
>
taskList
=
dispatchTask
.
stream
().
filter
(
e
->
e
.
getOrgType
().
equals
(
s
)).
collect
(
Collectors
.
toList
());
List
<
DispatchTask
>
taskList
=
dispatchTask
.
stream
().
filter
(
e
->
e
.
getOrgType
().
equals
(
s
)).
collect
(
Collectors
.
toList
());
if
(
taskList
.
size
()
>
0
)
{
if
(
taskList
.
size
()
>
0
)
{
map
.
put
(
"
派遣/通知
"
,
called
.
getRecDate
());
map
.
put
(
"
notice
"
,
called
.
getRecDate
());
map
.
put
(
"
到达
"
,
dispatchTask
.
get
(
0
).
getArriveTime
());
map
.
put
(
"
arrive
"
,
dispatchTask
.
get
(
0
).
getArriveTime
());
map
.
put
(
"
完成
"
,
dispatchTask
.
get
(
0
).
getSaveTime
());
map
.
put
(
"
complete
"
,
dispatchTask
.
get
(
0
).
getSaveTime
());
dataInit
(
alertHandlerInfoDto
,
s
,
""
,
""
,
"已派遣"
,
dataInit
(
alertHandlerInfoDto
,
s
,
""
,
""
,
"已派遣"
,
dispatchTask
.
get
(
0
).
getArriveTime
()
==
null
?
""
:
"已到达"
,
dispatchTask
.
get
(
0
).
getSaveTime
()
==
null
?
""
:
"已完成"
,
dispatchTask
.
get
(
0
).
getArriveTime
()
==
null
?
""
:
"已到达"
,
dispatchTask
.
get
(
0
).
getSaveTime
()
==
null
?
""
:
"已完成"
,
dispatchPaper
.
getFeedbackTime
()
!=
null
||
dispatchPaper
.
getFeedbackFinishTime
()
!=
null
?
"已回访"
:
""
);
dispatchPaper
.
getFeedbackTime
()
!=
null
||
dispatchPaper
.
getFeedbackFinishTime
()
!=
null
?
"已回访"
:
""
);
...
@@ -290,7 +312,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
...
@@ -290,7 +312,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
}
}
list
.
add
(
alertHandlerInfoDto
);
list
.
add
(
alertHandlerInfoDto
);
}
}
map
.
put
(
"
回访
"
,
dispatchPaper
.
getFeedbackTime
());
map
.
put
(
"
returnVisit
"
,
dispatchPaper
.
getFeedbackTime
());
}
else
{
}
else
{
for
(
String
s:
str
)
{
for
(
String
s:
str
)
{
AlertHandlerInfoDto
alertHandlerInfoDto
=
new
AlertHandlerInfoDto
();
AlertHandlerInfoDto
alertHandlerInfoDto
=
new
AlertHandlerInfoDto
();
...
@@ -303,6 +325,14 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
...
@@ -303,6 +325,14 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
return
alertHandlerDto
;
return
alertHandlerDto
;
}
}
@Override
public
Object
getCalledInfo
()
{
LambdaQueryWrapper
<
AlertCalled
>
queryWrapper
=
new
LambdaQueryWrapper
();
queryWrapper
.
eq
(
AlertCalled:
:
getAlertStageCode
,
"860"
);
Object
list
=
this
.
list
(
queryWrapper
);
return
list
;
}
private
void
dataInit
(
AlertHandlerInfoDto
alertHandlerInfoDto
,
String
process
,
String
answerThePolice
,
String
report
,
String
notice
,
String
arrive
,
String
complete
,
String
returnVisit
)
{
private
void
dataInit
(
AlertHandlerInfoDto
alertHandlerInfoDto
,
String
process
,
String
answerThePolice
,
String
report
,
String
notice
,
String
arrive
,
String
complete
,
String
returnVisit
)
{
alertHandlerInfoDto
.
setProcess
(
process
);
alertHandlerInfoDto
.
setProcess
(
process
);
alertHandlerInfoDto
.
setAnswerThePolice
(
answerThePolice
);
alertHandlerInfoDto
.
setAnswerThePolice
(
answerThePolice
);
...
@@ -363,6 +393,10 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
...
@@ -363,6 +393,10 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
alertCalled
.
setAlertStageCode
(
AlertStageEnums
.
JJ
.
getId
());
alertCalled
.
setAlertStageCode
(
AlertStageEnums
.
JJ
.
getId
());
alertCalled
.
setType
(
AlertStageEnums
.
JQCB
.
getValue
());
alertCalled
.
setType
(
AlertStageEnums
.
JQCB
.
getValue
());
alertCalled
.
setTypeCode
(
AlertStageEnums
.
JQCB
.
getId
());
alertCalled
.
setTypeCode
(
AlertStageEnums
.
JQCB
.
getId
());
LambdaQueryWrapper
<
Elevator
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
Elevator:
:
getRescueCode
,
alertCalled
.
getDeviceId
());
Elevator
elevator
=
iElevatorService
.
getOne
(
queryWrapper
);
alertCalled
.
setEquipmentId
(
elevator
.
getSequenceNbr
());
this
.
save
(
alertCalled
);
this
.
save
(
alertCalled
);
// 动态表单
// 动态表单
...
@@ -495,27 +529,56 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
...
@@ -495,27 +529,56 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
return
result
;
return
result
;
}
}
public
Object
getTodayEmergencyCount
()
{
public
Object
getTodayEmergencyCount
(
String
regionCode
)
{
return
alertCalledMapper
.
getTodayEmergencyCount
();
Map
<
String
,
Integer
>
map
=
alertCalledMapper
.
getTodayEmergencyCount
(
regionCode
);
}
Map
<
String
,
Integer
>
map1
=
alertCalledMapper
.
getImportantEventCount
(
regionCode
);
map
.
put
(
"importantEventCount"
,
map1
.
get
(
"importantEventCount"
));
public
Object
getImportantEventCount
()
{
return
map
;
return
alertCalledMapper
.
getImportantEventCount
();
}
}
public
Object
getImportantEventOrTodayEmergencyCount
(
String
type
)
{
// public Object getImportantEventCount() {
List
<
Map
<
String
,
Object
>>
map
=
null
;
// return
LambdaQueryWrapper
<
AlertCalled
>
queryWrapper
=
new
LambdaQueryWrapper
<
AlertCalled
>();
// }
queryWrapper
.
eq
(
AlertCalled:
:
getIsDelete
,
0
);
queryWrapper
.
eq
(
AlertCalled:
:
getAlarmTypeCode
,
"960"
);
public
Object
getImportantEventOrTodayEmergencyCount
(
String
type
,
String
regionCode
)
{
if
(
"rescueTotal"
.
equals
(
type
))
{
// List<Map<String, Object>> map=null;
queryWrapper
.
in
(
AlertCalled:
:
getAlertStageCode
,
Arrays
.
asList
(
"861"
,
"862"
));
// List<Map<String, Object>> map1= new LinkedList<>();
}
else
if
(
"rescueComplete"
.
equals
(
type
))
{
// LambdaQueryWrapper<AlertCalled> queryWrapper=new LambdaQueryWrapper<AlertCalled>();
queryWrapper
.
in
(
AlertCalled:
:
getAlertStageCode
,
Arrays
.
asList
(
"864"
,
"865"
,
"866"
));
// queryWrapper.eq(AlertCalled::getIsDelete, 0);
}
// queryWrapper.eq(AlertCalled::getAlarmTypeCode, "960");
// if("rescueTotal".equals(type)) {
// queryWrapper.in(AlertCalled::getAlertStageCode,Arrays.asList("861","862"));
// }else if("rescueComplete".equals(type)) {
// queryWrapper.in(AlertCalled::getAlertStageCode,Arrays.asList("864","865","866"));
// }
if
(
"importantEventCount"
.
equals
(
type
))
{
if
(
"importantEventCount"
.
equals
(
type
))
{
return
alertCalledMapper
.
getImportantEventDetail
();
return
alertCalledMapper
.
getImportantEventDetail
(
type
,
regionCode
);
}
}
else
{
return
this
.
baseMapper
.
selectMaps
(
queryWrapper
);
if
(
"rescueTotal"
.
equals
(
type
))
{
}
return
alertCalledMapper
.
getTodayEmergencyDetail
(
type
,
null
,
regionCode
);
}
else
if
(
"rescueComplete"
.
equals
(
type
))
{
return
alertCalledMapper
.
getTodayEmergencyDetail
(
null
,
type
,
regionCode
);
}
else
{
return
alertCalledMapper
.
getTodayEmergencyDetail
(
null
,
null
,
regionCode
);
}
}
// for (Map<String,Object> m: map
// ) {
// LambdaQueryWrapper<Elevator> queryWrapper1=new LambdaQueryWrapper<>();
// queryWrapper1.eq(Elevator::getIsDelete, 0);
// queryWrapper1.eq(Elevator::getSequenceNbr, m.get("equipment_id"));
// Elevator elevator = iElevatorService.getOne(queryWrapper1);
// m.put("injured","无伤亡");
// if(null != elevator) {
// m.put("longitude",elevator.getLongitude());
// m.put("latitude",elevator.getLatitude());
// m.put("regionCode",elevator.getRegionCode());
//
// if(elevator.getRegionCode().contains(regionCode)) {
// map1.add(m);
// }
// }
// }
}
}
}
\ No newline at end of file
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/DispatchTaskServiceImpl.java
View file @
f04e98b3
...
@@ -449,21 +449,30 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
...
@@ -449,21 +449,30 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
// 根据警情分类 封装MessageDto
// 根据警情分类 封装MessageDto
AlertCalled
alertCalled
=
alertCalledServiceImpl
.
getById
(
dispatchTaskDto
.
getAlertId
());
AlertCalled
alertCalled
=
alertCalledServiceImpl
.
getById
(
dispatchTaskDto
.
getAlertId
());
Map
<
String
,
String
>
data
=
new
HashMap
<>();
Map
<
String
,
String
>
data
=
new
HashMap
<>();
data
.
put
(
"address"
,
alertCalled
.
getAddress
());
data
.
put
(
"dispatchTime"
,
DateUtils
.
date2LongStr
(
dispatchTaskDto
.
getDispatchTime
()));
if
(
AlertStageEnums
.
KRJY
.
getId
().
equals
(
dispatchTaskDto
.
getAlertCode
()))
{
if
(
AlertStageEnums
.
KRJY
.
getId
().
equals
(
dispatchTaskDto
.
getAlertCode
()))
{
temp
.
setTemplateId
(
KRJY_TEMPID
);
temp
.
setTemplateId
(
KRJY_TEMPID
);
temp
.
setUrl
(
KRJY_URL
);
temp
.
setUrl
(
KRJY_URL
+
"?id="
+
dispatchTaskDto
.
getSequenceNbr
());
data
.
put
(
"first"
,
"电梯困人任务已派遣,请尽快前往救援!"
);
data
.
put
(
"keyword1"
,
alertCalled
.
getAddress
());
data
.
put
(
"keyword2"
,
DateUtils
.
date2LongStr
(
dispatchTaskDto
.
getDispatchTime
()));
data
.
put
(
"keyword3"
,
alertCalled
.
getEmergencyCall
());
data
.
put
(
"remark"
,
"请在收到任务后30分钟内到达人员被困位置进行救援!"
);
temp
.
setData
(
data
);
temp
.
setData
(
data
);
}
else
if
(
AlertStageEnums
.
GZWX
.
getId
().
equals
(
dispatchTaskDto
.
getAlertCode
()))
{
}
else
if
(
AlertStageEnums
.
GZWX
.
getId
().
equals
(
dispatchTaskDto
.
getAlertCode
()))
{
temp
.
setTemplateId
(
WX_TEMPID
);
temp
.
setTemplateId
(
WX_TEMPID
);
temp
.
setUrl
(
WX_URL
);
temp
.
setUrl
(
WX_URL
+
"?id="
+
dispatchTaskDto
.
getSequenceNbr
());
data
.
put
(
"first"
,
"故障维修任务已派遣,请尽快前往救援!"
);
data
.
put
(
"keyword1"
,
"故障维修"
);
data
.
put
(
"keyword2"
,
"电梯故障"
);
data
.
put
(
"keyword3"
,
alertCalled
.
getEmergencyPerson
());
data
.
put
(
"keyword4"
,
alertCalled
.
getEmergencyCall
());
data
.
put
(
"keyword5"
,
DateUtils
.
date2LongStr
(
dispatchTaskDto
.
getDispatchTime
()));
data
.
put
(
"remark"
,
"任务已派遣,请尽快前往处置!"
);
temp
.
setData
(
data
);
temp
.
setData
(
data
);
}
else
if
(
AlertStageEnums
.
TSZX
.
getId
().
equals
(
dispatchTaskDto
.
getAlertCode
()))
{
}
else
if
(
AlertStageEnums
.
TSZX
.
getId
().
equals
(
dispatchTaskDto
.
getAlertCode
()))
{
temp
.
setTemplateId
(
TS_TEMPID
);
temp
.
setTemplateId
(
TS_TEMPID
);
temp
.
setUrl
(
TS_URL
);
temp
.
setUrl
(
TS_URL
+
"?id="
+
dispatchTaskDto
.
getSequenceNbr
()
);
temp
.
setData
(
data
);
temp
.
setData
(
data
);
}
}
return
temp
;
return
temp
;
...
@@ -587,6 +596,7 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
...
@@ -587,6 +596,7 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
// 发送任务单
// 发送任务单
WechatRelation
temp
=
wechatRelationServiceImpl
.
getOne
(
new
LambdaQueryWrapper
<
WechatRelation
>().
eq
(
WechatRelation:
:
getPhone
,
dispatchTaskDto
.
getResponseUserTel
()));
WechatRelation
temp
=
wechatRelationServiceImpl
.
getOne
(
new
LambdaQueryWrapper
<
WechatRelation
>().
eq
(
WechatRelation:
:
getPhone
,
dispatchTaskDto
.
getResponseUserTel
()));
if
(
temp
!=
null
&&
temp
.
getOpenId
()
!=
null
)
{
if
(
temp
!=
null
&&
temp
.
getOpenId
()
!=
null
)
{
dispatchTaskDto
.
setSequenceNbr
(
dispatchTask
.
getSequenceNbr
());
WechatMessageDto
dto
=
this
.
getWechatMessageDtoByDispatchTaskDto
(
dispatchTaskDto
);
WechatMessageDto
dto
=
this
.
getWechatMessageDtoByDispatchTaskDto
(
dispatchTaskDto
);
wechatService
.
sendWechatModelMessage
(
temp
.
getOpenId
()
,
dto
);
wechatService
.
sendWechatModelMessage
(
temp
.
getOpenId
()
,
dto
);
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/ESElevatorServiceImpl.java
View file @
f04e98b3
...
@@ -2,7 +2,6 @@ package com.yeejoin.amos.boot.module.tzs.biz.service.impl;
...
@@ -2,7 +2,6 @@ package com.yeejoin.amos.boot.module.tzs.biz.service.impl;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.EsElevatorDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.EsElevatorDto
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled
;
...
@@ -13,7 +12,6 @@ import org.elasticsearch.index.query.BoolQueryBuilder;
...
@@ -13,7 +12,6 @@ import org.elasticsearch.index.query.BoolQueryBuilder;
import
org.elasticsearch.index.query.QueryBuilders
;
import
org.elasticsearch.index.query.QueryBuilders
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate
;
import
org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate
;
import
org.springframework.data.elasticsearch.core.SearchHit
;
import
org.springframework.data.elasticsearch.core.SearchHit
;
import
org.springframework.data.elasticsearch.core.SearchHits
;
import
org.springframework.data.elasticsearch.core.SearchHits
;
...
@@ -25,6 +23,7 @@ import java.util.ArrayList;
...
@@ -25,6 +23,7 @@ import java.util.ArrayList;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.LinkedList
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
/**
*
*
...
@@ -69,8 +68,10 @@ public class ESElevatorServiceImpl {
...
@@ -69,8 +68,10 @@ public class ESElevatorServiceImpl {
esElevator
.
setCity
(
elevator
.
getCity
());
esElevator
.
setCity
(
elevator
.
getCity
());
esElevator
.
setDistrict
(
elevator
.
getDistrict
());
esElevator
.
setDistrict
(
elevator
.
getDistrict
());
esElevator
.
setLatitude
(
elevator
.
getLatitude
());
esElevator
.
setLatitude
(
elevator
.
getLatitude
());
esElevator
.
setLongitude
(
elevator
.
getLongitude
());
esElevator
.
setRegisterCode
(
elevator
.
getRegisterCode
());
esElevator
.
setRegisterCode
(
elevator
.
getRegisterCode
());
esElevator
.
setRegionCode
(
elevator
.
getRegionCode
());
esElevator
.
setRegionCode
(
elevator
.
getRegionCode
());
esElevator
.
setRescueCode
(
elevator
.
getRescueCode
());
esElavtorRepository
.
save
(
esElevator
);
esElavtorRepository
.
save
(
esElevator
);
return
esElevator
;
return
esElevator
;
...
@@ -81,38 +82,49 @@ public class ESElevatorServiceImpl {
...
@@ -81,38 +82,49 @@ public class ESElevatorServiceImpl {
* 根据关键字查询文档,关键字不为空时按相关性从大到小排序
* 根据关键字查询文档,关键字不为空时按相关性从大到小排序
*
*
* @param elevatorDto 关键字
* @param elevatorDto 关键字
* @param current 当前页码
* @param size 页面大小
* @return
* @return
*/
*/
@SuppressWarnings
({
"rawtypes"
})
@SuppressWarnings
({
"rawtypes"
})
public
Page
<
EsElevatorDto
>
queryByKeys
(
EsElevatorDto
elevatorDto
,
int
current
,
int
size
)
{
public
List
<
EsElevatorDto
>
queryByKeys
(
EsElevatorDto
elevatorDto
)
{
Page
<
EsElevatorDto
>
result
=
new
Page
<>(
current
,
size
);
String
alarmTypeCode
=
elevatorDto
.
getAlarmTypeCode
();
String
alarmTypeCode
=
elevatorDto
.
getAlarmTypeCode
();
String
address
=
elevatorDto
.
getAddress
();
String
address
=
elevatorDto
.
getAddress
();
String
regionCode
=
elevatorDto
.
getRegionCode
();
String
regionCode
=
elevatorDto
.
getRegionCode
();
String
alertId
=
elevatorDto
.
getAlertId
();
/**
/**
* 通用匹配规则,条件构建
* 通用匹配规则,条件构建
*/
*/
BoolQueryBuilder
boolMust
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
boolMust
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
qb0
=
QueryBuilders
.
boolQuery
();
LambdaQueryWrapper
<
AlertCalled
>
queryWrapper
=
new
LambdaQueryWrapper
();
if
(!
ValidationUtil
.
isEmpty
(
alarmTypeCode
))
{
if
(!
ValidationUtil
.
isEmpty
(
alarmTypeCode
))
{
BoolQueryBuilder
qb0
=
QueryBuilders
.
boolQuery
();
LambdaQueryWrapper
<
AlertCalled
>
queryWrapper
=
new
LambdaQueryWrapper
();
queryWrapper
.
eq
(
AlertCalled:
:
getAlarmTypeCode
,
alarmTypeCode
);
queryWrapper
.
eq
(
AlertCalled:
:
getAlarmTypeCode
,
alarmTypeCode
);
}
if
(!
ValidationUtil
.
isEmpty
(
alertId
))
{
AlertCalled
alertCalled
=
iAlertCalledService
.
getById
(
elevatorDto
.
getAlertId
());
BoolQueryBuilder
qb4
=
QueryBuilders
.
boolQuery
();
qb4
.
must
(
QueryBuilders
.
termQuery
(
"sequenceNbr"
,
alertCalled
.
getEquipmentId
()));
boolMust
.
must
(
qb4
);
}
if
(
elevatorDto
.
getIsToday
()
!=
null
&&
elevatorDto
.
getIsToday
())
{
queryWrapper
.
ge
(
AlertCalled:
:
getCallTime
,
DateUtils
.
stampToDate
(
System
.
currentTimeMillis
(),
DateUtils
.
DATE_PATTERN
));
queryWrapper
.
ge
(
AlertCalled:
:
getCallTime
,
DateUtils
.
stampToDate
(
System
.
currentTimeMillis
(),
DateUtils
.
DATE_PATTERN
));
queryWrapper
.
le
(
AlertCalled:
:
getCallTime
,
DateUtils
.
stampToDate
(
DateUtils
.
dateAddDays
(
new
Date
(),
1
).
getTime
(),
DateUtils
.
DATE_PATTERN
));
queryWrapper
.
le
(
AlertCalled:
:
getCallTime
,
DateUtils
.
stampToDate
(
DateUtils
.
dateAddDays
(
new
Date
(),
1
).
getTime
(),
DateUtils
.
DATE_PATTERN
));
List
<
AlertCalled
>
alertCalleds
=
iAlertCalledService
.
list
(
queryWrapper
);
List
<
Long
>
stringList
=
new
ArrayList
<>();
for
(
AlertCalled
al:
alertCalleds
)
{
stringList
.
add
(
al
.
getEquipmentId
());
}
qb0
.
must
(
QueryBuilders
.
termsQuery
(
"sequenceNbr"
,
stringList
.
toArray
()));
boolMust
.
must
(
qb0
);
}
}
List
<
AlertCalled
>
alertCalleds
=
iAlertCalledService
.
list
(
queryWrapper
);
List
<
Long
>
stringList
=
new
ArrayList
<>();
for
(
AlertCalled
al:
alertCalleds
)
{
stringList
.
add
(
al
.
getEquipmentId
());
}
List
<
Long
>
listL
=
stringList
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
qb0
.
should
(
QueryBuilders
.
termsQuery
(
"sequenceNbr"
,
listL
.
toArray
()));
boolMust
.
must
(
qb0
);
if
(!
ValidationUtil
.
isEmpty
(
address
))
{
if
(!
ValidationUtil
.
isEmpty
(
address
))
{
BoolQueryBuilder
boolMustAddress
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
boolMustAddress
=
QueryBuilders
.
boolQuery
();
...
@@ -124,22 +136,20 @@ public class ESElevatorServiceImpl {
...
@@ -124,22 +136,20 @@ public class ESElevatorServiceImpl {
if
(!
ValidationUtil
.
isEmpty
(
regionCode
))
{
if
(!
ValidationUtil
.
isEmpty
(
regionCode
))
{
BoolQueryBuilder
qb2
=
QueryBuilders
.
boolQuery
().
BoolQueryBuilder
qb2
=
QueryBuilders
.
boolQuery
().
filter
(
QueryBuilders
.
term
Query
(
"regionCode"
,
regionCode
));
filter
(
QueryBuilders
.
matchPhrase
Query
(
"regionCode"
,
regionCode
));
boolMust
.
must
(
qb2
);
boolMust
.
must
(
qb2
);
}
}
// 创建查询构造器
// 创建查询构造器
NativeSearchQueryBuilder
queryBuilder
=
new
NativeSearchQueryBuilder
()
NativeSearchQueryBuilder
queryBuilder
=
new
NativeSearchQueryBuilder
()
// 分页
// 分页
.
withPageable
(
PageRequest
.
of
(
current
,
size
))
//
.withPageable(PageRequest.of(current, size))
// 排序
// 排序
// .withSort(SortBuilders.fieldSort("callTimeLong").order(SortOrder.DESC))
// .withSort(SortBuilders.fieldSort("callTimeLong").order(SortOrder.DESC))
//过滤条件
//过滤条件
.
withQuery
(
boolMust
);
.
withQuery
(
boolMust
);
List
<
EsElevatorDto
>
list
=
new
LinkedList
<>();
List
<
EsElevatorDto
>
list
=
new
LinkedList
<>();
long
totle
=
0
;
try
try
{
{
SearchHits
<
EsElevator
>
searchHits
=
elasticsearchTemplate
.
search
(
queryBuilder
.
build
(),
EsElevator
.
class
);
SearchHits
<
EsElevator
>
searchHits
=
elasticsearchTemplate
.
search
(
queryBuilder
.
build
(),
EsElevator
.
class
);
...
@@ -148,17 +158,22 @@ public class ESElevatorServiceImpl {
...
@@ -148,17 +158,22 @@ public class ESElevatorServiceImpl {
{
{
JSONObject
jsonObject
=
(
JSONObject
)
JSONObject
.
toJSON
(
searchHit
.
getContent
());
JSONObject
jsonObject
=
(
JSONObject
)
JSONObject
.
toJSON
(
searchHit
.
getContent
());
EsElevatorDto
esElevatorDto
=
JSONObject
.
toJavaObject
(
jsonObject
,
EsElevatorDto
.
class
);
EsElevatorDto
esElevatorDto
=
JSONObject
.
toJavaObject
(
jsonObject
,
EsElevatorDto
.
class
);
for
(
AlertCalled
al:
alertCalleds
)
{
if
(
al
.
getEquipmentId
().
equals
(
esElevatorDto
.
getSequenceNbr
()))
{
esElevatorDto
.
setHappenTime
(
al
.
getCallTime
());
esElevatorDto
.
setAlertId
(
String
.
valueOf
(
al
.
getSequenceNbr
()));
esElevatorDto
.
setAlarmTypeCode
(
al
.
getAlarmTypeCode
());
break
;
}
}
list
.
add
(
esElevatorDto
);
list
.
add
(
esElevatorDto
);
}
}
totle
=
searchHits
.
getTotalHits
();
}
}
catch
(
Exception
e
)
catch
(
Exception
e
)
{
{
// TODO: handle exception
// TODO: handle exception
}
}
result
.
setRecords
(
list
);
return
list
;
result
.
setTotal
(
totle
);
return
result
;
}
}
}
}
amos-boot-system-tzs/src/main/resources/application-dev.properties
View file @
f04e98b3
...
@@ -42,9 +42,9 @@ tzs.cti.secretkey=7bd29115-99ee-4f7d-1fb1-7c4719d5f43a
...
@@ -42,9 +42,9 @@ tzs.cti.secretkey=7bd29115-99ee-4f7d-1fb1-7c4719d5f43a
tzs.cti.url
=
http://36.46.151.113:8000
tzs.cti.url
=
http://36.46.151.113:8000
tzs.wechat.url
=
https://api.weixin.qq.com
tzs.wechat.url
=
https://api.weixin.qq.com
##wechatAPPID
##wechatAPPID
wx79aca5bb1cb4af92 wx8918c1aaad956617
tzs.wechat.appid
=
wx8918c1aaad956617
tzs.wechat.appid
=
wx8918c1aaad956617
##wechatSECRET
##wechatSECRET
f3a12323ba731d282c3d4698c27c3e97 f3a12323ba731d282c3d4698c27c3e97
tzs.wechat.secret
=
337c3d8f3e749140d4f9aedc8311033b
tzs.wechat.secret
=
337c3d8f3e749140d4f9aedc8311033b
##wechatToken
##wechatToken
...
@@ -52,9 +52,9 @@ tzs.wechat.token=yeejoin_2021
...
@@ -52,9 +52,9 @@ tzs.wechat.token=yeejoin_2021
##wechatTicketUrl
##wechatTicketUrl
tzs.wechat.ticketurl
=
https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=
tzs.wechat.ticketurl
=
https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=
tzs.wechat.tempId.kr
=
SLjmNJoCNLC3FBcYzWzR-u3el0kqXf8WMTmzw8dAQm
4
tzs.wechat.tempId.kr
=
Hlu43OOCVTESzOtkP4we1AUZJoPfquZl2_DEn6U66Z
4
tzs.wechat.url.kr
=
www.baidu.com
tzs.wechat.url.kr
=
tzs.yeeamos.com/persondetail.html
tzs.wechat.tempId.wx
=
SLjmNJoCNLC3FBcYzWzR-u3el0kqXf8WMTmzw8dAQm4
tzs.wechat.tempId.wx
=
rags-expfNSBB-h2WenuBI2c6pCEndH4uwTtOqlHqDM
tzs.wechat.url.wx
=
www.baidu.com
tzs.wechat.url.wx
=
tzs.yeeamos.com/persondetail.html
tzs.wechat.tempId.ts
=
SLjmNJoCNLC3FBcYzWzR-u3el0kqXf8WMTmzw8dAQm4
tzs.wechat.tempId.ts
=
SLjmNJoCNLC3FBcYzWzR-u3el0kqXf8WMTmzw8dAQm4
tzs.wechat.url.ts
=
www.baidu.com
tzs.wechat.url.ts
=
tzs.yeeamos.com/persondetail.html
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