Commit bee908f1 authored by tangwei's avatar tangwei

修改bug

parent bc16c4c4
package com.yeejoin.amos.boot.module.jcs.biz.rule.action;
import java.util.ArrayList;
import java.util.List;
import java.util.*;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.PowerrTransferLogServiceImpl;
import org.slf4j.Logger;
......@@ -60,16 +59,33 @@ public class PowerTransferAction {
AlertCallePowerTransferRo calledRo = (AlertCallePowerTransferRo) object;
// 获取力量调派发送人员
List<String> persons = new ArrayList<>();
List<Map<String, Object>> personslist = new ArrayList<Map<String, Object>>();
if (FireBrigadeTypeEnum.专职消防队.getKey().equals(calledRo.getPowerTransType())) {
alertSubmittedService.ruleCallbackActionForPowerTransferForCar(smsCode, sendIds, object,persons);//消防车辆
alertSubmittedService.ruleCallbackActionForPowerTransferForCar(smsCode, sendIds, object,personslist);//消防车辆
} else if (FireBrigadeTypeEnum.医疗救援队.getKey().equals(calledRo.getPowerTransType())) {
alertSubmittedService.ruleCallbackActionForPowerTransferForAid(smsCode, sendIds, object,persons);//120急救站
alertSubmittedService.ruleCallbackActionForPowerTransferForAid(smsCode, sendIds, object,personslist);//120急救站
} else if (FireBrigadeTypeEnum.监控大队.getKey().equals(calledRo.getPowerTransType())) {
alertSubmittedService.ruleCallbackActionForPowerTransferForSurvBrigade(smsCode, sendIds, object,persons);//监控大队
alertSubmittedService.ruleCallbackActionForPowerTransferForSurvBrigade(smsCode, sendIds, object,personslist);//监控大队
}
persons=getwone(personslist);
powerrTransferLogServiceImpl.savePowerTransferLog(calledRo,persons);
}
}
public List<String> getwone(List<Map<String, Object>> sendUserIds){
List<String> persons = new ArrayList<>();
Map<String,Map<String, Object>> map =new HashMap<>();
if(sendUserIds!=null&&sendUserIds.size()>0){
for (Map<String, Object> sendUserId : sendUserIds) {
map.put(sendUserId.get("userId").toString(),sendUserId);
}
}
Set<Map<String, Object>> set = new HashSet<>(map.values());
for (Map<String, Object> stringObjectMap : set) {
persons.add(stringObjectMap.get("userName").toString());
}
return persons;
}
}
......@@ -1531,7 +1531,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
@SuppressWarnings("unchecked")
public void ruleCallbackActionForPowerTransferForCar(String smsCode, List sendIds, Object object, List<String> pList)
public void ruleCallbackActionForPowerTransferForCar(String smsCode, List sendIds, Object object, List<Map<String, Object>> pList)
throws IllegalAccessException, MqttPersistenceException, MqttException {
List<AlertSubmittedObject> alertSubmittedObjectList = Lists.newArrayList();
......@@ -1637,7 +1637,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
alertSubmittedObject.setTheUser(orgUser.get("userName").toString());
// 将发送人放入 list
pList.add(orgUser.get("userName").toString());
pList.add(orgUser);
if (!ValidationUtil.isEmpty(orgUser.get("telephone"))) {
mobiles.add((String) orgUser.get("telephone"));
......@@ -1686,7 +1686,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
alertSubmittedObjectSub.setUserId(Long.parseLong(map.get("userId").toString()));
alertSubmittedObjectSub.setTheUser(map.get("userName").toString());
//
pList.add(map.get("userName").toString());
pList.add(map);
Set<String> mobile =null;
List<String> userList=null;
if (!ValidationUtil.isEmpty(map.get("mobilePhone"))) {
......@@ -1803,7 +1803,7 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){
@SuppressWarnings("unchecked")
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<Map<String, Object>> pList) throws MqttPersistenceException, MqttException {
List<AlertSubmittedObject> alertSubmittedObjectList = Lists.newArrayList();
// 查询已绑定车辆人员id
......@@ -1871,7 +1871,7 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){
alertSubmittedObject.setType(false);
alertSubmittedObject.setUserId(Long.parseLong(orgUser.get("userId").toString()));
alertSubmittedObject.setTheUser(orgUser.get("userName").toString());
pList.add(orgUser.get("userName").toString());
pList.add(orgUser);
if (!ValidationUtil.isEmpty(orgUser.get("telephone"))) {
mobiles.add((String) orgUser.get("telephone"));
......@@ -1939,7 +1939,7 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){
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<Map<String, Object>> 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());
......@@ -2014,7 +2014,7 @@ public Set<Map<String, Object>> getwone(Set<Map<String, Object>> sendUserIds){
alertSubmittedObject.setType(false);
alertSubmittedObject.setUserId(Long.parseLong(orgUser.get("userId").toString()));
alertSubmittedObject.setTheUser(orgUser.get("userName").toString());
pList.add(orgUser.get("userName").toString());
pList.add(orgUser);
if (!ValidationUtil.isEmpty(orgUser.get("mobilePhone"))) {
mobiles.add((String) orgUser.get("mobilePhone"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment