提交 a091706c 作者: gh

扫过期客服加入非空校验

上级 2954084b
......@@ -126,48 +126,52 @@ public class CustomerDelayPublishServiceImpl extends ServiceImpl<CustomerDelayPu
//超时的延时排期
List<RegisterUserEntity> allExpiredDelayPublish = registerUserEntityService.getAllExpiredDelayPublish(requestDate);
Set<String> appidList = allExpiredDelayPublish.stream().map(RegisterUserEntity::getAppId).collect(Collectors.toSet());
if(!allExpiredDelayPublish.isEmpty()){
Set<String> appidList = allExpiredDelayPublish.stream().map(RegisterUserEntity::getAppId).collect(Collectors.toSet());
//获取所有延时客服
List<CustomerDelayItemVO> allDelayCustomerMessage = customerGraphicsDelayService.findAllDelayCustomerSort(appidList,null);
//获取所有延时客服
List<CustomerDelayItemVO> allDelayCustomerMessage = customerGraphicsDelayService.findAllDelayCustomerSort(appidList,null);
Map<String, Map<Long, Integer>> collect = allDelayCustomerMessage.stream().collect(Collectors.groupingBy(CustomerDelayItemVO::getAppId, Collectors.toMap(CustomerDelayItemVO::getTimeInterval, CustomerDelayItemVO::getPostSort, (v1, v2) -> v1)));
Map<String, Map<Long, Integer>> collect = allDelayCustomerMessage.stream().collect(Collectors.groupingBy(CustomerDelayItemVO::getAppId, Collectors.toMap(CustomerDelayItemVO::getTimeInterval, CustomerDelayItemVO::getPostSort, (v1, v2) -> v1)));
Date currentDate = new Date();
Date currentDate = new Date();
for (RegisterUserEntity expiredUser : allExpiredDelayPublish) {
try {
Map<Long, Integer> longIntegerMap = collect.get(expiredUser.getAppId());
for (RegisterUserEntity expiredUser : allExpiredDelayPublish) {
try {
Map<Long, Integer> longIntegerMap = collect.get(expiredUser.getAppId());
if (longIntegerMap!=null&&!longIntegerMap.isEmpty()){
if (longIntegerMap!=null&&!longIntegerMap.isEmpty()){
Date firstActive = expiredUser.getFirstActive();
Date firstActive = expiredUser.getFirstActive();
ArrayList<Long> timeList = new ArrayList<>(longIntegerMap.keySet());
ArrayList<Long> timeList = new ArrayList<>(longIntegerMap.keySet());
List<Long> sortTimeList = timeList.stream().sorted().collect(Collectors.toList());
List<Long> sortTimeList = timeList.stream().sorted().collect(Collectors.toList());
for (Long aLong : sortTimeList) {
for (Long aLong : sortTimeList) {
Date publishTime = new Date(((firstActive.getTime() + aLong) / 60000) * 60000);
Date publishTime = new Date(((firstActive.getTime() + aLong) / 60000) * 60000);
if(publishTime.compareTo(currentDate)>0){
expiredUser.setCustomerPublish(publishTime);
expiredUser.setCustomerSort(longIntegerMap.get(aLong));
break;
if(publishTime.compareTo(currentDate)>0){
expiredUser.setCustomerPublish(publishTime);
expiredUser.setCustomerSort(longIntegerMap.get(aLong));
break;
}
expiredUser.setCustomerSort(-1);
}
}else{
expiredUser.setCustomerSort(-1);
}
}else{
expiredUser.setCustomerSort(-1);
}catch (Exception e){
log.error(e.getStackTrace()[0].toString());
}
}catch (Exception e){
log.error(e.getStackTrace()[0].toString());
}
}
registerUserEntityService.updateBatchById(allExpiredDelayPublish);
}
registerUserEntityService.updateBatchById(allExpiredDelayPublish);
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论