Browse Source

2024-10-11

master
qiezi 1 year ago
parent
commit
09c41523c7
  1. 5
      src/main/java/com/spring/modules/sys/service/impl/DictTypeServiceImpl.java
  2. 3
      src/main/resources/mapper/sys/DictTypeDao.xml

5
src/main/java/com/spring/modules/sys/service/impl/DictTypeServiceImpl.java

@ -82,7 +82,7 @@ public class DictTypeServiceImpl extends ServiceImpl<DictTypeDao, DictType> impl
}
dictGroupService.lambdaUpdate().eq(DictGroup::getDictType, entity.getDictType()).eq(DictGroup::getSite, entity.getSite()).remove();
dictGroupService.save(new DictGroup(entity.getSite(),entity.getDictType(),entity.getMenuId()));
return true;
return super.updateById(entity);
}
@Override
@ -91,10 +91,9 @@ public class DictTypeServiceImpl extends ServiceImpl<DictTypeDao, DictType> impl
if (Objects.isNull(entity)||Objects.isNull(entity.getDictId())){
throw new RuntimeException("字典编码为空");
}
removeById(entity.getDictId());
dictGroupService.lambdaUpdate().eq(DictGroup::getSite,entity.getSite()).eq(DictGroup::getDictType,entity.getDictType()).remove();
dictDataService.lambdaUpdate().eq(DictData::getSite,entity.getSite()).eq(DictData::getDictType,entity.getDictType()).remove();
return true;
return removeById(entity.getDictId());
}
@Override

3
src/main/resources/mapper/sys/DictTypeDao.xml

@ -33,9 +33,6 @@
<if test="menuId != null and menuId != ''">
and g.menu_id = #{menuId}
</if>
<if test="menuId != null and menuId != ''">
and g.menu_id = #{menuId}
</if>
<if test="menuId == null or menuId == ''">
and g.menu_id is null
</if>

Loading…
Cancel
Save