//根据目标单id查询源单上游单据
Map<String, HashSet<Long>> srcBills = BFTrackerServiceHelper.findSourceBills("目标单标识", new Long[]{目标单id});
//返回的Map对象 如果有数据 key 对应的是 源单单据标识 ,value 对应的是源单ids
Set<Long> invoiceId = new HashSet<Long>();
if (srcBills.containsKey("ar_invoice")) {
invoiceId = srcBills.get("ar_invoice");
}
//根据源单id查询源单下游单据
Map<String, HashSet<Long>> tarBills = BFTrackerServiceHelper.findTargetBills("源单标识", new Long[]{源单id});
//返回的Map对象 如果有数据 String 对应的是 目标单据标识 ,value 对应的目标单ids
Set<Long> invoiceId = new HashSet<Long>();
if (tarBills.containsKey("ar_invoice")) {
invoiceId = tarBills.get("ar_invoice");
}
关于上下游关系的都可以在这BFTrackerServiceHelper类方法找一下
推荐阅读