阿里云推送接口
This commit is contained in:
parent
7fa08e8e63
commit
a7b6fe8216
22
pom.xml
22
pom.xml
|
|
@ -69,13 +69,13 @@
|
||||||
<artifactId>hibernate-core</artifactId>
|
<artifactId>hibernate-core</artifactId>
|
||||||
<version>4.3.11.Final</version>
|
<version>4.3.11.Final</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.jboss.logging</groupId>
|
<groupId>org.jboss.logging</groupId>
|
||||||
<artifactId>jboss-logging-annotations</artifactId>
|
<artifactId>jboss-logging-annotations</artifactId>
|
||||||
<version>2.0.1.Final</version>
|
<version>2.0.1.Final</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-fileupload</groupId>
|
<groupId>commons-fileupload</groupId>
|
||||||
<artifactId>commons-fileupload</artifactId>
|
<artifactId>commons-fileupload</artifactId>
|
||||||
|
|
@ -119,24 +119,11 @@
|
||||||
<version>2.5.3</version>
|
<version>2.5.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.slf4j</groupId>
|
|
||||||
<artifactId>slf4j-api</artifactId>
|
|
||||||
<version>1.7.12</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>ch.qos.logback</groupId>
|
<groupId>ch.qos.logback</groupId>
|
||||||
<artifactId>logback-core</artifactId>
|
<artifactId>logback-core</artifactId>
|
||||||
<version>1.1.2</version>
|
<version>1.1.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>ch.qos.logback</groupId>
|
|
||||||
<artifactId>logback-classic</artifactId>
|
|
||||||
<version>1.1.2</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.mina</groupId>
|
<groupId>org.apache.mina</groupId>
|
||||||
<artifactId>mina-core</artifactId>
|
<artifactId>mina-core</artifactId>
|
||||||
|
|
@ -241,11 +228,6 @@
|
||||||
<artifactId>slf4j-api</artifactId>
|
<artifactId>slf4j-api</artifactId>
|
||||||
<version>1.7.5</version>
|
<version>1.7.5</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.slf4j</groupId>
|
|
||||||
<artifactId>slf4j-log4j12</artifactId>
|
|
||||||
<version>1.7.5</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,10 @@
|
||||||
package com.ifish.action;
|
package com.ifish.action;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.ifish.entity.AliyunDeviceInfo;
|
||||||
|
import com.ifish.service.PageListService;
|
||||||
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,6 +20,8 @@ import com.ifish.enums.ResultEnum;
|
||||||
import com.ifish.service.BaseService;
|
import com.ifish.service.BaseService;
|
||||||
import com.ifish.util.IfishUtil;
|
import com.ifish.util.IfishUtil;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName: UpdateUserAction
|
* @ClassName: UpdateUserAction
|
||||||
* @Description: TODO
|
* @Description: TODO
|
||||||
|
|
@ -27,6 +34,9 @@ public class UpdateUserAction {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private BaseService baseService;
|
private BaseService baseService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private PageListService pageListService;
|
||||||
|
|
||||||
private static Logger log = LoggerFactory.getLogger(UpdateUserAction.class);
|
private static Logger log = LoggerFactory.getLogger(UpdateUserAction.class);
|
||||||
|
|
||||||
|
|
@ -72,5 +82,55 @@ public class UpdateUserAction {
|
||||||
}
|
}
|
||||||
return IfishUtil.returnJson(ResultEnum.fail101.getKey(), "");
|
return IfishUtil.returnJson(ResultEnum.fail101.getKey(), "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = "/bindDevice.do")
|
||||||
|
@ResponseBody
|
||||||
|
public Object bindDevice(@RequestParam String deviceId,@RequestParam Integer userId){
|
||||||
|
AliyunDeviceInfo aliyunDeviceInfo = baseService.getAliyunDeviceInfo(deviceId);
|
||||||
|
if (aliyunDeviceInfo == null) {
|
||||||
|
aliyunDeviceInfo = new AliyunDeviceInfo();
|
||||||
|
aliyunDeviceInfo.setAliyunDeviceId(deviceId);
|
||||||
|
aliyunDeviceInfo.setUserId(userId);
|
||||||
|
aliyunDeviceInfo.setBindTime(new Date());
|
||||||
|
aliyunDeviceInfo.setLastUpdateTime(new Date());
|
||||||
|
} else {
|
||||||
|
aliyunDeviceInfo.setUserId(userId);
|
||||||
|
aliyunDeviceInfo.setLastUpdateTime(new Date());
|
||||||
|
}
|
||||||
|
return baseService.saveOrUpdateAliyunDeviceInfo(aliyunDeviceInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = "/userMessageIsRead.do")
|
||||||
|
@ResponseBody
|
||||||
|
public Object userMessageIsRead(@RequestParam Integer userId){
|
||||||
|
try {
|
||||||
|
return baseService.userMessageIsRead(userId);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("update userinfo:userId:{},error message:{}",userId);
|
||||||
|
}
|
||||||
|
return IfishUtil.returnJson(ResultEnum.fail101.getKey(), "");
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = "/userMessageNoReadCount.do")
|
||||||
|
@ResponseBody
|
||||||
|
public Object userMessageNoReadCount(@RequestParam Integer userId){
|
||||||
|
try {
|
||||||
|
return baseService.userMessageNoReadCount(userId);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("userMessageNoReadCount userinfo:userId:{},error message:{}",userId);
|
||||||
|
}
|
||||||
|
return IfishUtil.returnJson(ResultEnum.fail101.getKey(), "");
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = "/deleteMessages.do")
|
||||||
|
@ResponseBody
|
||||||
|
public Object deleteMessages(@RequestParam String pushIds){
|
||||||
|
try {
|
||||||
|
JSONArray pushId = JSONArray.parseArray(pushIds);
|
||||||
|
return pageListService.deletePushlist(pushId);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("deleteMessages : pushIds :{},error message:{}",pushIds);
|
||||||
|
}
|
||||||
|
return IfishUtil.returnJson(ResultEnum.fail101.getKey(), "");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.ifish.dao;
|
||||||
|
|
||||||
|
import com.ifish.entity.AliyunDeviceInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author: yan.y
|
||||||
|
* @Description:
|
||||||
|
* @Date: Created in 22:26 2019/5/20
|
||||||
|
*/
|
||||||
|
public interface AliyunDeviceInfoDao extends BaseDao<AliyunDeviceInfo,String> {
|
||||||
|
}
|
||||||
|
|
@ -12,4 +12,8 @@ import com.ifish.hibernate.Pagination;
|
||||||
public interface PushListDao extends BaseDao<PushList, Integer>{
|
public interface PushListDao extends BaseDao<PushList, Integer>{
|
||||||
|
|
||||||
public Pagination<PushList> findByCriteria(Integer pushId,Integer userId,Integer firstResult,Integer pageSize);
|
public Pagination<PushList> findByCriteria(Integer pushId,Integer userId,Integer firstResult,Integer pageSize);
|
||||||
|
|
||||||
|
void updatePushListIsRead(Integer userId);
|
||||||
|
|
||||||
|
int pushNoReadCount(Integer userId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.ifish.daoImpl;
|
||||||
|
|
||||||
|
import com.ifish.dao.AliyunDeviceInfoDao;
|
||||||
|
import com.ifish.entity.AliyunDeviceInfo;
|
||||||
|
import com.ifish.hibernate.HibernateBaseDao;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author: yan.y
|
||||||
|
* @Description:
|
||||||
|
* @Date: Created in 22:27 2019/5/20
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public class AliyunDeviceInfoDaoImpl extends HibernateBaseDao<AliyunDeviceInfo,String> implements AliyunDeviceInfoDao {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Class<AliyunDeviceInfo> getEntityClass() {
|
||||||
|
return AliyunDeviceInfo.class;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,8 +1,10 @@
|
||||||
package com.ifish.daoImpl;
|
package com.ifish.daoImpl;
|
||||||
|
|
||||||
|
import java.math.BigInteger;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.hibernate.SQLQuery;
|
||||||
import org.hibernate.criterion.Criterion;
|
import org.hibernate.criterion.Criterion;
|
||||||
import org.hibernate.criterion.Order;
|
import org.hibernate.criterion.Order;
|
||||||
import org.hibernate.criterion.Restrictions;
|
import org.hibernate.criterion.Restrictions;
|
||||||
|
|
@ -38,7 +40,7 @@ public class PushListDaoImpl extends HibernateBaseDao<PushList, Integer> impleme
|
||||||
queryList.add(criterion);
|
queryList.add(criterion);
|
||||||
}
|
}
|
||||||
if(userId!=null){
|
if(userId!=null){
|
||||||
Criterion criterion = Restrictions.or(Restrictions.eq("userId", userId),Restrictions.eq("pushType", PushTypeEnum.all_push.getKey()));
|
Criterion criterion = Restrictions.eq("userId", userId);
|
||||||
queryList.add(criterion);
|
queryList.add(criterion);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
|
@ -48,4 +50,18 @@ public class PushListDaoImpl extends HibernateBaseDao<PushList, Integer> impleme
|
||||||
return this.findByCriteria(firstResult, pageSize,Order.desc("pushId"), queryList.toArray(new Criterion[queryList.size()]));
|
return this.findByCriteria(firstResult, pageSize,Order.desc("pushId"), queryList.toArray(new Criterion[queryList.size()]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updatePushListIsRead(Integer userId) {
|
||||||
|
SQLQuery sqlQuery = this.getSession().createSQLQuery("update tbl_push_list set is_read = 0 where user_id = ? ");
|
||||||
|
sqlQuery.setParameter(0,userId);
|
||||||
|
sqlQuery.executeUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int pushNoReadCount(Integer userId) {
|
||||||
|
SQLQuery sqlQuery = this.getSession().createSQLQuery("select count(1) from tbl_push_list t where t.user_id = ? and t.is_read = 1 ");
|
||||||
|
sqlQuery.setParameter(0,userId);
|
||||||
|
BigInteger count = (BigInteger) sqlQuery.list().get(0);
|
||||||
|
return count.intValue();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,61 @@
|
||||||
|
package com.ifish.entity;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author: yan.y
|
||||||
|
* @Description: tbl_aliyun_device_info
|
||||||
|
* @Date: Created in 16:45 2018/1/28
|
||||||
|
* @Modified by:
|
||||||
|
*/
|
||||||
|
@Entity
|
||||||
|
@Table(name = "tbl_aliyun_device_info")
|
||||||
|
public class AliyunDeviceInfo implements Serializable{
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@Column(name = "aliyun_device_id")
|
||||||
|
private String aliyunDeviceId;
|
||||||
|
|
||||||
|
@Column(name = "user_id")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@Column(name="bind_time",columnDefinition="timestamp")
|
||||||
|
private Date bindTime;
|
||||||
|
|
||||||
|
@Column(name="last_update_time",columnDefinition="timestamp")
|
||||||
|
private Date lastUpdateTime;
|
||||||
|
|
||||||
|
public String getAliyunDeviceId() {
|
||||||
|
return aliyunDeviceId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAliyunDeviceId(String aliyunDeviceId) {
|
||||||
|
this.aliyunDeviceId = aliyunDeviceId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getUserId() {
|
||||||
|
return userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserId(Integer userId) {
|
||||||
|
this.userId = userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getBindTime() {
|
||||||
|
return bindTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBindTime(Date bindTime) {
|
||||||
|
this.bindTime = bindTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getLastUpdateTime() {
|
||||||
|
return lastUpdateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLastUpdateTime(Date lastUpdateTime) {
|
||||||
|
this.lastUpdateTime = lastUpdateTime;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -40,6 +40,8 @@ public class PushList implements Serializable{
|
||||||
private String neteaseStatus;
|
private String neteaseStatus;
|
||||||
//创建时间
|
//创建时间
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
//是否已读
|
||||||
|
private Integer isRead;
|
||||||
|
|
||||||
public PushList() {}
|
public PushList() {}
|
||||||
|
|
||||||
|
|
@ -133,5 +135,12 @@ public class PushList implements Serializable{
|
||||||
public void setNeteaseStatus(String neteaseStatus) {
|
public void setNeteaseStatus(String neteaseStatus) {
|
||||||
this.neteaseStatus = neteaseStatus;
|
this.neteaseStatus = neteaseStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getIsRead() {
|
||||||
|
return isRead;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsRead(Integer isRead) {
|
||||||
|
this.isRead = isRead;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -133,6 +133,7 @@ public class User implements Serializable{
|
||||||
*/
|
*/
|
||||||
@Column(name="latitude")
|
@Column(name="latitude")
|
||||||
private Double latitude;
|
private Double latitude;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改时间
|
* 修改时间
|
||||||
*/
|
*/
|
||||||
|
|
@ -283,6 +284,7 @@ public class User implements Serializable{
|
||||||
public void setLatitude(Double latitude) {
|
public void setLatitude(Double latitude) {
|
||||||
this.latitude = latitude;
|
this.latitude = latitude;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Date getLoginTime() {
|
public Date getLoginTime() {
|
||||||
return loginTime;
|
return loginTime;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,5 +18,6 @@
|
||||||
<property name="jpushStatus" column="jpush_status" type="string" length="1"/>
|
<property name="jpushStatus" column="jpush_status" type="string" length="1"/>
|
||||||
<property name="neteaseStatus" column="netease_status" type="string" length="1"/>
|
<property name="neteaseStatus" column="netease_status" type="string" length="1"/>
|
||||||
<property name="createTime" column="create_time" type="timestamp" update="false"/>
|
<property name="createTime" column="create_time" type="timestamp" update="false"/>
|
||||||
|
<property name="isRead" column="is_read" type="java.lang.Integer" length="1"/>
|
||||||
</class>
|
</class>
|
||||||
</hibernate-mapping>
|
</hibernate-mapping>
|
||||||
|
|
@ -7,6 +7,7 @@ package com.ifish.helper;
|
||||||
|
|
||||||
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.entity.*;
|
import com.ifish.entity.*;
|
||||||
import com.ifish.enums.BooleanEnum;
|
import com.ifish.enums.BooleanEnum;
|
||||||
import com.ifish.enums.GwellEnum;
|
import com.ifish.enums.GwellEnum;
|
||||||
|
|
@ -25,6 +26,8 @@ import com.ifish.util.StringUtil;
|
||||||
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.Restrictions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
|
@ -69,6 +72,8 @@ public class UserHelper implements UserHelperI {
|
||||||
@Autowired
|
@Autowired
|
||||||
private DeviceUserDao deviceUserDao;
|
private DeviceUserDao deviceUserDao;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private PushListDao pushListDao;
|
||||||
/**
|
/**
|
||||||
* 登陆接口
|
* 登陆接口
|
||||||
*
|
*
|
||||||
|
|
@ -293,6 +298,7 @@ public class UserHelper implements UserHelperI {
|
||||||
userMap.put("neteaseToken", tmpUser.getNeteaseToken());
|
userMap.put("neteaseToken", tmpUser.getNeteaseToken());
|
||||||
userMap.put("userType", tmpUser.getUserType());
|
userMap.put("userType", tmpUser.getUserType());
|
||||||
userMap.put("shopsUserId", tmpUser.getShopsUserId());
|
userMap.put("shopsUserId", tmpUser.getShopsUserId());
|
||||||
|
userMap.put("messageNoReadCount", this.pushListDao.pushNoReadCount(tmpUser.getUserId()));
|
||||||
if (tmpUser.getUpdateTime() != null) {
|
if (tmpUser.getUpdateTime() != null) {
|
||||||
userMap.put("updateTime", IfishUtil.format(tmpUser.getUpdateTime()));
|
userMap.put("updateTime", IfishUtil.format(tmpUser.getUpdateTime()));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ public interface Tbl_User_Mapper {
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Select("SELECT user_id,nick_name,user_password,phone_number,user_img,user_sex,signature,login_count,phone_type,update_time,login_time,create_time,login_type,remarks,"
|
@Select("SELECT user_id,nick_name,user_password,phone_number,user_img,user_sex,signature,login_count,phone_type,update_time,login_time,create_time,login_type,remarks,message_no_read_count,"
|
||||||
+ "address,P2PVerify_code1,P2PVerify_code2,gwell_userID,is_register_gwell,user_type,shops_user_id,netease_token,is_register_netease,latitude,longitude from tbl_user where phone_number=#{phoneNumber}")
|
+ "address,P2PVerify_code1,P2PVerify_code2,gwell_userID,is_register_gwell,user_type,shops_user_id,netease_token,is_register_netease,latitude,longitude from tbl_user where phone_number=#{phoneNumber}")
|
||||||
User getUserByPhoneNumber(@Param("phoneNumber") String phoneNumber);
|
User getUserByPhoneNumber(@Param("phoneNumber") String phoneNumber);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.ifish.service;
|
||||||
|
|
||||||
|
import com.ifish.entity.AliyunDeviceInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author: yan.y
|
||||||
|
* @Description:
|
||||||
|
* @Date: Created in 22:29 2019/5/20
|
||||||
|
*/
|
||||||
|
public interface AliyunDeviceInfoService {
|
||||||
|
AliyunDeviceInfo getAliyunDeviceInfo(String deviceId);
|
||||||
|
|
||||||
|
void saveOrUpdateAliyunDeviceInfo(AliyunDeviceInfo aliyunDeviceInfo);
|
||||||
|
}
|
||||||
|
|
@ -137,5 +137,33 @@ public interface BaseService {
|
||||||
|
|
||||||
//发送看护报告给用户
|
//发送看护报告给用户
|
||||||
public Object getLookReportById(Integer reportId);
|
public Object getLookReportById(Integer reportId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取阿里云推送设备信息
|
||||||
|
* @param deviceId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
AliyunDeviceInfo getAliyunDeviceInfo(String deviceId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存或修改阿里云推送设备信息
|
||||||
|
* @param aliyunDeviceInfo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Object saveOrUpdateAliyunDeviceInfo(AliyunDeviceInfo aliyunDeviceInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户消息已读
|
||||||
|
* @param userId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Object userMessageIsRead(Integer userId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询消息未读数
|
||||||
|
* @param userId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Object userMessageNoReadCount(Integer userId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.ifish.service;
|
package com.ifish.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.ifish.dto.ShopsLookUserDto;
|
import com.ifish.dto.ShopsLookUserDto;
|
||||||
import com.ifish.entity.PushList;
|
import com.ifish.entity.PushList;
|
||||||
import com.ifish.hibernate.Pagination;
|
import com.ifish.hibernate.Pagination;
|
||||||
|
|
@ -18,5 +19,6 @@ public interface PageListService {
|
||||||
|
|
||||||
//看护列表
|
//看护列表
|
||||||
public Pagination<ShopsLookUserDto> getLookListByPage(Integer shopsUserId,Integer firstResult,Integer pageSize);
|
public Pagination<ShopsLookUserDto> getLookListByPage(Integer shopsUserId,Integer firstResult,Integer pageSize);
|
||||||
|
|
||||||
|
Object deletePushlist(JSONArray pushIds);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
package com.ifish.serviceImpl;
|
||||||
|
|
||||||
|
import com.ifish.dao.AliyunDeviceInfoDao;
|
||||||
|
import com.ifish.entity.AliyunDeviceInfo;
|
||||||
|
import com.ifish.service.AliyunDeviceInfoService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author: yan.y
|
||||||
|
* @Description:
|
||||||
|
* @Date: Created in 22:29 2019/5/20
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Transactional
|
||||||
|
public class AliyunDeviceInfoServiceImpl implements AliyunDeviceInfoService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AliyunDeviceInfoDao aliyunDeviceInfoDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AliyunDeviceInfo getAliyunDeviceInfo(String deviceId) {
|
||||||
|
AliyunDeviceInfo aliyunDeviceInfo = aliyunDeviceInfoDao.get(deviceId);
|
||||||
|
return aliyunDeviceInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void saveOrUpdateAliyunDeviceInfo(AliyunDeviceInfo aliyunDeviceInfo) {
|
||||||
|
this.aliyunDeviceInfoDao.saveOrUpdate(aliyunDeviceInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,47 +1,30 @@
|
||||||
package com.ifish.serviceImpl;
|
package com.ifish.serviceImpl;
|
||||||
|
|
||||||
import java.io.File;
|
import com.alibaba.fastjson.JSON;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Calendar;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import com.ifish.dao.*;
|
import com.ifish.dao.*;
|
||||||
import com.ifish.entity.*;
|
import com.ifish.entity.*;
|
||||||
|
import com.ifish.enums.*;
|
||||||
|
import com.ifish.gwell.GwellApi;
|
||||||
|
import com.ifish.jpush.SmsNumSend;
|
||||||
|
import com.ifish.mail.Mail;
|
||||||
|
import com.ifish.netease.NeteaseIM;
|
||||||
|
import com.ifish.service.AliyunDeviceInfoService;
|
||||||
|
import com.ifish.service.BaseService;
|
||||||
|
import com.ifish.util.IfishFilePath;
|
||||||
|
import com.ifish.util.IfishUtil;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.hibernate.criterion.Criterion;
|
||||||
import org.hibernate.criterion.Order;
|
import org.hibernate.criterion.Order;
|
||||||
import org.hibernate.criterion.Restrictions;
|
import org.hibernate.criterion.Restrictions;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
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;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import java.io.File;
|
||||||
import com.ifish.enums.BooleanEnum;
|
import java.util.*;
|
||||||
import com.ifish.enums.GwellEnum;
|
|
||||||
import com.ifish.enums.Index1Enum;
|
|
||||||
import com.ifish.enums.Index2Enum;
|
|
||||||
import com.ifish.enums.Index3Enum;
|
|
||||||
import com.ifish.enums.NeteaseEnum;
|
|
||||||
import com.ifish.enums.PushTypeEnum;
|
|
||||||
import com.ifish.enums.ResultEnum;
|
|
||||||
import com.ifish.enums.SendTypeEnum;
|
|
||||||
import com.ifish.enums.ShopsStatusEnum;
|
|
||||||
import com.ifish.enums.SmsSignEnum;
|
|
||||||
import com.ifish.enums.SmsTemplateEnum;
|
|
||||||
import com.ifish.enums.SubDirectoryEnum;
|
|
||||||
import com.ifish.enums.UserTypeEnum;
|
|
||||||
import com.ifish.gwell.GwellApi;
|
|
||||||
import com.ifish.jpush.SmsNumSend;
|
|
||||||
import com.ifish.mail.Mail;
|
|
||||||
import com.ifish.netease.NeteaseIM;
|
|
||||||
import com.ifish.service.BaseService;
|
|
||||||
import com.ifish.util.IfishFilePath;
|
|
||||||
import com.ifish.util.IfishUtil;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName: BaseServiceImpl
|
* @ClassName: BaseServiceImpl
|
||||||
|
|
@ -91,8 +74,10 @@ public class BaseServiceImpl implements BaseService {
|
||||||
private DeviceHeaterDetailDao deviceHeaterDetailDao;
|
private DeviceHeaterDetailDao deviceHeaterDetailDao;
|
||||||
@Autowired
|
@Autowired
|
||||||
private DeviceHeaterDao deviceHeaterDao;
|
private DeviceHeaterDao deviceHeaterDao;
|
||||||
|
@Autowired
|
||||||
|
private AliyunDeviceInfoService aliyunDeviceInfoService;
|
||||||
|
|
||||||
private static final Logger log = Logger.getLogger(BaseServiceImpl.class);
|
private static final Logger log = LoggerFactory.getLogger(BaseServiceImpl.class);
|
||||||
/**
|
/**
|
||||||
* 获取验证码
|
* 获取验证码
|
||||||
*/
|
*/
|
||||||
|
|
@ -1176,7 +1161,6 @@ public class BaseServiceImpl implements BaseService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object setRemindWaterInf(Device device) {
|
public Object setRemindWaterInf(Device device) {
|
||||||
Logger log = Logger.getLogger(BaseServiceImpl.class);
|
|
||||||
log.info("setRemindWaterInf begin");
|
log.info("setRemindWaterInf begin");
|
||||||
Device tmpDevice = this.deviceDao.get(device.getDeviceId());
|
Device tmpDevice = this.deviceDao.get(device.getDeviceId());
|
||||||
if (tmpDevice != null) {
|
if (tmpDevice != null) {
|
||||||
|
|
@ -1686,4 +1670,27 @@ public class BaseServiceImpl implements BaseService {
|
||||||
return IfishUtil.returnJson(ResultEnum.fail101.getKey(), "");
|
return IfishUtil.returnJson(ResultEnum.fail101.getKey(), "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AliyunDeviceInfo getAliyunDeviceInfo(String device) {
|
||||||
|
return this.aliyunDeviceInfoService.getAliyunDeviceInfo(device);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object saveOrUpdateAliyunDeviceInfo(AliyunDeviceInfo aliyunDeviceInfo) {
|
||||||
|
this.aliyunDeviceInfoService.saveOrUpdateAliyunDeviceInfo(aliyunDeviceInfo);
|
||||||
|
return IfishUtil.returnJson(ResultEnum.success.getKey(), "");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object userMessageIsRead(Integer userId) {
|
||||||
|
this.pushListDao.updatePushListIsRead(userId);
|
||||||
|
return IfishUtil.returnJson(ResultEnum.success.getKey(), "");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object userMessageNoReadCount(Integer userId) {
|
||||||
|
Map<String, Object> map = new HashMap<String, Object>();
|
||||||
|
map.put("messageNoReadCount",this.pushListDao.pushNoReadCount(userId));
|
||||||
|
return IfishUtil.returnJson(ResultEnum.success.getKey(), map);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,10 @@
|
||||||
package com.ifish.serviceImpl;
|
package com.ifish.serviceImpl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.ifish.enums.ResultEnum;
|
||||||
|
import com.ifish.util.IfishUtil;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
@ -36,4 +41,13 @@ public class PageListServiceImpl implements PageListService {
|
||||||
return userDao.findByCriteria(shopsUserId, firstResult, pageSize);
|
return userDao.findByCriteria(shopsUserId, firstResult, pageSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object deletePushlist(JSONArray pushIds) {
|
||||||
|
for (Object pushId : pushIds) {
|
||||||
|
JSONObject json = JSONObject.parseObject(String.valueOf(pushId));
|
||||||
|
int id = Integer.parseInt(json.getString("pushId"));
|
||||||
|
pushListDao.delete(pushListDao.get(id));
|
||||||
|
}
|
||||||
|
return IfishUtil.returnJson(ResultEnum.success.getKey(), "");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue