利用集合,来实现移除的效果

List<Record>    otherFileList = Db.find(sql, uuid, uuid); 
        
        // 调用保理业务本次审核列表共同方法
        List<Record> approvefileList = this.getApproveDefineListCommon(controller);
        
        //定义一个筛选后的容器
        ArrayList<Record> otherArrayList=new ArrayList<Record>();
        
        
        for (Record otherFile : otherFileList) {
            //定义一个标记位
            boolean  flag=true ;
            // 获取另需提供的文件ID
            String otherFileDocumentId = otherFile.getStr("documentId");
            // 遍历
            for (Record approvefile : approvefileList) {
                // 如果文件ID相同,则结束当前的循环
                if (otherFileDocumentId.equals(approvefile.get("fileId").toString())) {
                    flag=false;
                    break;
                }
            }
            if (flag) {
                otherArrayList.add(otherFile);
            }
        }
        return otherArrayList;

 

posted on 2018-09-19 16:28  小白菜好吃  阅读(253)  评论(0编辑  收藏  举报

导航