2025-10-30 07:47:33 +00:00
|
|
|
package tqq9.lc123.cloud.app.plugin.operate.conm;
|
|
|
|
|
|
|
|
|
|
import kd.bos.dataentity.OperateOption;
|
|
|
|
|
import kd.bos.dataentity.entity.DynamicObject;
|
|
|
|
|
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
|
|
|
|
import kd.bos.entity.operate.result.OperationResult;
|
|
|
|
|
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
|
|
|
|
|
import kd.bos.entity.plugin.PreparePropertysEventArgs;
|
|
|
|
|
import kd.bos.entity.plugin.args.AfterOperationArgs;
|
|
|
|
|
import kd.bos.logging.Log;
|
|
|
|
|
import kd.bos.logging.LogFactory;
|
2025-11-17 07:41:30 +00:00
|
|
|
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
2025-10-30 07:47:33 +00:00
|
|
|
import kd.bos.servicehelper.operation.OperationServiceHelper;
|
|
|
|
|
import tqq9.lc123.cloud.app.api.utils.Constants;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 合同审核审核返利规则
|
|
|
|
|
*/
|
|
|
|
|
public class PurconmAuditToFLOp extends AbstractOperationServicePlugIn {
|
|
|
|
|
private final static Log logger = LogFactory.getLog(PurconmAuditToFLOp.class);
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onPreparePropertys(PreparePropertysEventArgs e) {
|
|
|
|
|
super.onPreparePropertys(e);
|
|
|
|
|
e.getFieldKeys().add("tqq9_entryentity.tqq9_pur_rebate");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void afterExecuteOperationTransaction(AfterOperationArgs e) {
|
|
|
|
|
super.afterExecuteOperationTransaction(e);
|
|
|
|
|
DynamicObject[] dataEntities1 = e.getDataEntities();
|
|
|
|
|
for (DynamicObject dynamicObject : dataEntities1) {
|
|
|
|
|
DynamicObjectCollection tqq9_entryentity = dynamicObject.getDynamicObjectCollection("tqq9_entryentity");
|
|
|
|
|
for (DynamicObject object : tqq9_entryentity) {
|
|
|
|
|
DynamicObject tqq9_pur_rebate = object.getDynamicObject("tqq9_pur_rebate");
|
2025-11-17 07:41:30 +00:00
|
|
|
if (null != tqq9_pur_rebate) {
|
|
|
|
|
tqq9_pur_rebate = BusinessDataServiceHelper.loadSingle(tqq9_pur_rebate.getLong("id"), "tqq9_pur_rebate");
|
|
|
|
|
OperateOption operateOption = OperateOption.create();
|
|
|
|
|
OperationResult auditResult = OperationServiceHelper.executeOperate(Constants.TYPE_AUDIT, "tqq9_pur_rebate", new DynamicObject[]{tqq9_pur_rebate}, operateOption);
|
|
|
|
|
if (!auditResult.isSuccess()) {
|
|
|
|
|
StringBuilder message = new StringBuilder();
|
|
|
|
|
auditResult.getAllErrorOrValidateInfo().forEach((error) -> {
|
|
|
|
|
message.append(error.getMessage());
|
|
|
|
|
});
|
|
|
|
|
logger.info("返利规则:" + tqq9_pur_rebate.getString("number") + "审批失败:" + message);
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-10-30 07:47:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|