| | |
| | | package com.ruoyi.account.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | |
| | | public R delete(String ids) { |
| | | //拿到单位列表 |
| | | String[] split = ids.split(","); |
| | | |
| | | List<TAppUserTag> list = appUserTagService.lambdaQuery().in(TAppUserTag::getUserTagId).list(); |
| | | if (!list.isEmpty()){ |
| | | return R.fail("当前标签已有用户获取,无法删除"); |
| | | } |
| | | for (String id : split) { |
| | | otherClient.deleteTag(Integer.valueOf(id)); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取用户标签关系 |
| | | * @param appUserTag |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/tags/getUserTag") |
| | | public R<TAppUserTag> getUserTag(@RequestBody TAppUserTag appUserTag){ |
| | | TAppUserTag one = appUserTagService.getOne(new LambdaQueryWrapper<TAppUserTag>().eq(TAppUserTag::getAppUserId, appUserTag.getAppUserId()) |
| | | .eq(TAppUserTag::getUserTagId, appUserTag.getUserTagId())); |
| | | return R.ok(one); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 保存用户标签关系数据 |
| | | * @param appUserTag |
| | | */ |
| | | @PostMapping(value = "/tags/addUserTag") |
| | | public void addUserTag(@RequestBody TAppUserTag appUserTag){ |
| | | appUserTagService.save(appUserTag); |
| | | } |
| | | } |
| | | |