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
5b454ed1
Commit
5b454ed1
authored
Jun 24, 2021
by
郭武斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*)添加警情报送规则
parent
98f89d4a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
232 additions
and
3 deletions
+232
-3
application-dev.properties
...-jcs-system/src/main/resources/application-dev.properties
+6
-0
AlertCalledRo.java
...m/yeejoin/amos/boot/module/jcs/api/dto/AlertCalledRo.java
+40
-0
ESAlertCalledRequestDto.java
...amos/boot/module/jcs/api/dto/ESAlertCalledRequestDto.java
+11
-1
AlertCalledAction.java
...os/boot/module/jcs/biz/rule/action/AlertCalledAction.java
+117
-0
RuleAlertCalledService.java
...t/module/jcs/biz/service/impl/RuleAlertCalledService.java
+50
-0
pom.xml
amos-boot-module/pom.xml
+8
-2
No files found.
amos-boot-jcs-system/src/main/resources/application-dev.properties
View file @
5b454ed1
...
@@ -25,6 +25,12 @@ spring.data.elasticsearch.cluster-name=elasticsearch
...
@@ -25,6 +25,12 @@ spring.data.elasticsearch.cluster-name=elasticsearch
spring.data.elasticsearch.cluster-nodes
=
172.16.3.3:9300
spring.data.elasticsearch.cluster-nodes
=
172.16.3.3:9300
spring.elasticsearch.rest.uris
=
http://172.16.3.3:9200
spring.elasticsearch.rest.uris
=
http://172.16.3.3:9200
## emqx
emqx.clean-session
=
true
emqx.client-id
=
${spring.application.name}-${random.int[1024,65536]}
emqx.broker
=
tcp://172.16.10.85:1883
emqx.user-name
=
super
emqx.password
=
a123456
security.systemctl.name
=
AMOS-API-SYSTEMCTL
security.systemctl.name
=
AMOS-API-SYSTEMCTL
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/dto/AlertCalledRo.java
0 → 100644
View file @
5b454ed1
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
api
.
dto
;
import
java.io.Serializable
;
import
com.yeejoin.amos.component.rule.Label
;
import
com.yeejoin.amos.component.rule.RuleFact
;
import
lombok.Data
;
/**
*
* <pre>
* 警情报送规则触发对象
* </pre>
*
* @author gwb
* @version $Id: AlertCalledRo.java, v 0.1 2021年6月24日 下午3:31:14 gwb Exp $
*/
@Data
@RuleFact
(
value
=
"警情信息"
,
project
=
"西咸机场119接处警规则"
)
public
class
AlertCalledRo
implements
Serializable
{
/**
* <pre>
*
* </pre>
*/
private
static
final
long
serialVersionUID
=
-
8105736102662461646L
;
@Label
(
"警情id"
)
private
Long
sequenceNbr
;
@Label
(
value
=
"警情类型"
)
private
String
alertType
;
@Label
(
value
=
"警情类型code"
)
private
String
alertTypeCode
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/dto/ESAlertCalledRequestDto.java
View file @
5b454ed1
...
@@ -4,8 +4,18 @@ import com.yeejoin.amos.boot.module.jcs.api.vo.AlertCalledVo;
...
@@ -4,8 +4,18 @@ import com.yeejoin.amos.boot.module.jcs.api.vo.AlertCalledVo;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
/**
*
* <pre>
* 警情信息ES请求参数对象
* </pre>
*
* @author gwb
* @version $Id: ESAlertCalledRequestDto.java, v 0.1 2021年6月24日 下午3:30:40 gwb Exp $
*/
@Data
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
public
class
ESAlertCalledRequestDto
extends
AlertCalledVo
public
class
ESAlertCalledRequestDto
extends
AlertCalledVo
{
{
@ApiModelProperty
(
value
=
"警情状态"
)
@ApiModelProperty
(
value
=
"警情状态"
)
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/rule/action/AlertCalledAction.java
0 → 100644
View file @
5b454ed1
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
rule
.
action
;
import
java.util.HashMap
;
import
java.util.Map
;
import
javax.annotation.PostConstruct
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.stereotype.Component
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledRo
;
import
com.yeejoin.amos.component.rule.RuleActionBean
;
import
com.yeejoin.amos.component.rule.RuleMethod
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
/**
*
* <pre>
* 警情报送规则动作
* </pre>
*
* @author gwb
* @version $Id: AlertCalledAction.java, v 0.1 2021年6月24日 下午4:41:22 gwb Exp $
*/
@Component
@RuleActionBean
(
beanLabel
=
"警情报送"
)
public
class
AlertCalledAction
{
public
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
AlertCalledAction
.
class
);
@PostConstruct
public
void
init
()
throws
Exception
{
System
.
out
.
println
();
}
public
void
sendSysMessage
(
String
msgType
,
AlertCalledRo
contingency
)
{
// ContingencyRo ro = (ContingencyRo)contingency;
// ro.setTelemetryMap(null);
// ro.setTelesignallingMap(null);
// Constructor<?> constructor;
// try {
// constructor = Class.forName(
// PACKAGEURL + result.getClass().getSimpleName() + "Message")
// .getConstructor(ActionResult.class);
// AbstractActionResultMessage<?> action = (AbstractActionResultMessage<?>) constructor.newInstance(result);
// ToipResponse toipResponse = action.buildResponse(msgType, contingency, result.toJson());
// String topic = String.format("/%s/%s/%s", serviceName, stationName,"numberPlan");
// log.info(String.format("mqtt[%s]:【 %s 】", topic, toipResponse.toJsonStr()));
// webMqttComponent.publish(topic, toipResponse.toJsonStr());
// ContingencyEvent event = new ContingencyEvent(this);
// event.setMsgBody(toipResponse.toJsonStr());
// event.setTopic(topic);
// event.setMsgType(msgType);
// event.setContingency(contingency);
// contingencyLogPublisher.publish(event);
//
// } catch (Exception e) {
// e.printStackTrace();
// }
}
/**
*
* <pre>
* 短信报送
* </pre>
*
* @param smsTemp
* @param sendType
* @param sendIds
* @param alertCalledRo
*/
@RuleMethod
(
methodLabel
=
"短信报送"
,
project
=
"西咸机场119接处警规则"
)
public
void
sendcmd
(
String
smsTemp
,
String
sendType
,
String
sendIds
,
Object
object
)
{
AlertCalledRo
alertCalledRo
=
(
AlertCalledRo
)
object
;
HashMap
<
String
,
String
>
smsParams
=
new
HashMap
<
String
,
String
>();
smsParams
.
put
(
"smsType"
,
"MOBILE_REGISTER"
);
smsParams
.
put
(
"mobile"
,
"15191462503"
);
Systemctl
.
smsClient
.
sendVerifyCode
(
smsParams
);
// ContingencyRo ro = (ContingencyRo)contingency;
// ro.setTelemetryMap(null);
// ro.setTelesignallingMap(null);
// Constructor<?> constructor;
// try {
// constructor = Class.forName(
// PACKAGEURL + result.getClass().getSimpleName() + "Message")
// .getConstructor(ActionResult.class);
// AbstractActionResultMessage<?> action = (AbstractActionResultMessage<?>) constructor.newInstance(result);
// if ("mqtt".equals(pushType.toLowerCase())) {
// ToipResponse toipResponse = action.buildResponse(msgType, contingency, result.toJson());
// String topic = String.format("/%s/%s/%s", serviceName, stationName,"plan");
// log.info(String.format("mqtt[%s]:【 %s 】", topic, toipResponse.toJsonStr()));
// webMqttComponent.publish(topic, toipResponse.toJsonStr());
//
// ContingencyEvent event = new ContingencyEvent(this);
// event.setMsgBody(toipResponse.toJsonStr());
// event.setTopic(topic);
// event.setMsgType(msgType);
// event.setContingency(contingency);
// contingencyLogPublisher.publish(event);
// } else if ("websocket".equals(pushType.toLowerCase())){
// action.execute(msgType, contingency);
// }
//
// } catch (Exception e) {
// e.printStackTrace();
// }
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/RuleAlertCalledService.java
0 → 100644
View file @
5b454ed1
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
service
.
impl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledRo
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled
;
import
com.yeejoin.amos.component.rule.RuleTrigger
;
/**
*
* <pre>
* 规则触发服务
* </pre>
*
* @author gwb
* @version $Id: RuleAlertCalledService.java, v 0.1 2021年6月24日 下午6:30:44 gwb Exp $
*/
@Service
public
class
RuleAlertCalledService
{
@Autowired
private
RuleTrigger
ruleTrigger
;
/**
*
* <pre>
* 触发警情报送规则
* </pre>
*
* @param alertCalled
* @return
* @throws Exception
*/
public
Boolean
fireAlertCalledRule
(
AlertCalled
alertCalled
)
throws
Exception
{
//构建警情报送规则对象
AlertCalledRo
alertCalledRo
=
new
AlertCalledRo
();
alertCalledRo
.
setSequenceNbr
(
alertCalled
.
getSequenceNbr
());
alertCalledRo
.
setAlertType
(
alertCalled
.
getAlertType
());
alertCalledRo
.
setAlertTypeCode
(
alertCalled
.
getAlertTypeCode
());
alertCalledRo
.
setAlertTypeCode
(
"229"
);
//触发规则
ruleTrigger
.
publish
(
alertCalledRo
,
"西咸机场119接处警规则/alertCalledRule"
,
new
String
[
0
]);
return
true
;
}
}
amos-boot-module/pom.xml
View file @
5b454ed1
...
@@ -12,12 +12,18 @@
...
@@ -12,12 +12,18 @@
<dependencies>
<dependencies>
<!-- ES-->
<dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-elasticsearch
</artifactId>
<artifactId>
spring-boot-starter-data-elasticsearch
</artifactId>
</dependency>
</dependency>
<!-- amos rule-->
<dependency>
<groupId>
com.yeejoin
</groupId>
<artifactId>
amos-component-rule
</artifactId>
<version>
1.4.7
</version>
</dependency>
</dependencies>
</dependencies>
<modules>
<modules>
...
...
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