From a7b550f95172e29d71aa38dca45cacf7f31949b8 Mon Sep 17 00:00:00 2001 From: 罗元桥 <2376770955@qq.com> Date: 星期四, 17 六月 2021 14:44:50 +0800 Subject: [PATCH] Merge branch 'test_screen' into 'master' --- 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