diff --git a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/api/PayBillApiSavePlugin.java b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/api/PayBillApiSavePlugin.java index 59a1e7f..f869e47 100644 --- a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/api/PayBillApiSavePlugin.java +++ b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/api/PayBillApiSavePlugin.java @@ -76,7 +76,13 @@ public class PayBillApiSavePlugin implements ApiSavePlugin { } if ("bd_supplier".equals(payeetype) || "bd_customer".equals(payeetype)) { -// BusinessDataServiceHelper.load(payeetype, "id,number,name,societycreditcode",) + DynamicObject[] objects = BusinessDataServiceHelper.load(payeetype.toString(), "id,number,name,societycreditcode", new QFilter("societycreditcode", QCP.equals, map.get("payeenumber").toString()).toArray()); + map.put("payeenumber", objects[0].getString("number")); + //收款人编码 + objectNumber = objects[0].getString("number"); + } else { + //收款人编码 + objectNumber = map.get("payeenumber").toString(); } @@ -84,11 +90,8 @@ public class PayBillApiSavePlugin implements ApiSavePlugin { //收款人类型 objectType = payeetype.toString(); if (!"other".equals(objectType)) { - //收款人编码 - objectNumber = map.get("payeenumber").toString(); //收款人ID fieldName1 = "payee"; - Map payeebankObj = (Map) map.get("payeebank"); bankNumber = (String) payeebankObj.get("number"); logger.info("付款处理 → \nobjectType:{}\nobjectNumber:{}\nbankNumber:{}", objectType, objectNumber, bankNumber); @@ -136,12 +139,21 @@ public class PayBillApiSavePlugin implements ApiSavePlugin { map.put("payertype", "other"); map.put("payerformid", "other"); } + + if ("bd_supplier".equals(payertype) || "bd_customer".equals(payertype)) { + DynamicObject[] objects = BusinessDataServiceHelper.load(payertype.toString(), "id,number,name,societycreditcode", new QFilter("societycreditcode", QCP.equals, map.get("payernumber").toString()).toArray()); + map.put("payernumber", objects[0].getString("number")); + //收款人编码 + objectNumber = objects[0].getString("number"); + } else { + //收款人编码 + objectNumber = map.get("payernumber").toString(); + } + objectType = payertype.toString(); if (!"other".equals(objectType)) { - objectNumber = map.get("payernumber").toString(); fieldName1 = "payer"; - Map accountbank = (Map) map.get("accountbank"); bankNumber = (String) accountbank.get("number"); logger.info("收款处理 → \nobjectType:{}\nobjectNumber:{}\nbankNumber:{}", objectType, objectNumber, bankNumber);