Authored by jianhui_wang

no message

... ... @@ -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);
... ...
... ... @@ -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++) {
... ...