From 42f542954978985c071861af6a0d27389949d015 Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期五, 01 三月 2024 09:40:42 +0800
Subject: [PATCH] 实体类添加字段

---
 north-glass-erp/src/main/java/com/example/erp/service/sd/CustomerService.java |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/north-glass-erp/src/main/java/com/example/erp/service/sd/CustomerService.java b/north-glass-erp/src/main/java/com/example/erp/service/sd/CustomerService.java
index d575958..9c04b4b 100644
--- a/north-glass-erp/src/main/java/com/example/erp/service/sd/CustomerService.java
+++ b/north-glass-erp/src/main/java/com/example/erp/service/sd/CustomerService.java
@@ -44,9 +44,11 @@
         try {
             Customer customer = JSONObject.parseObject(JSONObject.toJSONString(object.get("customer")), Customer.class);
            if(customer!=null){
-               if (customer.getId()!=null){
+               if (customer.getId()!=null && customer.getId()!=0){
+                   System.out.println(111);
                    customerMapper.updateCustomer(customer);
                }else{
+                   System.out.println(222);
                    customerMapper.insertCustomer(customer);
                }
 

--
Gitblit v1.8.0