From bf36c713be2bf8fdf5d5b50aa8707929414d487b Mon Sep 17 00:00:00 2001 From: dx <1242347652@qq.com> Date: Mon, 3 Mar 2025 14:38:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=EF=BC=8C=E4=BC=81=E4=B8=9A?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EnterpriseInspectionsServiceImpl.java | 25 +++++++++++++++---- .../service/taskinfo/TaskInfoServiceImpl.java | 8 +++--- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterpriseinspections/EnterpriseInspectionsServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterpriseinspections/EnterpriseInspectionsServiceImpl.java index afba306..8647f71 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterpriseinspections/EnterpriseInspectionsServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterpriseinspections/EnterpriseInspectionsServiceImpl.java @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.system.service.enterpriseinspections; import cn.iocoder.yudao.module.system.controller.admin.auth.vo.RoleNameAndSelectTypeVO; import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; +import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO; import cn.iocoder.yudao.module.system.dal.dataobject.enterprise.EnterpriseDO; import cn.iocoder.yudao.module.system.dal.dataobject.inspectionslog.InspectionsLogDO; import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO; @@ -23,6 +24,7 @@ import cn.iocoder.yudao.module.system.dal.mysql.tasktag.TaskTagMapper; import cn.iocoder.yudao.module.system.dal.mysql.user.AdminUserMapper; import cn.iocoder.yudao.module.system.service.auth.AdminAuthService; import cn.iocoder.yudao.module.system.service.dept.DeptService; +import cn.iocoder.yudao.module.system.service.dict.DictDataService; import cn.iocoder.yudao.module.system.service.inspectionslog.InspectionsLogService; import cn.iocoder.yudao.module.system.service.taglibrary.TagLibraryService; import cn.iocoder.yudao.module.system.service.user.AdminUserService; @@ -85,6 +87,8 @@ public class EnterpriseInspectionsServiceImpl implements EnterpriseInspectionsSe private SignInLogMapper signInLogMapper; @Resource private AdminAuthService authService; + @Resource + private DictDataService dictDataService; @Override public Long createEnterpriseInspections(EnterpriseInspectionsSaveReqVO createReqVO) { @@ -245,12 +249,23 @@ public class EnterpriseInspectionsServiceImpl implements EnterpriseInspectionsSe } //查询企业标签 - final TagLibraryDO tagLibrary = tagLibraryService.getTagLibrary(taskInfoDO.getTaskType()); - if (tagLibrary != null) { - List list = new ArrayList<>(); - list.add(tagLibrary.getTagName()); - item.setTagList(list); + final List tagLibraryDOS = tagLibraryService.listByEnterpriseId(enterpriseDO.getId()); + //添加地址 + final DictDataDO enterprisesArea = dictDataService.getDictData("enterprises_area", enterpriseDO.getRegion()); + + if (tagLibraryDOS != null && tagLibraryDOS.size() > 0) { + final List collect = tagLibraryDOS.stream().map(tagLibraryDO -> tagLibraryDO.getTagName()).collect(Collectors.toList()); + + if (enterprisesArea != null) { + collect.add(0, enterprisesArea.getLabel()); + } + + item.setTagList(collect); + } + + + item.setEnterpriseName(enterpriseDO.getEnterprisesName()); item.setEnterpriseAddress(enterpriseDO.getAddress()); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taskinfo/TaskInfoServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taskinfo/TaskInfoServiceImpl.java index b471785..20b683a 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taskinfo/TaskInfoServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taskinfo/TaskInfoServiceImpl.java @@ -267,9 +267,11 @@ public class TaskInfoServiceImpl implements TaskInfoService { if (taskInfoDOPageResult.getList() != null && taskInfoDOPageResult.getList().size() > 0) { taskInfoDOPageResult.getList().forEach(item->{ //获取任务标签 - final List tagLibraryDOS1 = tagLibraryService.listByTaskId(item.getId()); - if (tagLibraryDOS1 != null && tagLibraryDOS1.size() > 0) { - item.setTagList(tagLibraryDOS1.stream().map(TagLibraryDO::getTagName).collect(Collectors.toList())); + final TagLibraryDO tagLibrary = tagLibraryService.getTagLibrary(item.getTaskType()); + if (tagLibrary != null) { + List list = new ArrayList<>(); + list.add(tagLibrary.getTagName()); + item.setTagList(list); } //发布的部门