物料提交 将修改人 赋给 物料修改人(MaterialSubmitOp)
This commit is contained in:
parent
329d666b15
commit
1cb572ad65
|
|
@ -0,0 +1,33 @@
|
|||
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.entity.plugin.args.BeforeOperationArgs;
|
||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||
import kd.bos.servicehelper.operation.SaveServiceHelper;
|
||||
import kd.bos.servicehelper.user.UserServiceHelper;
|
||||
import kd.sdk.plugin.Plugin;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 单据操作插件
|
||||
* 物料提交 将修改人 赋给 物料修改人
|
||||
*/
|
||||
public class MaterialSubmitOp extends AbstractOperationServicePlugIn implements Plugin {
|
||||
@Override
|
||||
public void afterExecuteOperationTransaction(AfterOperationArgs e) {
|
||||
super.afterExecuteOperationTransaction(e);
|
||||
OperationResult operationResult = this.getOperationResult();
|
||||
List<Object> successPkIds = operationResult.getSuccessPkIds();
|
||||
for (Object successPkId : successPkIds) {
|
||||
long userID = UserServiceHelper.getCurrentUserId();
|
||||
DynamicObject material = BusinessDataServiceHelper.loadSingle(successPkId, "bd_material");
|
||||
DynamicObject user = BusinessDataServiceHelper.loadSingle(userID, "bos_user");
|
||||
material.set("tqq9_auditor", user);
|
||||
SaveServiceHelper.save(new DynamicObject[]{material});
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue