Merge branch 'refs/heads/main' into dev
This commit is contained in:
commit
b1c8e787fb
|
@ -0,0 +1,18 @@
|
|||
package zcgj.zcdev.zcdev.pr.plugin.form;
|
||||
|
||||
import kd.bos.bill.AbstractBillPlugIn;
|
||||
import kd.sdk.plugin.Plugin;
|
||||
|
||||
import java.util.EventObject;
|
||||
|
||||
/**
|
||||
* 单据界面插件
|
||||
*/
|
||||
public class EcContractFromPlugin extends AbstractBillPlugIn implements Plugin {
|
||||
|
||||
@Override
|
||||
public void afterCreateNewData(EventObject e) {
|
||||
super.afterCreateNewData(e);
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
package zcgj.zcdev.zcdev.pr.plugin.form;
|
||||
|
||||
import kd.bos.bill.AbstractBillPlugIn;
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||
import kd.bos.dataentity.metadata.dynamicobject.DynamicObjectType;
|
||||
import kd.bos.entity.datamodel.events.PropertyChangedArgs;
|
||||
import kd.sdk.plugin.Plugin;
|
||||
|
||||
/**
|
||||
* 单据界面插件
|
||||
*/
|
||||
public class OutContractFromPlugin extends AbstractBillPlugIn implements Plugin {
|
||||
|
||||
private String entryName = "treelistentry";//分录标识
|
||||
|
||||
private String ecContract = "";//
|
||||
@Override
|
||||
public void propertyChanged(PropertyChangedArgs e) {
|
||||
super.propertyChanged(e);
|
||||
String changeName = e.getProperty().getName();
|
||||
if(changeName.equals(ecContract)){//收入合同字段值改变
|
||||
Object outC = this.getModel().getValue(ecContract);
|
||||
if(outC!=null){
|
||||
DynamicObject outContract = (DynamicObject) outC;
|
||||
DynamicObjectCollection ecCEntrys = outContract.getDynamicObjectCollection(entryName);//获取收入合同合同清单
|
||||
for (int i = 0; i < ecCEntrys.size(); i++) {
|
||||
DynamicObject ecCEntry = ecCEntrys.get(i);
|
||||
int row = this.getModel().insertEntryRow(entryName, i);
|
||||
this.getModel().setValue(entryName, ecCEntry.get(""), row);
|
||||
}
|
||||
DynamicObjectCollection outCEntry = this.getModel().getEntryEntity(entryName);
|
||||
if (outCEntry.size() < 0) {
|
||||
for (int i = 0; i < ecCEntrys.size(); i++) {
|
||||
outCEntry.add(i, ecCEntrys.get(i));
|
||||
}
|
||||
this.getView().updateView(entryName);
|
||||
}
|
||||
outCEntry = this.getModel().getEntryEntity(entryName);
|
||||
if (outCEntry.size() < 0) {
|
||||
for (int i = 0; i < ecCEntrys.size(); i++) {
|
||||
outCEntry.add(ecCEntrys.get(i));
|
||||
}
|
||||
this.getView().updateView(entryName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package zcgj.zcdev.zcdev.pr.plugin.operate;
|
||||
import kd.bos.entity.plugin.AddValidatorsEventArgs;
|
||||
import kd.bos.entity.validate.AbstractValidator;
|
||||
import kd.ec.contract.opplugin.InContractBillOp;
|
||||
import kd.ec.contract.opplugin.validator.ContractValidator;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SubmitInContractBillOp extends InContractBillOp{
|
||||
@Override
|
||||
public void onAddValidators(AddValidatorsEventArgs e) {
|
||||
List<AbstractValidator> validators = e.getValidators();
|
||||
for (AbstractValidator validator:validators){
|
||||
if (validator instanceof ContractValidator){
|
||||
validators.remove(validator);
|
||||
break;
|
||||
}
|
||||
}
|
||||
super.onAddValidators(e);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue