收票登记增加客户映射按钮逻辑

This commit is contained in:
李贵强 2025-10-29 11:29:31 +08:00
parent cd8d847b80
commit c1e3493939
1 changed files with 19 additions and 16 deletions

View File

@ -33,6 +33,8 @@ public class RecPayerConvertPlugin extends AbstractConvertPlugIn implements Plug
e.addSrcField("company"); e.addSrcField("company");
//交票人类型 //交票人类型
e.addSrcField("payeetype"); e.addSrcField("payeetype");
//不遵循客户映射-默认关闭即需要执行
e.addSrcField("shjh_khys");
} }
@Override @Override
@ -48,7 +50,8 @@ public class RecPayerConvertPlugin extends AbstractConvertPlugIn implements Plug
// 获取单据数据包 // 获取单据数据包
DynamicObject bill = billEntity.getDataEntity(); DynamicObject bill = billEntity.getDataEntity();
String payeetype = (String) this.getSourceData(billEntity, fldProperties, "payeetype"); String payeetype = (String) this.getSourceData(billEntity, fldProperties, "payeetype");
if ("cdm_receivablebill".equals(bill.getString("sourcebilltype"))&&"bd_customer".equals(payeetype)){ Boolean shjh_khys = (Boolean) this.getSourceData(billEntity, fldProperties, "shjh_khys");
if ("cdm_receivablebill".equals(bill.getString("sourcebilltype"))&&"bd_customer".equals(payeetype)&&!shjh_khys){
this.carryCustomerRule(bill,billEntity,fldProperties); this.carryCustomerRule(bill,billEntity,fldProperties);
} }
@ -74,20 +77,20 @@ public class RecPayerConvertPlugin extends AbstractConvertPlugIn implements Plug
return; return;
} }
DynamicObject company = BusinessDataServiceHelper.loadSingle(companyId, "bos_org"); DynamicObject company = BusinessDataServiceHelper.loadSingle(companyId, "bos_org");
QFilter qFilter = new QFilter("shjh_dfhm", QCP.equals, accountName); // QFilter qFilter = new QFilter("shjh_dfhm", QCP.equals, accountName);
//新增收款入账中心-资金组织&&映射表组织过滤 // //新增收款入账中心-资金组织&&映射表组织过滤
qFilter.and(new QFilter("shjh_org.id", QCP.equals, companyId)); // qFilter.and(new QFilter("shjh_org.id", QCP.equals, companyId));
qFilter.and(new QFilter("enable", QCP.equals, "1")); // qFilter.and(new QFilter("enable", QCP.equals, "1"));
//1.对方户名与客户名称映射表 shjh_dfhmcust // //1.对方户名与客户名称映射表 shjh_dfhmcust
DynamicObject shjhDfhmcust = BusinessDataServiceHelper.loadSingle("shjh_dfhmcust", qFilter.toArray()); // DynamicObject shjhDfhmcust = BusinessDataServiceHelper.loadSingle("shjh_dfhmcust", qFilter.toArray());
if (null != shjhDfhmcust) { // if (null != shjhDfhmcust) {
DynamicObject shjhCustomer = shjhDfhmcust.getDynamicObject("shjh_customer"); // DynamicObject shjhCustomer = shjhDfhmcust.getDynamicObject("shjh_customer");
if (null != shjhCustomer) { // if (null != shjhCustomer) {
bill.set("payer", shjhCustomer.getPkValue()); //付款人id // bill.set("payer", shjhCustomer.getPkValue()); //付款人id
bill.set("payernumber", shjhCustomer.getString("number")); //付款人编码 // bill.set("payernumber", shjhCustomer.getString("number")); //付款人编码
bill.set("payername", shjhCustomer.getString("name")); //付款人名称 // bill.set("payername", shjhCustomer.getString("name")); //付款人名称
} // }
} else { // } else {
//2.规则生单未配置客户>取收款入账中心客户 //2.规则生单未配置客户>取收款入账中心客户
QFilter customerFilter = new QFilter("name", QCP.equals, accountName); QFilter customerFilter = new QFilter("name", QCP.equals, accountName);
customerFilter.and(new QFilter("group.name", QCP.not_equals, "员工")); customerFilter.and(new QFilter("group.name", QCP.not_equals, "员工"));
@ -144,7 +147,7 @@ public class RecPayerConvertPlugin extends AbstractConvertPlugIn implements Plug
} }
} }
} // }
bill.set("shjh_xdgzkh", true);//设置收款单标记位 从规则携带客户等信息 为true bill.set("shjh_xdgzkh", true);//设置收款单标记位 从规则携带客户等信息 为true
} }