kongzy
2023-12-08 ca5445257b1fdeceddf3fcc2dea18c442023aeb7
assess-system/src/main/java/com/gkhy/assess/system/service/impl/SysDictTypeServiceImpl.java
@@ -11,6 +11,7 @@
import com.gkhy.assess.system.mapper.SysDictTypeMapper;
import com.gkhy.assess.system.service.SysDictTypeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gkhy.assess.system.utils.ShiroUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -52,10 +53,10 @@
    }
    @Override
    @Transactional(rollbackFor = RuntimeException.class)
   // @Transactional(rollbackFor = RuntimeException.class)
    public int editDictType(SysDictType dict) {
        SysDictType oldDict= baseMapper.getDictTypeById(dict.getId());
        dictDataMapper.updateDictDataDictType(oldDict.getDictType(), dict.getDictType());
        dict.setDictType(oldDict.getDictType());//字典类型不能修改
        boolean b=updateById(dict);
        if(!b){
            throw new ApiException("修改数据字典类型失败");
@@ -78,11 +79,9 @@
    @Override
    public int changeDictTypeStatus(SysDictType dictType) {
        boolean b=updateById(dictType);
        if(!b){
            throw new ApiException("修改数据字典类型失败");
        }
        return 1;
        SysDictType dt=new SysDictType().setId(dictType.getId()).setDictType(dictType.getDictType());
        dt.setUpdateBy(ShiroUtils.getSysUser().getUsername());
        return baseMapper.updateById(dt);
    }
    @Override