| | |
| | | public Result<String> save(@Valid ItemUserOptionalListDTO itemUserOptionalListDTO) { |
| | | String partyId = SecurityUtils.getUser().getUserId(); |
| | | if (itemUserOptionalListService.findOne(partyId, itemUserOptionalListDTO.getName()) != null) { |
| | | return Result.failed("该自选组名称已经使用"); |
| | | return Result.failed("Watchlist name already in use"); |
| | | } |
| | | //新增或编辑表单保存 |
| | | ItemUserOptionalList entity = itemUserOptionalListWrapper.toEntity(itemUserOptionalListDTO); |
| | |
| | | public Result<String> saveItem(String listId, String symbol) { |
| | | String partyId = SecurityUtils.getUser().getUserId(); |
| | | if (itemUserOptionalItemService.findOne(partyId, listId, symbol) != null) { |
| | | return Result.failed("已经添加过该分组了"); |
| | | return Result.failed("Group already added"); |
| | | } |
| | | ItemUserOptionalItem itemUserOptionalItem = new ItemUserOptionalItem(); |
| | | itemUserOptionalItem.setListId(listId); |
| | |
| | | String partyId = SecurityUtils.getUser().getUserId(); |
| | | ItemUserOptionalList one = itemUserOptionalListService.findOne(partyId, updateDTO.getName()); |
| | | if (one != null && !one.getUuid().equalsIgnoreCase(updateDTO.getUuid())) { |
| | | return Result.failed("该自选组名称已经使用"); |
| | | return Result.failed("Watchlist name already in use"); |
| | | } |
| | | //新增或编辑表单保存 |
| | | ItemUserOptionalList entity = BeanUtil.copyProperties(updateDTO, ItemUserOptionalList.class); |