Bladeren bron

发送邮件改为发送指定的附件id

hu 6 uur geleden
bovenliggende
commit
cd6fab0315

+ 3 - 2
src/custom/restcontroller/webmanage/saletool/sharematerial/EquipmentResourceLibrary.java

@@ -507,6 +507,7 @@ public class EquipmentResourceLibrary extends Controller {
     public String sendMail() throws Exception {
         Long sat_sharematerialid = content.getLongValue("sat_sharematerialid");
         String email = content.getStringValue("email");
+        JSONArray attachmentids = content.getJSONArray("attachmentids");
 
         if (!Parameter.get(siteid, "remind_mail").equalsIgnoreCase("1")) {
             return getErrReturnObject().setErrMsg("邮件功能未开启").toString();
@@ -516,8 +517,8 @@ public class EquipmentResourceLibrary extends Controller {
         if (rows.isEmpty()) {
             return getErrReturnObject().setErrMsg("数据不存在").toString();
         }
-
-        Rows rowsAtt = Attachment.get(this, "sat_sharematerial", sat_sharematerialid);
+        //Rows rowsAtt = Attachment.get(this, "sat_sharematerial", sat_sharematerialid);
+        Rows rowsAtt = Attachment.get(this,attachmentids.toArray(new Long[]{}));
 
         EmailContent emailContent = new EmailContent();
         emailContent.addText(rows.get(0).getString("content"));