2024-12-12 02:25:38 +00:00
|
|
|
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;
|
2025-01-06 06:41:39 +00:00
|
|
|
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
2024-12-13 09:49:22 +00:00
|
|
|
import kd.bos.servicehelper.operation.SaveServiceHelper;
|
2024-12-12 02:25:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 采购需求单
|
2024-12-13 09:49:22 +00:00
|
|
|
* qeug_recon_settleplan_ext
|
2024-12-12 02:25:38 +00:00
|
|
|
*/
|
|
|
|
public class PurapplyAuditOPPlugin extends AbstractOperationServicePlugIn {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void afterExecuteOperationTransaction(AfterOperationArgs e) {
|
|
|
|
super.afterExecuteOperationTransaction(e);
|
|
|
|
String operationKey = e.getOperationKey();
|
2024-12-13 09:49:22 +00:00
|
|
|
if ("audit1".equals(operationKey)) {
|
2024-12-12 02:25:38 +00:00
|
|
|
DynamicObject[] dataEntities = e.getDataEntities();
|
|
|
|
DynamicObject dataEntity = dataEntities[0];
|
2025-01-06 06:41:39 +00:00
|
|
|
dataEntity = BusinessDataServiceHelper.loadSingle(dataEntity.getPkValue(),"recon_settleplanbill");
|
2024-12-13 09:49:22 +00:00
|
|
|
DynamicObjectCollection collection = dataEntity.getDynamicObjectCollection("qeug_cgxqentry");
|
2024-12-12 02:25:38 +00:00
|
|
|
if (collection.isEmpty()) {
|
|
|
|
DynamicObject add = collection.addNew();
|
2024-12-13 09:49:22 +00:00
|
|
|
add.set("qeug_reqdes","本次采购需求未填写明细");
|
2024-12-12 02:25:38 +00:00
|
|
|
}
|
2024-12-13 09:49:22 +00:00
|
|
|
SaveServiceHelper.save(new DynamicObject[]{dataEntity});
|
2024-12-12 02:25:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|