From b575038bb213fdf3b5383e881cb609d14d190252 Mon Sep 17 00:00:00 2001
From: yanghui <2536613402@qq.com>
Date: 星期五, 02 十二月 2022 09:58:47 +0800
Subject: [PATCH] #feat 修复bug
---
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientServiceCategoryServiceImpl.java | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientServiceCategoryServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientServiceCategoryServiceImpl.java
index c85f04f..187497c 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientServiceCategoryServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientServiceCategoryServiceImpl.java
@@ -68,6 +68,10 @@
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);
@@ -101,10 +105,10 @@
}
@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();
@@ -114,4 +118,9 @@
}
return R.ok(categoryVOList);
}
+
+ @Override
+ public R getSuitableServiceCategories(Long communityId,String areaCode) {
+ return R.ok(this.baseMapper.selectSuitableServiceCategories(communityId,areaCode));
+ }
}
--
Gitblit v1.7.1