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
cec35b98
Commit
cec35b98
authored
Dec 10, 2021
by
tangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
警情推送
parent
9e4f4f3c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
16 deletions
+35
-16
AlertCalledZhDto.java
...eejoin/amos/boot/module/jcs/api/dto/AlertCalledZhDto.java
+1
-1
AlertCalledServiceImpl.java
...t/module/jcs/biz/service/impl/AlertCalledServiceImpl.java
+5
-5
AlertSubmittedServiceImpl.java
...odule/jcs/biz/service/impl/AlertSubmittedServiceImpl.java
+28
-9
PowerTransferServiceImpl.java
...module/jcs/biz/service/impl/PowerTransferServiceImpl.java
+1
-1
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/dto/AlertCalledZhDto.java
View file @
cec35b98
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
api
.
dto
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
...
...
@@ -18,7 +19,6 @@ import java.util.Date;
@ApiModel
(
value
=
"AlertCalledZhDto"
,
description
=
" 指挥警情接警记录"
)
public
class
AlertCalledZhDto
{
@ApiModelProperty
(
value
=
"主键ID"
)
protected
Long
sequenceNbr
;
...
...
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 @
cec35b98
...
...
@@ -9,6 +9,7 @@ import java.util.Set;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
com.alibaba.fastjson.serializer.SerializerFeature
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
...
...
@@ -384,7 +385,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
// 保存动态表单数据
iAlertFormValueService
.
saveBatch
(
alertFormValuelist
);
emqKeeper
.
getMqttClient
().
publish
(
topic1
,
"1"
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
tru
e
);
emqKeeper
.
getMqttClient
().
publish
(
topic1
,
"1"
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
fals
e
);
}
else
{
// 警情报送
// ****************************************************待确认开发
...
...
@@ -409,15 +410,15 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
ruleAlertCalledService
.
fireAlertCalledRule
(
alertCalledObjsDto
,
AlertBusinessTypeEnum
.
警情初报
.
getCode
(),
null
,
null
,
null
);
// 通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化
emqKeeper
.
getMqttClient
().
publish
(
topic
,
"0"
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
tru
e
);
emqKeeper
.
getMqttClient
().
publish
(
topic
,
"0"
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
fals
e
);
//tuisongxinjingqing
RequestData
par
=
new
RequestData
();
par
.
setAlertId
(
alertCalled
.
getSequenceNbr
());
List
<
AlertCalledZhDto
>
list
=
this
.
alertCalledListByAlertStatus
(
null
,
null
,
par
);
String
json
=
list
!=
null
&&
list
.
size
()>
0
?
JSONObject
.
toJSONString
(
list
.
get
(
0
)):
""
;
emqKeeper
.
getMqttClient
().
publish
(
topicData
,
json
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
tru
e
);
String
json
=
list
!=
null
&&
list
.
size
()>
0
?
JSONObject
.
toJSONString
(
list
.
get
(
0
)
,
SerializerFeature
.
PrettyFormat
,
SerializerFeature
.
WriteMapNullValue
):
""
;
emqKeeper
.
getMqttClient
().
publish
(
topicData
,
json
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
fals
e
);
/**
* 同步保存ES
...
...
@@ -431,7 +432,6 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
throw
new
RuntimeException
(
"报送失败,系统异常!"
);
}
}
/**
* 根据id 修改警情 type:警情相关 操作类型 0警情续报 1非警情确认 2 警情结案
*/
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/AlertSubmittedServiceImpl.java
View file @
cec35b98
...
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONException
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.serializer.SerializerFeature
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.deepoove.poi.XWPFTemplate
;
...
...
@@ -515,15 +516,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
alertCalledAction
.
sendAlertCalleCmd
(
sCode
,
mobiles
,
smsParams
);
}
//警情結案推送
if
(
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情结案
.
getCode
()))
{
RequestData
par
=
new
RequestData
();
par
.
setAlertId
(
alertCalled
.
getSequenceNbr
());
List
<
AlertCalledZhDto
>
list
=
alertCalledService
.
alertCalledListByAlertStatus
(
null
,
null
,
par
);
String
json
=
list
!=
null
&&
list
.
size
()>
0
?
JSONObject
.
toJSONString
(
list
.
get
(
0
)):
""
;
emqKeeper
.
getMqttClient
().
publish
(
topicJa
,
json
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
true
);
}
...
...
@@ -538,7 +531,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Map
<
String
,
String
>
saveAlertSubmitted
(
AlertSubmittedDto
alertSubmittedDto
,
String
userName
)
{
Long
alertSubmittedId
=
alertSubmittedDto
.
getSequenceNbr
();
try
{
Long
alertSubmittedId
=
alertSubmittedDto
.
getSequenceNbr
();
String
alertWay
=
""
;
Map
<
String
,
String
>
map
=
new
HashMap
<>();
Set
<
String
>
mobiles
=
new
HashSet
<>();
...
...
@@ -665,6 +658,12 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
}
if
(
AlertBusinessTypeEnum
.
警情结案
.
getCode
().
equals
(
alertSubmittedDto
.
getBusinessTypeCode
())
||
AlertBusinessTypeEnum
.
非警情确认
.
getCode
().
equals
(
alertSubmittedDto
.
getBusinessTypeCode
()))
{
// 查询本次警情调派的车辆
...
...
@@ -689,6 +688,22 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
// powerTransferCompanyResourcesService.update(new UpdateWrapper<PowerTransferCompanyResources>().eq("resources_id", transferCarIdList).set("status", FireCarStatusEnum.返队.getCode()));
}
//警情結案推送
if
(
AlertBusinessTypeEnum
.
警情结案
.
getCode
().
equals
(
alertSubmittedDto
.
getBusinessTypeCode
()))
{
//tuisongxinjingqing
RequestData
par
=
new
RequestData
();
par
.
setAlertId
(
alertSubmittedDto
.
getAlertCalledId
());
List
<
AlertCalledZhDto
>
list4
=
alertCalledService
.
alertCalledListByAlertStatus
(
null
,
null
,
par
);
String
json
=
list4
!=
null
&&
list4
.
size
()>
0
?
JSONObject
.
toJSONString
(
list4
.
get
(
0
),
SerializerFeature
.
PrettyFormat
,
SerializerFeature
.
WriteMapNullValue
):
""
;
emqKeeper
.
getMqttClient
().
publish
(
topicJa
,
json
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
false
);
}
// 4.发送任务消息
// 4.1组织短信内容 废弃
...
...
@@ -704,6 +719,10 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
map
.
put
(
"alertWay"
,
alertWay
);
map
.
put
(
"mobiles"
,
StringUtils
.
join
(
mobiles
,
","
));
return
map
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
(
"报送失败,系统异常!"
);
}
}
public
void
generateMob
(
AlertCalled
alertCalled
)
throws
ParseException
,
FileNotFoundException
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/PowerTransferServiceImpl.java
View file @
cec35b98
...
...
@@ -162,7 +162,7 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
// 发送调派通知
// 通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化
emqKeeper
.
getMqttClient
().
publish
(
topic
,
"0"
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
tru
e
);
emqKeeper
.
getMqttClient
().
publish
(
topic
,
"0"
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
fals
e
);
}
catch
(
MqttException
e
)
{
throw
new
RuntimeException
();
}
...
...
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