修改in超过1000 bug
This commit is contained in:
@@ -7,6 +7,7 @@ import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.text.StrBuilder;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
@@ -158,7 +159,18 @@ public class EasyPoiWordExportServiceImpl implements EasyPoiWordExportService {
|
||||
|
||||
List<PqUserLineAssPO> pqUserLineAssPOS = pqUserLineAssMapper.selectList(new LambdaQueryWrapper<PqUserLineAssPO>().in(PqUserLineAssPO::getLineIndex, lineIds));
|
||||
List<String> userIds = pqUserLineAssPOS.stream().map(PqUserLineAssPO::getUserIndex).distinct().collect(Collectors.toList());
|
||||
List<PqUserLedgerPO> pqUserLedgerPOList = pqUserLedgerMapper.selectList(new LambdaQueryWrapper<PqUserLedgerPO>().in(PqUserLedgerPO::getId, userIds));
|
||||
LambdaQueryWrapper<PqUserLedgerPO> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (userIds.size() > 1000) {
|
||||
List<List<String>> listUserIds = CollUtil.split(userIds, 1000);
|
||||
queryWrapper.and(w -> {
|
||||
for (List<String> ids : listUserIds) {
|
||||
w.or(wIn -> wIn.in(PqUserLedgerPO::getId, ids));
|
||||
}
|
||||
});
|
||||
} else {
|
||||
queryWrapper.in(PqUserLedgerPO::getId, userIds);
|
||||
}
|
||||
List<PqUserLedgerPO> pqUserLedgerPOList = pqUserLedgerMapper.selectList(queryWrapper);
|
||||
Map<String, List<PqUserLedgerPO>> stringListMap = pqUserLedgerPOList.stream().collect(Collectors.groupingBy(PqUserLedgerPO::getSmallObjType));
|
||||
|
||||
String treeStr = userToStr(stringListMap, treePOMap);
|
||||
@@ -243,9 +255,18 @@ public class EasyPoiWordExportServiceImpl implements EasyPoiWordExportService {
|
||||
List<PqUserLineAssPO> pqUserLineAssPOS = pqUserLineAssMapper.selectList(new LambdaQueryWrapper<PqUserLineAssPO>().in(PqUserLineAssPO::getLineIndex,lineIds));
|
||||
List<String> userIds = pqUserLineAssPOS.stream().map(PqUserLineAssPO::getUserIndex).distinct().collect(Collectors.toList());
|
||||
|
||||
LambdaQueryWrapper<PqUserLedgerPO> pqUserLedgerPOLambdaQueryWrapper = new LambdaQueryWrapper<PqUserLedgerPO>();
|
||||
pqUserLedgerPOLambdaQueryWrapper.in(PqUserLedgerPO::getId,userIds).eq(PqUserLedgerPO::getIsShow,1);
|
||||
List<PqUserLedgerPO> pqUserLedgerPOList = pqUserLedgerMapper.selectList(pqUserLedgerPOLambdaQueryWrapper);
|
||||
LambdaQueryWrapper<PqUserLedgerPO> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (userIds.size() > 1000) {
|
||||
List<List<String>> listUserIds = CollUtil.split(userIds, 1000);
|
||||
queryWrapper.eq(PqUserLedgerPO::getIsShow,1).and(w -> {
|
||||
for (List<String> ids : listUserIds) {
|
||||
w.or(wIn -> wIn.in(PqUserLedgerPO::getId, ids));
|
||||
}
|
||||
});
|
||||
} else {
|
||||
queryWrapper.eq(PqUserLedgerPO::getIsShow,1).in(PqUserLedgerPO::getId, userIds);
|
||||
}
|
||||
List<PqUserLedgerPO> pqUserLedgerPOList = pqUserLedgerMapper.selectList(queryWrapper);
|
||||
if(CollectionUtils.isEmpty(pqUserLedgerPOList)){
|
||||
userContext ="不涉及半导体及重点关注用户。";
|
||||
}else {
|
||||
|
||||
Reference in New Issue
Block a user