| | |
| | | if (isNull(convenientServiceCategoryDO)) { |
| | | return R.fail("分类id不存在"); |
| | | } |
| | | int count = this.baseMapper.checkCategoryIsUsing(categoryId); |
| | | if (count > 0) { |
| | | return R.fail("该分类名称已被引用,无法删除!"); |
| | | } |
| | | convenientServiceCategoryDO.setIsDel(true); |
| | | convenientServiceCategoryDO.setUpdatedBy(operator); |
| | | int result = this.baseMapper.updateById(convenientServiceCategoryDO); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R getAllServiceCategories() { |
| | | public R getAllServiceCategories(String areaCode) { |
| | | List<ConvenientServiceCategoryVO> categoryVOList = new ArrayList<>(); |
| | | List<ConvenientServiceCategoryDO> categoryDOS = this.baseMapper.selectList(new QueryWrapper<ConvenientServiceCategoryDO>() |
| | | .lambda().orderByDesc(ConvenientServiceCategoryDO::getWeight)); |
| | | .lambda().eq(ConvenientServiceCategoryDO::getAreaCode,areaCode).orderByDesc(ConvenientServiceCategoryDO::getWeight)); |
| | | if (!ObjectUtils.isEmpty(categoryDOS)) { |
| | | categoryDOS.forEach(categoryDO -> { |
| | | ConvenientServiceCategoryVO categoryVO = new ConvenientServiceCategoryVO(); |
| | |
| | | } |
| | | return R.ok(categoryVOList); |
| | | } |
| | | |
| | | @Override |
| | | public R getSuitableServiceCategories(Long communityId,String areaCode) { |
| | | return R.ok(this.baseMapper.selectSuitableServiceCategories(communityId,areaCode)); |
| | | } |
| | | } |