支出合同结算表单插件优化

This commit is contained in:
xuhaihui 2025-08-15 14:15:10 +08:00
parent 22a9a56abe
commit 129060aaa0
2 changed files with 11 additions and 7 deletions

View File

@ -9,6 +9,8 @@ import kd.bos.entity.datamodel.events.ChangeData;
import kd.bos.entity.datamodel.events.PropertyChangedArgs;
import kd.bos.form.control.events.ItemClickEvent;
import kd.bos.form.plugin.AbstractFormPlugin;
import kd.bos.orm.query.QCP;
import kd.bos.orm.query.QFilter;
import kd.bos.servicehelper.BusinessDataServiceHelper;
import java.math.BigDecimal;
@ -48,7 +50,8 @@ public class CostAllocatorBillPlugin extends AbstractFormPlugin {
DynamicObjectType processAllocEntityType = processAllocEntityCollection.getDynamicObjectType();
long referBillId = payItemDetailEntry.getLong("referbillid");//关联单据id
DynamicObject EcOutContractMeasure = BusinessDataServiceHelper.loadSingle(referBillId, "ec_outcontractmeasure");//支出合同计量
QFilter qFilter = new QFilter("id", QCP.equals, referBillId);
DynamicObject EcOutContractMeasure = BusinessDataServiceHelper.loadSingle("ec_outcontractmeasure", new QFilter[]{qFilter});//支出合同计量
if (EcOutContractMeasure != null) {
DynamicObjectCollection ListModelEntryCollection = EcOutContractMeasure.getDynamicObjectCollection("listmodelentry");//模板分录
for (DynamicObject ListModelEntry : ListModelEntryCollection) {
@ -89,7 +92,7 @@ public class CostAllocatorBillPlugin extends AbstractFormPlugin {
super.propertyChanged(e);
String name = e.getProperty().getName();
if ("totalsettleoftaxamount".equals(name) || "contract".equals(name)) {
//关联单据
//累计结算金额含当期价税合计,合同名称
DynamicObjectCollection payItemDetailEntryCollection = this.getModel().getDataEntity(true).getDynamicObjectCollection("payitemdetailentry");//合同支付项明细
DynamicObjectCollection itemEntryCollection = this.getModel().getDataEntity(true).getDynamicObjectCollection("itementry");//支付项分录
if (itemEntryCollection.size() == 0) {
@ -101,7 +104,7 @@ public class CostAllocatorBillPlugin extends AbstractFormPlugin {
if ("contract".equals(name)) {
ChangeData changeData = e.getChangeSet()[0]; //修改值所在行
Object newValue = changeData.getNewValue();//新值
if (newValue == null){
if (newValue == null) {
this.getView().updateView("zcgj_processallocatentity");//工序分摊
return;
}
@ -116,7 +119,8 @@ public class CostAllocatorBillPlugin extends AbstractFormPlugin {
for (DynamicObject payItemDetailEntry : payItemDetailEntryCollection) {
long referBillId = payItemDetailEntry.getLong("referbillid");//关联单据id
DynamicObject EcOutContractMeasure = BusinessDataServiceHelper.loadSingle(referBillId, "ec_outcontractmeasure");//支出合同计量
QFilter qFilter = new QFilter("id", QCP.equals, referBillId);
DynamicObject EcOutContractMeasure = BusinessDataServiceHelper.loadSingle("ec_outcontractmeasure", new QFilter[]{qFilter});//支出合同计量
if (EcOutContractMeasure != null) {
DynamicObjectCollection ListModelEntryCollection = EcOutContractMeasure.getDynamicObjectCollection("listmodelentry");//模板分录
for (DynamicObject ListModelEntry : ListModelEntryCollection) {

View File

@ -262,7 +262,7 @@ public class EquipmentCommandBillPlugin extends AbstractBillPlugIn implements Be
QFilter[] qFilters = new QFilter[]{
new QFilter("number", QCP.equals, viewParent.getString("number"))
};
cost = BusinessDataServiceHelper.loadSingle("bos_adminorg", qFilters);
cost = BusinessDataServiceHelper.loadSingle("bos_adminorg", qFilters);//行政组织
}
DynamicObjectCollection structureCollection = cost.getDynamicObjectCollection("structure");//组织结构分录
DynamicObject structure = structureCollection.get(0);
@ -275,7 +275,7 @@ public class EquipmentCommandBillPlugin extends AbstractBillPlugIn implements Be
DynamicObject orgPattern1 = bos_adminOrg.getDynamicObject("orgpattern");//形态
String orgPatternNumber1 = orgPattern1.getString("number");
if (!orgPatternNumber1.equals("Orgform06")) {
//上级不为不为部门的时候将现在查询的部门赋值给一级承担部门
//上级不为不为部门的时候跳出循环
break;
} else {
a++;
@ -283,7 +283,7 @@ public class EquipmentCommandBillPlugin extends AbstractBillPlugIn implements Be
}
DynamicObject bos_adminorg = BusinessDataServiceHelper.loadSingle("bos_adminorg", new QFilter[]{
new QFilter("number", QCP.equals, viewParent.getString("number"))});
new QFilter("number", QCP.equals, viewParent.getString("number"))});//行政组织
this.getModel().setValue("zcgj_org", bos_adminorg);//所属组织
}
}