dobe_comic8/main/java/shkd/repc/rebm/opplugin/PurapplyAuditOPPlugin.java

32 lines
1.1 KiB
Java
Raw Normal View History

package shkd.repc.rebm.opplugin;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.DynamicObjectCollection;
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
import kd.bos.entity.plugin.args.AfterOperationArgs;
import kd.bos.servicehelper.operation.SaveServiceHelper;
/**
* 采购需求单
* qeug_recon_settleplan_ext
*/
public class PurapplyAuditOPPlugin extends AbstractOperationServicePlugIn {
@Override
public void afterExecuteOperationTransaction(AfterOperationArgs e) {
super.afterExecuteOperationTransaction(e);
String operationKey = e.getOperationKey();
if ("audit1".equals(operationKey)) {
DynamicObject[] dataEntities = e.getDataEntities();
DynamicObject dataEntity = dataEntities[0];
DynamicObjectCollection collection = dataEntity.getDynamicObjectCollection("qeug_cgxqentry");
if (collection.isEmpty()) {
DynamicObject add = collection.addNew();
add.set("qeug_reqdes","本次采购需求未填写明细");
}
SaveServiceHelper.save(new DynamicObject[]{dataEntity});
}
}
}