阿里云推送改造
This commit is contained in:
parent
a7b6fe8216
commit
eccd60a3a0
27
pom.xml
27
pom.xml
|
|
@ -21,6 +21,11 @@
|
||||||
<artifactId>spring-context</artifactId>
|
<artifactId>spring-context</artifactId>
|
||||||
<version>4.1.6.RELEASE</version>
|
<version>4.1.6.RELEASE</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-aop</artifactId>
|
||||||
|
<version>4.3.12.RELEASE</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework</groupId>
|
<groupId>org.springframework</groupId>
|
||||||
|
|
@ -64,6 +69,24 @@
|
||||||
<version>2.9.0</version>
|
<version>2.9.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.activemq</groupId>
|
||||||
|
<artifactId>activemq-all</artifactId>
|
||||||
|
<version>5.15.4</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-jms</artifactId>
|
||||||
|
<version>4.1.6.RELEASE</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.xbean</groupId>
|
||||||
|
<artifactId>xbean-spring</artifactId>
|
||||||
|
<version>3.16</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.hibernate</groupId>
|
<groupId>org.hibernate</groupId>
|
||||||
<artifactId>hibernate-core</artifactId>
|
<artifactId>hibernate-core</artifactId>
|
||||||
|
|
@ -268,8 +291,8 @@
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.5.1</version>
|
<version>3.5.1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<source>1.7</source>
|
<source>1.8</source>
|
||||||
<target>1.7</target>
|
<target>1.8</target>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,13 @@
|
||||||
package com.ifish.action;
|
package com.ifish.action;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.ifish.entity.AliyunDeviceInfo;
|
import com.ifish.entity.AliyunDeviceInfo;
|
||||||
|
import com.ifish.entity.User;
|
||||||
|
import com.ifish.enums.ResultEnum;
|
||||||
|
import com.ifish.service.BaseService;
|
||||||
import com.ifish.service.PageListService;
|
import com.ifish.service.PageListService;
|
||||||
|
import com.ifish.service.UserService;
|
||||||
|
import com.ifish.util.IfishUtil;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -15,11 +18,6 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import com.ifish.entity.User;
|
|
||||||
import com.ifish.enums.ResultEnum;
|
|
||||||
import com.ifish.service.BaseService;
|
|
||||||
import com.ifish.util.IfishUtil;
|
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -35,6 +33,9 @@ public class UpdateUserAction {
|
||||||
@Autowired
|
@Autowired
|
||||||
private BaseService baseService;
|
private BaseService baseService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private UserService userService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private PageListService pageListService;
|
private PageListService pageListService;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
package com.ifish.entity.event;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author: yan.y
|
||||||
|
* @Description:
|
||||||
|
* @Date: Created in 16:58 2019-04-10
|
||||||
|
* @Modified by:
|
||||||
|
*/
|
||||||
|
public class QueueEventBody {
|
||||||
|
|
||||||
|
public QueueEventBody(String entity, JSONObject data) {
|
||||||
|
this.entity = entity;
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String entity;
|
||||||
|
|
||||||
|
private JSONObject data;
|
||||||
|
|
||||||
|
public String getEntity() {
|
||||||
|
return entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEntity(String entity) {
|
||||||
|
this.entity = entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JSONObject getData() {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setData(JSONObject data) {
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
package com.ifish.entity.event;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author: yan.y
|
||||||
|
* @Description:
|
||||||
|
* @Date: Created in 16:46 2019-04-10
|
||||||
|
* @Modified by:
|
||||||
|
*/
|
||||||
|
public class QueueEventEntity {
|
||||||
|
|
||||||
|
private String eventProcess;
|
||||||
|
|
||||||
|
private String eventName;
|
||||||
|
|
||||||
|
private QueueEventBody eventBody;
|
||||||
|
|
||||||
|
public String getEventProcess() {
|
||||||
|
return eventProcess;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEventProcess(String eventProcess) {
|
||||||
|
this.eventProcess = eventProcess;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEventName() {
|
||||||
|
return eventName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEventName(String eventName) {
|
||||||
|
this.eventName = eventName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public QueueEventBody getEventBody() {
|
||||||
|
return eventBody;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEventBody(QueueEventBody eventBody) {
|
||||||
|
this.eventBody = eventBody;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -5,32 +5,39 @@
|
||||||
*/
|
*/
|
||||||
package com.ifish.helper;
|
package com.ifish.helper;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.ifish.bean.DeviceUserBean;
|
import com.ifish.bean.DeviceUserBean;
|
||||||
import com.ifish.dao.DeviceUserDao;
|
import com.ifish.dao.DeviceUserDao;
|
||||||
import com.ifish.dao.PushListDao;
|
import com.ifish.dao.PushListDao;
|
||||||
import com.ifish.entity.*;
|
import com.ifish.entity.*;
|
||||||
import com.ifish.enums.BooleanEnum;
|
import com.ifish.entity.event.QueueEventBody;
|
||||||
import com.ifish.enums.GwellEnum;
|
import com.ifish.entity.event.QueueEventEntity;
|
||||||
import com.ifish.enums.NeteaseEnum;
|
import com.ifish.enums.*;
|
||||||
import com.ifish.enums.ResultEnum;
|
|
||||||
import com.ifish.enums.SubDirectoryEnum;
|
|
||||||
import com.ifish.gwell.GwellApi;
|
import com.ifish.gwell.GwellApi;
|
||||||
import com.ifish.mapper.Tbl_Device_User_Mapper;
|
import com.ifish.mapper.Tbl_Device_User_Mapper;
|
||||||
import com.ifish.mapper.Tbl_User_Mapper;
|
import com.ifish.mapper.Tbl_User_Mapper;
|
||||||
import com.ifish.netease.NeteaseIM;
|
import com.ifish.netease.NeteaseIM;
|
||||||
|
import com.ifish.service.UserService;
|
||||||
import com.ifish.util.IfishFilePath;
|
import com.ifish.util.IfishFilePath;
|
||||||
import com.ifish.util.IfishUtil;
|
import com.ifish.util.IfishUtil;
|
||||||
import com.ifish.util.RedisKey;
|
import com.ifish.util.RedisKey;
|
||||||
import com.ifish.util.StringUtil;
|
import com.ifish.util.StringUtil;
|
||||||
|
|
||||||
|
import java.time.Instant;
|
||||||
|
import java.time.ZoneId;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.hibernate.criterion.Criterion;
|
import org.hibernate.criterion.Criterion;
|
||||||
import org.hibernate.criterion.Restrictions;
|
import org.hibernate.criterion.Restrictions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.jms.core.JmsTemplate;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.jms.Destination;
|
||||||
|
import javax.jms.Session;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户管理所有接口方法
|
* 用户管理所有接口方法
|
||||||
*
|
*
|
||||||
|
|
@ -74,6 +81,14 @@ public class UserHelper implements UserHelperI {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private PushListDao pushListDao;
|
private PushListDao pushListDao;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private UserService userService;
|
||||||
|
@Autowired
|
||||||
|
private JmsTemplate jmsTemplate;
|
||||||
|
@Autowired
|
||||||
|
private Destination ifish7PushQueueDestination;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登陆接口
|
* 登陆接口
|
||||||
*
|
*
|
||||||
|
|
@ -237,9 +252,28 @@ public class UserHelper implements UserHelperI {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map registUserNetease(User tmpUser, boolean isUpdate) throws Exception {
|
private Map registUserNetease(User tmpUser, boolean isUpdate) throws Exception {
|
||||||
|
StringBuffer msg = new StringBuffer();
|
||||||
|
msg.append("感谢您使用爱鱼奇,连接智能设备请查看下方说明书,内含操作视频:http://u.eqxiu.com/s/KmmVl87l\n");
|
||||||
|
msg.append("摄像头售后:18667812003\n睿芯插排售后:15757401229\n绚多插排售后:18857689069\n松诺插排售后:13392205468");
|
||||||
|
//如果当前设备用户未注册
|
||||||
if (tmpUser.getIsRegisterNetease().equals(BooleanEnum.NO.getKey())) {
|
if (tmpUser.getIsRegisterNetease().equals(BooleanEnum.NO.getKey())) {
|
||||||
|
PushList pushList = new PushList();
|
||||||
|
pushList.setUserId(tmpUser.getUserId());
|
||||||
|
pushList.setDeviceId(0);
|
||||||
|
pushList.setPhoneType("ALL");
|
||||||
|
pushList.setShowName("");
|
||||||
|
pushList.setPushType(PushTypeEnum.qu_reply.getKey());
|
||||||
|
pushList.setPushTitle("系统通知");
|
||||||
|
pushList.setPushContext(msg.toString());
|
||||||
|
sendPushQueueMessage(pushList);
|
||||||
|
|
||||||
|
//更新用户注册信息
|
||||||
|
User user = userService.getUser(tmpUser.getUserId());
|
||||||
|
user.setIsRegisterNetease(BooleanEnum.YES.getKey());
|
||||||
|
userService.updateUser(user);
|
||||||
|
|
||||||
//注册云信
|
//注册云信
|
||||||
Map<String, String> map = neteaseIM.createAccid(tmpUser.getUserId().toString(), tmpUser.getNickName(), IfishFilePath.getPath(SubDirectoryEnum.headImage, tmpUser.getUserImg()), "");
|
/*Map<String, String> map = neteaseIM.createAccid(tmpUser.getUserId().toString(), tmpUser.getNickName(), IfishFilePath.getPath(SubDirectoryEnum.headImage, tmpUser.getUserImg()), "");
|
||||||
if (map != null) {
|
if (map != null) {
|
||||||
String code = map.get("code");
|
String code = map.get("code");
|
||||||
if (code.equals(NeteaseEnum.status200.getKey())) {
|
if (code.equals(NeteaseEnum.status200.getKey())) {
|
||||||
|
|
@ -255,21 +289,7 @@ public class UserHelper implements UserHelperI {
|
||||||
tmpUser.setIsRegisterNetease(BooleanEnum.YES.getKey());
|
tmpUser.setIsRegisterNetease(BooleanEnum.YES.getKey());
|
||||||
isUpdate = true;
|
isUpdate = true;
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
} //已注册云信
|
|
||||||
else if (tmpUser.getIsRegisterNetease().equals(BooleanEnum.YES.getKey())) {
|
|
||||||
//token为空
|
|
||||||
if (tmpUser.getNeteaseToken().equals("")) {
|
|
||||||
//获取云信token
|
|
||||||
Map<String, String> map = neteaseIM.refreshToken(tmpUser.getUserId().toString());
|
|
||||||
if (map != null) {
|
|
||||||
String code = map.get("code");
|
|
||||||
if (code.equals(NeteaseEnum.status200.getKey())) {
|
|
||||||
tmpUser.setNeteaseToken(map.get("token"));
|
|
||||||
isUpdate = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Map resultMap = new HashMap();
|
Map resultMap = new HashMap();
|
||||||
resultMap.put("user", tmpUser);
|
resultMap.put("user", tmpUser);
|
||||||
|
|
@ -277,6 +297,22 @@ public class UserHelper implements UserHelperI {
|
||||||
return resultMap;
|
return resultMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推送Push消息队列
|
||||||
|
* @param pushList 内容
|
||||||
|
*/
|
||||||
|
private void sendPushQueueMessage(final PushList pushList) {
|
||||||
|
JSONObject data = JSON.parseObject(JSON.toJSONString(pushList));
|
||||||
|
QueueEventEntity eventEntity = new QueueEventEntity();
|
||||||
|
eventEntity.setEventName("com.ifish7.mq.queues.event.PushNotifcationEvent");
|
||||||
|
eventEntity.setEventProcess("deviceNotifcationPlus");
|
||||||
|
QueueEventBody eventBody = new QueueEventBody("com.ifish7.mq.business.user.entity.TblPushList",data);
|
||||||
|
eventEntity.setEventBody(eventBody);
|
||||||
|
String json = JSONObject.toJSONString(eventEntity);
|
||||||
|
jmsTemplate.send(ifish7PushQueueDestination,(Session session) -> session.createTextMessage(json));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录成功,返回给App数据
|
* 登录成功,返回给App数据
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -80,4 +80,8 @@ public interface UserService {
|
||||||
*/
|
*/
|
||||||
public JsonResult<?> uploadUserImg(Integer userId,MultipartFile fileUpload);
|
public JsonResult<?> uploadUserImg(Integer userId,MultipartFile fileUpload);
|
||||||
|
|
||||||
|
User getUser(Integer userId);
|
||||||
|
|
||||||
|
void updateUser(User user);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,13 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.ifish.entity.event.QueueEventBody;
|
||||||
|
import com.ifish.entity.event.QueueEventEntity;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.hibernate.criterion.Restrictions;
|
import org.hibernate.criterion.Restrictions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.jms.core.JmsTemplate;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
@ -83,6 +87,9 @@ import com.ifish.util.IfishUtil;
|
||||||
import com.ifish.validator.LoginParam;
|
import com.ifish.validator.LoginParam;
|
||||||
import com.ifish.validator.RegisterParam;
|
import com.ifish.validator.RegisterParam;
|
||||||
|
|
||||||
|
import javax.jms.Destination;
|
||||||
|
import javax.jms.Session;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName: UserServiceImpl
|
* @ClassName: UserServiceImpl
|
||||||
* @Description: TODO
|
* @Description: TODO
|
||||||
|
|
@ -127,6 +134,25 @@ public class UserServiceImpl implements UserService {
|
||||||
private CacheService cacheService;
|
private CacheService cacheService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private GradeService gradeService;
|
private GradeService gradeService;
|
||||||
|
@Autowired
|
||||||
|
private JmsTemplate jmsTemplate;
|
||||||
|
@Autowired
|
||||||
|
private Destination ifish7PushQueueDestination;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推送Push消息队列
|
||||||
|
* @param pushList 内容
|
||||||
|
*/
|
||||||
|
private void sendPushQueueMessage(final PushList pushList) {
|
||||||
|
JSONObject data = JSON.parseObject(JSON.toJSONString(pushList));
|
||||||
|
QueueEventEntity eventEntity = new QueueEventEntity();
|
||||||
|
eventEntity.setEventName("com.ifish7.mq.queues.event.PushNotifcationEvent");
|
||||||
|
eventEntity.setEventProcess("deviceNotifcationPlus");
|
||||||
|
QueueEventBody eventBody = new QueueEventBody("com.ifish7.mq.business.user.entity.TblPushList",data);
|
||||||
|
eventEntity.setEventBody(eventBody);
|
||||||
|
String json = JSONObject.toJSONString(eventEntity);
|
||||||
|
jmsTemplate.send(ifish7PushQueueDestination,(Session session) -> session.createTextMessage(json));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JsonResult<?> getVerificateCode(String phoneNumber, String sendType) {
|
public JsonResult<?> getVerificateCode(String phoneNumber, String sendType) {
|
||||||
|
|
@ -175,19 +201,32 @@ public class UserServiceImpl implements UserService {
|
||||||
user.setP2PVerifyCode2(gwellParam.getP2PVerifyCode2());
|
user.setP2PVerifyCode2(gwellParam.getP2PVerifyCode2());
|
||||||
user.setGwellUserID(gwellParam.getUserID());
|
user.setGwellUserID(gwellParam.getUserID());
|
||||||
}
|
}
|
||||||
//云信参数
|
StringBuffer msg = new StringBuffer();
|
||||||
|
msg.append("感谢您使用爱鱼奇,连接智能设备请查看下方说明书,内含操作视频:http://u.eqxiu.com/s/KmmVl87l\n");
|
||||||
|
msg.append("摄像头售后:18667812003\n睿芯插排售后:15757401229\n绚多插排售后:18857689069\n松诺插排售后:13392205468");
|
||||||
Integer userId = user.getUserId();
|
Integer userId = user.getUserId();
|
||||||
NeteaseParamDto neteaseParam = GetNeteaseInfo(user.getIsRegisterNetease(), userId, user.getNickName(), user.getUserImg(), user.getNeteaseToken());
|
//如果当前设备用户未注册
|
||||||
if(neteaseParam!=null){
|
if (user.getIsRegisterNetease().equals(BooleanEnum.NO.getKey())) {
|
||||||
user.setIsRegisterNetease(neteaseParam.getIsRegisterNetease());
|
PushList pushList = new PushList();
|
||||||
user.setNeteaseToken(neteaseParam.getNeteaseToken());
|
pushList.setUserId(userId);
|
||||||
|
pushList.setDeviceId(0);
|
||||||
|
pushList.setPhoneType("ALL");
|
||||||
|
pushList.setShowName("");
|
||||||
|
pushList.setPushType(PushTypeEnum.qu_reply.getKey());
|
||||||
|
pushList.setPushTitle("系统通知");
|
||||||
|
pushList.setPushContext(msg.toString());
|
||||||
|
sendPushQueueMessage(pushList);
|
||||||
|
|
||||||
|
//更新用户注册信息
|
||||||
|
user.setIsRegisterNetease(BooleanEnum.YES.getKey());
|
||||||
|
userDao.update(user);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 更新登陆参数
|
* 更新登陆参数
|
||||||
*/
|
*/
|
||||||
userDao.executeLoginUpdate(userId,loginParam.getLoginType());
|
userDao.executeLoginUpdate(userId,loginParam.getLoginType());
|
||||||
//设备信息
|
//设备信息
|
||||||
DeviceInfoDto deviceInfo = getDeviceInfo(userId);
|
DeviceInfoDto deviceInfo = getDeviceInfo(user.getUserId());
|
||||||
/**
|
/**
|
||||||
* 登录返回信息
|
* 登录返回信息
|
||||||
*/
|
*/
|
||||||
|
|
@ -253,10 +292,24 @@ public class UserServiceImpl implements UserService {
|
||||||
}
|
}
|
||||||
//云信参数
|
//云信参数
|
||||||
Integer userId = user.getUserId();
|
Integer userId = user.getUserId();
|
||||||
NeteaseParamDto neteaseParam = GetNeteaseInfo(user.getIsRegisterNetease(), userId, user.getNickName(), user.getUserImg(), user.getNeteaseToken());
|
StringBuffer msg = new StringBuffer();
|
||||||
if(neteaseParam!=null){
|
msg.append("感谢您使用爱鱼奇,连接智能设备请查看下方说明书,内含操作视频:http://u.eqxiu.com/s/KmmVl87l\n");
|
||||||
user.setIsRegisterNetease(neteaseParam.getIsRegisterNetease());
|
msg.append("摄像头售后:18667812003\n睿芯插排售后:15757401229\n绚多插排售后:18857689069\n松诺插排售后:13392205468");
|
||||||
user.setNeteaseToken(neteaseParam.getNeteaseToken());
|
//如果当前设备用户未注册
|
||||||
|
if (user.getIsRegisterNetease().equals(BooleanEnum.NO.getKey())) {
|
||||||
|
PushList pushList = new PushList();
|
||||||
|
pushList.setUserId(userId);
|
||||||
|
pushList.setDeviceId(0);
|
||||||
|
pushList.setPhoneType("ALL");
|
||||||
|
pushList.setShowName("");
|
||||||
|
pushList.setPushType(PushTypeEnum.qu_reply.getKey());
|
||||||
|
pushList.setPushTitle("系统通知");
|
||||||
|
pushList.setPushContext(msg.toString());
|
||||||
|
sendPushQueueMessage(pushList);
|
||||||
|
|
||||||
|
//更新用户注册信息
|
||||||
|
user.setIsRegisterNetease(BooleanEnum.YES.getKey());
|
||||||
|
userDao.update(user);
|
||||||
}
|
}
|
||||||
//更新登陆参数
|
//更新登陆参数
|
||||||
userDao.executeLoginUpdate(userId,loginParam.getLoginType());
|
userDao.executeLoginUpdate(userId,loginParam.getLoginType());
|
||||||
|
|
@ -595,6 +648,7 @@ public class UserServiceImpl implements UserService {
|
||||||
* 第一次注册云信发送一条系统消息
|
* 第一次注册云信发送一条系统消息
|
||||||
* @param to
|
* @param to
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public void sendMsgByIM(String to){
|
public void sendMsgByIM(String to){
|
||||||
//发送云信消息
|
//发送云信消息
|
||||||
User user = userDao.findUniqueByProperty(Restrictions.eq("phoneNumber", IfishFilePath.netease_phone));
|
User user = userDao.findUniqueByProperty(Restrictions.eq("phoneNumber", IfishFilePath.netease_phone));
|
||||||
|
|
@ -844,6 +898,7 @@ public class UserServiceImpl implements UserService {
|
||||||
* @param neteaseToken
|
* @param neteaseToken
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public NeteaseParamDto GetNeteaseInfo(String isRegisterNetease,Integer userId,String nickName,String userImg,String neteaseToken){
|
public NeteaseParamDto GetNeteaseInfo(String isRegisterNetease,Integer userId,String nickName,String userImg,String neteaseToken){
|
||||||
//未注册云信
|
//未注册云信
|
||||||
if(!BooleanEnum.YES.getKey().equals(isRegisterNetease)){
|
if(!BooleanEnum.YES.getKey().equals(isRegisterNetease)){
|
||||||
|
|
@ -1082,4 +1137,14 @@ public class UserServiceImpl implements UserService {
|
||||||
}
|
}
|
||||||
return goldTaskList;
|
return goldTaskList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public User getUser(Integer userId) {
|
||||||
|
return this.userDao.get(userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateUser(User user) {
|
||||||
|
this.userDao.update(user);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,15 @@
|
||||||
default-lazy-init="false">
|
default-lazy-init="false">
|
||||||
|
|
||||||
<!-- 导入外部的properties文件-->
|
<!-- 导入外部的properties文件-->
|
||||||
<context:property-placeholder location="classpath*:jdbc.properties"/>
|
<bean id="propertyConfigurer"
|
||||||
|
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
|
||||||
|
<property name="locations" >
|
||||||
|
<list>
|
||||||
|
<value>classpath:mq.properties</value>
|
||||||
|
<value>classpath:jdbc.properties</value>
|
||||||
|
</list>
|
||||||
|
</property>
|
||||||
|
</bean>
|
||||||
<!-- 注册识别注解 -->
|
<!-- 注册识别注解 -->
|
||||||
<context:component-scan base-package="com.ifish.daoImpl,com.ifish.serviceImpl,com.ifish.helper,com.ifish.config"/>
|
<context:component-scan base-package="com.ifish.daoImpl,com.ifish.serviceImpl,com.ifish.helper,com.ifish.config"/>
|
||||||
<!-- 文件上传 -->
|
<!-- 文件上传 -->
|
||||||
|
|
@ -89,7 +97,6 @@
|
||||||
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
|
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
|
||||||
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
|
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
|
||||||
<prop key="hibernate.format_sql">${hibernate.format_sql}</prop>
|
<prop key="hibernate.format_sql">${hibernate.format_sql}</prop>
|
||||||
<prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
|
|
||||||
</props>
|
</props>
|
||||||
</property>
|
</property>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
@ -118,5 +125,36 @@
|
||||||
<!-- 云信 -->
|
<!-- 云信 -->
|
||||||
<bean id="neteaseIM" class="com.ifish.netease.NeteaseIM"></bean>
|
<bean id="neteaseIM" class="com.ifish.netease.NeteaseIM"></bean>
|
||||||
|
|
||||||
|
<bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory" >
|
||||||
|
<property name="brokerURL" value="${broker_url}" />
|
||||||
|
<property name="userName" value="${username}" />
|
||||||
|
<property name="password" value="${password}" />
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
<bean id="jmsFactory" class="org.apache.activemq.pool.PooledConnectionFactory"
|
||||||
|
destroy-method="stop">
|
||||||
|
<property name="connectionFactory" ref="connectionFactory"/>
|
||||||
|
<property name="maxConnections" value="100"></property>
|
||||||
|
</bean>
|
||||||
|
<!--使用缓存可以提升效率-->
|
||||||
|
<bean id="cachingConnectionFactory" class="org.springframework.jms.connection.CachingConnectionFactory">
|
||||||
|
<property name="targetConnectionFactory" ref="jmsFactory"/>
|
||||||
|
<property name="sessionCacheSize" value="1"/>
|
||||||
|
</bean>
|
||||||
|
<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
|
||||||
|
<property name="connectionFactory" ref="cachingConnectionFactory"/>
|
||||||
|
<property name="messageConverter">
|
||||||
|
<bean class="org.springframework.jms.support.converter.SimpleMessageConverter"/>
|
||||||
|
</property>
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
<!-- 定义消息推送消息队列(Queue) -->
|
||||||
|
<bean id="ifish7PushQueueDestination" class="org.apache.activemq.command.ActiveMQQueue">
|
||||||
|
<!-- 设置消息队列的名字 -->
|
||||||
|
<constructor-arg>
|
||||||
|
<value>${queue_push_name}</value>
|
||||||
|
</constructor-arg>
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
|
||||||
</beans>
|
</beans>
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
jdbc.driver=com.mysql.jdbc.Driver
|
jdbc.driver=com.mysql.jdbc.Driver
|
||||||
#jdbc.url=jdbc\:mysql\://localhost\:3306/myfishdb?characterEncoding\=UTF-8
|
jdbc.url=jdbc\:mysql\://localhost\:3306/myfishdb?characterEncoding\=UTF-8
|
||||||
jdbc.url=jdbc\:mysql\://139.196.24.156\:3306/myfishdb?characterEncoding\=UTF-8
|
#jdbc.url=jdbc\:mysql\://139.196.24.156\:3306/myfishdb?characterEncoding\=UTF-8
|
||||||
#jdbc.username=ifish
|
jdbc.username=ifish
|
||||||
#jdbc.password=ifish7pwd
|
jdbc.password=ifish7pwd
|
||||||
jdbc.username=root
|
#jdbc.username=root
|
||||||
jdbc.password=ifish7mysql
|
#jdbc.password=ifish7mysql
|
||||||
#jdbc.testWhileIdle=true
|
#jdbc.testWhileIdle=true
|
||||||
jdbc.validationQuery=SELECT * FROM DUAL
|
jdbc.validationQuery=SELECT * FROM DUAL
|
||||||
initialSize=1
|
initialSize=1
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,5 @@ log4j.appender.ROLLING_FILE.layout=org.apache.log4j.PatternLayout
|
||||||
log4j.appender.ROLLING_FILE.layout.ConversionPattern=[Ifish7][%-5p]%d - %c.%t(%F:%L) - %m%n
|
log4j.appender.ROLLING_FILE.layout.ConversionPattern=[Ifish7][%-5p]%d - %c.%t(%F:%L) - %m%n
|
||||||
|
|
||||||
log4j.logger.org.springframework=INFO
|
log4j.logger.org.springframework=INFO
|
||||||
log4j.logger.com.hibernate=INFO
|
log4j.logger.com.hibernate=DEBUG
|
||||||
log4j.logger.java.sql=ERROR
|
log4j.logger.java.sql=ERROR
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
#broker_url=tcp://test.ifish7.com:61616
|
||||||
|
broker_url=tcp://www.ifish7.com:61616
|
||||||
|
username=admin
|
||||||
|
#password=admin
|
||||||
|
password=adminifish7
|
||||||
|
queue_data_name=ifishDataMq
|
||||||
|
queue_push_name=ifishPushMq
|
||||||
Loading…
Reference in New Issue