35 lines
1.4 KiB
Java
35 lines
1.4 KiB
Java
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;
|
|
import kd.sdk.plugin.Plugin;
|
|
import oadd.org.apache.commons.lang3.StringUtils;
|
|
|
|
import java.util.List;
|
|
|
|
/**
|
|
* 单据操作插件
|
|
* 供应商保存后设置中台供应商id
|
|
*/
|
|
public class SupSaveAfterOp 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) {
|
|
DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle(successPkId, "bd_supplier");
|
|
String tqq9_ztsupplierid = dataEntity.getString("tqq9_ztsupplierid");
|
|
if (StringUtils.isBlank(tqq9_ztsupplierid)) {
|
|
dataEntity.set("tqq9_ztsupplierid", dataEntity.getPkValue());
|
|
SaveServiceHelper.save(new DynamicObject[]{dataEntity});
|
|
}
|
|
}
|
|
|
|
}
|
|
} |