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/customer/CustomerService.java |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/mzl/flower/service/customer/CustomerService.java b/src/main/java/com/mzl/flower/service/customer/CustomerService.java
index ffce4ed..a4aa812 100644
--- a/src/main/java/com/mzl/flower/service/customer/CustomerService.java
+++ b/src/main/java/com/mzl/flower/service/customer/CustomerService.java
@@ -65,6 +65,7 @@
             }
 
             customer.create(SecurityUtils.getUserId());
+            customer.setIsEnabled(true);
             customerMapper.insert(customer);
         } else {//重新修改
             customer = customerMapper.selectById(dto.getId());
@@ -200,4 +201,17 @@
         }
         return null;
     }
+    public void isEnable(Long id) {
+        Customer customer = customerMapper.selectById(id);
+        if (customer == null) {
+            throw new ValidationException("商户信息不存在");
+        }
+        if (customer.getIsEnabled()) {
+            customer.setIsEnabled(false);
+        } else {
+            customer.setIsEnabled(true);
+        }
+        customer.update(SecurityUtils.getUserId());
+        customerMapper.updateById(customer);
+    }
 }

--
Gitblit v1.9.3