提交人:陈绍鑫

日期:2025/7/07 17:00
内容:解付自动兑付
This commit is contained in:
陈绍鑫 2025-07-07 13:38:07 +08:00
parent 885125440a
commit a37864f576
1 changed files with 16 additions and 16 deletions

View File

@ -121,28 +121,28 @@ public class DrafttradebillOP extends AbstractOperationServicePlugIn {
logger.info("删除单据编号:"+cdm_payablebill.getString("billno")+"失败,原因:"+delete.getMessage());
}
}else {
logger.info("单据编号:"+cdm_payablebill.getString("billno")+"后台生单成功");
//根据源单id查询源单下游单据
Map<String, HashSet<Long>> tarBills = BFTrackerServiceHelper.findTargetBills("cdm_payablebill", new Long[]{cdm_payablebill.getLong("id")});
//返回的Map对象 如果有数据 String 对应的是 目标单据标识 value 对应的目标单ids
Set<DynamicObject> bill = new HashSet<DynamicObject>();
if (tarBills.containsKey("cdm_drafttradebill")) {
HashSet<Long> billId = tarBills.get("cdm_drafttradebill");
for (Long aLong : billId) {
QFilter billfilter = new QFilter("tradetype", QCP.equals, "redeem");
billfilter.and(new QFilter("billstatus", QCP.equals, "C"));
billfilter.and(new QFilter("id", QCP.equals, aLong));
DynamicObject cdm_drafttradebill = BusinessDataServiceHelper.loadSingle("cdm_drafttradebill", "id,billno", billfilter.toArray());
if (cdm_drafttradebill != null) {
// logger.info("单据编号:"+cdm_payablebill.getString("billno")+"后台生单成功");
// //根据源单id查询源单下游单据
// Map<String, HashSet<Long>> tarBills = BFTrackerServiceHelper.findTargetBills("cdm_payablebill", new Long[]{cdm_payablebill.getLong("id")});
// //返回的Map对象 如果有数据 String 对应的是 目标单据标识 value 对应的目标单ids
// Set<DynamicObject> bill = new HashSet<DynamicObject>();
// if (tarBills.containsKey("cdm_drafttradebill")) {
// HashSet<Long> billId = tarBills.get("cdm_drafttradebill");
// for (Long aLong : billId) {
// QFilter billfilter = new QFilter("ltradetype", QCP.equals, "redeem");
// billfilter.and(new QFilter("billstatus", QCP.equals, "C"));
// billfilter.and(new QFilter("id", QCP.equals, aLong));
// DynamicObject cdm_drafttradebill = BusinessDataServiceHelper.loadSingle("cdm_drafttradebill", "id,billno", billfilter.toArray());
// if (cdm_drafttradebill != null) {
// OperationResult operation = OperationServiceHelper.executeOperate("drawbillsave", "cdm_drafttradebill", new Object[]{aLong}, OperateOption.create());
// if (operation.isSuccess()) {
// logger.info("单据编号:" + cdm_drafttradebill.getString("billno") + "确认交易成功");
// } else {
// logger.info("单据编号:" + cdm_drafttradebill.getString("billno") + "确认交易失败,请检查交易状态或者手动操作");
// }
}
}
}
// }
// }
// }
}
} catch (NumberFormatException exception) {
logger.error("单据编号:"+cdm_payablebill.getString("billno")+"后台生单錯誤原因:"+exception.getMessage());