2024-11-21 01:21:00 +00:00
|
|
|
|
package shkd.repc.recos.formplugin;
|
|
|
|
|
|
|
|
|
|
import kd.bos.bill.AbstractBillPlugIn;
|
|
|
|
|
import kd.bos.dataentity.entity.DynamicObject;
|
|
|
|
|
import kd.bos.entity.datamodel.IDataModel;
|
|
|
|
|
import kd.bos.form.FormShowParameter;
|
|
|
|
|
import kd.bos.orm.query.QCP;
|
|
|
|
|
import kd.bos.orm.query.QFilter;
|
|
|
|
|
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
|
|
|
|
import kd.sdk.plugin.Plugin;
|
|
|
|
|
|
|
|
|
|
import java.util.EventObject;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 单据界面插件
|
|
|
|
|
*/
|
|
|
|
|
public class GetDecisionAndPurProjectPlugin extends AbstractBillPlugIn implements Plugin {
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* 目标成本调整-若本单据是从定标跳转过来,则将定标上的采购项目赋值到项目
|
|
|
|
|
* */
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void afterBindData(EventObject e) {
|
|
|
|
|
super.afterBindData(e);
|
|
|
|
|
FormShowParameter formShowParameter = this.getView().getFormShowParameter();
|
|
|
|
|
Object decisionId = formShowParameter.getCustomParam("decision_id");
|
|
|
|
|
Object purProjectNumber = formShowParameter.getCustomParam("purproject_number");
|
2024-11-22 03:08:28 +00:00
|
|
|
|
Object seqNum = formShowParameter.getCustomParam("seqNum");
|
2024-11-21 01:21:00 +00:00
|
|
|
|
|
|
|
|
|
IDataModel model = this.getModel();
|
|
|
|
|
if (decisionId != null && 0 != (Long) decisionId) {
|
|
|
|
|
model.setValue("qeug_decision", decisionId);
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-22 03:08:28 +00:00
|
|
|
|
if (seqNum != null) {
|
|
|
|
|
model.setValue("qeug_section_seq", seqNum);
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-21 01:21:00 +00:00
|
|
|
|
if (purProjectNumber != null && !((String) purProjectNumber).isEmpty()) {
|
|
|
|
|
DynamicObject project = (DynamicObject) this.getModel().getValue("project");
|
|
|
|
|
if (project == null) {
|
|
|
|
|
QFilter projectQF= new QFilter("number", QCP.equals, purProjectNumber);
|
|
|
|
|
project = BusinessDataServiceHelper.loadSingle("repmd_project_f7", projectQF.toArray());
|
|
|
|
|
model.setValue("project", project);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|