| | |
| | | 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; |
| | |
| | | } |
| | | |
| | | @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("修改数据字典类型失败"); |
| | |
| | | |
| | | @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 |