From 37aba2181bf43026c38c0af0fa1dbd97e00a1a84 Mon Sep 17 00:00:00 2001 From: caozehui <2427765068@qq.com> Date: Mon, 2 Dec 2024 13:13:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../device/source/service/impl/PqSourceServiceImpl.java | 1 + .../system/dictionary/service/IDictDataService.java | 7 +++++++ .../dictionary/service/impl/DictDataServiceImpl.java | 8 ++++++++ .../dictionary/service/impl/DictTypeServiceImpl.java | 3 +++ .../gather/system/pojo/constant/SystemValidMessage.java | 2 +- .../user/user/service/impl/SysFunctionServiceImpl.java | 3 --- 6 files changed, 20 insertions(+), 4 deletions(-) diff --git a/device/src/main/java/com/njcn/gather/device/source/service/impl/PqSourceServiceImpl.java b/device/src/main/java/com/njcn/gather/device/source/service/impl/PqSourceServiceImpl.java index a2065849..67346ac1 100644 --- a/device/src/main/java/com/njcn/gather/device/source/service/impl/PqSourceServiceImpl.java +++ b/device/src/main/java/com/njcn/gather/device/source/service/impl/PqSourceServiceImpl.java @@ -50,6 +50,7 @@ public class PqSourceServiceImpl extends ServiceImpl i public boolean addPqSource(PqSourceParam param) { PqSource pqSource = new PqSource(); BeanUtil.copyProperties(param, pqSource); + pqSource.setParameter(StrUtil.isBlank(pqSource.getParameter()) ? null : pqSource.getParameter()); pqSource.setState(DataStateEnum.ENABLE.getCode()); return this.save(pqSource); } diff --git a/system/src/main/java/com/njcn/gather/system/dictionary/service/IDictDataService.java b/system/src/main/java/com/njcn/gather/system/dictionary/service/IDictDataService.java index 324e419c..19d2edca 100644 --- a/system/src/main/java/com/njcn/gather/system/dictionary/service/IDictDataService.java +++ b/system/src/main/java/com/njcn/gather/system/dictionary/service/IDictDataService.java @@ -80,4 +80,11 @@ public interface IDictDataService extends IService { * @param queryParam 查询参数 */ void exportDictData(DictDataParam.QueryParam queryParam); + + /** + * 根据字典类型id删除字典数据 + * @param ids 字典类型id集合 + * @return 成功返回true,失败返回false + */ + boolean deleteDictDataByDictTypeId(List ids); } diff --git a/system/src/main/java/com/njcn/gather/system/dictionary/service/impl/DictDataServiceImpl.java b/system/src/main/java/com/njcn/gather/system/dictionary/service/impl/DictDataServiceImpl.java index 3f7f4f86..a66ad248 100644 --- a/system/src/main/java/com/njcn/gather/system/dictionary/service/impl/DictDataServiceImpl.java +++ b/system/src/main/java/com/njcn/gather/system/dictionary/service/impl/DictDataServiceImpl.java @@ -166,6 +166,14 @@ public class DictDataServiceImpl extends ServiceImpl i ExcelUtil.exportExcel("字典数据导出数据.xlsx", "字典数据", DictDataExcel.class, dictDataExcels); } + @Override + public boolean deleteDictDataByDictTypeId(List ids) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("sys_dict_data.type_id", ids) + .ne("sys_dict_data.state", DataStateEnum.DELETED.getCode()); + return this.remove(queryWrapper); + } + /** * 校验参数,检查是否存在相同名称的字典类型 diff --git a/system/src/main/java/com/njcn/gather/system/dictionary/service/impl/DictTypeServiceImpl.java b/system/src/main/java/com/njcn/gather/system/dictionary/service/impl/DictTypeServiceImpl.java index 3bf5bcb9..6682d0b9 100644 --- a/system/src/main/java/com/njcn/gather/system/dictionary/service/impl/DictTypeServiceImpl.java +++ b/system/src/main/java/com/njcn/gather/system/dictionary/service/impl/DictTypeServiceImpl.java @@ -14,6 +14,7 @@ import com.njcn.gather.system.dictionary.mapper.DictTypeMapper; import com.njcn.gather.system.dictionary.pojo.param.DictTypeParam; import com.njcn.gather.system.dictionary.pojo.po.DictType; import com.njcn.gather.system.dictionary.pojo.vo.DictTypeExcel; +import com.njcn.gather.system.dictionary.service.IDictDataService; import com.njcn.gather.system.dictionary.service.IDictTypeService; import com.njcn.gather.system.pojo.enums.SystemResponseEnum; import com.njcn.web.factory.PageFactory; @@ -30,6 +31,7 @@ import java.util.List; @Service @RequiredArgsConstructor public class DictTypeServiceImpl extends ServiceImpl implements IDictTypeService { + private final IDictDataService dictDataService; @Override public Page listDictTypes(DictTypeParam.QueryParam queryParam) { @@ -71,6 +73,7 @@ public class DictTypeServiceImpl extends ServiceImpl i @Override public boolean deleteDictType(List ids) { + dictDataService.deleteDictDataByDictTypeId(ids); return this.lambdaUpdate() .set(DictType::getState, DataStateEnum.DELETED.getCode()) .in(DictType::getId, ids) diff --git a/system/src/main/java/com/njcn/gather/system/pojo/constant/SystemValidMessage.java b/system/src/main/java/com/njcn/gather/system/pojo/constant/SystemValidMessage.java index 45bcc15a..ea1eded3 100644 --- a/system/src/main/java/com/njcn/gather/system/pojo/constant/SystemValidMessage.java +++ b/system/src/main/java/com/njcn/gather/system/pojo/constant/SystemValidMessage.java @@ -29,7 +29,7 @@ public interface SystemValidMessage { String CODE_NOT_BLANK = "编码不能为空,请检查code参数"; - String CODE_FORMAT_ERROR = "编号格式错误,请检查code参数"; + String CODE_FORMAT_ERROR = "编码格式错误,请检查code参数"; String SORT_NOT_NULL = "排序不能为空,请检查sort参数"; diff --git a/user/src/main/java/com/njcn/gather/user/user/service/impl/SysFunctionServiceImpl.java b/user/src/main/java/com/njcn/gather/user/user/service/impl/SysFunctionServiceImpl.java index 69479d24..106ebf45 100644 --- a/user/src/main/java/com/njcn/gather/user/user/service/impl/SysFunctionServiceImpl.java +++ b/user/src/main/java/com/njcn/gather/user/user/service/impl/SysFunctionServiceImpl.java @@ -158,9 +158,6 @@ public class SysFunctionServiceImpl extends ServiceImpl List getChildrenList(T currMenu, List categories) { return categories.stream().filter(o -> Objects.equals(o.getPid(), currMenu.getId())).peek(o -> o.setChildren(getChildrenList(o, categories))).sorted(Comparator.comparingInt(SysFunction::getSort)).collect(Collectors.toList()); }