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}