From ad6b7f0d80337bcddb1d694cc53bd6273c03149e Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期三, 11 十月 2023 11:10:58 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/crm/manager/controller/CstmrController.java | 21 ++++++++++++++++++---
1 files changed, 18 insertions(+), 3 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 75ffe4d..ca07e48 100644
--- a/src/main/java/com/zy/crm/manager/controller/CstmrController.java
+++ b/src/main/java/com/zy/crm/manager/controller/CstmrController.java
@@ -68,6 +68,17 @@
return R.ok(cstmrService.selectById(String.valueOf(id)));
}
+ @RequestMapping(value = "/cstmr/name/check/auth")
+ @ManagerAuth
+ public R getName(String name) {
+ Cstmr cstmr = cstmrService.selectByName(getHostId(), name);
+ if (Cools.isEmpty(cstmr) || cstmr==null){
+ return R.ok();
+ }else {
+ return R.error(name+"宸插瓨鍦�");
+ }
+ }
+
@RequestMapping(value = "/cstmr/page/auth")
@ManagerAuth
public R page(@RequestParam(defaultValue = "1") Integer curr,
@@ -119,6 +130,9 @@
if (cstmrService.selectByUuid(hostId, cstmr.getUuid()) != null) {
throw new CoolException("瀹㈡埛宸插瓨鍦�");
}
+ if (cstmrService.selectByName(hostId, cstmr.getName()) != null) {
+ throw new CoolException("瀹㈡埛宸插瓨鍦�");
+ }
Cstmr cstmr1 = cstmrService.selectByName(hostId, cstmr.getName());
if (cstmr1!=null){
throw new CoolException("璇ュ鎴蜂俊鎭凡瀛樺湪锛屼笟鍔″憳鏄�:"+cstmr1.getDirector$());
@@ -132,6 +146,7 @@
cstmr.setCreateTime(new Date());
cstmr.setUpdateBy(getUserId());
cstmr.setUpdateTime(new Date());
+ cstmr.setDirector(getUserId());
cstmr.setStatus(1);
cstmrService.insert(cstmr);
return R.ok();
@@ -153,9 +168,9 @@
@ManagerAuth(memo = "鍒犻櫎鐢叉柟鍗曚綅")
public R delete(@RequestParam(value="ids[]") Long[] ids){
for (Long id : ids){
- int cstmr_id = orderService.selectCount(new EntityWrapper<Order>().eq("cstmr_id", id));
- if (cstmr_id!=0){
- return R.error("瀛樺湪鍏宠仈璺熻釜椤圭洰锛岀姝㈠垹闄わ紒锛侊紒");
+ int order = orderService.selectCount(new EntityWrapper<Order>().eq("cstmr_id", id));
+ if (order!=0){
+ return R.error("瀛樺湪鍏宠仈鐨勮窡韪」鐩紝绂佹鍒犻櫎锛侊紒锛�");
}
cstmrService.deleteById(id);
}
--
Gitblit v1.9.1