收入与支出合同计量清单过滤

This commit is contained in:
xiaoshi 2024-12-05 18:44:11 +08:00
parent feefdde77f
commit f64ab9497c
1 changed files with 42 additions and 0 deletions

View File

@ -1,9 +1,17 @@
package zcgj.zcdev.zcdev.pr.plugin.form; package zcgj.zcdev.zcdev.pr.plugin.form;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.utils.StringUtils;
import kd.bos.entity.datamodel.events.ChangeData; import kd.bos.entity.datamodel.events.ChangeData;
import kd.bos.form.CloseCallBack;
import kd.bos.form.ShowFormHelper;
import kd.bos.list.ListShowParameter;
import kd.bos.orm.query.QFilter;
import kd.ec.contract.formplugin.ContractMeasureBillEditPlugin; import kd.ec.contract.formplugin.ContractMeasureBillEditPlugin;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
public class ContractEeasurementBillPlugin extends ContractMeasureBillEditPlugin { public class ContractEeasurementBillPlugin extends ContractMeasureBillEditPlugin {
@ -29,4 +37,38 @@ public class ContractEeasurementBillPlugin extends ContractMeasureBillEditPlugin
} }
} }
@Override
protected void doNewListEntry() {
{
boolean inContract = this.isInContract();
String formId = inContract ? "ec_intreelisting" : "ec_outtreelisting";
ListShowParameter param = ShowFormHelper.createShowListForm(formId, true, 3, true);
List<QFilter> qFilters = param.getListFilterParameter().getQFilters();
int rowCount = this.getModel().getEntryRowCount("listentry");
List<Object> listingIds = new ArrayList();
int rowIndex;
for(rowIndex = 0; rowIndex < rowCount; ++rowIndex) {
DynamicObject listing = (DynamicObject)this.getModel().getValue("listing", rowIndex);
if (listing != null) {
// listingIds.add(listing.getPkValue());
}
}
qFilters.add(new QFilter("id", "not in", listingIds));
rowIndex = this.getModel().getEntryCurrentRowIndex("listmodelentry");
String listModelId = (String)this.getModel().getValue("listmodelid", rowIndex);
qFilters.add(new QFilter("listingmodel", "=", StringUtils.isNotBlank(listModelId) ? Long.parseLong(listModelId) : 0L));
DynamicObject contract = (DynamicObject)this.getModel().getValue("contract");
if (contract != null) {
qFilters.add(new QFilter("contractid", "=", contract.getLong("id")));
}
param.setCustomParam("listmodelid", listModelId);
CloseCallBack callBack = new CloseCallBack(this, "newlistentry");
param.setCloseCallBack(callBack);
this.getView().showForm(param);
}
}
} }