付款事项约束费用项目空值判断修复01

This commit is contained in:
zengweihai 2024-06-15 16:15:13 +08:00
parent ae7afdc95c
commit 748620a4aa
1 changed files with 16 additions and 7 deletions

View File

@ -52,11 +52,23 @@ public class CommonExpenseItemBillFormPlugin extends AbstractBillPlugIn implemen
DynamicObject payment = null; DynamicObject payment = null;
if ("expenseitem".equals(name)){ if ("expenseitem".equals(name)){
if (paymentList.contains(entityId)){ if (paymentList.contains(entityId)){
String payID = dataEntity.getDynamicObject("shkd_payment").getString("id"); DynamicObject shkd_payment = dataEntity.getDynamicObject("shkd_payment");
payment = BusinessDataServiceHelper.loadSingle(payID,"bos_assistantdata_detail"); if (shkd_payment != null){
String payID = dataEntity.getDynamicObject("shkd_payment").getString("id");
payment = BusinessDataServiceHelper.loadSingle(payID,"bos_assistantdata_detail");
}else {
beforeF7SelectEvent.setCancel(true);
this.getView().showTipNotification("请先选择付款事项");
}
}else if (paymentItemList.contains(entityId)){ }else if (paymentItemList.contains(entityId)){
String payID = dataEntity.getDynamicObject("shkd_paymentitem").getString("id"); DynamicObject shkd_paymentitem = dataEntity.getDynamicObject("shkd_paymentitem");
payment = BusinessDataServiceHelper.loadSingle(payID,"bos_assistantdata_detail"); if (shkd_paymentitem != null){
String payID = dataEntity.getDynamicObject("shkd_paymentitem").getString("id");
payment = BusinessDataServiceHelper.loadSingle(payID,"bos_assistantdata_detail");
}else {
beforeF7SelectEvent.setCancel(true);
this.getView().showTipNotification("请先选择付款事项");
}
} }
if (payment != null){ if (payment != null){
String longPaymentNumber = payment.getString("longnumber"); String longPaymentNumber = payment.getString("longnumber");
@ -88,9 +100,6 @@ public class CommonExpenseItemBillFormPlugin extends AbstractBillPlugIn implemen
this.getView().showTipNotification("该付款事项未关联费用项目"); this.getView().showTipNotification("该付款事项未关联费用项目");
} }
} }
}else {
beforeF7SelectEvent.setCancel(true);
this.getView().showTipNotification("请先选择付款事项");
} }
} }