|
@@ -6,10 +6,7 @@ import com.ozs.common.core.controller.BaseController;
|
|
import com.ozs.common.core.domain.entity.SysUser;
|
|
import com.ozs.common.core.domain.entity.SysUser;
|
|
import com.ozs.common.utils.AppendUtils;
|
|
import com.ozs.common.utils.AppendUtils;
|
|
import com.ozs.common.utils.StringUtils;
|
|
import com.ozs.common.utils.StringUtils;
|
|
-import com.ozs.service.entity.BaseCameraManagement;
|
|
|
|
-import com.ozs.service.entity.MsgAlarm;
|
|
|
|
-import com.ozs.service.entity.MsgAppPush;
|
|
|
|
-import com.ozs.service.entity.MsgWebPush;
|
|
|
|
|
|
+import com.ozs.service.entity.*;
|
|
import com.ozs.service.entity.vo.MsgAlarmResp;
|
|
import com.ozs.service.entity.vo.MsgAlarmResp;
|
|
import com.ozs.service.service.*;
|
|
import com.ozs.service.service.*;
|
|
import com.ozs.system.service.ISysUserService;
|
|
import com.ozs.system.service.ISysUserService;
|
|
@@ -168,14 +165,14 @@ public class WebSocketConteoller extends BaseController {
|
|
List<MsgAppPush> msgAppPushList = msgAppPushService.list(lwMsgAppPush);
|
|
List<MsgAppPush> msgAppPushList = msgAppPushService.list(lwMsgAppPush);
|
|
log.info("APPmsgAppPushList size -----" + msgAppPushList.size());
|
|
log.info("APPmsgAppPushList size -----" + msgAppPushList.size());
|
|
if (StringUtils.isEmpty(msgAppPushList) || msgAppPushList.size() == 0) {
|
|
if (StringUtils.isEmpty(msgAppPushList) || msgAppPushList.size() == 0) {
|
|
- List<String> alias = new ArrayList<>();
|
|
|
|
|
|
+ List<UserRegistrationid> alias = new ArrayList<>();
|
|
if (!StringUtils.isEmpty(userIdList) || userIdList.size() > 0) {
|
|
if (!StringUtils.isEmpty(userIdList) || userIdList.size() > 0) {
|
|
alias = userRegistrationidService.selectRegistrationID(userIdList);
|
|
alias = userRegistrationidService.selectRegistrationID(userIdList);
|
|
}
|
|
}
|
|
- List<String> listString = distinct(alias);
|
|
|
|
- if (!StringUtils.isEmpty(listString) || listString.size() > 0) {
|
|
|
|
- for (String userid : listString) {
|
|
|
|
- log.info("APP userid -----" + userid);
|
|
|
|
|
|
+// List<String> listString = distinct(alias);
|
|
|
|
+ if (!StringUtils.isEmpty(alias) || alias.size() > 0) {
|
|
|
|
+ for (UserRegistrationid userRegistrationid : alias) {
|
|
|
|
+ log.info("APP alias -----" + userRegistrationid.getRegistrationId());
|
|
String pushId = UUID.randomUUID().toString();
|
|
String pushId = UUID.randomUUID().toString();
|
|
msgAlarmResp.setPushId(UUID.randomUUID().toString());
|
|
msgAlarmResp.setPushId(UUID.randomUUID().toString());
|
|
String content = objStr(msgAlarmResp);
|
|
String content = objStr(msgAlarmResp);
|
|
@@ -183,9 +180,9 @@ public class WebSocketConteoller extends BaseController {
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
String formatDate = sdf.format(alarmTime != null ? alarmTime : new Date());
|
|
String formatDate = sdf.format(alarmTime != null ? alarmTime : new Date());
|
|
log.info("APPcontent-----" + content);
|
|
log.info("APPcontent-----" + content);
|
|
- log.info("APPuserid-----" + userid);
|
|
|
|
|
|
+ log.info("APPuserid-----" + userRegistrationid.getUserId());
|
|
List<String> userList = new ArrayList<>();
|
|
List<String> userList = new ArrayList<>();
|
|
- userList.add(userid);
|
|
|
|
|
|
+ userList.add(userRegistrationid.getRegistrationId());
|
|
JPushUtil.sendToRegistrationId(
|
|
JPushUtil.sendToRegistrationId(
|
|
userList,
|
|
userList,
|
|
"报警通知!", cameraName != null ? cameraName : "",
|
|
"报警通知!", cameraName != null ? cameraName : "",
|
|
@@ -198,7 +195,7 @@ public class WebSocketConteoller extends BaseController {
|
|
msgAppPush.setStatus(1);
|
|
msgAppPush.setStatus(1);
|
|
msgAppPush.setPushId(pushId);
|
|
msgAppPush.setPushId(pushId);
|
|
msgAppPush.setAlarmId(alarmId);
|
|
msgAppPush.setAlarmId(alarmId);
|
|
- msgAppPush.setReceiveBy(userid);
|
|
|
|
|
|
+ msgAppPush.setReceiveBy(userRegistrationid.getUserId());
|
|
msgAppPush.setCreateBy(userIdLogin);
|
|
msgAppPush.setCreateBy(userIdLogin);
|
|
msgAppPush.setCreateTime(new Date());
|
|
msgAppPush.setCreateTime(new Date());
|
|
msgAppPush.setUpdateBy(userIdLogin);
|
|
msgAppPush.setUpdateBy(userIdLogin);
|