Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
brandkbs2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shenjunjie
brandkbs2
Commits
b3219858
Commit
b3219858
authored
Nov 19, 2024
by
陈健智
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
后台项目列表增加项目状态筛选
parent
ff6cbcc5
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
10 deletions
+26
-10
src/main/java/com/zhiwei/brandkbs2/controller/admin/ProjectController.java
+8
-4
src/main/java/com/zhiwei/brandkbs2/service/ProjectService.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/service/impl/ProjectServiceImpl.java
+16
-4
No files found.
src/main/java/com/zhiwei/brandkbs2/controller/admin/ProjectController.java
View file @
b3219858
...
...
@@ -83,8 +83,11 @@ public class ProjectController extends BaseController {
@ApiImplicitParam
(
name
=
"size"
,
value
=
"每页记录数"
,
required
=
false
,
defaultValue
=
"10"
,
paramType
=
"query"
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"keyword"
,
value
=
"搜索关键字"
,
required
=
false
,
defaultValue
=
""
,
paramType
=
"query"
,
dataType
=
"string"
)})
@GetMapping
(
"/list"
)
public
ResponseResult
findProjectList
(
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
int
page
,
@RequestParam
(
value
=
"size"
,
defaultValue
=
"10"
)
int
size
,
@RequestParam
(
value
=
"keyword"
,
defaultValue
=
""
)
String
keyword
)
{
return
ResponseResult
.
success
(
ProjectService
.
findProjectList
(
page
,
size
,
keyword
));
public
ResponseResult
findProjectList
(
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
int
page
,
@RequestParam
(
value
=
"size"
,
defaultValue
=
"10"
)
int
size
,
@RequestParam
(
value
=
"keyword"
,
defaultValue
=
""
)
String
keyword
,
@RequestParam
(
value
=
"isStart"
,
required
=
false
)
Boolean
isStart
)
{
return
ResponseResult
.
success
(
ProjectService
.
findProjectList
(
page
,
size
,
keyword
,
isStart
));
}
...
...
@@ -286,8 +289,9 @@ public class ProjectController extends BaseController {
public
ResponseResult
findNonManualProjectList
(
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
int
page
,
@RequestParam
(
value
=
"size"
,
defaultValue
=
"10"
)
int
size
,
@RequestParam
(
value
=
"sorter"
,
defaultValue
=
"{\"cTime\":\"descend\"}"
)
String
sorter
,
@RequestParam
(
value
=
"keyword"
,
defaultValue
=
""
)
String
keyword
)
{
return
ResponseResult
.
success
(
ProjectService
.
findNonManualProjectList
(
page
,
size
,
sorter
,
keyword
));
@RequestParam
(
value
=
"keyword"
,
defaultValue
=
""
)
String
keyword
,
@RequestParam
(
value
=
"isStart"
,
required
=
false
)
Boolean
isStart
)
{
return
ResponseResult
.
success
(
ProjectService
.
findNonManualProjectList
(
page
,
size
,
sorter
,
keyword
,
isStart
));
}
@ApiOperation
(
"非人工项目-维护记录列表"
)
...
...
src/main/java/com/zhiwei/brandkbs2/service/ProjectService.java
View file @
b3219858
...
...
@@ -32,7 +32,7 @@ public interface ProjectService {
* @param keyword 关键字
* @return 项目列表
*/
PageVO
<
JSONObject
>
findProjectList
(
int
page
,
int
size
,
String
keyword
);
PageVO
<
JSONObject
>
findProjectList
(
int
page
,
int
size
,
String
keyword
,
Boolean
isStart
);
/**
* 根据项目ID获取该项目信息
...
...
@@ -171,7 +171,7 @@ public interface ProjectService {
* @param keyword 关键词
* @return
*/
PageVO
<
JSONObject
>
findNonManualProjectList
(
int
page
,
int
size
,
String
sorter
,
String
keyword
);
PageVO
<
JSONObject
>
findNonManualProjectList
(
int
page
,
int
size
,
String
sorter
,
String
keyword
,
Boolean
isStart
);
/**
* 非人工项目剩余数据量调整记录列表
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/ProjectServiceImpl.java
View file @
b3219858
...
...
@@ -143,13 +143,19 @@ public class ProjectServiceImpl implements ProjectService {
}
@Override
public
PageVO
<
JSONObject
>
findProjectList
(
int
page
,
int
size
,
String
keyword
)
{
public
PageVO
<
JSONObject
>
findProjectList
(
int
page
,
int
size
,
String
keyword
,
Boolean
isStart
)
{
Query
query
=
new
Query
();
// 人工项目
query
.
addCriteria
(
Criteria
.
where
(
"isManual"
).
is
(
true
));
// projectDao.addKeywordFuzz(query, keyword, "extraProjectName", "projectName");
// 状态
if
(
Objects
.
nonNull
(
isStart
)){
query
.
addCriteria
(
Criteria
.
where
(
"isStart"
).
is
(
isStart
));
}
if
(
StringUtils
.
isNotBlank
(
keyword
))
{
Criteria
extraProjectName
=
Criteria
.
where
(
"extraProjectName"
).
regex
(
keyword
,
"i"
);
Criteria
projectName
=
Criteria
.
where
(
"projectName"
).
regex
(
keyword
,
"i"
);
query
.
addCriteria
(
new
Criteria
().
orOperator
(
extraProjectName
,
projectName
));
}
long
count
=
projectDao
.
count
(
query
);
projectDao
.
addSort
(
query
,
"{\"cTime\":\"descend\"}"
);
mongoUtil
.
start
(
page
,
size
,
query
);
...
...
@@ -577,13 +583,19 @@ public class ProjectServiceImpl implements ProjectService {
}
@Override
public
PageVO
<
JSONObject
>
findNonManualProjectList
(
int
page
,
int
size
,
String
sorter
,
String
keyword
)
{
public
PageVO
<
JSONObject
>
findNonManualProjectList
(
int
page
,
int
size
,
String
sorter
,
String
keyword
,
Boolean
isStart
)
{
Query
query
=
new
Query
();
// 人工项目
query
.
addCriteria
(
Criteria
.
where
(
"isManual"
).
is
(
false
));
// projectDao.addKeywordFuzz(query, keyword, "extraProjectName", "projectName");
// 状态
if
(
Objects
.
nonNull
(
isStart
)){
query
.
addCriteria
(
Criteria
.
where
(
"isStart"
).
is
(
isStart
));
}
if
(
StringUtils
.
isNotBlank
(
keyword
))
{
Criteria
extraProjectName
=
Criteria
.
where
(
"extraProjectName"
).
regex
(
keyword
,
"i"
);
Criteria
projectName
=
Criteria
.
where
(
"projectName"
).
regex
(
keyword
,
"i"
);
query
.
addCriteria
(
new
Criteria
().
orOperator
(
extraProjectName
,
projectName
));
}
long
count
=
projectDao
.
count
(
query
);
if
(
Objects
.
isNull
(
sorter
)
||
Objects
.
isNull
(
JSONObject
.
parseObject
(
sorter
))
||
JSONObject
.
parseObject
(
sorter
).
isEmpty
()){
projectDao
.
addSort
(
query
,
"{\"cTime\":\"descend\"}"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment