doum
15 小时以前 7a0b33a5f2e0ba589bf35a1b8d896700a21f94a4
server/services/src/main/java/com/doumee/service/business/impl/AreasServiceImpl.java
@@ -133,6 +133,11 @@
    }
    @Override
    public Areas getById(Integer id) {
       return areasMapper.selectById(id);
    }
    @Override
    public Areas findById(Integer id) {
        if(ALL_AREA_LIST!=null){
            for(Areas a : ALL_AREA_LIST){
@@ -548,6 +553,7 @@
        return list;
    }
    @Override
    public Areas getOpenedCityByName(String cityName) {
        if (StringUtils.isBlank(cityName)) {
@@ -563,4 +569,33 @@
        return areasMapper.selectOne(qw);
    }
    @Override
    public Areas getOpenedCityByCode(String code) {
        if (StringUtils.isBlank(code)) {
            return null;
        }
        Areas areas = areasMapper.selectById(code);
        if(Objects.isNull(areas)||Objects.isNull(areas.getParentId())){
            return null;
        }
        Areas city = areasMapper.selectById(areas.getParentId());
        if(Objects.isNull(city)||Constants.equalsInteger(city.getIsdeleted(),Constants.ONE)||
            Constants.equalsInteger(city.getStatus(),Constants.ZERO)){
            return null;
        }
        return city;
    }
    @Override
    public void updateStatus(Areas areas) {
        if (areas == null || areas.getId() == null) {
            throw new BusinessException(ResponseStatus.BAD_REQUEST);
        }
        Areas update = new Areas();
        update.setId(areas.getId());
        update.setStatus(areas.getStatus());
        areasMapper.updateById(update);
    }
}