Merge branch 'dev'

This commit is contained in:
wangliwen 2022-10-13 16:45:37 +08:00
commit 208829c4f8
8 changed files with 33 additions and 11 deletions

View File

@ -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 '资源名称';

View File

@ -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;
}

View File

@ -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;
}

View File

@ -208,7 +208,6 @@ public class TbFuseServiceImpl extends CrudServiceImpl<TbFuseDao, TbFuseEntity,
Thread.sleep(300); // 防止任务运行过快无法跳出循环
} catch (InterruptedException e) {
logger.info("获取数据资源异常", e);
end.set(false);
}
} while (end.get());
@ -223,9 +222,9 @@ public class TbFuseServiceImpl extends CrudServiceImpl<TbFuseDao, TbFuseEntity,
wrapper.eq("fuse_id", fuseId);
List<TbFuseResourceEntity> list = fuseResourceDao.selectList(wrapper);
Map<String, List<TbFuseResourceEntity>> 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<TbFuseDao, TbFuseEntity,
result.addAll(value.stream().map(attr -> {
TbFuseResourceDTO dto = new TbFuseResourceDTO();
BeanUtils.copyProperties(attr, dto);
dto.setResource(dataResourceMap.get(dto.getResourceId()));
HashMap<Object, Object> 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)) {

View File

@ -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 '资源名称';

View File

@ -4,10 +4,10 @@
<mapper namespace="io.renren.modules.fuse.dao.TbFuseResourceDao">
<insert id="insertBatch">
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
<foreach collection="list" item="item" separator=",">
(#{item.id}, #{item.fuseId}, #{item.resourceId}, #{item.sequence})
(#{item.id}, #{item.fuseId}, #{item.resourceId}, #{item.sequence}, #{item.type}, #{item.deptName}, #{item.resourceName})
</foreach>
</insert>

View File

@ -122,8 +122,9 @@
UNION
SELECT
'会议室' AS 'type',
COUNT( id ) AS 'amount'
COUNT( id ) AS 'amount',
'会议室' AS 'type'
FROM
t_meetingroom_book tmb
) temp2

View File

@ -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 = '业务组件')
<choose>
<!--<choose>
<when test="approveStatus != null and approveStatus != ''">
AND taa.approve_status = #{approveStatus}
</when>
<otherwise>
AND taa.approve_status != '不通过'
</otherwise>
</choose>
</choose> -->
<if test="approveStatus != null and approveStatus != ''">
AND taa.approve_status = #{approveStatus}
</if>
<if test="deptId != null and deptId != ''">
AND sd.id = #{deptId}
</if>