物料保存关闭类、物料审核后 修改审核人、修改人为待审批人类 提交
This commit is contained in:
parent
5f571ca997
commit
f76ab6753b
|
|
@ -0,0 +1,39 @@
|
||||||
|
package tqq9.lc123.cloud.app.plugin.form.sys;
|
||||||
|
|
||||||
|
import kd.bos.bill.AbstractBillPlugIn;
|
||||||
|
import kd.bos.dataentity.resource.ResManager;
|
||||||
|
import kd.bos.dataentity.utils.StringUtils;
|
||||||
|
import kd.bos.form.IFormView;
|
||||||
|
import kd.bos.form.events.BeforeDoOperationEventArgs;
|
||||||
|
import kd.bos.form.operate.FormOperate;
|
||||||
|
import kd.sdk.plugin.Plugin;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单据界面插件
|
||||||
|
*/
|
||||||
|
public class MaterialSaveClosePlugin extends AbstractBillPlugIn implements Plugin {
|
||||||
|
@Override
|
||||||
|
public void beforeDoOperation(BeforeDoOperationEventArgs args) {
|
||||||
|
super.beforeDoOperation(args);
|
||||||
|
// FormOperate operation = (FormOperate) args.getSource();
|
||||||
|
// String key = operation.getOperateKey();
|
||||||
|
// if (StringUtils.equals("save", key)) {
|
||||||
|
// args.setCancel(Boolean.TRUE);
|
||||||
|
// // 弹出操作成功提示消息
|
||||||
|
// boolean showInParentView = true;
|
||||||
|
// IFormView view = this.getView().getViewNoPlugin(this.getView().getFormShowParameter().getParentPageId());
|
||||||
|
// if (view == null) {
|
||||||
|
// view = this.getView();
|
||||||
|
// showInParentView = false;
|
||||||
|
// }
|
||||||
|
// view.showSuccessNotification(String.format(ResManager.loadKDString("保存成功", "DefaultEntityOperate_5", "bos-entity-business", new Object[0]), operation.getOperateName().toString()));
|
||||||
|
// if (showInParentView) {
|
||||||
|
// this.getView().sendFormAction(view);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// this.getModel().setDataChanged(Boolean.FALSE);
|
||||||
|
// // 关闭新增窗口
|
||||||
|
// this.getView().close();
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -33,7 +33,16 @@ public class MaterialAuditOp extends AbstractOperationServicePlugIn {
|
||||||
if (operationResult.isSuccess()) {
|
if (operationResult.isSuccess()) {
|
||||||
DynamicObject[] dataEntities = e.getDataEntities();
|
DynamicObject[] dataEntities = e.getDataEntities();
|
||||||
for (DynamicObject material : dataEntities) {
|
for (DynamicObject material : dataEntities) {
|
||||||
material = BusinessDataServiceHelper.loadSingle(material.getPkValue(), "bd_material");
|
material = BusinessDataServiceHelper.loadSingle(material.getPkValue(), material.getDynamicObjectType().getName());
|
||||||
|
// DynamicObject tqq9_audit = material.getDynamicObject("tqq9_auditor");
|
||||||
|
// QFilter qf = new QFilter("id", "=", tqq9_audit.getPkValue());
|
||||||
|
// DynamicObject tqq9_auditor = BusinessDataServiceHelper.loadSingle("bos_user", new QFilter[]{qf});
|
||||||
|
// //将待审批人赋值给修改人、审核人
|
||||||
|
// if (tqq9_auditor != null) {
|
||||||
|
// material.set("modifier", tqq9_auditor);
|
||||||
|
// material.set("approverid", tqq9_auditor);
|
||||||
|
// SaveServiceHelper.save(new DynamicObject[]{material});
|
||||||
|
// }
|
||||||
String tqq9_srcnumber = material.getString("tqq9_srcnumber");
|
String tqq9_srcnumber = material.getString("tqq9_srcnumber");
|
||||||
//查询是否有源单编码,如果有就是物料变更,如果没有就是正常物料审核
|
//查询是否有源单编码,如果有就是物料变更,如果没有就是正常物料审核
|
||||||
if (StringUtils.isNotBlank(tqq9_srcnumber)) {
|
if (StringUtils.isNotBlank(tqq9_srcnumber)) {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
package tqq9.lc123.cloud.app.plugin.operate.sys;
|
||||||
|
|
||||||
|
import kd.bos.dataentity.entity.DynamicObject;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单据操作插件
|
||||||
|
* 审核后 修改审核人、修改人为待审批人
|
||||||
|
*/
|
||||||
|
public class MaterialAuditOpPlugin extends AbstractOperationServicePlugIn implements Plugin {
|
||||||
|
@Override
|
||||||
|
public void afterExecuteOperationTransaction(AfterOperationArgs e) {
|
||||||
|
super.afterExecuteOperationTransaction(e);
|
||||||
|
DynamicObject[] dataEntities = e.getDataEntities();
|
||||||
|
for (DynamicObject material : dataEntities) {
|
||||||
|
material = BusinessDataServiceHelper.loadSingle(material.getPkValue(), material.getDynamicObjectType().getName());
|
||||||
|
DynamicObject tqq9_auditor = material.getDynamicObject("tqq9_auditor");
|
||||||
|
if (tqq9_auditor != null) {
|
||||||
|
material.set("modifier", tqq9_auditor);
|
||||||
|
material.set("approverid", tqq9_auditor);
|
||||||
|
SaveServiceHelper.save(new DynamicObject[]{material});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue