diff --git a/main/java/shjh/jhzj7/fi/fi/plugin/operate/PaybillOperation.java b/main/java/shjh/jhzj7/fi/fi/plugin/operate/PaybillOperation.java index bfa9993..37cec34 100644 --- a/main/java/shjh/jhzj7/fi/fi/plugin/operate/PaybillOperation.java +++ b/main/java/shjh/jhzj7/fi/fi/plugin/operate/PaybillOperation.java @@ -10,6 +10,7 @@ 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.AttachmentServiceHelper; import kd.bos.servicehelper.BusinessDataServiceHelper; import kd.bos.servicehelper.operation.SaveServiceHelper; import kd.bos.util.StringUtils; @@ -19,6 +20,8 @@ import java.time.LocalDate; import java.time.ZoneId; import java.time.format.DateTimeFormatter; import java.util.Date; +import java.util.List; +import java.util.Map; import static shjh.jhzj7.fi.fi.utils.SapUtils.withholding_billing; @@ -168,7 +171,15 @@ public class PaybillOperation extends AbstractOperationServicePlugIn implements header.put("FM_ExpenseTypeCode", FM_ExpenseTypeCode);// 业务大类编码(EQ49,EQ44,EQ1101) header.put("FM_CurrencyCode", "RMB");// 币种编码,默认:RMB header.put("FM_RequestName", bill.getString("description"));// 单据主题_拼接 - header.put("FM_AttachUrl", null);//附件URL地址:array + List> attachments = AttachmentServiceHelper.getAttachments(bill.getDataEntityType().getName(), bill.getLong("id"), "attachmentpanel"); + if (attachments.size()!=0){ + JSONArray attachUrls = new JSONArray(); + for (Map attachment : attachments) { + String url = (String)attachment.get("url"); + attachUrls.add(url); + } + header.put("FM_AttachUrl", attachUrls);//附件URL地址:array + } header.put("FM_BudType", 0);//预算类别0-组织预算,1-全年预算,当前只处理0 int header.put("Remark", bill.getString("description"));// 事项描述_摘要