From 00a59b93c16b24e7be77c6f1ce4866c75a2e0431 Mon Sep 17 00:00:00 2001 From: 101captain <237651143@qq.com> Date: 星期二, 19 四月 2022 16:32:21 +0800 Subject: [PATCH] 花城E+防疫修改 --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngCarServiceImpl.java | 18 ++++++++++++++++-- 1 files changed, 16 insertions(+), 2 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 3cc4723..f069af3 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 @@ -4,6 +4,7 @@ import javax.annotation.Resource; +import com.panzhihua.common.utlis.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; @@ -110,7 +111,7 @@ List<ComMngCarDO> existList = comMngCarDAO.selectList( new QueryWrapper<ComMngCarDO>().lambda().eq(ComMngCarDO::getPlateNum, comMngCarSaveDTO.getPlateNum())); if (!existList.isEmpty()) { - return R.ok("车辆已存在"); + return R.fail("车辆已存在"); } } ComMngVillageDO comMngVillageDO = comMngVillageDAO.selectById(comMngCarSaveDTO.getAreaId()); @@ -125,7 +126,20 @@ } ComMngCarDO comMngCarDO = new ComMngCarDO(); BeanUtils.copyProperties(comMngCarSaveDTO, comMngCarDO); - comMngCarDO.setAreaName(comMngVillageDO.getGroupAt()); + //如果小区没有名字,则将街路巷和地区号拼接起来 + if(comMngVillageDO.getName() != null && StringUtils.isNotEmpty(comMngVillageDO.getName())){ + comMngCarDO.setAreaName(comMngVillageDO.getName()); + }else{ + StringBuilder sb = new StringBuilder(); + sb.append(comMngVillageDO.getAlley()); + if(!comMngVillageDO.getHouseNum().contains("号")){ + sb.append(comMngVillageDO.getHouseNum() + "号"); + } + comMngCarDO.setAreaName(sb.toString()); + } +// if(comMngVillageDO.getGroupAt() == null){ +// comMngCarDO.setAreaName(comMngVillageDO.getGroupAt()); +// } comMngCarDO.setCommunityId(comMngVillageDO.getCommunityId()); try { comMngCarDO.setCardNo(AESUtil.encrypt128(comMngCarSaveDTO.getCardNo(), aesKey)); -- Gitblit v1.7.1