parent
b45316d33b
commit
c583280b35
|
@ -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 '资源名称';
|
|
@ -26,5 +26,9 @@ public class TbFuseResourceDTO {
|
||||||
private Object resource;
|
private Object resource;
|
||||||
@ApiModelProperty(value = "资源类型")
|
@ApiModelProperty(value = "资源类型")
|
||||||
private String type;
|
private String type;
|
||||||
|
@ApiModelProperty(value = "部门名称")
|
||||||
|
private String deptName;
|
||||||
|
@ApiModelProperty(value = "资源名称")
|
||||||
|
private String resourceName;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package io.renren.modules.fuse.entity;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
@ -36,4 +37,7 @@ public class TbFuseResourceEntity {
|
||||||
* 资源类型
|
* 资源类型
|
||||||
*/
|
*/
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
|
private String deptName;
|
||||||
|
private String resourceName;
|
||||||
}
|
}
|
||||||
|
|
|
@ -208,7 +208,6 @@ public class TbFuseServiceImpl extends CrudServiceImpl<TbFuseDao, TbFuseEntity,
|
||||||
Thread.sleep(300); // 防止任务运行过快,无法跳出循环
|
Thread.sleep(300); // 防止任务运行过快,无法跳出循环
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
logger.info("获取数据资源异常", e);
|
logger.info("获取数据资源异常", e);
|
||||||
end.set(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} while (end.get());
|
} while (end.get());
|
||||||
|
@ -223,9 +222,9 @@ public class TbFuseServiceImpl extends CrudServiceImpl<TbFuseDao, TbFuseEntity,
|
||||||
wrapper.eq("fuse_id", fuseId);
|
wrapper.eq("fuse_id", fuseId);
|
||||||
List<TbFuseResourceEntity> list = fuseResourceDao.selectList(wrapper);
|
List<TbFuseResourceEntity> list = fuseResourceDao.selectList(wrapper);
|
||||||
Map<String, List<TbFuseResourceEntity>> resourceMap = list.stream().filter(index -> index.getType() != null).collect(Collectors.groupingBy(TbFuseResourceEntity::getType));
|
Map<String, List<TbFuseResourceEntity>> resourceMap = list.stream().filter(index -> index.getType() != null).collect(Collectors.groupingBy(TbFuseResourceEntity::getType));
|
||||||
if (resourceMap.containsKey("数据资源")) {
|
//if (resourceMap.containsKey("数据资源")) {
|
||||||
dataResourceMap.putAll(getDataResource());
|
// dataResourceMap.putAll(getDataResource());
|
||||||
}
|
//}
|
||||||
resourceMap.forEach((type, value) -> {
|
resourceMap.forEach((type, value) -> {
|
||||||
if ("组件服务".equals(type)) {
|
if ("组件服务".equals(type)) {
|
||||||
result.addAll(value.stream().map(attr -> {
|
result.addAll(value.stream().map(attr -> {
|
||||||
|
@ -243,7 +242,12 @@ public class TbFuseServiceImpl extends CrudServiceImpl<TbFuseDao, TbFuseEntity,
|
||||||
result.addAll(value.stream().map(attr -> {
|
result.addAll(value.stream().map(attr -> {
|
||||||
TbFuseResourceDTO dto = new TbFuseResourceDTO();
|
TbFuseResourceDTO dto = new TbFuseResourceDTO();
|
||||||
BeanUtils.copyProperties(attr, dto);
|
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;
|
return dto;
|
||||||
}).collect(Collectors.toList()));
|
}).collect(Collectors.toList()));
|
||||||
} else if ("基础设施".equals(type)) {
|
} else if ("基础设施".equals(type)) {
|
||||||
|
|
|
@ -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 '资源名称';
|
|
@ -4,10 +4,10 @@
|
||||||
<mapper namespace="io.renren.modules.fuse.dao.TbFuseResourceDao">
|
<mapper namespace="io.renren.modules.fuse.dao.TbFuseResourceDao">
|
||||||
|
|
||||||
<insert id="insertBatch">
|
<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
|
values
|
||||||
<foreach collection="list" item="item" separator=",">
|
<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>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
|
|
@ -122,8 +122,9 @@
|
||||||
|
|
||||||
UNION
|
UNION
|
||||||
SELECT
|
SELECT
|
||||||
'会议室' AS 'type',
|
|
||||||
COUNT( id ) AS 'amount'
|
COUNT( id ) AS 'amount',
|
||||||
|
'会议室' AS 'type'
|
||||||
FROM
|
FROM
|
||||||
t_meetingroom_book tmb
|
t_meetingroom_book tmb
|
||||||
) temp2
|
) temp2
|
||||||
|
|
|
@ -1738,14 +1738,17 @@
|
||||||
AND taa.resource_id = tdr.id
|
AND taa.resource_id = tdr.id
|
||||||
AND (tdr.type = '应用资源' OR tdr.type = '智能算法' OR tdr.type = '图层服务' OR tdr.type = '开发组件' OR
|
AND (tdr.type = '应用资源' OR tdr.type = '智能算法' OR tdr.type = '图层服务' OR tdr.type = '开发组件' OR
|
||||||
tdr.type = '业务组件')
|
tdr.type = '业务组件')
|
||||||
<choose>
|
<!--<choose>
|
||||||
<when test="approveStatus != null and approveStatus != ''">
|
<when test="approveStatus != null and approveStatus != ''">
|
||||||
AND taa.approve_status = #{approveStatus}
|
AND taa.approve_status = #{approveStatus}
|
||||||
</when>
|
</when>
|
||||||
<otherwise>
|
<otherwise>
|
||||||
AND taa.approve_status != '不通过'
|
AND taa.approve_status != '不通过'
|
||||||
</otherwise>
|
</otherwise>
|
||||||
</choose>
|
</choose> -->
|
||||||
|
<if test="approveStatus != null and approveStatus != ''">
|
||||||
|
AND taa.approve_status = #{approveStatus}
|
||||||
|
</if>
|
||||||
<if test="deptId != null and deptId != ''">
|
<if test="deptId != null and deptId != ''">
|
||||||
AND sd.id = #{deptId}
|
AND sd.id = #{deptId}
|
||||||
</if>
|
</if>
|
||||||
|
|
Loading…
Reference in New Issue