From efbc8993d6545d7ab898f5349a89915729fe5cb7 Mon Sep 17 00:00:00 2001 From: LSH Date: 星期五, 06 十月 2023 14:12:31 +0800 Subject: [PATCH] #一键修改负责人 --- src/main/java/com/zy/crm/manager/controller/CstmrController.java | 10 +++++++--- 1 files changed, 7 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..b26ea1f 100644 --- a/src/main/java/com/zy/crm/manager/controller/CstmrController.java +++ b/src/main/java/com/zy/crm/manager/controller/CstmrController.java @@ -119,6 +119,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 +135,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 +157,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