Commit 3b48cfc7 by gaopeng

modify 更新主干代码

parent edadc760
...@@ -85,3 +85,5 @@ uedThirdPartyOrderUrl=https://rayscloud.chubanyun.net ...@@ -85,3 +85,5 @@ uedThirdPartyOrderUrl=https://rayscloud.chubanyun.net
## \u7CFB\u7EDF\u73AF\u5883 ## \u7CFB\u7EDF\u73AF\u5883
system.env = pro system.env = pro
jsbj.agent.id = 1000009100
\ No newline at end of file
...@@ -87,3 +87,5 @@ uedThirdPartyOrderUrl=http://deveapi.chubanyun.net ...@@ -87,3 +87,5 @@ uedThirdPartyOrderUrl=http://deveapi.chubanyun.net
## \u7CFB\u7EDF\u73AF\u5883 ## \u7CFB\u7EDF\u73AF\u5883
system.env = uat system.env = uat
jsbj.agent.id = 12829
\ No newline at end of file
...@@ -51,6 +51,7 @@ public class ParamLogAspect { ...@@ -51,6 +51,7 @@ public class ParamLogAspect {
Signature signature = joinPoint.getSignature(); Signature signature = joinPoint.getSignature();
String methodName = signature.getName(); String methodName = signature.getName();
String description = paramLog.description(); String description = paramLog.description();
description = StringUtil.isEmpty(description) ? paramLog.value() : description;
StringBuffer msg = new StringBuffer("【" + methodName + " before】"); StringBuffer msg = new StringBuffer("【" + methodName + " before】");
if (StringUtil.isEmpty(description)) { if (StringUtil.isEmpty(description)) {
msg.append(joinPoint.getSignature().toString()); msg.append(joinPoint.getSignature().toString());
...@@ -79,6 +80,7 @@ public class ParamLogAspect { ...@@ -79,6 +80,7 @@ public class ParamLogAspect {
Signature signature = joinPoint.getSignature(); Signature signature = joinPoint.getSignature();
String methodName = signature.getName(); String methodName = signature.getName();
String description = paramLog.description(); String description = paramLog.description();
description = StringUtil.isEmpty(description) ? paramLog.value() : description;
StringBuffer msg = new StringBuffer("【" + methodName + " afterReturn】"); StringBuffer msg = new StringBuffer("【" + methodName + " afterReturn】");
if (StringUtil.isEmpty(description)) { if (StringUtil.isEmpty(description)) {
msg.append(joinPoint.getSignature().toString()); msg.append(joinPoint.getSignature().toString());
......
...@@ -70,6 +70,11 @@ public enum AppTypeEnum { ...@@ -70,6 +70,11 @@ public enum AppTypeEnum {
TB("tb"), TB("tb"),
/** /**
* 直播
*/
LIVE("live"),
/**
* 打卡 * 打卡
*/ */
CLOCK("clock"); CLOCK("clock");
......
package com.pcloud.common.core.dto; package com.pcloud.common.core.dto;
import java.io.Serializable; import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
/** /**
* 事件埋点 * 事件埋点
*
* @author 石纯山 * @author 石纯山
* @date 2018/4/16 * @date 2018/4/16
*/ */
public class FrontEventDto implements Serializable { public class FrontEventDto implements Serializable {
/** private static final long serialVersionUID = 7668311875701119389L;
*
*/
private static final long serialVersionUID = 3065716090982449711L;
/** /**
* 事件id * 事件id
*/ */
...@@ -23,6 +21,11 @@ public class FrontEventDto implements Serializable { ...@@ -23,6 +21,11 @@ public class FrontEventDto implements Serializable {
private String funnelId; private String funnelId;
/** /**
* 事件id集合
*/
private Map<String,String> eventMap;
/**
* 编辑id * 编辑id
*/ */
private Long adviserId; private Long adviserId;
...@@ -215,13 +218,42 @@ public class FrontEventDto implements Serializable { ...@@ -215,13 +218,42 @@ public class FrontEventDto implements Serializable {
this.systemCode = systemCode; this.systemCode = systemCode;
} }
public Map<String, String> getEventMap() {
return eventMap;
}
public void setEventMap(Map<String, String> eventMap) {
this.eventMap = eventMap;
}
public void setEventMap(String eventId, String funnelId) {
if(eventMap == null){
eventMap = new HashMap<>();
}
eventMap.put(eventId,funnelId);
}
@Override @Override
public String toString() { public String toString() {
return "PaymentEventDto{" + "eventId='" + eventId + '\'' + ", funnelId='" + funnelId + '\'' + ", adviserId=" return "FrontEventDto{" +
+ adviserId + ", channelId=" + channelId + ", sourceType=" + sourceType + ", timestamp=" + timestamp "eventId='" + eventId + '\'' +
+ ", platCode='" + platCode + '\'' + ", isReader=" + isReader + ", partyId=" + partyId ", funnelId='" + funnelId + '\'' +
+ ", systemCode='" + systemCode + '\'' + ", officeAccountId=" + officeAccountId + ", wechatUserId=" ", eventMap=" + eventMap +
+ wechatUserId + ", sceneId=" + sceneId + ", agentId=" + agentId + ", Exp1='" + Exp1 + '\'' + ", Exp2='" ", adviserId=" + adviserId +
+ Exp2 + '\'' + ", Exp3='" + Exp3 + '\'' + '}'; ", channelId=" + channelId +
", sourceType=" + sourceType +
", timestamp=" + timestamp +
", platCode='" + platCode + '\'' +
", isReader=" + isReader +
", partyId=" + partyId +
", systemCode='" + systemCode + '\'' +
", officeAccountId=" + officeAccountId +
", wechatUserId=" + wechatUserId +
", sceneId=" + sceneId +
", agentId=" + agentId +
", Exp1='" + Exp1 + '\'' +
", Exp2='" + Exp2 + '\'' +
", Exp3='" + Exp3 + '\'' +
'}';
} }
} }
/**
*
*/
package com.pcloud.common.enums; package com.pcloud.common.enums;
import com.google.common.collect.Maps;
import java.util.Arrays;
import java.util.Map;
/** /**
* @描述:应用类型常量枚举 * @描述:应用类型常量枚举
* @作者:songx * @作者:songx
...@@ -48,6 +50,17 @@ public enum AppTypeEnum { ...@@ -48,6 +50,17 @@ public enum AppTypeEnum {
WISH("WISH"); // 愿望单 WISH("WISH"); // 愿望单
/** /**
* 枚举转换
*/
public static final Map<String, AppTypeEnum> APP_TYPE_MAP = Maps.newHashMap();
static {
Arrays.asList(AppTypeEnum.values()).forEach(m -> {
APP_TYPE_MAP.put(m.value, m);
});
}
/**
* 值 * 值
*/ */
public final String value; public final String value;
......
package com.pcloud.common.utils;
import org.springframework.beans.BeanUtils;
/**
*
*
* @author:songx
* @date:2018年8月24日,下午2:18:40
*/
public class BeanNewUtils {
/**
* 实体类之间的转换
*
* @param source
* 来源
* @param clazz
* 目标对象
* @return
*/
public static <T> T copyProperties(Object source, T t) {
if (source == null || t == null) {
return t;
}
BeanUtils.copyProperties(source, t);
return t;
}
}
...@@ -6,6 +6,7 @@ import java.text.SimpleDateFormat; ...@@ -6,6 +6,7 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List; import java.util.List;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -1603,4 +1604,78 @@ public class DateUtils extends org.apache.commons.lang.time.DateUtils { ...@@ -1603,4 +1604,78 @@ public class DateUtils extends org.apache.commons.lang.time.DateUtils {
return calendar.getTime(); return calendar.getTime();
} }
/**
* 获取今天开始时间
* @return
*/
public static Date getDayBegin() {
Calendar cal = new GregorianCalendar();
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
return cal.getTime();
}
/**
* 获取今天结束时间
* @return
*/
public static Date getDayEnd() {
Calendar cal = new GregorianCalendar();
cal.set(Calendar.HOUR_OF_DAY, 23);
cal.set(Calendar.MINUTE, 59);
cal.set(Calendar.SECOND, 59);
return cal.getTime();
}
/**
* 获取某个日期的开始时间
* @param day
* @return
*/
public static Timestamp getDayStartTime(Date day) {
Calendar calendar = Calendar.getInstance();
if (null != day) calendar.setTime(day);
calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
calendar.set(Calendar.MILLISECOND, 0);
return new Timestamp(calendar.getTimeInMillis());
}
/**
* 获取某个日期的结束时间
* @param day 日期
* @return
*/
public static Timestamp getDayEndTime(Date day) {
Calendar calendar = Calendar.getInstance();
if (null != day) calendar.setTime(day);
calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH), 23, 59, 59);
calendar.set(Calendar.MILLISECOND, 999);
return new Timestamp(calendar.getTimeInMillis());
}
/**
* 获取昨天开始时间
*
* @return
*/
public static Date getBeginDayOfYesterday() {
Calendar cal = new GregorianCalendar();
cal.setTime(getDayBegin());
cal.add(Calendar.DAY_OF_MONTH, -1);
return cal.getTime();
}
/**
* 获取昨天的结束时间
* @return
*/
public static Date getEndDayOfYesterDay() {
Calendar cal = new GregorianCalendar();
cal.setTime(getDayEnd());
cal.add(Calendar.DAY_OF_MONTH, -1);
return cal.getTime();
}
} }
...@@ -8,6 +8,7 @@ import java.util.List; ...@@ -8,6 +8,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import org.apache.commons.lang3.StringUtils;
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;
...@@ -19,6 +20,7 @@ import com.google.common.collect.Maps; ...@@ -19,6 +20,7 @@ import com.google.common.collect.Maps;
import com.pcloud.common.utils.ListUtils; import com.pcloud.common.utils.ListUtils;
import com.pcloud.common.utils.string.StringUtil; import com.pcloud.common.utils.string.StringUtil;
import org.springframework.util.CollectionUtils;
import redis.clients.jedis.JedisCluster; import redis.clients.jedis.JedisCluster;
/** /**
...@@ -45,10 +47,8 @@ public class JedisClusterUtils { ...@@ -45,10 +47,8 @@ public class JedisClusterUtils {
/** /**
* 保存一个字符串到redis中,长期有效 * 保存一个字符串到redis中,长期有效
* *
* @param key * @param key 键
* 键 * @param value 值
* @param value
* 值
* @return * @return
*/ */
public static boolean set(String key, String value) { public static boolean set(String key, String value) {
...@@ -62,14 +62,82 @@ public class JedisClusterUtils { ...@@ -62,14 +62,82 @@ public class JedisClusterUtils {
} }
/** /**
* 根据前缀匹配模糊删除
*
* @param fuzzyKey 模糊前缀
* @return 删除的数量
*/
public static int fuzzyDel(String fuzzyKey) {
if (StringUtils.isBlank(fuzzyKey)) {
return 0;
}
Set<String> keys = jedisCluster.hkeys(fuzzyKey);
if (CollectionUtils.isEmpty(keys)) {
return 0;
}
int num = 0;
for (String key : keys) {
if (del(key)) {
num++;
}
}
return num;
}
/**
* 保存一个字符串到redis中,长期有效
*
* @param key 键
* @param value 值
* @return
*/
public static boolean getSet(String key, String value) {
try {
jedisCluster.getSet(key, value);
} catch (Exception e) {
LOGGER.warn("jedis缓存保存失败:" + e.getMessage(), e);
return false;
}
return true;
}
public static String getSetR(String key,String value){
String set;
try {
set = jedisCluster.getSet(key, value);
} catch (Exception e) {
LOGGER.warn("jedis缓存保存失败:" + e.getMessage(), e);
return null;
}
return set;
}
/**
* 保存一个字符串到redis中并指定过期时间 * 保存一个字符串到redis中并指定过期时间
* *
* @param key * @param key 键
* 键 * @param value 值
* @param value * @param seconds 有效时间,为null使用默认时间30分钟
* 值 * @return 旧值
* @param seconds */
* 有效时间,为null使用默认时间30分钟 public static String getSet(String key, String value, Integer seconds) {
String set;
try {
set = jedisCluster.getSet(key, value);
expire(key, seconds);
} catch (Exception e) {
LOGGER.warn("jedis getSet缓存保存失败:" + e.getMessage(), e);
return null;
}
return set;
}
/**
* 保存一个字符串到redis中并指定过期时间
*
* @param key 键
* @param value 值
* @param seconds 有效时间,为null使用默认时间30分钟
* @return * @return
*/ */
public static boolean set(String key, String value, Integer seconds) { public static boolean set(String key, String value, Integer seconds) {
...@@ -86,10 +154,8 @@ public class JedisClusterUtils { ...@@ -86,10 +154,8 @@ public class JedisClusterUtils {
/** /**
* 保存一个字符串到redis中,长期有效 * 保存一个字符串到redis中,长期有效
* *
* @param objecKey * @param objecKey 键
* 键 * @param objecValue 缓存对象
* @param objecValue
* 缓存对象
* @return * @return
*/ */
public static boolean setObject(Object key, Object value) { public static boolean setObject(Object key, Object value) {
...@@ -105,12 +171,9 @@ public class JedisClusterUtils { ...@@ -105,12 +171,9 @@ public class JedisClusterUtils {
/** /**
* 保存一个字符串到redis中并指定过期时间 * 保存一个字符串到redis中并指定过期时间
* *
* @param objecKey * @param objecKey 键
* 键 * @param objecValue 缓存对象
* @param objecValue * @param seconds 时间,如果为null,则使用默认时间30分钟
* 缓存对象
* @param seconds
* 时间,如果为null,则使用默认时间30分钟
* @return * @return
*/ */
public static boolean setObject(Object key, Object value, Integer seconds) { public static boolean setObject(Object key, Object value, Integer seconds) {
...@@ -165,8 +228,7 @@ public class JedisClusterUtils { ...@@ -165,8 +228,7 @@ public class JedisClusterUtils {
/** /**
* 根据缓存键获取Redis缓存中的值.<br/> * 根据缓存键获取Redis缓存中的值.<br/>
* *
* @param key * @param key 键
* 键
* @return * @return
*/ */
public static String get(String key) { public static String get(String key) {
...@@ -181,8 +243,7 @@ public class JedisClusterUtils { ...@@ -181,8 +243,7 @@ public class JedisClusterUtils {
/** /**
* 根据缓存键获取Redis缓存中的对象.<br/> * 根据缓存键获取Redis缓存中的对象.<br/>
* *
* @param objecKey * @param objecKey 键
* 键
* @return * @return
*/ */
public static Object getObject(Object key) { public static Object getObject(Object key) {
...@@ -262,10 +323,8 @@ public class JedisClusterUtils { ...@@ -262,10 +323,8 @@ public class JedisClusterUtils {
/** /**
* 保存一个Map对象到redis中,长期有效 * 保存一个Map对象到redis中,长期有效
* *
* @param key * @param key 键
* 键 * @param hash Map组合的字符串
* @param hash
* Map组合的字符串
* @return * @return
*/ */
public static boolean hmset(String key, Map<String, String> hash) { public static boolean hmset(String key, Map<String, String> hash) {
...@@ -281,12 +340,9 @@ public class JedisClusterUtils { ...@@ -281,12 +340,9 @@ public class JedisClusterUtils {
/** /**
* 保存一个Map对象到redis中并指定过期时间 * 保存一个Map对象到redis中并指定过期时间
* *
* @param key * @param key 键
* 键 * @param hash Map组合的字符串
* @param hash * @param seconds 时间
* Map组合的字符串
* @param seconds
* 时间
* @return * @return
*/ */
public static boolean hmset(String key, Map<String, String> hash, Integer seconds) { public static boolean hmset(String key, Map<String, String> hash, Integer seconds) {
...@@ -413,8 +469,7 @@ public class JedisClusterUtils { ...@@ -413,8 +469,7 @@ public class JedisClusterUtils {
* 根据缓存键获取Redis缓存中的Map.<br/> * 根据缓存键获取Redis缓存中的Map.<br/>
* *
* @param key * @param key
* @param fields * @param fields 具体的map键
* 具体的map键
* @return * @return
*/ */
public static Map<String, String> hgetAll(String key) { public static Map<String, String> hgetAll(String key) {
...@@ -431,8 +486,7 @@ public class JedisClusterUtils { ...@@ -431,8 +486,7 @@ public class JedisClusterUtils {
* 可以指定Map具体的键值获取精确数据 * 可以指定Map具体的键值获取精确数据
* *
* @param key * @param key
* @param fields * @param fields 具体的map键
* 具体的map键
* @return * @return
*/ */
public static Map<String, String> hmget(String key, String... fields) { public static Map<String, String> hmget(String key, String... fields) {
...@@ -527,10 +581,8 @@ public class JedisClusterUtils { ...@@ -527,10 +581,8 @@ public class JedisClusterUtils {
/** /**
* 根据缓存键删除map中的指定键值 * 根据缓存键删除map中的指定键值
* *
* @param key * @param key 缓存键
* 缓存键 * @param field map键值
* @param field
* map键值
* @return 删除成功返回1,失败返回0 * @return 删除成功返回1,失败返回0
*/ */
public static Boolean hdel(String key, String... fields) { public static Boolean hdel(String key, String... fields) {
...@@ -730,10 +782,8 @@ public class JedisClusterUtils { ...@@ -730,10 +782,8 @@ public class JedisClusterUtils {
* 获取指定key的list集合 * 获取指定key的list集合
* *
* @param key * @param key
* @param start * @param start list中的起始位置,从0开始
* list中的起始位置,从0开始 * @param len 长度,-1获取所有
* @param len
* 长度,-1获取所有
* @return * @return
*/ */
public static List<String> lrange(String key, long start, long len) { public static List<String> lrange(String key, long start, long len) {
...@@ -946,6 +996,7 @@ public class JedisClusterUtils { ...@@ -946,6 +996,7 @@ public class JedisClusterUtils {
/** /**
* 有序序列(Sort-Set)集合:添加数据 * 有序序列(Sort-Set)集合:添加数据
*
* @param key * @param key
* @return * @return
*/ */
...@@ -961,6 +1012,7 @@ public class JedisClusterUtils { ...@@ -961,6 +1012,7 @@ public class JedisClusterUtils {
/** /**
* 获取指定key的Sort-Set集合长度 * 获取指定key的Sort-Set集合长度
*
* @return * @return
*/ */
public static Long zcard(String key) { public static Long zcard(String key) {
...@@ -974,6 +1026,7 @@ public class JedisClusterUtils { ...@@ -974,6 +1026,7 @@ public class JedisClusterUtils {
/** /**
* 获取指定key的Sort-Set集合中member元素所在的位置排行(从 0 开始) * 获取指定key的Sort-Set集合中member元素所在的位置排行(从 0 开始)
*
* @return * @return
*/ */
public static Long zrank(String key, String member) { public static Long zrank(String key, String member) {
...@@ -987,6 +1040,7 @@ public class JedisClusterUtils { ...@@ -987,6 +1040,7 @@ public class JedisClusterUtils {
/** /**
* 获取指定key的Sort-Set集合的元素(按照score从小到大排序) * 获取指定key的Sort-Set集合的元素(按照score从小到大排序)
*
* @return * @return
*/ */
public static Set<String> zrange(String key, long start, long end) { public static Set<String> zrange(String key, long start, long end) {
...@@ -1000,6 +1054,7 @@ public class JedisClusterUtils { ...@@ -1000,6 +1054,7 @@ public class JedisClusterUtils {
/** /**
* 获取指定key的Sort-Set集合的元素(按照score从大到小排序) * 获取指定key的Sort-Set集合的元素(按照score从大到小排序)
*
* @return * @return
*/ */
public static Set<String> zrevrange(String key, long start, long end) { public static Set<String> zrevrange(String key, long start, long end) {
...@@ -1013,6 +1068,7 @@ public class JedisClusterUtils { ...@@ -1013,6 +1068,7 @@ public class JedisClusterUtils {
/** /**
* 删除指定key的Sort-Set集合的元素 * 删除指定key的Sort-Set集合的元素
*
* @return * @return
*/ */
public static boolean zrem(String key, long start, long end) { public static boolean zrem(String key, long start, long end) {
...@@ -1138,8 +1194,7 @@ public class JedisClusterUtils { ...@@ -1138,8 +1194,7 @@ public class JedisClusterUtils {
* *
* @param key * @param key
* @param obj * @param obj
* @param seconds * @param seconds 有效期(秒)
* 有效期(秒)
* @return * @return
*/ */
public static Boolean setJson(String key, Object obj, Integer seconds) { public static Boolean setJson(String key, Object obj, Integer seconds) {
...@@ -1204,8 +1259,7 @@ public class JedisClusterUtils { ...@@ -1204,8 +1259,7 @@ public class JedisClusterUtils {
* 设置超时时间 * 设置超时时间
* *
* @param key * @param key
* @param seconds * @param seconds 超时时间(单位为秒)
* 超时时间(单位为秒)
* @return * @return
*/ */
public static boolean expireObject(Object key, Integer seconds) { public static boolean expireObject(Object key, Integer seconds) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment