Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
wyszyk
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
注册表
注册表
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
任建彩
wyszyk
Commits
d4a7fcb2
提交
d4a7fcb2
authored
9月 02, 2022
作者:
任建宇
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 检索
1.resource
上级
650c2c42
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
25 行增加
和
25 行删除
+25
-25
DiyTypeController.java
...m/zrqx/resource/controller/backend/DiyTypeController.java
+11
-11
DiyTypeController.java
.../zrqx/resource/controller/frontend/DiyTypeController.java
+5
-5
DiyType.java
...main/java/com/zrqx/resource/model/po/diytype/DiyType.java
+3
-3
DiyTypeVO.java
...in/java/com/zrqx/resource/model/vo/diytype/DiyTypeVO.java
+2
-2
FgDiyTypeListVo.java
...a/com/zrqx/resource/model/vo/diytype/FgDiyTypeListVo.java
+2
-2
FgDiyTypeVo.java
.../java/com/zrqx/resource/model/vo/diytype/FgDiyTypeVo.java
+2
-2
没有找到文件。
wyszyk-provider/wyszyk-provider-resource/src/main/java/com/zrqx/resource/controller/backend/DiyTypeController.java
浏览文件 @
d4a7fcb2
...
...
@@ -98,7 +98,7 @@ public class DiyTypeController {
entity
.
setCode
(
UUIDUtil
.
newCodeOfThree
(
code
));
}
else
{
//没有查询到子分类,获取父类code 拼接 001
if
(
entity
.
getParentId
()
!=
0
)
{
if
(
!
entity
.
getParentId
().
equals
(
"0"
)
)
{
entity
.
setCode
(
service
.
getById
(
entity
.
getParentId
()).
getCode
()
+
"001"
);
}
else
{
entity
.
setCode
(
"001"
);
...
...
@@ -180,7 +180,7 @@ public class DiyTypeController {
@GetMapping
(
value
=
"/{oid}"
)
public
CallBack
<
DiyType
>
getById
(
@PathVariable
Integer
oid
)
{
DiyType
diyType
=
service
.
getById
(
oid
);
if
(
diyType
.
getParentId
()
!=
0
)
{
if
(
!
diyType
.
getParentId
().
equals
(
"0"
)
)
{
DiyType
parentDiyType
=
service
.
getById
(
diyType
.
getParentId
());
diyType
.
setParentName
(
parentDiyType
.
getTypeName
());
}
...
...
@@ -267,7 +267,7 @@ public class DiyTypeController {
}
PageHelper
.
orderBy
(
"sort desc,createdTime desc"
);
List
<
DiyType
>
list
=
service
.
list
(
diyTypeLambdaQueryWrapper
);
List
<
DiyTypeVO
>
voList
=
Copy
.
copyList
(
list
,
DiyTypeVO
.
class
,
obj
->
obj
.
getParentId
().
intValue
()
==
0
);
List
<
DiyTypeVO
>
voList
=
Copy
.
copyList
(
list
,
DiyTypeVO
.
class
,
obj
->
obj
.
getParentId
().
equals
(
"0"
)
);
tree
(
list
,
voList
);
return
CallBack
.
success
(
voList
);
}
...
...
@@ -305,7 +305,7 @@ public class DiyTypeController {
PageHelper
.
orderBy
(
"sort desc,createdTime desc"
);
List
<
DiyType
>
list
=
service
.
list
(
diyTypeLambdaQueryWrapper
);
// 获取一级分类
List
<
DiyTypeVO
>
voList
=
Copy
.
copyList
(
list
,
DiyTypeVO
.
class
,
obj
->
name
.
equals
(
obj
.
getTypeName
())
&&
obj
.
getParentId
()
==
0
);
List
<
DiyTypeVO
>
voList
=
Copy
.
copyList
(
list
,
DiyTypeVO
.
class
,
obj
->
name
.
equals
(
obj
.
getTypeName
())
&&
obj
.
getParentId
()
.
equals
(
"0"
)
);
tree
(
list
,
voList
);
return
CallBack
.
success
(
convertAllToOne
(
voList
,
vos
));
...
...
@@ -314,7 +314,7 @@ public class DiyTypeController {
public
List
<
DiyTypeVO
>
tree
(
List
<
DiyType
>
list
,
List
<
DiyTypeVO
>
voList
)
{
voList
.
forEach
(
entity
->
{
//第一次设置 一级分类的子类 后续递归设置 子类的子类
entity
.
setList
(
Copy
.
copyList
(
list
,
DiyTypeVO
.
class
,
obj
->
obj
.
getParentId
().
intValue
()
==
entity
.
getId
().
intValue
(
)));
entity
.
setList
(
Copy
.
copyList
(
list
,
DiyTypeVO
.
class
,
obj
->
obj
.
getParentId
().
equals
(
entity
.
getId
()
)));
//当前分类存在子类 开始递归子类
if
(
entity
.
getList
().
size
()
>
0
)
{
tree
(
list
,
entity
.
getList
());
...
...
@@ -362,15 +362,15 @@ public class DiyTypeController {
List
<
DiyType
>
list
=
call
.
getData
();
List
<
DiyTypeVO
>
newTree
=
new
ArrayList
<>();
// 获取一级分类
List
<
DiyTypeVO
>
voList
=
Copy
.
copyList
(
list
,
DiyTypeVO
.
class
,
obj
->
search
.
equals
(
obj
.
getTypeName
())
&&
obj
.
getParentId
()
!=
0
);
List
<
DiyTypeVO
>
voList
=
Copy
.
copyList
(
list
,
DiyTypeVO
.
class
,
obj
->
search
.
equals
(
obj
.
getTypeName
())
&&
!
obj
.
getParentId
().
equals
(
"0"
)
);
if
(!
voList
.
isEmpty
())
{
Integer
id
=
voList
.
get
(
0
).
getParentId
();
String
id
=
voList
.
get
(
0
).
getParentId
();
List
<
DiyType
>
diyList
=
new
ArrayList
<>();
do
{
DiyType
diyType
=
service
.
getById
(
id
);
id
=
diyType
.
getParentId
();
diyList
.
add
(
diyType
);
}
while
(
id
!=
0
);
}
while
(
!
id
.
equals
(
"0"
)
);
List
<
DiyTypeVO
>
fathor
=
getDiyTypeVO
(
diyList
);
List
<
DiyTypeVO
>
child
=
tree
(
list
,
voList
);
newTree
=
connect
(
fathor
,
child
);
...
...
@@ -389,7 +389,7 @@ public class DiyTypeController {
}
public
List
<
DiyTypeVO
>
getDiyTypeVO
(
List
<
DiyType
>
list
)
{
List
<
DiyTypeVO
>
voList
=
Copy
.
copyList
(
list
,
DiyTypeVO
.
class
,
obj
->
obj
.
getParentId
()
==
0
);
List
<
DiyTypeVO
>
voList
=
Copy
.
copyList
(
list
,
DiyTypeVO
.
class
,
obj
->
obj
.
getParentId
()
.
equals
(
"0"
)
);
tree
(
list
,
voList
);
return
voList
;
}
...
...
@@ -464,7 +464,7 @@ public class DiyTypeController {
}
}
list
.
forEach
(
f
->
{
if
(
f
.
getParentId
()
!=
0
)
{
if
(
!
f
.
getParentId
().
equals
(
"0"
)
)
{
DiyType
parentDiyType
=
service
.
getById
(
f
.
getParentId
());
if
(
parentDiyType
!=
null
)
{
f
.
setParentName
(
parentDiyType
.
getTypeName
());
...
...
@@ -473,7 +473,7 @@ public class DiyTypeController {
});
// 获取一级分类
List
<
DiyTypeVO
>
voList
=
Copy
.
copyList
(
list
,
DiyTypeVO
.
class
,
obj
->
form
.
getName
().
equals
(
obj
.
getTypeName
())
&&
obj
.
getParentId
()
==
0
);
List
<
DiyTypeVO
>
voList
=
Copy
.
copyList
(
list
,
DiyTypeVO
.
class
,
obj
->
form
.
getName
().
equals
(
obj
.
getTypeName
())
&&
obj
.
getParentId
()
.
equals
(
"0"
)
);
tree
(
list
,
voList
);
voList
.
forEach
(
f
->
f
.
getList
().
forEach
(
ff
->
{
Integer
resourceNum
=
service
.
selectResourceNum
(
ff
.
getCode
());
...
...
wyszyk-provider/wyszyk-provider-resource/src/main/java/com/zrqx/resource/controller/frontend/DiyTypeController.java
浏览文件 @
d4a7fcb2
...
...
@@ -102,7 +102,7 @@ public class DiyTypeController {
//PageHelper.orderBy("sort desc,createdTime desc");
PageHelper
.
orderBy
(
"sort asc"
);
List
<
DiyType
>
list
=
service
.
list
(
diyTypeLambdaQueryWrapper
);
List
<
DiyTypeVO
>
voList
=
Copy
.
copyList
(
list
,
DiyTypeVO
.
class
,
obj
->
obj
.
getParentId
()
==
0
);
List
<
DiyTypeVO
>
voList
=
Copy
.
copyList
(
list
,
DiyTypeVO
.
class
,
obj
->
obj
.
getParentId
()
.
equals
(
"0"
)
);
tree
(
list
,
voList
);
return
CallBack
.
success
(
voList
);
}
...
...
@@ -120,7 +120,7 @@ public class DiyTypeController {
PageHelper
.
orderBy
(
"sort asc"
);
List
<
DiyType
>
list
=
service
.
list
(
diyTypeLambdaQueryWrapper
);
list
.
forEach
(
f
->
{
if
(
f
.
getParentId
()
!=
0
)
{
if
(
!
f
.
getParentId
().
equals
(
"0"
)
)
{
DiyType
parentDiyType
=
service
.
getById
(
f
.
getParentId
());
if
(
parentDiyType
!=
null
)
{
f
.
setParentName
(
parentDiyType
.
getTypeName
());
...
...
@@ -128,7 +128,7 @@ public class DiyTypeController {
}
});
// 获取一级分类
List
<
DiyTypeVO
>
voList
=
Copy
.
copyList
(
list
,
DiyTypeVO
.
class
,
obj
->
name
.
equals
(
obj
.
getTypeName
())
&&
obj
.
getParentId
()
==
0
);
List
<
DiyTypeVO
>
voList
=
Copy
.
copyList
(
list
,
DiyTypeVO
.
class
,
obj
->
name
.
equals
(
obj
.
getTypeName
())
&&
obj
.
getParentId
()
.
equals
(
"0"
)
);
tree
(
list
,
voList
);
voList
.
forEach
(
f
->
f
.
getList
().
forEach
(
ff
->
{
Integer
resourceNum
=
service
.
selectResourceNum
(
ff
.
getCode
());
...
...
@@ -182,7 +182,7 @@ public class DiyTypeController {
public
List
<
DiyTypeVO
>
tree
(
List
<
DiyType
>
list
,
List
<
DiyTypeVO
>
voList
)
{
voList
.
forEach
(
entity
->
{
//第一次设置 一级分类的子类 后续递归设置 子类的子类
entity
.
setList
(
Copy
.
copyList
(
list
,
DiyTypeVO
.
class
,
obj
->
obj
.
getParentId
().
intValue
()
==
entity
.
getId
().
intValue
(
)));
entity
.
setList
(
Copy
.
copyList
(
list
,
DiyTypeVO
.
class
,
obj
->
obj
.
getParentId
().
equals
(
entity
.
getId
()
)));
Integer
resourceNum
=
service
.
selectResourceNum
(
entity
.
getCode
());
entity
.
setResourceNum
(
resourceNum
);
//当前分类存在子类 开始递归子类
...
...
@@ -218,7 +218,7 @@ public class DiyTypeController {
List
<
String
>
codes
=
facet
.
getValues
().
stream
().
map
(
FacetField
.
Count
::
getName
).
collect
(
Collectors
.
toList
());
// 保证一级分类始终显示(无论是否有数据)
oldVos
.
stream
().
forEach
(
oldVo
->
{
if
(
oldVo
.
getParentId
()
==
0
){
if
(
oldVo
.
getParentId
()
.
equals
(
"0"
)
){
codes
.
add
(
oldVo
.
getCode
());
}
});
...
...
wyszyk-provider/wyszyk-provider-resource/src/main/java/com/zrqx/resource/model/po/diytype/DiyType.java
浏览文件 @
d4a7fcb2
...
...
@@ -16,15 +16,15 @@ import java.util.Date;
@TableName
(
"res_diy_type"
)
public
class
DiyType
{
@TableId
(
value
=
"id"
,
type
=
IdType
.
A
UTO
)
@TableId
(
value
=
"id"
,
type
=
IdType
.
A
SSIGN_UUID
)
@ApiModelProperty
(
"自定义分类id,新增时不需要填写"
)
private
Integer
id
;
private
String
id
;
@ApiModelProperty
(
value
=
"自定义分类名称"
,
required
=
true
)
private
String
typeName
;
@ApiModelProperty
(
value
=
"显示名称"
,
required
=
true
)
private
String
showName
;
@ApiModelProperty
(
value
=
"父类id"
,
required
=
true
)
private
Integer
parentId
;
private
String
parentId
;
@ApiModelProperty
(
value
=
"排序号"
)
private
Integer
sort
;
@ApiModelProperty
(
value
=
"分类编号"
,
required
=
true
)
...
...
wyszyk-provider/wyszyk-provider-resource/src/main/java/com/zrqx/resource/model/vo/diytype/DiyTypeVO.java
浏览文件 @
d4a7fcb2
...
...
@@ -10,9 +10,9 @@ import java.util.List;
@Data
public
class
DiyTypeVO
{
@ApiModelProperty
(
"自定义分类id"
)
private
Integer
id
;
private
String
id
;
@ApiModelProperty
(
value
=
"父类id"
)
private
Integer
parentId
;
private
String
parentId
;
@ApiModelProperty
(
value
=
"排序号"
)
private
Integer
sort
;
@ApiModelProperty
(
value
=
"自定义分类名称"
)
...
...
wyszyk-provider/wyszyk-provider-resource/src/main/java/com/zrqx/resource/model/vo/diytype/FgDiyTypeListVo.java
浏览文件 @
d4a7fcb2
...
...
@@ -9,9 +9,9 @@ import java.util.List;
@Data
public
class
FgDiyTypeListVo
{
@ApiModelProperty
(
"自定义分类id"
)
private
Integer
id
;
private
String
id
;
@ApiModelProperty
(
value
=
"父类id"
)
private
Integer
parentId
;
private
String
parentId
;
@ApiModelProperty
(
value
=
"排序号"
)
private
Integer
sort
;
@ApiModelProperty
(
value
=
"显示名称"
)
...
...
wyszyk-provider/wyszyk-provider-resource/src/main/java/com/zrqx/resource/model/vo/diytype/FgDiyTypeVo.java
浏览文件 @
d4a7fcb2
...
...
@@ -12,9 +12,9 @@ import java.util.List;
public
class
FgDiyTypeVo
{
@ApiModelProperty
(
"自定义分类id"
)
private
Integer
id
;
private
String
id
;
@ApiModelProperty
(
value
=
"父类id"
)
private
Integer
parentId
;
private
String
parentId
;
@ApiModelProperty
(
value
=
"排序号"
)
private
Integer
sort
;
@ApiModelProperty
(
value
=
"自定义分类名称"
,
required
=
true
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论