From 1a987c8fd64413f04bdd0ea2bc8cb1b4262d4242 Mon Sep 17 00:00:00 2001 From: CeDo <cedoogle@gmail.com> Date: 星期二, 15 六月 2021 11:03:24 +0800 Subject: [PATCH] Merge branch 'test_elder_cedoo' into test --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngCarServiceImpl.java | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngCarServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngCarServiceImpl.java index 17a626f..764f33b 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngCarServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngCarServiceImpl.java @@ -96,10 +96,12 @@ if (!carResult) { return R.fail("车牌号有误!"); } - ComMngCarDO exist = comMngCarDAO.selectOne(new QueryWrapper<ComMngCarDO>() - .lambda().eq(ComMngCarDO::getPlateNum, comMngCarSaveDTO.getPlateNum())); - if (exist != null) { - return R.ok("车辆已存在"); + if (comMngCarSaveDTO.getId()==null) { + List<ComMngCarDO> existList = comMngCarDAO.selectList(new QueryWrapper<ComMngCarDO>() + .lambda().eq(ComMngCarDO::getPlateNum, comMngCarSaveDTO.getPlateNum())); + if (!existList.isEmpty()) { + return R.ok("车辆已存在"); + } } ComMngStructAreaDO comMngStructAreaDO = comMngStructAreaDAO.selectById(comMngCarSaveDTO.getAreaId()); if (ObjectUtils.isEmpty(comMngStructAreaDO)) { -- Gitblit v1.7.1