From 02cdd5f7521065c444e43e71c395c8c74054b183 Mon Sep 17 00:00:00 2001
From: zm <zm@iemsoft.cn>
Date: Wed, 26 Aug 2020 21:52:01 +0800
Subject: [PATCH] 附件管理功能开发,采购入库单导出pdf增加备注字段,采购入库和销售出库的提交按钮名称修改为审核按钮

---
 src/web/Application/Home/Service/AttachmentService.class.php |   40 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 40 insertions(+), 0 deletions(-)

diff --git a/src/web/Application/Home/Service/AttachmentService.class.php b/src/web/Application/Home/Service/AttachmentService.class.php
index 9901219..2421e15 100644
--- a/src/web/Application/Home/Service/AttachmentService.class.php
+++ b/src/web/Application/Home/Service/AttachmentService.class.php
@@ -70,4 +70,44 @@
     return $this->ok(null);
   }
 
+  /**
+   * 删除附件
+   *
+   * @param array $params        	
+   * @return NULL|array
+   */
+  public function delete($params)
+  {
+    if ($this->isNotOnline()) {
+      return $this->notOnlineError();
+    }
+
+    $id = $params["attachmentId"];
+
+    $db = $this->db();
+    $db->startTrans();
+
+    $dao = new AttachmentDAO($db);
+
+    $log = null;
+
+    $params["companyId"] = $this->getCompanyId();
+
+    $rc = $dao->delete($params);
+    if ($rc) {
+      $db->rollback();
+      return $rc;
+    }
+
+    $log = "删除附件: $id";
+
+    // 记录业务日志
+    $bs = new BizlogService($db);
+    $bs->insertBizlog($log, $this->LOG_CATEGORY);
+
+    $db->commit();
+
+    return $this->ok(null);
+  }
+
 }

--
Gitblit v1.8.0