记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董敬伟
liquidnet-bus-v1
Commits
d9f080de
Commit
d9f080de
authored
Aug 16, 2021
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
redis 批量删除 修改 获取场地相关方法
parent
15a05d19
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
202 additions
and
307 deletions
+202
-307
MongoVoUtils.java
...idnet/client/admin/zhengzai/kylin/utils/MongoVoUtils.java
+5
-5
PerformanceVoUtils.java
...client/admin/zhengzai/kylin/utils/PerformanceVoUtils.java
+2
-3
RedisUtil.java
...java/com.liquidnet.common.cache/redis/util/RedisUtil.java
+168
-269
FieldsServiceImpl.java
...quidnet/service/kylin/service/impl/FieldsServiceImpl.java
+1
-1
DataUtils.java
...ain/java/com/liquidnet/service/kylin/utils/DataUtils.java
+1
-1
DataImpl.java
...quidnet/service/platform/service/impl/kylin/DataImpl.java
+5
-8
KylinPerformancesPartnerServiceImpl.java
...ice/impl/partner/KylinPerformancesPartnerServiceImpl.java
+2
-3
MongoVoUtils.java
...va/com/liquidnet/service/platform/utils/MongoVoUtils.java
+6
-6
PerformanceVoTask.java
...m/liquidnet/service/platform/utils/PerformanceVoTask.java
+2
-2
RedisDataUtils.java
...ava/com/liquidnet/service/sweet/utils/RedisDataUtils.java
+5
-5
RedisMDSKDataUtils.java
...com/liquidnet/service/sweet/utils/RedisMDSKDataUtils.java
+5
-4
No files found.
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/kylin/utils/MongoVoUtils.java
View file @
d9f080de
...
...
@@ -53,12 +53,12 @@ public class MongoVoUtils {
KylinPerformanceRelations
p3
=
performanceRelationsMapper
.
selectOne
(
new
UpdateWrapper
<
KylinPerformanceRelations
>().
eq
(
"performance_id"
,
performancesId
));
//场地相关数据
KylinFields
fields
=
new
KylinFields
();
String
cityName
=
(
String
)
redisUtil
.
hg
et
(
KylinRedisConst
.
FIELDS
+
":"
+
p3
.
getFieldId
(),
"city_name"
);
String
cityName
=
(
String
)
redisUtil
.
getDB15RedisHG
et
(
KylinRedisConst
.
FIELDS
+
":"
+
p3
.
getFieldId
(),
"city_name"
);
fields
.
setCityId
(
null
);
fields
.
setLatitude
((
String
)
redisUtil
.
hg
et
(
KylinRedisConst
.
FIELDS
+
":"
+
p3
.
getFieldId
(),
"latitude"
));
fields
.
setLongitude
((
String
)
redisUtil
.
hg
et
(
KylinRedisConst
.
FIELDS
+
":"
+
p3
.
getFieldId
(),
"longitude"
));
fields
.
setCityName
((
String
)
redisUtil
.
hg
et
(
KylinRedisConst
.
FIELDS
+
":"
+
p3
.
getFieldId
(),
"city_name"
));
fields
.
setName
((
String
)
redisUtil
.
hg
et
(
KylinRedisConst
.
FIELDS
+
":"
+
p3
.
getFieldId
(),
"name"
));
fields
.
setLatitude
((
String
)
redisUtil
.
getDB15RedisHG
et
(
KylinRedisConst
.
FIELDS
+
":"
+
p3
.
getFieldId
(),
"latitude"
));
fields
.
setLongitude
((
String
)
redisUtil
.
getDB15RedisHG
et
(
KylinRedisConst
.
FIELDS
+
":"
+
p3
.
getFieldId
(),
"longitude"
));
fields
.
setCityName
((
String
)
redisUtil
.
getDB15RedisHG
et
(
KylinRedisConst
.
FIELDS
+
":"
+
p3
.
getFieldId
(),
"city_name"
));
fields
.
setName
((
String
)
redisUtil
.
getDB15RedisHG
et
(
KylinRedisConst
.
FIELDS
+
":"
+
p3
.
getFieldId
(),
"name"
));
//相关状态时间初始变量
LocalDateTime
stopSellTime
=
null
;
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/kylin/utils/PerformanceVoUtils.java
View file @
d9f080de
...
...
@@ -33,7 +33,6 @@ import org.springframework.stereotype.Component;
import
java.math.BigDecimal
;
import
java.text.SimpleDateFormat
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.util.ArrayList
;
import
java.util.Comparator
;
import
java.util.HashMap
;
...
...
@@ -250,8 +249,8 @@ public class PerformanceVoUtils {
KylinPerformanceRelations
performanceRelations
=
new
KylinPerformanceRelations
();
BeanUtils
.
copyProperties
(
performanceUpdateMisVo
,
performanceRelations
);
performances
.
setCityName
((
String
)
redisUtil
.
hg
et
(
KylinRedisConst
.
FIELDS
+
":"
+
performanceRelations
.
getFieldId
(),
"city_name"
));
performances
.
setCityId
(
Integer
.
parseInt
((
String
)
redisUtil
.
hg
et
(
KylinRedisConst
.
FIELDS
+
":"
+
performanceRelations
.
getFieldId
(),
"city_id"
)));
performances
.
setCityName
((
String
)
redisUtil
.
getDB15RedisHG
et
(
KylinRedisConst
.
FIELDS
+
":"
+
performanceRelations
.
getFieldId
(),
"city_name"
));
performances
.
setCityId
(
Integer
.
parseInt
((
String
)
redisUtil
.
getDB15RedisHG
et
(
KylinRedisConst
.
FIELDS
+
":"
+
performanceRelations
.
getFieldId
(),
"city_id"
)));
performances
.
setCreatedAt
(
DateUtil
.
asLocalDateTime
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
).
parse
(
performanceUpdateMisVo
.
getCreatedAt
())));
performances
.
setTimeStart
(
DateUtil
.
asLocalDateTime
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
).
parse
(
performanceUpdateMisVo
.
getTimeStart
())));
performances
.
setTimeEnd
(
DateUtil
.
asLocalDateTime
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
).
parse
(
performanceUpdateMisVo
.
getTimeEnd
())));
...
...
liquidnet-bus-common/liquidnet-common-cache/liquidnet-common-cache-redis/src/main/java/com.liquidnet.common.cache/redis/util/RedisUtil.java
View file @
d9f080de
...
...
@@ -6,9 +6,7 @@ import org.springframework.data.redis.core.RedisTemplate;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.CollectionUtils
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.*
;
import
java.util.concurrent.TimeUnit
;
/**
...
...
@@ -22,45 +20,38 @@ import java.util.concurrent.TimeUnit;
*/
@Component
(
"redisUtil"
)
public
final
class
RedisUtil
{
@Autowired
private
RedisConfig
redisConfig
;
@Autowired
private
RedisConfig
redisConfig
;
// =============================common============================
/**
* 指定缓存失效时间
* @param key 键
*
* @param key 键
* @param time 时间(秒)
* @return
*/
public
boolean
expire
(
String
key
,
long
time
)
{
if
(
time
>
0
)
{
if
(
time
>
0
)
{
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
expire
(
key
,
time
,
TimeUnit
.
SECONDS
);
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
expire
(
key
,
time
,
TimeUnit
.
SECONDS
);
}
}
return
true
;
return
true
;
}
/**
* 根据key 获取过期时间
*
* @param key 键 不能为null
* @return 时间(秒) 返回0代表为永久有效
*/
public
long
getExpire
(
String
key
)
{
...
...
@@ -71,18 +62,15 @@ public final class RedisUtil {
/**
* 判断key是否存在
*
* @param key 键
* @return true 存在 false不存在
*/
public
boolean
hasKey
(
String
key
)
{
return
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
hasKey
(
key
);
return
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
hasKey
(
key
);
}
...
...
@@ -93,7 +81,7 @@ public final class RedisUtil {
*/
public
void
delKeysByPrefix
(
String
prefix
)
{
if
(
null
!=
prefix
&&
prefix
.
trim
().
length
()
>
0
)
{
for
(
Integer
key:
RedisConfig
.
redisTemplateMap
.
keySet
())
{
for
(
Integer
key
:
RedisConfig
.
redisTemplateMap
.
keySet
())
{
Set
<
String
>
keys
=
redisConfig
.
getRedisTemplateByDb
(
key
).
keys
(
prefix
.
concat
(
"*"
));
if
(!
CollectionUtils
.
isEmpty
(
keys
))
{
...
...
@@ -105,11 +93,9 @@ public final class RedisUtil {
/**
* 删除缓存(多db情况需要单独实现批量删除-该方法慎重使用)
*
* @param key 可以传一个值 或多个
*/
@SuppressWarnings
(
"unchecked"
)
...
...
@@ -125,7 +111,7 @@ public final class RedisUtil {
}
else
{
// redisTemplate.delete(CollectionUtils.arrayToList(key));
for
(
String
keyStr:
key
)
{
for
(
String
keyStr
:
key
)
{
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
keyStr
)).
delete
(
keyStr
);
}
}
...
...
@@ -134,27 +120,49 @@ public final class RedisUtil {
}
public
void
delList
(
List
<
String
>
key
)
{
private
static
final
ArrayList
<
String
>
STRING_ARRAY_LIST
=
new
ArrayList
<>();
private
static
final
HashMap
<
Integer
,
ArrayList
<
String
>>
INTEGER_ARRAY_LIST_HASH_MAP
=
new
HashMap
();
public
static
ArrayList
<
String
>
arrayListString
()
{
return
(
ArrayList
<
String
>)
STRING_ARRAY_LIST
.
clone
();
}
public
static
HashMap
<
Integer
,
ArrayList
<
String
>>
hashMapIntegerArrayList
()
{
return
(
HashMap
<
Integer
,
ArrayList
<
String
>>)
INTEGER_ARRAY_LIST_HASH_MAP
.
clone
();
}
public
void
delList
(
List
<
String
>
key
)
{
HashMap
<
Integer
,
ArrayList
<
String
>>
hashMap
;
if
(
key
!=
null
&&
key
.
size
()
>
0
)
{
for
(
String
keyStr:
key
){
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
keyStr
)).
delete
(
keyStr
);
hashMap
=
hashMapIntegerArrayList
();
//构建 需要删除的Redis HashMapDBKey
for
(
String
keyStr
:
key
)
{
Integer
dbPosition
=
MathUtil
.
getIndex
(
keyStr
);
ArrayList
<
String
>
dbArray
;
if
(
hashMap
.
containsKey
(
dbPosition
))
{
dbArray
=
hashMap
.
get
(
dbPosition
);
}
else
{
dbArray
=
arrayListString
();
}
dbArray
.
add
(
keyStr
);
hashMap
.
put
(
dbPosition
,
dbArray
);
}
// redisTemplate.delete(key);
}
//删除Redis
for
(
Integer
redisDb:
hashMap
.
keySet
())
{
ArrayList
<
String
>
delRedisKeyList
=
hashMap
.
get
(
redisDb
);
redisConfig
.
getRedisTemplateByDb
(
redisDb
).
delete
(
delRedisKeyList
);
}
}
}
// ============================String=============================
/**
* 普通缓存获取
*
* @param key 键
* @return 值
*/
public
Object
get
(
String
key
)
{
...
...
@@ -165,72 +173,58 @@ public final class RedisUtil {
/**
* 普通缓存放入
* @param key 键
*
* @param key 键
* @param value 值
* @return true成功 false失败
*/
public
boolean
set
(
String
key
,
Object
value
)
{
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
opsForValue
().
set
(
key
,
value
);
return
true
;
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
opsForValue
().
set
(
key
,
value
);
return
true
;
}
/**
* 普通缓存放入并设置时间
* @param key 键
*
* @param key 键
* @param value 值
* @param time 时间(秒) time要大于0 如果time小于等于0 将设置无限期
* @param time 时间(秒) time要大于0 如果time小于等于0 将设置无限期
* @return true成功 false 失败
*/
public
boolean
set
(
String
key
,
Object
value
,
long
time
)
{
if
(
time
>
0
)
{
RedisTemplate
<
String
,
Object
>
redisTemplate
=
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
));
redisTemplate
.
opsForValue
().
set
(
key
,
value
,
time
,
TimeUnit
.
SECONDS
);
if
(
time
>
0
)
{
RedisTemplate
<
String
,
Object
>
redisTemplate
=
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
));
redisTemplate
.
opsForValue
().
set
(
key
,
value
,
time
,
TimeUnit
.
SECONDS
);
}
else
{
}
else
{
set
(
key
,
value
);
set
(
key
,
value
);
}
}
return
true
;
return
true
;
}
/**
* 递增
* @param key 键
*
* @param key 键
* @param delta 要增加几(大于0)
* @return
*/
public
long
incr
(
String
key
,
long
delta
)
{
...
...
@@ -247,15 +241,11 @@ public final class RedisUtil {
/**
* 递减
* @param key 键
*
* @param key 键
* @param delta 要减少几(小于0)
* @return
*/
public
long
decr
(
String
key
,
long
delta
)
{
...
...
@@ -274,15 +264,11 @@ public final class RedisUtil {
// ================================Map=================================
/**
* HashGet
* @param key 键 不能为null
*
* @param key 键 不能为null
* @param item 项 不能为null
* @return 值
*/
public
Object
hget
(
String
key
,
String
item
)
{
...
...
@@ -295,13 +281,10 @@ public final class RedisUtil {
/**
* 获取hashKey对应的所有键值
*
* @param key 键
* @return 对应的多个键值
*/
public
Map
<
Object
,
Object
>
hmget
(
String
key
)
{
...
...
@@ -312,125 +295,102 @@ public final class RedisUtil {
/**
* HashSet
*
* @param key 键
* @param map 对应多个键值
* @return true 成功 false 失败
*/
public
boolean
hmset
(
String
key
,
Map
<
String
,
Object
>
map
)
{
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
opsForHash
().
putAll
(
key
,
map
);
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
opsForHash
().
putAll
(
key
,
map
);
return
true
;
return
true
;
}
/**
* HashSet 并设置时间
* @param key 键
* @param map 对应多个键值
*
* @param key 键
* @param map 对应多个键值
* @param time 时间(秒)
* @return true成功 false失败
*/
public
boolean
hmset
(
String
key
,
Map
<
String
,
Object
>
map
,
long
time
)
{
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
opsForHash
().
putAll
(
key
,
map
);
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
opsForHash
().
putAll
(
key
,
map
);
if
(
time
>
0
)
{
if
(
time
>
0
)
{
expire
(
key
,
time
);
expire
(
key
,
time
);
}
}
return
true
;
return
true
;
}
/**
* 向一张hash表中放入数据,如果不存在将创建
* @param key 键
* @param item 项
*
* @param key 键
* @param item 项
* @param value 值
* @return true 成功 false失败
*/
public
boolean
hset
(
String
key
,
String
item
,
Object
value
)
{
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
opsForHash
().
put
(
key
,
item
,
value
);
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
opsForHash
().
put
(
key
,
item
,
value
);
return
true
;
return
true
;
}
/**
* 向一张hash表中放入数据,如果不存在将创建
* @param key 键
* @param item 项
*
* @param key 键
* @param item 项
* @param value 值
* @param time 时间(秒) 注意:如果已存在的hash表有时间,这里将会替换原有的时间
* @param time 时间(秒) 注意:如果已存在的hash表有时间,这里将会替换原有的时间
* @return true 成功 false失败
*/
public
boolean
hset
(
String
key
,
String
item
,
Object
value
,
long
time
)
{
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
opsForHash
().
put
(
key
,
item
,
value
);
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
opsForHash
().
put
(
key
,
item
,
value
);
if
(
time
>
0
)
{
if
(
time
>
0
)
{
expire
(
key
,
time
);
expire
(
key
,
time
);
}
}
return
true
;
return
true
;
}
/**
* 删除hash表中的值
* @param key 键 不能为null
*
* @param key 键 不能为null
* @param item 项 可以使多个 不能为null
*/
public
void
hdel
(
String
key
,
Object
...
item
)
{
...
...
@@ -441,15 +401,11 @@ public final class RedisUtil {
/**
* 判断hash表中是否有该项的值
* @param key 键 不能为null
*
* @param key 键 不能为null
* @param item 项 不能为null
* @return true 存在 false不存在
*/
public
boolean
hHasKey
(
String
key
,
String
item
)
{
...
...
@@ -460,17 +416,12 @@ public final class RedisUtil {
/**
* hash递增 如果不存在,就会创建一个 并把新增后的值返回
* @param key 键
*
* @param key 键
* @param item 项
* @param by 要增加几(大于0)
* @param by 要增加几(大于0)
* @return
*/
public
double
hincr
(
String
key
,
String
item
,
double
by
)
{
...
...
@@ -481,17 +432,12 @@ public final class RedisUtil {
/**
* hash递减
* @param key 键
*
* @param key 键
* @param item 项
* @param by 要减少记(小于0)
* @param by 要减少记(小于0)
* @return
*/
public
double
hdecr
(
String
key
,
String
item
,
double
by
)
{
...
...
@@ -504,132 +450,109 @@ public final class RedisUtil {
// ============================set=============================
/**
* 根据key获取Set中的所有值
*
* @param key 键
* @return
*/
public
Set
<
Object
>
sGet
(
String
key
)
{
return
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
opsForSet
().
members
(
key
);
return
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
opsForSet
().
members
(
key
);
}
/**
* 根据value从一个set中查询,是否存在
* @param key 键
*
* @param key 键
* @param value 值
* @return true 存在 false不存在
*/
public
boolean
sHasKey
(
String
key
,
Object
value
)
{
return
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
opsForSet
().
isMember
(
key
,
value
);
return
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
opsForSet
().
isMember
(
key
,
value
);
}
/**
* 将数据放入set缓存
* @param key 键
*
* @param key 键
* @param values 值 可以是多个
* @return 成功个数
*/
public
long
sSet
(
String
key
,
Object
...
values
)
{
return
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
opsForSet
().
add
(
key
,
values
);
return
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
opsForSet
().
add
(
key
,
values
);
}
/**
* 将set数据放入缓存
* @param key 键
* @param time 时间(秒)
*
* @param key 键
* @param time 时间(秒)
* @param values 值 可以是多个
* @return 成功个数
*/
public
long
sSetAndTime
(
String
key
,
long
time
,
Object
...
values
)
{
Long
count
=
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
opsForSet
().
add
(
key
,
values
);
Long
count
=
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
opsForSet
().
add
(
key
,
values
);
if
(
time
>
0
)
if
(
time
>
0
)
expire
(
key
,
time
);
expire
(
key
,
time
);
return
count
;
return
count
;
}
/**
* 获取set缓存的长度
*
* @param key 键
* @return
*/
public
long
sGetSetSize
(
String
key
)
{
return
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
opsForSet
().
size
(
key
);
return
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
opsForSet
().
size
(
key
);
}
/**
* 移除值为value的
* @param key 键
*
* @param key 键
* @param values 值 可以是多个
* @return 移除的个数
*/
public
long
setRemove
(
String
key
,
Object
...
values
)
{
Long
count
=
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
opsForSet
().
remove
(
key
,
values
);
Long
count
=
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
opsForSet
().
remove
(
key
,
values
);
return
count
;
return
count
;
}
...
...
@@ -638,63 +561,51 @@ public final class RedisUtil {
/**
* 获取list缓存的内容
* @param key 键
*
* @param key 键
* @param start 开始
* @param end 结束 0 到 -1代表所有值
* @param end 结束 0 到 -1代表所有值
* @return
*/
public
List
<
Object
>
lGet
(
String
key
,
long
start
,
long
end
)
{
return
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
opsForList
().
range
(
key
,
start
,
end
);
return
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
opsForList
().
range
(
key
,
start
,
end
);
}
/**
* 获取list缓存的长度
*
* @param key 键
* @return
*/
public
long
lGetListSize
(
String
key
)
{
return
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
opsForList
().
size
(
key
);
return
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
opsForList
().
size
(
key
);
}
/**
* 通过索引 获取list中的值
* @param key 键
*
* @param key 键
* @param index 索引 index>=0时, 0 表头,1 第二个元素,依次类推;index<0时,-1,表尾,-2倒数第二个元素,依次类推
* @return
*/
public
Object
lGetIndex
(
String
key
,
long
index
)
{
return
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
opsForList
().
index
(
key
,
index
);
return
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
opsForList
().
index
(
key
,
index
);
}
...
...
@@ -702,6 +613,7 @@ public final class RedisUtil {
/**
* 将list放入缓存
*
* @param key
* @param value
* @return
...
...
@@ -709,38 +621,33 @@ public final class RedisUtil {
public
boolean
lSet
(
String
key
,
Object
value
)
{
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
opsForList
().
rightPush
(
key
,
value
);
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
opsForList
().
rightPush
(
key
,
value
);
return
true
;
return
true
;
}
/**
* 将list放入缓存
* @param key 键
*
* @param key 键
* @param value 值
* @param time 时间(秒)
* @param time 时间(秒)
* @return
*/
public
boolean
lSet
(
String
key
,
Object
value
,
long
time
)
{
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
opsForList
().
rightPush
(
key
,
value
);
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
opsForList
().
rightPush
(
key
,
value
);
if
(
time
>
0
)
if
(
time
>
0
)
expire
(
key
,
time
);
expire
(
key
,
time
);
return
true
;
return
true
;
}
...
...
@@ -748,6 +655,7 @@ public final class RedisUtil {
/**
* 将list放入缓存
*
* @param key
* @param value
* @return
...
...
@@ -755,96 +663,87 @@ public final class RedisUtil {
public
boolean
lSet
(
String
key
,
List
<
Object
>
value
)
{
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
opsForList
().
rightPushAll
(
key
,
value
);
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
opsForList
().
rightPushAll
(
key
,
value
);
return
true
;
return
true
;
}
/**
* 将list放入缓存
*
* @param key 键
* @param key 键
* @param value 值
* @param time 时间(秒)
* @param time 时间(秒)
* @return
*/
public
boolean
lSet
(
String
key
,
List
<
Object
>
value
,
long
time
)
{
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
opsForList
().
rightPushAll
(
key
,
value
);
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
opsForList
().
rightPushAll
(
key
,
value
);
if
(
time
>
0
)
if
(
time
>
0
)
expire
(
key
,
time
);
expire
(
key
,
time
);
return
true
;
return
true
;
}
/**
* 根据索引修改list中的某条数据
* @param key 键
*
* @param key 键
* @param index 索引
* @param value 值
* @return
*/
public
boolean
lUpdateIndex
(
String
key
,
long
index
,
Object
value
)
{
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
opsForList
().
set
(
key
,
index
,
value
);
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
opsForList
().
set
(
key
,
index
,
value
);
return
true
;
return
true
;
}
/**
* 移除N个值为value
* @param key 键
*
* @param key 键
* @param count 移除多少个
* @param value 值
* @return 移除的个数
*/
public
long
lRemove
(
String
key
,
long
count
,
Object
value
)
{
Long
remove
=
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
opsForList
().
remove
(
key
,
count
,
value
);
Long
remove
=
redisConfig
.
getRedisTemplateByDb
(
MathUtil
.
getIndex
(
key
)).
opsForList
().
remove
(
key
,
count
,
value
);
return
remove
;
return
remove
;
}
public
RedisTemplate
<
String
,
Object
>
getRedisTemplateByDb
(
int
db
){
public
RedisTemplate
<
String
,
Object
>
getRedisTemplateByDb
(
int
db
)
{
return
redisConfig
.
getRedisTemplateByDb
(
db
);
}
public
Object
getDB15RedisHGet
(
String
redisKey
,
String
item
)
{
return
redisConfig
.
getRedisTemplateByDb
(
15
).
opsForHash
().
get
(
redisKey
,
item
);
}
public
Object
getDB15RedisGet
(
String
redisKey
)
{
return
redisConfig
.
getRedisTemplateByDb
(
15
).
opsForValue
().
get
(
redisKey
);
}
}
liquidnet-bus-service/liquidnet-service-kylin/liquidnet-service-kylin-impl/src/main/java/com/liquidnet/service/kylin/service/impl/FieldsServiceImpl.java
View file @
d9f080de
...
...
@@ -57,7 +57,7 @@ public class FieldsServiceImpl implements KylinFieldsService {
public
KylinFieldsVo
fieldDetails
(
String
fieldId
)
{
KylinFieldsVo
info
=
null
;
// 获取 redis数据
info
=
(
KylinFieldsVo
)
redisUtil
.
hg
et
(
KylinRedisConst
.
FIELDS
,
fieldId
+
""
);
info
=
(
KylinFieldsVo
)
redisUtil
.
getDB15RedisHG
et
(
KylinRedisConst
.
FIELDS
,
fieldId
+
""
);
//不存在 获取 mongo数据
if
(
null
==
info
)
{
info
=
mongoTemplate
.
findOne
(
Query
.
query
(
Criteria
.
where
(
"fieldsId"
).
is
(
fieldId
)),
KylinFieldsVo
.
class
,
KylinFieldsVo
.
class
.
getSimpleName
());
...
...
liquidnet-bus-service/liquidnet-service-kylin/liquidnet-service-kylin-impl/src/main/java/com/liquidnet/service/kylin/utils/DataUtils.java
View file @
d9f080de
...
...
@@ -208,7 +208,7 @@ public class DataUtils {
*/
public
String
getAgentInfoName
(
String
agentId
)
{
String
redisKey
=
KylinRedisConst
.
PERFORMANCES_AGENT_INFO
.
concat
(
agentId
);
String
name
=
(
String
)
redisUtil
.
hg
et
(
redisKey
,
"name"
);
String
name
=
(
String
)
redisUtil
.
getDB15RedisHG
et
(
redisKey
,
"name"
);
// String name = "";
return
name
;
}
...
...
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/service/impl/kylin/DataImpl.java
View file @
d9f080de
...
...
@@ -16,12 +16,10 @@ import com.liquidnet.service.kylin.dto.vo.partner.KylinTicketPartnerVo;
import
com.liquidnet.service.kylin.dto.vo.partner.KylinTicketTimesPartnerVo
;
import
com.liquidnet.service.kylin.entity.*
;
import
com.liquidnet.service.kylin.mapper.*
;
import
com.liquidnet.service.kylin.service.*
;
import
com.liquidnet.service.platform.utils.DataUtils
;
import
com.liquidnet.service.platform.utils.PerformanceVoTask
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.DigestUtils
;
...
...
@@ -150,7 +148,7 @@ public class DataImpl {
performances
.
setDescribes
(
resultData
.
getString
(
"describe"
));
performances
.
setDetails
(
resultData
.
getString
(
"detail"
));
performances
.
setCityId
(
Integer
.
parseInt
(
resultData
.
getString
(
"city_id"
)));
performances
.
setCityName
((
String
)
redisUtil
.
hg
et
(
KylinRedisConst
.
FIELDS
+
":"
+
resultData
.
getInt
(
"field_id"
),
"city_name"
));
performances
.
setCityName
((
String
)
redisUtil
.
getDB15RedisHG
et
(
KylinRedisConst
.
FIELDS
+
":"
+
resultData
.
getInt
(
"field_id"
),
"city_name"
));
performances
.
setNoticeImage
(
"[{\"id\":1,\"sort\":1,\"message\":\"因演出票品非普通商品,其背后承载的文化服务具有时效性、稀缺性等特征,故不适用7天无理由退货政策。因“不可抗力”导致的演出取消或延期除外。\",\"title\":\"门票退换\",\"type\":\"image\",\"imgUrl\":\"http://img-zhengzai-tv.oss-cn-hangzhou.aliyuncs.com/partner/2019/01/21/5c45722882a13.png\"},{\"id\":7,\"sort\":2,\"message\":\"凭订单二维码或手机号兑票入场,二维码或手机号请勿泄露,以免影响入场。个人原因导致的信息泄露,主办方/平台方不承担任何责任。\",\"title\":\"电子票\",\"type\":\"image\",\"imgUrl\":\"http://img-zhengzai-tv.oss-cn-hangzhou.aliyuncs.com/partner/2019/01/21/5c456d9482fb9.png\"},{\"id\":3,\"sort\":3,\"message\":\"本场演出不设座位,均为站席观演。\",\"title\":\"仅设站席\",\"type\":\"image\",\"imgUrl\":\"http://img-zhengzai-tv.oss-cn-hangzhou.aliyuncs.com/partner/2019/01/21/5c456e93db0b9.png\"},{\"id\":12,\"sort\":4,\"message\":\"每场现场票数量由场地方决定,具体请到现场询问。\",\"title\":\"现场票\",\"type\":\"image\",\"imgUrl\":\"http://img-zhengzai-tv.oss-cn-hangzhou.aliyuncs.com/partner/2019/06/17/5d07647eaa55f.png\"}]"
);
performances
.
setTimeStart
(
DateUtil
.
Formatter
.
yyyyMMddHHmmssS
.
parse
(
resultData
.
getTimestamp
(
"time_start"
).
toString
()));
performances
.
setTimeEnd
(
DateUtil
.
Formatter
.
yyyyMMddHHmmssS
.
parse
(
resultData
.
getTimestamp
(
"time_end"
).
toString
()));
...
...
@@ -203,7 +201,7 @@ public class DataImpl {
performancePartnerVo
.
setTimeStart
(
DateUtil
.
Formatter
.
yyyyMMddHHmmss
.
format
(
performances
.
getTimeStart
()));
performancePartnerVo
.
setTimeEnd
(
DateUtil
.
Formatter
.
yyyyMMddHHmmss
.
format
(
performances
.
getTimeEnd
()));
performancePartnerVo
.
setFieldId
(
performanceRelations
.
getFieldId
());
performancePartnerVo
.
setFieldName
((
String
)
redisUtil
.
hg
et
(
KylinRedisConst
.
FIELDS
+
":"
+
performanceRelations
.
getFieldId
(),
"name"
));
performancePartnerVo
.
setFieldName
((
String
)
redisUtil
.
getDB15RedisHG
et
(
KylinRedisConst
.
FIELDS
+
":"
+
performanceRelations
.
getFieldId
(),
"name"
));
performancePartnerVo
.
setNotice
(
performances
.
getNotice
());
performancePartnerVo
.
setSponsorId
(
performances
.
getSponsorId
());
performancePartnerVo
.
setSponsorType
(
performances
.
getSponsorType
());
...
...
@@ -672,7 +670,7 @@ public class DataImpl {
orderTicketVo
.
setNoticeImage
(
"[{\"id\":1,\"sort\":1,\"message\":\"因演出票品非普通商品,其背后承载的文化服务具有时效性、稀缺性等特征,故不适用7天无理由退货政策。因“不可抗力”导致的演出取消或延期除外。\",\"title\":\"门票退换\",\"type\":\"image\",\"imgUrl\":\"http://img-zhengzai-tv.oss-cn-hangzhou.aliyuncs.com/partner/2019/01/21/5c45722882a13.png\"},{\"id\":7,\"sort\":2,\"message\":\"凭订单二维码或手机号兑票入场,二维码或手机号请勿泄露,以免影响入场。个人原因导致的信息泄露,主办方/平台方不承担任何责任。\",\"title\":\"电子票\",\"type\":\"image\",\"imgUrl\":\"http://img-zhengzai-tv.oss-cn-hangzhou.aliyuncs.com/partner/2019/01/21/5c456d9482fb9.png\"},{\"id\":3,\"sort\":3,\"message\":\"本场演出不设座位,均为站席观演。\",\"title\":\"仅设站席\",\"type\":\"image\",\"imgUrl\":\"http://img-zhengzai-tv.oss-cn-hangzhou.aliyuncs.com/partner/2019/01/21/5c456e93db0b9.png\"},{\"id\":12,\"sort\":4,\"message\":\"每场现场票数量由场地方决定,具体请到现场询问。\",\"title\":\"现场票\",\"type\":\"image\",\"imgUrl\":\"http://img-zhengzai-tv.oss-cn-hangzhou.aliyuncs.com/partner/2019/06/17/5d07647eaa55f.png\"}]"
);
orderTicketVo
.
setNotice
(
notice
);
orderTicketVo
.
setTicketType
(
ticketType
);
orderTicketVo
.
setFieldName
((
String
)
redisUtil
.
hg
et
(
KylinRedisConst
.
FIELDS
+
":"
+
orderTicketRelations
.
getPerformanceId
(),
"name"
));
orderTicketVo
.
setFieldName
((
String
)
redisUtil
.
getDB15RedisHG
et
(
KylinRedisConst
.
FIELDS
+
":"
+
orderTicketRelations
.
getPerformanceId
(),
"name"
));
//入场人
String
enterSql
=
"select * from order_ticket_entities where order_id = "
+
orderTickets
.
getOrderTicketsId
();
//设置的预编译语句格式
...
...
@@ -932,13 +930,12 @@ public class DataImpl {
// redis 库存迁移
@Autowired
// private RedisTemplate<String, Object> redisTemplate;
public
boolean
SurplusRedis
(){
List
<
KylinTicketStatus
>
ticketStatus
=
ticketStatusMapper
.
selectList
(
Wrappers
.
lambdaQuery
(
KylinTicketStatus
.
class
));
for
(
KylinTicketStatus
item
:
ticketStatus
){
String
ticketId
=
item
.
getTicketId
();
// dataUtils.setSurplusGeneral(ticketId, (Integer) redisTemplate.opsForValue().g
et(KylinRedisConst.PERFORMANCES_INVENTORY + ticketId + ":" + KylinRedisConst.SURPLUS_GENERAL));
// dataUtils.setSurplusExchange(ticketId, (Integer) redisTemplate.opsForValue().g
et(KylinRedisConst.PERFORMANCES_INVENTORY + ticketId + ":" + KylinRedisConst.SURPLUS_EXCHANGE));
dataUtils
.
setSurplusGeneral
(
ticketId
,
(
Integer
)
redisUtil
.
getDB15RedisG
et
(
KylinRedisConst
.
PERFORMANCES_INVENTORY
+
ticketId
+
":"
+
KylinRedisConst
.
SURPLUS_GENERAL
));
dataUtils
.
setSurplusExchange
(
ticketId
,
(
Integer
)
redisUtil
.
getDB15RedisG
et
(
KylinRedisConst
.
PERFORMANCES_INVENTORY
+
ticketId
+
":"
+
KylinRedisConst
.
SURPLUS_EXCHANGE
));
}
return
true
;
}
...
...
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/service/impl/partner/KylinPerformancesPartnerServiceImpl.java
View file @
d9f080de
package
com
.
liquidnet
.
service
.
platform
.
service
.
impl
.
partner
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.github.pagehelper.PageHelper
;
...
...
@@ -143,7 +142,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
performancePartnerVo
.
setRoadShowId
(
"0"
);
performancePartnerVo
.
setProjectId
(
"0"
);
performancePartnerVo
.
setIsShow
(
1
);
performancePartnerVo
.
setFieldName
((
String
)
redisUtil
.
hg
et
(
KylinRedisConst
.
FIELDS
+
":"
+
performancePartnerVo
.
getFieldId
(),
"name"
));
performancePartnerVo
.
setFieldName
((
String
)
redisUtil
.
getDB15RedisHG
et
(
KylinRedisConst
.
FIELDS
+
":"
+
performancePartnerVo
.
getFieldId
(),
"name"
));
performancePartnerVo
.
setNoticeImage
(
dataUtils
.
getBuyNoticeJsonString
(
step1Param
.
getNoticeIds
()));
mongoTemplate
.
insert
(
...
...
@@ -176,7 +175,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
performancePartnerVo
.
setIsSubmit
(
0
);
performancePartnerVo
.
setStatus
(
0
);
performancePartnerVo
.
setNoticeImage
(
dataUtils
.
getBuyNoticeJsonString
(
step1Param
.
getNoticeIds
()));
performancePartnerVo
.
setFieldName
((
String
)
redisUtil
.
hg
et
(
KylinRedisConst
.
FIELDS
+
":"
+
performancePartnerVo
.
getFieldId
(),
"name"
));
performancePartnerVo
.
setFieldName
((
String
)
redisUtil
.
getDB15RedisHG
et
(
KylinRedisConst
.
FIELDS
+
":"
+
performancePartnerVo
.
getFieldId
(),
"name"
));
performancePartnerVo
.
setNoticeImage
(
dataUtils
.
getBuyNoticeJsonString
(
step1Param
.
getNoticeIds
()));
if
(
data
!=
null
)
{
// 有修改记录
performancePartnerVo
.
setIsTrueName
(
data
.
getIsTrueName
());
...
...
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/utils/MongoVoUtils.java
View file @
d9f080de
...
...
@@ -53,12 +53,12 @@ public class MongoVoUtils {
KylinPerformanceRelations
p3
=
performanceRelationsMapper
.
selectOne
(
new
UpdateWrapper
<
KylinPerformanceRelations
>().
eq
(
"performance_id"
,
performancesId
));
//场地相关数据
KylinFields
fields
=
new
KylinFields
();
String
cityName
=
(
String
)
redisUtil
.
hg
et
(
KylinRedisConst
.
FIELDS
+
":"
+
p3
.
getFieldId
(),
"city_name"
);
fields
.
setCityId
(
Integer
.
parseInt
((
String
)
redisUtil
.
hg
et
(
KylinRedisConst
.
FIELDS
+
":"
+
p3
.
getFieldId
(),
"city_id"
)));
fields
.
setLatitude
((
String
)
redisUtil
.
hg
et
(
KylinRedisConst
.
FIELDS
+
":"
+
p3
.
getFieldId
(),
"latitude"
));
fields
.
setLongitude
((
String
)
redisUtil
.
hg
et
(
KylinRedisConst
.
FIELDS
+
":"
+
p3
.
getFieldId
(),
"longitude"
));
fields
.
setCityName
((
String
)
redisUtil
.
hg
et
(
KylinRedisConst
.
FIELDS
+
":"
+
p3
.
getFieldId
(),
"city_name"
));
fields
.
setName
((
String
)
redisUtil
.
hg
et
(
KylinRedisConst
.
FIELDS
+
":"
+
p3
.
getFieldId
(),
"name"
));
String
cityName
=
(
String
)
redisUtil
.
getDB15RedisHG
et
(
KylinRedisConst
.
FIELDS
+
":"
+
p3
.
getFieldId
(),
"city_name"
);
fields
.
setCityId
(
Integer
.
parseInt
((
String
)
redisUtil
.
getDB15RedisHG
et
(
KylinRedisConst
.
FIELDS
+
":"
+
p3
.
getFieldId
(),
"city_id"
)));
fields
.
setLatitude
((
String
)
redisUtil
.
getDB15RedisHG
et
(
KylinRedisConst
.
FIELDS
+
":"
+
p3
.
getFieldId
(),
"latitude"
));
fields
.
setLongitude
((
String
)
redisUtil
.
getDB15RedisHG
et
(
KylinRedisConst
.
FIELDS
+
":"
+
p3
.
getFieldId
(),
"longitude"
));
fields
.
setCityName
((
String
)
redisUtil
.
getDB15RedisHG
et
(
KylinRedisConst
.
FIELDS
+
":"
+
p3
.
getFieldId
(),
"city_name"
));
fields
.
setName
((
String
)
redisUtil
.
getDB15RedisHG
et
(
KylinRedisConst
.
FIELDS
+
":"
+
p3
.
getFieldId
(),
"name"
));
//相关状态时间初始变量
LocalDateTime
stopSellTime
=
null
;
...
...
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/utils/PerformanceVoTask.java
View file @
d9f080de
...
...
@@ -257,8 +257,8 @@ public class PerformanceVoTask {
performances
.
setCreatedAt
(
DateUtil
.
asLocalDateTime
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
).
parse
(
kylinPerformanceMisVo
.
getCreatedAt
())));
performances
.
setTimeStart
(
DateUtil
.
asLocalDateTime
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
).
parse
(
kylinPerformanceMisVo
.
getTimeStart
())));
performances
.
setTimeEnd
(
DateUtil
.
asLocalDateTime
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
).
parse
(
kylinPerformanceMisVo
.
getTimeEnd
())));
performances
.
setCityName
((
String
)
redisUtil
.
hg
et
(
KylinRedisConst
.
FIELDS
+
":"
+
performanceRelations
.
getFieldId
(),
"city_name"
));
performances
.
setCityId
(
Integer
.
parseInt
((
String
)
redisUtil
.
hg
et
(
KylinRedisConst
.
FIELDS
+
":"
+
performanceRelations
.
getFieldId
(),
"city_id"
)));
performances
.
setCityName
((
String
)
redisUtil
.
getDB15RedisHG
et
(
KylinRedisConst
.
FIELDS
+
":"
+
performanceRelations
.
getFieldId
(),
"city_name"
));
performances
.
setCityId
(
Integer
.
parseInt
((
String
)
redisUtil
.
getDB15RedisHG
et
(
KylinRedisConst
.
FIELDS
+
":"
+
performanceRelations
.
getFieldId
(),
"city_id"
)));
performances
.
setUpdatedAt
(
updatedAt
);
performanceStatus
.
setPerformanceId
(
performances
.
getPerformancesId
());
...
...
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/utils/RedisDataUtils.java
View file @
d9f080de
...
...
@@ -7,7 +7,7 @@ import com.liquidnet.commons.lang.util.DateUtil;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.service.base.SqlMapping
;
import
com.liquidnet.service.base.constant.MQConst
;
import
com.liquidnet.service.kylin.
dto.vo.mongo.KylinPerformanceVo
;
import
com.liquidnet.service.kylin.
constant.KylinRedisConst
;
import
com.liquidnet.service.sweet.constant.SweetConstant
;
import
com.liquidnet.service.sweet.dto.SweetManualAppletDto
;
import
com.liquidnet.service.sweet.dto.SweetManualArtistList2Dto
;
...
...
@@ -55,10 +55,10 @@ public class RedisDataUtils {
if
(!
item
.
getIsMember
().
equals
(
1
)){
item
.
setTimeSell
(
DateUtil
.
format
(
DateUtil
.
addMin
(
DateUtil
.
parse
(
item
.
getTimeSell
(),
"yyyy-MM-dd HH:mm:ss"
),
item
.
getPayCountdownMinute
()),
DateUtil
.
Formatter
.
yyyyMMddHHmmss
));
}
item
.
setFieldName
((
String
)
redisUtil
.
hget
(
"kylin:fields:id"
+
":"
+
item
.
getFieldId
(),
"name"
));
item
.
setCityName
((
String
)
redisUtil
.
hget
(
"kylin:fields:id"
+
":"
+
item
.
getFieldId
(),
"city_name"
));
item
.
setLatitude
((
String
)
redisUtil
.
hget
(
"kylin:fields:id"
+
":"
+
item
.
getFieldId
(),
"latitude"
));
item
.
setLongitude
((
String
)
redisUtil
.
hget
(
"kylin:fields:id"
+
":"
+
item
.
getFieldId
(),
"longitude"
));
item
.
setFieldName
((
String
)
redisUtil
.
getDB15RedisHGet
(
KylinRedisConst
.
FIELDS
+
":"
+
item
.
getFieldId
(),
"name"
));
item
.
setCityName
((
String
)
redisUtil
.
getDB15RedisHGet
(
KylinRedisConst
.
FIELDS
+
":"
+
item
.
getFieldId
(),
"city_name"
));
item
.
setLatitude
((
String
)
redisUtil
.
getDB15RedisHGet
(
KylinRedisConst
.
FIELDS
+
":"
+
item
.
getFieldId
(),
"latitude"
));
item
.
setLongitude
((
String
)
redisUtil
.
getDB15RedisHGet
(
KylinRedisConst
.
FIELDS
+
":"
+
item
.
getFieldId
(),
"longitude"
));
}
redisUtil
.
set
(
redisKey
,
data
);
return
data
;
...
...
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/utils/RedisMDSKDataUtils.java
View file @
d9f080de
...
...
@@ -6,6 +6,7 @@ import com.liquidnet.commons.lang.util.CollectionUtil;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
com.liquidnet.service.base.SqlMapping
;
import
com.liquidnet.service.base.constant.MQConst
;
import
com.liquidnet.service.kylin.constant.KylinRedisConst
;
import
com.liquidnet.service.sweet.constant.SweetConstant
;
import
com.liquidnet.service.sweet.dto.*
;
import
com.liquidnet.service.sweet.entity.*
;
...
...
@@ -48,10 +49,10 @@ public class RedisMDSKDataUtils {
if
(!
item
.
getIsMember
().
equals
(
1
)){
item
.
setTimeSell
(
DateUtil
.
format
(
DateUtil
.
addMin
(
DateUtil
.
parse
(
item
.
getTimeSell
(),
"yyyy-MM-dd HH:mm:ss"
),-
item
.
getPayCountdownMinute
()),
DateUtil
.
Formatter
.
yyyyMMddHHmmss
));
}
item
.
setFieldName
((
String
)
redisUtil
.
hget
(
"kylin:fields:id"
+
":"
+
item
.
getFieldId
(),
"name"
));
item
.
setCityName
((
String
)
redisUtil
.
hget
(
"kylin:fields:id"
+
":"
+
item
.
getFieldId
(),
"city_name"
));
item
.
setLatitude
((
String
)
redisUtil
.
hget
(
"kylin:fields:id"
+
":"
+
item
.
getFieldId
(),
"latitude"
));
item
.
setLongitude
((
String
)
redisUtil
.
hget
(
"kylin:fields:id"
+
":"
+
item
.
getFieldId
(),
"longitude"
));
item
.
setFieldName
((
String
)
redisUtil
.
getDB15RedisHGet
(
KylinRedisConst
.
FIELDS
+
":"
+
item
.
getFieldId
(),
"name"
));
item
.
setCityName
((
String
)
redisUtil
.
getDB15RedisHGet
(
KylinRedisConst
.
FIELDS
+
":"
+
item
.
getFieldId
(),
"city_name"
));
item
.
setLatitude
((
String
)
redisUtil
.
getDB15RedisHGet
(
KylinRedisConst
.
FIELDS
+
":"
+
item
.
getFieldId
(),
"latitude"
));
item
.
setLongitude
((
String
)
redisUtil
.
getDB15RedisHGet
(
KylinRedisConst
.
FIELDS
+
":"
+
item
.
getFieldId
(),
"longitude"
));
}
redisUtil
.
set
(
redisKey
,
data
);
return
data
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment