订舱产品需求单 作废功能完善 (作废时同时删除【云之家表单实例id】、【云之家流程实例id】 )

This commit is contained in:
ljw 2024-08-29 11:30:12 +08:00
parent 068d66138b
commit 0205f3f397

View File

@ -0,0 +1,35 @@
package com.yem.wm.im.orderproreqbill.op;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
import kd.bos.entity.plugin.args.AfterOperationArgs;
import kd.bos.orm.query.QCP;
import kd.bos.orm.query.QFilter;
import kd.bos.servicehelper.BusinessDataServiceHelper;
import kd.bos.servicehelper.operation.SaveServiceHelper;
/**
* @author ljw
* @date 2024/8/29 10:26
* @description orderproreqbillcancelstatusOp
*/
public class orderproreqbillcancelstatusOp extends AbstractOperationServicePlugIn {
@Override
public void afterExecuteOperationTransaction(AfterOperationArgs e) {
super.afterExecuteOperationTransaction(e);
DynamicObject[] dataEntities = e.getDataEntities();
for (DynamicObject dataEntity : dataEntities) {
long aLong = dataEntity.getLong("id");
DynamicObject dynamicObject = BusinessDataServiceHelper.loadSingle("yem_orderproreqbill", "id,number,yem_cancelstatus,yem_flowinstid,yem_forminstid,yem_contremark"
, new QFilter[]{new QFilter("id", QCP.equals, aLong)});
String yemCancelstatus = dynamicObject.getString("yem_cancelstatus");
if (yemCancelstatus.equals("B")){
dynamicObject.set("yem_flowinstid",null);
dynamicObject.set("yem_forminstid",null);
dynamicObject.set("yem_contremark",null);
}
SaveServiceHelper.save(new DynamicObject[]{dynamicObject});
SaveServiceHelper.update(dynamicObject);
}
}
}