From c583280b35a0d6e9c65888359fa3ffb91f7b378f Mon Sep 17 00:00:00 2001 From: dinggang <2498628697@qq.com> Date: Thu, 13 Oct 2022 16:44:46 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E5=89=8D=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E8=83=BD=E5=8A=9B=E7=94=B3=E8=AF=B7=E7=BB=9F=E8=AE=A1=E9=80=BB?= =?UTF-8?q?=E8=BE=91=EF=BC=8C=E5=8A=A0=E5=85=A5=E4=BC=9A=E8=AE=AE=E5=AE=A4?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BB=9F=E8=AE=A1=202.=E8=B5=8B=E8=83=BD?= =?UTF-8?q?=E5=9C=BA=E6=99=AF=E5=A2=9E=E5=8A=A0=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/db/V6.6__tb_fuse_resource_add_col.sql | 3 +++ .../renren/modules/fuse/dto/TbFuseResourceDTO.java | 4 ++++ .../modules/fuse/entity/TbFuseResourceEntity.java | 4 ++++ .../fuse/service/impl/TbFuseServiceImpl.java | 14 +++++++++----- .../db/V6.6__tb_fuse_resource_add_col.sql | 3 +++ .../resources/mapper/fuse/TbFuseResourceDao.xml | 4 ++-- .../mapper/processForm/TAbilityApplicationDao.xml | 5 +++-- .../main/resources/mapper/resource/ResourceDao.xml | 7 +++++-- 8 files changed, 33 insertions(+), 11 deletions(-) create mode 100644 config/db/V6.6__tb_fuse_resource_add_col.sql create mode 100644 renren-admin/src/main/resources/db/V6.6__tb_fuse_resource_add_col.sql diff --git a/config/db/V6.6__tb_fuse_resource_add_col.sql b/config/db/V6.6__tb_fuse_resource_add_col.sql new file mode 100644 index 00000000..cd92a290 --- /dev/null +++ b/config/db/V6.6__tb_fuse_resource_add_col.sql @@ -0,0 +1,3 @@ +ALTER TABLE `tb_fuse_resource` ADD COLUMN `type` int NULL DEFAULT 0 COMMENT '资源类型'; +ALTER TABLE `tb_fuse_resource` ADD COLUMN `dept_name` int NULL DEFAULT 0 COMMENT '部门名称'; +ALTER TABLE `tb_fuse_resource` ADD COLUMN `resource_name` int NULL DEFAULT 0 COMMENT '资源名称'; \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/fuse/dto/TbFuseResourceDTO.java b/renren-admin/src/main/java/io/renren/modules/fuse/dto/TbFuseResourceDTO.java index 42c632de..fe406604 100644 --- a/renren-admin/src/main/java/io/renren/modules/fuse/dto/TbFuseResourceDTO.java +++ b/renren-admin/src/main/java/io/renren/modules/fuse/dto/TbFuseResourceDTO.java @@ -26,5 +26,9 @@ public class TbFuseResourceDTO { private Object resource; @ApiModelProperty(value = "资源类型") private String type; + @ApiModelProperty(value = "部门名称") + private String deptName; + @ApiModelProperty(value = "资源名称") + private String resourceName; } diff --git a/renren-admin/src/main/java/io/renren/modules/fuse/entity/TbFuseResourceEntity.java b/renren-admin/src/main/java/io/renren/modules/fuse/entity/TbFuseResourceEntity.java index 7ce04506..3490fb69 100644 --- a/renren-admin/src/main/java/io/renren/modules/fuse/entity/TbFuseResourceEntity.java +++ b/renren-admin/src/main/java/io/renren/modules/fuse/entity/TbFuseResourceEntity.java @@ -2,6 +2,7 @@ package io.renren.modules.fuse.entity; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; @@ -36,4 +37,7 @@ public class TbFuseResourceEntity { * 资源类型 */ private String type; + + private String deptName; + private String resourceName; } diff --git a/renren-admin/src/main/java/io/renren/modules/fuse/service/impl/TbFuseServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/fuse/service/impl/TbFuseServiceImpl.java index 598b1272..6b55238e 100644 --- a/renren-admin/src/main/java/io/renren/modules/fuse/service/impl/TbFuseServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/fuse/service/impl/TbFuseServiceImpl.java @@ -208,7 +208,6 @@ public class TbFuseServiceImpl extends CrudServiceImpl list = fuseResourceDao.selectList(wrapper); Map> resourceMap = list.stream().filter(index -> index.getType() != null).collect(Collectors.groupingBy(TbFuseResourceEntity::getType)); - if (resourceMap.containsKey("数据资源")) { - dataResourceMap.putAll(getDataResource()); - } + //if (resourceMap.containsKey("数据资源")) { + // dataResourceMap.putAll(getDataResource()); + //} resourceMap.forEach((type, value) -> { if ("组件服务".equals(type)) { result.addAll(value.stream().map(attr -> { @@ -243,7 +242,12 @@ public class TbFuseServiceImpl extends CrudServiceImpl { TbFuseResourceDTO dto = new TbFuseResourceDTO(); BeanUtils.copyProperties(attr, dto); - dto.setResource(dataResourceMap.get(dto.getResourceId())); + HashMap map = new HashMap<>(); + map.put("resourceName", attr.getResourceName()); + map.put("resourceId", attr.getResourceId()); + map.put("deptName", attr.getDeptName()); + map.put("type", attr.getType()); + dto.setResource(map); return dto; }).collect(Collectors.toList())); } else if ("基础设施".equals(type)) { diff --git a/renren-admin/src/main/resources/db/V6.6__tb_fuse_resource_add_col.sql b/renren-admin/src/main/resources/db/V6.6__tb_fuse_resource_add_col.sql new file mode 100644 index 00000000..cd92a290 --- /dev/null +++ b/renren-admin/src/main/resources/db/V6.6__tb_fuse_resource_add_col.sql @@ -0,0 +1,3 @@ +ALTER TABLE `tb_fuse_resource` ADD COLUMN `type` int NULL DEFAULT 0 COMMENT '资源类型'; +ALTER TABLE `tb_fuse_resource` ADD COLUMN `dept_name` int NULL DEFAULT 0 COMMENT '部门名称'; +ALTER TABLE `tb_fuse_resource` ADD COLUMN `resource_name` int NULL DEFAULT 0 COMMENT '资源名称'; \ No newline at end of file diff --git a/renren-admin/src/main/resources/mapper/fuse/TbFuseResourceDao.xml b/renren-admin/src/main/resources/mapper/fuse/TbFuseResourceDao.xml index c648e021..0e6d6389 100644 --- a/renren-admin/src/main/resources/mapper/fuse/TbFuseResourceDao.xml +++ b/renren-admin/src/main/resources/mapper/fuse/TbFuseResourceDao.xml @@ -4,10 +4,10 @@ - insert into tb_fuse_resource(id, fuse_id, resource_id, sequence) + insert into tb_fuse_resource(id, fuse_id, resource_id, sequence, type, dept_name, resource_name) values - (#{item.id}, #{item.fuseId}, #{item.resourceId}, #{item.sequence}) + (#{item.id}, #{item.fuseId}, #{item.resourceId}, #{item.sequence}, #{item.type}, #{item.deptName}, #{item.resourceName}) diff --git a/renren-admin/src/main/resources/mapper/processForm/TAbilityApplicationDao.xml b/renren-admin/src/main/resources/mapper/processForm/TAbilityApplicationDao.xml index 17c2821b..3a59b4ee 100644 --- a/renren-admin/src/main/resources/mapper/processForm/TAbilityApplicationDao.xml +++ b/renren-admin/src/main/resources/mapper/processForm/TAbilityApplicationDao.xml @@ -122,8 +122,9 @@ UNION SELECT - '会议室' AS 'type', - COUNT( id ) AS 'amount' + + COUNT( id ) AS 'amount', + '会议室' AS 'type' FROM t_meetingroom_book tmb ) temp2 diff --git a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml index 7ba85dde..acebb23e 100644 --- a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml +++ b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml @@ -1738,14 +1738,17 @@ AND taa.resource_id = tdr.id AND (tdr.type = '应用资源' OR tdr.type = '智能算法' OR tdr.type = '图层服务' OR tdr.type = '开发组件' OR tdr.type = '业务组件') - + + + AND taa.approve_status = #{approveStatus} + AND sd.id = #{deptId}