Toggle navigation
Toggle navigation
This project
Loading...
Sign in
YOHOBUY
/
yohobuy-union
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
jianhui_wang
8 years ago
Commit
e436038c58a74b981f9ba05dc86474df877672d1
1 parent
b3863f87
no message
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
26 deletions
server/src/main/java/com/yoho/unions/server/service/impl/UserInfoImportServiceImpl.java
server/src/main/java/com/yoho/unions/server/service/impl/UserRegisterBuyInfoserviceImpl.java
server/src/main/java/com/yoho/unions/server/service/impl/UserInfoImportServiceImpl.java
View file @
e436038
...
...
@@ -3,6 +3,7 @@ package com.yoho.unions.server.service.impl;
import
com.google.common.collect.Lists
;
import
com.yoho.service.model.union.response.PageuserRegisterBuyResponseBO
;
import
com.yoho.service.model.union.response.UserRegisterBuyInfoBO
;
import
com.yoho.unions.common.redis.RedisListCache
;
import
com.yoho.unions.common.redis.RedisTemplate
;
import
com.yoho.unions.common.redis.RedisValueCache
;
import
com.yoho.unions.common.service.IBusinessImportService
;
...
...
@@ -34,6 +35,8 @@ public class UserInfoImportServiceImpl implements IBusinessImportService {
@Autowired
IUserProfileDAO
userProfileDAO
;
@Autowired
private
RedisListCache
redisListCache
;
@Autowired
private
RedisValueCache
redisValueCache
;
@Autowired
private
RedisTemplate
redisTemplate
;
...
...
@@ -65,11 +68,11 @@ public class UserInfoImportServiceImpl implements IBusinessImportService {
UserProfile
userProfile
=
new
UserProfile
();
List
<
UserRegisterBuyInfoBO
>
userRegisterBuyList
=
new
ArrayList
<>();
int
j
=
0
;
while
(
null
!=
redisValueCache
.
get
(
"userRegisterBuyListKey"
+
Integer
.
toString
(
j
),
UserRegisterBuyInfoBO
.
class
))
{
redisTemplate
.
delete
(
"userRegisterBuyListKey"
+
Integer
.
toString
(
j
));
j
++;
}
// int j = 0;
// while (null != redisValueCache.get("userRegisterBuyListKey" + Integer.toString(j), UserRegisterBuyInfoBO.class)) {
// redisTemplate.delete("userRegisterBuyListKey" + Integer.toString(j));
// j++;
// }
for
(
int
i
=
0
;
i
<
userMobileAndUidVOList
.
size
();
i
++)
{
String
mobile
=
userMobileAndUidVOList
.
get
(
i
).
getMobile
();
...
...
@@ -108,25 +111,17 @@ public class UserInfoImportServiceImpl implements IBusinessImportService {
userRegisterBuyList
.
add
(
UserRegisterBuyInfoBO_i
);
// redisTemplate.delete("userRegisterBuyListKey"+Integer.toString(i));
redisValueCache
.
set
(
"userRegisterBuyListKey"
+
Integer
.
toString
(
i
),
UserRegisterBuyInfoBO_i
,
20
,
TimeUnit
.
MINUTES
);
//
redisValueCache.set("userRegisterBuyListKey" + Integer.toString(i), UserRegisterBuyInfoBO_i, 20, TimeUnit.MINUTES);
}
// if (redisValueCache.get(ListKey) == null) {
// redisValueCache.set(ListKey, userRegisterBuyList, 120, TimeUnit.MINUTES);
// } else {
// redisTemplate.delete(ListKey);
// redisValueCache.set(ListKey, userRegisterBuyList, 120, TimeUnit.MINUTES);
// }
String
ListKey
=
"userRegisterBuyListKey"
;
/*
redisTemplate.delete(ListKey);
redisTemplate
.
delete
(
ListKey
);
redisListCache.rightPushAll(ListKey, userRegisterBuyList
.toString()
, 120, TimeUnit.MINUTES);
redisListCache
.
rightPushAll
(
ListKey
,
userRegisterBuyList
,
120
,
TimeUnit
.
MINUTES
);
redisListCache
.
range
(
ListKey
,
UserRegisterBuyInfoBO
.
class
,
0
,
-
1
);
*/
// redisValueCache.set(ListKey, userRegisterBuyList, 120, TimeUnit.MINUTES);
...
...
server/src/main/java/com/yoho/unions/server/service/impl/UserRegisterBuyInfoserviceImpl.java
View file @
e436038
...
...
@@ -6,6 +6,7 @@ import com.yoho.error.exception.ServiceException;
import
com.yoho.service.model.response.PageResponseBO
;
import
com.yoho.service.model.union.request.UserRegisterBuyBO
;
import
com.yoho.service.model.union.response.UserRegisterBuyInfoBO
;
import
com.yoho.unions.common.redis.RedisListCache
;
import
com.yoho.unions.common.redis.RedisValueCache
;
import
com.yoho.unions.common.service.IBusinessExportService
;
import
com.yoho.unions.dal.IOrdersMapper
;
...
...
@@ -33,6 +34,8 @@ public class UserRegisterBuyInfoserviceImpl implements IUserRegisterBuyInfoServi
@Autowired
IOrdersMapper
ordersMapper
;
@Autowired
private
RedisListCache
redisListCache
;
@Autowired
private
RedisValueCache
redisValueCache
;
...
...
@@ -48,15 +51,20 @@ public class UserRegisterBuyInfoserviceImpl implements IUserRegisterBuyInfoServi
int
i
=
0
;
UserRegisterBuyInfoBO
UserRegisterBuyInfoBO
=
new
UserRegisterBuyInfoBO
();
//从redis获取结果数据
do
{
UserRegisterBuyInfoBO
=
redisValueCache
.
get
(
"userRegisterBuyListKey"
+
Integer
.
toString
(
i
),
UserRegisterBuyInfoBO
.
class
);
if
(
UserRegisterBuyInfoBO
==
null
)
{
break
;
}
userInfoList
.
add
(
i
,
UserRegisterBuyInfoBO
);
i
++;
}
while
(
UserRegisterBuyInfoBO
!=
null
);
String
ListKey
=
"userRegisterBuyListKey"
;
userInfoList
=
redisListCache
.
range
(
ListKey
,
UserRegisterBuyInfoBO
.
class
,
0
,
-
1
);
// do {
// UserRegisterBuyInfoBO = redisValueCache.get("userRegisterBuyListKey" + Integer.toString(i), UserRegisterBuyInfoBO.class);
// if (UserRegisterBuyInfoBO == null) {
// break;
// }
// userInfoList.add(i, UserRegisterBuyInfoBO);
// i++;
// }
// while (UserRegisterBuyInfoBO != null);
int
newId
=
1
;
for
(
int
k
=
0
;
k
<
userInfoList
.
size
();
k
++)
{
...
...
Please
register
or
login
to post a comment