Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
91489a9398
|
@ -0,0 +1,57 @@
|
||||||
|
package zcgj.zcdev.zcdev.pr.plugin.form;
|
||||||
|
|
||||||
|
import kd.bos.bill.AbstractBillPlugIn;
|
||||||
|
import kd.bos.dataentity.entity.DynamicObject;
|
||||||
|
import kd.bos.dataentity.metadata.IDataEntityType;
|
||||||
|
import kd.bos.form.field.BasedataEdit;
|
||||||
|
import kd.bos.form.field.events.BeforeF7SelectEvent;
|
||||||
|
import kd.bos.form.field.events.BeforeF7SelectListener;
|
||||||
|
import kd.bos.list.ListShowParameter;
|
||||||
|
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 ContractProcessRevisionFilterPlugin extends AbstractBillPlugIn implements Plugin, BeforeF7SelectListener {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void registerListener(EventObject e) {
|
||||||
|
super.registerListener(e);
|
||||||
|
BasedataEdit contractprocess = this.getControl("zcgj_contractprocess");
|
||||||
|
if(contractprocess != null) {
|
||||||
|
contractprocess.addBeforeF7SelectListener(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void beforeF7Select(BeforeF7SelectEvent beforeF7SelectEvent) {
|
||||||
|
String name1 = beforeF7SelectEvent.getProperty().getName();
|
||||||
|
if(name1.equals("zcgj_contractprocess")) {
|
||||||
|
String name = this.getModel().getDataEntity().getDataEntityType().getName();
|
||||||
|
Object contractObj = this.getModel().getValue("contract");
|
||||||
|
if(contractObj != null) {
|
||||||
|
if(contractObj instanceof DynamicObject) {
|
||||||
|
DynamicObject contract = (DynamicObject) contractObj;
|
||||||
|
Object projectObj = contract.getDynamicObject("project");
|
||||||
|
if(projectObj!=null){
|
||||||
|
DynamicObject projectInfo = (DynamicObject)projectObj;
|
||||||
|
QFilter qFilter = new QFilter("project.id", QCP.equals, projectInfo.getLong("id"));
|
||||||
|
QFilter treeFilter = new QFilter("number", QCP.equals, projectInfo.getString("number"));
|
||||||
|
ListShowParameter showParameter = (ListShowParameter) beforeF7SelectEvent.getFormShowParameter();
|
||||||
|
showParameter.getListFilterParameter().getQFilters().add(qFilter);
|
||||||
|
showParameter.getTreeFilterParameter().getQFilters().add(treeFilter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// }
|
||||||
|
}
|
|
@ -15,30 +15,32 @@ public class ContractSettleOp extends AbstractOperationServicePlugIn {
|
||||||
public void onAddValidators(AddValidatorsEventArgs e) {
|
public void onAddValidators(AddValidatorsEventArgs e) {
|
||||||
super.onAddValidators(e);
|
super.onAddValidators(e);
|
||||||
DynamicObject[] dataEntities1 = e.getDataEntities();
|
DynamicObject[] dataEntities1 = e.getDataEntities();
|
||||||
DynamicObject object = dataEntities1[0];
|
if(dataEntities1!=null && dataEntities1.length>0){
|
||||||
Object changetype = object.getString("changetype");
|
DynamicObject object = dataEntities1[0];
|
||||||
if (changetype != null) {
|
Object changetype = object.getString("changetype");
|
||||||
if (changetype.toString().equals("03")) {
|
if (changetype != null) {
|
||||||
DynamicObject contract = object.getDynamicObject("contract");
|
if (changetype.toString().equals("03")) {
|
||||||
String billName = contract.getDataEntityType().getName();
|
DynamicObject contract = object.getDynamicObject("contract");
|
||||||
DynamicObject zcgjpartb = object.getDynamicObject("zcgj_partb");
|
String billName = contract.getDataEntityType().getName();
|
||||||
DynamicObjectCollection zcgjOtherpart = object.getDynamicObjectCollection("zcgj_otherpart");
|
DynamicObject zcgjpartb = object.getDynamicObject("zcgj_partb");
|
||||||
if (billName.equals("ec_out_contract_f7")) {
|
DynamicObjectCollection zcgjOtherpart = object.getDynamicObjectCollection("zcgj_otherpart");
|
||||||
QFilter f1 = new QFilter("number", "=", contract.getString("number"));
|
if (billName.equals("ec_out_contract_f7")) {
|
||||||
DynamicObject outContractF7 = BusinessDataServiceHelper.loadSingle("ec_out_contract_f7", new QFilter[]{f1});
|
QFilter f1 = new QFilter("number", "=", contract.getString("number"));
|
||||||
outContractF7.set("partb", zcgjpartb);
|
DynamicObject outContractF7 = BusinessDataServiceHelper.loadSingle("ec_out_contract_f7", new QFilter[]{f1});
|
||||||
OperationResult saveOperationResult = SaveServiceHelper.saveOperate("ec_out_contract_f7", new DynamicObject[]{outContractF7}, null);//支出合同F7实体
|
outContractF7.set("partb", zcgjpartb);
|
||||||
|
OperationResult saveOperationResult = SaveServiceHelper.saveOperate("ec_out_contract_f7", new DynamicObject[]{outContractF7}, null);//支出合同F7实体
|
||||||
|
|
||||||
QFilter f2 = new QFilter("billno", "=", contract.getString("number"));
|
QFilter f2 = new QFilter("billno", "=", contract.getString("number"));
|
||||||
DynamicObject outContract = BusinessDataServiceHelper.loadSingle("ec_out_contract", new QFilter[]{f2});
|
DynamicObject outContract = BusinessDataServiceHelper.loadSingle("ec_out_contract", new QFilter[]{f2});
|
||||||
outContract.set("partb", zcgjpartb);
|
outContract.set("partb", zcgjpartb);
|
||||||
if (zcgjOtherpart != null) {
|
if (zcgjOtherpart != null) {
|
||||||
// DynamicObjectCollection otherpart = (DynamicObjectCollection) this.getModel().getValue("zcgj_otherpart");
|
// DynamicObjectCollection otherpart = (DynamicObjectCollection) this.getModel().getValue("zcgj_otherpart");
|
||||||
outContract.set("otherpart", zcgjOtherpart);
|
outContract.set("otherpart", zcgjOtherpart);
|
||||||
outContract.set("ismulticontract", true);
|
outContract.set("ismulticontract", true);
|
||||||
|
}
|
||||||
|
OperationResult saveOperationResult1 = SaveServiceHelper.saveOperate("ec_out_contract", new DynamicObject[]{outContractF7}, null);//支出合同实体
|
||||||
|
System.out.println(saveOperationResult1);
|
||||||
}
|
}
|
||||||
OperationResult saveOperationResult1 = SaveServiceHelper.saveOperate("ec_out_contract", new DynamicObject[]{outContractF7}, null);//支出合同实体
|
|
||||||
System.out.println(saveOperationResult1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue