From 7e69570ee1fb9ad422e0f8520fbefa4618661412 Mon Sep 17 00:00:00 2001 From: dx <1242347652@qq.com> Date: Fri, 7 Mar 2025 16:57:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=81=E4=B8=9A=E5=A2=9E=E6=B7=BB=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../enterprise/EnterpriseController.java | 36 +++++++++++++++++-- .../admin/enterprise/vo/EnterpriseRespVO.java | 3 +- .../admin/enterprise/vo/LabelValueVO.java | 11 ++++++ .../dataobject/enterprise/EnterpriseDO.java | 7 ++-- 4 files changed, 48 insertions(+), 9 deletions(-) create mode 100644 yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/LabelValueVO.java diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/EnterpriseController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/EnterpriseController.java index ca8f944..f1b3262 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/EnterpriseController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/EnterpriseController.java @@ -143,8 +143,6 @@ public class EnterpriseController { enterprise.setFiles(list); } - - // 获取标签 List tagLibraryDOS = tagLibraryService.listByEnterpriseId(enterprise.getId()); if (tagLibraryDOS != null) { @@ -158,7 +156,6 @@ public class EnterpriseController { enterprise.setTagList(Collections.emptyList()); } - //通过userID获取专管人 if (enterprise.getUserId() != null) { final AdminUserDO user = adminUserService.getUser(Long.valueOf(enterprise.getUserId())); @@ -210,6 +207,20 @@ public class EnterpriseController { if (user != null) { item.setInviterName(user.getNickname()); } + + final List tagLibraryDOS = tagLibraryService.listByEnterpriseId(item.getId()); + if (tagLibraryDOS != null) { + List labelValueVOList = new ArrayList<>(); + tagLibraryDOS.forEach(tag->{ + LabelValueVO labelValueVO = new LabelValueVO(); + labelValueVO.setLabel(tag.getTagName()); + labelValueVO.setValue(tag.getParentId()); + labelValueVOList.add(labelValueVO); + }); + + item.setTagListName(labelValueVOList); + } + }); return success(BeanUtils.toBean(pageResult, EnterpriseRespVO.class)); } @@ -243,10 +254,29 @@ public class EnterpriseController { //企业图片 final List fileList = fileInfoService.getFileList(EnterpriseServiceImpl.DEFAULT_DICT_TYPE, EnterpriseServiceImpl.DEFAULT_DICT_DATA_QY, item.getId().toString()); item.setFiles(fileList); + + //邀请人姓名 + final AdminUserDO user = adminUserService.getUser(Long.valueOf(item.getUserId())); + if (user != null) { + item.setInviterName(user.getRealName()); + } + // 企业标签 final List tagLibraryDOS1 = tagLibraryService.listByEnterpriseId(item.getId()); if (tagLibraryDOS1 != null && tagLibraryDOS1.size() > 0) { item.setTagList(tagLibraryDOS1.stream().map(item1->item1.getTagName()).collect(Collectors.toList())); + + List labelValueVOList = new ArrayList<>(); + tagLibraryDOS1.forEach(tag->{ + LabelValueVO labelValueVO = new LabelValueVO(); + labelValueVO.setLabel(tag.getTagName()); + labelValueVO.setValue(tag.getParentId()); + labelValueVOList.add(labelValueVO); + + }); + + item.setTagListName(labelValueVOList); + } }); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterpriseRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterpriseRespVO.java index 146fd3e..e12209c 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterpriseRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterpriseRespVO.java @@ -118,7 +118,6 @@ public class EnterpriseRespVO { @ExcelProperty("邀请人") private String inviterName; - - + private List tagListName; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/LabelValueVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/LabelValueVO.java new file mode 100644 index 0000000..1bd175e --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/LabelValueVO.java @@ -0,0 +1,11 @@ +package cn.iocoder.yudao.module.system.controller.admin.enterprise.vo; + +import lombok.Data; + +@Data +public class LabelValueVO { + //值 + private Integer value; + //名称 + private String label; +} diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/enterprise/EnterpriseDO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/enterprise/EnterpriseDO.java index c4c6857..7ef4030 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/enterprise/EnterpriseDO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/enterprise/EnterpriseDO.java @@ -1,15 +1,12 @@ package cn.iocoder.yudao.module.system.dal.dataobject.enterprise; import cn.iocoder.yudao.module.infra.api.file.dto.InfraFileInfoDTO; +import cn.iocoder.yudao.module.system.controller.admin.enterprise.vo.LabelValueVO; import cn.iocoder.yudao.module.system.dal.dataobject.qualification.EnterpriseQualificationDO; -import cn.iocoder.yudao.module.system.dal.dataobject.taglibrary.TagLibraryDO; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.time.LocalDate; import java.util.*; -import java.time.LocalDateTime; -import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.*; import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; @@ -107,4 +104,6 @@ public class EnterpriseDO extends BaseDO { @TableField(exist = false) private String inviterName; + @TableField(exist = false) + private List tagListName; }