Browse Source

标签 2边都可以设置

master
PoffyZhang 1 year ago
parent
commit
54776515a7
1 changed files with 12 additions and 2 deletions
  1. +12
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/portrait/manage/TagManage.java

+ 12
- 2
pmapi/src/main/java/com/ningdatech/pmapi/portrait/manage/TagManage.java View File

@@ -10,6 +10,8 @@ import com.ningdatech.basic.model.PageVo;
import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.pmapi.common.constant.BizConst;
import com.ningdatech.pmapi.common.constant.RegionConst;
import com.ningdatech.pmapi.gov.model.entity.GovBizProjectBaseinfo;
import com.ningdatech.pmapi.gov.service.IGovBizProjectBaseinfoService;
import com.ningdatech.pmapi.portrait.model.dto.TagDTO;
import com.ningdatech.pmapi.portrait.model.dto.TagToProjectDTO;
import com.ningdatech.pmapi.portrait.model.entity.ProjectTag;
@@ -49,6 +51,8 @@ public class TagManage {

private final IProjectTagService projectTagService;

private final IGovBizProjectBaseinfoService baseinfoService;

/**
* 标签分页
* @param areaCode
@@ -140,7 +144,10 @@ public class TagManage {
UserInfoDetails user = LoginUserUtil.loginUserDetail();
String projectCode = dtos.get(0).getProjectCode();
Project project = projectService.getProjectByCode(projectCode);
VUtils.isTrue(Objects.isNull(project)).throwMessage("项目不存在!");
GovBizProjectBaseinfo baseinfo = baseinfoService.getOne(Wrappers.lambdaQuery(GovBizProjectBaseinfo.class)
.eq(GovBizProjectBaseinfo::getBaseProjId, projectCode)
.last(BizConst.LIMIT_1));
VUtils.isTrue(Objects.isNull(project) && Objects.isNull(baseinfo)).throwMessage("项目不存在!");
projectTagService.remove(Wrappers.lambdaQuery(ProjectTag.class)
.eq(ProjectTag::getProjectCode,projectCode));
//去重
@@ -165,7 +172,10 @@ public class TagManage {
public String removeTagToProject(TagToProjectDTO dto) {
String projectCode = dto.getProjectCode();
Project project = projectService.getProjectByCode(projectCode);
VUtils.isTrue(Objects.isNull(project)).throwMessage("项目不存在!");
GovBizProjectBaseinfo baseinfo = baseinfoService.getOne(Wrappers.lambdaQuery(GovBizProjectBaseinfo.class)
.eq(GovBizProjectBaseinfo::getBaseProjId, projectCode)
.last(BizConst.LIMIT_1));
VUtils.isTrue(Objects.isNull(project) && Objects.isNull(baseinfo)).throwMessage("项目不存在!");
Long tagId = dto.getTagId();
Tag tag = tagService.getById(tagId);
VUtils.isTrue(Objects.isNull(tag)).throwMessage("标签不存在!");


Loading…
Cancel
Save