Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YeeAmosFireAutoSysRoot
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
station
YeeAmosFireAutoSysRoot
Commits
54426991
Commit
54426991
authored
Jun 01, 2020
by
taabe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
风险预警消息
parent
6048e324
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
79 additions
and
14 deletions
+79
-14
SimpleTipAction.java
...com/yeejoin/amos/fas/business/action/SimpleTipAction.java
+16
-3
FmeaServiceImpl.java
...ejoin/amos/fas/business/service/impl/FmeaServiceImpl.java
+4
-0
RiskSourceServiceImpl.java
...amos/fas/business/service/impl/RiskSourceServiceImpl.java
+8
-4
BasicsRo.java
...com/yeejoin/amos/fas/business/service/model/BasicsRo.java
+3
-1
RiskSourceRuleRo.java
...oin/amos/fas/business/service/model/RiskSourceRuleRo.java
+44
-5
application-dev.properties
...utoSysStart/src/main/resources/application-dev.properties
+3
-0
application.properties
...ireAutoSysStart/src/main/resources/application.properties
+1
-1
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/SimpleTipAction.java
View file @
54426991
...
...
@@ -4,7 +4,12 @@ import java.lang.reflect.Constructor;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.UUID
;
import
com.yeejoin.amos.fas.business.service.model.RiskSourceRuleRo
;
import
com.yeejoin.amos.fas.core.common.request.DateUtil
;
import
com.yeejoin.amos.fas.core.util.StringUtil
;
import
org.jsoup.helper.DataUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
...
...
@@ -19,6 +24,8 @@ import com.yeejoin.amos.fas.business.service.model.ToipResponse;
import
com.yeejoin.amos.fas.dao.entity.BusinessEntity
;
import
com.yeejoin.amos.fas.dao.entity.Message
;
import
com.yeejoin.amos.fas.dao.entity.MessageRo
;
import
org.springframework.util.unit.DataUnit
;
/**
*
* <pre>
...
...
@@ -39,10 +46,8 @@ public class SimpleTipAction implements CustomerAction
//@ExposeAction("消息提示")
public
void
sendMessageTip
(
Object
bizobj
,
String
title
,
String
content
,
String
type
)
{
try
{
ELEvaluationContext
.
setVariable
(
"bizobj"
,
bizobj
);
TipResult
result
=
new
TipResult
();
result
.
add
(
bizobj
);
...
...
@@ -54,7 +59,6 @@ public class SimpleTipAction implements CustomerAction
tempmap2
.
put
(
"content"
,
content
);
result
.
add
(
tempmap2
);
Constructor
<?>
constructor
;
constructor
=
Class
.
forName
(
...
...
@@ -91,11 +95,20 @@ public class SimpleTipAction implements CustomerAction
message
.
setTitle
(
map
.
get
(
"title"
).
toString
());
}
}
if
(
abstractActionResult
.
getToipResponse
().
getBizObj
()
instanceof
MessageRo
)
{
MessageRo
messageRo
=
(
MessageRo
)
abstractActionResult
.
getToipResponse
().
getBizObj
();
message
.
setTime
(
messageRo
.
getDateTime
());
message
.
setBizId
(
messageRo
.
getId
());
}
if
(
abstractActionResult
.
getToipResponse
().
getBizObj
()
instanceof
RiskSourceRuleRo
)
{
RiskSourceRuleRo
riskSourceRuleRo
=
(
RiskSourceRuleRo
)
abstractActionResult
.
getToipResponse
().
getBizObj
();
message
.
setTime
(
DateUtil
.
getNow
());
message
.
setBizId
(
StringUtil
.
isNotEmpty
(
riskSourceRuleRo
.
getId
())
?
String
.
valueOf
(
riskSourceRuleRo
.
getId
())
:
""
);
}
message
.
setBizclassName
(
abstractActionResult
.
getToipResponse
().
getBizObj
().
getClass
().
toString
());
message
.
setType
(
type
);
message
.
setId
(
UUID
.
randomUUID
().
toString
());
messageService
.
save
(
message
);
}
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/FmeaServiceImpl.java
View file @
54426991
...
...
@@ -15,6 +15,7 @@ import com.yeejoin.amos.fas.business.feign.RemoteSecurityService;
import
com.yeejoin.amos.fas.business.param.CommonPageInfoParam
;
import
com.yeejoin.amos.fas.business.service.intfc.IFmeaService
;
import
com.yeejoin.amos.fas.business.service.model.RiskSourceRo
;
import
com.yeejoin.amos.fas.core.util.StringUtil
;
import
com.yeejoin.amos.fas.dao.entity.Fmea
;
import
com.yeejoin.amos.fas.dao.entity.RiskFactor
;
import
com.yeejoin.amos.fas.dao.entity.RiskLevel
;
...
...
@@ -94,6 +95,7 @@ public class FmeaServiceImpl implements IFmeaService {
userIds
.
add
(
String
.
valueOf
(
map
.
get
(
"personLeaderId"
)));
userIds
.
add
(
String
.
valueOf
(
map
.
get
(
"identifyUserId"
)));
}
userIds
.
remove
(
"null"
);
userIds
.
remove
(
null
);
userIds
.
remove
(
""
);
if
(!
CollectionUtils
.
isEmpty
(
userIds
)){
...
...
@@ -101,6 +103,7 @@ public class FmeaServiceImpl implements IFmeaService {
if
(!
CollectionUtils
.
isEmpty
(
userIds
)){
users
=
remoteSecurityService
.
listUserByUserIds
(
toke
,
product
,
appKey
,
Joiner
.
on
(
","
).
join
(
userIds
));
}
if
(
StringUtil
.
isNotEmpty
(
users
))
{
Map
<
String
,
String
>
userMap
=
users
.
stream
().
collect
(
Collectors
.
toMap
(
AgencyUserModel:
:
getUserId
,
AgencyUserModel:
:
getRealName
));
for
(
HashMap
<
String
,
Object
>
map
:
content
)
{
map
.
put
(
"companyLeaderName"
,
userMap
.
get
(
map
.
get
(
"companyLeaderId"
)));
...
...
@@ -110,6 +113,7 @@ public class FmeaServiceImpl implements IFmeaService {
map
.
put
(
"identifyUserName"
,
userMap
.
get
(
map
.
get
(
"identifyUserId"
)));
}
}
}
}
return
new
PageImpl
<
HashMap
<
String
,
Object
>>(
content
,
param
,
total
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/RiskSourceServiceImpl.java
View file @
54426991
...
...
@@ -1315,7 +1315,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
//4.极光推送给手机客户端
jpushRiskSourceMessage
(
jpushMsgBo
);
//5.规则告警(消息)TODO
notifyRule
(
riskSourceId
,
rpn
,
rpni
,
notifyType
,
changeType
);
notifyRule
(
riskSourceId
,
rpn
,
rpni
,
notifyType
,
changeType
,
jpushMsgBo
.
getMsg
()
);
//6.通知全景监控屏幕数据刷新
iDataRefreshService
.
refreshViewData
(
DataRefreshTypeEum
.
rpn
.
getCode
());
}
...
...
@@ -1420,15 +1420,19 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
BigDecimal
rpnr
,
BigDecimal
rpni
,
String
notifyType
,
String
changeType
)
{
String
changeType
,
JpushMsgContentBo
msgContentBo
)
{
RiskSourceRuleRo
riskSourceRuleRo
=
new
RiskSourceRuleRo
();
riskSourceRuleRo
.
setId
(
id
);
riskSourceRuleRo
.
setRpnr
(
rpnr
);
riskSourceRuleRo
.
setRpni
(
rpni
);
riskSourceRuleRo
.
setLevelChangeType
(
changeType
);
riskSourceRuleRo
.
setNotifyType
(
notifyType
);
riskSourceRuleRo
.
setType
(
notifyType
);
riskSourceRuleRo
.
setContent
(
msgContentBo
.
genMessage
());
riskSourceRuleRo
.
setTitle
(
msgContentBo
.
getSubject
());
riskSourceRuleRo
.
setRg
(
String
.
valueOf
(
rpnr
.
subtract
(
rpni
).
toBigInteger
()));
try
{
remoteRuleServer
.
fireRule
(
riskSourceRuleRo
,
"风险管控/riskSource"
);
// remoteRuleServer.fireRule(riskSourceRuleRo, "风险管控/riskSource");
ruleTrigger
.
publish
(
riskSourceRuleRo
,
"风险管控/riskSource"
,
null
);
// 没有配决策流,processIds传null即可
}
catch
(
Exception
e
)
{
log
.
error
(
"调用规则异常"
,
e
);
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/model/BasicsRo.java
View file @
54426991
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
model
;
import
com.yeejoin.amos.fas.dao.entity.BusinessEntity
;
import
java.io.Serializable
;
public
class
BasicsRo
implements
Serializable
{
public
class
BasicsRo
extends
BusinessEntity
implements
Serializable
{
private
String
batchNo
;
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/model/RiskSourceRuleRo.java
View file @
54426991
...
...
@@ -4,10 +4,11 @@ import java.math.BigDecimal;
public
class
RiskSourceRuleRo
extends
BasicsRo
{
private
static
final
long
serialVersionUID
=
-
1029442967802232957L
;
/**
* patrol、equipment、update、delete
*/
private
String
notifyT
ype
;
private
String
t
ype
;
private
Long
id
;
...
...
@@ -16,10 +17,24 @@ public class RiskSourceRuleRo extends BasicsRo {
private
BigDecimal
rpni
;
/**
* 风险增益
*/
private
String
rg
;
/**
* up、down、no
*/
private
String
levelChangeType
;
/**
* 消息内容
*/
private
String
content
;
/**
* 消息标题
*/
private
String
title
;
public
Long
getId
()
{
return
id
;
}
...
...
@@ -52,11 +67,35 @@ public class RiskSourceRuleRo extends BasicsRo {
this
.
levelChangeType
=
levelChangeType
;
}
public
String
getNotifyType
()
{
return
notifyType
;
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
String
getContent
()
{
return
content
;
}
public
void
setContent
(
String
content
)
{
this
.
content
=
content
;
}
public
String
getTitle
()
{
return
title
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
String
getRg
()
{
return
rg
;
}
public
void
set
NotifyType
(
String
notifyType
)
{
this
.
notifyType
=
notifyType
;
public
void
set
Rg
(
String
rg
)
{
this
.
rg
=
rg
;
}
}
YeeAmosFireAutoSysStart/src/main/resources/application-dev.properties
View file @
54426991
...
...
@@ -60,3 +60,5 @@ dutyMode.fegin.name=AMOS-DUTY
##\u89C4\u5219\u5BF9\u8C61\u81EA\u52A8\u626B\u63CF
rule.definition.load
=
true
rule.definition.model-package
=
com.yeejoin.amos.fas.business.service.model
amos.feign.gennerator.use-gateway
=
false
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/application.properties
View file @
54426991
spring.application.name
=
AMOS-AUTOSYS
-WJ
spring.application.name
=
AMOS-AUTOSYS
server.port
=
8083
...
...
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