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
f654fc22
Commit
f654fc22
authored
Jun 09, 2022
by
lisong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
ca6e61c2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
95 additions
and
17 deletions
+95
-17
AlertSubmittedServiceImpl.java
...odule/jcs/biz/service/impl/AlertSubmittedServiceImpl.java
+95
-17
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/AlertSubmittedServiceImpl.java
View file @
f654fc22
...
@@ -35,6 +35,7 @@ import com.yeejoin.amos.boot.module.command.biz.service.impl.FrontlineLiaisonSer
...
@@ -35,6 +35,7 @@ import com.yeejoin.amos.boot.module.command.biz.service.impl.FrontlineLiaisonSer
import
com.yeejoin.amos.boot.module.common.api.service.ISourceFileService
;
import
com.yeejoin.amos.boot.module.common.api.service.ISourceFileService
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.*
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.*
;
import
com.yeejoin.amos.boot.module.jcs.api.mapper.JcSituationDetailMapper
;
import
com.yeejoin.amos.boot.module.jcs.api.mapper.JcSituationDetailMapper
;
import
com.yeejoin.amos.boot.module.jcs.api.mapper.UserCarMapper
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.poi.xwpf.usermodel.XWPFTable
;
import
org.apache.poi.xwpf.usermodel.XWPFTable
;
...
@@ -216,6 +217,9 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -216,6 +217,9 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
@Autowired
@Autowired
JcSituationDetailMapper
jcSituationDetailMapper
;
JcSituationDetailMapper
jcSituationDetailMapper
;
@Autowired
UserCarMapper
userCarMapper
;
@Value
(
"${mqtt.topic.command.alert.noticeJa}"
)
@Value
(
"${mqtt.topic.command.alert.noticeJa}"
)
private
String
topicJa
;
private
String
topicJa
;
...
@@ -577,21 +581,21 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -577,21 +581,21 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
if
(
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情初报
.
getCode
()))
{
if
(
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情初报
.
getCode
()))
{
alertCalledAction
.
sendAlertCalleCmd
(
smsCode
,
mobiles
,
smsParams
);
alertCalledAction
.
sendAlertCalleCmd
(
smsCode
,
mobiles
,
smsParams
);
besidesMap
.
put
(
"sendTime"
,
DateUtils
.
dateFormat
(
alertCalled
.
getCallTime
(),
DateUtils
.
DATE_TIME_PATTERN
));
besidesMap
.
put
(
"sendTime"
,
DateUtils
.
dateFormat
(
alertCalled
.
getCallTime
(),
DateUtils
.
DATE_TIME_PATTERN
));
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
警情初报
.
getCode
(),
besidesMap
,
smsParams
,
usIds
);
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
警情初报
.
getCode
(),
besidesMap
,
smsParams
,
usIds
,
null
);
}
else
{
}
else
{
if
(
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情续报
.
getCode
()))
{
if
(
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情续报
.
getCode
()))
{
besidesMap
.
put
(
"sendTime"
,
DateUtils
.
dateFormat
(
alertCalled
.
getCallTime
(),
DateUtils
.
DATE_TIME_PATTERN
));
besidesMap
.
put
(
"sendTime"
,
DateUtils
.
dateFormat
(
alertCalled
.
getCallTime
(),
DateUtils
.
DATE_TIME_PATTERN
));
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
警情续报
.
getCode
(),
besidesMap
,
smsParams
,
usIds
);
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
警情续报
.
getCode
(),
besidesMap
,
smsParams
,
usIds
,
null
);
}
}
if
(
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情结案
.
getCode
()))
{
if
(
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情结案
.
getCode
()))
{
besidesMap
.
put
(
"startTime"
,
DateUtils
.
dateFormat
(
alertCalled
.
getCallTime
(),
DateUtils
.
DATE_TIME_PATTERN
));
besidesMap
.
put
(
"startTime"
,
DateUtils
.
dateFormat
(
alertCalled
.
getCallTime
(),
DateUtils
.
DATE_TIME_PATTERN
));
besidesMap
.
put
(
"endTime"
,
DateUtils
.
dateFormat
(
alertCalled
.
getRecDate
(),
DateUtils
.
DATE_TIME_PATTERN
));
besidesMap
.
put
(
"endTime"
,
DateUtils
.
dateFormat
(
alertCalled
.
getRecDate
(),
DateUtils
.
DATE_TIME_PATTERN
));
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
警情结案
.
getCode
(),
besidesMap
,
smsParams
,
usIds
);
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
警情结案
.
getCode
(),
besidesMap
,
smsParams
,
usIds
,
null
);
}
}
if
(
alertWay
.
equals
(
AlertBusinessTypeEnum
.
非警情确认
.
getCode
()))
{
if
(
alertWay
.
equals
(
AlertBusinessTypeEnum
.
非警情确认
.
getCode
()))
{
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
非警情确认
.
getCode
(),
besidesMap
,
smsParams
,
usIds
);
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
非警情确认
.
getCode
(),
besidesMap
,
smsParams
,
usIds
,
null
);
}
}
alertCalledAction
.
sendAlertCalleCmd
(
sCode
,
mobiles
,
smsParams
);
alertCalledAction
.
sendAlertCalleCmd
(
sCode
,
mobiles
,
smsParams
);
...
@@ -1623,6 +1627,9 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1623,6 +1627,9 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
smsParams
.
put
(
"alertType"
,
calledRo
.
getAlertType
());
smsParams
.
put
(
"alertType"
,
calledRo
.
getAlertType
());
List
<
PowerTransferCompanyResourcesDto
>
list
=
powerDto
List
<
PowerTransferCompanyResourcesDto
>
list
=
powerDto
.
getPowerTransferCompanyResourcesDtoList
();
.
getPowerTransferCompanyResourcesDtoList
();
// 查询已绑定车辆人员id
List
<
UserCar
>
userCars
=
userCarMapper
.
selectList
(
new
QueryWrapper
<
UserCar
>().
lambda
().
eq
(
UserCar:
:
getIsDelete
,
false
));
List
<
Long
>
userIds
=
userCars
.
stream
().
map
(
UserCar:
:
getAmosUserId
).
collect
(
Collectors
.
toList
());
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
for
(
PowerTransferCompanyResourcesDto
i
:
list
)
{
for
(
PowerTransferCompanyResourcesDto
i
:
list
)
{
String
carName
=
i
.
getResourcesName
();
String
carName
=
i
.
getResourcesName
();
...
@@ -1660,8 +1667,22 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1660,8 +1667,22 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
}
}
};
};
userList
=
new
ArrayList
<
String
>();
userList
=
new
ArrayList
<
String
>();
// 车辆绑定人发送的是待办任务
if
(!
ValidationUtil
.
isEmpty
(
map
.
get
(
"amosId"
)))
{
if
(!
ValidationUtil
.
isEmpty
(
map
.
get
(
"amosId"
)))
{
userList
.
add
(
map
.
get
(
"amosId"
).
toString
());
if
(!
CollectionUtils
.
isEmpty
(
userIds
)){
if
(
userIds
.
contains
(
Long
.
valueOf
(
map
.
get
(
"amosId"
).
toString
()))){
Map
<
String
,
String
>
besidesMap
=
new
HashMap
<
String
,
String
>();
besidesMap
.
put
(
"responseLevelString"
,
responseLevelString
);
besidesMap
.
put
(
"alterId"
,
alertCalledId
);
ArrayList
<
String
>
strings
=
new
ArrayList
<>();
strings
.
add
(
map
.
get
(
"amosId"
).
toString
());
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
力量调派
.
getCode
(),
besidesMap
,
smsParams
,
strings
,
RuleConstant
.
TASK
);
}
else
{
userList
.
add
(
map
.
get
(
"amosId"
).
toString
());
}
}
else
{
userList
.
add
(
map
.
get
(
"amosId"
).
toString
());
}
}
}
alertSubmittedObjectSub
.
setUserPhone
(
map
.
get
(
"mobilePhone"
).
toString
());
alertSubmittedObjectSub
.
setUserPhone
(
map
.
get
(
"mobilePhone"
).
toString
());
}
}
...
@@ -1673,7 +1694,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1673,7 +1694,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
besidesMap
.
put
(
"responseLevelString"
,
responseLevelString
);
besidesMap
.
put
(
"responseLevelString"
,
responseLevelString
);
besidesMap
.
put
(
"alterId"
,
alertCalledId
);
besidesMap
.
put
(
"alterId"
,
alertCalledId
);
if
(
userList
.
size
()>
0
)
{
if
(
userList
.
size
()>
0
)
{
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
力量调派
.
getCode
(),
besidesMap
,
smsParams
,
userList
);
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
力量调派
.
getCode
(),
besidesMap
,
smsParams
,
userList
,
null
);
}
}
emqKeeper
.
getMqttClient
().
publish
(
topic
,
alertCalledId
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
emqKeeper
.
getMqttClient
().
publish
(
topic
,
alertCalledId
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
...
@@ -1683,14 +1704,31 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1683,14 +1704,31 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
}
}
String
resourcesNumStr
=
resourcesNum
.
toString
();
String
resourcesNumStr
=
resourcesNum
.
toString
();
List
<
String
>
userList
=
new
ArrayList
<
String
>();
List
<
String
>
userList
=
new
ArrayList
<
String
>();
ArrayList
<
String
>
taskUserIds
=
new
ArrayList
<>();
sendUserIds
.
stream
().
forEach
(
i
->
{
sendUserIds
.
stream
().
forEach
(
i
->
{
if
(
i
.
containsKey
(
"mobilePhone"
))
{
if
(
i
.
containsKey
(
"mobilePhone"
))
{
mobiles
.
add
(
i
.
get
(
"mobilePhone"
).
toString
());
mobiles
.
add
(
i
.
get
(
"mobilePhone"
).
toString
());
}
}
if
(
i
.
containsKey
(
"amosId"
)&&
!
ValidationUtil
.
isEmpty
(
i
.
get
(
"amosId"
)))
{
if
(
i
.
containsKey
(
"amosId"
)&&
!
ValidationUtil
.
isEmpty
(
i
.
get
(
"amosId"
)))
{
userList
.
add
(
i
.
get
(
"amosId"
).
toString
());
if
(!
CollectionUtils
.
isEmpty
(
userIds
)){
if
(
userIds
.
contains
(
Long
.
valueOf
(
i
.
get
(
"amosId"
).
toString
()))){
taskUserIds
.
add
(
i
.
get
(
"amosId"
).
toString
());
}
else
{
userList
.
add
(
i
.
get
(
"amosId"
).
toString
());
}
}
else
{
userList
.
add
(
i
.
get
(
"amosId"
).
toString
());
}
}
}
});
});
// 车辆绑定人发送的是待办任务
if
(!
CollectionUtils
.
isEmpty
(
taskUserIds
)){
Map
<
String
,
String
>
besidesMap
=
new
HashMap
<
String
,
String
>();
besidesMap
.
put
(
"responseLevelString"
,
responseLevelString
);
//响应级别
besidesMap
.
put
(
"alterId"
,
alertCalledId
);
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
力量调派
.
getCode
(),
besidesMap
,
smsParams
,
taskUserIds
,
RuleConstant
.
TASK
);
}
smsParams
.
put
(
"resourcesNum"
,
resourcesNumStr
);
smsParams
.
put
(
"resourcesNum"
,
resourcesNumStr
);
// 短信报送对象
// 短信报送对象
// alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectList);
// alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectList);
...
@@ -1705,7 +1743,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1705,7 +1743,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
besidesMap
.
put
(
"responseLevelString"
,
responseLevelString
);
//响应级别
besidesMap
.
put
(
"responseLevelString"
,
responseLevelString
);
//响应级别
besidesMap
.
put
(
"alterId"
,
alertCalledId
);
besidesMap
.
put
(
"alterId"
,
alertCalledId
);
if
(
userList
.
size
()>
0
)
{
if
(
userList
.
size
()>
0
)
{
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
力量调派
.
getCode
(),
besidesMap
,
smsParams
,
userList
);
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
力量调派
.
getCode
(),
besidesMap
,
smsParams
,
userList
,
null
);
}
}
emqKeeper
.
getMqttClient
().
publish
(
topic
,
alertCalledId
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
false
);
emqKeeper
.
getMqttClient
().
publish
(
topic
,
alertCalledId
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
false
);
}
}
...
@@ -1717,7 +1755,9 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1717,7 +1755,9 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
public
void
ruleCallbackActionForPowerTransferForSurvBrigade
(
String
smsCode
,
List
sendIds
,
Object
object
,
List
<
String
>
pList
)
throws
MqttPersistenceException
,
MqttException
{
public
void
ruleCallbackActionForPowerTransferForSurvBrigade
(
String
smsCode
,
List
sendIds
,
Object
object
,
List
<
String
>
pList
)
throws
MqttPersistenceException
,
MqttException
{
List
<
AlertSubmittedObject
>
alertSubmittedObjectList
=
Lists
.
newArrayList
();
List
<
AlertSubmittedObject
>
alertSubmittedObjectList
=
Lists
.
newArrayList
();
// 查询已绑定车辆人员id
List
<
UserCar
>
userCars
=
userCarMapper
.
selectList
(
new
QueryWrapper
<
UserCar
>().
lambda
().
eq
(
UserCar:
:
getIsDelete
,
false
));
List
<
Long
>
userCarIds
=
userCars
.
stream
().
map
(
UserCar:
:
getAmosUserId
).
collect
(
Collectors
.
toList
());
Set
<
String
>
mobiles
=
new
HashSet
<>();
Set
<
String
>
mobiles
=
new
HashSet
<>();
HashMap
<
String
,
String
>
smsParams
=
new
HashMap
<>();
HashMap
<
String
,
String
>
smsParams
=
new
HashMap
<>();
String
alertCalledId
=
null
;
String
alertCalledId
=
null
;
...
@@ -1796,14 +1836,30 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1796,14 +1836,30 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
smsParams
.
put
(
"alertType"
,
calledRo
.
getAlertType
());
smsParams
.
put
(
"alertType"
,
calledRo
.
getAlertType
());
List
<
String
>
userList
=
new
ArrayList
<
String
>();
List
<
String
>
userList
=
new
ArrayList
<
String
>();
ArrayList
<
String
>
taskUserIds
=
new
ArrayList
<>();
sendUserIds
.
stream
().
forEach
(
i
->
{
sendUserIds
.
stream
().
forEach
(
i
->
{
if
(
i
.
containsKey
(
"mobilePhone"
))
{
if
(
i
.
containsKey
(
"mobilePhone"
))
{
mobiles
.
add
(
i
.
get
(
"mobilePhone"
).
toString
());
mobiles
.
add
(
i
.
get
(
"mobilePhone"
).
toString
());
}
}
if
(
i
.
containsKey
(
"amosId"
)&&
!
ValidationUtil
.
isEmpty
(
i
.
get
(
"amosId"
)))
{
if
(
i
.
containsKey
(
"amosId"
)&&
!
ValidationUtil
.
isEmpty
(
i
.
get
(
"amosId"
)))
{
userList
.
add
(
i
.
get
(
"amosId"
).
toString
());
if
(!
CollectionUtils
.
isEmpty
(
userCarIds
)){
if
(
userCarIds
.
contains
(
Long
.
valueOf
(
i
.
get
(
"amosId"
).
toString
()))){
taskUserIds
.
add
(
i
.
get
(
"amosId"
).
toString
());
}
else
{
userList
.
add
(
i
.
get
(
"amosId"
).
toString
());
}
}
else
{
userList
.
add
(
i
.
get
(
"amosId"
).
toString
());
}
}
}
});
});
// 绑定车辆人员发送的是待办消息
if
(!
CollectionUtils
.
isEmpty
(
taskUserIds
)){
Map
<
String
,
String
>
besidesMap
=
new
HashMap
<
String
,
String
>();
besidesMap
.
put
(
"alterId"
,
alertCalledId
);
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
力量调派
.
getCode
(),
besidesMap
,
smsParams
,
taskUserIds
,
RuleConstant
.
TASK
);
}
smsParams
.
put
(
"resourcesNum"
,
companyName
);
smsParams
.
put
(
"resourcesNum"
,
companyName
);
// 短信报送对象
// 短信报送对象
// alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectList);
// alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectList);
...
@@ -1818,7 +1874,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1818,7 +1874,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
Map
<
String
,
String
>
besidesMap
=
new
HashMap
<
String
,
String
>();
Map
<
String
,
String
>
besidesMap
=
new
HashMap
<
String
,
String
>();
besidesMap
.
put
(
"alterId"
,
alertCalledId
);
besidesMap
.
put
(
"alterId"
,
alertCalledId
);
if
(
userList
.
size
()>
0
)
{
if
(
userList
.
size
()>
0
)
{
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
力量调派
.
getCode
(),
besidesMap
,
smsParams
,
userList
);
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
力量调派
.
getCode
(),
besidesMap
,
smsParams
,
userList
,
null
);
}
}
emqKeeper
.
getMqttClient
().
publish
(
topic
,
alertCalledId
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
false
);
emqKeeper
.
getMqttClient
().
publish
(
topic
,
alertCalledId
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
false
);
}
}
...
@@ -1830,7 +1886,9 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1830,7 +1886,9 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
public
void
ruleCallbackActionForPowerTransferForAid
(
String
smsCode
,
List
sendIds
,
Object
object
,
List
<
String
>
pList
)
throws
MqttPersistenceException
,
MqttException
{
public
void
ruleCallbackActionForPowerTransferForAid
(
String
smsCode
,
List
sendIds
,
Object
object
,
List
<
String
>
pList
)
throws
MqttPersistenceException
,
MqttException
{
// 查询已绑定车辆人员id
List
<
UserCar
>
userCars
=
userCarMapper
.
selectList
(
new
QueryWrapper
<
UserCar
>().
lambda
().
eq
(
UserCar:
:
getIsDelete
,
false
));
List
<
Long
>
userCarIds
=
userCars
.
stream
().
map
(
UserCar:
:
getAmosUserId
).
collect
(
Collectors
.
toList
());
List
<
AlertSubmittedObject
>
alertSubmittedObjectList
=
Lists
.
newArrayList
();
List
<
AlertSubmittedObject
>
alertSubmittedObjectList
=
Lists
.
newArrayList
();
Set
<
String
>
mobiles
=
new
HashSet
<>();
Set
<
String
>
mobiles
=
new
HashSet
<>();
...
@@ -1916,14 +1974,30 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1916,14 +1974,30 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
smsParams
.
put
(
"contactPhone"
,
calledRo
.
getContactPhone
());
smsParams
.
put
(
"contactPhone"
,
calledRo
.
getContactPhone
());
smsParams
.
put
(
"alertType"
,
calledRo
.
getAlertType
());
smsParams
.
put
(
"alertType"
,
calledRo
.
getAlertType
());
List
<
String
>
userList
=
new
ArrayList
<
String
>();
List
<
String
>
userList
=
new
ArrayList
<
String
>();
List
<
String
>
taskUserIds
=
new
ArrayList
<
String
>();
sendUserIds
.
stream
().
forEach
(
i
->
{
sendUserIds
.
stream
().
forEach
(
i
->
{
if
(
i
.
containsKey
(
"mobilePhone"
))
{
if
(
i
.
containsKey
(
"mobilePhone"
))
{
mobiles
.
add
(
i
.
get
(
"mobilePhone"
).
toString
());
mobiles
.
add
(
i
.
get
(
"mobilePhone"
).
toString
());
}
}
if
(
i
.
containsKey
(
"amosId"
)&&
!
ValidationUtil
.
isEmpty
(
i
.
get
(
"amosId"
)))
{
if
(
i
.
containsKey
(
"amosId"
)&&
!
ValidationUtil
.
isEmpty
(
i
.
get
(
"amosId"
)))
{
userList
.
add
(
i
.
get
(
"amosId"
).
toString
());
if
(!
CollectionUtils
.
isEmpty
(
userCarIds
)){
if
(
userCarIds
.
contains
(
Long
.
valueOf
(
i
.
get
(
"amosId"
).
toString
()))){
taskUserIds
.
add
(
i
.
get
(
"amosId"
).
toString
());
}
else
{
userList
.
add
(
i
.
get
(
"amosId"
).
toString
());
}
}
else
{
userList
.
add
(
i
.
get
(
"amosId"
).
toString
());
}
}
}
});
});
// 绑定车辆人员发送的是待办消息
if
(
CollectionUtils
.
isEmpty
(
taskUserIds
)){
Map
<
String
,
String
>
besidesMap
=
new
HashMap
<
String
,
String
>();
besidesMap
.
put
(
"alterId"
,
alertCalledId
);
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
力量调派
.
getCode
(),
besidesMap
,
smsParams
,
taskUserIds
,
RuleConstant
.
TASK
);
}
smsParams
.
put
(
"resourcesNum"
,
companyName
);
smsParams
.
put
(
"resourcesNum"
,
companyName
);
// 短信报送对象
// 短信报送对象
// alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectList);
// alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectList);
...
@@ -1938,7 +2012,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1938,7 +2012,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
Map
<
String
,
String
>
besidesMap
=
new
HashMap
<
String
,
String
>();
Map
<
String
,
String
>
besidesMap
=
new
HashMap
<
String
,
String
>();
besidesMap
.
put
(
"alterId"
,
alertCalledId
);
besidesMap
.
put
(
"alterId"
,
alertCalledId
);
if
(
userList
.
size
()>
0
)
{
if
(
userList
.
size
()>
0
)
{
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
力量调派
.
getCode
(),
besidesMap
,
smsParams
,
userList
);
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
力量调派
.
getCode
(),
besidesMap
,
smsParams
,
userList
,
null
);
}
}
emqKeeper
.
getMqttClient
().
publish
(
topic
,
alertCalledId
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
false
);
emqKeeper
.
getMqttClient
().
publish
(
topic
,
alertCalledId
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
false
);
...
@@ -1952,13 +2026,17 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1952,13 +2026,17 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
* @throws MqttPersistenceException
* @throws MqttPersistenceException
* @throws MqttException
* @throws MqttException
*/
*/
public
void
pushPowerTransferToAppAndWeb
(
String
type
,
Map
<
String
,
String
>
besidesMap
,
HashMap
<
String
,
String
>
smsParams
,
List
<
String
>
userList
){
public
void
pushPowerTransferToAppAndWeb
(
String
type
,
Map
<
String
,
String
>
besidesMap
,
HashMap
<
String
,
String
>
smsParams
,
List
<
String
>
userList
,
Integer
messageType
){
PushMessageWebAndAppRo
pushMessageWebAndAppRo
=
new
PushMessageWebAndAppRo
();
PushMessageWebAndAppRo
pushMessageWebAndAppRo
=
new
PushMessageWebAndAppRo
();
pushMessageWebAndAppRo
.
setRelationId
(
besidesMap
.
get
(
"alterId"
));
pushMessageWebAndAppRo
.
setRelationId
(
besidesMap
.
get
(
"alterId"
));
pushMessageWebAndAppRo
.
setRecivers
(
userList
);
pushMessageWebAndAppRo
.
setRecivers
(
userList
);
// pushMessageWebAndAppRo.setCategory(RuleConstant.NOTIFY);
// 默认发送消息通知,力量调派车辆绑定人发送待办任务。
pushMessageWebAndAppRo
.
setCategory
(
RuleConstant
.
TASK
);
if
(
null
!=
messageType
){
pushMessageWebAndAppRo
.
setCategory
(
RuleConstant
.
TASK
);
}
else
{
pushMessageWebAndAppRo
.
setCategory
(
RuleConstant
.
NOTIFY
);
}
pushMessageWebAndAppRo
.
setIsSendApp
(
true
);
pushMessageWebAndAppRo
.
setIsSendApp
(
true
);
pushMessageWebAndAppRo
.
setIsSendWeb
(
true
);
pushMessageWebAndAppRo
.
setIsSendWeb
(
true
);
pushMessageWebAndAppRo
.
setRuleType
(
type
);
pushMessageWebAndAppRo
.
setRuleType
(
type
);
...
...
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