From aaa854c00701ba3188dddea9278634ced1eaa486 Mon Sep 17 00:00:00 2001 From: ljw Date: Mon, 14 Oct 2024 10:58:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=86=85=E5=AE=A1=E9=A2=84=E7=AE=97?= =?UTF-8?q?=E5=8D=95=E6=92=A4=E9=94=80=E9=99=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../intauditbusa/op/InAuditWithdrawalOp.java | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/main/java/com/yem/wm/im/intauditbusa/op/InAuditWithdrawalOp.java diff --git a/src/main/java/com/yem/wm/im/intauditbusa/op/InAuditWithdrawalOp.java b/src/main/java/com/yem/wm/im/intauditbusa/op/InAuditWithdrawalOp.java new file mode 100644 index 00000000..bb06f50d --- /dev/null +++ b/src/main/java/com/yem/wm/im/intauditbusa/op/InAuditWithdrawalOp.java @@ -0,0 +1,49 @@ +package com.yem.wm.im.intauditbusa.op; + +import com.yem.wm.utils.DynamicObjectUtil; +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.entity.plugin.AbstractOperationServicePlugIn; +import kd.bos.entity.plugin.args.EndOperationTransactionArgs; +import kd.bos.orm.query.QCP; +import kd.bos.orm.query.QFilter; +import kd.bos.servicehelper.AttachmentServiceHelper; +import kd.bos.servicehelper.BusinessDataServiceHelper; +import kd.bos.servicehelper.operation.DeleteServiceHelper; + +import java.util.List; +import java.util.Map; + +/** + * @author ljw + * @date 2024/10/12 15:23 + * @description InAuditWithdrawalOp + */ +public class InAuditWithdrawalOp extends AbstractOperationServicePlugIn { + @Override + public void endOperationTransaction(EndOperationTransactionArgs e) { + DynamicObject[] dataEntities = e.getDataEntities(); + for (DynamicObject dataEntitie : dataEntities) { + dataEntitie = BusinessDataServiceHelper.loadSingle(dataEntitie.getPkValue(), dataEntitie.getDynamicObjectType().getName()); + createPdf(dataEntitie); + } + } + + private void createPdf(DynamicObject dataEntitie) { + // 清空上传的附件面板 + List> beforeUpload = AttachmentServiceHelper.getAttachments("yem_im_intauditbusa", dataEntitie.getLong("id"), "attachmentpanel"); + List> salesorder = AttachmentServiceHelper.getAttachments("yem_es_salesorder", dataEntitie.getLong("yem_sourcebillid"), "attachmentpanel"); + for (Map map : salesorder) { + Boolean bool = false; + if (!bool) { + for (Map beforeUploadmap : beforeUpload) { + if (beforeUploadmap.get("uid").equals(map.get("uid"))) { + bool = true; + } + } + } + if (bool) { + DeleteServiceHelper.delete("bos_attachment", new QFilter[]{new QFilter("id", QCP.equals, map.get("attPkId"))}); + } + } + } +}