|
|
|
@@ -529,7 +529,7 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { |
|
|
|
} catch (Exception e) { |
|
|
|
stringRedisTemplate.opsForHash().put(importKey, "allCount", "1"); |
|
|
|
stringRedisTemplate.opsForHash().put(importKey, "allSuccessCount", "0"); |
|
|
|
stringRedisTemplate.opsForHash().put(importKey, "successCount", "0"); |
|
|
|
stringRedisTemplate.opsForHash().put(importKey, "processCount", "0"); |
|
|
|
stringRedisTemplate.opsForHash().put(importKey, "failCount", "1"); |
|
|
|
logger.error(e.getMessage()); |
|
|
|
return new ResultData(ErrorCode.MEM_IMPORT_ERR); |
|
|
|
@@ -547,27 +547,29 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { |
|
|
|
int all_success = successList.size(); |
|
|
|
int all_fail = failList.size(); |
|
|
|
|
|
|
|
//添加到redis里 |
|
|
|
stringRedisTemplate.opsForHash().put(importKey, "allCount", "" + total); |
|
|
|
stringRedisTemplate.opsForHash().put(importKey, "allSuccessCount", "" + all_success); |
|
|
|
stringRedisTemplate.opsForHash().put(importKey, "processCount", "0"); |
|
|
|
stringRedisTemplate.opsForHash().put(importKey, "failCount", "" + all_fail); |
|
|
|
|
|
|
|
logger.info("验证通过的数量: " + successList.size()); |
|
|
|
logger.info("验证未通过的数量: " + failList.size()); |
|
|
|
|
|
|
|
WxTags wxTagsQ = new WxTags(); |
|
|
|
List<WxTags> tagList = wxTagsMapper.findList(wxTagsQ); |
|
|
|
|
|
|
|
try { |
|
|
|
//添加到redis里 |
|
|
|
stringRedisTemplate.opsForHash().put(importKey, "allCount", "" + total); |
|
|
|
stringRedisTemplate.opsForHash().put(importKey, "allSuccessCount", "" + all_success); |
|
|
|
stringRedisTemplate.opsForHash().put(importKey, "successCount", "0"); |
|
|
|
stringRedisTemplate.opsForHash().put(importKey, "failCount", "" + all_fail); |
|
|
|
|
|
|
|
logger.info("验证通过的数量: " + successList.size()); |
|
|
|
logger.info("验证未通过的数量: " + failList.size()); |
|
|
|
|
|
|
|
successList.parallelStream().forEach(uBase -> { |
|
|
|
|
|
|
|
if (StringUtils.isBlank(uBase.getPhone())) { |
|
|
|
stringRedisTemplate.opsForHash().increment(importKey, "processCount", 1); |
|
|
|
logger.error("手机号为空", uBase.toString()); |
|
|
|
return; |
|
|
|
} |
|
|
|
WxCUserBasicInfo userBase = InitUserBaseInfo(uBase, tenantId); |
|
|
|
if (userBase == null) { |
|
|
|
stringRedisTemplate.opsForHash().increment(importKey, "processCount", 1); |
|
|
|
logger.error("userBase为null", uBase.toString()); |
|
|
|
return; |
|
|
|
} |
|
|
|
@@ -626,6 +628,7 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { |
|
|
|
try { |
|
|
|
wxCUserBasicInfoMapper.insertSelective(userBase); |
|
|
|
} catch (Exception e) { |
|
|
|
stringRedisTemplate.opsForHash().increment(importKey, "processCount", 1); |
|
|
|
logger.error(e.getMessage()); |
|
|
|
return; |
|
|
|
} |
|
|
|
@@ -671,11 +674,10 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error(e.getMessage()); |
|
|
|
logger.error("打标签+成长值失败--继续导入"); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
//记数 |
|
|
|
stringRedisTemplate.opsForHash().increment(importKey,"successCount",1); |
|
|
|
stringRedisTemplate.opsForHash().increment(importKey,"processCount",1); |
|
|
|
}); |
|
|
|
} catch (Exception e) { |
|
|
|
stringRedisTemplate.opsForHash().put(importKey, "allCount", "" + all_fail); |
|
|
|
|