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
232f51e4
Commit
232f51e4
authored
Nov 17, 2021
by
xinglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*)修改防火监督消息
parent
ebb9d743
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
21 deletions
+50
-21
TerminalConstant.java
...join/amos/boot/biz/common/constants/TerminalConstant.java
+12
-0
RuleTypeEnum.java
.../com/yeejoin/amos/boot/biz/common/enums/RuleTypeEnum.java
+24
-8
RulePlanService.java
...os/supervision/business/service/impl/RulePlanService.java
+14
-13
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/constants/TerminalConstant.java
0 → 100644
View file @
232f51e4
package
com
.
yeejoin
.
amos
.
boot
.
biz
.
common
.
constants
;
/**
* @Author: xl
* @Description: 终端标识
* @Date: 2021/11/17 11:40
*/
public
class
TerminalConstant
{
public
final
static
String
APP
=
"APP"
;
public
final
static
String
WEB
=
"WEB"
;
public
final
static
String
APP_WEB
=
"APP/WEB"
;
}
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/enums/RuleTypeEnum.java
View file @
232f51e4
package
com
.
yeejoin
.
amos
.
boot
.
biz
.
common
.
enums
;
import
com.yeejoin.amos.boot.biz.common.constants.TerminalConstant
;
/**
* 规则请求枚举
* @author xl
*
*/
public
enum
RuleTypeEnum
{
// 防火监督
计划提交
(
"计划提交"
,
"addPlan"
,
"auditPage"
),
计划审核
(
"计划审核"
,
"planAudit"
,
"auditPage"
),
计划审核完成
(
"计划审核完成"
,
"planAuditAll"
,
"formulatePage"
),
计划生成
(
"计划生成"
,
"addPlanTask"
,
null
),
计划完成
(
"计划完成"
,
"planCompleted"
,
null
),
计划提交
(
"计划提交"
,
"addPlan"
,
"auditPage"
,
TerminalConstant
.
WEB
),
计划审核
(
"计划审核"
,
"planAudit"
,
"auditPage"
,
TerminalConstant
.
APP_WEB
),
计划审核完成
(
"计划审核完成"
,
"planAuditAll"
,
"formulatePage"
,
TerminalConstant
.
APP_WEB
),
计划生成
(
"计划生成"
,
"addPlanTask"
,
null
,
TerminalConstant
.
APP
),
计划完成
(
"计划完成"
,
"planCompleted"
,
null
,
TerminalConstant
.
APP_WEB
),
// 隐患
隐患第一次提交
(
"隐患提交"
,
"addLatentDanger"
,
null
),
隐患审核
(
"隐患审核"
,
"dangerAudit"
,
null
);
隐患第一次提交
(
"隐患提交"
,
"addLatentDanger"
,
null
,
null
),
隐患审核
(
"隐患审核"
,
"dangerAudit"
,
null
,
null
);
/**
* 名称,描述
...
...
@@ -29,6 +32,10 @@ public enum RuleTypeEnum {
* 跳转地址
*/
private
String
url
;
/**
* 终端标识
*/
private
String
terminal
;
public
String
getName
()
{
return
name
;
...
...
@@ -54,10 +61,19 @@ public enum RuleTypeEnum {
this
.
url
=
url
;
}
RuleTypeEnum
(
String
name
,
String
code
,
String
url
)
{
public
String
getTerminal
()
{
return
terminal
;
}
public
void
setTerminal
(
String
terminal
)
{
this
.
terminal
=
terminal
;
}
RuleTypeEnum
(
String
name
,
String
code
,
String
url
,
String
terminal
)
{
this
.
name
=
name
;
this
.
code
=
code
;
this
.
url
=
url
;
this
.
terminal
=
terminal
;
}
public
static
RuleTypeEnum
getEnumByCode
(
String
field
){
...
...
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 @
232f51e4
package
com
.
yeejoin
.
amos
.
supervision
.
business
.
service
.
impl
;
import
com.yeejoin.amos.boot.biz.common.constants.TerminalConstant
;
import
com.yeejoin.amos.boot.biz.common.enums.RuleTypeEnum
;
import
com.yeejoin.amos.component.rule.RuleTrigger
;
import
com.yeejoin.amos.supervision.business.dto.PlanRo
;
...
...
@@ -27,10 +28,6 @@ public class RulePlanService {
private
final
String
packageId
=
"消息/addPlanRule"
;
private
final
String
msgType
=
"supervision"
;
private
final
String
APP
=
"APP"
;
private
final
String
WEB
=
"WEB"
;
private
final
String
APP_WEB
=
"APP/WEB"
;
@Autowired
private
RuleTrigger
ruleTrigger
;
...
...
@@ -47,7 +44,6 @@ public class RulePlanService {
public
Boolean
addPlanAuditRule
(
Plan
plan
,
List
<
String
>
userIds
,
RuleTypeEnum
ruleType
,
String
excuteStateName
)
throws
Exception
{
PlanRo
planRo
=
buildPlanRo
(
plan
,
userIds
,
ruleType
);
planRo
.
setExcuteStateName
(
excuteStateName
);
//触发规则
ruleTrigger
.
publish
(
planRo
,
packageId
,
new
String
[
0
]);
return
true
;
...
...
@@ -59,11 +55,21 @@ public class RulePlanService {
planRo
.
setMsgType
(
msgType
);
planRo
.
setRuleType
(
ruleType
.
getCode
());
planRo
.
setRelationId
(
String
.
valueOf
(
plan
.
getId
()));
planRo
.
setTerminal
(
ruleType
.
getTerminal
());
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"planId"
,
String
.
valueOf
(
plan
.
getId
()));
if
(!
ValidationUtil
.
isEmpty
(
ruleType
.
getUrl
())){
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"url"
,
ruleType
.
getUrl
());
planRo
.
setExtras
(
map
);
}
if
(
TerminalConstant
.
WEB
.
equals
(
ruleType
.
getTerminal
())){
planRo
.
setIsSendWeb
(
true
);
}
else
if
(
TerminalConstant
.
APP
.
equals
(
ruleType
.
getTerminal
())){
planRo
.
setIsSendApp
(
true
);
}
else
if
(
TerminalConstant
.
APP_WEB
.
equals
(
ruleType
.
getTerminal
())){
planRo
.
setIsSendWeb
(
true
);
planRo
.
setIsSendApp
(
true
);
}
if
(
ValidationUtil
.
isEmpty
(
userIds
))
{
...
...
@@ -72,15 +78,10 @@ public class RulePlanService {
leadPeopleIds
+=
","
+
plan
.
getUserId
();
}
userIds
=
(
List
<
String
>)
jcsFeignClient
.
getAmosIdListByUserIds
(
leadPeopleIds
).
getResult
();
planRo
.
setIsSendApp
(
true
);
planRo
.
setTerminal
(
WEB
);
}
else
{
planRo
.
setIsSendWeb
(
true
);
planRo
.
setIsSendApp
(
false
);
planRo
.
setTerminal
(
APP_WEB
);
}
planRo
.
setSendTime
(
DateUtil
.
date2LongStr
(
new
Date
()));
planRo
.
setRecivers
(
userIds
);
planRo
.
setExtras
(
map
);
return
planRo
;
}
}
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