| | |
| | | |
| | | private final Map<String, LinkTypeVO> idLinkMap = new ConcurrentHashMap<>(); |
| | | |
| | | private void putBtm(@NotNull BtmTypeVO... voList) throws ServiceException { |
| | | private void putBtm(@NotNull BtmTypeVO... voList) throws Throwable { |
| | | String collect = Arrays.stream(voList).map(BtmTypeVO::getId).filter(idBtmMap::containsKey).collect(Collectors.joining(",")); |
| | | if (StringUtils.isBlank(collect)) { |
| | | Arrays.stream(voList).forEach(vo -> { |
| | | idBtmMap.put(vo.getId(), vo); |
| | | }); |
| | | } else { |
| | | throw new ServiceException("业务类型:[" + collect + "]正在被其他用户操作"); |
| | | throw new Throwable("业务类型:[" + collect + "]正在被其他用户操作"); |
| | | } |
| | | } |
| | | |
| | | private void putLink(@NotNull LinkTypeVO... voList) throws ServiceException { |
| | | private void putLink(@NotNull LinkTypeVO... voList) throws Throwable { |
| | | String collect = Arrays.stream(voList).map(LinkTypeVO::getId).filter(idLinkMap::containsKey).collect(Collectors.joining(",")); |
| | | if (StringUtils.isBlank(collect)) { |
| | | Arrays.stream(voList).forEach(vo -> { |
| | | idLinkMap.put(vo.getId(), vo); |
| | | }); |
| | | } else { |
| | | throw new ServiceException("链接类型:[" + collect + "]正在被其他用户操作"); |
| | | throw new Throwable("链接类型:[" + collect + "]正在被其他用户操作"); |
| | | } |
| | | } |
| | | |
| | |
| | | * @return 执行结果 |
| | | */ |
| | | @Override |
| | | public R<List<ModifyAttributeInfo>> submit(BtmAndLinkTypeDdlDTO ddlDTO) { |
| | | public R<List<ModifyAttributeInfo>> submit(BtmAndLinkTypeDdlDTO ddlDTO) throws Throwable { |
| | | try { |
| | | List<ModifyAttributeInfo> changedList = new ArrayList<>(); |
| | | if (!CollectionUtils.isEmpty(ddlDTO.getBtmTypeList())) { |
| | |
| | | R<List<ModifyAttributeInfo>> result = R.success("数据库操作成功"); |
| | | result.setData(changedList); |
| | | return result; |
| | | } catch (VciBaseException e) { |
| | | } catch (Exception e) { |
| | | try { |
| | | // 建表失败有异常,捕获后返回,并释放线程中的内容 |
| | | if (!CollectionUtils.isEmpty(ddlDTO.getBtmTypeList())) { |
| | |
| | | }catch (ServiceException e2){ |
| | | throw new RuntimeException(e2.getMessage()); |
| | | } |
| | | } catch (ServiceException e) { |
| | | throw new RuntimeException(e.getMessage()); |
| | | } |
| | | } |
| | | |