Merge remote-tracking branch 'origin/master'

This commit is contained in:
“wyx12345678” 2024-06-14 15:55:04 +08:00
commit a4447de1fa
2 changed files with 22 additions and 5 deletions

View File

@ -19,6 +19,8 @@ import java.util.EventObject;
/**
* 单据界面插件
* 单据类型及部门约束付款事项
* 根据付款事项辅助资料查找对应的付款事项对应及其下级的叶子对象
*/
public class CommonBillOsPaymentBillFormPlugin extends AbstractBillPlugIn implements BeforeF7SelectListener,Plugin {
@ -75,6 +77,7 @@ public class CommonBillOsPaymentBillFormPlugin extends AbstractBillPlugIn implem
DynamicObject org = (DynamicObject) this.getModel().getValue("org");
String orgName = org.getString("name");
QF.and("shkd_org.name",QCP.equals,orgName);
QF.and("enable",QCP.equals,"1");//使用状态为可用
logger.info("过滤条件单据类型为"+billType+",组织名称为:"+orgName);
ArrayList<Object> paymentNumbers = new ArrayList<>();
DynamicObject[] loads = BusinessDataServiceHelper.load("shkd_paymatter", "id,shkd_paymatterinfo.number", QF.toArray());
@ -83,7 +86,7 @@ public class CommonBillOsPaymentBillFormPlugin extends AbstractBillPlugIn implem
logger.info("开始查询该付款事项及其下游叶子事项");
String sql_number = "%"+paymentNumber+"%";
QFilter QFSon = new QFilter("longnumber", QCP.like, sql_number);
QFSon.and("isleaf",QCP.equals,"1");
QFSon.and("isleaf",QCP.equals,"1");//是叶子节点
DynamicObject[] datum = BusinessDataServiceHelper.load("bos_assistantdata_detail", "id,number,longnumber,level", QFSon.toArray());
for (DynamicObject data : datum) {
String longnumber = data.getString("longnumber");//长编码

View File

@ -21,6 +21,8 @@ import java.util.List;
/**
* 单据界面插件
* 付款事项根据费用项目关联付款事项约束费用项目
* 根据付款事项编码查询对于的费用项目级次大于1的付款事项按它的1级编码查询
*/
public class CommonExpenseItemBillFormPlugin extends AbstractBillPlugIn implements BeforeF7SelectListener,Plugin {
String entityId;
@ -50,15 +52,27 @@ public class CommonExpenseItemBillFormPlugin extends AbstractBillPlugIn implemen
DynamicObject payment = null;
if ("expenseitem".equals(name)){
if (paymentList.contains(entityId)){
payment = dataEntity.getDynamicObject("shkd_payment");
String payID = dataEntity.getDynamicObject("shkd_payment").getString("id");
payment = BusinessDataServiceHelper.loadSingle(payID,"bos_assistantdata_detail");
}else if (paymentItemList.contains(entityId)){
payment = dataEntity.getDynamicObject("shkd_paymentitem");
String payID = dataEntity.getDynamicObject("shkd_paymentitem").getString("id");
payment = BusinessDataServiceHelper.loadSingle(payID,"bos_assistantdata_detail");
}
if (payment != null){
String paymentNumber = payment.getString("number");
if (StringUtils.isNotEmpty(paymentNumber)){//付款事项编码不为空
String longPaymentNumber = payment.getString("longnumber");
if (StringUtils.isNotEmpty(longPaymentNumber)){//付款事项编码不为空
String paymentNumber = "";
int level = payment.getInt("level");
if (level > 1){
int index = longPaymentNumber.indexOf("!");
paymentNumber = longPaymentNumber.substring(0, index);//取一级付款事项编码
}else {
paymentNumber = longPaymentNumber;
}
ArrayList<Object> paymentIds = new ArrayList<>();
QFilter qFilter = new QFilter("shkd_paymatterinfo.number", QCP.equals, paymentNumber);
qFilter.and("enable",QCP.equals,"1");//使用状态为可用
DynamicObject[] loads = BusinessDataServiceHelper.load("shkd_accountlinkmatter","id,shkd_expenseitem.id",qFilter.toArray());
for (DynamicObject load : loads) {
long aLong = load.getLong("shkd_expenseitem.id");