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
395e9e67
Commit
395e9e67
authored
Oct 30, 2024
by
陈健智
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
项目别名搜索调整
parent
8e8541cb
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
3 deletions
+14
-3
src/main/java/com/zhiwei/brandkbs2/controller/admin/ProjectController.java
+2
-0
src/main/java/com/zhiwei/brandkbs2/service/impl/ProjectServiceImpl.java
+12
-3
No files found.
src/main/java/com/zhiwei/brandkbs2/controller/admin/ProjectController.java
View file @
395e9e67
...
...
@@ -2,6 +2,7 @@ package com.zhiwei.brandkbs2.controller.admin;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.zhiwei.brandkbs2.aop.LogRecord
;
import
com.zhiwei.brandkbs2.auth.Auth
;
import
com.zhiwei.brandkbs2.auth.UserThreadLocal
;
import
com.zhiwei.brandkbs2.controller.BaseController
;
...
...
@@ -89,6 +90,7 @@ public class ProjectController extends BaseController {
@ApiOperation
(
"修改项目"
)
@PutMapping
(
"/update"
)
@LogRecord
(
values
=
"extraProjectName"
,
description
=
"修改项目-修改别名"
,
arguments
=
true
,
entity
=
true
)
public
ResponseResult
updateProject
(
@RequestBody
ProjectVO
projectVO
)
{
return
ProjectService
.
updateProject
(
projectVO
);
}
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/ProjectServiceImpl.java
View file @
395e9e67
...
...
@@ -145,7 +145,10 @@ public class ProjectServiceImpl implements ProjectService {
public
PageVO
<
JSONObject
>
findProjectList
(
int
page
,
int
size
,
String
keyword
)
{
Query
query
=
new
Query
();
query
.
addCriteria
(
Criteria
.
where
(
"isManual"
).
is
(
true
));
projectDao
.
addKeywordFuzz
(
query
,
keyword
,
"extraProjectName"
,
"projectName"
);
// projectDao.addKeywordFuzz(query, keyword, "extraProjectName", "projectName");
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
);
...
...
@@ -576,7 +579,10 @@ public class ProjectServiceImpl implements ProjectService {
public
PageVO
<
JSONObject
>
findNonManualProjectList
(
int
page
,
int
size
,
String
sorter
,
String
keyword
)
{
Query
query
=
new
Query
();
query
.
addCriteria
(
Criteria
.
where
(
"isManual"
).
is
(
false
));
projectDao
.
addKeywordFuzz
(
query
,
keyword
,
"extraProjectName"
,
"projectName"
);
// projectDao.addKeywordFuzz(query, keyword, "extraProjectName", "projectName");
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\"}"
);
...
...
@@ -665,7 +671,10 @@ public class ProjectServiceImpl implements ProjectService {
projectDao
.
addSort
(
query
,
"{\"_id\":\"asc\"}"
);
// 项目名关键词模糊
if
(
StringUtils
.
isNotBlank
(
keyword
)){
projectDao
.
addKeywordFuzz
(
query
,
keyword
,
"extraProjectName"
,
"projectName"
);
// projectDao.addKeywordFuzz(query, keyword, "extraProjectName", "projectName");
Criteria
extraProjectName
=
Criteria
.
where
(
"extraProjectName"
).
regex
(
keyword
,
"i"
);
Criteria
projectName
=
Criteria
.
where
(
"projectName"
).
regex
(
keyword
,
"i"
);
query
.
addCriteria
(
new
Criteria
().
orOperator
(
extraProjectName
,
projectName
));
}
// 用户拥有权限的项目
if
(
StringUtils
.
isNotBlank
(
userId
)
&&
!
userDao
.
findOneById
(
userId
).
isSuperAdmin
()){
...
...
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