Commit 54051d7a authored by wuqinghua's avatar wuqinghua

2021/11/12 吴卿华 修改两人查询时 可能会出现死循环问题

parent 85d0b27c
...@@ -722,8 +722,17 @@ public class TransferRelationshipServiceImpl implements TransferRelationshipServ ...@@ -722,8 +722,17 @@ public class TransferRelationshipServiceImpl implements TransferRelationshipServ
hashMap1.put(searchRelationshipSubordinateVo.getCardNumber(),searchRelationshipSubordinateVo.getCardNumber()); hashMap1.put(searchRelationshipSubordinateVo.getCardNumber(),searchRelationshipSubordinateVo.getCardNumber());
for (int b=0;b<1;) { for (int b=0;b<1;) {
for (int a = 0; a < superiorList.size(); a++) { for (int a = 0; a < superiorList.size(); a++) {
//存放查询出来的上级信息
List<SearchRelationshipVo> superior=new ArrayList<>();
//循环查询出来的上级信息 之后将查出来的上级信息存入到list中
for (int m=0;m<superiorList.size();m++){
//查询上级转账人方法 //查询上级转账人方法
List<SearchRelationshipVo> superior = transferRelationshipMapper.querySuperior(superiorList.get(a).getCardNumber()); List<SearchRelationshipVo> superior1 = transferRelationshipMapper.querySuperior(superiorList.get(m).getCardNumber());
for (int j=0;j<superior1.size();j++){
superior.add(superior1.get(j));
}
}
//清空list数据 //清空list数据
superiorList.clear(); superiorList.clear();
//判断上级是否是转账人 如果是 就直接返回数据 //判断上级是否是转账人 如果是 就直接返回数据
...@@ -751,9 +760,9 @@ public class TransferRelationshipServiceImpl implements TransferRelationshipServ ...@@ -751,9 +760,9 @@ public class TransferRelationshipServiceImpl implements TransferRelationshipServ
if (Number==null){ if (Number==null){
//添加被转账人信息 //添加被转账人信息
transferAssociationList.add(searchRelationshipSubordinateVo1); transferAssociationList.add(searchRelationshipSubordinateVo1);
}
//向防止重复map添加已经查询到的上级卡号 //向防止重复map添加已经查询到的上级卡号
hashMap1.put(superior.get(n).getCardNumber(), superior.get(n).getCardNumber()); hashMap1.put(superior.get(n).getCardNumber(), superior.get(n).getCardNumber());
}
superiorList.add(searchRelationshipSubordinateVo1); superiorList.add(searchRelationshipSubordinateVo1);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment