Compare commits
No commits in common. "32545d6cdd592a21849aa3ce09ce7d547d5def2f" and "61bce4c26a3defe256d4c503e9d1605049678a08" have entirely different histories.
32545d6cdd
...
61bce4c26a
|
|
@ -14,8 +14,6 @@ import cn.jpush.api.push.model.PushPayload;
|
|||
import cn.jpush.api.push.model.audience.Audience;
|
||||
import cn.jpush.api.push.model.notification.IosNotification;
|
||||
import cn.jpush.api.push.model.notification.Notification;
|
||||
import com.ifish.util.IfishFilePath;
|
||||
import com.ifish.util.IfishUtil;
|
||||
import java.util.Map;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
|
@ -31,17 +29,10 @@ public class JiGuangPush {
|
|||
// private static final String masterSecret = "60162c8cf195ce9f4dc76629";
|
||||
// private static final String appKey = "d970d5e193cb2a0bbe41653c";
|
||||
//测试
|
||||
private static String masterSecret = "4f759a0609dcd9d2edb06125";
|
||||
private static String appKey = "6e5e9d757570859b3f274bb8";
|
||||
private final static String masterSecret = "4f759a0609dcd9d2edb06125";
|
||||
private final static String appKey = "6e5e9d757570859b3f274bb8";
|
||||
|
||||
static {
|
||||
if (IfishUtil.isOnLine()) {
|
||||
appKey = IfishFilePath.AppKeyFormal;
|
||||
masterSecret = IfishFilePath.MasterSecretFormal;
|
||||
} else {
|
||||
appKey = IfishFilePath.AppKeyFormal;
|
||||
masterSecret = IfishFilePath.MasterSecretFormal;
|
||||
}
|
||||
jPushClient = new JPushClient(masterSecret, appKey);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ public class Tbl_Device implements java.io.Serializable {
|
|||
/**
|
||||
* 版本号
|
||||
*/
|
||||
private static final long serialVersionUID = 204106348073538365L;
|
||||
private static final long serialVersionUID = 3405700970095511149L;
|
||||
|
||||
/**
|
||||
* 设备Id
|
||||
|
|
@ -63,7 +63,7 @@ public class Tbl_Device implements java.io.Serializable {
|
|||
private Date loginTime;
|
||||
|
||||
/**
|
||||
* 是否在黑名单(是否授权):1未授权,在、0已授权,不在
|
||||
* 是否在黑名单:1不在、0在
|
||||
*/
|
||||
@Column(name = "is_blacklist", nullable = true, length = 1)
|
||||
private String isBlacklist;
|
||||
|
|
@ -75,7 +75,7 @@ public class Tbl_Device implements java.io.Serializable {
|
|||
private String hardwareType;
|
||||
|
||||
/**
|
||||
* 是否温度报警
|
||||
* 是否推送
|
||||
*/
|
||||
@Column(name = "on_off", nullable = true, length = 1)
|
||||
private String onOff;
|
||||
|
|
@ -119,7 +119,7 @@ public class Tbl_Device implements java.io.Serializable {
|
|||
/**
|
||||
* 摄像头ID
|
||||
*/
|
||||
@Column(name = "camera_id", unique = true, nullable = true, length = 20)
|
||||
@Column(name = "camera_id", nullable = true, length = 20)
|
||||
private String cameraId;
|
||||
|
||||
/**
|
||||
|
|
@ -255,18 +255,18 @@ public class Tbl_Device implements java.io.Serializable {
|
|||
}
|
||||
|
||||
/**
|
||||
* 获取是否在黑名单(是否授权):1未授权,在、0已授权,不在
|
||||
* 获取是否在黑名单:1不在、0在
|
||||
*
|
||||
* @return 是否在黑名单(是否授权):1未授权
|
||||
* @return 是否在黑名单
|
||||
*/
|
||||
public String getIsBlacklist() {
|
||||
return this.isBlacklist;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否在黑名单(是否授权):1未授权,在、0已授权,不在
|
||||
* 设置是否在黑名单:1不在、0在
|
||||
*
|
||||
* @param isBlacklist 是否在黑名单(是否授权):1未授权,在、0已授权,不在
|
||||
* @param isBlacklist 是否在黑名单:1不在、0在
|
||||
*/
|
||||
public void setIsBlacklist(String isBlacklist) {
|
||||
this.isBlacklist = isBlacklist;
|
||||
|
|
@ -291,18 +291,18 @@ public class Tbl_Device implements java.io.Serializable {
|
|||
}
|
||||
|
||||
/**
|
||||
* 获取是否温度报警
|
||||
* 获取是否推送
|
||||
*
|
||||
* @return 是否温度报警
|
||||
* @return 是否推送
|
||||
*/
|
||||
public String getOnOff() {
|
||||
return this.onOff;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否温度报警
|
||||
* 设置是否推送
|
||||
*
|
||||
* @param onOff 是否温度报警
|
||||
* @param onOff 是否推送
|
||||
*/
|
||||
public void setOnOff(String onOff) {
|
||||
this.onOff = onOff;
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ public class Tbl_Device_User implements java.io.Serializable {
|
|||
/**
|
||||
* 版本号
|
||||
*/
|
||||
private static final long serialVersionUID = 5123379244673522530L;
|
||||
private static final long serialVersionUID = -4018159739383033383L;
|
||||
|
||||
/**
|
||||
* id
|
||||
|
|
@ -36,7 +36,7 @@ public class Tbl_Device_User implements java.io.Serializable {
|
|||
/**
|
||||
* 用户Id
|
||||
*/
|
||||
@Column(name = "user_id", nullable = false, length = 10)
|
||||
@Column(name = "user_id", unique = true, nullable = false, length = 10)
|
||||
private Integer userId;
|
||||
|
||||
/**
|
||||
|
|
@ -93,12 +93,6 @@ public class Tbl_Device_User implements java.io.Serializable {
|
|||
@Column(name = "is_live", nullable = true, length = 1)
|
||||
private String isLive;
|
||||
|
||||
/**
|
||||
* 是否开启离线提醒,1开启,0关闭,默认1
|
||||
*/
|
||||
@Column(name = "off_line", nullable = true, length = 1)
|
||||
private String offLine;
|
||||
|
||||
/**
|
||||
* 获取id
|
||||
*
|
||||
|
|
@ -296,22 +290,4 @@ public class Tbl_Device_User implements java.io.Serializable {
|
|||
public void setIsLive(String isLive) {
|
||||
this.isLive = isLive;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取是否开启离线提醒,1开启,0关闭,默认1
|
||||
*
|
||||
* @return 是否开启离线提醒
|
||||
*/
|
||||
public String getOffLine() {
|
||||
return this.offLine;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否开启离线提醒,1开启,0关闭,默认1
|
||||
*
|
||||
* @param offLine 是否开启离线提醒,1开启,0关闭,默认1
|
||||
*/
|
||||
public void setOffLine(String offLine) {
|
||||
this.offLine = offLine;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ import javax.persistence.Table;
|
|||
*/
|
||||
@Entity
|
||||
@Table(name = "tbl_vender_list")
|
||||
public class Tbl_Vender_List implements java.io.Serializable {
|
||||
public class Tbl_Vender implements java.io.Serializable {
|
||||
|
||||
/**
|
||||
* 版本号
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
package com.ifish.config;
|
||||
|
||||
import com.ifish.util.IfishUtil;
|
||||
import com.ifish.util.IfishFilePath;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
|
|
@ -26,7 +26,7 @@ public class RedisConfig {
|
|||
|
||||
// //获取当前操作系统(servers_os为服务器设置的属性JAVA_OPTS=%JAVA_OPTS% -Dservers_os=online84)
|
||||
// String servers_os = System.getProperty("servers_os") == null ? "" : System.getProperty("servers_os");
|
||||
if (IfishUtil.isOnLine()) {
|
||||
if (IfishFilePath.link_img_head.contains("ifish7")) {
|
||||
//站点线上服务器
|
||||
cf.setHostName("120.55.190.56");
|
||||
cf.setPort(3796);
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ import com.ifish.util.IfishFilePath;
|
|||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
|
||||
import org.springframework.web.servlet.ViewResolver;
|
||||
import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
|
||||
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import com.ifish.bean.Tbl_User;
|
|||
import com.ifish.enums.ResultEnum;
|
||||
import com.ifish.helper.DeviceHelperI;
|
||||
import com.ifish.util.IfishUtil;
|
||||
import java.util.Date;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
|
@ -44,18 +43,6 @@ public class Device {
|
|||
return IfishUtil.returnJson(ResultEnum.fail101.getKey(), "");
|
||||
}
|
||||
|
||||
/**
|
||||
* 分享设备
|
||||
*
|
||||
* @param userId
|
||||
* @param macAddress
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/shareDevice", method = RequestMethod.POST)
|
||||
public Object shareDevice(Integer userId, Integer deviceId) {
|
||||
return deviceHelperI.shareDevice(userId, deviceId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定摄像头
|
||||
*
|
||||
|
|
@ -152,42 +139,4 @@ public class Device {
|
|||
}
|
||||
return IfishUtil.returnJson(ResultEnum.fail101.getKey(), "");
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否接收离线通知
|
||||
*
|
||||
* @param macAddress
|
||||
* @param offLive
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"/updateDeviceOffLive"}, method = RequestMethod.POST)
|
||||
public Object updateDeviceOffLive(Integer userId, Integer deviceId, String offLive) {
|
||||
return deviceHelperI.updateDeviceOffLive(userId, deviceId, offLive);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置换水提醒
|
||||
*
|
||||
* @param macAddress 设备mac
|
||||
* @param todayRemind 今天是否提醒
|
||||
* @param waterRemind 是否开启换水提醒
|
||||
* @param remindDate 换水提醒日期
|
||||
* @param remindCycle 换水提醒周期
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"/updateDeviceRemind"}, method = RequestMethod.POST)
|
||||
public Object updateDeviceRemind(Integer deviceId, String waterRemind, Integer remindCycle) {
|
||||
return deviceHelperI.updateDeviceRemind(deviceId, waterRemind, remindCycle);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据设备ID获取设备换水提醒
|
||||
*
|
||||
* @param deviceId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"/getDeviceRemind"}, method = RequestMethod.GET)
|
||||
public Object getDeviceRemind(Integer deviceId) {
|
||||
return deviceHelperI.getDeviceRemind(deviceId);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -155,27 +155,12 @@ public class LiveRoom {
|
|||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/liveRoom/v3/updateLiveRoom.do", method = RequestMethod.POST)
|
||||
public Object updateLiveRoom(Tbl_Live_Room liveRoom) {
|
||||
try {
|
||||
return liveRoomHelperI.updateLiveRoom(liveRoom);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
return IfishUtil.returnJson(ResultEnum.fail101.getKey(), "");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改直播间展示图片
|
||||
*
|
||||
* @param fileUpload
|
||||
* @param liveRoom
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/liveRoom/v3/updateLiveRoomImg.do", method = RequestMethod.POST)
|
||||
public Object updateLiveRoomImg(MultipartFile fileUpload, Tbl_Live_Room liveRoom) {
|
||||
public Object updateLiveRoom(MultipartFile fileUpload, Tbl_Live_Room liveRoom) {
|
||||
try {
|
||||
return liveRoomHelperI.updateLiveRoom(fileUpload, liveRoom);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
return IfishUtil.returnJson(ResultEnum.fail101.getKey(), "");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -146,9 +146,4 @@ public class Login {
|
|||
public Object forgetPasswordByMobile(String phoneNumber, String password) {
|
||||
return userHelperI.forgetPassword(phoneNumber, password);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/IsRegisterJPush", method = RequestMethod.POST)
|
||||
public Object IsRegisterJPush(String userId) {
|
||||
return userHelperI.IsRegisterJPush(userId);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,26 @@
|
|||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.ifish.enums;
|
||||
|
||||
/**
|
||||
* 推送消息类型
|
||||
*
|
||||
* @author Administrator
|
||||
*/
|
||||
public enum PushTypeEnum {
|
||||
remove_device("remove_device", "OUT OF CONTROL"),//解绑通知
|
||||
wendu_warn("wendu_warn", "TEMPERTURE WARNING"),//温度预警
|
||||
remove_device("remove_device", "解绑通知"),
|
||||
wendu_warn("wendu_warn", "温度预警"),
|
||||
qu_reply("qu_reply", "问题反馈"),
|
||||
app_update("app_update", "UPDATE NOTICE"),//IOS更新推送
|
||||
remind_water("remind_water", "WATER CHANGE NOTIEC"),//换水提醒
|
||||
offline_push("offline_push", "OFF-LINE NOTICE"),//离线通知
|
||||
app_update("app_update", "IOS更新推送"),
|
||||
remind_water("remind_water", "换水提醒"),
|
||||
offline_push("offline_push", "离线通知"),
|
||||
send_report("send_report", "看护报告"),
|
||||
shops_push("shops_push", "看护通知"),
|
||||
all_push("all_push", "所有用户推送"),
|
||||
pinglun_push("pinglun_push", "直播间评论");
|
||||
pinglun_push("pinglun_push","直播间评论");
|
||||
|
||||
private PushTypeEnum(String key, String value) {
|
||||
this.key = key;
|
||||
|
|
@ -20,6 +30,16 @@ public enum PushTypeEnum {
|
|||
private String key;
|
||||
private String value;
|
||||
|
||||
//普通方法
|
||||
public static String getValue(String key) {
|
||||
for (PushTypeEnum c : PushTypeEnum.values()) {
|
||||
if (c.getKey().equals(key)) {
|
||||
return c.getValue();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ import com.ifish.enums.PushTypeEnum;
|
|||
import com.ifish.enums.ResultEnum;
|
||||
import com.ifish.mapper.Tbl_Device_Mapper;
|
||||
import com.ifish.util.IfishUtil;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
|
@ -31,22 +30,19 @@ import org.springframework.stereotype.Component;
|
|||
*/
|
||||
@Component
|
||||
public class DeviceHelper implements DeviceHelperI {
|
||||
|
||||
|
||||
@Autowired
|
||||
private RedisHelperI redisHelperI;
|
||||
|
||||
|
||||
@Autowired
|
||||
private RedisKeyHelperI redisKeyHelperI;
|
||||
|
||||
|
||||
@Autowired
|
||||
private Tbl_Device_Mapper tbl_Device_Mapper;
|
||||
|
||||
|
||||
@Autowired
|
||||
private UserHelperI userHelperI;
|
||||
|
||||
@Autowired
|
||||
private LiveRoomHelperI liveRoomHelperI;
|
||||
|
||||
/**
|
||||
* 根据用户Id获取绑定设备集合
|
||||
*
|
||||
|
|
@ -185,7 +181,6 @@ public class DeviceHelper implements DeviceHelperI {
|
|||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public Tbl_Device_Statistics getDeviceStatisticsByDeviceId(Integer deviceId) throws Exception {
|
||||
Tbl_Device_Statistics device = null;
|
||||
String key = redisKeyHelperI.getTbl_Device_StatisticsRedisKeyByDeviceId(deviceId);
|
||||
|
|
@ -201,29 +196,6 @@ public class DeviceHelper implements DeviceHelperI {
|
|||
return device;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据设备ID获取设备统计信息
|
||||
*
|
||||
* @param deviceId
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public Tbl_Device_Statistics getDeviceStatisticsByMacAddress(String mackAddress) throws Exception {
|
||||
Tbl_Device_Statistics device = null;
|
||||
String key = redisKeyHelperI.getTbl_Device_StatisticsRedisKeyByMacAddress(mackAddress);
|
||||
String redisString = redisHelperI.getRedis(key);
|
||||
if (StringUtils.isNotBlank(redisString)) {
|
||||
device = (Tbl_Device_Statistics) IfishUtil.JsonToBean(redisString, Tbl_Device_Statistics.class);
|
||||
} else {
|
||||
device = tbl_Device_Mapper.getDevStatisticsByMacAddress(mackAddress);
|
||||
if (device != null && device.getDeviceId() > 0) {
|
||||
redisHelperI.setRedis(key, IfishUtil.ObjectToJson(device));
|
||||
}
|
||||
}
|
||||
return device;
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定设备
|
||||
*
|
||||
|
|
@ -234,7 +206,7 @@ public class DeviceHelper implements DeviceHelperI {
|
|||
*/
|
||||
@Override
|
||||
public Object bindDevice(Integer userId, String mackAddress) {
|
||||
|
||||
|
||||
try {
|
||||
Tbl_User tmpUser = userHelperI.getUserById(userId);
|
||||
//用户存在
|
||||
|
|
@ -256,7 +228,7 @@ public class DeviceHelper implements DeviceHelperI {
|
|||
if (tmpDdeviceUser != null) {
|
||||
//原先不是主控制,则删除其他用户关联关系
|
||||
if (!tmpDdeviceUser.getIsMaster().equals("1")) {
|
||||
|
||||
|
||||
for (Tbl_Device_User du : deviceUserList) {
|
||||
Integer userid = du.getUserId();
|
||||
Integer deviceId = du.getDeviceId();
|
||||
|
|
@ -266,7 +238,7 @@ public class DeviceHelper implements DeviceHelperI {
|
|||
//基本参数
|
||||
Map<String, String> baseMap = new HashMap<String, String>();
|
||||
baseMap.put("title", PushTypeEnum.remove_device.getValue());
|
||||
baseMap.put("content", "Your aquarium “" + du.getShowName() + "” is out of control at " + timestamp + "!");
|
||||
baseMap.put("content", "你已于" + timestamp + "失去对“" + du.getShowName() + "”设备的控制权");
|
||||
baseMap.put("user_id", tu.getUserId().toString());
|
||||
baseMap.put("loginType", tu.getLoginType());
|
||||
//推送参数
|
||||
|
|
@ -303,7 +275,7 @@ public class DeviceHelper implements DeviceHelperI {
|
|||
//基本参数
|
||||
Map<String, String> baseMap = new HashMap<String, String>();
|
||||
baseMap.put("title", PushTypeEnum.remove_device.getValue());
|
||||
baseMap.put("content", "Your aquarium “" + du.getShowName() + "” is out of control at " + timestamp + "!");
|
||||
baseMap.put("content", "你已于" + timestamp + "失去对“" + du.getShowName() + "”设备的控制权");
|
||||
baseMap.put("user_id", tu.getUserId().toString());
|
||||
baseMap.put("loginType", tu.getLoginType());
|
||||
//推送参数
|
||||
|
|
@ -338,11 +310,9 @@ public class DeviceHelper implements DeviceHelperI {
|
|||
tbl_Device_Mapper.insertDeviceStatistics(ds);
|
||||
} else {
|
||||
//修改设备统计信息
|
||||
if (ds.getFirstActivate() == null) {
|
||||
ds.setFirstActivate(new Date());
|
||||
tbl_Device_Mapper.updateDeviceStatistics(ds);
|
||||
redisKeyHelperI.deleteRedisByTbl_Device_Statistics(ds);
|
||||
}
|
||||
ds.setFirstActivate(new Date());
|
||||
tbl_Device_Mapper.updateDeviceStatistics(ds);
|
||||
redisKeyHelperI.deleteRedisByTbl_Device_Statistics(ds);
|
||||
}
|
||||
}
|
||||
} //设备不存在
|
||||
|
|
@ -371,7 +341,7 @@ public class DeviceHelper implements DeviceHelperI {
|
|||
//需要新增
|
||||
if (bln) {
|
||||
//新增关联关系
|
||||
deviceUser.setShowName("Aquarium" + (int) (Math.random() * 9000 + 1000));
|
||||
deviceUser.setShowName("鱼缸" + (int) (Math.random() * 9000 + 1000));
|
||||
deviceUser.setIsMaster("1");
|
||||
Date date = new Date();
|
||||
deviceUser.setUpdateTime(date);
|
||||
|
|
@ -388,48 +358,6 @@ public class DeviceHelper implements DeviceHelperI {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 分享设备
|
||||
*
|
||||
* @param userId
|
||||
* @param macAddress
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Object shareDevice(Integer userId, Integer deviceId) {
|
||||
try {
|
||||
Tbl_User user = userHelperI.getUserById(userId);
|
||||
if (user == null) {
|
||||
return IfishUtil.returnJson(ResultEnum.error401.getKey(), "");
|
||||
}
|
||||
Tbl_Device device = getDeviceById(deviceId);
|
||||
if (device == null) {
|
||||
return IfishUtil.returnJson(ResultEnum.error401.getKey(), "");
|
||||
}
|
||||
Tbl_Device_User tbl_Device_User = getDeviceUserByUserId_DeviceId(userId, device.getDeviceId());
|
||||
if (tbl_Device_User != null) {
|
||||
//封装设备返回信息
|
||||
return IfishUtil.returnJson(ResultEnum.success.getKey(), userHelperI.getDeviceInfo(device, tbl_Device_User));
|
||||
} else {
|
||||
tbl_Device_User = new Tbl_Device_User();
|
||||
tbl_Device_User.setDeviceId(device.getDeviceId());
|
||||
tbl_Device_User.setOffLine("1");
|
||||
tbl_Device_User.setUserId(userId);
|
||||
tbl_Device_User.setShowName("Aquarium" + (int) (Math.random() * 9000 + 1000));
|
||||
tbl_Device_User.setIsMaster("0");
|
||||
Date date = new Date();
|
||||
tbl_Device_User.setCreateTime(date);
|
||||
int i = tbl_Device_Mapper.insertDeviceUser(tbl_Device_User);
|
||||
if (i > 0) {
|
||||
//封装设备返回信息
|
||||
return IfishUtil.returnJson(ResultEnum.success.getKey(), userHelperI.getDeviceInfo(device, tbl_Device_User));
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
return IfishUtil.returnJson(ResultEnum.fail101.getKey(), "");
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定摄像头
|
||||
*
|
||||
|
|
@ -473,7 +401,6 @@ public class DeviceHelper implements DeviceHelperI {
|
|||
device_User.setShowName("摄像头" + (int) (Math.random() * 900 + 100));
|
||||
device_User.setCreateTime(new Date());
|
||||
tbl_Device_Mapper.insertDeviceUser(device_User);
|
||||
redisKeyHelperI.deleteRedisByTbl_Device_User(device_User);
|
||||
//返回数据
|
||||
dataMap.put("cameraId", cameraId);
|
||||
dataMap.put("showName", device_User.getShowName());
|
||||
|
|
@ -511,7 +438,7 @@ public class DeviceHelper implements DeviceHelperI {
|
|||
camera.setActiveTime(date);
|
||||
camera.setUpdateTime(date);
|
||||
int i = tbl_Device_Mapper.updateTbl_Device(camera);
|
||||
|
||||
|
||||
activa_Code.setIsUsed("1");
|
||||
tbl_Device_Mapper.updateTblActivaCodeIsUse(activeCode);
|
||||
return IfishUtil.returnJson(ResultEnum.success.getKey(), "");
|
||||
|
|
@ -537,10 +464,10 @@ public class DeviceHelper implements DeviceHelperI {
|
|||
*/
|
||||
@Override
|
||||
public Object updateDeviceUser(Tbl_Device_User device) {
|
||||
|
||||
|
||||
try {
|
||||
Tbl_Device_User olDevice_User = getDeviceUserByUserId_DeviceId(device.getUserId(), device.getDeviceId());
|
||||
|
||||
|
||||
if (device != null) {
|
||||
if (olDevice_User != null) {
|
||||
device.setId(olDevice_User.getId());
|
||||
|
|
@ -573,7 +500,7 @@ public class DeviceHelper implements DeviceHelperI {
|
|||
Tbl_Device_User olDevice_User = getDeviceUserByUserId_CameraId(device_User.getUserId(), cameraId.toString());
|
||||
if (olDevice_User != null) {
|
||||
if (olDevice_User != null) {
|
||||
|
||||
|
||||
device_User.setId(olDevice_User.getId());
|
||||
int i = tbl_Device_Mapper.updateTblDeviceUser(device_User);
|
||||
if (i > 0) {
|
||||
|
|
@ -637,9 +564,6 @@ public class DeviceHelper implements DeviceHelperI {
|
|||
Tbl_Device device = getDeviceByCameraId(cameraId);
|
||||
redisKeyHelperI.deleteRedisByTbl_Device(device);
|
||||
redisKeyHelperI.deleteRedisByTbl_Device_User(device_User);
|
||||
//删除此摄像头的直播间信息
|
||||
liveRoomHelperI.deleteLiveRoom(cameraId);
|
||||
|
||||
return IfishUtil.returnJson(ResultEnum.success.getKey(), "");
|
||||
}
|
||||
}
|
||||
|
|
@ -647,10 +571,10 @@ public class DeviceHelper implements DeviceHelperI {
|
|||
}
|
||||
return IfishUtil.returnJson(ResultEnum.fail101.getKey(), "");
|
||||
}
|
||||
|
||||
|
||||
@Autowired
|
||||
private JiGuangPush jiGuangPush;
|
||||
|
||||
|
||||
@Autowired
|
||||
private PushMessageHelperI pushMessageHelperI;
|
||||
|
||||
|
|
@ -681,7 +605,7 @@ public class DeviceHelper implements DeviceHelperI {
|
|||
pushList.setUserId(Integer.valueOf(userId));
|
||||
pushList.setDeviceId(Integer.valueOf(pushMap.get("device_id")));
|
||||
pushList.setPhoneType(loginType);
|
||||
pushList.setShowName(pushMap.get("device_name"));
|
||||
pushList.setShowName(pushMap.get("showName"));
|
||||
pushList.setPushType(msgType);
|
||||
pushList.setPushTitle(title);
|
||||
pushList.setPushContext(content);
|
||||
|
|
@ -712,101 +636,4 @@ public class DeviceHelper implements DeviceHelperI {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置设备是否开启离线提醒
|
||||
*
|
||||
* @param macAddress
|
||||
* @param offLive
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Object updateDeviceOffLive(Integer userId, Integer deviceId, String offLive) {
|
||||
try {
|
||||
|
||||
Tbl_Device_User device_User = getDeviceUserByUserId_DeviceId(userId, deviceId);
|
||||
if (device_User != null) {
|
||||
Tbl_Device_User tbl_Device_User = new Tbl_Device_User();
|
||||
tbl_Device_User.setId(device_User.getId());
|
||||
tbl_Device_User.setOffLine(offLive);
|
||||
int i = tbl_Device_Mapper.updateTblDeviceUser(tbl_Device_User);
|
||||
if (i > 0) {
|
||||
tbl_Device_User.setUserId(userId);
|
||||
tbl_Device_User.setDeviceId(deviceId);
|
||||
redisKeyHelperI.deleteRedisByTbl_Device_User(tbl_Device_User);
|
||||
return IfishUtil.toJson(ResultEnum.success.getKey(), "");
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
return IfishUtil.toJson(ResultEnum.fail101.getKey(), "");
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置换水提醒
|
||||
*
|
||||
* @param macAddress
|
||||
* @param todayRemind
|
||||
* @param waterRemind
|
||||
* @param remindDate
|
||||
* @param remindCycle
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Object updateDeviceRemind(Integer deviceId, String waterRemind, Integer remindCycle) {
|
||||
try {
|
||||
Tbl_Device device = getDeviceById(deviceId);
|
||||
if (device != null) {
|
||||
Tbl_Device tbl_Device = new Tbl_Device();
|
||||
tbl_Device.setDeviceId(device.getDeviceId());
|
||||
if (remindCycle > 0) {
|
||||
tbl_Device.setRemindCycle(remindCycle);
|
||||
}
|
||||
if (StringUtils.isNotBlank(waterRemind)) {
|
||||
tbl_Device.setWaterRemind(waterRemind);
|
||||
}
|
||||
tbl_Device.setTodayRemind("0");
|
||||
//下一次提醒日期
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.add(Calendar.DATE, device.getRemindCycle());
|
||||
tbl_Device.setRemindDate(calendar.getTime());
|
||||
|
||||
int i = tbl_Device_Mapper.updateTbl_Device(tbl_Device);
|
||||
if (i > 0) {
|
||||
redisKeyHelperI.deleteRedisByTbl_Device(device);
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("todayRemind", tbl_Device.getTodayRemind());
|
||||
map.put("waterRemind", tbl_Device.getWaterRemind());
|
||||
map.put("remindDate", IfishUtil.format1(tbl_Device.getRemindDate()));
|
||||
map.put("remindCycle", tbl_Device.getRemindCycle());
|
||||
return IfishUtil.returnJson(ResultEnum.success.getKey(), map);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
return IfishUtil.toJson(ResultEnum.fail101.getKey(), "");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取换水提醒
|
||||
*
|
||||
* @param deviceId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Object getDeviceRemind(Integer deviceId) {
|
||||
try {
|
||||
Tbl_Device tbl_Device = getDeviceById(deviceId);
|
||||
if (tbl_Device != null) {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("todayRemind", tbl_Device.getTodayRemind());
|
||||
map.put("waterRemind", tbl_Device.getWaterRemind());
|
||||
map.put("remindDate", IfishUtil.format1(tbl_Device.getRemindDate()));
|
||||
map.put("remindCycle", tbl_Device.getRemindCycle());
|
||||
return IfishUtil.returnJson(ResultEnum.success.getKey(), map);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
return IfishUtil.toJson(ResultEnum.fail101.getKey(), "");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,10 +6,8 @@
|
|||
package com.ifish.helper;
|
||||
|
||||
import com.ifish.bean.Tbl_Device;
|
||||
import com.ifish.bean.Tbl_Device_Statistics;
|
||||
import com.ifish.bean.Tbl_Device_User;
|
||||
import com.ifish.bean.Tbl_User;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -34,24 +32,6 @@ public interface DeviceHelperI {
|
|||
*/
|
||||
Tbl_Device_User getDeviceUserByUserId_CameraId(Integer userId, String cameraId) throws Exception;
|
||||
|
||||
/**
|
||||
* 根据设备ID获取设备统计信息
|
||||
*
|
||||
* @param deviceId
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public Tbl_Device_Statistics getDeviceStatisticsByDeviceId(Integer deviceId) throws Exception;
|
||||
|
||||
/**
|
||||
* 根据设备ID获取设备统计信息
|
||||
*
|
||||
* @param deviceId
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public Tbl_Device_Statistics getDeviceStatisticsByMacAddress(String macAddress) throws Exception;
|
||||
|
||||
/**
|
||||
* 根据设备Id获取设备详情
|
||||
*
|
||||
|
|
@ -71,14 +51,6 @@ public interface DeviceHelperI {
|
|||
*/
|
||||
Tbl_Device getDeviceByMacAddress(String macAddress) throws Exception;
|
||||
|
||||
/**
|
||||
* 根据摄像头ID获取设备信息
|
||||
*
|
||||
* @param cameraId
|
||||
* @return
|
||||
*/
|
||||
Tbl_Device getDeviceByCameraId(String cameraId) throws Exception;
|
||||
|
||||
/**
|
||||
* 绑定设备
|
||||
*
|
||||
|
|
@ -88,15 +60,6 @@ public interface DeviceHelperI {
|
|||
*/
|
||||
Object bindDevice(Integer userId, String mackAddress);
|
||||
|
||||
/**
|
||||
* 分享设备
|
||||
*
|
||||
* @param userId
|
||||
* @param macAddress
|
||||
* @return
|
||||
*/
|
||||
public Object shareDevice(Integer userId, Integer deviceId);
|
||||
|
||||
/**
|
||||
* 激活摄像头
|
||||
*
|
||||
|
|
@ -115,6 +78,14 @@ public interface DeviceHelperI {
|
|||
*/
|
||||
Object bindCamera(Integer userId, String cameraId);
|
||||
|
||||
/**
|
||||
* 根据摄像头ID获取设备信息
|
||||
*
|
||||
* @param cameraId
|
||||
* @return
|
||||
*/
|
||||
Tbl_Device getDeviceByCameraId(String cameraId) throws Exception;
|
||||
|
||||
/**
|
||||
* 修改设备信息
|
||||
*
|
||||
|
|
@ -150,32 +121,4 @@ public interface DeviceHelperI {
|
|||
*/
|
||||
Object deleteDeviceUser(Tbl_Device_User deviceUser);
|
||||
|
||||
/**
|
||||
* 设置设备是否开启离线提醒
|
||||
*
|
||||
* @param macAddress
|
||||
* @param offLive
|
||||
* @return
|
||||
*/
|
||||
public Object updateDeviceOffLive(Integer userId, Integer deviceId, String offLive);
|
||||
|
||||
/**
|
||||
* 设置换水提醒
|
||||
*
|
||||
* @param macAddress
|
||||
* @param todayRemind
|
||||
* @param waterRemind
|
||||
* @param remindDate
|
||||
* @param remindCycle
|
||||
* @return
|
||||
*/
|
||||
public Object updateDeviceRemind(Integer deviceId, String waterRemind, Integer remindCycle);
|
||||
|
||||
/**
|
||||
* 获取换水提醒
|
||||
*
|
||||
* @param deviceId
|
||||
* @return
|
||||
*/
|
||||
public Object getDeviceRemind(Integer deviceId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ public class FastDFSClient implements FastDFSClientI {
|
|||
//获取classpath路径下配置文件"fdfs_client.conf"的路径
|
||||
//conf直接写相对于classpath的位置,不需要写classpath:
|
||||
String conf = "";
|
||||
if (IfishUtil.isOnLine()) {
|
||||
if (IfishFilePath.link_img_head.contains("ifish7")) {
|
||||
conf = "fdfs_client_ifish7.conf";
|
||||
} else {
|
||||
conf = "fdfs_client_zhangxinyanv5.conf";
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
package com.ifish.helper;
|
||||
|
||||
import com.ifish.bean.Tbl_HardWare_Type;
|
||||
import com.ifish.bean.Tbl_Vender_List;
|
||||
import com.ifish.bean.Tbl_Vender;
|
||||
import com.ifish.mapper.Tbl_Hardware_Type_Mapper;
|
||||
import com.ifish.util.IfishUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
|
@ -35,12 +35,6 @@ public class HardWareTypeHelper implements HardWareTypeHelperI {
|
|||
@Autowired
|
||||
private RedisKeyHelperI redisKeyHelperI;
|
||||
|
||||
/**
|
||||
* 根据设备型号获取设备类型参数
|
||||
*
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Tbl_HardWare_Type getHardwareTypeByTypeCode(String code) throws Exception {
|
||||
Tbl_HardWare_Type hardwareType = null;
|
||||
|
|
@ -57,45 +51,17 @@ public class HardWareTypeHelper implements HardWareTypeHelperI {
|
|||
return hardwareType;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据厂家code获取厂家信息
|
||||
*
|
||||
* @param code
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public Tbl_Vender_List getVenderListByBrandCode(String code) throws Exception {
|
||||
Tbl_Vender_List venderList = new Tbl_Vender_List();
|
||||
public Tbl_Vender getVenderListByBrandCode(String code) throws Exception {
|
||||
Tbl_Vender venderList = new Tbl_Vender();
|
||||
String key = redisKeyHelperI.getTbl_Vender_ListRedisKeyByCode(code);
|
||||
String redisString = redisHelperI.getRedis(key);
|
||||
if (StringUtils.isNotBlank(redisString)) {
|
||||
venderList = (Tbl_Vender_List) IfishUtil.JsonToBean(redisString, Tbl_Vender_List.class);
|
||||
venderList = (Tbl_Vender) IfishUtil.JsonToBean(redisString, Tbl_Vender.class);
|
||||
} else {
|
||||
venderList = tbl_Hardware_Type_Mapper.getVenderListByBrandCode(code);
|
||||
redisHelperI.setRedis(key, IfishUtil.ObjectToJson(venderList));
|
||||
}
|
||||
return venderList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据设备型号获取厂家信息
|
||||
*
|
||||
* @param code
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public Tbl_Vender_List getVenderListByHardwareTypeCode(String code) throws Exception {
|
||||
Tbl_Vender_List venderList = new Tbl_Vender_List();
|
||||
String key = redisKeyHelperI.getTbl_Vender_ListRedisKeyByCode(code);
|
||||
String redisString = redisHelperI.getRedis(key);
|
||||
if (StringUtils.isNotBlank(redisString)) {
|
||||
venderList = (Tbl_Vender_List) IfishUtil.JsonToBean(redisString, Tbl_Vender_List.class);
|
||||
} else {
|
||||
venderList = tbl_Hardware_Type_Mapper.getVenderListByHardwareTypeCode(code);
|
||||
redisHelperI.setRedis(key, IfishUtil.ObjectToJson(venderList));
|
||||
}
|
||||
return venderList;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
package com.ifish.helper;
|
||||
|
||||
import com.ifish.bean.Tbl_HardWare_Type;
|
||||
import com.ifish.bean.Tbl_Vender_List;
|
||||
import com.ifish.bean.Tbl_Vender;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -29,15 +29,6 @@ public interface HardWareTypeHelperI {
|
|||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
Tbl_Vender_List getVenderListByBrandCode(String code) throws Exception;
|
||||
|
||||
/**
|
||||
* 根据设备型号获取厂家信息
|
||||
*
|
||||
* @param code
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public Tbl_Vender_List getVenderListByHardwareTypeCode(String code) throws Exception;
|
||||
Tbl_Vender getVenderListByBrandCode(String code) throws Exception;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,15 +69,6 @@ public class LiveRoomHelper implements LiveRoomHelperI {
|
|||
@Override
|
||||
public Object addLiveRoom(MultipartFile fileUpload, Tbl_Live_Room liveRoom) {
|
||||
try {
|
||||
if (StringUtils.isNotBlank(liveRoom.getRoomName())) {
|
||||
String roomName = new String(liveRoom.getRoomName().getBytes("iso-8859-1"), "UTF-8");
|
||||
liveRoom.setRoomName(roomName);
|
||||
}
|
||||
if (StringUtils.isNotBlank(liveRoom.getRoomDesc())) {
|
||||
String roomDesc = new String(liveRoom.getRoomDesc().getBytes("iso-8859-1"), "UTF-8");
|
||||
liveRoom.setRoomDesc(roomDesc);
|
||||
}
|
||||
|
||||
if (liveRoom.getUserId() == null || liveRoom.getUserId() <= 0) {
|
||||
throw new IfishException(ResultEnum.error401);
|
||||
}
|
||||
|
|
@ -120,7 +111,6 @@ public class LiveRoomHelper implements LiveRoomHelperI {
|
|||
cameraUser.setIsLive("1");
|
||||
cameraChange = true;
|
||||
}
|
||||
|
||||
//新增直播间
|
||||
liveRoom.setCreateTime(new Date());
|
||||
liveRoom.setPopularityValue(0);
|
||||
|
|
@ -130,17 +120,11 @@ public class LiveRoomHelper implements LiveRoomHelperI {
|
|||
deviceHelperI.updateDeviceUser(cameraUser);
|
||||
}
|
||||
redisKeyHelperI.deleteRedisByTbl_Live_Room(liveRoom);
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
Map map = new HashMap();
|
||||
map.put("cameraId", cameraId);
|
||||
map.put("isLive", cameraUser.getIsLive());
|
||||
map.put("roomId", liveRoom.getRoomId());
|
||||
map.put("userId", liveRoom.getUserId());
|
||||
map.put("cameraId", liveRoom.getCameraId());
|
||||
map.put("roomName", liveRoom.getRoomName());
|
||||
map.put("roomDesc", liveRoom.getRoomDesc());
|
||||
map.put("popularityValue", liveRoom.getPopularityValue());
|
||||
map.put("roomStatus", liveRoom.getRoomStatus());
|
||||
map.put("roomImg", liveRoom.getRoomImg());
|
||||
map.put("createTime", liveRoom.getCreateTime());
|
||||
map.put("zanNum", liveRoom.getZanNum());
|
||||
return IfishUtil.returnJson(ResultEnum.success.getKey(), map);
|
||||
}
|
||||
return IfishUtil.returnJson(ResultEnum.fail101.getKey(), "");
|
||||
|
|
@ -281,10 +265,9 @@ public class LiveRoomHelper implements LiveRoomHelperI {
|
|||
if (i > 0) {
|
||||
liveMessage.setUserName(user.getNickName());
|
||||
liveMessage.setUserImg(user.getUserImg());
|
||||
redisKeyHelperI.deleteRedisByTbl_Live_Message(liveMessage);
|
||||
}
|
||||
liveMessage.setUserImg(user.getUserImg());
|
||||
liveMessage.setUserName(user.getNickName());
|
||||
liveMessage.setUserImg(user.getUserImg());
|
||||
Integer asUserId = liveMessage.getAsUserId();
|
||||
if (asUserId != null) {
|
||||
Tbl_User asUser = userHelperI.getUserById(asUserId);
|
||||
|
|
@ -363,21 +346,7 @@ public class LiveRoomHelper implements LiveRoomHelperI {
|
|||
redisHelperI.setRedis(key, IfishUtil.ObjectToJson(list));
|
||||
}
|
||||
}
|
||||
key = redisKeyHelperI.getTbl_Live_MessageCount(roomId);
|
||||
redisString = redisHelperI.getRedis(key);
|
||||
Integer count = 0;
|
||||
if (StringUtils.isNotBlank(redisString)) {
|
||||
count = Integer.parseInt(redisString);
|
||||
} else {
|
||||
count = tbl_Live_Room_Mapper.getLive_MessagesCountByRoomId(roomId);
|
||||
if (count > 0) {
|
||||
redisHelperI.setRedis(key, count.toString());
|
||||
}
|
||||
}
|
||||
PageResult<Map> page = new PageResult<Map>();
|
||||
page.setList(list);
|
||||
page.setTotalCount(count);
|
||||
return IfishUtil.returnPageData(page, ResultEnum.success.getKey());
|
||||
return IfishUtil.toJson(ResultEnum.success.getKey(), list);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
return IfishUtil.toJson(ResultEnum.fail101.getKey(), "");
|
||||
|
|
@ -396,10 +365,8 @@ public class LiveRoomHelper implements LiveRoomHelperI {
|
|||
//查找直播间信息
|
||||
Tbl_Live_Room curLiveRoom = getTbl_Live_RoomByRoomId(roomId);
|
||||
if (curLiveRoom != null) {
|
||||
Tbl_User user = userHelperI.getUserById(curLiveRoom.getUserId());
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("roomId", roomId);
|
||||
map.put("userImg", user.getUserImg());
|
||||
map.put("userId", curLiveRoom.getUserId());
|
||||
map.put("cameraId", curLiveRoom.getCameraId());
|
||||
map.put("roomName", curLiveRoom.getRoomName());
|
||||
|
|
@ -431,10 +398,8 @@ public class LiveRoomHelper implements LiveRoomHelperI {
|
|||
//查找直播间信息
|
||||
Tbl_Live_Room curLiveRoom = getTbl_Live_RoomByCameraId(cameraId);
|
||||
if (curLiveRoom != null) {
|
||||
Tbl_User user = userHelperI.getUserById(curLiveRoom.getUserId());
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("roomId", curLiveRoom.getRoomId());
|
||||
map.put("userImg", user.getUserImg());
|
||||
map.put("cameraId", curLiveRoom.getCameraId());
|
||||
map.put("userId", curLiveRoom.getUserId());
|
||||
map.put("roomName", curLiveRoom.getRoomName());
|
||||
|
|
@ -514,44 +479,12 @@ public class LiveRoomHelper implements LiveRoomHelperI {
|
|||
public Object updateLiveRoom(MultipartFile fileUpload, Tbl_Live_Room liveRoom) {
|
||||
|
||||
try {
|
||||
if (StringUtils.isNotBlank(liveRoom.getRoomName())) {
|
||||
String roomName = new String(liveRoom.getRoomName().getBytes("iso-8859-1"), "UTF-8");
|
||||
liveRoom.setRoomName(roomName);
|
||||
}
|
||||
if (StringUtils.isNotBlank(liveRoom.getRoomDesc())) {
|
||||
String roomDesc = new String(liveRoom.getRoomDesc().getBytes("iso-8859-1"), "UTF-8");
|
||||
liveRoom.setRoomDesc(roomDesc);
|
||||
}
|
||||
if (fileUpload != null && fileUpload.getSize() <= 1048576) {
|
||||
String file = fastDFSClientI.uploadFileToFastDFS(fileUpload);
|
||||
if (StringUtils.isNotBlank(file)) {
|
||||
liveRoom.setRoomImg(file);
|
||||
}
|
||||
}
|
||||
|
||||
int i = tbl_Live_Room_Mapper.updateLiveRoom(liveRoom);
|
||||
if (i > 0) {
|
||||
redisKeyHelperI.deleteRedisByTbl_Live_Room(liveRoom);
|
||||
Tbl_Live_Room live = getTbl_Live_RoomByRoomId(liveRoom.getRoomId());
|
||||
return IfishUtil.toJson(ResultEnum.success.getKey(), live);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
return IfishUtil.toJson(ResultEnum.fail101.getKey(), "");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改直播间
|
||||
*
|
||||
* @param fileUpload
|
||||
* @param liveRoom
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Object updateLiveRoom(Tbl_Live_Room liveRoom) {
|
||||
|
||||
try {
|
||||
|
||||
int i = tbl_Live_Room_Mapper.updateLiveRoom(liveRoom);
|
||||
if (i > 0) {
|
||||
redisKeyHelperI.deleteRedisByTbl_Live_Room(liveRoom);
|
||||
|
|
@ -673,24 +606,4 @@ public class LiveRoomHelper implements LiveRoomHelperI {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据摄像头删除直播间
|
||||
*
|
||||
* @param cameraId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Integer deleteLiveRoom(String cameraId) {
|
||||
try {
|
||||
Tbl_Live_Room live_Room = getTbl_Live_RoomByCameraId(cameraId);
|
||||
if (live_Room != null) {
|
||||
redisKeyHelperI.deleteRedisByTbl_Live_Room(live_Room);
|
||||
}
|
||||
int i = tbl_Live_Room_Mapper.deleteLive_RoomByCameraId(cameraId);
|
||||
return i;
|
||||
} catch (Exception e) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public interface LiveRoomHelperI {
|
|||
* @return
|
||||
*/
|
||||
Object getLiveRoomInfoByRoomId(Integer rommId);
|
||||
|
||||
|
||||
/**
|
||||
* 根据摄像头ID获取直播间信息
|
||||
*
|
||||
|
|
@ -85,15 +85,6 @@ public interface LiveRoomHelperI {
|
|||
*/
|
||||
Object updateLiveRoom(MultipartFile fileUpload, Tbl_Live_Room liveRoom);
|
||||
|
||||
/**
|
||||
* 修改直播间
|
||||
*
|
||||
* @param fileUpload
|
||||
* @param liveRoom
|
||||
* @return
|
||||
*/
|
||||
Object updateLiveRoom(Tbl_Live_Room liveRoom);
|
||||
|
||||
/**
|
||||
* 直播间人气值加1
|
||||
*
|
||||
|
|
@ -102,12 +93,4 @@ public interface LiveRoomHelperI {
|
|||
* @return
|
||||
*/
|
||||
Object popularityValue(Integer roomId, Integer userId);
|
||||
|
||||
/**
|
||||
* 根据摄像头删除直播间
|
||||
*
|
||||
* @param cameraId
|
||||
* @return
|
||||
*/
|
||||
Integer deleteLiveRoom(String cameraId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ public class PushMessageHelper implements PushMessageHelperI {
|
|||
return IfishUtil.returnJson(ResultEnum.error401.getKey(), "");
|
||||
}
|
||||
List<Tbl_Push_List> list = tbl_Push_List_Mapper.getPushList(userId, pushType, pageSize, firstResult);
|
||||
int count = tbl_Push_List_Mapper.getPushListCount(userId, pushType);
|
||||
int count = tbl_Push_List_Mapper.getPushListCount(userId, pushType, pageSize, firstResult);
|
||||
PageResult page = new PageResult();
|
||||
page.setList(list);
|
||||
page.setPageNo(firstResult);
|
||||
|
|
|
|||
|
|
@ -8,11 +8,8 @@ package com.ifish.helper;
|
|||
import com.ifish.bean.Tbl_Device;
|
||||
import com.ifish.bean.Tbl_Device_Statistics;
|
||||
import com.ifish.bean.Tbl_Device_User;
|
||||
import com.ifish.bean.Tbl_Live_Message;
|
||||
import com.ifish.bean.Tbl_Live_Room;
|
||||
import com.ifish.bean.Tbl_Push_List;
|
||||
import com.ifish.bean.Tbl_User;
|
||||
import com.ifish.mapper.Tbl_Live_Room_Mapper;
|
||||
import com.ifish.util.RedisKey;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -27,12 +24,6 @@ public class RedisKeyHelper implements RedisKeyHelperI {
|
|||
|
||||
@Autowired
|
||||
private RedisHelperI redisHelperI;
|
||||
@Autowired
|
||||
private DeviceHelperI deviceHelper;
|
||||
@Autowired
|
||||
private UserHelperI userHelperI;
|
||||
@Autowired
|
||||
private Tbl_Live_Room_Mapper tbl_Live_Room_Mapper;
|
||||
|
||||
/**
|
||||
* 根据phoneNumber获取Tbl_User用户信息的Redis缓存key键值
|
||||
|
|
@ -78,77 +69,6 @@ public class RedisKeyHelper implements RedisKeyHelperI {
|
|||
return RedisKey.USER_ID_KEY + userId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据条件获取用户列表缓存key
|
||||
*
|
||||
* @param start
|
||||
* @param length
|
||||
* @param userId
|
||||
* @param phoneNumber
|
||||
* @param userEmail
|
||||
* @param phoneType
|
||||
* @param isRegisterGwell
|
||||
* @param isRegisterJiguang
|
||||
* @param sortField
|
||||
* @param sortMode
|
||||
* @param nickName
|
||||
* @param remarks
|
||||
* @param loginTime1
|
||||
* @param loginTime2
|
||||
* @param createTime1
|
||||
* @param createTime2
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String getUserListRedisKey(Integer start, Integer length, String userId, String phoneNumber, String userEmail, String phoneType, String isRegisterGwell, String isRegisterJiguang, String sortField, String sortMode, String nickName, String remarks, String loginTime1, String loginTime2, String createTime1, String createTime2) {
|
||||
return RedisKey.USER_LIST + userId + "_" + phoneNumber + "_" + userEmail + "_" + phoneType + "_" + isRegisterGwell + "_" + isRegisterJiguang + "_" + sortField + "_" + sortMode + "_" + nickName + "_" + remarks + "_" + loginTime1 + "_" + loginTime2 + "_" + createTime1 + "_" + createTime2 + "_" + start + "_" + length;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据条件搜索获取用户列表缓存key
|
||||
*
|
||||
* @param userId
|
||||
* @param phoneNumber
|
||||
* @param userEmail
|
||||
* @param phoneType
|
||||
* @param isRegisterGwell
|
||||
* @param isRegisterJiguang
|
||||
* @param sortField
|
||||
* @param sortMode
|
||||
* @param nickName
|
||||
* @param remarks
|
||||
* @param loginTime1
|
||||
* @param loginTime2
|
||||
* @param createTime1
|
||||
* @param createTime2
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String getUserListCountRedisKey(String userId, String phoneNumber, String userEmail, String phoneType, String isRegisterGwell, String isRegisterJiguang, String sortField, String sortMode, String nickName, String remarks, String loginTime1, String loginTime2, String createTime1, String createTime2) {
|
||||
return RedisKey.USER_LIST_COUNT + userId + "_" + phoneNumber + "_" + userEmail + "_" + phoneType + "_" + isRegisterGwell + "_" + isRegisterJiguang + "_" + sortField + "_" + sortMode + "_" + nickName + "_" + remarks + "_" + loginTime1 + "_" + loginTime2 + "_" + createTime1 + "_" + createTime2;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户列表总数
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String getAllUserListCountRedisKey() {
|
||||
return RedisKey.USER_LIST_COUNT_ALL;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据userName获取Tbl_Security_User管理用户的redis缓存key键值
|
||||
*
|
||||
* @param userName
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String getTbl_Security_UserRedisKeyByUserName(String userName) {
|
||||
return RedisKey.SECURITY_USER + userName;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据mac地址获取Tbl_Device的redis缓存key键值
|
||||
*
|
||||
|
|
@ -314,6 +234,7 @@ public class RedisKeyHelper implements RedisKeyHelperI {
|
|||
* @return
|
||||
*/
|
||||
@Override
|
||||
|
||||
public String getTbl_Live_Room_CountRedisKey() {
|
||||
return RedisKey.LIVEROOM_COUNT;
|
||||
}
|
||||
|
|
@ -329,17 +250,6 @@ public class RedisKeyHelper implements RedisKeyHelperI {
|
|||
return RedisKey.LIVEMESSAGE_ROOMID + roomId + "_f_" + firstResult + "_p_" + pageSize;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取直播间评论总数的redis缓存key键值
|
||||
*
|
||||
* @param roomId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String getTbl_Live_MessageCount(Integer roomId) {
|
||||
return RedisKey.LIVEMESSAGE_COUNT + roomId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据pushId获取Tbl_push_list的redis缓存key键值
|
||||
*
|
||||
|
|
@ -380,25 +290,6 @@ public class RedisKeyHelper implements RedisKeyHelperI {
|
|||
*/
|
||||
@Override
|
||||
public void deleteRedisByTbl_Device(Tbl_Device device) {
|
||||
|
||||
try {
|
||||
if (device.getDeviceId() != null && device.getDeviceId() != 0 && StringUtils.isBlank(device.getMacAddress())) {
|
||||
device = deviceHelper.getDeviceById(device.getDeviceId());
|
||||
}
|
||||
if (StringUtils.isNotBlank(device.getMacAddress()) && (device.getDeviceId() == null || device.getDeviceId() == 0)) {
|
||||
device = deviceHelper.getDeviceByMacAddress(device.getMacAddress());
|
||||
}
|
||||
if (StringUtils.isNotBlank(device.getCameraId()) && (device.getDeviceId() == null || device.getDeviceId() == 0)) {
|
||||
device = deviceHelper.getDeviceByCameraId(device.getCameraId());
|
||||
}
|
||||
deleteTbl_DeviceInfo(device);
|
||||
Tbl_Device_Statistics device_Statistics = deviceHelper.getDeviceStatisticsByDeviceId(device.getDeviceId());
|
||||
deleteTbl_Device_StatisticsInfo(device_Statistics);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
|
||||
public void deleteTbl_DeviceInfo(Tbl_Device device) {
|
||||
if (device.getDeviceId() != null && device.getDeviceId() > 0) {
|
||||
redisHelperI.deleteRedis(getTbl_DeviceRedisKeyByDeviceId(device.getDeviceId()));
|
||||
}
|
||||
|
|
@ -418,29 +309,12 @@ public class RedisKeyHelper implements RedisKeyHelperI {
|
|||
*/
|
||||
@Override
|
||||
public void deleteRedisByTbl_Device_Statistics(Tbl_Device_Statistics device) {
|
||||
|
||||
try {
|
||||
if (device.getDeviceId() != null && device.getDeviceId() != 0 && StringUtils.isBlank(device.getMacAddress())) {
|
||||
device = deviceHelper.getDeviceStatisticsByDeviceId(device.getDeviceId());
|
||||
}
|
||||
if (StringUtils.isNotBlank(device.getMacAddress()) && (device.getDeviceId() == null || device.getDeviceId() == 0)) {
|
||||
device = deviceHelper.getDeviceStatisticsByMacAddress(device.getMacAddress());
|
||||
}
|
||||
deleteTbl_Device_StatisticsInfo(device);
|
||||
Tbl_Device device1 = deviceHelper.getDeviceById(device.getDeviceId());
|
||||
deleteTbl_DeviceInfo(device1);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
|
||||
public void deleteTbl_Device_StatisticsInfo(Tbl_Device_Statistics device) {
|
||||
if (device.getDeviceId() != null && device.getDeviceId() > 0) {
|
||||
redisHelperI.deleteRedis(getTbl_Device_StatisticsRedisKeyByDeviceId(device.getDeviceId()));
|
||||
redisHelperI.deleteRedis(getTbl_DeviceRedisKeyByDeviceId(device.getDeviceId()));
|
||||
}
|
||||
if (StringUtils.isNotBlank(device.getMacAddress())) {
|
||||
redisHelperI.deleteRedis(getTbl_Device_StatisticsRedisKeyByMacAddress(device.getMacAddress()));
|
||||
redisHelperI.deleteRedis(getTbl_DeviceRedisKeyByMacAddress(device.getMacAddress()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -450,27 +324,12 @@ public class RedisKeyHelper implements RedisKeyHelperI {
|
|||
*/
|
||||
@Override
|
||||
public void deleteRedisByTbl_Device_User(Tbl_Device_User tbl_Device_User) {
|
||||
deleteTbl_Device_UserInfo(tbl_Device_User);
|
||||
try {
|
||||
Tbl_Device device1 = deviceHelper.getDeviceById(tbl_Device_User.getDeviceId());
|
||||
deleteTbl_DeviceInfo(device1);
|
||||
Tbl_Device_Statistics device_Statistics = deviceHelper.getDeviceStatisticsByDeviceId(tbl_Device_User.getDeviceId());
|
||||
deleteTbl_Device_StatisticsInfo(device_Statistics);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void deleteTbl_Device_UserInfo(Tbl_Device_User tbl_Device_User) {
|
||||
if (tbl_Device_User.getDeviceId() != null && tbl_Device_User.getUserId() != null && tbl_Device_User.getDeviceId() > 0 && tbl_Device_User.getUserId() > 0) {
|
||||
redisHelperI.deleteRedis(getTbl_Device_UserRedisKeyByDeviceIdAndUserId(tbl_Device_User.getUserId(), tbl_Device_User.getDeviceId()));
|
||||
}
|
||||
if (tbl_Device_User.getDeviceId() != null && tbl_Device_User.getDeviceId() > 0) {
|
||||
redisHelperI.deleteRedis(getListTbl_Device_UserKeyByDeviceId(tbl_Device_User.getDeviceId()));
|
||||
}
|
||||
if (tbl_Device_User.getUserId() != null) {
|
||||
redisHelperI.delRedisByTagKey(getListTbl_Device_UserKeyByUserId(tbl_Device_User.getUserId()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -480,12 +339,6 @@ public class RedisKeyHelper implements RedisKeyHelperI {
|
|||
*/
|
||||
@Override
|
||||
public void deleteRedisByTbl_User(Tbl_User tbl_User) {
|
||||
try {
|
||||
if (tbl_User.getUserId() != null && tbl_User.getUserId() > 0) {
|
||||
tbl_User = userHelperI.getUserById(tbl_User.getUserId());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
if (tbl_User.getUserId() != null && tbl_User.getUserId() > 0) {
|
||||
redisHelperI.deleteRedis(getTbl_UserRedisKeyByUserId(tbl_User.getUserId()));
|
||||
}
|
||||
|
|
@ -498,9 +351,6 @@ public class RedisKeyHelper implements RedisKeyHelperI {
|
|||
if (StringUtils.isNotBlank(tbl_User.getToken())) {
|
||||
redisHelperI.deleteRedis(getTbl_UserRedisKeyByToken(tbl_User.getToken()));
|
||||
}
|
||||
redisHelperI.delRedisByTagKey(RedisKey.USER_LIST);
|
||||
redisHelperI.delRedisByTagKey(RedisKey.USER_LIST_COUNT);
|
||||
redisHelperI.delRedisByTagKey(RedisKey.USER_LIST_COUNT_ALL);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -510,16 +360,11 @@ public class RedisKeyHelper implements RedisKeyHelperI {
|
|||
*/
|
||||
@Override
|
||||
public void deleteRedisByTbl_Live_Room(Tbl_Live_Room live_Room) {
|
||||
if ((live_Room.getRoomId() == null || live_Room.getRoomId() == 0) && StringUtils.isNotBlank(live_Room.getCameraId())) {
|
||||
live_Room = tbl_Live_Room_Mapper.getTbl_Live_RoomByCameraId(live_Room.getCameraId());
|
||||
} else if (StringUtils.isBlank(live_Room.getCameraId()) && (live_Room.getRoomId() != null && live_Room.getRoomId() > 0)) {
|
||||
live_Room = tbl_Live_Room_Mapper.getTbl_Live_RoomById(live_Room.getRoomId());
|
||||
}
|
||||
if (live_Room.getRoomId() != null && live_Room.getRoomId() > 0) {
|
||||
redisHelperI.deleteRedis(getTbl_Live_RoomRedisKeyByRoomId(live_Room.getRoomId()));
|
||||
}
|
||||
if (StringUtils.isNotBlank(live_Room.getCameraId())) {
|
||||
redisHelperI.deleteRedis(getTbl_Live_RoomRedisKeyByCameraId(live_Room.getCameraId()));
|
||||
redisHelperI.deleteRedis(live_Room.getCameraId());
|
||||
}
|
||||
if (live_Room.getUserId() != null && live_Room.getUserId() > 0) {
|
||||
redisHelperI.deleteRedis(getTbl_Live_RoomRedisKeyByUserId(live_Room.getUserId()));
|
||||
|
|
@ -536,101 +381,4 @@ public class RedisKeyHelper implements RedisKeyHelperI {
|
|||
redisHelperI.deleteRedis(getTbl_Live_Room_CountRedisKey());
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除redis中某个直播间评论列表缓存
|
||||
*
|
||||
* @param tbl_Live_Message
|
||||
*/
|
||||
@Override
|
||||
public void deleteRedisByTbl_Live_Message(Tbl_Live_Message tbl_Live_Message) {
|
||||
redisHelperI.delRedisByTagKey(RedisKey.LIVEMESSAGE_ROOMID + tbl_Live_Message.getRoomId());
|
||||
redisHelperI.deleteRedis(RedisKey.LIVEMESSAGE_COUNT + tbl_Live_Message.getRoomId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 后台推送消息列表缓存
|
||||
*
|
||||
* @param start
|
||||
* @param length
|
||||
* @param sdkVersion
|
||||
* @param phoneNumber
|
||||
* @param mac
|
||||
* @param phoneType
|
||||
* @param pushType
|
||||
* @param sortField
|
||||
* @param sortMode
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String getAdmin_Tbl_Push_List_BySelect(Integer start, Integer length, String sdkVersion, String phoneNumber, String mac, String phoneType, String pushType, String sortField, String sortMode) {
|
||||
return RedisKey.PUSHLIST_SELECT + start + "_" + length + "_" + sdkVersion + "_" + phoneNumber + "_" + mac + "_" + phoneType + "_" + pushType + "_" + sortField + "_" + sortMode;
|
||||
}
|
||||
|
||||
/**
|
||||
* 后台推送消息列表查询数量缓存
|
||||
*
|
||||
* @param start
|
||||
* @param length
|
||||
* @param sdkVersion
|
||||
* @param phoneNumber
|
||||
* @param mac
|
||||
* @param phoneType
|
||||
* @param pushType
|
||||
* @param sortField
|
||||
* @param sortMode
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String getAdmin_Tbl_Push_List_Count_BySelect(String sdkVersion, String phoneNumber, String mac, String phoneType, String pushType, String sortField, String sortMode) {
|
||||
return RedisKey.PUSHLIST_SELECT + "count_" + sdkVersion + "_" + phoneNumber + "_" + mac + "_" + phoneType + "_" + pushType + "_" + sortField + "_" + sortMode;
|
||||
}
|
||||
|
||||
/**
|
||||
* 后台推送消息列表总数缓存
|
||||
*
|
||||
* @param start
|
||||
* @param length
|
||||
* @param sdkVersion
|
||||
* @param phoneNumber
|
||||
* @param mac
|
||||
* @param phoneType
|
||||
* @param pushType
|
||||
* @param sortField
|
||||
* @param sortMode
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String getAdmin_Tbl_Push_List_AllCount() {
|
||||
return RedisKey.PUSHLIST_SELECT;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据条件删除推送列表缓存
|
||||
*
|
||||
* @param pushId
|
||||
*/
|
||||
@Override
|
||||
public void deleteRedisByTbl_Push_List(Tbl_Push_List tbl_Push_List) {
|
||||
if (tbl_Push_List.getPushId() != null) {
|
||||
redisHelperI.deleteRedis(getTbl_Push_List_RedisByPushId(tbl_Push_List.getPushId()));
|
||||
}
|
||||
deleteRedisByTbl_Push_ListToAllRedisList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除推送列表类缓存
|
||||
*/
|
||||
@Override
|
||||
public void deleteRedisByTbl_Push_ListToAllRedisList() {
|
||||
redisHelperI.delRedisByTagKey(RedisKey.PUSHLIST_SELECT);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除鱼缸厂信息缓存
|
||||
*/
|
||||
@Override
|
||||
public void deleteTbl_Vender_List_RedisKey() {
|
||||
redisHelperI.delRedisByTagKey(RedisKey.VENDER_CODE);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,9 +8,7 @@ package com.ifish.helper;
|
|||
import com.ifish.bean.Tbl_Device;
|
||||
import com.ifish.bean.Tbl_Device_Statistics;
|
||||
import com.ifish.bean.Tbl_Device_User;
|
||||
import com.ifish.bean.Tbl_Live_Message;
|
||||
import com.ifish.bean.Tbl_Live_Room;
|
||||
import com.ifish.bean.Tbl_Push_List;
|
||||
import com.ifish.bean.Tbl_User;
|
||||
|
||||
/**
|
||||
|
|
@ -51,65 +49,6 @@ public interface RedisKeyHelperI {
|
|||
*/
|
||||
public String getTbl_UserRedisKeyByEmail(String email);
|
||||
|
||||
/**
|
||||
* 根据条件获取用户列表缓存key
|
||||
*
|
||||
* @param start
|
||||
* @param length
|
||||
* @param userId
|
||||
* @param phoneNumber
|
||||
* @param userEmail
|
||||
* @param phoneType
|
||||
* @param isRegisterGwell
|
||||
* @param isRegisterJiguang
|
||||
* @param sortField
|
||||
* @param sortMode
|
||||
* @param nickName
|
||||
* @param remarks
|
||||
* @param loginTime1
|
||||
* @param loginTime2
|
||||
* @param createTime1
|
||||
* @param createTime2
|
||||
* @return
|
||||
*/
|
||||
public String getUserListRedisKey(Integer start, Integer length, String userId, String phoneNumber, String userEmail, String phoneType, String isRegisterGwell, String isRegisterJiguang, String sortField, String sortMode, String nickName, String remarks, String loginTime1, String loginTime2, String createTime1, String createTime2);
|
||||
|
||||
/**
|
||||
* 根据条件搜索获取用户列表缓存key
|
||||
*
|
||||
* @param userId
|
||||
* @param phoneNumber
|
||||
* @param userEmail
|
||||
* @param phoneType
|
||||
* @param isRegisterGwell
|
||||
* @param isRegisterJiguang
|
||||
* @param sortField
|
||||
* @param sortMode
|
||||
* @param nickName
|
||||
* @param remarks
|
||||
* @param loginTime1
|
||||
* @param loginTime2
|
||||
* @param createTime1
|
||||
* @param createTime2
|
||||
* @return
|
||||
*/
|
||||
public String getUserListCountRedisKey(String userId, String phoneNumber, String userEmail, String phoneType, String isRegisterGwell, String isRegisterJiguang, String sortField, String sortMode, String nickName, String remarks, String loginTime1, String loginTime2, String createTime1, String createTime2);
|
||||
|
||||
/**
|
||||
* 获取用户列表总数
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getAllUserListCountRedisKey();
|
||||
|
||||
/**
|
||||
* 根据userName获取Tbl_Security_User管理用户的redis缓存key键值
|
||||
*
|
||||
* @param userName
|
||||
* @return
|
||||
*/
|
||||
public String getTbl_Security_UserRedisKeyByUserName(String userName);
|
||||
|
||||
/**
|
||||
* 根据mac地址获取Tbl_Device的redis缓存key键值
|
||||
*
|
||||
|
|
@ -242,14 +181,6 @@ public interface RedisKeyHelperI {
|
|||
*/
|
||||
public String getTbl_Live_Message(Integer firstResult, Integer pageSize, Integer roomId);
|
||||
|
||||
/**
|
||||
* 获取直播间评论总数的redis缓存key键值
|
||||
*
|
||||
* @param roomId
|
||||
* @return
|
||||
*/
|
||||
public String getTbl_Live_MessageCount(Integer roomId);
|
||||
|
||||
/**
|
||||
* 根据pushId获取Tbl_push_list的redis缓存key键值
|
||||
*
|
||||
|
|
@ -258,54 +189,6 @@ public interface RedisKeyHelperI {
|
|||
*/
|
||||
public String getTbl_Push_List_RedisByPushId(Integer pushId);
|
||||
|
||||
/**
|
||||
* 后台推送消息列表缓存
|
||||
*
|
||||
* @param start
|
||||
* @param length
|
||||
* @param sdkVersion
|
||||
* @param phoneNumber
|
||||
* @param mac
|
||||
* @param phoneType
|
||||
* @param pushType
|
||||
* @param sortField
|
||||
* @param sortMode
|
||||
* @return
|
||||
*/
|
||||
public String getAdmin_Tbl_Push_List_BySelect(Integer start, Integer length, String sdkVersion, String phoneNumber, String mac, String phoneType, String pushType, String sortField, String sortMode);
|
||||
|
||||
/**
|
||||
* 后台推送消息列表查询数量缓存
|
||||
*
|
||||
* @param start
|
||||
* @param length
|
||||
* @param sdkVersion
|
||||
* @param phoneNumber
|
||||
* @param mac
|
||||
* @param phoneType
|
||||
* @param pushType
|
||||
* @param sortField
|
||||
* @param sortMode
|
||||
* @return
|
||||
*/
|
||||
public String getAdmin_Tbl_Push_List_Count_BySelect(String sdkVersion, String phoneNumber, String mac, String phoneType, String pushType, String sortField, String sortMode);
|
||||
|
||||
/**
|
||||
* 后台推送消息列表总数缓存
|
||||
*
|
||||
* @param start
|
||||
* @param length
|
||||
* @param sdkVersion
|
||||
* @param phoneNumber
|
||||
* @param mac
|
||||
* @param phoneType
|
||||
* @param pushType
|
||||
* @param sortField
|
||||
* @param sortMode
|
||||
* @return
|
||||
*/
|
||||
public String getAdmin_Tbl_Push_List_AllCount();
|
||||
|
||||
/**
|
||||
* 根据MD5值获取redis缓存key键值(注册账号用)
|
||||
*
|
||||
|
|
@ -364,28 +247,4 @@ public interface RedisKeyHelperI {
|
|||
*/
|
||||
public void deleteRedisByLiveRoomListCount();
|
||||
|
||||
/**
|
||||
* 删除redis中某个直播间评论列表缓存
|
||||
*
|
||||
* @param tbl_Live_Message
|
||||
*/
|
||||
public void deleteRedisByTbl_Live_Message(Tbl_Live_Message tbl_Live_Message);
|
||||
|
||||
/**
|
||||
* 根据条件删除推送列表缓存
|
||||
*
|
||||
* @param pushId
|
||||
*/
|
||||
public void deleteRedisByTbl_Push_List(Tbl_Push_List tbl_Push_List);
|
||||
|
||||
/**
|
||||
* 删除推送列表类缓存
|
||||
*/
|
||||
public void deleteRedisByTbl_Push_ListToAllRedisList();
|
||||
|
||||
/**
|
||||
* 删除鱼缸厂信息缓存
|
||||
*/
|
||||
public void deleteTbl_Vender_List_RedisKey();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,9 +12,12 @@ import com.ifish.bean.Tbl_Device;
|
|||
import com.ifish.bean.Tbl_Device_User;
|
||||
import com.ifish.bean.Tbl_HardWare_Type;
|
||||
import com.ifish.bean.Tbl_User;
|
||||
import com.ifish.bean.Tbl_Vender_List;
|
||||
import com.ifish.bean.Tbl_Vender;
|
||||
import com.ifish.enums.GwellEnum;
|
||||
import com.ifish.enums.ResultEnum;
|
||||
import com.ifish.enums.SendTypeEnum;
|
||||
import com.ifish.enums.SmsSignEnum;
|
||||
import com.ifish.enums.SmsTemplateEnum;
|
||||
import com.ifish.mapper.Tbl_User_Mapper;
|
||||
import com.ifish.util.IfishUtil;
|
||||
import java.util.ArrayList;
|
||||
|
|
@ -47,19 +50,19 @@ public class UserHelper implements UserHelperI {
|
|||
*/
|
||||
@Autowired
|
||||
private Tbl_User_Mapper tbl_User_Mapper;
|
||||
|
||||
|
||||
@Autowired
|
||||
private DeviceHelperI deviceHelperI;
|
||||
|
||||
|
||||
@Autowired
|
||||
private HardWareTypeHelperI hardWareTypeHelperI;
|
||||
|
||||
|
||||
@Autowired
|
||||
private RedisKeyHelperI redisKeyHelperI;
|
||||
|
||||
|
||||
@Autowired
|
||||
private SendMobile sendMobile;
|
||||
|
||||
|
||||
@Autowired
|
||||
private FastDFSClientI fastDFSClientI;
|
||||
|
||||
|
|
@ -147,7 +150,7 @@ public class UserHelper implements UserHelperI {
|
|||
dataMap.put("userSex", user.getUserSex());
|
||||
dataMap.put("userImg", user.getUserImg());
|
||||
dataMap.put("nickName", user.getNickName());
|
||||
|
||||
|
||||
return IfishUtil.returnJson(ResultEnum.success.getKey(), dataMap);
|
||||
}
|
||||
|
||||
|
|
@ -250,11 +253,11 @@ public class UserHelper implements UserHelperI {
|
|||
if (user == null) {
|
||||
return "修改失败,请联系管理员!";
|
||||
}
|
||||
|
||||
|
||||
user.setUserPassword(map.get("password").toString());
|
||||
Date date = new Date();
|
||||
user.setUpdateTime(date);
|
||||
|
||||
|
||||
int i = tbl_User_Mapper.updateUser(user);
|
||||
if (i > 0) {
|
||||
redisKeyHelperI.deleteRedisByTbl_User(user);
|
||||
|
|
@ -302,7 +305,6 @@ public class UserHelper implements UserHelperI {
|
|||
user.setUserType("0");
|
||||
user.setLoginType(loginType);
|
||||
user.setCreateTime(new Date());
|
||||
user.setUserImg("http://139.196.24.156:83/00/00/1.png");
|
||||
int i = tbl_User_Mapper.insertUserByTourist(user);
|
||||
Map result = new HashMap();
|
||||
if (i > 0 && user.getUserId() > 0) {
|
||||
|
|
@ -361,7 +363,7 @@ public class UserHelper implements UserHelperI {
|
|||
curUser.setUserSex(userSex);
|
||||
bln = true;
|
||||
}
|
||||
|
||||
|
||||
String registerId = user.getJiguangUserid();
|
||||
if (StringUtils.isNotBlank(registerId)) {
|
||||
curUser.setJiguangUserid(registerId);
|
||||
|
|
@ -410,7 +412,7 @@ public class UserHelper implements UserHelperI {
|
|||
return IfishUtil.returnJson(ResultEnum.fail101.getKey(), "");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Tbl_User user = getUserById(userId);
|
||||
user.setUserImg(img);
|
||||
int i = tbl_User_Mapper.updateUser(user);
|
||||
|
|
@ -461,7 +463,7 @@ public class UserHelper implements UserHelperI {
|
|||
Map userMap = getUserMap(user);
|
||||
return IfishUtil.returnJson(ResultEnum.success.getKey(), userMap);
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
}
|
||||
return IfishUtil.toJson(ResultEnum.fail101.getKey(), "");
|
||||
|
|
@ -492,7 +494,7 @@ public class UserHelper implements UserHelperI {
|
|||
redisKeyHelperI.deleteRedisByTbl_User(user);
|
||||
return IfishUtil.returnJson(ResultEnum.success.getKey(), "");
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
}
|
||||
return IfishUtil.toJson(ResultEnum.fail101.getKey(), "");
|
||||
|
|
@ -529,23 +531,6 @@ public class UserHelper implements UserHelperI {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 极光是否注册别名成功
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Object IsRegisterJPush(String userId) {
|
||||
if (StringUtils.isNotBlank(userId)) {
|
||||
int i = tbl_User_Mapper.IsRegisterJPush(userId);
|
||||
if (i > 0) {
|
||||
return IfishUtil.toJson(ResultEnum.success.getKey(), "");
|
||||
}
|
||||
}
|
||||
return IfishUtil.toJson(ResultEnum.fail101.getKey(), "");
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据手机号从缓存或数据库中取得用户对象
|
||||
*
|
||||
|
|
@ -727,7 +712,7 @@ public class UserHelper implements UserHelperI {
|
|||
dataMap.put("device", deviceMap.get("list"));
|
||||
dataMap.put("camera", deviceMap.get("list2"));
|
||||
return IfishUtil.returnJson(ResultEnum.success.getKey(), dataMap);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -827,7 +812,7 @@ public class UserHelper implements UserHelperI {
|
|||
if (tmpUser.getUpdateTime() != null) {
|
||||
userMap.put("updateTime", IfishUtil.format(tmpUser.getUpdateTime()));
|
||||
}
|
||||
|
||||
|
||||
return userMap;
|
||||
}
|
||||
|
||||
|
|
@ -845,20 +830,20 @@ public class UserHelper implements UserHelperI {
|
|||
//获取用户拥有设备
|
||||
List<Tbl_Device_User> deviceUserList = deviceHelperI.getDeviceUsersByUserId(tmpUser.getUserId());
|
||||
List<Integer> deviceIds = new ArrayList<Integer>();
|
||||
List<String> cameraIds = new ArrayList<String>();
|
||||
List<Integer> cameraIds = new ArrayList<Integer>();
|
||||
for (Tbl_Device_User deviceUser : deviceUserList) {
|
||||
Tbl_Device device = deviceHelperI.getDeviceById(deviceUser.getDeviceId());
|
||||
if (device.getIsCamera().equals("1")) {
|
||||
cameraIds.add(device.getCameraId());
|
||||
cameraIds.add(device.getDeviceId());
|
||||
list2.add(getCameraInfo(device, deviceUser));
|
||||
} else {
|
||||
deviceIds.add(device.getDeviceId());
|
||||
//封装设备返回信息
|
||||
list.add(getDeviceInfo(device, deviceUser));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
Map map = new HashMap();
|
||||
map.put("list", list);
|
||||
map.put("list2", list2);
|
||||
|
|
@ -920,19 +905,17 @@ public class UserHelper implements UserHelperI {
|
|||
deviceMap.put("waterRemind", device.getWaterRemind());
|
||||
deviceMap.put("remindDate", device.getRemindDate() != null ? IfishUtil.format1(device.getRemindDate()) : "");
|
||||
deviceMap.put("remindCycle", device.getRemindCycle() != null ? device.getRemindCycle() : "");
|
||||
//是否开启离线通知
|
||||
deviceMap.put("offLine", deviceUser.getOffLine());
|
||||
}
|
||||
}
|
||||
//厂家
|
||||
if (device.getBrandCode() != null) {
|
||||
//厂家
|
||||
Tbl_Vender_List venderList = new Tbl_Vender_List();
|
||||
Tbl_Vender venderList = new Tbl_Vender();
|
||||
venderList = hardWareTypeHelperI.getVenderListByBrandCode(device.getBrandCode());
|
||||
deviceMap.put("venderList", venderList);
|
||||
} else {
|
||||
//默认爱鱼奇
|
||||
Tbl_Vender_List defaultVenderList = new Tbl_Vender_List();
|
||||
Tbl_Vender defaultVenderList = new Tbl_Vender();
|
||||
defaultVenderList = hardWareTypeHelperI.getVenderListByBrandCode("AYQ");
|
||||
deviceMap.put("venderList", defaultVenderList);
|
||||
}
|
||||
|
|
@ -950,7 +933,7 @@ public class UserHelper implements UserHelperI {
|
|||
*/
|
||||
public Map<String, Object> getCameraInfo(Tbl_Device camera, Tbl_Device_User cameraUser) {
|
||||
Map<String, Object> cameraMap = new HashMap<String, Object>();
|
||||
cameraMap.put("cameraId", camera.getCameraId());
|
||||
cameraMap.put("cameraId", camera.getDeviceId());
|
||||
cameraMap.put("isMaster", cameraUser.getIsMaster());
|
||||
cameraMap.put("isLook", cameraUser.getIsLook());
|
||||
cameraMap.put("isActive", StringUtils.isNotBlank(camera.getActiveCode()) ? "1" : "0");
|
||||
|
|
@ -976,5 +959,5 @@ public class UserHelper implements UserHelperI {
|
|||
return IfishUtil.returnJson(ResultEnum.fail101.getKey(), "");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -127,12 +127,4 @@ public interface UserHelperI {
|
|||
* @return
|
||||
*/
|
||||
public Object forgetPasswordByEmail(String email, String password);
|
||||
|
||||
/**
|
||||
* 极光是否注册别名成功
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
public Object IsRegisterJPush(String userId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public interface Tbl_Device_Mapper {
|
|||
* @param deviceId
|
||||
* @return
|
||||
*/
|
||||
@Select("SELECT id,user_id,device_id,is_master,show_name,create_time,update_time,custom_icon_name,custom_show_name,is_look,is_live,off_line from tbl_device_user WHERE user_id = #{userid}")
|
||||
@Select("SELECT id,user_id,device_id,is_master,show_name,create_time,update_time,custom_icon_name,custom_show_name,is_look,is_live from tbl_device_user WHERE user_id = #{userid}")
|
||||
List<Tbl_Device_User> getDeviceUsersByUserId(@Param("userid") Integer userid);
|
||||
|
||||
/**
|
||||
|
|
@ -71,7 +71,7 @@ public interface Tbl_Device_Mapper {
|
|||
* @param deviceId
|
||||
* @return
|
||||
*/
|
||||
@Select("SELECT id,user_id,device_id,is_master,show_name,create_time,update_time,custom_icon_name,custom_show_name,is_look,is_live,off_line from tbl_device_user WHERE user_id <> ${userid} AND device_id = #{deviceid}")
|
||||
@Select("SELECT id,user_id,device_id,is_master,show_name,create_time,update_time,custom_icon_name,custom_show_name,is_look,is_live from tbl_device_user WHERE user_id <> ${userid} AND device_id = #{deviceid}")
|
||||
List<Tbl_Device_User> getOtherDeviceUsersByOtherUserIdAndDeviceId(@Param("userid") Integer userid, @Param("deviceid") Integer deviceId);
|
||||
|
||||
/**
|
||||
|
|
@ -81,7 +81,7 @@ public interface Tbl_Device_Mapper {
|
|||
* @param deviceId
|
||||
* @return
|
||||
*/
|
||||
@Select("SELECT id,user_id,device_id,is_master,show_name,create_time,update_time,custom_icon_name,custom_show_name,is_look,is_live,off_line from tbl_device_user WHERE user_id = #{userid} AND device_id = #{deviceid}")
|
||||
@Select("SELECT id,user_id,device_id,is_master,show_name,create_time,update_time,custom_icon_name,custom_show_name,is_look,is_live from tbl_device_user WHERE user_id = #{userid} AND device_id = #{deviceid}")
|
||||
Tbl_Device_User getDeviceUsersByUserIdAndDeviceId(@Param("userid") Integer userid, @Param("deviceid") Integer deviceId);
|
||||
|
||||
/**
|
||||
|
|
@ -90,7 +90,7 @@ public interface Tbl_Device_Mapper {
|
|||
* @param deviceId
|
||||
* @return
|
||||
*/
|
||||
@Select("SELECT id,user_id,device_id,is_master,show_name,create_time,update_time,custom_icon_name,custom_show_name,is_look,is_live,off_line from tbl_device_user WHERE device_id = #{deviceid}")
|
||||
@Select("SELECT id,user_id,device_id,is_master,show_name,create_time,update_time,custom_icon_name,custom_show_name,is_look,is_live from tbl_device_user WHERE device_id = #{deviceid}")
|
||||
List<Tbl_Device_User> getDeviceUsersByDeviceId(@Param("deviceid") Integer deviceId);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -55,9 +55,6 @@ public class Tbl_Device_MapperSql {
|
|||
if (StringUtils.isNotBlank(device_User.getIsLive())) {
|
||||
sb.append("is_live = #{deviceUser.isLive}, ");
|
||||
}
|
||||
if (StringUtils.isNotBlank(device_User.getOffLine())) {
|
||||
sb.append("off_line = #{deviceUser.offLine}, ");
|
||||
}
|
||||
sb.append("update_time = now() ");
|
||||
sb.append(" WHERE id = #{deviceUser.id}");
|
||||
return sb.toString();
|
||||
|
|
@ -243,9 +240,6 @@ public class Tbl_Device_MapperSql {
|
|||
if (StringUtils.isNotBlank(device.getWaterRemind())) {
|
||||
sb.append("water_remind = #{device.waterRemind}, ");
|
||||
}
|
||||
if (device.getRemindDate() != null) {
|
||||
sb.append("remind_date = #{device.remindDate}, ");
|
||||
}
|
||||
if (device.getRemindCycle() != null && device.getRemindCycle() > 0) {
|
||||
sb.append("remind_cycle = #{device.remindCycle}, ");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
package com.ifish.mapper;
|
||||
|
||||
import com.ifish.bean.Tbl_HardWare_Type;
|
||||
import com.ifish.bean.Tbl_Vender_List;
|
||||
import com.ifish.bean.Tbl_Vender;
|
||||
import java.util.Map;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
|
@ -34,15 +34,5 @@ public interface Tbl_Hardware_Type_Mapper {
|
|||
* @return
|
||||
*/
|
||||
@Select("select brand_code,brand_name,brand_introduce,brand_logo from tbl_vender_list where brand_code=#{code}")
|
||||
Tbl_Vender_List getVenderListByBrandCode(@Param("code") String code);
|
||||
|
||||
/**
|
||||
* 根据设备型号获取厂家信息
|
||||
*
|
||||
* @param code
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@Select("select a.brand_code,brand_name,brand_introduce,brand_logo from tbl_vender_list a LEFT JOIN tbl_vender_hardware b ON a.brand_code = b.brand_code where b.hardware_type=#{code}")
|
||||
Tbl_Vender_List getVenderListByHardwareTypeCode(@Param("code") String code);
|
||||
Tbl_Vender getVenderListByBrandCode(@Param("code") String code);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -184,18 +184,9 @@ public interface Tbl_Live_Room_Mapper {
|
|||
+ "from tbl_live_message l "
|
||||
+ "LEFT JOIN tbl_user u ON l.user_id = u.user_id "
|
||||
+ "LEFT JOIN tbl_user uu ON l.as_user_id=uu.user_id "
|
||||
+ "WHERE room_id = #{roomid} ORDER BY l.create_time DESC LIMIT ${first},${page} ")
|
||||
+ "WHERE room_id = #{roomid} LIMIT ${first},${page} ")
|
||||
List<Map> getLive_MessagesListByRoomId(@Param("roomid") Integer roomid, @Param("first") Integer firstResult, @Param("page") Integer pageSize);
|
||||
|
||||
/**
|
||||
* 获取直播间评论总数
|
||||
*
|
||||
* @param roomid
|
||||
* @return
|
||||
*/
|
||||
@Select("select count(1) from tbl_live_message WHERE room_id = #{roomid}")
|
||||
Integer getLive_MessagesCountByRoomId(@Param("roomid") Integer roomid);
|
||||
|
||||
/**
|
||||
* 根据直播间和用户ID获取观看记录
|
||||
*
|
||||
|
|
@ -224,12 +215,4 @@ public interface Tbl_Live_Room_Mapper {
|
|||
@Insert("INSERT INTO TBL_LIVE_WATCH(room_id,user_id,update_time,create_time) VALUES (#{live.roomId},#{live.userId},#{live.updateTime},#{live.createTime})")
|
||||
Integer insertTbl_Live_Watch(@Param("live") Tbl_Live_Watch live);
|
||||
|
||||
/**
|
||||
* 根据摄像头ID删除直播间
|
||||
*
|
||||
* @param cameraId
|
||||
* @return
|
||||
*/
|
||||
@Delete("DELETE TBL_LIVE_ROOM WHERE camera_id = #{cameraid}")
|
||||
Integer deleteLive_RoomByCameraId(@Param("cameraid") String cameraId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ public interface Tbl_Push_List_Mapper {
|
|||
Integer deletePushListById(@Param("id") Integer pushId);
|
||||
|
||||
/**
|
||||
* 获取用户推送消息总数
|
||||
* 分页获取用户推送消息
|
||||
*
|
||||
* @param userId
|
||||
* @param pushType
|
||||
|
|
@ -58,8 +58,8 @@ public interface Tbl_Push_List_Mapper {
|
|||
* @param firstResult
|
||||
* @return
|
||||
*/
|
||||
@SelectProvider(type = Tbl_Push_List_MapperSql.class, method = "getPushListCount")
|
||||
Integer getPushListCount(@Param("userid") Integer userId, @Param("pushtype") String pushType);
|
||||
@Select("SELECT COUNT(1) FROM TBL_PUSH_LIST WHERE user_id = #{userid} AND push_type = #{pushtype} LIMIT ${first},${pagesize}")
|
||||
Integer getPushListCount(@Param("userid") Integer userId, @Param("pushtype") String pushType, @Param("pagesize") Integer pageSize, @Param("first") Integer firstResult);
|
||||
|
||||
/**
|
||||
* 插入一条推送信息
|
||||
|
|
|
|||
|
|
@ -27,16 +27,4 @@ public class Tbl_Push_List_MapperSql {
|
|||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getPushListCount(@Param("userid") Integer userId, @Param("pushtype") String pushType) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append("SELECT count(1) FROM TBL_PUSH_LIST WHERE ");
|
||||
sb.append("user_id = #{userid} ");
|
||||
if (StringUtils.isNotBlank(pushType)) {
|
||||
sb.append("AND push_type = #{pushtype} ");
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -100,13 +100,4 @@ public interface Tbl_User_Mapper {
|
|||
+ "#{user.token},#{user.longitude},#{user.latitude},#{user.loginType})")
|
||||
@SelectKey(statement = "select @@IDENTITY as user_id", keyProperty = "user.userId", keyColumn = "userId", before = false, resultType = int.class)
|
||||
Integer insertUserByPhoneNumberAndEmail(@Param("user") Tbl_User user);
|
||||
|
||||
/**
|
||||
* 修改极光别名注册成功
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@Update("UPDATE tbl_user set jiguang_userid = '1' WHERE user_id = #{userid} ")
|
||||
Integer IsRegisterJPush(@Param("userid") String userId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,20 +16,34 @@ import java.util.Properties;
|
|||
*/
|
||||
public class IfishFilePath {
|
||||
|
||||
//头像地址
|
||||
public static String path_img;
|
||||
/**
|
||||
* 图片头地址
|
||||
*/
|
||||
public static String link_img_head;
|
||||
//商家图片地址
|
||||
public static String path_shops;
|
||||
//商品介绍图片
|
||||
public static String path_commodity;
|
||||
//微信分享页面
|
||||
public static String path_share_html;
|
||||
//微信分享页图片
|
||||
public static String path_share_img;
|
||||
//看护报告页面
|
||||
public static String path_look_html;
|
||||
//看护报告图片
|
||||
public static String path_look_img;
|
||||
//html名字
|
||||
public static String html_name;
|
||||
//图片上传格式
|
||||
public static String check_style;
|
||||
|
||||
public static String AppKeyFormal;
|
||||
|
||||
public static String MasterSecretFormal;
|
||||
|
||||
public static String AppKey;
|
||||
|
||||
public static String MasterSecret;
|
||||
//云信爱鱼奇官方帐号
|
||||
public static String ifish_account;
|
||||
//IM官方手机号
|
||||
public static String netease_phone;
|
||||
//直播间封面
|
||||
public static String path_room_img;
|
||||
//开发模式
|
||||
public static boolean devModel;
|
||||
|
||||
|
|
|
|||
|
|
@ -64,19 +64,6 @@ public class IfishUtil {
|
|||
*/
|
||||
public static final int CacheTime_DAYS = 1;
|
||||
|
||||
/**
|
||||
* 是否在线上运行,true在线上,false在测试环境
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static boolean isOnLine() {
|
||||
if (IfishFilePath.link_img_head.contains("ifish7")) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Object转Json
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ public class RedisKey {
|
|||
* 用户缓存前缀,以id进行存储
|
||||
*/
|
||||
public static final String USER_ID_KEY = "userE:id_";
|
||||
|
||||
/**
|
||||
* 用户缓存前缀,以手机号进行存储
|
||||
*/
|
||||
|
|
@ -23,26 +24,11 @@ public class RedisKey {
|
|||
* 用户缓存前缀,以邮箱进行存储
|
||||
*/
|
||||
public static final String USER_EMAIL = "userE:ema_";
|
||||
/**
|
||||
* 用户列表缓存前缀
|
||||
*/
|
||||
public static final String USER_LIST = "userlistE:";
|
||||
/**
|
||||
* 用户列表总数缓存前缀(带条件)
|
||||
*/
|
||||
public static final String USER_LIST_COUNT = "userlistcountE:";
|
||||
/**
|
||||
* 所有用户列表缓存前缀(不需条件)
|
||||
*/
|
||||
public static final String USER_LIST_COUNT_ALL = "alluserlistcountE";
|
||||
|
||||
/**
|
||||
* 用户缓存前缀,以token进行存储
|
||||
*/
|
||||
public static final String USER_TOKEN = "userE:to_";
|
||||
/**
|
||||
* 管理用户缓存前缀
|
||||
*/
|
||||
public static final String SECURITY_USER = "seuserE:un_";
|
||||
|
||||
/**
|
||||
* 设备用户关系缓存前缀,以设备ID和用户ID进行存储
|
||||
|
|
@ -124,21 +110,11 @@ public class RedisKey {
|
|||
*/
|
||||
public static final String LIVEMESSAGE_ROOMID = "livemessageE:rid_";
|
||||
|
||||
/**
|
||||
* 指定直播间评论总数
|
||||
*/
|
||||
public static final String LIVEMESSAGE_COUNT = "livemessageCtE:rid_";
|
||||
|
||||
/**
|
||||
* 推送信息表缓存前缀,以推送Id进行存储
|
||||
*/
|
||||
public static final String PUSHLIST_PUSHID = "pushlistE:id_";
|
||||
|
||||
/**
|
||||
* 后台推送列表缓存条件
|
||||
*/
|
||||
public static final String PUSHLIST_SELECT = "pushlistE:se_";
|
||||
|
||||
/**
|
||||
* 邮箱验证有效缓存key
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,11 +1,27 @@
|
|||
#\u6b63\u5f0f\u73af\u5883\u6781\u5149AppKey
|
||||
AppKeyFormal=123
|
||||
#\u6b63\u5f0f\u73af\u5883\u6781\u5149Master Secret
|
||||
MasterSecretFormal=123
|
||||
#\u6d4b\u8bd5\u73af\u5883\u6781\u5149AppKey
|
||||
AppKey=6e5e9d757570859b3f274bb8
|
||||
#\u6d4b\u8bd5\u73af\u5883\u6781\u5149Master Secret
|
||||
MasterSecret=4f759a0609dcd9d2edb06125
|
||||
#\u5934\u50cf\u5b58\u50a8\u8def\u5f84
|
||||
path_img=/mydata/tmp/Img/app
|
||||
#\u5546\u5bb6\u8ba4\u8bc1\u56fe\u7247
|
||||
path_shops=/mydata/tmp/Img/shops
|
||||
#\u5546\u54c1\u4ecb\u7ecd\u56fe\u7247
|
||||
path_commodity=/mydata/tmp/Img/commodity
|
||||
#\u76f4\u64ad\u95f4\u5c01\u9762
|
||||
path_room_img=/mydata/tmp/Img/room
|
||||
#\u5fae\u4fe1\u5206\u4eab\u9875\u9762
|
||||
path_share_html=/mydata/tmp/html/
|
||||
#\u5fae\u4fe1\u5206\u4eab\u9875\u56fe\u7247
|
||||
path_share_img=/mydata/tmp/html/images/share
|
||||
#\u770b\u62a4\u62a5\u544a\u9875\u9762
|
||||
path_look_html=/mydata/tmp/look/
|
||||
#\u770b\u62a4\u62a5\u544a\u56fe\u7247
|
||||
path_look_img=/mydata/tmp/look/images/share
|
||||
#\u770b\u62a4\u62a5\u544a\u6a21\u7248html\u540d\u5b57
|
||||
html_name=index.html
|
||||
#\u4e91\u4fe1\u7231\u9c7c\u5947\u5b98\u65b9\u5e10\u53f7
|
||||
ifish_account=ifish
|
||||
#IM\u5b98\u65b9\u624b\u673a\u53f7
|
||||
netease_phone=18501773036
|
||||
#\u672c\u5730
|
||||
#link_img_head=http://192.168.61.128:81/
|
||||
#\u6d4b\u8bd5\u73af\u5883
|
||||
link_img_head=http://139.196.24.156:83/
|
||||
#\u6b63\u5f0f\u73af\u5883
|
||||
|
|
|
|||
Loading…
Reference in New Issue