Commit 54051d7a authored by wuqinghua's avatar wuqinghua

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

parent 85d0b27c
......@@ -722,8 +722,17 @@ public class TransferRelationshipServiceImpl implements TransferRelationshipServ
hashMap1.put(searchRelationshipSubordinateVo.getCardNumber(),searchRelationshipSubordinateVo.getCardNumber());
for (int b=0;b<1;) {
for (int a = 0; a < superiorList.size(); a++) {
//查询上级转账人方法
List<SearchRelationshipVo> superior = transferRelationshipMapper.querySuperior(superiorList.get(a).getCardNumber());
//存放查询出来的上级信息
List<SearchRelationshipVo> superior=new ArrayList<>();
//循环查询出来的上级信息 之后将查出来的上级信息存入到list中
for (int m=0;m<superiorList.size();m++){
//查询上级转账人方法
List<SearchRelationshipVo> superior1 = transferRelationshipMapper.querySuperior(superiorList.get(m).getCardNumber());
for (int j=0;j<superior1.size();j++){
superior.add(superior1.get(j));
}
}
//清空list数据
superiorList.clear();
//判断上级是否是转账人 如果是 就直接返回数据
......@@ -746,14 +755,14 @@ public class TransferRelationshipServiceImpl implements TransferRelationshipServ
searchRelationshipSubordinateVo1.setColor(colour.getColour());
searchRelationshipSubordinateVo1.setSize(10);
searchRelationshipSubordinateVo1.setHierarchy(searchRelationshipVoList.get(k).getHierarchy());
searchRelationshipSubordinateVo1.setSubordinateQuantity(searchRelationshipVoList.get(k).getSubordinateQuantity());
searchRelationshipSubordinateVo1.setSubordinateQuantity(searchRelationshipVoList.get(k).getSubordinateQuantity());
Object Number = hashMap1.get(superior.get(n).getCardNumber());
if (Number==null){
//添加被转账人信息
transferAssociationList.add(searchRelationshipSubordinateVo1);
//向防止重复map添加已经查询到的上级卡号
hashMap1.put(superior.get(n).getCardNumber(), superior.get(n).getCardNumber());
}
//向防止重复map添加已经查询到的上级卡号
hashMap1.put(superior.get(n).getCardNumber(), superior.get(n).getCardNumber());
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