From 540b80dd4c3b3fdecc56e12792b485cc111b5530 Mon Sep 17 00:00:00 2001
From: cloudroam <cloudroam>
Date: 星期二, 10 九月 2024 14:03:38 +0800
Subject: [PATCH] 1.新增筛选:已加价/未加价2.新增“售价”字段,售价=底价+加价

---
 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