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
39c48d75
Commit
39c48d75
authored
Nov 19, 2021
by
helinlin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
66b170da
c1b8b623
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
45 additions
and
24 deletions
+45
-24
RuleConstant.java
.../yeejoin/amos/boot/biz/common/constants/RuleConstant.java
+5
-2
RuleTypeEnum.java
.../com/yeejoin/amos/boot/biz/common/enums/RuleTypeEnum.java
+22
-9
LatentDangerRo.java
...eejoin/amos/latentdanger/business/dto/LatentDangerRo.java
+4
-1
RuleDangerService.java
...latentdanger/business/service/impl/RuleDangerService.java
+4
-6
PlanRo.java
...ava/com/yeejoin/amos/supervision/business/dto/PlanRo.java
+4
-1
RulePlanService.java
...os/supervision/business/service/impl/RulePlanService.java
+5
-4
pom.xml
pom.xml
+1
-1
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/constants/
Terminal
Constant.java
→
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/constants/
Rule
Constant.java
View file @
39c48d75
...
...
@@ -2,11 +2,14 @@ package com.yeejoin.amos.boot.biz.common.constants;
/**
* @Author: xl
* @Description:
终端标识
* @Description:
规则常量
* @Date: 2021/11/17 11:40
*/
public
class
Terminal
Constant
{
public
class
Rule
Constant
{
public
final
static
String
APP
=
"APP"
;
public
final
static
String
WEB
=
"WEB"
;
public
final
static
String
APP_WEB
=
"APP/WEB"
;
public
final
static
Integer
TASK
=
0
;
// 任务
public
final
static
Integer
NOTIFY
=
1
;
// 通知
}
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/enums/RuleTypeEnum.java
View file @
39c48d75
package
com
.
yeejoin
.
amos
.
boot
.
biz
.
common
.
enums
;
import
com.yeejoin.amos.boot.biz.common.constants.
Terminal
Constant
;
import
com.yeejoin.amos.boot.biz.common.constants.
Rule
Constant
;
/**
* 规则请求枚举
...
...
@@ -10,15 +10,15 @@ import com.yeejoin.amos.boot.biz.common.constants.TerminalConstant;
public
enum
RuleTypeEnum
{
// 防火监督
计划提交
(
"计划提交"
,
"addPlan"
,
"auditPage"
,
TerminalConstant
.
WEB
),
计划审核
(
"计划审核"
,
"planAudit"
,
"auditPage"
,
TerminalConstant
.
APP_WEB
),
计划审核完成
(
"计划审核完成"
,
"planAuditAll"
,
"formulatePage"
,
TerminalConstant
.
APP_WEB
),
计划生成
(
"计划生成"
,
"addPlanTask"
,
null
,
TerminalConstant
.
APP
),
计划完成
(
"计划完成"
,
"planCompleted"
,
null
,
TerminalConstant
.
APP_WEB
),
计划提交
(
"计划提交"
,
"addPlan"
,
"auditPage"
,
RuleConstant
.
WEB
,
RuleConstant
.
TASK
),
计划审核
(
"计划审核"
,
"planAudit"
,
"auditPage"
,
RuleConstant
.
APP_WEB
,
RuleConstant
.
TASK
),
计划审核完成
(
"计划审核完成"
,
"planAuditAll"
,
"formulatePage"
,
RuleConstant
.
APP_WEB
,
RuleConstant
.
NOTIFY
),
计划生成
(
"计划生成"
,
"addPlanTask"
,
null
,
RuleConstant
.
APP
,
RuleConstant
.
TASK
),
计划完成
(
"计划完成"
,
"planCompleted"
,
null
,
RuleConstant
.
APP_WEB
,
RuleConstant
.
NOTIFY
),
// 隐患
隐患第一次提交
(
"隐患提交"
,
"addLatentDanger"
,
null
,
null
),
隐患审核
(
"隐患审核"
,
"dangerAudit"
,
null
,
null
);
隐患第一次提交
(
"隐患提交"
,
"addLatentDanger"
,
null
,
null
,
RuleConstant
.
TASK
),
隐患审核
(
"隐患审核"
,
"dangerAudit"
,
null
,
null
,
RuleConstant
.
TASK
);
/**
* 名称,描述
...
...
@@ -36,6 +36,10 @@ public enum RuleTypeEnum {
* 终端标识
*/
private
String
terminal
;
/**
* 类别
*/
private
Integer
category
;
public
String
getName
()
{
return
name
;
...
...
@@ -69,11 +73,20 @@ public enum RuleTypeEnum {
this
.
terminal
=
terminal
;
}
RuleTypeEnum
(
String
name
,
String
code
,
String
url
,
String
terminal
)
{
public
Integer
getCategory
()
{
return
category
;
}
public
void
setCategory
(
Integer
category
)
{
this
.
category
=
category
;
}
RuleTypeEnum
(
String
name
,
String
code
,
String
url
,
String
terminal
,
Integer
category
)
{
this
.
name
=
name
;
this
.
code
=
code
;
this
.
url
=
url
;
this
.
terminal
=
terminal
;
this
.
category
=
category
;
}
public
static
RuleTypeEnum
getEnumByCode
(
String
field
){
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-latentdanger-biz/src/main/java/com/yeejoin/amos/latentdanger/business/dto/LatentDangerRo.java
View file @
39c48d75
...
...
@@ -17,7 +17,7 @@ import java.util.Map;
@RuleFact
(
value
=
"隐患"
,
project
=
"消息规则"
)
public
class
LatentDangerRo
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
2985122485796921797
L
;
private
static
final
long
serialVersionUID
=
2560250594750328185
L
;
@Label
(
"隐患名称"
)
private
String
dangerName
;
...
...
@@ -61,6 +61,9 @@ public class LatentDangerRo implements Serializable {
@Label
(
value
=
"终端标识"
)
private
String
terminal
;
@Label
(
value
=
"类别"
)
private
Integer
category
;
@Label
(
value
=
"扩展参数"
)
private
Map
<
String
,
String
>
extras
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-latentdanger-biz/src/main/java/com/yeejoin/amos/latentdanger/business/service/impl/RuleDangerService.java
View file @
39c48d75
package
com
.
yeejoin
.
amos
.
latentdanger
.
business
.
service
.
impl
;
import
com.yeejoin.amos.boot.biz.common.constants.RuleConstant
;
import
com.yeejoin.amos.component.rule.RuleTrigger
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
...
...
@@ -30,16 +31,12 @@ public class RuleDangerService {
private
final
String
packageId
=
"消息/addDangerRule"
;
private
final
String
msgType
=
"danger"
;
private
final
String
APP
=
"APP"
;
private
final
String
WEB
=
"WEB"
;
private
final
String
APP_WEB
=
"APP/WEB"
;
@Autowired
private
RuleTrigger
ruleTrigger
;
public
Boolean
addLatentDangerRule
(
LatentDanger
latentDanger
,
String
ruleType
,
String
roleName
)
throws
Exception
{
LatentDangerRo
latentDangerRo
=
buildLatentDangerRo
(
latentDanger
,
ruleType
);
latentDangerRo
.
setTerminal
(
APP
);
latentDangerRo
.
setTerminal
(
RuleConstant
.
APP
);
List
<
RoleModel
>
result
=
Privilege
.
roleClient
.
queryRoleList
(
roleName
,
null
).
getResult
();
if
(
result
.
size
()
>
0
)
{
List
<
AgencyUserModel
>
userModels
=
Privilege
.
agencyUserClient
.
queryByRoleId
(
String
.
valueOf
(
result
.
get
(
0
).
getSequenceNbr
()),
null
).
getResult
();
...
...
@@ -61,7 +58,7 @@ public class RuleDangerService {
latentDangerRo
.
setExcuteStateName
(
excuteStateName
);
latentDangerRo
.
setIsSendWeb
(
true
);
latentDangerRo
.
setRecivers
(
userIds
);
latentDangerRo
.
setTerminal
(
APP_WEB
);
latentDangerRo
.
setTerminal
(
RuleConstant
.
APP_WEB
);
//触发规则
ruleTrigger
.
publish
(
latentDangerRo
,
packageId
,
new
String
[
0
]);
return
true
;
...
...
@@ -73,6 +70,7 @@ public class RuleDangerService {
latentDangerRo
.
setMsgType
(
msgType
);
latentDangerRo
.
setIsSendApp
(
true
);
latentDangerRo
.
setRuleType
(
ruleType
);
latentDangerRo
.
setCategory
(
RuleConstant
.
TASK
);
latentDangerRo
.
setRelationId
(
String
.
valueOf
(
latentDanger
.
getId
()));
latentDangerRo
.
setSendTime
(
DateUtil
.
date2LongStr
(
new
Date
()));
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/dto/PlanRo.java
View file @
39c48d75
...
...
@@ -17,7 +17,7 @@ import java.util.Map;
@RuleFact
(
value
=
"巡检计划"
,
project
=
"消息规则"
)
public
class
PlanRo
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
3493714205659077324
L
;
private
static
final
long
serialVersionUID
=
-
493916718753345180
L
;
@Label
(
"计划名称"
)
private
String
name
;
...
...
@@ -52,6 +52,9 @@ public class PlanRo implements Serializable {
@Label
(
value
=
"终端标识"
)
private
String
terminal
;
@Label
(
value
=
"类别"
)
private
Integer
category
;
@Label
(
value
=
"扩展参数"
)
private
Map
<
String
,
String
>
extras
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/service/impl/RulePlanService.java
View file @
39c48d75
package
com
.
yeejoin
.
amos
.
supervision
.
business
.
service
.
impl
;
import
com.yeejoin.amos.boot.biz.common.constants.
Terminal
Constant
;
import
com.yeejoin.amos.boot.biz.common.constants.
Rule
Constant
;
import
com.yeejoin.amos.boot.biz.common.enums.RuleTypeEnum
;
import
com.yeejoin.amos.component.rule.RuleTrigger
;
import
com.yeejoin.amos.supervision.business.dto.PlanRo
;
...
...
@@ -56,6 +56,7 @@ public class RulePlanService {
planRo
.
setRuleType
(
ruleType
.
getCode
());
planRo
.
setRelationId
(
String
.
valueOf
(
plan
.
getId
()));
planRo
.
setTerminal
(
ruleType
.
getTerminal
());
planRo
.
setCategory
(
ruleType
.
getCategory
());
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"planId"
,
String
.
valueOf
(
plan
.
getId
()));
...
...
@@ -63,11 +64,11 @@ public class RulePlanService {
map
.
put
(
"url"
,
ruleType
.
getUrl
());
}
if
(
Terminal
Constant
.
WEB
.
equals
(
ruleType
.
getTerminal
())){
if
(
Rule
Constant
.
WEB
.
equals
(
ruleType
.
getTerminal
())){
planRo
.
setIsSendWeb
(
true
);
}
else
if
(
Terminal
Constant
.
APP
.
equals
(
ruleType
.
getTerminal
())){
}
else
if
(
Rule
Constant
.
APP
.
equals
(
ruleType
.
getTerminal
())){
planRo
.
setIsSendApp
(
true
);
}
else
if
(
Terminal
Constant
.
APP_WEB
.
equals
(
ruleType
.
getTerminal
())){
}
else
if
(
Rule
Constant
.
APP_WEB
.
equals
(
ruleType
.
getTerminal
())){
planRo
.
setIsSendWeb
(
true
);
planRo
.
setIsSendApp
(
true
);
}
...
...
pom.xml
View file @
39c48d75
...
...
@@ -210,7 +210,7 @@
<dependency>
<groupId>
com.yeejoin
</groupId>
<artifactId>
amos-feign-systemctl
</artifactId>
<version>
1.6.
4
-SNAPSHOT
</version>
<version>
1.6.
5
-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
io.swagger
</groupId>
...
...
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