Search in sources :

Example 1 with AgileSysDictType

use of com.jeeagile.system.entity.AgileSysDictType in project jeeagile by jeeagile.

the class AgileSysDictTypeServiceImpl method updateModel.

@Override
public boolean updateModel(AgileSysDictType agileSysDictType) {
    this.validateData(agileSysDictType);
    AgileSysDictType oldAgileSysDictType = this.getById(agileSysDictType.getId());
    if (oldAgileSysDictType.getDictType() != agileSysDictType.getDictType()) {
        LambdaUpdateWrapper<AgileSysDictData> lambdaUpdateWrapper = new UpdateWrapper().lambda();
        lambdaUpdateWrapper.set(AgileSysDictData::getDictType, agileSysDictType.getDictType());
        lambdaUpdateWrapper.eq(AgileSysDictData::getDictType, oldAgileSysDictType.getDictType());
        agileSysDictDataService.update(lambdaUpdateWrapper);
    }
    return this.updateById(agileSysDictType);
}
Also used : AgileSysDictData(com.jeeagile.system.entity.AgileSysDictData) UpdateWrapper(com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper) LambdaUpdateWrapper(com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper) AgileSysDictType(com.jeeagile.system.entity.AgileSysDictType)

Example 2 with AgileSysDictType

use of com.jeeagile.system.entity.AgileSysDictType in project jeeagile by jeeagile.

the class AgileSysDictTypeServiceImpl method deleteModel.

@Override
public boolean deleteModel(Serializable id) {
    AgileSysDictType agileSysDictType = this.getById(id);
    if (agileSysDictType.getSystemFlag().equals(AgileFlagEnum.YES.getCode())) {
        throw new AgileValidateException("系统内置,不能删除!");
    }
    this.deleteDictData(agileSysDictType);
    return this.removeById(id);
}
Also used : AgileValidateException(com.jeeagile.core.exception.AgileValidateException) AgileSysDictType(com.jeeagile.system.entity.AgileSysDictType)

Aggregations

AgileSysDictType (com.jeeagile.system.entity.AgileSysDictType)2 LambdaUpdateWrapper (com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper)1 UpdateWrapper (com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper)1 AgileValidateException (com.jeeagile.core.exception.AgileValidateException)1 AgileSysDictData (com.jeeagile.system.entity.AgileSysDictData)1