lc/lc123/cloud/app/plugin/operate/sys/MaterialSaveAndSubmitOp.java

30 lines
1.2 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package tqq9.lc123.cloud.app.plugin.operate.sys;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.entity.operate.result.OperationResult;
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
import kd.bos.entity.plugin.args.AfterOperationArgs;
import kd.bos.servicehelper.BusinessDataServiceHelper;
import kd.bos.servicehelper.operation.SaveServiceHelper;
/**
* 物料保存或者提交后将是否修改个性字段修改为false 锁定住物料自行字段
*/
public class MaterialSaveAndSubmitOp extends AbstractOperationServicePlugIn {
@Override
public void afterExecuteOperationTransaction(AfterOperationArgs e) {
super.afterExecuteOperationTransaction(e);
OperationResult operationResult = this.getOperationResult();
if (operationResult.isSuccess()) {
DynamicObject[] dataEntities = e.getDataEntities();
for (DynamicObject material : dataEntities) {
material = BusinessDataServiceHelper.loadSingle(material.getPkValue(), material.getDynamicObjectType().getName());
material.set("tqq9_checkboxfield", false);
SaveServiceHelper.save(new DynamicObject[]{material});
}
}
}
}