| | |
| | | |
| | | private final String REGEXP = "^[A-Za-z]+$"; |
| | | |
| | | @Resource |
| | | private BtmTypeMapper btmTypeMapper; |
| | | |
| | | @Override |
| | | public boolean deleteLogic(@NotEmpty List<Long> ids) { |
| | | return false; |
| | |
| | | */ |
| | | @Override |
| | | public boolean submit(AttributeDTO dto) { |
| | | if (Pattern.compile(REGEXP).matcher(dto.getId()).matches()){ |
| | | if (!Pattern.compile(REGEXP).matcher(dto.getId()).matches()){ |
| | | throw new VciBaseException("属性名称{0}只能是英文",new Object[]{dto.getId()}); |
| | | } |
| | | LambdaQueryWrapper<Attribute> wrapper = Wrappers.<Attribute>query().lambda().eq(Attribute::getId, dto.getId()); |
| | | Long count = baseMapper.selectCount((Func.isEmpty(dto.getId())) ? wrapper : wrapper.notIn(Attribute::getId, dto.getId())); |
| | | Long count = baseMapper.selectCount((Func.isEmpty(dto.getOid())) ? wrapper : wrapper.notIn(Attribute::getOid, dto.getOid())); |
| | | if (count > 0L) { |
| | | throw new ServiceException("属性名已存在!"); |
| | | } |
| | | Attribute omdAttribute = BeanUtil.copy(dto, Attribute.class); |
| | | Attribute attribute = AttributeWrapper.build().copyBeforeSave(dto); |
| | | CacheUtil.clear(OmdCacheConstant.ATTR_CACHE); |
| | | return saveOrUpdate(omdAttribute); |
| | | return saveOrUpdate(attribute); |
| | | } |
| | | |
| | | /** |