|
@@ -13,11 +13,14 @@ import cn.com.ty.lift.business.library.dao.entity.PlatformCompanyLiftRelevance;
|
|
|
import cn.com.ty.lift.business.library.service.PlatformCompanyLiftRelevanceService;
|
|
|
import cn.com.ty.lift.business.project.dao.entity.Region;
|
|
|
import cn.com.ty.lift.business.push.service.PushUserService;
|
|
|
+import cn.com.ty.lift.common.constants.ApiConstants;
|
|
|
import cn.com.ty.lift.common.constants.CommonEnum;
|
|
|
+import cn.com.ty.lift.common.constants.WebSocketConstants;
|
|
|
import cn.com.ty.lift.common.model.CountPage;
|
|
|
import cn.com.ty.lift.common.model.PushMessage;
|
|
|
import cn.com.ty.lift.common.model.PushUserInfo;
|
|
|
import cn.com.ty.lift.common.utils.DateUtils;
|
|
|
+import cn.com.ty.lift.common.utils.SendMessageUtil;
|
|
|
import cn.com.ty.lift.common.utils.ValuePool;
|
|
|
import cn.com.ty.lift.common.utils.WordUtil;
|
|
|
import cn.com.ty.lift.common.verify.Val;
|
|
@@ -198,7 +201,19 @@ public class EmergencyRepairController {
|
|
|
}
|
|
|
if(!pushUserInfos.isEmpty()){
|
|
|
RepairResponse info = emergencyRepairService.infoById(id);
|
|
|
- PushMessage.emergencyAssign(info.getAreaName(), info.getProjectName(), info.getDevicePosition(), info.getRegistrationCode(), info.getCallerDate(), info.getIsTrapped(), info.getCallerFaultDescription(), info.getWorkerName()).sendTokenOnPlatform(jmsMessagingTemplate, pushUserInfos);
|
|
|
+ PushMessage pushMessage = PushMessage.emergencyAssign(info.getAreaName(), info.getProjectName(), info.getDevicePosition(),
|
|
|
+ info.getRegistrationCode(), info.getCallerDate(), info.getIsTrapped(),
|
|
|
+ info.getCallerFaultDescription(), info.getWorkerName());
|
|
|
+ if(ApiConstants.ACCESS_TYPE_PUBLIC == entity.getMobileType()) {
|
|
|
+ pushMessage = PushMessage.emergencyAssignByProperty(info.getAreaName(), info.getProjectName(), info.getDevicePosition(),
|
|
|
+ info.getRegistrationCode(), info.getCallerDate(), info.getIsTrapped(),
|
|
|
+ info.getCallerFaultDescription(), info.getWorkerName());
|
|
|
+ //物业端发起的急修要将消息推送到pc端
|
|
|
+ List<Long> pushUserIds = pushUserInfos.stream().map(PushUserInfo::getUserId).collect(Collectors.toList());
|
|
|
+ SendMessageUtil.sendMessageToPC(jmsMessagingTemplate, pushUserIds, pushMessage.getContent(),
|
|
|
+ WebSocketConstants.MessageType.EMERGENCY_MSG);
|
|
|
+ }
|
|
|
+ pushMessage.sendTokenOnPlatform(jmsMessagingTemplate, pushUserInfos);
|
|
|
}
|
|
|
}
|
|
|
return RestResponse.success(result);
|
|
@@ -408,7 +423,13 @@ public class EmergencyRepairController {
|
|
|
}
|
|
|
if(!pushUserInfos.isEmpty()){
|
|
|
RepairResponse info = emergencyRepairService.infoById(id);
|
|
|
- PushMessage.emergencyTaking(info.getAreaName(), info.getProjectName(), info.getDevicePosition(), info.getRegistrationCode(), info.getCallerDate()).sendTokenOnPlatform(jmsMessagingTemplate, pushUserInfos);
|
|
|
+ PushMessage pushMessage = PushMessage.emergencyTaking(info.getAreaName(), info.getProjectName(),
|
|
|
+ info.getDevicePosition(), info.getRegistrationCode(), info.getCallerDate());
|
|
|
+ pushMessage.sendTokenOnPlatform(jmsMessagingTemplate, pushUserInfos);
|
|
|
+ //推送消息到pc端
|
|
|
+ List<Long> pushUserIds = pushUserInfos.stream().map(PushUserInfo::getUserId).collect(Collectors.toList());
|
|
|
+ SendMessageUtil.sendMessageToPC(jmsMessagingTemplate, pushUserIds, pushMessage.getContent(),
|
|
|
+ WebSocketConstants.MessageType.EMERGENCY_MSG);
|
|
|
}
|
|
|
}
|
|
|
return result;
|
|
@@ -452,7 +473,13 @@ public class EmergencyRepairController {
|
|
|
}
|
|
|
if(!pushUserInfos.isEmpty()){
|
|
|
RepairResponse info = emergencyRepairService.infoById(id);
|
|
|
- PushMessage.emergencyArrive(info.getAreaName(), info.getProjectName(), info.getDevicePosition(), info.getRegistrationCode(), info.getCallerDate(), info.getArriveTime()).sendTokenOnPlatform(jmsMessagingTemplate, pushUserInfos);
|
|
|
+ PushMessage pushMessage = PushMessage.emergencyArrive(info.getAreaName(), info.getProjectName(),
|
|
|
+ info.getDevicePosition(), info.getRegistrationCode(), info.getCallerDate(), info.getArriveTime());
|
|
|
+ pushMessage.sendTokenOnPlatform(jmsMessagingTemplate, pushUserInfos);
|
|
|
+ //推送消息到pc端
|
|
|
+ List<Long> pushUserIds = pushUserInfos.stream().map(PushUserInfo::getUserId).collect(Collectors.toList());
|
|
|
+ SendMessageUtil.sendMessageToPC(jmsMessagingTemplate, pushUserIds, pushMessage.getContent(),
|
|
|
+ WebSocketConstants.MessageType.EMERGENCY_MSG);
|
|
|
}
|
|
|
}
|
|
|
return RestResponse.success(result);
|
|
@@ -704,7 +731,13 @@ public class EmergencyRepairController {
|
|
|
}
|
|
|
if(!pushUserInfos.isEmpty()){
|
|
|
RepairResponse info = emergencyRepairService.infoById(id);
|
|
|
- PushMessage.emergencyOrder(info.getAreaName(), info.getProjectName(), info.getDevicePosition(), info.getRegistrationCode(), info.getCallerDate(), info.getRecoveryDate()).sendTokenOnPlatform(jmsMessagingTemplate, pushUserInfos);
|
|
|
+ PushMessage pushMessage = PushMessage.emergencyOrder(info.getAreaName(), info.getProjectName(),
|
|
|
+ info.getDevicePosition(), info.getRegistrationCode(), info.getCallerDate(), info.getRecoveryDate());
|
|
|
+ pushMessage.sendTokenOnPlatform(jmsMessagingTemplate, pushUserInfos);
|
|
|
+ //推送消息到pc端
|
|
|
+ List<Long> pushUserIds = pushUserInfos.stream().map(PushUserInfo::getUserId).collect(Collectors.toList());
|
|
|
+ SendMessageUtil.sendMessageToPC(jmsMessagingTemplate, pushUserIds, pushMessage.getContent(),
|
|
|
+ WebSocketConstants.MessageType.EMERGENCY_MSG);
|
|
|
}
|
|
|
}
|
|
|
return result;
|