manailin
2022-04-08 8d5fb4ee9d27fd6a61b210eaee74af265f76aa7c
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));