| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.vci.ubcs.common.constant.CommonConstant; |
| | | import com.vci.ubcs.core.log.exception.ServiceException; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import com.vci.ubcs.system.cache.DictBizCache; |
| | | import com.vci.ubcs.system.entity.DictBiz; |
| | | import com.vci.ubcs.system.mapper.DictBizMapper; |
| | |
| | | @Override |
| | | public R checkOrInsert(DictBiz dictBiz) { |
| | | |
| | | LambdaQueryWrapper<DictBiz> lqw = Wrappers.<DictBiz>query().lambda().eq(DictBiz::getCode, dictBiz.getCode()).eq(DictBiz::getDictKey, dictBiz.getDictKey()); |
| | | LambdaQueryWrapper<DictBiz> lqw = Wrappers.<DictBiz>query().lambda().eq(DictBiz::getCode, dictBiz.getCode()).eq(DictBiz::getDictKey, dictBiz.getDictKey()).eq(DictBiz::getDictValue, dictBiz.getDictValue()); |
| | | Long cnt = baseMapper.selectCount((Func.isEmpty(dictBiz.getId())) ? lqw : lqw.notIn(DictBiz::getId, dictBiz.getId())); |
| | | if (cnt > 0L) { |
| | | return R.fail("字典已经存在!"); |