From 9f345310a755f35dcd06424b3923b119686365af Mon Sep 17 00:00:00 2001
From: cloudroam <cloudroam>
Date: 星期一, 09 九月 2024 16:14:33 +0800
Subject: [PATCH] add:合伙人账号启用/禁用;供应商启用/禁用;花店端账号禁用/启用

---
 src/main/java/com/mzl/flower/service/supplier/SupplierService.java |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/mzl/flower/service/supplier/SupplierService.java b/src/main/java/com/mzl/flower/service/supplier/SupplierService.java
index c5516c6..67e2e99 100644
--- a/src/main/java/com/mzl/flower/service/supplier/SupplierService.java
+++ b/src/main/java/com/mzl/flower/service/supplier/SupplierService.java
@@ -50,6 +50,7 @@
             supplier.create(SecurityUtils.getUserId());
             supplier.setShowed(true);
             supplier.setStatus(SUPPLIER_STATUS_AUDIT);
+            supplier.setIsEnabled(true);
             supplierMapper.insert(supplier);
         }else{//重新修改
             supplier = supplierMapper.selectById(dto.getId());
@@ -187,4 +188,18 @@
         supplier.update(SecurityUtils.getUserId());
         supplierMapper.updateById(supplier);
     }
+
+    public void isEnable(Long id) {
+        Supplier supplier = supplierMapper.selectById(id);
+        if (supplier == null) {
+            throw new ValidationException("供应商信息不存在");
+        }
+        if (supplier.getIsEnabled()) {
+            supplier.setIsEnabled(false);
+        } else {
+            supplier.setIsEnabled(true);
+        }
+        supplier.update(SecurityUtils.getUserId());
+        supplierMapper.updateById(supplier);
+    }
 }

--
Gitblit v1.9.3