Pārlūkot izejas kodu

【CHG】修改删除时查不到对象报错的问题

ZhaoMn 4 gadi atpakaļ
vecāks
revīzija
2e5a38963b

+ 3 - 0
railway-system/src/main/java/com/railway/system/service/impl/SysDictTypeServiceImpl.java

@@ -111,6 +111,9 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService {
   public void deleteDictTypeByIds(Long[] dictIds) {
     for (Long dictId : dictIds) {
       SysDictType dictType = selectDictTypeById(dictId);
+      if(null == dictType){
+        continue;
+      }
       if (dictDataMapper.countDictDataByType(dictType.getDictType()) > 0) {
         throw new ServiceException(String.format("%1$s已分配,不能删除", dictType.getDictName()));
       }