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
51415d62
Commit
51415d62
authored
May 10, 2023
by
litengwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
沂南应急极光推送消息逻辑修改
parent
417423b5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
56 deletions
+31
-56
ContingencyAction.java
...m/yeejoin/amos/fas/business/action/ContingencyAction.java
+12
-9
PlanOperationRecordMapper.java
...os/fas/business/dao/mapper/PlanOperationRecordMapper.java
+7
-0
PlanVisual3dServiceImpl.java
...os/fas/business/service/impl/PlanVisual3dServiceImpl.java
+4
-45
IPlanVisual3dService.java
...amos/fas/business/service/intfc/IPlanVisual3dService.java
+2
-2
PlanOperationRecordMapper.xml
...rc/main/resources/db/mapper/PlanOperationRecordMapper.xml
+6
-0
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/ContingencyAction.java
View file @
51415d62
...
...
@@ -476,15 +476,7 @@ public class ContingencyAction implements CustomerAction {
log
.
error
(
"optionarea 加入队列失败-->"
+
e
.
getMessage
());
}
MessageVO
messageVO
=
new
MessageVO
();
messageVO
.
setTitle
(
"应急处置事项提醒"
);
messageVO
.
setBody
(
"【"
+
actionName
+
"】"
+
DateFormatUtils
.
format
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss"
));
messageVO
.
setMsgType
(
"emergencyPlan"
);
messageVO
.
setCategory
(
1
);
messageVO
.
setIsSendApp
(
true
);
messageVO
.
setIsSendWeb
(
true
);
messageVO
.
setRelationId
(
batchNo
);
planVisual3dService
.
sendMessage
(
buttonCode
,
messageVO
);
}
}
...
...
@@ -998,6 +990,17 @@ public class ContingencyAction implements CustomerAction {
contingencyPlanInstance
.
setStepCode
(
stepCode
);
contingencyPlanInstance
.
setContent
(
buttonJson
);
contingencyPlanInstanceRepository
.
save
(
contingencyPlanInstance
);
MessageVO
messageVO
=
new
MessageVO
();
messageVO
.
setTitle
(
"应急处置事项提醒"
);
messageVO
.
setBody
(
"【"
+
taskName
+
"】"
+
DateFormatUtils
.
format
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss"
));
messageVO
.
setMsgType
(
"emergencyPlan"
);
messageVO
.
setCategory
(
1
);
messageVO
.
setIsSendApp
(
true
);
messageVO
.
setIsSendWeb
(
true
);
messageVO
.
setRelationId
(
batchNo
);
planVisual3dService
.
sendMessage
(
roleCode
,
messageVO
);
}
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/PlanOperationRecordMapper.java
View file @
51415d62
...
...
@@ -5,6 +5,7 @@ import com.yeejoin.amos.fas.dao.entity.PlanRule;
import
com.yeejoin.amos.fas.datasync.bo.PlanOperationRecordSyncBo
;
import
org.springframework.stereotype.Repository
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -42,6 +43,12 @@ public interface PlanOperationRecordMapper {
*/
String
getLastBatchNo
();
/**
* 获取batchNo
* @return
*/
List
<
String
>
getArraysUserIds
(
String
roleCode
);
Map
<
String
,
Object
>
getLatestFireEquipId
();
PlanRule
getPlanRuleByBatchNo
(
String
batchNo
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/PlanVisual3dServiceImpl.java
View file @
51415d62
...
...
@@ -611,10 +611,10 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
}
@Override
public
void
sendMessage
(
String
button
Code
,
MessageVO
messageVO
)
{
public
void
sendMessage
(
String
role
Code
,
MessageVO
messageVO
)
{
// 添加极光推送开关
if
(
auroraPushSwitch
)
{
List
<
String
>
userIds
=
getUserIds
(
button
Code
);
List
<
String
>
userIds
=
getUserIds
(
role
Code
);
if
(!
CollectionUtils
.
isEmpty
(
userIds
))
{
messageVO
.
setRecivers
(
userIds
);
sendMessage
(
messageVO
);
...
...
@@ -731,50 +731,9 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
return
contingencyPlanInstance
;
}
private
List
<
String
>
getUserIds
(
String
buttonCode
)
{
String
planStepJson
=
planStepService
.
getPlanStep
();
List
<
PlanStepJsonVO
>
planStepJsonList
=
JSONObject
.
parseArray
(
planStepJson
,
PlanStepJsonVO
.
class
);
List
<
String
>
collect
=
planStepJsonList
.
stream
().
filter
(
code
->
code
.
getButtonCode
().
equals
(
buttonCode
)).
map
(
PlanStepJsonVO:
:
getRoleCode
).
collect
(
Collectors
.
toList
());
Toke
toke
=
remoteSecurityService
.
getServerToken
();
RequestContext
.
setToken
(
toke
.
getToke
());
RequestContext
.
setProduct
(
toke
.
product
);
RequestContext
.
setAppKey
(
toke
.
appKey
);
ArrayList
<
String
>
userIds
=
new
ArrayList
<>();
ArrayList
<
String
>
roleIds
=
new
ArrayList
<>();
// 查询按钮下角色id
for
(
String
roleName
:
collect
)
{
FeignClientResult
roleList
;
List
<
Map
>
roleModelList
=
null
;
try
{
roleList
=
privilegeFeign
.
getRoleList
(
RequestContext
.
getAppKey
(),
RequestContext
.
getProduct
(),
RequestContext
.
getToken
(),
roleName
);
roleModelList
=
(
List
<
Map
>)
roleList
.
getResult
();
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
if
(!
CollectionUtils
.
isEmpty
(
roleModelList
))
{
for
(
Map
map
:
roleModelList
)
{
roleIds
.
add
(
String
.
valueOf
(
map
.
get
(
"sequenceNbr"
)));
}
}
}
private
List
<
String
>
getUserIds
(
String
roleCode
)
{
// 查询角色下用户
FeignClientResult
userResult
;
List
<
Map
>
userList
=
null
;
try
{
userResult
=
privilegeFeign
.
getUserByRoleIds
(
RequestContext
.
getAppKey
(),
RequestContext
.
getProduct
(),
RequestContext
.
getToken
(),
String
.
join
(
","
,
roleIds
));
userList
=
(
List
<
Map
>)
userResult
.
getResult
();
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
if
(!
CollectionUtils
.
isEmpty
(
userList
))
{
for
(
Map
map
:
userList
)
{
userIds
.
add
(
String
.
valueOf
(
map
.
get
(
"userId"
)));
}
}
return
userIds
;
return
planOperationRecordMapper
.
getArraysUserIds
(
roleCode
);
}
@Override
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IPlanVisual3dService.java
View file @
51415d62
...
...
@@ -110,10 +110,10 @@ public interface IPlanVisual3dService {
/**
* 极光推送消息
*
* @param
button
Code
* @param
role
Code
* @param messageVO
*/
void
sendMessage
(
String
button
Code
,
MessageVO
messageVO
);
void
sendMessage
(
String
role
Code
,
MessageVO
messageVO
);
/**
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/PlanOperationRecordMapper.xml
View file @
51415d62
...
...
@@ -140,4 +140,9 @@
<select
id=
"getLastPlanPattern"
resultType=
"java.lang.Integer"
>
select plan_pattern as planPattern from c_plan_operation_record where is_delete = 0 order by create_date desc limit 1
</select>
<select
id=
"getArraysUserIds"
resultType=
"java.lang.String"
>
SELECT amos_id from c_emergency_relation cer where obligationId in (
select id from f_dict fd where dict_value = #{roleCode}
)
</select>
</mapper>
\ No newline at end of file
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