From 6f96a5cd39c0d3d2d96375a73718609046c2f92c Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@63.com>
Date: 星期一, 12 九月 2022 16:28:44 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/crm/manager/controller/CstmrController.java |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/zy/crm/manager/controller/CstmrController.java b/src/main/java/com/zy/crm/manager/controller/CstmrController.java
index bb59c92..41bd8d0 100644
--- a/src/main/java/com/zy/crm/manager/controller/CstmrController.java
+++ b/src/main/java/com/zy/crm/manager/controller/CstmrController.java
@@ -9,6 +9,7 @@
 import com.core.common.Cools;
 import com.core.common.DateUtils;
 import com.core.common.R;
+import com.core.exception.CoolException;
 import com.zy.crm.common.web.BaseController;
 import com.zy.crm.manager.entity.Cstmr;
 import com.zy.crm.manager.service.CstmrService;
@@ -61,7 +62,15 @@
     @RequestMapping(value = "/cstmr/add/auth")
     @ManagerAuth
     public R add(Cstmr cstmr) {
-        cstmr.setHostId(getHostId());
+        Long hostId = getHostId();
+        if (cstmrService.selectByUuid(hostId, cstmr.getUuid()) != null) {
+            throw new CoolException("瀹㈡埛宸插瓨鍦�");
+        }
+        cstmr.setHostId(hostId);
+        cstmr.setUuid(cstmrService.getNextUuid(hostId));  // 瀹㈡埛浠e彿
+        cstmr.setDeptId(getDeptId());               // 鎵�灞為儴闂�
+        cstmr.setUserId(getUserId());               // 鎵�灞炰汉鍛�
+
         cstmr.setCreateBy(getUserId());
         cstmr.setCreateTime(new Date());
         cstmr.setUpdateBy(getUserId());

--
Gitblit v1.9.1