供应商考察汇总表单表单插件校验数据是否为空(临时版)

This commit is contained in:
zengweihai 2024-11-26 15:53:05 +08:00
parent ad35787615
commit 564aad435b
1 changed files with 58 additions and 0 deletions

View File

@ -1,12 +1,20 @@
package shkd.repc.resm.report.form;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.DynamicObjectCollection;
import kd.bos.dataentity.metadata.IDataEntityProperty;
import kd.bos.entity.datamodel.events.ChangeData;
import kd.bos.entity.datamodel.events.PropertyChangedArgs;
import kd.bos.entity.report.FilterInfo;
import kd.bos.entity.report.ReportQueryParam;
import kd.bos.form.plugin.AbstractFormPlugin;
import kd.bos.orm.query.QCP;
import kd.bos.orm.query.QFilter;
import kd.bos.report.plugin.AbstractReportFormPlugin;
import kd.bos.servicehelper.BusinessDataServiceHelper;
import kd.sdk.plugin.Plugin;
import java.util.ArrayList;
import java.util.EventObject;
/**
@ -54,4 +62,54 @@ public class SupInspectSumReportFormPlugin extends AbstractReportFormPlugin impl
}
}
@Override
public boolean verifyQuery(ReportQueryParam queryParam) {
FilterInfo filterInfo = queryParam.getFilter();
QFilter qFilter = new QFilter("billstatus", QCP.equals, "B");//提交评分状态为已提交
DynamicObjectCollection orges = (DynamicObjectCollection)filterInfo.getValue("qeug_orgfilter");
//todo:设置所属组织过滤条件
if (orges != null && orges.size() > 0){
ArrayList<Long> orgIdList = new ArrayList<>();
for (DynamicObject org : orges) {
orgIdList.add(org.getLong("id"));
}
qFilter.and("org.id",QCP.in,orgIdList);
}
DynamicObjectCollection regSupplies = (DynamicObjectCollection)filterInfo.getValue("qeug_evalsupplierfilter");//潜在供应商集合
DynamicObjectCollection offSupplies = (DynamicObjectCollection)filterInfo.getValue("qeug_evaloffsuppliefilter");//正式供应商集合
DynamicObjectCollection supplierGroups = (DynamicObjectCollection)filterInfo.getValue("qeug_suppliergroupfilter");//供应商分类集合
//todo:设置供应商过滤条件
if (regSupplies != null || offSupplies != null){
if (regSupplies != null && regSupplies.size() > 0){//潜在供应商
ArrayList<Long> regSupplyIdList = new ArrayList<>();
for (DynamicObject regSupply : regSupplies) {
regSupplyIdList.add(regSupply.getLong("id"));//填充潜在供应商主键
}
qFilter.and("evalsupplier.id",QCP.in,regSupplyIdList);
}
if (offSupplies != null && offSupplies.size() > 0){//正式供应商
ArrayList<Long> offSupplyIdList = new ArrayList<>();
for (DynamicObject offSupply : offSupplies) {
offSupplyIdList.add(offSupply.getLong("id"));//填充正式供应商主键
}
qFilter.and("evaloffsupplier.id",QCP.in,offSupplyIdList);
}
}
//todo:设置供应商分类过滤条件
if (supplierGroups != null && supplierGroups.size() > 0){
ArrayList<Long> supplierGroupIdList = new ArrayList<>();//供应商分类集合
for (DynamicObject supplierGroup : supplierGroups) {
supplierGroupIdList.add(supplierGroup.getLong("id"));//填充供应商分类主键
}
qFilter.and("multisuppliertype.fbasedataid.id",QCP.in,supplierGroupIdList);
}
DynamicObject[] resm_myexams = BusinessDataServiceHelper.load("resm_myexam", "id,name,org,examsuppliername,modifytime,evalscore,creator,entry_evalscore,entry_evalscore.qeug_scoredesc,entry_evalscore.scoredesc", qFilter.toArray());//加载数据源
if(!(resm_myexams != null && resm_myexams.length > 0)) {
this.getView().showTipNotification("该条件下无符合条件的数据!");
return false;
}
return super.verifyQuery(queryParam);
}
}